dsh-code-server-app 0.3.49 → 0.3.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -464,6 +464,7 @@ pnpm test:launcher-routes # launcher 的 HTTP 面(起真进程,较慢)
464
464
  pnpm test:workspace-switch # 切工作区不重启进程
465
465
  pnpm test:workspace-cwd # "当前工作区目录"解析:DSH 0.1.6-alpha.2(sessionId)与旧版(current)两套形状
466
466
  pnpm test:client-cwd # 同一件事但直接对**构建产物** lib/client.js 验(注册出来的 body 真发不发 cwd、URL 带不带 folder;先跑 build:client)
467
+ pnpm test:client-seat # 设置卡住哪个座位:插件页 plugins.bundle.config(DSH ≥ 0.1.6-alpha.2)vs settings.plugin.item(≤ alpha.1;新版已退役)
467
468
  pnpm test:fullscreen # 打开标签即全屏
468
469
  pnpm test:vendored # 重打包表 ↔ 插件依赖表一致(无 npm: 别名 / 无聚合包 / vendored.json 进了 files)
469
470
  pnpm test:dsh-resolve # 部署位置表:各平台全局装布局(npm --prefix / nvm / pnpm global / %APPDATA%)都能找到 DSH 部署
@@ -864,9 +865,19 @@ host 探测顺序:`@jinsiyu/dshcs-vscode-server/vscode`(**0.2.0+ 正式布局**)
864
865
  插件包内 `vendor/vscode` > 插件包内 `vendor/code-server`(开发期)。旧安装根
865
866
  `<profile>\.code-server-app` 只在启动日志里提示可删除,不再被使用。
866
867
 
867
- ## 设置卡片(设置 → 插件 → Code Server)
868
+ ## 设置卡片(0.3.50 起:插件页;更早:设置 → 插件 → Code Server)
869
+
870
+ **位置随 DSH 版本而变**(两条腿都注册,谁被声明谁生效,不会出现两份):
871
+
872
+ | DSH | 座位 | 长什么样 |
873
+ |---|---|---|
874
+ | **≥ 0.1.6-alpha.2** | `plugins.bundle.config`,**键 = 包名** `dsh-code-server-app` | 插件页 → 找到 `dsh-code-server-app` → 打开该插件页面,设置区在**描述与各行之间**(页面自己画标题/图标/面包屑,我们只出表单 + 保存控件) |
875
+ | ≤ 0.1.6-alpha.1 | `settings.plugin.item`(key `code-server`) | 设置 → 插件 → Code Server 的自绘可折叠卡片(该插槽在新版**已退役**) |
876
+
877
+ > 为什么必须跟着搬:上游 agent note《插件页上的插件配置》把配置从设置页搬到插件页,并**删掉了
878
+ > `settings.plugin.item`**;插件页只在 `ledger.bundles.has(包名)` 时才渲染那块区域 —— 键写错或还用旧座位,
879
+ > 表现是**设置卡静默消失**(无报错、无日志)。回归:`pnpm test:client-seat`(对构建产物验两个座位与两种视图)。
868
880
 
869
- 参照 dsh-auto-open-web 的自绘卡片模式,注册在 `settings.plugin.item` 插槽,
870
881
  数据经官方 settings 域(`settingsScope`,命名空间 `code-server`)持久化到官方 settings 文档:
871
882
 
872
883
  | 键 | 默认 | 说明 |
@@ -12,7 +12,7 @@
12
12
  | react | 18.3.1 | MIT |
13
13
  | react-dom | 18.3.1 | MIT |
14
14
 
15
- 生成时间:2026-09-17T16:48:16.348Z
15
+ 生成时间:2026-09-18T11:01:15.067Z
16
16
  渲染器:@deepseek-ai/dsh-client-ui-primitives@0.1.6-alpha.1(DSH 部署的界面版本:未知)
17
17
  设计令牌:@deepseek-ai/dsh-client-ui-theme@0.1.6-alpha.1(11 段)
18
18
  KaTeX:已打包(公式排版与 DSH 界面一致)
package/lib/client.js CHANGED
@@ -1,5 +1,5 @@
1
1
  window.__ModuleLoader__.load({id:'dsh-code-server-app',factory:function(require){var module={exports:{}};var exports=module.exports;
2
- var G=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var ze=(e,r)=>{for(var n in r)G(e,n,{get:r[n],enumerable:!0})},Pe=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of je(r))!De.call(e,a)&&a!==n&&G(e,a,{get:()=>r[a],enumerable:!(t=Ie(r,a))||t.enumerable});return e};var _e=e=>Pe(G({},"__esModule",{value:!0}),e);var jr={};ze(jr,{apply:()=>Tr,inject:()=>Rr,name:()=>Ir});module.exports=_e(jr);var ae="dsh-resource://file/",He="sidebar://";function Y(e){return typeof e=="string"&&e.startsWith(He)}function _(e){if(typeof e!="string"||!e.startsWith(ae))return null;for(var r=e.length,n=0;n<e.length;n+=1){var t=e.charAt(n);if(t==="?"||t==="#"){r=n;break}}var a=e.slice(ae.length,r).split("/"),l=a.shift();try{if(l==="session"){var o=a.shift();return o===void 0||o===""||a.length===0?null:{scope:"session",sessionId:decodeURIComponent(o),path:se(a)}}if(l==="absolute"){var d=a[0]===""&&a.length>1,p=d?a.slice(1):a,f=se(p);return(f===""||f.charAt(0)==="/")&&!d?null:d?{scope:"absolute",path:"//"+f}:f===""?null:{scope:"absolute",path:ie(f)?f:"/"+f}}}catch(x){return null}return null}function se(e){for(var r=[],n=0;n<e.length;n+=1)r.push(decodeURIComponent(e[n]));return r.join("/")}function ie(e){return/^[A-Za-z]:($|\/)/.test(e)}function Ue(e){return typeof e!="string"||e===""?!1:e.charAt(0)==="/"?!0:ie(e)}function le(e){var r=_(e);if(r===null)return"";var n=r.path.replace(/[/\\]+$/,""),t=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\")),a=t===-1?n:n.slice(t+1);return a}function oe(e,r){if(e===null||e==null)return null;var n=typeof e.path=="string"?e.path:"";if(n==="")return null;if(Ue(n))return n;if(typeof r!="string"||r==="")return null;var t=r.indexOf("\\")!==-1?"\\":"/",a=r.replace(/[\\/]+$/,"");return a+t+(t==="\\"?n.replace(/\//g,"\\"):n)}var M="*;!md;!markdown;!html;!htm;!png;!jpg;!jpeg;!gif;!webp;!bmp;!ico;!svg;!pdf",Be=/[;,\s]+/;function Fe(e){return String(e).replace(/!\s+/g,"!").split(Be)}function We(e){var r=typeof e=="string"?e.trim():"";if(r==="")return"";var n=r.charAt(0)==="!",t=n?r.slice(1).trim():r;return t==="*"?n?"!*":"*":(t.slice(0,2)==="*."?t=t.slice(2):t.charAt(0)==="."&&(t=t.slice(1)),t=t.toLowerCase(),t===""?"":n?"!"+t:t)}function A(e){if(typeof e!="string")return"";for(var r=Fe(e),n=[],t=0;t<r.length;t+=1){var a=We(r[t]);a===""||a==="!*"||n.indexOf(a)===-1&&n.push(a)}return n.join(";")}function H(e){for(var r=A(e),n=r===""?[]:r.split(";"),t=!1,a=[],l=[],o=0;o<n.length;o+=1){var d=n[o];if(d==="*"){t=!0;continue}d.charAt(0)==="!"?l.push(d.slice(1)):a.push(d)}return{all:t,allow:a,deny:l}}function Ge(e){if(typeof e!="string"||e==="")return"";var r=e.replace(/[/\\]+$/,""),n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\"));n!==-1&&(r=r.slice(n+1));var t=r.lastIndexOf(".");return t<=0?"":r.slice(t+1).toLowerCase()}function Ye(e,r){if(r==null)return!1;var n=Ge(e);return n!==""&&r.deny.indexOf(n)!==-1?!1:n!==""&&r.allow.indexOf(n)!==-1?!0:r.all===!0}function de(e,r){return e===null||e==null?!1:Ye(e.path,r)}function ce(e){var r=H(e),n=[];return r.all&&n.push("\u5176\u4F59\u7C7B\u578B\u5168\u90E8\u8BA4\u9886"),r.allow.length>0&&n.push("\u6307\u5B9A\u8BA4\u9886 "+r.allow.length+" \u9879"),r.deny.length>0&&n.push("\u6392\u9664 "+r.deny.length+" \u9879"),n.length===0?"\u4E0D\u8BA4\u9886\u4EFB\u4F55\u6587\u4EF6(\u53EA\u6709\u9875\u9762\u6807\u7B7E)":n.join(" \xB7 ")}var Qe="[data-sidebar-right-panel]",Je='[data-sidebar-right-mode="fullscreen"]';function ue(e){if(e==null||typeof e.closest!="function")return"no-root";var r,n;try{if(r=e.closest(Qe),r==null||typeof r.querySelector!="function")return"no-panel";n=r.querySelector(Je)}catch(t){return"lookup-failed"}if(n==null||typeof n.click!="function")return"no-control";try{n.click()}catch(t){return"click-failed"}return"clicked"}function fe(e,r){if(!(e==null||e.byId==null)&&!(typeof r!="string"||r==="")){var n=e.byId[r];if(n!=null)return typeof n.cwd=="string"&&n.cwd!==""?n.cwd:void 0}}function Q(e,r){if(!(e==null||!Array.isArray(e.items))&&!(typeof r!="string"||r===""))for(var n=0;n<e.items.length;n+=1){var t=e.items[n];if(!(t==null||!Array.isArray(t.sessionIds))&&t.sessionIds.indexOf(r)!==-1&&typeof t.path=="string"&&t.path!=="")return t.path}}function J(e){var r=e==null?{}:e,n=r.sessions==null?null:r.sessions,t=r.workspaces==null?null:r.workspaces,a=typeof r.sessionId=="string"&&r.sessionId!==""?r.sessionId:void 0,l=fe(n,a);if(l!==void 0)return l;var o=n==null?void 0:n.current,d=fe(n,o);if(d!==void 0)return d;var p=Q(t,a);if(p!==void 0)return p;var f=Q(t,typeof o=="string"?o:void 0);if(f!==void 0)return f;var x=n!=null&&Array.isArray(n.ids)?n.ids[0]:void 0,v=Q(t,typeof x=="string"?x:void 0);if(v!==void 0)return v;if(t!=null&&Array.isArray(t.items)&&t.recentWorkspaceId!==void 0)for(var w=0;w<t.items.length;w+=1){var c=t.items[w];if(!(c==null||c.workspaceId!==t.recentWorkspaceId)&&typeof c.path=="string"&&c.path!=="")return c.path}if(t!=null&&Array.isArray(t.items)&&t.items.length>0){var m=t.items[0];if(m!=null&&typeof m.path=="string"&&m.path!=="")return m.path}}var R=typeof Element!="undefined"&&typeof Element.prototype.moveBefore=="function",Ze=-2e4,s={park:null,frame:null,currentSrc:null,sameOrigin:null,owner:null,lastRect:null,parkStrategy:"offscreen",degraded:!1,preloaded:!1,nudgeCount:0,nudgeEnabled:!0,lastNudgeAt:0,listeners:new Set};function Z(){return{ready:s.frame!==null,docked:s.owner!==null,owner:s.owner,src:s.currentSrc,sameOrigin:s.sameOrigin,parkStrategy:s.parkStrategy,degraded:s.degraded,preloaded:s.preloaded,supportsMoveBefore:R,nudgeCount:s.nudgeCount,lastNudgeAt:s.lastNudgeAt}}function I(){var e=Z();s.listeners.forEach(function(r){try{r(e)}catch(n){}})}function pe(e){return s.listeners.add(e),function(){s.listeners.delete(e)}}function ve(){return Z()}function Xe(e){e!=="offscreen"&&e!=="behind"||s.parkStrategy!==e&&(s.parkStrategy=e,s.frame!==null&&s.owner===null&&X(),I())}function Ke(){return s.parkStrategy}function Ve(){var e=s.lastRect;e!==null&&(s.park.style.width=Math.max(1,Math.round(e.width))+"px",s.park.style.height=Math.max(1,Math.round(e.height))+"px")}function X(){if(s.park!==null){if(Ve(),s.parkStrategy==="behind"&&s.lastRect!==null){s.park.style.left=Math.round(s.lastRect.left)+"px",s.park.style.top=Math.round(s.lastRect.top)+"px",s.park.style.visibility="visible",s.park.style.zIndex="0";return}s.park.style.left=Ze+"px",s.park.style.top="0px",s.park.style.visibility="hidden",s.park.style.zIndex="0"}}function he(){s.frame!==null&&(s.frame.setAttribute("inert",""),s.frame.setAttribute("aria-hidden","true"))}function qe(){s.frame!==null&&(s.frame.removeAttribute("inert"),s.frame.removeAttribute("aria-hidden"))}function $e(){var e=document.createElement("div");e.className="dshcs-park",e.setAttribute("data-dshcs-park",""),e.setAttribute("aria-hidden","true");var r=document.createElement("iframe");return r.className="dshcs-frame",r.setAttribute("title","code-server"),r.setAttribute("allow","clipboard-read; clipboard-write"),r.setAttribute("data-dshcs-resident",""),r.src="about:blank",e.appendChild(r),document.body.appendChild(e),s.park=e,s.frame=r,s.currentSrc="about:blank",s.owner=null,X(),he(),r}function er(e){var r=s.frame;if(r!==null){var n=s.sameOrigin!==e;!n&&r.hasAttribute("data-dshcs-attrs")||(e===!0?r.removeAttribute("sandbox"):e===!1&&r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write"),r.setAttribute("data-dshcs-attrs",e===!0?"same-origin":"cross-origin"),s.sameOrigin=e)}}function K(e){var r=e||{};return s.frame===null&&$e(),typeof r.sameOrigin=="boolean"&&er(r.sameOrigin),typeof r.src=="string"&&r.src!==""&&r.src!==s.currentSrc&&rr(r.src),s.frame}function rr(e){s.frame===null||typeof e!="string"||e===""||e===s.currentSrc||(s.currentSrc=e,s.frame.src=e,I())}function me(){var e=s.frame;if(s.nudgeEnabled!==!0||e===null||e.isConnected!==!0)return!1;var r=e.style.display;return e.style.display="none",e.offsetHeight,e.style.display=r,s.nudgeCount+=1,s.lastNudgeAt=Date.now(),!0}function nr(e){return s.nudgeEnabled=e!==!1,s.nudgeEnabled}function ge(e){if(s.frame!==null){if(R)try{e.moveBefore(s.frame,null);return}catch(r){s.degraded=!0,s.lastMoveError=(r&&r.name?r.name+": ":"")+(r&&r.message?r.message:String(r))}else s.degraded=!0;e.appendChild(s.frame)}}function V(e,r){if(!(s.frame===null||e==null)){var n=s.owner===null,t=e.getBoundingClientRect();t.width>=1&&t.height>=1&&(s.lastRect={left:t.left,top:t.top,width:t.width,height:t.height}),s.owner=r===void 0?null:r,qe(),s.park.setAttribute("aria-hidden","true"),ge(e),n&&me(),I()}}function j(e){s.frame!==null&&(e!==void 0&&s.owner!==e||(s.owner=null,X(),he(),s.park.setAttribute("aria-hidden","true"),ge(s.park),I()))}function q(e){var r=e||{};return K(r),s.owner===null&&(typeof r.src=="string"&&r.src!==""&&(s.preloaded=!0),j()),s.frame}function tr(){s.park!==null&&s.park.parentNode!==null&&s.park.parentNode.removeChild(s.park),s.park=null,s.frame=null,s.currentSrc=null,s.sameOrigin=null,s.owner=null,s.lastRect=null,s.degraded=!1,s.preloaded=!1,s.nudgeCount=0,s.lastNudgeAt=0,I()}typeof window!="undefined"&&(window.__dshcsSurface={snapshot:Z,setParkStrategy:Xe,getParkStrategy:Ke,preload:q,dock:V,park:j,nudge:me,setNudgeEnabled:nr,destroy:tr});var i=require("react"),re=new Set,D={status:null,busy:!1,sidebarUi:"unknown",sidebarRegisterFailed:!1};function O(e){D=Object.assign({},D,e),re.forEach(function(r){r()})}function ar(e){return re.add(e),function(){re.delete(e)}}function sr(){return D}function te(){return i.useSyncExternalStore(ar,sr)}var ir="/api",lr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function y(e,r){var n={method:r===void 0?"GET":"POST",headers:{}};r!==void 0&&(n.headers["content-type"]="application/json",n.body=JSON.stringify(r));var t=await fetch(ir+e,n),a=await t.text(),l=null;try{l=a===""?null:JSON.parse(a)}catch(o){l=null}return t.ok?l!==null?l:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+t.status+(l!==null&&l.error!==void 0?": "+l.error:"")}}function be(){}function Oe(e){var r=typeof e.useSessions=="function"?e.useSessions:be,n=typeof e.useWorkspaces=="function"?e.useWorkspaces:be;return{sessions:r(function(t){return t}),workspaces:n(function(t){return t})}}function Le(e,r){if(e==null||typeof e.url!="string"||e.url==="")return null;var n=e.pid!=null?String(e.pid):e.startedAt!=null?String(e.startedAt):"0",t=e.url+"?s="+encodeURIComponent(n),a=typeof r=="string"&&r!==""?r:e!=null&&e.cwd!=null?e.cwd:null;if(a==null||a==="")return t;var l=a.replace(/\\/g,"/"),o=l;return(/^[A-Za-z]:\//.test(l)||l.charCodeAt(0)!==47)&&(o="/"+l),t+"&folder="+encodeURIComponent(o)}function or(e){var r=e.status,n=e.pageUrl,t=e.reloadTick,a=e.owner,l=i.useRef(null),o=r!=null&&r.ok===!0&&r.running===!0,d=r!=null&&r.status==="starting",p=r!=null&&r.ok===!1,f=r!=null&&r.serve==="dsh";if(i.useLayoutEffect(function(){if(!o||n===null){j(a);return}K({src:n,sameOrigin:f}),l.current!==null&&V(l.current,a)},[o,n,f,t,a]),i.useLayoutEffect(function(){return function(){j(a)}},[a]),o&&n!==null)return i.createElement("div",{ref:l,className:"dshcs-slot","data-code-server-slot":a!=null?a:"code-server"});if(d)return i.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026");var x=p&&r!=null&&r.error?r.error:"code-server \u672A\u8FD0\u884C",v=f?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(r!=null&&r.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(r!=null&&r.port!=null?r.port:"\u968F\u673A")+" + \u8DEF\u5F84\u4EE4\u724C;\u8981\u5728\u65B0\u6807\u7B7E\u9875\u6253\u5F00,\u590D\u5236\u8BBE\u7F6E\u5361\u91CC\u7684\u5B8C\u6574\u5730\u5740 \u2014\u2014 \u7F3A\u4E86\u4EE4\u724C\u90A3\u6BB5\u4F1A 404)\u3002",w=R?"\u5E38\u9A7B\u9762:\u53EF\u7528(\u5207\u6807\u7B7E/\u6536\u8D77\u4FA7\u680F\u4E0D\u91CD\u8F7D)\u3002":"\u5E38\u9A7B\u9762:\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore \u2014\u2014 \u5207\u6807\u7B7E\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u53EF\u7528)\u3002";return i.createElement("div",{className:"dshcs-empty"},i.createElement("div",{className:"dshcs-emptybox"},i.createElement("div",null,p?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),i.createElement("pre",{className:"dshcs-error"},x),i.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u67E5\u770B DSH host \u65E5\u5FD7\u91CC\u7684 [code-server] \u8F93\u51FA(\u6216\u5728\u8BBE\u7F6E\u5361\u7247\u91CC\u5207\u6362\u300C\u540E\u53F0\u5E38\u9A7B\u300D\u89E6\u53D1\u4E00\u6B21\u542F\u52A8)\u3002"+v+w)))}function dr(e){var r=te(),n=r.status,t=n!=null&&n.ok===!0&&n.running===!0,a=n!=null&&n.keepResident===!0,l=Oe(e!=null?e:{}),o=J({sessions:l.sessions,workspaces:l.workspaces}),d=t?Le(n,o):null;return i.useEffect(function(){!a||!t||d===null||q({src:d,sameOrigin:n!=null&&n.serve==="dsh"})},[a,t,d,n!=null?n.serve:null]),null}var cr=".dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-slot{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--dsw-alias-bg-base,#fff)}.dshcs-park{position:fixed;left:-20000px;top:0;width:320px;height:200px;overflow:hidden;pointer-events:none;z-index:0;visibility:hidden;contain:strict}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-legacy{color:var(--dsw-alias-label-warning,#b54708);font-size:12px;font-weight:600;margin:0 0 6px}",ye="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(ye)+"]")===null&&(U=document.createElement("style"),U.setAttribute("data-dshcs",ye),U.textContent=cr,document.head.appendChild(U));var U,xe="code-server",we="dsh-code-server-app",ur=2500,fr=1e4,pr=1500;function vr(e){var r=e!=null&&typeof e.size=="number"?e.size:16;return i.createElement("img",{src:lr,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:r,height:r,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}var hr=H("");function mr(){var e=D.status;return e==null||typeof e.claimExtensions!="string"?hr:H(e.claimExtensions)}function gr(e){var r=e.useTabInfo(),n=r.tab,t=te(),a=t.status,l=n.navigation,o=l!=null&&typeof l.revision=="number"?l.revision:0,d=l!=null&&typeof l.address=="string"?l.address:"",p=Y(d)?null:_(d),f=Oe(e),x=p!=null&&typeof p.sessionId=="string"?p.sessionId:void 0,v=J({sessions:f.sessions,workspaces:f.workspaces,sessionId:x!==void 0?x:e.sessionId}),w=i.useRef(!1),c=oe(p,v),m=l!=null&&l.params!=null&&typeof l.params.line=="number"?l.params.line:null,g=i.useRef(void 0),[S,F]=i.useState(0),z=i.useRef(null),L=i.useRef(!1),W=r.tab!=null&&r.tab.visible===!0,P=r.sidebar!=null&&r.sidebar.fullscreen===!0,k=a!=null&&a.fullscreenOnOpen!==!1;return i.useLayoutEffect(function(){if(!W){L.current=!1;return}if(!(!k||P||L.current)){L.current=!0;var C=ue(z.current);C!=="clicked"&&console.warn("[code-server] \u672A\u80FD\u81EA\u52A8\u5207\u5230\u5168\u5C4F\u53F3\u4FA7\u680F("+C+");\u672C\u6B21\u6253\u5F00\u4FDD\u6301\u539F\u6A21\u5F0F")}},[W,P,k]),i.useEffect(function(){if(!(typeof v!="string"||v==="")&&g.current!==v){var C=g.current!==void 0;g.current=v;var E=!1;return y("/code-server/start",{cwd:v}).then(function(h){E||(O({status:h}),C&&h!=null&&h.ok===!0&&h.running===!0&&F(function(b){return b+1}))}).catch(function(){}),function(){E=!0}}},[v]),i.useEffect(function(){typeof v=="string"&&v!==""||w.current||(w.current=!0,console.warn("[code-server] \u672A\u80FD\u89E3\u6790\u5F53\u524D\u5DE5\u4F5C\u533A\u76EE\u5F55(\u4F1A\u8BDD\u65E0 cwd / \u6807\u51C6 prop \u65E0 sessionId / \u5DE5\u4F5C\u533A\u8868\u4E5F\u6CA1\u5339\u914D\u4E0A):\u672C\u6B21\u4E0D\u5411\u5BBF\u4E3B\u53D1\u9001 cwd,IDE \u4F1A\u4EE5\u7A7A\u5DE5\u4F5C\u533A\u6253\u5F00"))},[v]),i.useEffect(function(){y("/code-server/status").then(function(E){E!=null&&O({status:E})}).catch(function(){});var C=window.setInterval(function(){y("/code-server/status").then(function(E){O({status:E})}).catch(function(){})},3e3);return function(){window.clearInterval(C)}},[]),i.useEffect(function(){c!==null&&y("/code-server/open-file",m===null?{file:c}:{file:c,line:m}).catch(function(){})},[o,c,m]),i.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body",ref:z},i.createElement(or,{status:a,pageUrl:Le(a,v),reloadTick:S,owner:"tab:"+n.id}))}function $(e,r){if(e==null)return null;var n=e[r];if(n!=null)return n;if(typeof e.get=="function"){var t=e.get(r);if(t!=null)return t}return null}function br(e){var r=$(e,"sidebarRightTabs"),n=$(e,"sidebarRight");if(r==null||n==null)return console.error("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u4E0A\u4E0B\u6587\u4E0D\u53EF\u89C1(sidebarRightTabs="+(r!=null)+", sidebarRight="+(n!=null)+"):\u8DF3\u8FC7\u4FA7\u680F\u6CE8\u518C"),!1;var t=$(e,"slots");if(e.effect(function(){return r.register({id:we,kind:xe,priority:"extension",patterns:["dsh-resource://file/**"],canOpen:function(a){return de(_(a),mr())},title:function(a){if(Y(a)||a===void 0||a===null||a==="")return"Code Server";var l=le(a);return l===""?"Code Server":l},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A;\u4EA7\u7269/\u4EA4\u4ED8\u6587\u4EF6\u70B9\u51FB\u540E\u5728\u6B64\u6253\u5F00\u3002"},icon:vr}]})},"code-server: sidebar tab type"),t!=null)e.effect(function(){return t.inject("sidebar.right.pane.tab",function(){return t.register({name:"sidebar.right.pane.tab",key:we},gr)})},"code-server: sidebar tab body");else return console.error("[code-server] slots \u670D\u52A1\u4E0D\u53EF\u89C1:\u4FA7\u680F\u6807\u7B7E body \u672A\u6CE8\u518C"),!1;return e.effect(function(){return function(){O({sidebarUi:"unknown"})}},"code-server: sidebar mode reset"),console.log("[code-server] right-sidebar tab registered (kind="+xe+")"),!0}var yr=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-card .dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-text{display:flex}.dshcs-text input{font:12px/1.5 ui-monospace,Consolas,monospace;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3,transparent);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:5px 8px;width:100%;min-width:0}.dshcs-text input:disabled{opacity:.5;cursor:default}.dshcs-text input:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-1px}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",xr="dsh-code-server/Card.module.css";function wr(e,r){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var n=document.createElement("style");n.dataset.plugin="dsh-code-server",n.dataset.pluginCss=e,n.textContent=r,document.head.appendChild(n)}}wr(xr,yr);function kr(e){return i.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},i.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function ke(e){return i.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function Ee(e){return i.createElement("label",{className:"dshcs-check"},i.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(r){e.onChange(r.target.checked)}}),i.createElement("span",{className:"dshcs-hint"},e.children))}function Er(e){return i.createElement("label",{className:"dshcs-text"},i.createElement("input",{type:"text",value:e.value,disabled:e.disabled===!0,spellCheck:!1,autoComplete:"off",placeholder:e.placeholder,onChange:function(r){e.onChange(r.target.value)}}))}function ee(e){var r=[];return e.overridden===!0&&(r.push(i.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),r.push(i.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),r.length===0?null:i.createElement("span",{className:"dshcs-badges"},...r)}function Se(e){var[r,n]=i.useState(e.defaultOpen===!0),t=e.state;if(t==null||t.available!==!0)return null;var a=e.title,l=e.noticeOnly===!0,o=t.dirty!==!0||t.invalid===!0||t.saving===!0;return i.createElement("li",{className:"dshcs-card"+(r?" dshcs-cardOpen":"")},i.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":r,onClick:function(){n(!r)}},i.createElement("span",{className:"dshcs-cardHeadText"},i.createElement("span",{className:"dshcs-cardName"},a),i.createElement("span",{className:"dshcs-cardDescription"},e.description)),t.dirty===!0?i.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,i.createElement(kr,{className:"dshcs-cardChevron"+(r?" dshcs-cardChevronOpen":"")})),r===!0?i.createElement("div",{className:"dshcs-cardBody"},l===!0?null:t.writable!==!0?i.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,l===!0?null:i.createElement("div",{className:"dshcs-cardFooter"},t.failed===!0?i.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,i.createElement(ke,{disabled:t.dirty!==!0||t.saving===!0,onClick:e.onDiscard},e.discardLabel),i.createElement(ke,{variant:"primary",disabled:o,onClick:e.onSave},t.saving===!0?e.savingLabel:e.saveLabel))):null)}function Sr(e){try{let k=function(){y("/code-server/status").then(function(h){h!=null&&typeof h=="object"&&O({status:h})}).catch(function(){})};var r=e.scope,[n,t]=i.useState(function(){return r!==void 0?r.getSnapshot():null}),[a,l]=i.useState(null),[o,d]=i.useState(!1),[p,f]=i.useState(!1),x=te(),[v,w]=i.useState(ve());if(i.useEffect(function(){return pe(function(h){w(h)})},[]),i.useEffect(function(){if(r===void 0||typeof r.subscribe!="function")return;function h(){try{t(r.getSnapshot())}catch(Dr){}}var b=r.subscribe(h);return function(){typeof b=="function"&&b()}},[r]),r===void 0)return console.error("[code-server] card scope missing"),null;if(n==null||n.status!=="ready")return n!=null&&n.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",n.status),null;var c=n.value!==void 0&&n.value!==null?n.value:{},m=n.user,g={keepResident:c.keepResident!==!1,claimExtensions:typeof c.claimExtensions=="string"?c.claimExtensions:M,fullscreenOnOpen:c.fullscreenOnOpen!==!1};if(x!=null&&x.sidebarUi==="legacy")return i.createElement(Se,{title:"Code Server",description:"\u5F53\u524D DSH \u7248\u672C\u4E0D\u53D7\u652F\u6301(\u7F3A\u5C11\u53F3\u4FA7\u680F\u670D\u52A1)",defaultOpen:!0,noticeOnly:!0,state:{available:!0,writable:!1,dirty:!1,invalid:!1,saving:!1,failed:!1}},i.createElement("div",{className:"dshcs-field"},i.createElement("div",{className:"dshcs-legacy"},"\u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH\u3002"),i.createElement("div",{className:"dshcs-hint",style:{marginTop:0}},`\u672A\u68C0\u6D4B\u5230\u53F3\u4FA7\u680F\u63D2\u4EF6\u670D\u52A1 sidebarRightTabs / sidebarRight,\u56E0\u6B64\u63D2\u4EF6\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3(\u65E7\u7248\u7684\u60AC\u6D6E\u7403\u4E0E\u6D6E\u52A8\u7A97\u53E3\u5DF2\u79FB\u9664),\u4E5F\u4E0D\u4F1A\u540E\u53F0\u542F\u52A8 IDE\u3002
3
- \u5347\u7EA7 DSH \u5230\u5E26\u53F3\u4FA7\u680F\u7684\u7248\u672C(\u2265 0.1.5-alpha.1)\u540E,Code Server \u4F1A\u51FA\u73B0\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC,\u672C\u9875\u540C\u65F6\u663E\u793A\u5B8C\u6574\u8BBE\u7F6E\u9879;\u5347\u7EA7\u540E\u65E0\u9700\u91CD\u88C5\u672C\u63D2\u4EF6,\u5237\u65B0\u9875\u9762\u5373\u53EF\u3002`)));var S=m!=null&&Object.prototype.hasOwnProperty.call(m,"keepResident"),F=m!=null&&Object.prototype.hasOwnProperty.call(m,"claimExtensions"),z=m!=null&&Object.prototype.hasOwnProperty.call(m,"fullscreenOnOpen"),L=a!==null&&(a.keepResident!==g.keepResident||A(a.claimExtensions)!==A(g.claimExtensions)||a.fullscreenOnOpen!==g.fullscreenOnOpen),W=!L||o,P={available:!0,writable:n.writable,dirty:L,invalid:!1,saving:o,failed:p};async function C(){if(L&&!o){d(!0),f(!1);try{var h=a!==null?a:g;await e.scope.set("keepResident",h.keepResident===!0),await e.scope.set("claimExtensions",A(h.claimExtensions)),await e.scope.set("fullscreenOnOpen",h.fullscreenOnOpen===!0),l(null),k()}catch(b){f(!0)}d(!1)}}async function E(){if(!(o||n.writable!==!0)){d(!0),f(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("keepResident"),await e.scope.unset("claimExtensions"),await e.scope.unset("fullscreenOnOpen")):(await e.scope.set("keepResident",c.keepResident===void 0||c.keepResident===null?!0:c.keepResident),await e.scope.set("claimExtensions",typeof c.claimExtensions=="string"?A(c.claimExtensions):M),await e.scope.set("fullscreenOnOpen",c.fullscreenOnOpen===void 0||c.fullscreenOnOpen===null?!0:c.fullscreenOnOpen)),l(null),k()}catch(h){f(!0)}d(!1)}}return i.createElement(Se,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1);\u8BA4\u9886\u7C7B\u578B\u51B3\u5B9A\u54EA\u4E9B\u6587\u4EF6\u4EA4\u7ED9 Code Server \u6253\u5F00",state:P,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:C,onDiscard:function(){l(null),f(!1)}},i.createElement("div",{className:"dshcs-field"},i.createElement("div",{className:"dshcs-fieldHead"},i.createElement("span",{className:"dshcs-fieldLabel"},"\u8BA4\u9886\u7C7B\u578B(\u6309\u6269\u5C55\u540D,\u5206\u53F7\u5206\u9694)"),F===!0?i.createElement(ee,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){E()}}):null),i.createElement(Er,{value:a!==null?a.claimExtensions:g.claimExtensions,disabled:n.writable!==!0,placeholder:M,onChange:function(h){l(function(b){return Object.assign({},b!==null?b:g,{claimExtensions:h})}),f(!1)}}),i.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},"\u5199\u6269\u5C55\u540D(\u4E0D\u5E26\u70B9,\u5927\u5C0F\u5199\u968F\u610F);`*` = \u5176\u4F59\u7C7B\u578B\u4E5F\u8BA4\u9886;`!ext` = \u4E0D\u8BA4\u9886(\u6392\u9664\u4F18\u5148)\u3002\u4E0D\u518D\u533A\u5206\u4F1A\u8BDD\u5185/\u7EDD\u5BF9\u8DEF\u5F84 \u2014\u2014 \u6240\u6709 `dsh-resource://file/**` \u4E00\u89C6\u540C\u4EC1,\u672A\u8BA4\u9886\u7684\u843D\u56DE DSH \u81EA\u5E26\u9884\u89C8\u3002"),i.createElement("div",{className:"dshcs-hint",style:{marginTop:2}},"\u5B9E\u9645\u89C4\u5219:"+ce(a!==null?a.claimExtensions:g.claimExtensions)+(A(a!==null?a.claimExtensions:g.claimExtensions)!==(a!==null?a.claimExtensions:g.claimExtensions)?"(\u4FDD\u5B58\u540E\u5F52\u4E00\u5316)":"")+" \xB7 \u9ED8\u8BA4 "+M)),i.createElement("div",{className:"dshcs-field"},i.createElement("div",{className:"dshcs-fieldHead"},i.createElement("span",{className:"dshcs-fieldLabel"},"\u6253\u5F00\u5373\u5168\u5C4F(\u53F3\u4FA7\u680F\u94FA\u6EE1\u7A97\u53E3)"),z===!0?i.createElement(ee,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){E()}}):null),i.createElement(Ee,{checked:a!==null?a.fullscreenOnOpen:g.fullscreenOnOpen,disabled:n.writable!==!0,onChange:function(h){l(function(b){return Object.assign({},b!==null?b:g,{fullscreenOnOpen:h===!0})}),f(!1)}},'\u6253\u5F00 Code Server \u6807\u7B7E(\u542B\u70B9\u5F00\u4EA7\u7269/\u4EA4\u4ED8\u6587\u4EF6)\u65F6,\u81EA\u52A8\u628A\u53F3\u4FA7\u680F\u4ECE"\u4E0E\u5BF9\u8BDD\u5E76\u6392"\u5207\u5230\u5168\u5C4F;\u60F3\u540C\u65F6\u770B\u5BF9\u8BDD\u5C31\u5173\u6389\u5B83,\u6216\u968F\u65F6\u70B9\u53F3\u4FA7\u680F\u7684\u300C\u9000\u51FA\u5168\u5C4F\u300D\u2014\u2014 \u672C\u6B21\u6253\u5F00\u4E0D\u4F1A\u88AB\u62A2\u56DE\u53BB'),i.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},'\u53EA\u5F71\u54CD"\u6253\u5F00\u90A3\u4E00\u523B":\u5207\u8D70\u518D\u5207\u56DE\u3001\u518D\u6B21\u6253\u5F00\u6587\u4EF6 tab \u4F1A\u91CD\u65B0\u5207\u5168\u5C4F;DSH \u672A\u5411\u63D2\u4EF6\u5F00\u653E\u6A21\u5F0F\u63A5\u53E3,\u672C\u9879\u7531\u70B9\u51FB\u53F3\u4FA7\u680F\u81EA\u8EAB\u7684\u300C\u5168\u5C4F\u300D\u6309\u94AE\u5B9E\u73B0\u3002')),i.createElement("div",{className:"dshcs-field"},i.createElement("div",{className:"dshcs-fieldHead"},i.createElement("span",{className:"dshcs-fieldLabel"},"\u540E\u53F0\u5E38\u9A7B(\u5207\u6807\u7B7E\u4E0D\u91CD\u8F7D)"),S===!0?i.createElement(ee,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){E()}}):null),i.createElement(Ee,{checked:a!==null?a.keepResident:g.keepResident,disabled:n.writable!==!0,onChange:function(h){l(function(b){return Object.assign({},b!==null?b:g,{keepResident:h===!0})}),f(!1)}},'\u5F00\u542F\u540E\u5BBF\u4E3B\u542F\u52A8\u5373\u628A IDE \u52A0\u8F7D\u5230\u540E\u53F0"\u505C\u653E\u533A":\u5207\u6362\u53F3\u4FA7\u680F\u6807\u7B7E\u3001\u6536\u8D77/\u5C55\u5F00\u4FA7\u680F\u3001\u62D6\u6210\u6D6E\u52A8\u7A97\u53E3\u90FD\u4E0D\u518D\u91CD\u8F7D,\u9996\u6B21\u6253\u5F00\u514D\u7B49\u5F85;\u5173\u95ED\u5219\u53EA\u5728\u6253\u5F00\u9762\u677F\u65F6\u52A0\u8F7D(\u7701\u5185\u5B58)'),i.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},R?"\u5E38\u9A7B\u9762:"+(v.docked?"\u5DF2\u505C\u9760":v.ready?"\u5DF2\u505C\u653E(\u540E\u53F0\u8FD0\u884C\u4E2D)":"\u672A\u542F\u52A8")+(v.degraded?" \xB7 \u672C\u6B21\u53D1\u751F\u8FC7\u964D\u7EA7\u91CD\u8F7D":""):"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore(Chromium <133)\u2192 \u5E38\u9A7B\u4E0D\u53EF\u7528,\u5207\u6807\u7B7E\u4ECD\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u751F\u6548)")))}catch(k){return console.error("[code-server] card render error:",k!=null&&k.message!==void 0?k.message:String(k)),null}}var Ce=900,u={rev:-1,open:!1,mounted:!1,pending:null,el:null,body:null,title:null,timer:null,loading:!1};function Cr(e){if(!(e===null||typeof e!="object")){if(e.type==="ready"){T(!0);return}if(e.type==="ask"&&typeof e.text=="string"){y("/code-server/ask/send",{text:e.text,mode:u.pending===null?void 0:u.pending.mode}).then(function(r){u.rev=-1,T(!0)}).catch(function(){});return}if(e.type==="approve"&&typeof e.id=="string"){y("/code-server/ask/approve",{id:e.id,outcome:e.outcome}).then(function(r){r!=null&&r.ok===!1&&B(r.error||"\u6388\u6743\u63D0\u4EA4\u5931\u8D25"),u.rev=-1,T(!0)}).catch(function(r){B("\u6388\u6743\u63D0\u4EA4\u5931\u8D25:"+String(r&&r.message?r.message:r))});return}e.type==="close"&&Ae()}}function T(e){if(u.el!==null){var r=window.__DSHCS_ASK_PUSH__;typeof r=="function"?r(u.pending):e===!0&&setTimeout(function(){T(!1)},120)}}function B(e){console.warn("[code-server] ask dialog:",e)}function Ae(){u.open=!1,u.el!==null&&(u.el.style.display="none"),y("/code-server/ask/close",{}).catch(function(){})}function Te(){if(u.el===null){var e=document.createElement("div");e.className="dshcs-dialog",e.setAttribute("data-dshcs-dialog","ask"),e.style.cssText=["position:fixed","right:24px","bottom:24px","width:460px","height:600px","min-width:320px","min-height:280px","max-width:96vw","max-height:92vh","resize:both","overflow:hidden","display:none","z-index:2147483000","border-radius:10px","box-shadow:0 18px 48px rgba(0,0,0,.45)","border:1px solid var(--dsw-alias-border-l2, rgba(128,128,128,.4))","background:var(--dsw-alias-bg-base, var(--vscode-editor-background, #1e1e1e))"].join(";");var r=document.createElement("div");r.style.cssText="display:flex;align-items:center;gap:8px;padding:6px 10px;cursor:move;border-bottom:1px solid var(--dsw-alias-border-l1, rgba(128,128,128,.3));font:var(--dsw-font-markdown-base, 13px/20px sans-serif)";var n=document.createElement("span");n.textContent="DSH \u5BF9\u8BDD",n.style.cssText="font-weight:600;flex:none";var t=document.createElement("span");t.style.cssText="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary, rgba(128,128,128,.9));font-size:12px";var a=document.createElement("button");a.type="button",a.textContent="\u2715",a.title="\u5173\u95ED",a.setAttribute("aria-label","\u5173\u95ED"),a.style.cssText="flex:none;border:0;background:transparent;color:inherit;cursor:pointer;font-size:13px;line-height:1;padding:2px 6px;border-radius:4px",a.addEventListener("click",function(){Ae()}),r.appendChild(n),r.appendChild(t),r.appendChild(a);var l=document.createElement("div");l.className="dshcs-panel",l.setAttribute("data-dshcs-ask-root",""),l.style.cssText="height:calc(100% - 33px);overflow:hidden",e.appendChild(r),e.appendChild(l),document.body.appendChild(e),u.el=e,u.body=l,u.title=t;var o=null;r.addEventListener("pointerdown",function(d){if(d.target!==a){var p=e.getBoundingClientRect();o={x:d.clientX,y:d.clientY,left:p.left,top:p.top},e.style.right="auto",e.style.bottom="auto",e.style.left=p.left+"px",e.style.top=p.top+"px";try{r.setPointerCapture(d.pointerId)}catch(f){}}}),r.addEventListener("pointermove",function(d){o!==null&&(e.style.left=Math.max(0,Math.min(window.innerWidth-80,o.left+(d.clientX-o.x)))+"px",e.style.top=Math.max(0,Math.min(window.innerHeight-40,o.top+(d.clientY-o.y)))+"px")}),r.addEventListener("pointerup",function(){o=null})}}var Me="dshcs.ask.bundle",Nr=900*1e3,N=null;function ne(){try{var e=window.sessionStorage.getItem(Me);if(e==null)return null;var r=JSON.parse(e);return r==null||typeof r.js!="string"||typeof r.css!="string"||Date.now()-Number(r.at||0)>Nr?null:{css:r.css,js:r.js}}catch(n){return null}}function Re(e){try{window.sessionStorage.setItem(Me,JSON.stringify({at:Date.now(),css:e.css,js:e.js}))}catch(r){}}function Or(){if(!(N!==null||u.mounted)){var e=ne();if(e!==null){N=e;return}y("/code-server/ask/bundle").then(function(r){r==null||r.ok!==!0||(N={css:r.css,js:r.js},Re(N),console.log("[code-server] ask bundle preloaded ("+Math.round((r.js.length+r.css.length)/1024)+"KB)"))}).catch(function(){})}}function Lr(){if(!(u.mounted||u.loading)){u.loading=!0;var e=N!==null?Promise.resolve(N):ne()!==null?Promise.resolve(ne()):y("/code-server/ask/bundle");e.then(function(r){u.loading=!1;var n=r;if(N===null&&r!=null&&r.ok===!0&&(n={css:r.css,js:r.js},N=n,Re(n)),n==null||typeof n.js!="string"){B(n!=null&&n.error?n.error:"\u9762\u677F\u4EA7\u7269\u4E0D\u53EF\u7528");return}if(Te(),document.getElementById("dshcs-ask-style")===null){var t=document.createElement("style");t.id="dshcs-ask-style",t.textContent=n.css,document.head.appendChild(t)}window.__DSHCS_HOST__="dsh",window.__DSHCS_MOUNT__=u.body,window.acquireVsCodeApi=function(){return{postMessage:Cr}};var a=document.createElement("script");a.textContent=n.js,document.head.appendChild(a),u.mounted=!0,setTimeout(function(){T(!0)},60)}).catch(function(r){u.loading=!1,B("\u9762\u677F\u4EA7\u7269\u52A0\u8F7D\u5931\u8D25:"+String(r&&r.message?r.message:r))})}}function Ne(){y("/code-server/ask/state?rev="+u.rev).then(function(e){e==null||e.ok!==!0||e.changed===!0&&(u.rev=typeof e.rev=="number"?e.rev:-1,u.pending=e,e.open===!0?(Te(),u.el.style.display="block",u.title!==null&&(u.title.textContent=e.contextText||"\u6765\u81EA\u7F16\u8F91\u5668"),u.open=!0,Lr(),u.mounted&&T(!0)):u.el!==null&&(u.el.style.display="none",u.open=!1))}).catch(function(){})}function Ar(){u.timer===null&&(u.timer=setInterval(Ne,Ce),setTimeout(Ne,800),setTimeout(Or,3e3),console.log("[code-server] ask dialog poller started (every "+Ce+"ms)"))}function Tr(e){try{Mr(e),Ar()}catch(r){console.error("[code-server] apply failed:",r&&r.stack?r.stack:String(r));try{document.title="CS-ERR "+(r&&r.message||String(r))}catch(n){}}}function Mr(e){var r=e.get("slots");if(r===void 0){console.error("[code-server] slots service unavailable");return}var n=e.settingsScope,t=null;if(n!==void 0&&typeof n.bind=="function")t=n.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}y("/code-server/status").then(function(c){O({status:c})}).catch(function(){}),r.inject("settings.plugin.item",()=>r.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:t}}},Sr));var a=!1;function l(c,m){if(!a){a=!0,x();var g=!1;try{g=br(c)}catch(S){console.error("[code-server] sidebar tab registration failed:",S!=null&&S.message!=null?S.message:String(S))}D.sidebarUi==="legacy"&&(console.log("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u665A\u5230(\u7ECF "+m+"):\u64A4\u9500\u65E7\u7248 DSH \u5224\u5B9A"),y("/code-server/ui-mode",{sidebar:!0}).catch(function(){})),O({sidebarUi:"modern",sidebarRegisterFailed:g!==!0}),r.inject("shell.overlay",()=>r.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},S=>i.createElement(dr,S))),console.log("[code-server] client registered via "+m+": sidebar tab="+g+"(claims dsh-resource://file/**) + resident preload + settings card")}}function o(c){O({sidebarUi:"legacy"}),console.warn("[code-server] \u672A\u63A2\u6D4B\u5230\u53F3\u4FA7\u680F\u670D\u52A1(sidebarRightTabs/sidebarRight): \u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH \u2014\u2014 \u9664\u300C\u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server\u300D\u7684\u63D0\u793A\u5916\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3,\u4E5F\u4E0D\u9884\u70ED IDE\u3002\u8BF7\u5347\u7EA7 DSH\u3002"),c===!0&&y("/code-server/ui-mode",{sidebar:!1}).catch(function(){})}var d=null,p=null,f=null;function x(){d!==null&&(clearTimeout(d),d=null),p!==null&&(clearTimeout(p),p=null),f!==null&&(clearTimeout(f),f=null)}var v=!1;try{typeof e.inject=="function"&&(v=!0,e.inject(["sidebarRightTabs","sidebarRight"],function(c){l(c,"inject")}))}catch(c){console.warn("[code-server] sidebar inject failed:",c!=null&&c.message!=null?c.message:String(c))}var w=typeof e.get=="function"&&e.get("sidebarRightTabs")!==void 0&&e.get("sidebarRight")!==void 0;if(w){f=setTimeout(function(){a||(console.warn("[code-server] ctx.inject \u672A\u5728 1.5s \u5185\u56DE\u8C03,\u6539\u7528\u540C\u6B65\u670D\u52A1\u6CE8\u518C\u4FA7\u680F"),l(e,"sync-fallback"))},pr);return}if(v!==!0){o(!0);return}d=setTimeout(function(){a||o(!1)},ur),p=setTimeout(function(){a||o(!0)},fr)}var Rr=["slots","settingsScope"],Ir="code-server";
2
+ var Q=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Pe=Object.prototype.hasOwnProperty;var _e=(e,r)=>{for(var n in r)Q(e,n,{get:r[n],enumerable:!0})},He=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of ze(r))!Pe.call(e,a)&&a!==n&&Q(e,a,{get:()=>r[a],enumerable:!(t=De(r,a))||t.enumerable});return e};var Ue=e=>He(Q({},"__esModule",{value:!0}),e);var _r={};_e(_r,{apply:()=>jr,inject:()=>zr,name:()=>Pr});module.exports=Ue(_r);var ie="dsh-resource://file/",Be="sidebar://";function J(e){return typeof e=="string"&&e.startsWith(Be)}function U(e){if(typeof e!="string"||!e.startsWith(ie))return null;for(var r=e.length,n=0;n<e.length;n+=1){var t=e.charAt(n);if(t==="?"||t==="#"){r=n;break}}var a=e.slice(ie.length,r).split("/"),l=a.shift();try{if(l==="session"){var o=a.shift();return o===void 0||o===""||a.length===0?null:{scope:"session",sessionId:decodeURIComponent(o),path:le(a)}}if(l==="absolute"){var c=a[0]===""&&a.length>1,p=c?a.slice(1):a,f=le(p);return(f===""||f.charAt(0)==="/")&&!c?null:c?{scope:"absolute",path:"//"+f}:f===""?null:{scope:"absolute",path:oe(f)?f:"/"+f}}}catch(x){return null}return null}function le(e){for(var r=[],n=0;n<e.length;n+=1)r.push(decodeURIComponent(e[n]));return r.join("/")}function oe(e){return/^[A-Za-z]:($|\/)/.test(e)}function Fe(e){return typeof e!="string"||e===""?!1:e.charAt(0)==="/"?!0:oe(e)}function ce(e){var r=U(e);if(r===null)return"";var n=r.path.replace(/[/\\]+$/,""),t=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\")),a=t===-1?n:n.slice(t+1);return a}function de(e,r){if(e===null||e==null)return null;var n=typeof e.path=="string"?e.path:"";if(n==="")return null;if(Fe(n))return n;if(typeof r!="string"||r==="")return null;var t=r.indexOf("\\")!==-1?"\\":"/",a=r.replace(/[\\/]+$/,"");return a+t+(t==="\\"?n.replace(/\//g,"\\"):n)}var R="*;!md;!markdown;!html;!htm;!png;!jpg;!jpeg;!gif;!webp;!bmp;!ico;!svg;!pdf",We=/[;,\s]+/;function Ge(e){return String(e).replace(/!\s+/g,"!").split(We)}function Ye(e){var r=typeof e=="string"?e.trim():"";if(r==="")return"";var n=r.charAt(0)==="!",t=n?r.slice(1).trim():r;return t==="*"?n?"!*":"*":(t.slice(0,2)==="*."?t=t.slice(2):t.charAt(0)==="."&&(t=t.slice(1)),t=t.toLowerCase(),t===""?"":n?"!"+t:t)}function A(e){if(typeof e!="string")return"";for(var r=Ge(e),n=[],t=0;t<r.length;t+=1){var a=Ye(r[t]);a===""||a==="!*"||n.indexOf(a)===-1&&n.push(a)}return n.join(";")}function B(e){for(var r=A(e),n=r===""?[]:r.split(";"),t=!1,a=[],l=[],o=0;o<n.length;o+=1){var c=n[o];if(c==="*"){t=!0;continue}c.charAt(0)==="!"?l.push(c.slice(1)):a.push(c)}return{all:t,allow:a,deny:l}}function Qe(e){if(typeof e!="string"||e==="")return"";var r=e.replace(/[/\\]+$/,""),n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\"));n!==-1&&(r=r.slice(n+1));var t=r.lastIndexOf(".");return t<=0?"":r.slice(t+1).toLowerCase()}function Je(e,r){if(r==null)return!1;var n=Qe(e);return n!==""&&r.deny.indexOf(n)!==-1?!1:n!==""&&r.allow.indexOf(n)!==-1?!0:r.all===!0}function ue(e,r){return e===null||e==null?!1:Je(e.path,r)}function fe(e){var r=B(e),n=[];return r.all&&n.push("\u5176\u4F59\u7C7B\u578B\u5168\u90E8\u8BA4\u9886"),r.allow.length>0&&n.push("\u6307\u5B9A\u8BA4\u9886 "+r.allow.length+" \u9879"),r.deny.length>0&&n.push("\u6392\u9664 "+r.deny.length+" \u9879"),n.length===0?"\u4E0D\u8BA4\u9886\u4EFB\u4F55\u6587\u4EF6(\u53EA\u6709\u9875\u9762\u6807\u7B7E)":n.join(" \xB7 ")}var Ze="[data-sidebar-right-panel]",Ke='[data-sidebar-right-mode="fullscreen"]';function pe(e){if(e==null||typeof e.closest!="function")return"no-root";var r,n;try{if(r=e.closest(Ze),r==null||typeof r.querySelector!="function")return"no-panel";n=r.querySelector(Ke)}catch(t){return"lookup-failed"}if(n==null||typeof n.click!="function")return"no-control";try{n.click()}catch(t){return"click-failed"}return"clicked"}function ve(e,r){if(!(e==null||e.byId==null)&&!(typeof r!="string"||r==="")){var n=e.byId[r];if(n!=null)return typeof n.cwd=="string"&&n.cwd!==""?n.cwd:void 0}}function Z(e,r){if(!(e==null||!Array.isArray(e.items))&&!(typeof r!="string"||r===""))for(var n=0;n<e.items.length;n+=1){var t=e.items[n];if(!(t==null||!Array.isArray(t.sessionIds))&&t.sessionIds.indexOf(r)!==-1&&typeof t.path=="string"&&t.path!=="")return t.path}}function K(e){var r=e==null?{}:e,n=r.sessions==null?null:r.sessions,t=r.workspaces==null?null:r.workspaces,a=typeof r.sessionId=="string"&&r.sessionId!==""?r.sessionId:void 0,l=ve(n,a);if(l!==void 0)return l;var o=n==null?void 0:n.current,c=ve(n,o);if(c!==void 0)return c;var p=Z(t,a);if(p!==void 0)return p;var f=Z(t,typeof o=="string"?o:void 0);if(f!==void 0)return f;var x=n!=null&&Array.isArray(n.ids)?n.ids[0]:void 0,v=Z(t,typeof x=="string"?x:void 0);if(v!==void 0)return v;if(t!=null&&Array.isArray(t.items)&&t.recentWorkspaceId!==void 0)for(var w=0;w<t.items.length;w+=1){var d=t.items[w];if(!(d==null||d.workspaceId!==t.recentWorkspaceId)&&typeof d.path=="string"&&d.path!=="")return d.path}if(t!=null&&Array.isArray(t.items)&&t.items.length>0){var h=t.items[0];if(h!=null&&typeof h.path=="string"&&h.path!=="")return h.path}}var I=typeof Element!="undefined"&&typeof Element.prototype.moveBefore=="function",Xe=-2e4,s={park:null,frame:null,currentSrc:null,sameOrigin:null,owner:null,lastRect:null,parkStrategy:"offscreen",degraded:!1,preloaded:!1,nudgeCount:0,nudgeEnabled:!0,lastNudgeAt:0,listeners:new Set};function X(){return{ready:s.frame!==null,docked:s.owner!==null,owner:s.owner,src:s.currentSrc,sameOrigin:s.sameOrigin,parkStrategy:s.parkStrategy,degraded:s.degraded,preloaded:s.preloaded,supportsMoveBefore:I,nudgeCount:s.nudgeCount,lastNudgeAt:s.lastNudgeAt}}function j(){var e=X();s.listeners.forEach(function(r){try{r(e)}catch(n){}})}function he(e){return s.listeners.add(e),function(){s.listeners.delete(e)}}function me(){return X()}function Ve(e){e!=="offscreen"&&e!=="behind"||s.parkStrategy!==e&&(s.parkStrategy=e,s.frame!==null&&s.owner===null&&V(),j())}function qe(){return s.parkStrategy}function $e(){var e=s.lastRect;e!==null&&(s.park.style.width=Math.max(1,Math.round(e.width))+"px",s.park.style.height=Math.max(1,Math.round(e.height))+"px")}function V(){if(s.park!==null){if($e(),s.parkStrategy==="behind"&&s.lastRect!==null){s.park.style.left=Math.round(s.lastRect.left)+"px",s.park.style.top=Math.round(s.lastRect.top)+"px",s.park.style.visibility="visible",s.park.style.zIndex="0";return}s.park.style.left=Xe+"px",s.park.style.top="0px",s.park.style.visibility="hidden",s.park.style.zIndex="0"}}function ge(){s.frame!==null&&(s.frame.setAttribute("inert",""),s.frame.setAttribute("aria-hidden","true"))}function er(){s.frame!==null&&(s.frame.removeAttribute("inert"),s.frame.removeAttribute("aria-hidden"))}function rr(){var e=document.createElement("div");e.className="dshcs-park",e.setAttribute("data-dshcs-park",""),e.setAttribute("aria-hidden","true");var r=document.createElement("iframe");return r.className="dshcs-frame",r.setAttribute("title","code-server"),r.setAttribute("allow","clipboard-read; clipboard-write"),r.setAttribute("data-dshcs-resident",""),r.src="about:blank",e.appendChild(r),document.body.appendChild(e),s.park=e,s.frame=r,s.currentSrc="about:blank",s.owner=null,V(),ge(),r}function nr(e){var r=s.frame;if(r!==null){var n=s.sameOrigin!==e;!n&&r.hasAttribute("data-dshcs-attrs")||(e===!0?r.removeAttribute("sandbox"):e===!1&&r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write"),r.setAttribute("data-dshcs-attrs",e===!0?"same-origin":"cross-origin"),s.sameOrigin=e)}}function q(e){var r=e||{};return s.frame===null&&rr(),typeof r.sameOrigin=="boolean"&&nr(r.sameOrigin),typeof r.src=="string"&&r.src!==""&&r.src!==s.currentSrc&&tr(r.src),s.frame}function tr(e){s.frame===null||typeof e!="string"||e===""||e===s.currentSrc||(s.currentSrc=e,s.frame.src=e,j())}function be(){var e=s.frame;if(s.nudgeEnabled!==!0||e===null||e.isConnected!==!0)return!1;var r=e.style.display;return e.style.display="none",e.offsetHeight,e.style.display=r,s.nudgeCount+=1,s.lastNudgeAt=Date.now(),!0}function ar(e){return s.nudgeEnabled=e!==!1,s.nudgeEnabled}function ye(e){if(s.frame!==null){if(I)try{e.moveBefore(s.frame,null);return}catch(r){s.degraded=!0,s.lastMoveError=(r&&r.name?r.name+": ":"")+(r&&r.message?r.message:String(r))}else s.degraded=!0;e.appendChild(s.frame)}}function $(e,r){if(!(s.frame===null||e==null)){var n=s.owner===null,t=e.getBoundingClientRect();t.width>=1&&t.height>=1&&(s.lastRect={left:t.left,top:t.top,width:t.width,height:t.height}),s.owner=r===void 0?null:r,er(),s.park.setAttribute("aria-hidden","true"),ye(e),n&&be(),j()}}function D(e){s.frame!==null&&(e!==void 0&&s.owner!==e||(s.owner=null,V(),ge(),s.park.setAttribute("aria-hidden","true"),ye(s.park),j()))}function ee(e){var r=e||{};return q(r),s.owner===null&&(typeof r.src=="string"&&r.src!==""&&(s.preloaded=!0),D()),s.frame}function sr(){s.park!==null&&s.park.parentNode!==null&&s.park.parentNode.removeChild(s.park),s.park=null,s.frame=null,s.currentSrc=null,s.sameOrigin=null,s.owner=null,s.lastRect=null,s.degraded=!1,s.preloaded=!1,s.nudgeCount=0,s.lastNudgeAt=0,j()}typeof window!="undefined"&&(window.__dshcsSurface={snapshot:X,setParkStrategy:Ve,getParkStrategy:qe,preload:ee,dock:$,park:D,nudge:be,setNudgeEnabled:ar,destroy:sr});var i=require("react"),te=new Set,z={status:null,busy:!1,sidebarUi:"unknown",sidebarRegisterFailed:!1};function L(e){z=Object.assign({},z,e),te.forEach(function(r){r()})}function ir(e){return te.add(e),function(){te.delete(e)}}function lr(){return z}function se(){return i.useSyncExternalStore(ir,lr)}var or="/api",cr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function y(e,r){var n={method:r===void 0?"GET":"POST",headers:{}};r!==void 0&&(n.headers["content-type"]="application/json",n.body=JSON.stringify(r));var t=await fetch(or+e,n),a=await t.text(),l=null;try{l=a===""?null:JSON.parse(a)}catch(o){l=null}return t.ok?l!==null?l:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+t.status+(l!==null&&l.error!==void 0?": "+l.error:"")}}function xe(){}function Le(e){var r=typeof e.useSessions=="function"?e.useSessions:xe,n=typeof e.useWorkspaces=="function"?e.useWorkspaces:xe;return{sessions:r(function(t){return t}),workspaces:n(function(t){return t})}}function Ae(e,r){if(e==null||typeof e.url!="string"||e.url==="")return null;var n=e.pid!=null?String(e.pid):e.startedAt!=null?String(e.startedAt):"0",t=e.url+"?s="+encodeURIComponent(n),a=typeof r=="string"&&r!==""?r:e!=null&&e.cwd!=null?e.cwd:null;if(a==null||a==="")return t;var l=a.replace(/\\/g,"/"),o=l;return(/^[A-Za-z]:\//.test(l)||l.charCodeAt(0)!==47)&&(o="/"+l),t+"&folder="+encodeURIComponent(o)}function dr(e){var r=e.status,n=e.pageUrl,t=e.reloadTick,a=e.owner,l=i.useRef(null),o=r!=null&&r.ok===!0&&r.running===!0,c=r!=null&&r.status==="starting",p=r!=null&&r.ok===!1,f=r!=null&&r.serve==="dsh";if(i.useLayoutEffect(function(){if(!o||n===null){D(a);return}q({src:n,sameOrigin:f}),l.current!==null&&$(l.current,a)},[o,n,f,t,a]),i.useLayoutEffect(function(){return function(){D(a)}},[a]),o&&n!==null)return i.createElement("div",{ref:l,className:"dshcs-slot","data-code-server-slot":a!=null?a:"code-server"});if(c)return i.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026");var x=p&&r!=null&&r.error?r.error:"code-server \u672A\u8FD0\u884C",v=f?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(r!=null&&r.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(r!=null&&r.port!=null?r.port:"\u968F\u673A")+" + \u8DEF\u5F84\u4EE4\u724C;\u8981\u5728\u65B0\u6807\u7B7E\u9875\u6253\u5F00,\u590D\u5236\u8BBE\u7F6E\u5361\u91CC\u7684\u5B8C\u6574\u5730\u5740 \u2014\u2014 \u7F3A\u4E86\u4EE4\u724C\u90A3\u6BB5\u4F1A 404)\u3002",w=I?"\u5E38\u9A7B\u9762:\u53EF\u7528(\u5207\u6807\u7B7E/\u6536\u8D77\u4FA7\u680F\u4E0D\u91CD\u8F7D)\u3002":"\u5E38\u9A7B\u9762:\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore \u2014\u2014 \u5207\u6807\u7B7E\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u53EF\u7528)\u3002";return i.createElement("div",{className:"dshcs-empty"},i.createElement("div",{className:"dshcs-emptybox"},i.createElement("div",null,p?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),i.createElement("pre",{className:"dshcs-error"},x),i.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u67E5\u770B DSH host \u65E5\u5FD7\u91CC\u7684 [code-server] \u8F93\u51FA(\u6216\u5728\u8BBE\u7F6E\u5361\u7247\u91CC\u5207\u6362\u300C\u540E\u53F0\u5E38\u9A7B\u300D\u89E6\u53D1\u4E00\u6B21\u542F\u52A8)\u3002"+v+w)))}function ur(e){var r=se(),n=r.status,t=n!=null&&n.ok===!0&&n.running===!0,a=n!=null&&n.keepResident===!0,l=Le(e!=null?e:{}),o=K({sessions:l.sessions,workspaces:l.workspaces}),c=t?Ae(n,o):null;return i.useEffect(function(){!a||!t||c===null||ee({src:c,sameOrigin:n!=null&&n.serve==="dsh"})},[a,t,c,n!=null?n.serve:null]),null}var fr=".dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-slot{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--dsw-alias-bg-base,#fff)}.dshcs-park{position:fixed;left:-20000px;top:0;width:320px;height:200px;overflow:hidden;pointer-events:none;z-index:0;visibility:hidden;contain:strict}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-legacy{color:var(--dsw-alias-label-warning,#b54708);font-size:12px;font-weight:600;margin:0 0 6px}",we="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(we)+"]")===null&&(F=document.createElement("style"),F.setAttribute("data-dshcs",we),F.textContent=fr,document.head.appendChild(F));var F,ke="code-server",Ee="dsh-code-server-app",pr="dsh-code-server-app",vr="\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A;\u8BA4\u9886\u7C7B\u578B\u3001\u6253\u5F00\u5373\u5168\u5C4F\u3001\u540E\u53F0\u5E38\u9A7B\u90FD\u5728\u8FD9\u91CC\u8BBE\u3002",hr=2500,mr=1e4,gr=1500;function br(e){var r=e!=null&&typeof e.size=="number"?e.size:16;return i.createElement("img",{src:cr,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:r,height:r,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}var yr=B("");function xr(){var e=z.status;return e==null||typeof e.claimExtensions!="string"?yr:B(e.claimExtensions)}function wr(e){var r=e.useTabInfo(),n=r.tab,t=se(),a=t.status,l=n.navigation,o=l!=null&&typeof l.revision=="number"?l.revision:0,c=l!=null&&typeof l.address=="string"?l.address:"",p=J(c)?null:U(c),f=Le(e),x=p!=null&&typeof p.sessionId=="string"?p.sessionId:void 0,v=K({sessions:f.sessions,workspaces:f.workspaces,sessionId:x!==void 0?x:e.sessionId}),w=i.useRef(!1),d=de(p,v),h=l!=null&&l.params!=null&&typeof l.params.line=="number"?l.params.line:null,m=i.useRef(void 0),[E,Y]=i.useState(0),P=i.useRef(null),C=i.useRef(!1),_=r.tab!=null&&r.tab.visible===!0,H=r.sidebar!=null&&r.sidebar.fullscreen===!0,M=a!=null&&a.fullscreenOnOpen!==!1;return i.useLayoutEffect(function(){if(!_){C.current=!1;return}if(!(!M||H||C.current)){C.current=!0;var b=pe(P.current);b!=="clicked"&&console.warn("[code-server] \u672A\u80FD\u81EA\u52A8\u5207\u5230\u5168\u5C4F\u53F3\u4FA7\u680F("+b+");\u672C\u6B21\u6253\u5F00\u4FDD\u6301\u539F\u6A21\u5F0F")}},[_,H,M]),i.useEffect(function(){if(!(typeof v!="string"||v==="")&&m.current!==v){var b=m.current!==void 0;m.current=v;var S=!1;return y("/code-server/start",{cwd:v}).then(function(N){S||(L({status:N}),b&&N!=null&&N.ok===!0&&N.running===!0&&Y(function(g){return g+1}))}).catch(function(){}),function(){S=!0}}},[v]),i.useEffect(function(){typeof v=="string"&&v!==""||w.current||(w.current=!0,console.warn("[code-server] \u672A\u80FD\u89E3\u6790\u5F53\u524D\u5DE5\u4F5C\u533A\u76EE\u5F55(\u4F1A\u8BDD\u65E0 cwd / \u6807\u51C6 prop \u65E0 sessionId / \u5DE5\u4F5C\u533A\u8868\u4E5F\u6CA1\u5339\u914D\u4E0A):\u672C\u6B21\u4E0D\u5411\u5BBF\u4E3B\u53D1\u9001 cwd,IDE \u4F1A\u4EE5\u7A7A\u5DE5\u4F5C\u533A\u6253\u5F00"))},[v]),i.useEffect(function(){y("/code-server/status").then(function(S){S!=null&&L({status:S})}).catch(function(){});var b=window.setInterval(function(){y("/code-server/status").then(function(S){L({status:S})}).catch(function(){})},3e3);return function(){window.clearInterval(b)}},[]),i.useEffect(function(){d!==null&&y("/code-server/open-file",h===null?{file:d}:{file:d,line:h}).catch(function(){})},[o,d,h]),i.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body",ref:P},i.createElement(dr,{status:a,pageUrl:Ae(a,v),reloadTick:E,owner:"tab:"+n.id}))}function re(e,r){if(e==null)return null;var n=e[r];if(n!=null)return n;if(typeof e.get=="function"){var t=e.get(r);if(t!=null)return t}return null}function kr(e){var r=re(e,"sidebarRightTabs"),n=re(e,"sidebarRight");if(r==null||n==null)return console.error("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u4E0A\u4E0B\u6587\u4E0D\u53EF\u89C1(sidebarRightTabs="+(r!=null)+", sidebarRight="+(n!=null)+"):\u8DF3\u8FC7\u4FA7\u680F\u6CE8\u518C"),!1;var t=re(e,"slots");if(e.effect(function(){return r.register({id:Ee,kind:ke,priority:"extension",patterns:["dsh-resource://file/**"],canOpen:function(a){return ue(U(a),xr())},title:function(a){if(J(a)||a===void 0||a===null||a==="")return"Code Server";var l=ce(a);return l===""?"Code Server":l},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A;\u4EA7\u7269/\u4EA4\u4ED8\u6587\u4EF6\u70B9\u51FB\u540E\u5728\u6B64\u6253\u5F00\u3002"},icon:br}]})},"code-server: sidebar tab type"),t!=null)e.effect(function(){return t.inject("sidebar.right.pane.tab",function(){return t.register({name:"sidebar.right.pane.tab",key:Ee},wr)})},"code-server: sidebar tab body");else return console.error("[code-server] slots \u670D\u52A1\u4E0D\u53EF\u89C1:\u4FA7\u680F\u6807\u7B7E body \u672A\u6CE8\u518C"),!1;return e.effect(function(){return function(){L({sidebarUi:"unknown"})}},"code-server: sidebar mode reset"),console.log("[code-server] right-sidebar tab registered (kind="+ke+")"),!0}var Er=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-card .dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-text{display:flex}.dshcs-text input{font:12px/1.5 ui-monospace,Consolas,monospace;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3,transparent);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:5px 8px;width:100%;min-width:0}.dshcs-text input:disabled{opacity:.5;cursor:default}.dshcs-text input:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-1px}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}.dshcs-cfgpage{display:flex;flex-direction:column;gap:0}.dshcs-cfgfoot{justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}",Sr="dsh-code-server/Card.module.css";function Cr(e,r){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var n=document.createElement("style");n.dataset.plugin="dsh-code-server",n.dataset.pluginCss=e,n.textContent=r,document.head.appendChild(n)}}Cr(Sr,Er);function Nr(e){return i.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},i.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function W(e){return i.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function Se(e){return i.createElement("label",{className:"dshcs-check"},i.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(r){e.onChange(r.target.checked)}}),i.createElement("span",{className:"dshcs-hint"},e.children))}function Or(e){return i.createElement("label",{className:"dshcs-text"},i.createElement("input",{type:"text",value:e.value,disabled:e.disabled===!0,spellCheck:!1,autoComplete:"off",placeholder:e.placeholder,onChange:function(r){e.onChange(r.target.value)}}))}function ne(e){var r=[];return e.overridden===!0&&(r.push(i.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),r.push(i.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),r.length===0?null:i.createElement("span",{className:"dshcs-badges"},...r)}function Ce(e){var[r,n]=i.useState(e.defaultOpen===!0),t=e.state;if(t==null||t.available!==!0)return null;var a=e.title,l=e.noticeOnly===!0,o=t.dirty!==!0||t.invalid===!0||t.saving===!0;return i.createElement("li",{className:"dshcs-card"+(r?" dshcs-cardOpen":"")},i.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":r,onClick:function(){n(!r)}},i.createElement("span",{className:"dshcs-cardHeadText"},i.createElement("span",{className:"dshcs-cardName"},a),i.createElement("span",{className:"dshcs-cardDescription"},e.description)),t.dirty===!0?i.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,i.createElement(Nr,{className:"dshcs-cardChevron"+(r?" dshcs-cardChevronOpen":"")})),r===!0?i.createElement("div",{className:"dshcs-cardBody"},l===!0?null:t.writable!==!0?i.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,l===!0?null:i.createElement("div",{className:"dshcs-cardFooter"},t.failed===!0?i.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,i.createElement(W,{disabled:t.dirty!==!0||t.saving===!0,onClick:e.onDiscard},e.discardLabel),i.createElement(W,{variant:"primary",disabled:o,onClick:e.onSave},t.saving===!0?e.savingLabel:e.saveLabel))):null)}function Te(e){try{let b=function(){y("/code-server/status").then(function(g){g!=null&&typeof g=="object"&&L({status:g})}).catch(function(){})};var r=e.scope,[n,t]=i.useState(function(){return r!==void 0?r.getSnapshot():null}),[a,l]=i.useState(null),[o,c]=i.useState(!1),[p,f]=i.useState(!1),x=se(),[v,w]=i.useState(me());if(i.useEffect(function(){return he(function(g){w(g)})},[]),i.useEffect(function(){if(r===void 0||typeof r.subscribe!="function")return;function g(){try{t(r.getSnapshot())}catch(Hr){}}var k=r.subscribe(g);return function(){typeof k=="function"&&k()}},[r]),r===void 0)return console.error("[code-server] card scope missing"),null;if(n==null||n.status!=="ready")return n!=null&&n.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",n.status),null;var d=n.value!==void 0&&n.value!==null?n.value:{},h=n.user,m={keepResident:d.keepResident!==!1,claimExtensions:typeof d.claimExtensions=="string"?d.claimExtensions:R,fullscreenOnOpen:d.fullscreenOnOpen!==!1};if(x!=null&&x.sidebarUi==="legacy")return i.createElement(Ce,{title:"Code Server",description:"\u5F53\u524D DSH \u7248\u672C\u4E0D\u53D7\u652F\u6301(\u7F3A\u5C11\u53F3\u4FA7\u680F\u670D\u52A1)",defaultOpen:!0,noticeOnly:!0,state:{available:!0,writable:!1,dirty:!1,invalid:!1,saving:!1,failed:!1}},i.createElement("div",{className:"dshcs-field"},i.createElement("div",{className:"dshcs-legacy"},"\u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH\u3002"),i.createElement("div",{className:"dshcs-hint",style:{marginTop:0}},`\u672A\u68C0\u6D4B\u5230\u53F3\u4FA7\u680F\u63D2\u4EF6\u670D\u52A1 sidebarRightTabs / sidebarRight,\u56E0\u6B64\u63D2\u4EF6\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3(\u65E7\u7248\u7684\u60AC\u6D6E\u7403\u4E0E\u6D6E\u52A8\u7A97\u53E3\u5DF2\u79FB\u9664),\u4E5F\u4E0D\u4F1A\u540E\u53F0\u542F\u52A8 IDE\u3002
3
+ \u5347\u7EA7 DSH \u5230\u5E26\u53F3\u4FA7\u680F\u7684\u7248\u672C(\u2265 0.1.5-alpha.1)\u540E,Code Server \u4F1A\u51FA\u73B0\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC,\u672C\u9875\u540C\u65F6\u663E\u793A\u5B8C\u6574\u8BBE\u7F6E\u9879;\u5347\u7EA7\u540E\u65E0\u9700\u91CD\u88C5\u672C\u63D2\u4EF6,\u5237\u65B0\u9875\u9762\u5373\u53EF\u3002`)));var E=h!=null&&Object.prototype.hasOwnProperty.call(h,"keepResident"),Y=h!=null&&Object.prototype.hasOwnProperty.call(h,"claimExtensions"),P=h!=null&&Object.prototype.hasOwnProperty.call(h,"fullscreenOnOpen"),C=a!==null&&(a.keepResident!==m.keepResident||A(a.claimExtensions)!==A(m.claimExtensions)||a.fullscreenOnOpen!==m.fullscreenOnOpen),_=!C||o,H={available:!0,writable:n.writable,dirty:C,invalid:!1,saving:o,failed:p};async function S(){if(C&&!o){c(!0),f(!1);try{var g=a!==null?a:m;await e.scope.set("keepResident",g.keepResident===!0),await e.scope.set("claimExtensions",A(g.claimExtensions)),await e.scope.set("fullscreenOnOpen",g.fullscreenOnOpen===!0),l(null),b()}catch(k){f(!0)}c(!1)}}async function N(){if(!(o||n.writable!==!0)){c(!0),f(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("keepResident"),await e.scope.unset("claimExtensions"),await e.scope.unset("fullscreenOnOpen")):(await e.scope.set("keepResident",d.keepResident===void 0||d.keepResident===null?!0:d.keepResident),await e.scope.set("claimExtensions",typeof d.claimExtensions=="string"?A(d.claimExtensions):R),await e.scope.set("fullscreenOnOpen",d.fullscreenOnOpen===void 0||d.fullscreenOnOpen===null?!0:d.fullscreenOnOpen)),l(null),b()}catch(g){f(!0)}c(!1)}}var M=[i.createElement("div",{className:"dshcs-field"},i.createElement("div",{className:"dshcs-fieldHead"},i.createElement("span",{className:"dshcs-fieldLabel"},"\u8BA4\u9886\u7C7B\u578B(\u6309\u6269\u5C55\u540D,\u5206\u53F7\u5206\u9694)"),Y===!0?i.createElement(ne,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){N()}}):null),i.createElement(Or,{value:a!==null?a.claimExtensions:m.claimExtensions,disabled:n.writable!==!0,placeholder:R,onChange:function(g){l(function(k){return Object.assign({},k!==null?k:m,{claimExtensions:g})}),f(!1)}}),i.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},"\u5199\u6269\u5C55\u540D(\u4E0D\u5E26\u70B9,\u5927\u5C0F\u5199\u968F\u610F);`*` = \u5176\u4F59\u7C7B\u578B\u4E5F\u8BA4\u9886;`!ext` = \u4E0D\u8BA4\u9886(\u6392\u9664\u4F18\u5148)\u3002\u4E0D\u518D\u533A\u5206\u4F1A\u8BDD\u5185/\u7EDD\u5BF9\u8DEF\u5F84 \u2014\u2014 \u6240\u6709 `dsh-resource://file/**` \u4E00\u89C6\u540C\u4EC1,\u672A\u8BA4\u9886\u7684\u843D\u56DE DSH \u81EA\u5E26\u9884\u89C8\u3002"),i.createElement("div",{className:"dshcs-hint",style:{marginTop:2}},"\u5B9E\u9645\u89C4\u5219:"+fe(a!==null?a.claimExtensions:m.claimExtensions)+(A(a!==null?a.claimExtensions:m.claimExtensions)!==(a!==null?a.claimExtensions:m.claimExtensions)?"(\u4FDD\u5B58\u540E\u5F52\u4E00\u5316)":"")+" \xB7 \u9ED8\u8BA4 "+R)),i.createElement("div",{className:"dshcs-field"},i.createElement("div",{className:"dshcs-fieldHead"},i.createElement("span",{className:"dshcs-fieldLabel"},"\u6253\u5F00\u5373\u5168\u5C4F(\u53F3\u4FA7\u680F\u94FA\u6EE1\u7A97\u53E3)"),P===!0?i.createElement(ne,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){N()}}):null),i.createElement(Se,{checked:a!==null?a.fullscreenOnOpen:m.fullscreenOnOpen,disabled:n.writable!==!0,onChange:function(g){l(function(k){return Object.assign({},k!==null?k:m,{fullscreenOnOpen:g===!0})}),f(!1)}},'\u6253\u5F00 Code Server \u6807\u7B7E(\u542B\u70B9\u5F00\u4EA7\u7269/\u4EA4\u4ED8\u6587\u4EF6)\u65F6,\u81EA\u52A8\u628A\u53F3\u4FA7\u680F\u4ECE"\u4E0E\u5BF9\u8BDD\u5E76\u6392"\u5207\u5230\u5168\u5C4F;\u60F3\u540C\u65F6\u770B\u5BF9\u8BDD\u5C31\u5173\u6389\u5B83,\u6216\u968F\u65F6\u70B9\u53F3\u4FA7\u680F\u7684\u300C\u9000\u51FA\u5168\u5C4F\u300D\u2014\u2014 \u672C\u6B21\u6253\u5F00\u4E0D\u4F1A\u88AB\u62A2\u56DE\u53BB'),i.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},'\u53EA\u5F71\u54CD"\u6253\u5F00\u90A3\u4E00\u523B":\u5207\u8D70\u518D\u5207\u56DE\u3001\u518D\u6B21\u6253\u5F00\u6587\u4EF6 tab \u4F1A\u91CD\u65B0\u5207\u5168\u5C4F;DSH \u672A\u5411\u63D2\u4EF6\u5F00\u653E\u6A21\u5F0F\u63A5\u53E3,\u672C\u9879\u7531\u70B9\u51FB\u53F3\u4FA7\u680F\u81EA\u8EAB\u7684\u300C\u5168\u5C4F\u300D\u6309\u94AE\u5B9E\u73B0\u3002')),i.createElement("div",{className:"dshcs-field"},i.createElement("div",{className:"dshcs-fieldHead"},i.createElement("span",{className:"dshcs-fieldLabel"},"\u540E\u53F0\u5E38\u9A7B(\u5207\u6807\u7B7E\u4E0D\u91CD\u8F7D)"),E===!0?i.createElement(ne,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){N()}}):null),i.createElement(Se,{checked:a!==null?a.keepResident:m.keepResident,disabled:n.writable!==!0,onChange:function(g){l(function(k){return Object.assign({},k!==null?k:m,{keepResident:g===!0})}),f(!1)}},'\u5F00\u542F\u540E\u5BBF\u4E3B\u542F\u52A8\u5373\u628A IDE \u52A0\u8F7D\u5230\u540E\u53F0"\u505C\u653E\u533A":\u5207\u6362\u53F3\u4FA7\u680F\u6807\u7B7E\u3001\u6536\u8D77/\u5C55\u5F00\u4FA7\u680F\u3001\u62D6\u6210\u6D6E\u52A8\u7A97\u53E3\u90FD\u4E0D\u518D\u91CD\u8F7D,\u9996\u6B21\u6253\u5F00\u514D\u7B49\u5F85;\u5173\u95ED\u5219\u53EA\u5728\u6253\u5F00\u9762\u677F\u65F6\u52A0\u8F7D(\u7701\u5185\u5B58)'),i.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},I?"\u5E38\u9A7B\u9762:"+(v.docked?"\u5DF2\u505C\u9760":v.ready?"\u5DF2\u505C\u653E(\u540E\u53F0\u8FD0\u884C\u4E2D)":"\u672A\u542F\u52A8")+(v.degraded?" \xB7 \u672C\u6B21\u53D1\u751F\u8FC7\u964D\u7EA7\u91CD\u8F7D":""):"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore(Chromium <133)\u2192 \u5E38\u9A7B\u4E0D\u53EF\u7528,\u5207\u6807\u7B7E\u4ECD\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u751F\u6548)"))];return e.seat==="bundle-config"?i.createElement("div",{className:"dshcs-cfgpage","data-code-server-config":"page"},n.writable!==!0?i.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002"):null,...M,p===!0?i.createElement("p",{className:"dshcs-cardFailed",role:"status"},"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002"):null,i.createElement("div",{className:"dshcs-cfgfoot"},i.createElement(W,{disabled:!C||o,onClick:function(){l(null),f(!1)}},"\u653E\u5F03\u4FEE\u6539"),i.createElement(W,{variant:"primary",disabled:_,onClick:function(){S()}},o===!0?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58"))):i.createElement(Ce,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1);\u8BA4\u9886\u7C7B\u578B\u51B3\u5B9A\u54EA\u4E9B\u6587\u4EF6\u4EA4\u7ED9 Code Server \u6253\u5F00",state:H,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:S,onDiscard:function(){l(null),f(!1)}},...M)}catch(b){return console.error("[code-server] card render error:",b!=null&&b.message!==void 0?b.message:String(b)),null}}function Lr(e){return e!=null&&e.view==="summary"?vr:i.createElement(Te,Object.assign({},e,{seat:"bundle-config"}))}var Ne=900,u={rev:-1,open:!1,mounted:!1,pending:null,el:null,body:null,title:null,timer:null,loading:!1};function Ar(e){if(!(e===null||typeof e!="object")){if(e.type==="ready"){T(!0);return}if(e.type==="ask"&&typeof e.text=="string"){y("/code-server/ask/send",{text:e.text,mode:u.pending===null?void 0:u.pending.mode}).then(function(r){u.rev=-1,T(!0)}).catch(function(){});return}if(e.type==="approve"&&typeof e.id=="string"){y("/code-server/ask/approve",{id:e.id,outcome:e.outcome}).then(function(r){r!=null&&r.ok===!1&&G(r.error||"\u6388\u6743\u63D0\u4EA4\u5931\u8D25"),u.rev=-1,T(!0)}).catch(function(r){G("\u6388\u6743\u63D0\u4EA4\u5931\u8D25:"+String(r&&r.message?r.message:r))});return}e.type==="close"&&Me()}}function T(e){if(u.el!==null){var r=window.__DSHCS_ASK_PUSH__;typeof r=="function"?r(u.pending):e===!0&&setTimeout(function(){T(!1)},120)}}function G(e){console.warn("[code-server] ask dialog:",e)}function Me(){u.open=!1,u.el!==null&&(u.el.style.display="none"),y("/code-server/ask/close",{}).catch(function(){})}function Re(){if(u.el===null){var e=document.createElement("div");e.className="dshcs-dialog",e.setAttribute("data-dshcs-dialog","ask"),e.style.cssText=["position:fixed","right:24px","bottom:24px","width:460px","height:600px","min-width:320px","min-height:280px","max-width:96vw","max-height:92vh","resize:both","overflow:hidden","display:none","z-index:2147483000","border-radius:10px","box-shadow:0 18px 48px rgba(0,0,0,.45)","border:1px solid var(--dsw-alias-border-l2, rgba(128,128,128,.4))","background:var(--dsw-alias-bg-base, var(--vscode-editor-background, #1e1e1e))"].join(";");var r=document.createElement("div");r.style.cssText="display:flex;align-items:center;gap:8px;padding:6px 10px;cursor:move;border-bottom:1px solid var(--dsw-alias-border-l1, rgba(128,128,128,.3));font:var(--dsw-font-markdown-base, 13px/20px sans-serif)";var n=document.createElement("span");n.textContent="DSH \u5BF9\u8BDD",n.style.cssText="font-weight:600;flex:none";var t=document.createElement("span");t.style.cssText="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary, rgba(128,128,128,.9));font-size:12px";var a=document.createElement("button");a.type="button",a.textContent="\u2715",a.title="\u5173\u95ED",a.setAttribute("aria-label","\u5173\u95ED"),a.style.cssText="flex:none;border:0;background:transparent;color:inherit;cursor:pointer;font-size:13px;line-height:1;padding:2px 6px;border-radius:4px",a.addEventListener("click",function(){Me()}),r.appendChild(n),r.appendChild(t),r.appendChild(a);var l=document.createElement("div");l.className="dshcs-panel",l.setAttribute("data-dshcs-ask-root",""),l.style.cssText="height:calc(100% - 33px);overflow:hidden",e.appendChild(r),e.appendChild(l),document.body.appendChild(e),u.el=e,u.body=l,u.title=t;var o=null;r.addEventListener("pointerdown",function(c){if(c.target!==a){var p=e.getBoundingClientRect();o={x:c.clientX,y:c.clientY,left:p.left,top:p.top},e.style.right="auto",e.style.bottom="auto",e.style.left=p.left+"px",e.style.top=p.top+"px";try{r.setPointerCapture(c.pointerId)}catch(f){}}}),r.addEventListener("pointermove",function(c){o!==null&&(e.style.left=Math.max(0,Math.min(window.innerWidth-80,o.left+(c.clientX-o.x)))+"px",e.style.top=Math.max(0,Math.min(window.innerHeight-40,o.top+(c.clientY-o.y)))+"px")}),r.addEventListener("pointerup",function(){o=null})}}var Ie="dshcs.ask.bundle",Tr=900*1e3,O=null;function ae(){try{var e=window.sessionStorage.getItem(Ie);if(e==null)return null;var r=JSON.parse(e);return r==null||typeof r.js!="string"||typeof r.css!="string"||Date.now()-Number(r.at||0)>Tr?null:{css:r.css,js:r.js}}catch(n){return null}}function je(e){try{window.sessionStorage.setItem(Ie,JSON.stringify({at:Date.now(),css:e.css,js:e.js}))}catch(r){}}function Mr(){if(!(O!==null||u.mounted)){var e=ae();if(e!==null){O=e;return}y("/code-server/ask/bundle").then(function(r){r==null||r.ok!==!0||(O={css:r.css,js:r.js},je(O),console.log("[code-server] ask bundle preloaded ("+Math.round((r.js.length+r.css.length)/1024)+"KB)"))}).catch(function(){})}}function Rr(){if(!(u.mounted||u.loading)){u.loading=!0;var e=O!==null?Promise.resolve(O):ae()!==null?Promise.resolve(ae()):y("/code-server/ask/bundle");e.then(function(r){u.loading=!1;var n=r;if(O===null&&r!=null&&r.ok===!0&&(n={css:r.css,js:r.js},O=n,je(n)),n==null||typeof n.js!="string"){G(n!=null&&n.error?n.error:"\u9762\u677F\u4EA7\u7269\u4E0D\u53EF\u7528");return}if(Re(),document.getElementById("dshcs-ask-style")===null){var t=document.createElement("style");t.id="dshcs-ask-style",t.textContent=n.css,document.head.appendChild(t)}window.__DSHCS_HOST__="dsh",window.__DSHCS_MOUNT__=u.body,window.acquireVsCodeApi=function(){return{postMessage:Ar}};var a=document.createElement("script");a.textContent=n.js,document.head.appendChild(a),u.mounted=!0,setTimeout(function(){T(!0)},60)}).catch(function(r){u.loading=!1,G("\u9762\u677F\u4EA7\u7269\u52A0\u8F7D\u5931\u8D25:"+String(r&&r.message?r.message:r))})}}function Oe(){y("/code-server/ask/state?rev="+u.rev).then(function(e){e==null||e.ok!==!0||e.changed===!0&&(u.rev=typeof e.rev=="number"?e.rev:-1,u.pending=e,e.open===!0?(Re(),u.el.style.display="block",u.title!==null&&(u.title.textContent=e.contextText||"\u6765\u81EA\u7F16\u8F91\u5668"),u.open=!0,Rr(),u.mounted&&T(!0)):u.el!==null&&(u.el.style.display="none",u.open=!1))}).catch(function(){})}function Ir(){u.timer===null&&(u.timer=setInterval(Oe,Ne),setTimeout(Oe,800),setTimeout(Mr,3e3),console.log("[code-server] ask dialog poller started (every "+Ne+"ms)"))}function jr(e){try{Dr(e),Ir()}catch(r){console.error("[code-server] apply failed:",r&&r.stack?r.stack:String(r));try{document.title="CS-ERR "+(r&&r.message||String(r))}catch(n){}}}function Dr(e){var r=e.get("slots");if(r===void 0){console.error("[code-server] slots service unavailable");return}var n=e.settingsScope,t=null;if(n!==void 0&&typeof n.bind=="function")t=n.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}y("/code-server/status").then(function(d){L({status:d})}).catch(function(){}),r.inject("plugins.bundle.config",()=>r.register({name:"plugins.bundle.config",key:pr,inject:function(){return{scope:t}}},Lr)),r.inject("settings.plugin.item",()=>r.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:t}}},Te));var a=!1;function l(d,h){if(!a){a=!0,x();var m=!1;try{m=kr(d)}catch(E){console.error("[code-server] sidebar tab registration failed:",E!=null&&E.message!=null?E.message:String(E))}z.sidebarUi==="legacy"&&(console.log("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u665A\u5230(\u7ECF "+h+"):\u64A4\u9500\u65E7\u7248 DSH \u5224\u5B9A"),y("/code-server/ui-mode",{sidebar:!0}).catch(function(){})),L({sidebarUi:"modern",sidebarRegisterFailed:m!==!0}),r.inject("shell.overlay",()=>r.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},E=>i.createElement(ur,E))),console.log("[code-server] client registered via "+h+": sidebar tab="+m+"(claims dsh-resource://file/**) + resident preload + settings card")}}function o(d){L({sidebarUi:"legacy"}),console.warn("[code-server] \u672A\u63A2\u6D4B\u5230\u53F3\u4FA7\u680F\u670D\u52A1(sidebarRightTabs/sidebarRight): \u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH \u2014\u2014 \u9664\u300C\u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server\u300D\u7684\u63D0\u793A\u5916\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3,\u4E5F\u4E0D\u9884\u70ED IDE\u3002\u8BF7\u5347\u7EA7 DSH\u3002"),d===!0&&y("/code-server/ui-mode",{sidebar:!1}).catch(function(){})}var c=null,p=null,f=null;function x(){c!==null&&(clearTimeout(c),c=null),p!==null&&(clearTimeout(p),p=null),f!==null&&(clearTimeout(f),f=null)}var v=!1;try{typeof e.inject=="function"&&(v=!0,e.inject(["sidebarRightTabs","sidebarRight"],function(d){l(d,"inject")}))}catch(d){console.warn("[code-server] sidebar inject failed:",d!=null&&d.message!=null?d.message:String(d))}var w=typeof e.get=="function"&&e.get("sidebarRightTabs")!==void 0&&e.get("sidebarRight")!==void 0;if(w){f=setTimeout(function(){a||(console.warn("[code-server] ctx.inject \u672A\u5728 1.5s \u5185\u56DE\u8C03,\u6539\u7528\u540C\u6B65\u670D\u52A1\u6CE8\u518C\u4FA7\u680F"),l(e,"sync-fallback"))},gr);return}if(v!==!0){o(!0);return}c=setTimeout(function(){a||o(!1)},hr),p=setTimeout(function(){a||o(!0)},mr)}var zr=["slots","settingsScope"],Pr="code-server";
4
4
  return module.exports;}});
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-code-server-app",
3
- "version": "0.3.49",
3
+ "version": "0.3.50",
4
4
  "description": "VS Code (from a code-server release) inside DSH: a right-sidebar tab driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs). Since 0.3.0 the bundle also ships an editor bridge (assets/extensions/dshcs-editor-bridge): a read-only channel between the in-tree VS Code extension host and DSH, giving the agent what only the editor knows (unsaved buffers, language-server diagnostics, the active selection) and letting editor gestures drive the session. Since 0.3.22 the ask panel renders that session's new content with DSH's own Markdown renderer (pinned to the deployed DSH UI version); since 0.3.23 it is a full-width dialog with collapsible thinking rows and can answer approval requests in place — the bridge's only non-read-only route (POST /approve, constrained to pending in-process requests and the outcomes allowed-once/rejected; panel-first for 5 minutes, handed back to the official card the moment the panel closes). The tab claims DSH file addresses (dsh-resource://file/**) by file type (setting claimExtensions), so the product's own produced-file chips, delivered-file previews and inline prose mentions open in the workbench. The IDE is a resident surface moved with Element.moveBefore instead of being remounted, so switching sidebar tabs no longer reloads it. Opening the tab switches the right sidebar to fullscreen by default (setting fullscreenOnOpen). Following a workspace switch is lightweight: the workbench re-navigates with the new ?folder= and the IDE process is not restarted (since 0.2.12). Requires a DSH with the right-sidebar services (sidebarRightTabs/sidebarRight, >= 0.1.5-alpha.1); older DSH versions get a single upgrade notice on the settings page and no other UI. Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). No code-server Node layer, no argon2, no C++ toolchain.",
5
5
  "homepage": "https://github.com/jinsiyu/dsh-code-server-app",
6
6
  "repository": {
@@ -190,6 +190,7 @@
190
190
  "test:workspace-switch": "node scripts/test-workspace-switch.mjs",
191
191
  "test:workspace-cwd": "node scripts/test-workspace-cwd.mjs",
192
192
  "test:client-cwd": "node scripts/test-client-bundle-cwd.mjs",
193
+ "test:client-seat": "node scripts/test-client-settings-seat.mjs",
193
194
  "test:dsh-resolve": "node scripts/test-dsh-resolve.mjs",
194
195
  "test:bridge-routes": "node scripts/test-bridge-routes.mjs",
195
196
  "test:bridge-extension": "node scripts/test-bridge-extension.mjs",
@@ -3,7 +3,7 @@
3
3
  "vscodeVersion": "1.137.0",
4
4
  "productPath": "stable-b11dabdaca0d3369986975be285db92c8795cea5",
5
5
  "layout": "vscode-only",
6
- "preparedAt": "2026-09-17T16:48:15.827Z",
6
+ "preparedAt": "2026-09-18T11:01:14.801Z",
7
7
  "source": "registry",
8
8
  "node": "v24.20.0",
9
9
  "platform": "linux",