@oneworks/client 0.1.0-beta.0 → 0.1.0-beta.2
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/dist/assets/{ActionSearchToolbar-8q-bk3mu.js → ActionSearchToolbar-DEGf2jhC.js} +1 -1
- package/dist/assets/{AgentRoomRoute-DfSI_dFH.js → AgentRoomRoute-q3zS46Sd.js} +1 -1
- package/dist/assets/{AgentRoomSessionRoute-DH9PdjZm.js → AgentRoomSessionRoute-DjPxv7X5.js} +1 -1
- package/dist/assets/{ArchiveRoute-E9-htB4H.js → ArchiveRoute-CLIn3VrK.js} +1 -1
- package/dist/assets/{AuthenticatedApp-CgBrvMuc.js → AuthenticatedApp-CjqSg3Fe.js} +192 -192
- package/dist/assets/{AutomationRoute-Bw2xw5bx.js → AutomationRoute-BUkrePKH.js} +1 -1
- package/dist/assets/{BenchmarkRoute-3VS17jHr.js → BenchmarkRoute-CuO0hJBU.js} +1 -1
- package/dist/assets/{ChatRoute-CBQ3j4Je.js → ChatRoute-Du5zkaQU.js} +1 -1
- package/dist/assets/{Collapse-B-oCiEx4.js → Collapse-v6rPK_Og.js} +1 -1
- package/dist/assets/{ComposerLanding-SZn_zRGX.js → ComposerLanding-Yr0ydPHI.js} +1 -1
- package/dist/assets/{ConfigRoute-Dv-7BRGG.js → ConfigRoute-C3uzNXG_.js} +1 -1
- package/dist/assets/{InteractionStructureRoute-FDl9jRvT.js → InteractionStructureRoute-Db6Csunn.js} +1 -1
- package/dist/assets/{KnowledgeRoute-C5em_VSL.js → KnowledgeRoute-qqkXU5WL.js} +1 -1
- package/dist/assets/{LauncherApp-olYmK_zO.js → LauncherApp-Qvdl-Yj8.js} +2 -2
- package/dist/assets/{LauncherRoute-Qt8dQkIk.js → LauncherRoute-DZWkoiJw.js} +1 -1
- package/dist/assets/{MobileAwareSelect-BmK6WApn.js → MobileAwareSelect-C3a67aGF.js} +1 -1
- package/dist/assets/{ModuleManagementRoute-B1I_8JKc.js → ModuleManagementRoute-Cy4wuohf.js} +1 -1
- package/dist/assets/{NotFoundRoute-Bj6_YY3I.js → NotFoundRoute-ChcyVvqJ.js} +1 -1
- package/dist/assets/{PluginStoreRoute-B847PAZ5.js → PluginStoreRoute-DdiK4aa2.js} +1 -1
- package/dist/assets/{RouteContainerPanelTabs-BnIptVwq.js → RouteContainerPanelTabs-jxh2d8jI.js} +1 -1
- package/dist/assets/{SchemaObjectEditor-B9fPfDyT.js → SchemaObjectEditor-COAQ7p3E.js} +1 -1
- package/dist/assets/{StandaloneMobileDebugRoute-BR4w_LeM.js → StandaloneMobileDebugRoute-CB3AJiyj.js} +1 -1
- package/dist/assets/StandaloneMobileDebugRoute-Cz0tNyI6.css +1 -0
- package/dist/assets/{WorkspaceApp-BNmtIdn4.js → WorkspaceApp-CokR7Tpr.js} +3 -3
- package/dist/assets/{agent-room-session-paths-Dca8S6NN.js → agent-room-session-paths-CDJw-DoF.js} +3 -3
- package/dist/assets/{arc-JBUpUV6M.js → arc-f6ab2s7J.js} +1 -1
- package/dist/assets/{blockDiagram-c4efeb88-DKhNwgEQ.js → blockDiagram-c4efeb88-DuND8Id_.js} +1 -1
- package/dist/assets/{c4Diagram-c83219d4-CWODEGms.js → c4Diagram-c83219d4-CrENVa9z.js} +1 -1
- package/dist/assets/channel-CE7hI28G.js +1 -0
- package/dist/assets/{classDiagram-beda092f-DlghsOqF.js → classDiagram-beda092f-DLPG6RB7.js} +1 -1
- package/dist/assets/{classDiagram-v2-2358418a-CrSR8gWz.js → classDiagram-v2-2358418a-BKv3EDtT.js} +1 -1
- package/dist/assets/client-build-info-tgdsIlyX.js +1 -0
- package/dist/assets/clone-Ddl6jS9o.js +1 -0
- package/dist/assets/{createText-1719965b-CLlPr73k.js → createText-1719965b-NwleWdyg.js} +1 -1
- package/dist/assets/{cssMode-Bt_74RVV.js → cssMode-ww9pyNNv.js} +1 -1
- package/dist/assets/{dockPanelConstants-BWuu_DJp.js → dockPanelConstants-CW3M3t4v.js} +1 -1
- package/dist/assets/{edges-96097737-L_gy1fky.js → edges-96097737-D8fX9hn5.js} +1 -1
- package/dist/assets/{erDiagram-0228fc6a-X1QMD6me.js → erDiagram-0228fc6a-HDOuPZk2.js} +1 -1
- package/dist/assets/{flowDb-c6c81e3f-DNdWK0Po.js → flowDb-c6c81e3f-CnExuc5d.js} +1 -1
- package/dist/assets/{flowDiagram-50d868cf-C2khStgw.js → flowDiagram-50d868cf-DZV01cOD.js} +1 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-Tygi-b2q.js +1 -0
- package/dist/assets/{flowchart-elk-definition-6af322e1-C89sxd2D.js → flowchart-elk-definition-6af322e1-rMtb8Q3Q.js} +1 -1
- package/dist/assets/{freemarker2-DZ1XIuHj.js → freemarker2-CtQwsBbf.js} +1 -1
- package/dist/assets/{ganttDiagram-a2739b55-Ba3rPNKd.js → ganttDiagram-a2739b55-BPZWVVUB.js} +1 -1
- package/dist/assets/{gitGraphDiagram-82fe8481-DTEFHHtN.js → gitGraphDiagram-82fe8481-DF7pLuMJ.js} +1 -1
- package/dist/assets/{graph-BPujwFoF.js → graph-DKmOtEDg.js} +1 -1
- package/dist/assets/{handlebars-lOgsnnQw.js → handlebars-nX8yIw3l.js} +1 -1
- package/dist/assets/{html-DLHadu9L.js → html-CbuZuRXh.js} +1 -1
- package/dist/assets/{htmlMode-VeiQ-IsQ.js → htmlMode-CJH80z5n.js} +1 -1
- package/dist/assets/{index-5325376f-Cx2RM6pk.js → index-5325376f-DEHuhQF_.js} +1 -1
- package/dist/assets/{index-DBUG8CzV.js → index-CPxqxItX.js} +1 -1
- package/dist/assets/{index-sFqkb8xv.js → index-CqhgNUy-.js} +1 -1
- package/dist/assets/{index-CJEVYkL9.js → index-DOj3DlsY.js} +1 -1
- package/dist/assets/{index-Cp4GfHnF.js → index-DgZk1SFp.js} +27 -27
- package/dist/assets/{index-CBFCjoHv.js → index-DnQoX9ZY.js} +1 -1
- package/dist/assets/{index-D4eelxQF.js → index-JwN0oF3c.js} +1 -1
- package/dist/assets/{index-CWmEuVWV.js → index-aZ1QdVqZ.js} +1 -1
- package/dist/assets/{infoDiagram-8eee0895-Bj9hWnDg.js → infoDiagram-8eee0895-CZD8lkRQ.js} +1 -1
- package/dist/assets/interaction-panel-mobile-debug-pages-Bu5Kh4-Z.css +1 -0
- package/dist/assets/interaction-panel-mobile-debug-pages-CT5eb8Gd.js +171 -0
- package/dist/assets/{javascript-CXJw-bvU.js → javascript-CxKLYDBQ.js} +1 -1
- package/dist/assets/{journeyDiagram-c64418c1-BXAycrrn.js → journeyDiagram-c64418c1-BMaEeakR.js} +1 -1
- package/dist/assets/{jsonMode-DmUNJfpX.js → jsonMode-DIC-5Lwr.js} +1 -1
- package/dist/assets/{layout-Bp8GVMnq.js → layout-Q0dn6j1W.js} +1 -1
- package/dist/assets/{line-olpPNgnh.js → line-BqB1JWak.js} +1 -1
- package/dist/assets/{linear-flh_7ux_.js → linear-VTwyGoCc.js} +1 -1
- package/dist/assets/{liquid-BiVpRgBP.js → liquid-DNvVNW0k.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-olWF83eX.js → lspLanguageFeatures-DeOzllRF.js} +1 -1
- package/dist/assets/{mdx-B5dr7YB-.js → mdx-C98MqvlS.js} +1 -1
- package/dist/assets/{mermaid.core-NVIiXnRA.js → mermaid.core-DBYO3wup.js} +4 -4
- package/dist/assets/{mindmap-definition-8da855dc-BOCh8K8K.js → mindmap-definition-8da855dc-D9C_cL3R.js} +1 -1
- package/dist/assets/{pieDiagram-a8764435-CCitKBQK.js → pieDiagram-a8764435-FVnh07ga.js} +1 -1
- package/dist/assets/{project-file-tree-icons-DqqhgvoI.js → project-file-tree-icons-Iz30jDs3.js} +1 -1
- package/dist/assets/{python-BkEOPIle.js → python-Emg9kCcG.js} +1 -1
- package/dist/assets/{quadrantDiagram-1e28029f-C_FvcHzZ.js → quadrantDiagram-1e28029f-DKEnlnQE.js} +1 -1
- package/dist/assets/{razor-BCMQgdis.js → razor-BebYpuFx.js} +1 -1
- package/dist/assets/{requirementDiagram-08caed73-B001ugYd.js → requirementDiagram-08caed73-BHVdwyn8.js} +1 -1
- package/dist/assets/{route-plugin-chrome-B-Goj3vG.js → route-plugin-chrome-DI32l8cC.js} +1 -1
- package/dist/assets/{sankeyDiagram-a04cb91d-BnkC9YW5.js → sankeyDiagram-a04cb91d-COhhpvg5.js} +1 -1
- package/dist/assets/{sequenceDiagram-c5b8d532-BGiFCs5z.js → sequenceDiagram-c5b8d532-CfjihR0y.js} +1 -1
- package/dist/assets/{shortcutUtils-20iqPDwh.js → shortcutUtils-HFKOHIG8.js} +1 -1
- package/dist/assets/{stateDiagram-1ecb1508-Uk4XxTkP.js → stateDiagram-1ecb1508-BjgwBAXi.js} +1 -1
- package/dist/assets/{stateDiagram-v2-c2b004d7-Db6Ouywh.js → stateDiagram-v2-c2b004d7-D3w7Spww.js} +1 -1
- package/dist/assets/{styles-b4e223ce-CfG45yIm.js → styles-b4e223ce-BOAkdyMQ.js} +1 -1
- package/dist/assets/{styles-ca3715f6-BGGbMvKc.js → styles-ca3715f6-CcZFkBde.js} +1 -1
- package/dist/assets/{styles-d45a18b0-mHteeqS2.js → styles-d45a18b0-HXDBEoho.js} +1 -1
- package/dist/assets/{svgDrawCommon-b86b1483-BAMR2PsF.js → svgDrawCommon-b86b1483-CyvFXNjU.js} +1 -1
- package/dist/assets/{timeline-definition-faaaa080-DLBoPuJD.js → timeline-definition-faaaa080-CKFw-bXV.js} +1 -1
- package/dist/assets/{tsMode-BTzZ8Zos.js → tsMode-B7ZLt3D7.js} +1 -1
- package/dist/assets/{typescript-_rLmAd51.js → typescript-BI4b07nJ.js} +1 -1
- package/dist/assets/{use-app-preferences-gyulV-hA.js → use-app-preferences-BZCemhY7.js} +1 -1
- package/dist/assets/{use-chat-session-actions-DDZ5KCua.js → use-chat-session-actions-BNmm_R8s.js} +1 -1
- package/dist/assets/{vendor-state-BYwEPTaO.js → vendor-state-Djj0Jjxr.js} +1 -1
- package/dist/assets/{workspace-file-openers-BwZ5cSeq.js → workspace-file-openers-yFyhcWXX.js} +1 -1
- package/dist/assets/{xml-BAU8TJ-c.js → xml--qVpqb-2.js} +1 -1
- package/dist/assets/{xychartDiagram-f5964ef8-CNfcxTsi.js → xychartDiagram-f5964ef8-v75Tkx5A.js} +1 -1
- package/dist/assets/{yaml-_cphTIn0.js → yaml-CkA7Z41y.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +17 -17
- package/dist/assets/StandaloneMobileDebugRoute-DuOLjUb9.css +0 -1
- package/dist/assets/channel-BsuHYNQO.js +0 -1
- package/dist/assets/client-build-info-bcijLdfD.js +0 -1
- package/dist/assets/clone-BKV6leIk.js +0 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-DW5hyUju.js +0 -1
- package/dist/assets/interaction-panel-mobile-debug-pages-1Gdivksn.js +0 -113
- package/dist/assets/interaction-panel-mobile-debug-pages-8AAd4Csf.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,R as qt,c as dr,j as Ue}from"./vendor-react-CnooHTJc.js";import{b8 as $a,b9 as Oa,ba as So,bb as Co,ac as xo,P as Eo,bc as Gn,aY as B,bd as or,b2 as rn,L as Ro,Y as Fe,aa as Tr,aW as J,b6 as Lt,be as Lr,bf as An,ag as St,bg as $o,bh as zr,C as Ia,h as Cn,j as ye,bi as Ee,aV as wt,O as Ht,e as ct,bj as Ma,Q as Cr,b5 as sn,aX as Te,x as Vn,bk as Pa,bl as fr,a4 as _a,w as gt,bm as vr,bn as xr,bo as Er,bp as Oo,bq as Na,br as Da,a5 as Io,bs as Ta,d as qn,Z as Rr,bt as Hn,l as Xn,m as Xt,E as _n,H as La,bu as za,r as Yn,bv as mr,o as Ve,bw as Mo,aZ as ja,X as $r,a1 as Ha,bx as Ba,a0 as Aa,b4 as Or,b3 as Va,q as Wa,M as Fa,G as Ka,A as Ua,by as Ir,bz as Wn,bA as ka,a8 as Ga,bB as qa,ad as Xa,bC as Po,bD as Ya,bE as jr,bF as Za,bG as Qa,bH as Ja}from"./index-Cp4GfHnF.js";import{u as ei}from"./vendor-state-BYwEPTaO.js";var gr=o.createContext(null);function ti(e){var t=e.children,n=e.onBatchResize,r=o.useRef(0),a=o.useRef([]),i=o.useContext(gr),l=o.useCallback(function(s,c,u){r.current+=1;var v=r.current;a.current.push({size:s,element:c,data:u}),Promise.resolve().then(function(){v===r.current&&(n==null||n(a.current),a.current=[])}),i==null||i(s,c,u)},[n,i]);return o.createElement(gr.Provider,{value:l},t)}var _o=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(a,i){return a[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},t.prototype.set=function(n,r){var a=e(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,a=e(r,n);~a&&r.splice(a,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,i=this.__entries__;a<i.length;a++){var l=i[a];n.call(r,l[1],l[0])}},t}()}(),hr=typeof window<"u"&&typeof document<"u"&&window.document===document,Fn=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),ni=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Fn):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ri=2;function oi(e,t){var n=!1,r=!1,a=0;function i(){n&&(n=!1,e()),r&&s()}function l(){ni(i)}function s(){var c=Date.now();if(n){if(c-a<ri)return;r=!0}else n=!0,r=!1,setTimeout(l,t);a=c}return s}var ai=20,ii=["top","right","bottom","left","width","height","size","weight"],li=typeof MutationObserver<"u",si=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=oi(this.refresh.bind(this),ai)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!hr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),li?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!hr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,a=ii.some(function(i){return!!~r.indexOf(i)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),No=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},Sn=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Fn},Do=Zn(0,0,0,0);function Kn(e){return parseFloat(e)||0}function Hr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,a){var i=e["border-"+a+"-width"];return r+Kn(i)},0)}function ci(e){for(var t=["top","right","bottom","left"],n={},r=0,a=t;r<a.length;r++){var i=a[r],l=e["padding-"+i];n[i]=Kn(l)}return n}function ui(e){var t=e.getBBox();return Zn(0,0,t.width,t.height)}function di(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Do;var r=Sn(e).getComputedStyle(e),a=ci(r),i=a.left+a.right,l=a.top+a.bottom,s=Kn(r.width),c=Kn(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=Hr(r,"left","right")+i),Math.round(c+l)!==n&&(c-=Hr(r,"top","bottom")+l)),!vi(e)){var u=Math.round(s+i)-t,v=Math.round(c+l)-n;Math.abs(u)!==1&&(s-=u),Math.abs(v)!==1&&(c-=v)}return Zn(a.left,a.top,s,c)}var fi=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Sn(e).SVGGraphicsElement}:function(e){return e instanceof Sn(e).SVGElement&&typeof e.getBBox=="function"}}();function vi(e){return e===Sn(e).document.documentElement}function mi(e){return hr?fi(e)?ui(e):di(e):Do}function gi(e){var t=e.x,n=e.y,r=e.width,a=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,l=Object.create(i.prototype);return No(l,{x:t,y:n,width:r,height:a,top:n,right:t+r,bottom:a+n,left:t}),l}function Zn(e,t,n,r){return{x:e,y:t,width:n,height:r}}var hi=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Zn(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=mi(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),pi=function(){function e(t,n){var r=gi(n);No(this,{target:t,contentRect:r})}return e}(),bi=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new _o,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Sn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new hi(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Sn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new pi(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),To=typeof WeakMap<"u"?new WeakMap:new _o,Lo=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=si.getInstance(),r=new bi(t,n,this);To.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Lo.prototype[e]=function(){var t;return(t=To.get(this))[e].apply(t,arguments)}});var yi=function(){return typeof Fn.ResizeObserver<"u"?Fn.ResizeObserver:Lo}(),nn=new Map;function wi(e){e.forEach(function(t){var n,r=t.target;(n=nn.get(r))===null||n===void 0||n.forEach(function(a){return a(r)})})}var zo=new yi(wi);function Si(e,t){nn.has(e)||(nn.set(e,new Set),zo.observe(e)),nn.get(e).add(t)}function Ci(e,t){nn.has(e)&&(nn.get(e).delete(t),nn.get(e).size||(zo.unobserve(e),nn.delete(e)))}var xi=function(e){$a(n,e);var t=Oa(n);function n(){return So(this,n),t.apply(this,arguments)}return Co(n,[{key:"render",value:function(){return this.props.children}}]),n}(o.Component);function Ei(e,t){var n=e.children,r=e.disabled,a=o.useRef(null),i=o.useRef(null),l=o.useContext(gr),s=typeof n=="function",c=s?n(a):n,u=o.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),v=!s&&o.isValidElement(c)&&xo(c),f=v?Eo(c):null,h=Gn(f,a),d=function(){var b;return or(a.current)||(a.current&&rn(a.current)==="object"?or((b=a.current)===null||b===void 0?void 0:b.nativeElement):null)||or(i.current)};o.useImperativeHandle(t,function(){return d()});var g=o.useRef(e);g.current=e;var m=o.useCallback(function(p){var b=g.current,y=b.onResize,C=b.data,w=p.getBoundingClientRect(),_=w.width,S=w.height,O=p.offsetWidth,P=p.offsetHeight,L=Math.floor(_),K=Math.floor(S);if(u.current.width!==L||u.current.height!==K||u.current.offsetWidth!==O||u.current.offsetHeight!==P){var Y={width:L,height:K,offsetWidth:O,offsetHeight:P};u.current=Y;var V=O===Math.round(_)?_:O,te=P===Math.round(S)?S:P,U=B(B({},Y),{},{offsetWidth:V,offsetHeight:te});l==null||l(U,p,C),y&&Promise.resolve().then(function(){y(U,p)})}},[]);return o.useEffect(function(){var p=d();return p&&!r&&Si(p,m),function(){return Ci(p,m)}},[a.current,r]),o.createElement(xi,{ref:i},v?o.cloneElement(c,{ref:h}):c)}var Ri=o.forwardRef(Ei),$i="rc-observer-key";function Oi(e,t){var n=e.children,r=typeof n=="function"?[n]:Ro(n);return r.map(function(a,i){var l=(a==null?void 0:a.key)||"".concat($i,"-").concat(i);return o.createElement(Ri,Fe({},e,{key:l,ref:i===0?t:void 0}),a)})}var un=o.forwardRef(Oi);un.Collection=ti;function ar(e){return e!==void 0}function Mn(e,t){var n=t||{},r=n.defaultValue,a=n.value,i=n.onChange,l=n.postState,s=Tr(function(){return ar(a)?a:ar(r)?typeof r=="function"?r():r:typeof e=="function"?e():e}),c=J(s,2),u=c[0],v=c[1],f=a!==void 0?a:u,h=l?l(f):f,d=Lt(i),g=Tr([f]),m=J(g,2),p=m[0],b=m[1];Lr(function(){var C=p[0];u!==C&&d(u,C)},[p]),Lr(function(){ar(a)||v(a)},[a]);var y=Lt(function(C,w){v(C,w),b([f],w)});return[h,y]}function Ii(e,t){return An.reduce((n,r)=>{const a=e[`${r}1`],i=e[`${r}3`],l=e[`${r}6`],s=e[`${r}7`];return Object.assign(Object.assign({},n),t(r,{lightColor:a,lightBorderColor:i,darkColor:l,textColor:s}))},{})}const lu=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
1
|
+
import{r as o,R as qt,c as dr,j as Ue}from"./vendor-react-CnooHTJc.js";import{b8 as $a,b9 as Oa,ba as So,bb as Co,ac as xo,P as Eo,bc as Gn,aY as B,bd as or,b2 as rn,L as Ro,Y as Fe,aa as Tr,aW as J,b6 as Lt,be as Lr,bf as An,ag as St,bg as $o,bh as zr,C as Ia,h as Cn,j as ye,bi as Ee,aV as wt,O as Ht,e as ct,bj as Ma,Q as Cr,b5 as sn,aX as Te,x as Vn,bk as Pa,bl as fr,a4 as _a,w as gt,bm as vr,bn as xr,bo as Er,bp as Oo,bq as Na,br as Da,a5 as Io,bs as Ta,d as qn,Z as Rr,bt as Hn,l as Xn,m as Xt,E as _n,H as La,bu as za,r as Yn,bv as mr,o as Ve,bw as Mo,aZ as ja,X as $r,a1 as Ha,bx as Ba,a0 as Aa,b4 as Or,b3 as Va,q as Wa,M as Fa,G as Ka,A as Ua,by as Ir,bz as Wn,bA as ka,a8 as Ga,bB as qa,ad as Xa,bC as Po,bD as Ya,bE as jr,bF as Za,bG as Qa,bH as Ja}from"./index-DgZk1SFp.js";import{u as ei}from"./vendor-state-Djj0Jjxr.js";var gr=o.createContext(null);function ti(e){var t=e.children,n=e.onBatchResize,r=o.useRef(0),a=o.useRef([]),i=o.useContext(gr),l=o.useCallback(function(s,c,u){r.current+=1;var v=r.current;a.current.push({size:s,element:c,data:u}),Promise.resolve().then(function(){v===r.current&&(n==null||n(a.current),a.current=[])}),i==null||i(s,c,u)},[n,i]);return o.createElement(gr.Provider,{value:l},t)}var _o=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(a,i){return a[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},t.prototype.set=function(n,r){var a=e(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,a=e(r,n);~a&&r.splice(a,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,i=this.__entries__;a<i.length;a++){var l=i[a];n.call(r,l[1],l[0])}},t}()}(),hr=typeof window<"u"&&typeof document<"u"&&window.document===document,Fn=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),ni=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Fn):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ri=2;function oi(e,t){var n=!1,r=!1,a=0;function i(){n&&(n=!1,e()),r&&s()}function l(){ni(i)}function s(){var c=Date.now();if(n){if(c-a<ri)return;r=!0}else n=!0,r=!1,setTimeout(l,t);a=c}return s}var ai=20,ii=["top","right","bottom","left","width","height","size","weight"],li=typeof MutationObserver<"u",si=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=oi(this.refresh.bind(this),ai)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!hr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),li?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!hr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,a=ii.some(function(i){return!!~r.indexOf(i)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),No=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},Sn=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Fn},Do=Zn(0,0,0,0);function Kn(e){return parseFloat(e)||0}function Hr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,a){var i=e["border-"+a+"-width"];return r+Kn(i)},0)}function ci(e){for(var t=["top","right","bottom","left"],n={},r=0,a=t;r<a.length;r++){var i=a[r],l=e["padding-"+i];n[i]=Kn(l)}return n}function ui(e){var t=e.getBBox();return Zn(0,0,t.width,t.height)}function di(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Do;var r=Sn(e).getComputedStyle(e),a=ci(r),i=a.left+a.right,l=a.top+a.bottom,s=Kn(r.width),c=Kn(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=Hr(r,"left","right")+i),Math.round(c+l)!==n&&(c-=Hr(r,"top","bottom")+l)),!vi(e)){var u=Math.round(s+i)-t,v=Math.round(c+l)-n;Math.abs(u)!==1&&(s-=u),Math.abs(v)!==1&&(c-=v)}return Zn(a.left,a.top,s,c)}var fi=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Sn(e).SVGGraphicsElement}:function(e){return e instanceof Sn(e).SVGElement&&typeof e.getBBox=="function"}}();function vi(e){return e===Sn(e).document.documentElement}function mi(e){return hr?fi(e)?ui(e):di(e):Do}function gi(e){var t=e.x,n=e.y,r=e.width,a=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,l=Object.create(i.prototype);return No(l,{x:t,y:n,width:r,height:a,top:n,right:t+r,bottom:a+n,left:t}),l}function Zn(e,t,n,r){return{x:e,y:t,width:n,height:r}}var hi=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Zn(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=mi(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),pi=function(){function e(t,n){var r=gi(n);No(this,{target:t,contentRect:r})}return e}(),bi=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new _o,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Sn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new hi(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Sn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new pi(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),To=typeof WeakMap<"u"?new WeakMap:new _o,Lo=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=si.getInstance(),r=new bi(t,n,this);To.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Lo.prototype[e]=function(){var t;return(t=To.get(this))[e].apply(t,arguments)}});var yi=function(){return typeof Fn.ResizeObserver<"u"?Fn.ResizeObserver:Lo}(),nn=new Map;function wi(e){e.forEach(function(t){var n,r=t.target;(n=nn.get(r))===null||n===void 0||n.forEach(function(a){return a(r)})})}var zo=new yi(wi);function Si(e,t){nn.has(e)||(nn.set(e,new Set),zo.observe(e)),nn.get(e).add(t)}function Ci(e,t){nn.has(e)&&(nn.get(e).delete(t),nn.get(e).size||(zo.unobserve(e),nn.delete(e)))}var xi=function(e){$a(n,e);var t=Oa(n);function n(){return So(this,n),t.apply(this,arguments)}return Co(n,[{key:"render",value:function(){return this.props.children}}]),n}(o.Component);function Ei(e,t){var n=e.children,r=e.disabled,a=o.useRef(null),i=o.useRef(null),l=o.useContext(gr),s=typeof n=="function",c=s?n(a):n,u=o.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),v=!s&&o.isValidElement(c)&&xo(c),f=v?Eo(c):null,h=Gn(f,a),d=function(){var b;return or(a.current)||(a.current&&rn(a.current)==="object"?or((b=a.current)===null||b===void 0?void 0:b.nativeElement):null)||or(i.current)};o.useImperativeHandle(t,function(){return d()});var g=o.useRef(e);g.current=e;var m=o.useCallback(function(p){var b=g.current,y=b.onResize,C=b.data,w=p.getBoundingClientRect(),_=w.width,S=w.height,O=p.offsetWidth,P=p.offsetHeight,L=Math.floor(_),K=Math.floor(S);if(u.current.width!==L||u.current.height!==K||u.current.offsetWidth!==O||u.current.offsetHeight!==P){var Y={width:L,height:K,offsetWidth:O,offsetHeight:P};u.current=Y;var V=O===Math.round(_)?_:O,te=P===Math.round(S)?S:P,U=B(B({},Y),{},{offsetWidth:V,offsetHeight:te});l==null||l(U,p,C),y&&Promise.resolve().then(function(){y(U,p)})}},[]);return o.useEffect(function(){var p=d();return p&&!r&&Si(p,m),function(){return Ci(p,m)}},[a.current,r]),o.createElement(xi,{ref:i},v?o.cloneElement(c,{ref:h}):c)}var Ri=o.forwardRef(Ei),$i="rc-observer-key";function Oi(e,t){var n=e.children,r=typeof n=="function"?[n]:Ro(n);return r.map(function(a,i){var l=(a==null?void 0:a.key)||"".concat($i,"-").concat(i);return o.createElement(Ri,Fe({},e,{key:l,ref:i===0?t:void 0}),a)})}var un=o.forwardRef(Oi);un.Collection=ti;function ar(e){return e!==void 0}function Mn(e,t){var n=t||{},r=n.defaultValue,a=n.value,i=n.onChange,l=n.postState,s=Tr(function(){return ar(a)?a:ar(r)?typeof r=="function"?r():r:typeof e=="function"?e():e}),c=J(s,2),u=c[0],v=c[1],f=a!==void 0?a:u,h=l?l(f):f,d=Lt(i),g=Tr([f]),m=J(g,2),p=m[0],b=m[1];Lr(function(){var C=p[0];u!==C&&d(u,C)},[p]),Lr(function(){ar(a)||v(a)},[a]);var y=Lt(function(C,w){v(C,w),b([f],w)});return[h,y]}function Ii(e,t){return An.reduce((n,r)=>{const a=e[`${r}1`],i=e[`${r}3`],l=e[`${r}6`],s=e[`${r}7`];return Object.assign(Object.assign({},n),t(r,{lightColor:a,lightBorderColor:i,darkColor:l,textColor:s}))},{})}const lu=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
2
2
|
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
3
3
|
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),Mi=new St("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Pi=new St("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),_i=new St("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ni=new St("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Di=new St("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ti=new St("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Li=new St("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),zi=new St("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),ji={"move-up":{inKeyframes:Li,outKeyframes:zi},"move-down":{inKeyframes:Mi,outKeyframes:Pi},"move-left":{inKeyframes:_i,outKeyframes:Ni},"move-right":{inKeyframes:Di,outKeyframes:Ti}},Br=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:a,outKeyframes:i}=ji[t];return[$o(r,a,i,e.motionDurationMid),{[`
|
|
4
4
|
${r}-enter,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as mn,h as cn,r as u,j as a}from"./vendor-react-CnooHTJc.js";import{aI as gn,aD as G,B as ne}from"./index-
|
|
1
|
+
import{u as mn,h as cn,r as u,j as a}from"./vendor-react-CnooHTJc.js";import{aI as gn,aD as G,B as ne}from"./index-DgZk1SFp.js";import{e as pn,bD as hn,bE as ae,bF as vn,f as Ce,R as wn,Q as W,T as _n}from"./AuthenticatedApp-CjqSg3Fe.js";import{M as C}from"./route-plugin-chrome-DI32l8cC.js";import{u as fn}from"./vendor-state-Djj0Jjxr.js";import{T as S}from"./MobileAwareSelect-C3a67aGF.js";import{D as le}from"./shortcutUtils-HFKOHIG8.js";import{A as bn,C as xn}from"./Collapse-v6rPK_Og.js";import{S as yn}from"./WorkspaceApp-CokR7Tpr.js";import"./use-app-preferences-BZCemhY7.js";import"./project-file-tree-icons-Iz30jDs3.js";import"./index-aZ1QdVqZ.js";import"./client-build-info-tgdsIlyX.js";const te=(l,e)=>l??e,kn=l=>{var e;return((e=l.split(`
|
|
2
2
|
`).map(s=>s.trim()).filter(s=>s!=="").find(s=>!s.startsWith("#")))==null?void 0:e.replace(/^[-*]\s+/,"").replace(/^#+\s*/,""))??""},Cn=["stable","rc","beta","alpha"],ie=["core","adapter","plugin"],jn=new Set(["adapter","core"]),Un=(l,e)=>{var s,i;return{from:((s=l.changelog)==null?void 0:s.fromVersion)??l.currentVersion??e,to:((i=l.changelog)==null?void 0:i.toVersion)??l.latestVersion??e}},Nn=l=>l.replace(/`/g,"\\`"),je=l=>l.trim(),Mn=l=>{var e,s;typeof window>"u"||l===""||(s=(e=window.oneworksDesktop)==null?void 0:e.openExternalUrl)==null||s.call(e,l)},re=l=>l.replace(/!\[[^\]]*\]\([^)]+\)/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").trim(),Ue=["feature","fix","other"],Sn={feature:["breaking","feature","highlight","improve","support","主要变更","优化","功能","新增","支持","改进","破坏性","重要","重点"],fix:["bug","fix","修复","修正","问题","错误"],other:["other","test","verification","其他","测试","验证"]},Le=["breaking changes","feature changes","important changes","other changes","主要变更","功能更新","其他调整","breaking","features","important","fixes","other","tests","verification","feature","fix","test","重点","重要","破坏性","新增","修复","验证","测试"],Ln=new Set(Le.map(l=>l.toLowerCase())),$n=[...Le].sort((l,e)=>e.length-l.length),se=(l,e)=>Sn[e].some(s=>l.includes(s)),de=l=>Ln.has(l.trim().toLowerCase()),Ne=(l,e)=>{const s=`${l} ${e}`.toLowerCase();return se(s,"fix")?"fix":se(s,"other")?"other":(se(s,"feature"),"feature")},An=l=>l===""||/^发布日期[::]/.test(l)||/^发布\s+@/.test(l)||/^release\s+@/i.test(l),Tn=l=>{let e=l.trim();if(e.startsWith("**")){const i=e.indexOf("**",2),v=i>2?e.slice(2,i).trim().replace(/[::]$/,""):"";if(de(v))return e.slice(i+2).replace(/^[::]\s*/,"").trim()}if(e.startsWith("[")){const i=e.indexOf("]"),v=i>1?e.slice(1,i):"";de(v)&&(e=e.slice(i+1).trim())}const s=e.toLowerCase();for(const i of $n){const v=i.toLowerCase();if(s.startsWith(`${v}:`)||s.startsWith(`${v}:`))return e.slice(i.length+1).trim()}return e},Rn=l=>{const e=re(l).replace(/[::]$/,"").trim();return de(e)},Dn=l=>{const e=l.trimStart(),s=l.length-e.length,i=e[0];return i!=="-"&&i!=="*"&&i!=="+"||e[1]!==" "?null:{indent:s,text:e.slice(2).trim()}},In=/^[a-z\d](?:[a-z\d-]{0,37}[a-z\d])?$/i,Vn=(l,e)=>{const s=l.trim().replace(/^@/,"");return In.test(s)?{avatarUrl:`https://github.com/${s}.png?size=40`,login:s,name:(e==null?void 0:e.trim())===""||e==null?s:e.trim(),profileUrl:`https://github.com/${s}`}:null},En=(l,e)=>{try{const s=new URL(e);if(s.hostname!=="github.com")return null;const i=s.pathname.split("/").filter(Boolean)[0];return i==null||s.pathname.split("/").filter(Boolean).length!==1?null:Vn(i,l.trim().replace(/^@/,""))}catch{return null}},Gn=l=>{const e=[];let s=l;const i=/\[(@?[a-z\d][a-z\d-]{0,38})\]\((https:\/\/github\.com\/[a-z\d][a-z\d-]{0,38}\/?)\)/gi;let v;for(v=i.exec(l);v!=null;){const r=v;v=i.exec(l);const k=En(r[1]??"",r[2]??"");k!=null&&(e.push(k),s=s.replace(r[0],""))}s=s.replace(/(?:作者|贡献者|by|author|contributors?)[::]?[、,\s]*/gi,"").replace(/\s+([。;;::,,])/g,"$1").replace(/[,,、]\s*([。;;::])/g,"$1").replace(/\s*[—–-]\s*$/g,"").replace(/\s{2,}/g," ").trim();const j=new Set;return{contributors:e.filter(r=>j.has(r.login)?!1:(j.add(r.login),!0)),text:s}},Me=(l,e)=>{const s=l.at(-1);s==null||e.trim()===""||s.details.push(e)},On=l=>{var v;const e=[];let s=null,i=0;for(const j of((v=l.changelog)==null?void 0:v.entries)??[]){let r="";for(const k of j.body.split(`
|
|
3
3
|
`)){const w=k.trim();if(w==="")continue;if(/^#{1,6}\s+/.test(w)){r=re(w.replace(/^#{1,6}\s+/,"")),s=null;continue}if(/^!\[[^\]]*\]\([^)]+\)/.test(w)){Me(e,w);continue}const $=Dn(k);if($==null)continue;const M=Tn($.text);if(An(re(M)))continue;const x=$.indent;if(Rn(M)){s={category:Ne(r,M),indent:x};continue}if(x>i&&e.length>0&&(s==null||i>s.indent)){Me(e,M);continue}s!=null&&x<=s.indent&&(s=null),e.push({category:s!=null&&x>s.indent?s.category:Ne(r,M),details:[],text:M}),i=x}}return e},Se=l=>l.flatMap(e=>On(e).map((s,i)=>{const{contributors:v,text:j}=Gn(s.text);return{category:s.category,contributors:v,details:s.details,key:`${e.id}:${i}:${j}`,moduleLabel:e.label,text:j.replace(/\)\s*[::]\s*/,"):")}})),Pn=l=>{const e=new URLSearchParams(l),s=e.get("review"),i=e.get("target");return s==="global"||s==="all"?{kind:s}:s==="group"&&i!=null&&ie.includes(i)?{group:i,kind:"group"}:s==="module"&&i!=null&&i.trim()!==""?{id:i,kind:"module"}:null},zn=l=>{const e=new URLSearchParams(l).get("detail");return e==="modules"||e==="changelog"?e:"summary"},oe=(l,e="summary")=>{const s=new URLSearchParams;return s.set("review",l.kind),l.kind==="group"&&s.set("target",l.group),l.kind==="module"&&s.set("target",l.id),e!=="summary"&&s.set("detail",e),`?${s.toString()}`},Bn=(l,e)=>{if(l==null)return{checkedAt:e.checkedAt,channel:e.channel,moduleChannels:e.moduleChannels,modules:[e.module],npmTag:e.npmTag};const s=l.modules.some(i=>i.id===e.module.id);return{checkedAt:e.checkedAt,channel:e.channel,moduleChannels:e.moduleChannels,modules:s?l.modules.map(i=>i.id===e.module.id?e.module:i):[...l.modules,e.module],npmTag:e.npmTag}},Fn=l=>l.errorMessage!=null?"error":l.updateAvailable?"available":l.needsActivation?"pendingActivation":l.cachedVersion!=null&&l.kind==="adapter"?"cached":"upToDate",Kn=l=>{switch(l){case"available":return"processing";case"cached":case"pendingActivation":return"warning";case"error":return"error";default:return"success"}};function Hn(){const{message:l}=gn.useApp(),{t:e}=fn(),s=mn(),i=cn(),{isCompactView:v,openRouteSidebar:j}=pn(),[r,k]=u.useState(null),[w,$]=u.useState(!1),[M,x]=u.useState(null),[f,ue]=u.useState(null),[_,Wn]=u.useState(null),[g,me]=u.useState(!1),[h,A]=u.useState(null),[$e,Ae]=u.useState("core"),y=u.useMemo(()=>Pn(s.search),[s.search]),L=u.useMemo(()=>zn(s.search),[s.search]),D=u.useCallback(()=>{$(!0),x(null),hn().then(k).catch(n=>{console.error("[module-updates] failed to check module updates",n),x(G(n,e("moduleUpdates.checkFailed")))}).finally(()=>$(!1))},[e]);u.useEffect(()=>{D()},[D]);const Q=u.useCallback(n=>{i({pathname:"/modules",search:oe(n)})},[i]),q=u.useCallback(()=>{i({pathname:"/modules",search:""},{replace:!0})},[i]),Te=n=>{!n.updateAvailable||f!=null||_!=null||g||Q({id:n.id,kind:"module"})},Re=n=>{n.available===0||f!=null||_!=null||g||h!=null||Q({group:n.key,kind:"group"})},De=()=>{((r==null?void 0:r.modules)??[]).filter(t=>t.updateAvailable).length===0||f!=null||_!=null||g||h!=null||Q({kind:"all"})},ce=u.useCallback(n=>{(r==null?void 0:r.channel)===n||h!=null||g||(A("default"),x(null),ae({defaultChannel:n}).then(t=>{k(t),l.success(e("moduleUpdates.channelSaved"))}).catch(t=>{console.error("[module-updates] failed to update default channel",t),l.error(G(t,e("moduleUpdates.channelSaveFailed")))}).finally(()=>A(null)))},[r==null?void 0:r.channel,g,l,h,e]),Ie=u.useCallback((n,t)=>{if(h!=null||g)return;const o=t==="default"?null:t;(n.configuredChannel??null)!==o&&(A(n.id),x(null),ae({moduleChannels:{[n.id]:o}}).then(d=>{k(d),l.success(e("moduleUpdates.channelSaved"))}).catch(d=>{console.error("[module-updates] failed to update module channel",d),l.error(G(d,e("moduleUpdates.channelSaveFailed")))}).finally(()=>A(null)))},[g,l,h,e]),Ve=u.useCallback((n,t)=>{if(h!=null||g)return;const o=t==="default"?null:t;if(!n.modules.some(c=>(c.configuredChannel??null)!==o))return;const m=n.modules.reduce((c,p)=>(c[p.id]=o,c),{});A(`group:${n.key}`),x(null),ae({moduleChannels:m}).then(c=>{k(c),l.success(e("moduleUpdates.channelSaved"))}).catch(c=>{console.error("[module-updates] failed to update module group channel",c),l.error(G(c,e("moduleUpdates.channelSaveFailed")))}).finally(()=>A(null))},[g,l,h,e]),J=u.useMemo(()=>{const n=(r==null?void 0:r.modules)??[];return{available:n.filter(t=>t.updateAvailable).length,pendingActivation:n.filter(t=>t.needsActivation).length}},[r]),X=_==="all",Ee=u.useMemo(()=>ie.map(n=>{const t=((r==null?void 0:r.modules)??[]).filter(o=>o.group===n);return{available:t.filter(o=>o.updateAvailable).length,key:n,modules:t,pendingActivation:t.filter(o=>o.needsActivation).length,total:t.length}}).filter(n=>n.total>0),[r==null?void 0:r.modules]),U=u.useMemo(()=>{if(y==null)return[];const n=((r==null?void 0:r.modules)??[]).filter(t=>t.updateAvailable);switch(y.kind){case"all":return n;case"global":return n.filter(t=>jn.has(t.group));case"group":return n.filter(t=>t.group===y.group);case"module":return n.filter(t=>t.id===y.id)}},[r==null?void 0:r.modules,y]),ge=u.useCallback(n=>{if(n.length===0)return e("moduleUpdates.reviewEmpty");const t=[`# ${e("moduleUpdates.changelogSummaryTitle")}`,"",e("moduleUpdates.changelogSummaryIntro",{count:n.length})],o=Se(n);return o.length===0?(t.push("",e("moduleUpdates.changelogSummaryMissingHint")),t.join(`
|
|
4
4
|
`)):(Ue.forEach(d=>{const m=o.filter(p=>p.category===d);if(m.length===0)return;const c=d==="feature"?"changelogSummaryFeatures":d==="fix"?"changelogSummaryFixes":"changelogSummaryOther";t.push("",`## ${e(`moduleUpdates.${c}`)}`),m.forEach(p=>t.push(`- ${p.text}`))}),t.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as i,h as n,j as a}from"./vendor-react-CnooHTJc.js";import{cq as s}from"./index-
|
|
1
|
+
import{u as i,h as n,j as a}from"./vendor-react-CnooHTJc.js";import{cq as s}from"./index-DgZk1SFp.js";import{u}from"./vendor-state-Djj0Jjxr.js";function p(){const{t}=u(),o=i(),r=n(),e=`${o.pathname}${o.search}${o.hash}`;return a.jsx(s,{actions:[{kind:"home",onClick:()=>void r("/")}],description:t("errorState.routeNotFoundDescription"),details:{copyText:e,items:[{label:t("common.navigation"),mono:!0,value:e}],title:t("errorState.diagnostics")},mobileDescription:t("errorState.routeNotFoundMobileDescription"),severity:"info",title:t("errorState.routeNotFoundTitle")})}export{p as NotFoundRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as t,k as Le,h as Ze,n as et}from"./vendor-react-CnooHTJc.js";import{M as k,i as tt,n as nt,o as it}from"./route-plugin-chrome-B-Goj3vG.js";import{D as we,j as at,k as st,m as rt,n as lt,o as ot,S as ct,C as ut,T as J,Q as Ke,bG as dt,bH as pt,bI as gt,bJ as mt,bK as Pe,bL as Me,bM as ht,bN as bt,bO as ft,bP as _t,e as xt,bQ as St,bR as yt,R as jt,f as kt}from"./AuthenticatedApp-CgBrvMuc.js";import{u as re,e as _e}from"./vendor-state-BYwEPTaO.js";import{a as Fe,u as vt}from"./use-app-preferences-gyulV-hA.js";import{bF as Oe,aI as ve,B as ae,aD as de,bU as Ae}from"./index-Cp4GfHnF.js";import{u as Dt}from"./use-chat-session-actions-DDZ5KCua.js";import{h as Nt,E as ne,T as G,S as Ct}from"./MobileAwareSelect-BmK6WApn.js";import{A as Ge,C as wt}from"./Collapse-B-oCiEx4.js";import{S as Pt}from"./SchemaObjectEditor-B9fPfDyT.js";import{I as le}from"./index-CWmEuVWV.js";import{S as se}from"./project-file-tree-icons-DqqhgvoI.js";import{T as Mt}from"./index-DBUG8CzV.js";import{A as At}from"./ActionSearchToolbar-8q-bk3mu.js";import{S as It}from"./WorkspaceApp-BNmtIdn4.js";import"./shortcutUtils-20iqPDwh.js";/* empty css */import"./index-sFqkb8xv.js";import"./client-build-info-bcijLdfD.js";const Et=()=>{},Ue=(e,i)=>{const n=e.trim(),a=n.toLowerCase();return a.includes("create-plugin")||a.includes("plugin-creator")?n:i("pluginStore.createLandingSendInstruction",{request:n})},$t=(e,i)=>{let n=!1;const a=e.map(s=>s.type!=="text"||n?s:(n=!0,{...s,text:Ue(s.text,i)}));return n?a:[{type:"text",text:i("pluginStore.createLandingAttachmentInstruction")},...a]};function Tt(){const{t:e}=re(),{isCompactLayout:i,isTouchInteraction:n}=Nt(),{data:a}=_e("/api/config",Fe),s=u.useRef(!1),r=u.useMemo(()=>a==null?we:at(a),[a]),[l,b]=u.useState(()=>({...st})),[f,o]=u.useState(()=>({...we})),[M,x]=u.useState(""),[h,y]=u.useState(0),{adapterOptions:C,hasAvailableModels:R,hiddenBuiltinAdapterOptions:S,builtinPreviewModelOptions:D,modelMenuGroups:$,modelSearchOptions:U,recommendedModelOptions:I,selectedAdapter:W,selectedModel:N,selectedModelWithService:K,servicePreviewModelOptions:T,setSelectedAdapter:E,setSelectedModel:j,toggleRecommendedModel:Y,updatingRecommendedModelValue:B}=rt(),{effort:V,setEffort:_,effortOptions:L}=lt(),{permissionMode:z,setPermissionMode:X,permissionModeOptions:m}=ot(),{isCreating:w,isStopping:P,send:p,sendContent:v,interrupt:F}=Dt({modelForQuery:K,hasAvailableModels:R,effort:V,permissionMode:z,adapter:W,sessionTargetDraft:l,workspaceDraft:f,onClearMessages:Et}),H=u.useMemo(()=>[{description:e("pluginStore.starterChatActionDescription"),icon:"add_comment",prompt:e("pluginStore.starterChatActionPrompt"),title:e("pluginStore.starterChatActionTitle")},{description:e("pluginStore.starterLauncherDescription"),icon:"manage_search",prompt:e("pluginStore.starterLauncherPrompt"),title:e("pluginStore.starterLauncherTitle")},{description:e("pluginStore.starterWorkbenchDescription"),icon:"tab",prompt:e("pluginStore.starterWorkbenchPrompt"),title:e("pluginStore.starterWorkbenchTitle")},{description:e("pluginStore.starterRouteDescription"),icon:"route",prompt:e("pluginStore.starterRoutePrompt"),title:e("pluginStore.starterRouteTitle")}],[e]),Q=g=>{x(g),y(A=>A+1)};u.useEffect(()=>{s.current||o({...r})},[r]);const d=t.jsxs("div",{className:"sender-container plugin-create-guide__composer",children:[t.jsx(ct,{initialContent:M,placeholder:e("pluginStore.createLandingPlaceholder"),autoFocus:!0,sessionStatus:w?"running":void 0,onInterrupt:F,stopLoading:P,onSend:g=>p(Ue(g,e)),onSendContent:g=>v($t(g,e)),builtinPreviewModelOptions:D,modelMenuGroups:$,modelSearchOptions:U,recommendedModelOptions:I,servicePreviewModelOptions:T,onToggleRecommendedModel:Y,updatingRecommendedModelValue:B,selectedModel:N,onModelChange:j,effort:V,effortOptions:L,onEffortChange:_,permissionMode:z,permissionModeOptions:m,onPermissionModeChange:X,selectedAdapter:W,adapterOptions:C,hiddenBuiltinAdapterOptions:S,onAdapterChange:E,modelUnavailable:!R,sessionTarget:{draft:l,locked:!1,disabled:w,onChange:b}},h),t.jsx(ut,{draftWorkspace:f,isCreating:w,onDraftWorkspaceChange:g=>{s.current=!0,o(g)}})]}),c=["plugin-create-landing",i||n?"plugin-create-landing--compact":""].filter(Boolean).join(" ");return t.jsxs("div",{className:c,children:[t.jsxs("div",{className:"plugin-create-guide",children:[t.jsxs("div",{className:"plugin-create-guide__header",children:[t.jsx("h2",{children:e("pluginStore.createLandingTitle")}),t.jsx("p",{children:e("pluginStore.createLandingDescription")})]}),t.jsx("div",{className:"plugin-create-guide__grid",children:H.map(g=>t.jsxs("button",{type:"button",className:"plugin-create-guide__item",onClick:()=>Q(g.prompt),children:[t.jsx("span",{className:"material-symbols-rounded plugin-create-guide__icon",children:g.icon}),t.jsxs("span",{className:"plugin-create-guide__item-text",children:[t.jsx("span",{className:"plugin-create-guide__item-title",children:g.title}),t.jsx("span",{className:"plugin-create-guide__item-desc",children:g.description})]})]},g.title))})]}),d]})}const Rt=e=>e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`;function Lt({emptyText:e,error:i,group:n,loading:a,title:s}){const r=(n==null?void 0:n.files)??[];return t.jsx("section",{className:"plugin-detail-route__section plugin-detail-route__asset-section",children:a?t.jsx(Oe,{active:!0,paragraph:{rows:5},title:!1}):i!=null?t.jsx(Ge,{type:"warning",showIcon:!0,message:i}):r.length===0?t.jsx("p",{className:"plugin-detail-route__empty",children:e}):t.jsx("div",{className:"plugin-detail-route__asset-list","aria-label":s,children:r.map(l=>t.jsxs("article",{className:"plugin-detail-route__asset-file",children:[t.jsxs("div",{className:"plugin-detail-route__asset-file-header",children:[t.jsxs("div",{className:"plugin-detail-route__asset-file-title",children:[t.jsx(k,{name:l.contentKind==="markdown"?"article":"code_blocks"}),t.jsx("span",{children:l.path})]}),t.jsxs("div",{className:"plugin-detail-route__asset-file-meta",children:[t.jsx(J,{children:l.contentKind}),t.jsx(J,{children:Rt(l.size)})]})]}),l.content==null?t.jsx("p",{className:"plugin-detail-route__asset-empty",children:e}):l.contentKind==="markdown"?t.jsx("div",{className:"plugin-detail-route__asset-markdown markdown-body",children:t.jsx(Ke,{content:l.content,openLinksInNewTab:!0})}):t.jsx("pre",{className:"plugin-detail-route__asset-code",children:l.content})]},l.path))})})}const Z=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),We=e=>e==null?void 0:e.replace(/_/g,"-").toLowerCase(),Kt=e=>{const i=We(e),n=i==null?void 0:i.split("-")[0];return[i,n,"en"].filter((a,s,r)=>a!=null&&a!==""&&r.indexOf(a)===s)},me=(e,i)=>{if(typeof e=="string")return e;if(!Z(e))return;const n=Object.entries(e).map(([a,s])=>[We(a),typeof s=="string"?s:void 0]).filter(a=>a[0]!=null&&a[1]!=null);if(n.length!==0){for(const a of Kt(i)){const s=n.find(([l])=>l===a);if(s!=null)return s[1];const r=n.find(([l])=>l.split("-")[0]===a);if(r!=null)return r[1]}return n[0][1]}},ge=(e,i,n)=>{const a=me(e[`${i}I18n`],n);if(a!=null)return a;if(Z(e.i18n)){const s=Object.fromEntries(Object.entries(e.i18n).map(([l,b])=>[l,Z(b)&&typeof b[i]=="string"?b[i]:void 0])),r=me(s,n);if(r!=null)return r}return me(e[i],n)},Be=e=>{const i=e["x-oneworks-ui"]??e["x-ui"]??e.ui;return Z(i)?i:{}},oe=(...e)=>e.find(i=>typeof i=="string"&&i.trim()!==""),xe=e=>{const i=e.type;if(typeof i=="string")return i;if(Array.isArray(i))return i.find(n=>typeof n=="string"&&n!=="null");if(Z(e.properties))return"object";if(Array.isArray(e.enum)||Array.isArray(e.oneOf)||Array.isArray(e.anyOf))return"string"},Ft=e=>Z(e.properties)?e.properties:void 0,Ot=e=>Z(e.items)?e.items:void 0,Gt=e=>e.every(i=>typeof i=="string"),ze=(e,i)=>{if(Array.isArray(e.enum)&&Gt(e.enum)){const s=Array.isArray(e.enumNames)?e.enumNames:[];return e.enum.map((r,l)=>({value:r,label:typeof s[l]=="string"?s[l]:r}))}const a=(Array.isArray(e.oneOf)?e.oneOf:Array.isArray(e.anyOf)?e.anyOf:[]).flatMap(s=>!Z(s)||typeof s.const!="string"?[]:[{value:s.const,label:ge(s,"title",i)??s.const,description:ge(s,"description",i)}]);return a.length>0?a:void 0},Ut=e=>{const i=Be(e),n=oe(i.control,i.type,i.widget);if(n==="textarea"||n==="multiline")return"multiline";if(n==="json")return"json";if(ze(e,"en")!=null)return"select";const a=xe(e);if(a==="boolean")return"boolean";if(a==="integer"||a==="number")return"number";if(a==="array"){const s=Ot(e);return s!=null&&xe(s)==="string"?"string[]":"json"}if(a==="string"){const s=oe(e.format);return s==="textarea"||s==="multiline"?"multiline":"string"}return"json"},Wt=e=>e==="boolean"?"toggle_on":e==="number"?"numbers":e==="string[]"?"view_list":e==="select"?"checklist":e==="multiline"?"notes":e==="json"?"data_object":"text_fields",He=(e,i,n,a)=>{const s=Ft(e),r=xe(e),l=Be(e),b=oe(l.control,l.type,l.widget)==="json";if(r==="object"&&s!=null&&!b){for(const[M,x]of Object.entries(s))Z(x)&&He(x,[...i,M],n,a);return}if(i.length===0)return;const f=Ut(e),o=oe(l.icon)??Wt(f);a.push({path:i,type:f,defaultValue:e.default,label:ge(e,"title",n),description:ge(e,"description",n),icon:o,placeholder:oe(l.placeholder,e.placeholder),sensitive:e.writeOnly===!0||e.format==="password"||l.sensitive===!0,options:ze(e,n)})},Bt=e=>{const i=(e==null?void 0:e.schema)??(e==null?void 0:e.jsonSchema);return Z(i)?i:void 0},zt=(e,i)=>{if((e==null?void 0:e.uiSchema)!=null)return e.uiSchema;const n=Bt(e);if(!Z(n))return;const a=[];return He(n,[],i,a),a.length===0?void 0:{fields:a}},Ht=e=>JSON.stringify(e,null,2),De=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),qt=e=>De(e)?e:{},Se=e=>{if(e===void 0)return;if(Array.isArray(e))return e.map(Se).filter(n=>n!==void 0);if(!De(e))return e;const i=Object.entries(e).map(([n,a])=>[n,Se(a)]).filter(n=>n[1]!==void 0);return Object.fromEntries(i)},qe=e=>{const i=Se(e);return De(i)?i:{}},pe=e=>JSON.stringify(qe(e)),Vt=e=>{var i;return{enabled:e.enabled!==!1,id:e.requestId,options:e.options??{},packageId:e.packageId,pluginRoot:e.pluginRoot??e.rootDir,scope:e.scope,sourceGroup:e.sourceGroup,watch:((i=e.watch)==null?void 0:i.enabled)===!0}},Qt=e=>{var i;return e.manifest??{displayName:e.displayName,name:e.name,plugin:{client:e.client,contributions:((i=e.plugin)==null?void 0:i.contributions)??e.contributions}}};function Jt({labels:e,onOptionsChange:i,plugin:n}){var W;const{message:a}=ve.useApp(),{i18n:s,t:r}=re(),l=s.resolvedLanguage??s.language,b=u.useMemo(()=>{var N;return zt((N=n.manifest)==null?void 0:N.config,l)},[(W=n.manifest)==null?void 0:W.config,l]),f=u.useMemo(()=>qt(n.options),[n.options]),[o,M]=u.useState(f),[x,h]=u.useState("idle"),y=u.useRef(),C=u.useRef(0),R=u.useRef(pe(f)),S=u.useCallback(()=>{y.current!=null&&(clearTimeout(y.current),y.current=void 0)},[]);u.useEffect(()=>{S(),M(f),R.current=pe(f),C.current+=1,h("idle")},[S,f,n.scope]),u.useEffect(()=>()=>S(),[S]);const D=u.useCallback(async(N,K)=>{const T=qe(N),E=pe(T);if(R.current===E){C.current===K&&h("idle");return}C.current===K&&h("saving");try{const j=await dt(n.scope,T);R.current=pe(j),C.current===K&&(M(j),h("saved"),await(i==null?void 0:i()))}catch(j){console.error("[plugin] failed to update plugin options",j),C.current===K&&(h("error"),a.error(e.saveFailed))}},[e.saveFailed,a,i,n.scope]),$=u.useCallback(N=>{M(N),S();const K=C.current+1;C.current=K,h("pending"),y.current=setTimeout(()=>{y.current=void 0,D(N,K)},700)},[S,D]),U=[{icon:"settings",key:"instance",title:e.instance,value:Vt(n)},{icon:"data_object",key:"manifest",title:e.manifest,value:Qt(n)}],I=x==="saving"||x==="pending"?e.saving:x==="saved"?e.saved:x==="error"?e.saveFailed:void 0;return t.jsxs("section",{className:"plugin-detail-route__section plugin-detail-route__config-section",children:[t.jsxs("article",{className:"plugin-detail-route__config-form",children:[t.jsxs("div",{className:"plugin-detail-route__config-block-header",children:[t.jsx(k,{name:"tune","aria-hidden":"true"}),t.jsx("h2",{children:e.options}),I!=null&&t.jsx("span",{className:`plugin-detail-route__config-save-state is-${x}`,children:I})]}),b==null?t.jsx(ne,{image:ne.PRESENTED_IMAGE_SIMPLE,description:e.noSchema}):t.jsx(Pt,{value:o,schema:b,onChange:$,t:r})]}),b==null&&t.jsx("div",{className:"plugin-detail-route__config-list",children:U.map(N=>t.jsxs("article",{className:"plugin-detail-route__config-block",children:[t.jsxs("div",{className:"plugin-detail-route__config-block-header",children:[t.jsx(k,{name:N.icon,"aria-hidden":"true"}),t.jsx("h2",{children:N.title})]}),t.jsx("pre",{className:"plugin-detail-route__config-code",children:Ht(N.value)})]},N.key))})]})}const Yt=[{icon:"extension",key:"extensionPoints",labelKey:"pluginDetail.groups.extensionPoints"},{icon:"add_link",key:"extensionContributions",labelKey:"pluginDetail.groups.extensionContributions"},{icon:"dock_to_left",key:"navItems",labelKey:"pluginDetail.groups.navItems"},{icon:"more_horiz",key:"navMoreMenu",labelKey:"pluginDetail.groups.navMoreMenu"},{icon:"vertical_align_top",key:"navFooterBefore",labelKey:"pluginDetail.groups.navFooterBefore"},{icon:"add_comment",key:"chatHeaderActions",labelKey:"pluginDetail.groups.chatHeaderActions"},{icon:"more_vert",key:"chatHeaderMoreMenu",labelKey:"pluginDetail.groups.chatHeaderMoreMenu"},{icon:"dashboard_customize",key:"chatInteractionPanelEmptyActions",labelKey:"pluginDetail.groups.chatInteractionPanelEmptyActions"},{icon:"web_asset",key:"routeHeaderActions",labelKey:"pluginDetail.groups.routeHeaderActions"},{icon:"more_vert",key:"routeMoreMenuItems",labelKey:"pluginDetail.groups.routeMoreMenuItems"},{icon:"left_click",key:"routeSidebarContextMenu",labelKey:"pluginDetail.groups.routeSidebarContextMenu"},{icon:"dock_to_left",key:"routeWindowBarActions",labelKey:"pluginDetail.groups.routeWindowBarActions"},{icon:"add_box",key:"workbenchAddMenu",labelKey:"pluginDetail.groups.workbenchAddMenu"},{icon:"tab",key:"workbenchTabs",labelKey:"pluginDetail.groups.workbenchTabs"},{icon:"view_sidebar",key:"workspaceDrawerTabs",labelKey:"pluginDetail.groups.workspaceDrawerTabs"},{icon:"manage_search",key:"launcherSearchProviders",labelKey:"pluginDetail.groups.launcherSearchProviders"},{icon:"route",key:"routes",labelKey:"pluginDetail.groups.routes"}],Ve=["id","title","targetRoute","targetRoutes","route","routeId","command","mode","target","proxyTarget","extensionPoint","contributionSchema","href","active","activeLabel","activeTitle","danger","disabled","selected","tab","clientView","viewId","placement","icon","activeIcon","shortcut","inputSchema","outputSchema","headerSchema"],Xt={active:"radio_button_checked",activeLabel:"label",activeTitle:"tooltip",clientView:"language",command:"terminal",contributionSchema:"schema",danger:"warning",disabled:"toggle_off",extensionPoint:"extension",headerSchema:"fact_check",href:"open_in_new",id:"fingerprint",inputSchema:"input",mode:"route",outputSchema:"output",icon:"symbol",placement:"dock_to_right",proxyTarget:"hub",route:"link",routeId:"link",shortcut:"keyboard",selected:"check_circle",tab:"layers",target:"api",targetRoute:"filter_alt",targetRoutes:"filter_alt",title:"sell",viewId:"language"},Zt=["all","enabled","disabled"],en={all:"filter_list",disabled:"toggle_off",enabled:"toggle_on"},tn=e=>{var n,a,s;const i=((n=e.plugin)==null?void 0:n.contributions)??e.contributions??((s=(a=e.manifest)==null?void 0:a.plugin)==null?void 0:s.contributions)??{};return i.routeMoreMenuItems!=null||i.routeMoreMenu==null?i:{...i,routeMoreMenuItems:i.routeMoreMenu}},ye=e=>{if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){const i=e.map(n=>ye(n)).filter(n=>n!=null&&n!=="");return i.length===0?void 0:i.join(", ")}if(e!=null&&typeof e=="object")return JSON.stringify(e)},Qe=e=>e==null?void 0:e.replace(/_/g,"-").toLowerCase(),nn=e=>{const i=Qe(e),n=i==null?void 0:i.split("-")[0];return[i,n,"en"].filter((a,s,r)=>a!=null&&r.indexOf(a)===s)},ce=(e,i,n={})=>{const a=ye(e);if(a!=null)return a;if(e==null||typeof e!="object"||Array.isArray(e))return;const s=Object.entries(e).map(([l,b])=>[Qe(l),ye(b)]).filter(l=>l[0]!=null&&l[1]!=null);if(s.length===0)return;const r=nn(i);for(const l of r){const b=s.find(([o])=>o===l);if(b!=null)return b[1];const f=s.find(([o])=>o.split("-")[0]===l);if(f!=null)return f[1]}return n.allowAnyFallback===!1?void 0:s[0][1]},ue=(e,i,n)=>{const a=ce(e[`${i}I18n`],n,{allowAnyFallback:!1});if(a!=null)return a;const s=e.i18n;if(s!=null&&typeof s=="object"&&!Array.isArray(s)){const r=ce(Object.fromEntries(Object.entries(s).map(([l,b])=>[l,b!=null&&typeof b=="object"&&!Array.isArray(b)?b[i]:void 0])),n,{allowAnyFallback:!1});if(r!=null)return r}return ce(e[i],n)},je=(e,i)=>`${e}: ${i??"-"}`,Je=(e,i)=>e!=null&&typeof e=="object"&&!Array.isArray(e)?e:{id:i,value:e},an=(e,i,n)=>{const a=ue(e,"description",i);return a??n},sn=e=>e.trim().toLocaleLowerCase(),rn=(e,i,n)=>{const a=Je(e.value,e.id);return[e.id,ue(a,"title",i),ue(a,"description",i),...Ve.flatMap(s=>[s,n[s],ce(a[s],i)])].filter(s=>s!=null&&s!=="").join(" ").toLocaleLowerCase()},ln=(e,i,n)=>{switch(n){case"disabled":return e.disabled===!0?i:i.filter(a=>a.disabled===!0);case"enabled":return e.disabled===!0?[]:i.filter(a=>a.disabled!==!0);case"all":return i}},on=({disableItemText:e,enableItemText:i,fieldLabels:n,item:a,itemDisabledText:s,language:r,noDescriptionText:l,onItemEnabledChange:b})=>{const f=Je(a.value,a.id),o=ue(f,"title",r)??ue(f,"id",r)??a.id,M=a.disabled===!0?s??l:an(f,r,l),x=Ve.filter(h=>h!=="title").map(h=>[h,ce(f[h],r)]).filter(h=>h[1]!=null);return t.jsxs("div",{className:`plugin-detail-route__contribution-item${a.disabled===!0?" is-disabled":""}`,children:[t.jsx("div",{className:"plugin-detail-route__contribution-main",children:t.jsxs("div",{className:"plugin-detail-route__contribution-title-row",children:[t.jsxs("div",{className:"plugin-detail-route__contribution-title-main",children:[t.jsx("div",{className:"plugin-detail-route__contribution-title",children:o}),t.jsx("p",{className:"plugin-detail-route__contribution-description",children:M})]}),b!=null&&t.jsx(G,{title:a.disabled===!0?i:e,children:t.jsx("span",{className:"plugin-detail-route__contribution-item-toggle",children:t.jsx(se,{"aria-label":a.disabled===!0?i:e,checked:a.disabled!==!0,size:"small",onChange:h=>b(a.id,h),onClick:(h,y)=>y.stopPropagation()})})})]})}),x.length>0&&t.jsx("div",{className:"plugin-detail-route__contribution-tags",children:x.map(([h,y])=>t.jsx(G,{title:je(n[h]??h,y),children:t.jsxs("span",{className:"plugin-detail-route__contribution-tag","aria-label":je(n[h]??h,y),children:[t.jsx(k,{name:Xt[h]??"info","aria-hidden":"true"}),t.jsx("span",{children:n[h]??h}),t.jsx("strong",{children:y})]})},`${h}:${y}`))})]},a.id)};function te({icon:e,label:i,value:n}){const a=je(i,n),s=n==null||n===""?"-":n;return t.jsxs("div",{className:`plugin-detail-route__fact ${n==null||n===""?"is-empty":"is-set"}`,"aria-label":a,children:[t.jsx("span",{className:"plugin-detail-route__fact-icon",children:t.jsx(k,{name:e,"aria-hidden":"true"})}),t.jsxs("span",{className:"plugin-detail-route__fact-main",children:[t.jsx("span",{className:"plugin-detail-route__fact-label",children:i}),t.jsx("span",{className:"plugin-detail-route__fact-value",children:s})]})]})}function cn({enabledHint:e,enabledLoading:i,labels:n,onEnabledChange:a,onWatchChange:s,plugin:r,watchHint:l,watchLoading:b}){var f,o,M,x,h,y;return t.jsxs("section",{className:"plugin-detail-route__overview",children:[t.jsxs("div",{className:"plugin-detail-route__title-row",children:[t.jsxs("div",{className:"plugin-detail-route__title-main",children:[t.jsx(k,{name:"info","aria-hidden":"true"}),t.jsx("h2",{children:n.overview})]}),r.enabled===!1&&t.jsx("div",{className:"plugin-detail-route__title-tags",children:t.jsx(G,{title:n.disabled,children:t.jsx("span",{className:"plugin-detail-route__scope-icon is-danger","aria-label":n.disabled,children:t.jsx(k,{name:"close","aria-hidden":"true"})})})})]}),t.jsxs("div",{className:"plugin-detail-route__facts",children:[t.jsx(te,{icon:"deployed_code",label:n.version,value:r.version}),t.jsx(te,{icon:"download",label:n.requestedVersion,value:r.requestedVersion}),t.jsx(te,{icon:"layers",label:n.package,value:r.packageId}),t.jsx(te,{icon:"link",label:n.request,value:r.requestId}),t.jsx(te,{icon:"folder_open",label:n.root,value:r.pluginRoot??r.rootDir}),t.jsx(te,{icon:"language",label:n.clientEntry,value:r.clientEntryUrl??((f=r.client)==null?void 0:f.entry)}),t.jsx(te,{icon:"tune",label:n.clientDevEntry,value:r.devClientEntryUrl??((o=r.client)==null?void 0:o.devServer)}),t.jsx(te,{icon:"terminal",label:n.serverEntry,value:(h=(x=(M=r.manifest)==null?void 0:M.plugin)==null?void 0:x.server)==null?void 0:h.entry})]}),t.jsx(G,{title:e,children:t.jsxs("span",{className:"plugin-detail-route__watch","aria-label":n.enabled,children:[t.jsxs("span",{className:"plugin-detail-route__watch-main",children:[t.jsx(k,{name:r.enabled===!1?"extension_off":"extension","aria-hidden":"true"}),t.jsx("span",{children:n.enabled})]}),t.jsx(se,{"aria-label":n.enabled,checked:r.enabled!==!1,loading:i,onChange:a})]})}),t.jsx(G,{title:l,children:t.jsxs("span",{className:"plugin-detail-route__watch","aria-label":n.watch,children:[t.jsxs("span",{className:"plugin-detail-route__watch-main",children:[t.jsx(k,{name:"speed","aria-hidden":"true"}),t.jsx("span",{children:n.watch})]}),t.jsx(se,{"aria-label":n.watch,checked:((y=r.watch)==null?void 0:y.enabled)===!0,disabled:r.enabled===!1,loading:b,onChange:s})]})})]})}function un({disableText:e,disabledText:i,disableItemText:n,emptyText:a,enableItemText:s,enableText:r,fieldLabels:l,itemDisabledText:b,language:f,noMatchesText:o,noDescriptionText:M,onItemEnabledChange:x,onRowEnabledChange:h,rows:y,searchPlaceholder:C,showTitle:R=!0,title:S}){var B,V;const{t:D}=re(),[$,U]=u.useState(""),[I,W]=u.useState(!1),[N,K]=u.useState("all"),T=sn($),E=u.useMemo(()=>y.map(_=>{const L=`${_.id} ${_.title}`.toLocaleLowerCase().includes(T),z=T===""||L?_.items:_.items.filter(m=>rn(m,f,l).includes(T)),X=ln(_,z,N);return{..._,items:X}}).filter(_=>_.items.length>0),[l,f,T,y,N]),j=((B=E.find(_=>_.disabled!==!0))==null?void 0:B.id)??((V=E[0])==null?void 0:V.id),Y=y.length===0?a:o;return t.jsxs("section",{className:`plugin-detail-route__section${R?"":" plugin-detail-route__section--flush-top"}`,children:[R&&t.jsx("div",{className:"plugin-detail-route__title-row",children:t.jsxs("div",{className:"plugin-detail-route__title-main",children:[t.jsx(k,{name:"extension"}),t.jsx("h2",{children:S})]})}),y.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"plugin-detail-route__section-toolbar",children:[t.jsx(le,{allowClear:!0,className:"plugin-detail-route__search-input",placeholder:C,prefix:t.jsx(k,{name:"search","aria-hidden":"true"}),value:$,onChange:_=>U(_.target.value)}),t.jsx("div",{className:"plugin-detail-route__section-toolbar-actions",children:t.jsx(G,{title:D("pluginDetail.filter"),children:t.jsx(ae,{className:`plugin-detail-route__section-toolbar-button${I?" is-active":""}`,type:"text","aria-label":D("pluginDetail.filter"),"aria-pressed":I,icon:t.jsx(k,{name:"filter_alt","aria-hidden":"true"}),onClick:()=>W(_=>!_)})})})]}),I&&t.jsx("div",{className:"plugin-detail-route__filter-panel",children:t.jsxs("div",{className:"plugin-detail-route__filter-row",children:[t.jsxs("span",{className:"plugin-detail-route__filter-label",children:[t.jsx(k,{name:"toggle_on","aria-hidden":"true"}),t.jsx("span",{children:D("pluginDetail.filterStatus")})]}),t.jsx("div",{className:"plugin-detail-route__filter-options",children:Zt.map(_=>t.jsx(ae,{className:`plugin-detail-route__filter-option${N===_?" is-active":""}`,type:"text",size:"small",icon:t.jsx(k,{name:en[_],"aria-hidden":"true"}),onClick:()=>K(_),children:D(`pluginDetail.filterStatus_${_}`)},_))})]})})]}),E.length===0?t.jsx("p",{className:"plugin-detail-route__empty",children:Y}):t.jsx(wt,{accordion:!0,bordered:!1,className:"plugin-detail-route__contribution-accordion",defaultActiveKey:j,items:E.map(_=>({children:_.disabled===!0?t.jsxs("p",{className:"plugin-detail-route__contribution-disabled",children:[t.jsx(k,{name:"extension_off","aria-hidden":"true"}),t.jsx("span",{children:i})]}):t.jsx("div",{className:"plugin-detail-route__contribution-list",children:_.items.map(L=>on({disableItemText:n,enableItemText:s,fieldLabels:l,item:L,itemDisabledText:b,language:f,noDescriptionText:M,onItemEnabledChange:x}))}),className:`plugin-detail-route__contribution-group${_.disabled===!0?" is-disabled":""}`,key:_.id,label:t.jsxs("div",{className:"plugin-detail-route__contribution-group-title",children:[t.jsxs("span",{className:"plugin-detail-route__contribution-group-main",children:[t.jsx("span",{className:"plugin-detail-route__contribution-group-icon",children:t.jsx(k,{name:_.icon,"aria-hidden":"true"})}),t.jsx("span",{className:"plugin-detail-route__contribution-group-label",children:_.title})]}),h!=null&&t.jsx(G,{title:_.disabled===!0?r:e,children:t.jsx("span",{className:"plugin-detail-route__contribution-group-toggle",onClick:L=>L.stopPropagation(),children:t.jsx(se,{"aria-label":_.disabled===!0?r:e,checked:_.disabled!==!0,size:"small",onChange:L=>h(_.id,L)})})})]})}))},`${T}:${N}`)]})}function dn({diagnostics:e,emptyText:i,title:n}){return t.jsxs("section",{className:"plugin-detail-route__diagnostics",children:[t.jsxs("div",{className:"plugin-detail-route__title-row",children:[t.jsxs("div",{className:"plugin-detail-route__title-main",children:[t.jsx(k,{name:"info","aria-hidden":"true"}),t.jsx("h2",{children:n})]}),e.length>0&&t.jsx(G,{title:`${n}: ${e.length}`,children:t.jsxs("span",{className:"plugin-detail-route__diagnostic-count","aria-label":`${n}: ${e.length}`,children:[t.jsx(k,{name:"bug_report","aria-hidden":"true"}),t.jsx("span",{children:e.length})]})})]}),e.length===0?t.jsx(G,{title:i,children:t.jsxs("p",{className:"plugin-detail-route__diagnostics-empty","aria-label":i,children:[t.jsx(k,{name:"check","aria-hidden":"true"}),t.jsx("span",{children:i})]})}):e.map((a,s)=>t.jsxs("div",{className:"plugin-detail-route__diagnostic",children:[t.jsx(J,{color:a.level==="error"?"error":a.level==="warning"?"warning":void 0,children:a.level}),t.jsx("span",{children:a.message})]},`${a.message}:${s}`))]})}const pn=/^[a-z][a-z\d+\-.]*:|^\/\//i,gn=(e,i)=>{const n=i.trim();if(n===""||n.startsWith("#")||pn.test(n))return;const a=e.replace(/\\/g,"/").split("/").slice(0,-1).filter(Boolean).join("/"),s=a===""?"/":`/${a}/`;try{const r=new URL(n,`https://plugin.local${s}`);if(r.origin!=="https://plugin.local")return;const l=decodeURIComponent(r.pathname).replace(/^\/+/,"");return l===""?void 0:l}catch{return}},he=e=>e==null?void 0:e.replace(/_/g,"-").toLowerCase(),Ie=(e,i)=>{if(e.length===0)return;const n=he(i);if(n!=null){const a=e.find(l=>he(l.language)===n);if(a!=null)return a.path;const s=n.split("-")[0],r=e.find(l=>{var b;return((b=he(l.language))==null?void 0:b.split("-")[0])===s});if(r!=null)return r.path}return e[0].path};function mn({emptyText:e,error:i,loading:n,preferredLanguage:a,pluginScope:s,readme:r,readmes:l=r==null?[]:[r],showTitle:b=!0,title:f}){const[o,M]=u.useState(()=>Ie(l,a)),x=u.useMemo(()=>l.find(S=>S.path===o)??r,[r,l,o]),h=u.useMemo(()=>l.map(S=>({label:S.language==null?S.path:`${S.language} (${S.path})`,value:S.path})),[l]);u.useEffect(()=>{M(Ie(l,a))},[a,l]);const y=S=>{if(x==null)return;const D=gn(x.path,S);return D==null?void 0:pt(s,D)},C=({alt:S,src:D,title:$})=>{const U=y(D)??D;return t.jsx("img",{src:U,alt:S??"",title:$,loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"})},R=(S,D)=>{const $=y(S);$!=null&&(D.preventDefault(),window.open($,"_blank","noopener,noreferrer"))};return t.jsxs("section",{className:"plugin-detail-route__readme",children:[b&&t.jsxs("div",{className:"plugin-detail-route__title-row",children:[t.jsxs("div",{className:"plugin-detail-route__title-main",children:[t.jsx(k,{name:"article"}),t.jsx("h2",{children:f})]}),x!=null&&t.jsx(J,{children:x.path})]}),h.length>1&&t.jsx("div",{className:"plugin-detail-route__readme-toolbar",children:t.jsx(Ct,{"aria-label":f,options:h,popupMatchSelectWidth:!1,size:"small",value:o,onChange:M})}),n?t.jsx(Oe,{active:!0,paragraph:{rows:5},title:!1}):i!=null?t.jsx(Ge,{type:"warning",showIcon:!0,message:i}):x==null?t.jsx("p",{className:"plugin-detail-route__empty",children:e}):t.jsx("div",{className:"plugin-detail-route__readme-content",children:t.jsx(Ke,{content:x.content,openLinksInNewTab:!0,renderImage:C,onLinkClick:R})})]})}const hn=(e,i,n)=>{const[a,s]=u.useState({groups:[],loading:!1});return u.useEffect(()=>{if(e==null){s({groups:[],loading:!1});return}let r=!1;return s({groups:[],loading:!0}),gt(e.scope).then(l=>{r||s({groups:l,loading:!1})}).catch(l=>{if(r)return;const b=l instanceof Error?l.message:n;s({error:b,groups:[],loading:!1})}),()=>{r=!0}},[n,e,i]),a},bn=(e,i,n)=>{const[a,s]=u.useState({loading:!1,readmes:[]});return u.useEffect(()=>{if(e==null){s({loading:!1,readmes:[]});return}let r=!1;return s({loading:!0,readmes:[]}),mt(e.scope).then(({readme:l,readmes:b})=>{r||s({loading:!1,readme:l,readmes:b})}).catch(l=>{if(r)return;const b=l instanceof Error?l.message:n;s({error:b,loading:!1,readmes:[]})}),()=>{r=!0}},[n,e,i]),a},fn={"chat.header.actions":"pluginDetail.groups.chatHeaderActions","chat.header.moreMenu":"pluginDetail.groups.chatHeaderMoreMenu","chat.interactionPanel.emptyActions":"pluginDetail.groups.chatInteractionPanelEmptyActions","launcher.searchProviders":"pluginDetail.groups.launcherSearchProviders","nav.footer.before":"pluginDetail.groups.navFooterBefore","nav.items":"pluginDetail.groups.navItems","nav.moreMenu":"pluginDetail.groups.navMoreMenu","route.header.actions":"pluginDetail.groups.routeHeaderActions","route.moreMenu.items":"pluginDetail.groups.routeMoreMenuItems","route.sidebar.contextMenu":"pluginDetail.groups.routeSidebarContextMenu","route.windowBar.actions":"pluginDetail.groups.routeWindowBarActions","workbench.addMenu":"pluginDetail.groups.workbenchAddMenu","workbench.tabs":"pluginDetail.groups.workbenchTabs","workspace.drawer.tabs":"pluginDetail.groups.workspaceDrawerTabs"},be="tab",_n=["readme","contributions","config","skills","mcp","hooks"],xn=new Set(_n),Sn=e=>e!=null&&xn.has(e)?e:"readme";function yn({enabledLoading:e,onContributionPreferencesChange:i,onEnabledChange:n,onOptionsChange:a,onWatchChange:s,plugin:r,snapshot:l,watchLoading:b}){const{i18n:f,t:o}=re(),[M,x]=Le(),h=bn(r,l.instances,o("pluginDetail.readmeLoadFailed")),y=hn(r,l.instances,o("pluginDetail.assetsLoadFailed")),[C,R]=u.useState(()=>Pe(r.scope)),[S,D]=u.useState(()=>Me(r.scope));u.useEffect(()=>{R(Pe(r.scope)),D(Me(r.scope))},[r.scope]);const $=u.useMemo(()=>{const m=tn(r);return Yt.map(w=>{const P=m[w.key];return{...w,items:Array.isArray(P)?P:[]}}).filter(w=>w.items.length>0)},[r]),U=u.useMemo(()=>{const m=Object.entries(l.slots).flatMap(([d,c])=>{const g=(c??[]).filter(O=>O.pluginScope===r.scope);if(g.length===0)return[];const A=fn[d],q=A==null?d:o(A);return[{icon:"widgets",id:`slot:${d}`,items:g,title:o("pluginDetail.runtimeSlotLabel",{slot:q})}]}),w=l.routes.filter(d=>d.scope===r.scope).map(d=>({id:d.id,title:d.title,viewId:d.viewId})),P=l.views.filter(d=>d.scope===r.scope).map(d=>({id:d.id})),p=l.launcherProviders.filter(d=>d.scope===r.scope).map(d=>({command:d.command,id:d.id,title:d.title})),v=l.pluginApis.filter(d=>d.pluginScope===r.scope).map(d=>({description:d.description,descriptionI18n:d.descriptionI18n,id:d.id,inputSchema:d.inputSchema,outputSchema:d.outputSchema,title:d.title,titleI18n:d.titleI18n})),F=l.extensionPoints.filter(d=>d.pluginScope===r.scope).map(d=>({contributionSchema:d.contributionSchema,description:d.description,descriptionI18n:d.descriptionI18n,id:d.id,title:d.title,titleI18n:d.titleI18n})),H=Object.values(l.extensionContributions).flat().filter(d=>d.pluginScope===r.scope).map(d=>({command:typeof d.command=="string"?d.command:void 0,description:d.description,descriptionI18n:d.descriptionI18n,extensionPoint:d.extensionPoint,icon:typeof d.icon=="string"?d.icon:void 0,id:d.id,target:d.target,title:d.title,titleI18n:d.titleI18n})),Q=(r.apis??[]).map(d=>({description:d.description,headerSchema:d.headerSchema,id:d.id,inputSchema:d.inputSchema,mode:d.mode,outputSchema:d.outputSchema,proxyTarget:d.proxyTarget,target:d.target,title:d.title}));return[...m,...F.length>0?[{icon:"extension",id:"runtime:extension-points",items:F,title:o("pluginDetail.runtimeExtensionPoints")}]:[],...H.length>0?[{icon:"add_link",id:"runtime:extension-contributions",items:H,title:o("pluginDetail.runtimeExtensionContributions")}]:[],...Q.length>0?[{icon:"api",id:"runtime:apis",items:Q,title:o("pluginDetail.runtimeApis")}]:[],...v.length>0?[{icon:"hub",id:"runtime:plugin-apis",items:v,title:o("pluginDetail.runtimePluginApis")}]:[],...w.length>0?[{icon:"route",id:"runtime:routes",items:w,title:o("pluginDetail.runtimeRoutes")}]:[],...P.length>0?[{icon:"web_asset",id:"runtime:views",items:P,title:o("pluginDetail.runtimeViews")}]:[],...p.length>0?[{icon:"manage_search",id:"runtime:launchers",items:p,title:o("pluginDetail.runtimeLaunchers")}]:[]]},[r.apis,r.scope,l.extensionContributions,l.extensionPoints,l.launcherProviders,l.pluginApis,l.routes,l.slots,l.views,o]),I=u.useMemo(()=>[...l.diagnostics.filter(m=>("pluginScope"in m?m.pluginScope:m.scope)===r.scope),...r.diagnostics??[]],[r,l.diagnostics]),W=u.useMemo(()=>new Set(C),[C]),N=u.useMemo(()=>new Set(S),[S]),K=u.useCallback((m,w)=>{const P=new Set(C);w?P.delete(m):P.add(m);const p=[...P];R(p),ht(r.scope,p),i()},[C,i,r.scope]),T=u.useCallback((m,w)=>{const P=new Set(S);w?P.delete(m):P.add(m);const p=[...P];D(p),bt(r.scope,p),i()},[S,i,r.scope]),E=u.useCallback((m,w)=>w.map((P,p)=>{const v=ft(m,P,p);return{disabled:N.has(v),id:v,value:P}}),[N]),j=u.useMemo(()=>[...$.map(m=>({disabled:W.has(m.key),icon:m.icon,id:m.key,items:E(m.key,m.items),title:o(m.labelKey)})),...U.map(m=>({...m,disabled:W.has(m.id),items:E(m.id,m.items)}))],[$,W,U,o,E]),Y=h.readme==null?o("pluginDetail.readme"):`${o("pluginDetail.readme")}: ${h.readme.path}`,B=`${o("pluginDetail.contributions")}: ${j.length}`,V=u.useMemo(()=>new Map(y.groups.map(m=>[m.kind,m])),[y.groups]),_=m=>V.get(m),L=[{icon:"article",key:"skills",title:o("pluginDetail.skills")},{icon:"deployed_code",key:"mcp",title:o("pluginDetail.mcp")},{icon:"tune",key:"hooks",title:o("pluginDetail.hooks")}],z=Sn(M.get(be)),X=u.useCallback(m=>{x(w=>{const P=new URLSearchParams(w);return m==="readme"?P.delete(be):P.set(be,m),P},{replace:!0})},[x]);return t.jsxs("div",{className:"plugin-detail-route__content",children:[t.jsx("main",{className:"plugin-detail-route__main",children:t.jsx(Mt,{activeKey:z,className:"plugin-detail-route__tabs",onChange:X,items:[{children:t.jsx(mn,{emptyText:o("pluginDetail.readmeEmpty"),error:h.error,loading:h.loading,preferredLanguage:f.resolvedLanguage??f.language,pluginScope:r.scope,readme:h.readme,readmes:h.readmes,showTitle:!1,title:o("pluginDetail.readme")}),key:"readme",label:t.jsx(G,{title:Y,children:t.jsxs("span",{className:"plugin-detail-route__tab-label","aria-label":Y,children:[t.jsx(k,{name:"article","aria-hidden":"true"}),t.jsx("span",{children:o("pluginDetail.readme")})]})})},{children:t.jsx(un,{emptyText:o("pluginDetail.noContributions"),disabledText:o("pluginDetail.contributionDisabled"),disableText:o("pluginDetail.disableContribution"),disableItemText:o("pluginDetail.disableContributionItem"),enableText:o("pluginDetail.enableContribution"),enableItemText:o("pluginDetail.enableContributionItem"),fieldLabels:{clientView:o("pluginDetail.fields.clientView"),command:o("pluginDetail.fields.command"),contributionSchema:o("pluginDetail.fields.contributionSchema"),extensionPoint:o("pluginDetail.fields.extensionPoint"),headerSchema:o("pluginDetail.fields.headerSchema"),href:o("pluginDetail.fields.href"),id:o("pluginDetail.fields.id"),inputSchema:o("pluginDetail.fields.inputSchema"),mode:o("pluginDetail.fields.mode"),outputSchema:o("pluginDetail.fields.outputSchema"),placement:o("pluginDetail.fields.placement"),proxyTarget:o("pluginDetail.fields.proxyTarget"),route:o("pluginDetail.fields.route"),routeId:o("pluginDetail.fields.routeId"),tab:o("pluginDetail.fields.tab"),target:o("pluginDetail.fields.target"),title:o("pluginDetail.fields.title"),viewId:o("pluginDetail.fields.viewId")},itemDisabledText:o("pluginDetail.contributionItemDisabled"),language:f.resolvedLanguage??f.language,noMatchesText:o("pluginDetail.noContributionMatches"),noDescriptionText:o("pluginDetail.noContributionDescription"),onItemEnabledChange:T,onRowEnabledChange:K,rows:j,searchPlaceholder:o("pluginDetail.searchContributions"),showTitle:!1,title:o("pluginDetail.contributions")}),key:"contributions",label:t.jsx(G,{title:B,children:t.jsxs("span",{className:"plugin-detail-route__tab-label","aria-label":B,children:[t.jsx(k,{name:"extension","aria-hidden":"true"}),t.jsx("span",{children:o("pluginDetail.contributions")})]})})},{children:t.jsx(Jt,{labels:{instance:o("pluginDetail.configInstance"),manifest:o("pluginDetail.configManifest"),noSchema:o("pluginDetail.configNoSchema"),options:o("pluginDetail.configOptions"),saved:o("pluginDetail.configSaved"),saveFailed:o("pluginDetail.configSaveFailed"),saving:o("pluginDetail.configSaving")},onOptionsChange:a,plugin:r}),key:"config",label:t.jsx(G,{title:o("pluginDetail.config"),children:t.jsxs("span",{className:"plugin-detail-route__tab-label","aria-label":o("pluginDetail.config"),children:[t.jsx(k,{name:"settings","aria-hidden":"true"}),t.jsx("span",{children:o("pluginDetail.config")})]})})},...L.map(m=>({children:t.jsx(Lt,{emptyText:o("pluginDetail.assetsEmpty"),error:y.error,group:_(m.key),loading:y.loading,title:m.title}),key:m.key,label:t.jsx(G,{title:m.title,children:t.jsxs("span",{className:"plugin-detail-route__tab-label","aria-label":m.title,children:[t.jsx(k,{name:m.icon,"aria-hidden":"true"}),t.jsx("span",{children:m.title})]})})}))]})}),t.jsxs("aside",{className:"plugin-detail-route__side",children:[t.jsx(cn,{labels:{clientDevEntry:o("pluginDetail.clientDevEntry"),clientEntry:o("pluginDetail.clientEntry"),disabled:o("pluginStore.disabled"),enabled:o("pluginStore.enablePluginInWorkspace"),overview:o("pluginDetail.overview"),package:o("pluginDetail.package"),request:o("pluginDetail.request"),requestedVersion:o("pluginDetail.requestedVersion"),root:o("pluginDetail.root"),serverEntry:o("pluginDetail.serverEntry"),version:o("pluginDetail.version"),watch:o("pluginStore.watch")},enabledHint:o("pluginStore.enabledHint"),enabledLoading:e,plugin:r,watchHint:o("pluginStore.watchHint"),watchLoading:b,onEnabledChange:n,onWatchChange:s}),t.jsx(dn,{diagnostics:I,emptyText:o("pluginDetail.diagnosticsEmpty"),title:o("pluginStore.diagnostics")})]})]})}const Ye=["user","project","global"],jn=["all",...Ye],kn=["all","enabled","disabled"],Ee=(e,i)=>{var n,a,s;return((s=(a=(n=e==null?void 0:e.sources)==null?void 0:n[i])==null?void 0:a.plugins)==null?void 0:s.marketplaces)??{}},ke=e=>e.trim().toLowerCase().replace(/\.git$/u,"").replace(/[^a-z0-9._-]+/gu,"-").replace(/^-+|-+$/gu,""),$e=e=>{const i=e.trim().replace(/\/+$/u,"").replace(/\.git$/u,""),n=i.split(/[/:]/u).filter(Boolean).at(-1);return ke(n??i)||"plugin-source"},Te=(e,i)=>{if(i[e]==null)return e;for(let n=2;n<100;n+=1){const a=`${e}-${n}`;if(i[a]==null)return a}return`${e}-${Date.now()}`},vn=e=>{var n,a;const i=(n=e.options)==null?void 0:n.source;if(i==null)return{detail:"",icon:"storefront",title:"-"};switch(i.source){case"git":return{detail:[i.ref,i.path].filter(Boolean).join(" · "),icon:"account_tree",title:i.url};case"github":return{detail:[i.ref,i.path].filter(Boolean).join(" · "),icon:"account_tree",title:i.repo};case"directory":return{detail:"",icon:"folder",title:i.path};case"url":return{detail:"",icon:"link",title:i.url};case"settings":return{detail:i.name??"",icon:"tune",title:((a=i.metadata)==null?void 0:a.pluginRoot)??i.name??"settings"};case"hostPattern":return{detail:"",icon:"language",title:i.hostPattern}}};function Dn({onQueryChange:e,query:i}){var Q,d;const{t:n}=re(),{message:a}=ve.useApp(),{data:s,mutate:r}=_e("/api/config",Fe),{data:l,mutate:b}=_e("/api/plugins/marketplace/catalog",_t),[f,o]=u.useState(""),[M,x]=u.useState(""),[h,y]=u.useState(""),[C,R]=u.useState(""),[S,D]=u.useState(),[$,U]=u.useState(),[I,W]=u.useState(),[N,K]=u.useState("all"),[T,E]=u.useState("all"),j=u.useMemo(()=>Ee(s,"merged"),[s]),Y=((d=(Q=s==null?void 0:s.sources)==null?void 0:Q.user)==null?void 0:d.plugins)??{},B=Y.marketplaces??{},V=(l==null?void 0:l.plugins)??[],_=u.useMemo(()=>new Map(((l==null?void 0:l.sources)??[]).map(c=>[c.key,c])),[l==null?void 0:l.sources]),L=u.useMemo(()=>Object.entries(j).map(([c,g])=>({configSource:Ye.find(A=>Ee(s,A)[c]!=null),entry:g,key:c})).sort((c,g)=>c.key.localeCompare(g.key)),[s,j]),z=i.trim().toLowerCase(),X=u.useMemo(()=>V.filter(c=>{const g=z===""||[c.name,c.description,c.version,c.marketplace,c.marketplaceTitle,c.sourceLabel,...c.skills??[],...c.commands??[],...c.agents??[]].filter(Boolean).join(" ").toLowerCase().includes(z),A=N==="all"||(c.configSource??"user")===N,q=c.enabled;return g&&A&&(T==="all"||(T==="enabled"?q:!q))}),[V,z,N,T]),m=u.useMemo(()=>{const c=ke(f),g=c!==""?c:$e(M);return Te(g,j)},[j,f,M]),w=async(c,g)=>{await vt("user","plugins",{...Y,marketplaces:c}),await r(),await b(),a.success(g)},P=c=>{W(g=>g===c?void 0:c)},p=async c=>{c.preventDefault();const g=M.trim();if(g===""){a.error(n("pluginStore.marketplaceSourceUrlRequired"));return}const A=ke(f),q=A!==""?A:$e(g),O=Te(q,j);D(O);try{await w({...B,[O]:{type:"claude-code",enabled:!0,options:{source:{source:"git",url:g,...h.trim()!==""?{ref:h.trim()}:{},...C.trim()!==""?{path:C.trim()}:{}}}}},n("pluginStore.marketplaceSourceSaved")),o(""),x(""),y(""),R("")}catch(ie){a.error(de(ie,n("pluginStore.marketplaceSourceSaveFailed")))}finally{D(void 0)}},v=async(c,g)=>{D(c.key);try{await w({...B,[c.key]:{...c.entry,enabled:g}},n(g?"pluginStore.marketplaceSourceEnabled":"pluginStore.marketplaceSourceDisabled"))}catch(A){a.error(de(A,n("pluginStore.marketplaceSourceSaveFailed")))}finally{D(void 0)}},F=async(c,g)=>{var q;const A=`${c.marketplace}:${c.name}`;U(A);try{const O=B[c.marketplace]??{type:"claude-code"},ie=((q=O.plugins)==null?void 0:q[c.name])??{};await w({...B,[c.marketplace]:{...O,type:"claude-code",plugins:{...O.plugins,[c.name]:{...ie,enabled:g}}}},n(g?"pluginStore.marketplacePluginEnabled":"pluginStore.marketplacePluginDisabled"))}catch(O){a.error(de(O,n("pluginStore.marketplacePluginSaveFailed")))}finally{U(void 0)}},H=async c=>{D(c);try{const g={...B};delete g[c],await w(g,n("pluginStore.marketplaceSourceRemoved"))}catch(g){a.error(de(g,n("pluginStore.marketplaceSourceSaveFailed")))}finally{D(void 0)}};return t.jsxs("div",{className:"plugin-marketplace",children:[t.jsx(At,{query:i,placeholder:n("pluginStore.marketplaceSearchPlaceholder"),onQueryChange:e,actions:[{active:I==="filter",ariaLabel:n("pluginStore.marketplaceFilter"),icon:"filter_alt",key:"filter",onClick:()=>P("filter"),pressed:I==="filter",title:n("pluginStore.marketplaceFilter")},{active:I==="config",ariaLabel:n("pluginStore.marketplaceConfig"),icon:"tune",key:"config",onClick:()=>P("config"),pressed:I==="config",title:n("pluginStore.marketplaceConfig")}]}),I==="filter"&&t.jsxs("div",{className:"plugin-marketplace__panel plugin-marketplace__panel--filter",children:[t.jsxs("div",{className:"plugin-marketplace__filter-row",children:[t.jsx("span",{className:"plugin-marketplace__filter-label",children:n("pluginStore.marketplaceFilterStatus")}),t.jsx("div",{className:"plugin-marketplace__filter-options",children:kn.map(c=>t.jsx(ae,{className:`plugin-marketplace__filter-option${T===c?" is-active":""}`,type:"text",size:"small",onClick:()=>E(c),children:n(`pluginStore.marketplaceFilterStatus_${c}`)},c))})]}),t.jsxs("div",{className:"plugin-marketplace__filter-row",children:[t.jsx("span",{className:"plugin-marketplace__filter-label",children:n("pluginStore.marketplaceFilterSource")}),t.jsx("div",{className:"plugin-marketplace__filter-options",children:jn.map(c=>t.jsx(ae,{className:`plugin-marketplace__filter-option${N===c?" is-active":""}`,type:"text",size:"small",onClick:()=>K(c),children:n(c==="all"?"pluginStore.marketplaceFilterAll":`config.sources.${c}`)},c))})]})]}),I==="config"&&t.jsxs("div",{className:"plugin-marketplace__panel plugin-marketplace__panel--config",children:[t.jsxs("form",{className:"plugin-marketplace__source-form",onSubmit:c=>void p(c),children:[t.jsx(le,{"aria-label":n("pluginStore.marketplaceSourceName"),placeholder:n("pluginStore.marketplaceSourceName"),value:f,onChange:c=>o(c.target.value)}),t.jsx(le,{"aria-label":n("pluginStore.marketplaceSourceUrl"),placeholder:n("pluginStore.marketplaceSourceUrl"),value:M,onChange:c=>x(c.target.value)}),t.jsxs("div",{className:"plugin-marketplace__source-form-row",children:[t.jsx(le,{"aria-label":n("pluginStore.marketplaceSourceRef"),placeholder:n("pluginStore.marketplaceSourceRef"),value:h,onChange:c=>y(c.target.value)}),t.jsx(le,{"aria-label":n("pluginStore.marketplaceSourcePath"),placeholder:n("pluginStore.marketplaceSourcePath"),value:C,onChange:c=>R(c.target.value)}),t.jsx(G,{title:n("pluginStore.addMarketplaceSource"),children:t.jsx(ae,{className:"plugin-marketplace__icon-button",htmlType:"submit",loading:S===m,"aria-label":n("pluginStore.addMarketplaceSource"),icon:t.jsx(k,{name:"add"})})})]})]}),t.jsx("div",{className:"plugin-marketplace__config-source-list",role:"list",children:L.length===0?t.jsx(ne,{image:ne.PRESENTED_IMAGE_SIMPLE,description:n("pluginStore.marketplaceSourcesEmpty")}):L.map(c=>{const g=vn(c.entry),A=_.get(c.key),q=c.configSource==="user";return t.jsxs("div",{className:"plugin-marketplace__source-item",role:"listitem",children:[t.jsx(k,{className:"plugin-marketplace__source-icon",name:g.icon}),t.jsxs("div",{className:"plugin-marketplace__source-copy",children:[t.jsxs("div",{className:"plugin-marketplace__source-title-row",children:[t.jsx("span",{className:"plugin-marketplace__source-name",children:c.key}),t.jsx(J,{children:n(`config.sources.${c.configSource??"user"}`)}),A!=null&&t.jsx(J,{children:A.pluginCount})]}),t.jsx("span",{className:"plugin-marketplace__source-url",title:g.title,children:g.title}),g.detail!==""&&t.jsx("span",{className:"plugin-marketplace__source-detail",children:g.detail}),(A==null?void 0:A.error)!=null&&t.jsx("span",{className:"plugin-marketplace__source-error",children:A.error})]}),t.jsxs("div",{className:"plugin-marketplace__source-actions",children:[t.jsx(se,{size:"small",checked:c.entry.enabled!==!1,loading:S===c.key,onChange:O=>void v(c,O)}),q&&t.jsx(G,{title:n("pluginStore.removeMarketplaceSource"),children:t.jsx(ae,{className:"plugin-marketplace__icon-button",type:"text","aria-label":n("pluginStore.removeMarketplaceSource"),icon:t.jsx(k,{name:"delete"}),onClick:()=>void H(c.key)})})]})]},c.key)})})]}),t.jsx("div",{className:"plugin-marketplace__content",children:t.jsx("section",{className:"plugin-marketplace__section plugin-marketplace__section--plugins",children:t.jsx("div",{className:"plugin-marketplace__plugin-list",role:"list",children:X.length===0?t.jsx(ne,{image:ne.PRESENTED_IMAGE_SIMPLE,description:n("pluginStore.marketplacePluginsEmpty")}):X.map(c=>{var A,q,O,ie,Ne,Ce;const g=`${c.marketplace}:${c.name}`;return t.jsxs("div",{className:"plugin-marketplace__plugin-item",role:"listitem",children:[t.jsx(k,{className:"plugin-marketplace__plugin-icon",name:"extension"}),t.jsxs("div",{className:"plugin-marketplace__plugin-copy",children:[t.jsxs("div",{className:"plugin-marketplace__plugin-title-row",children:[t.jsx("span",{className:"plugin-marketplace__plugin-name",children:c.name}),t.jsx(J,{children:n(`config.sources.${c.configSource??"user"}`)}),t.jsx(J,{children:c.marketplaceTitle??c.marketplace}),c.version!=null&&t.jsx(J,{children:c.version})]}),c.description!=null&&t.jsx("span",{className:"plugin-marketplace__plugin-description",children:c.description}),t.jsx("span",{className:"plugin-marketplace__plugin-source",title:c.sourceLabel,children:c.sourceLabel}),(((A=c.skills)==null?void 0:A.length)??0)+(((q=c.commands)==null?void 0:q.length)??0)+(((O=c.agents)==null?void 0:O.length)??0)>0&&t.jsxs("div",{className:"plugin-marketplace__plugin-meta",children:[(ie=c.skills)==null?void 0:ie.map(ee=>t.jsx(J,{children:ee},`skill:${ee}`)),(Ne=c.commands)==null?void 0:Ne.map(ee=>t.jsx(J,{children:ee},`command:${ee}`)),(Ce=c.agents)==null?void 0:Ce.map(ee=>t.jsx(J,{children:ee},`agent:${ee}`))]})]}),t.jsx("div",{className:"plugin-marketplace__plugin-actions",children:t.jsx(se,{size:"small",checked:c.enabled,disabled:!c.marketplaceEnabled,loading:$===g,onChange:ee=>void F(c,ee)})})]},g)})})})})]})}const Nn=[{icon:"toggle_on",key:"enabled",labelKey:"pluginStore.groupByEnabled"},{icon:"folder_open",key:"source",labelKey:"pluginStore.groupBySource"}],fe=(e,i)=>({contextMenuItems:i==null?void 0:i(e),icon:e.enabled===!1?"extension_off":"extension",key:e.scope,label:e.displayName??e.name??e.scope,searchText:`${e.displayName??""} ${e.name??""} ${e.scope} ${e.packageId??""} ${e.requestId??""} ${e.pluginRoot??e.rootDir??""}`}),Xe=e=>{var a,s;if(e.sourceGroup!=null)return e.sourceGroup;const i=(e.pluginRoot??e.rootDir??"").replaceAll("\\","/"),n=e.requestId.replaceAll("\\","/");return((a=e.watch)==null?void 0:a.enabled)===!0||i.includes("/.oo/plugins.dev/")?"localDev":((s=e.packageId)==null?void 0:s.startsWith("@oneworks/plugin-"))===!0||i.includes("/packages/plugins/")||i.includes("/plugins/cache/openai-bundled/")||i.includes("/plugins/cache/openai-primary-runtime/")?"builtIn":i.includes("/.oneworks/global/plugins/")?"global":n.startsWith("/")&&!i.includes("/node_modules/")?"localDev":i.includes("/node_modules/")||e.packageId!=null?"local":"global"},Cn=(e,i,n,a)=>i==="source"?[{icon:"deployed_code",key:"builtIn",labelKey:"pluginStore.sourceBuiltIn"},{icon:"public",key:"global",labelKey:"pluginStore.sourceGlobal"},{icon:"folder",key:"local",labelKey:"pluginStore.sourceLocal"},{icon:"code_blocks",key:"localDev",labelKey:"pluginStore.sourceLocalDev"}].map(r=>({icon:r.icon,items:e.filter(l=>Xe(l)===r.key).map(l=>fe(l,a)),key:`source:${r.key}`,label:n(r.labelKey)})):[{icon:"toggle_on",items:e.filter(s=>s.enabled!==!1).map(s=>fe(s,a)),key:"enabled:true",label:n("pluginStore.groupEnabled")},{icon:"toggle_off",items:e.filter(s=>s.enabled===!1).map(s=>fe(s,a)),key:"enabled:false",label:n("pluginStore.groupDisabled")}];function wn({groupMode:e,t:i,onGroupModeChange:n}){return t.jsx("span",{className:"plugin-store-route__group-actions","aria-label":i("pluginStore.groupMode"),children:Nn.map(a=>{const s=e===a.key;return t.jsx(G,{title:i(a.labelKey),children:t.jsx("button",{type:"button",className:["search-toggle-button","plugin-store-route__group-button",s?"is-open":""].filter(Boolean).join(" "),"aria-label":i(a.labelKey),"aria-pressed":s,onMouseDown:r=>r.preventDefault(),onClick:()=>n(a.key),children:t.jsx(k,{className:"search-toggle-icon",name:a.icon})})},a.key)})})}const Re="plugin-store";function Vn(){const{t:e}=re(),{message:i}=ve.useApp(),n=Ze(),{scope:a=""}=et(),[s]=Le(),{openRouteSidebar:r}=xt(),{clearRouteSidebar:l,hasRouteSidebarProvider:b,setRouteSidebar:f}=tt(),{refreshPlugins:o,reloadPlugin:M,snapshot:x}=nt(),{headerActions:h,sidebarContextMenuItems:y}=it("plugins"),[C,R]=u.useState(),[S,D]=u.useState(),[$,U]=u.useState(""),[I,W]=u.useState("enabled"),[N,K]=u.useState(""),T=a===""&&s.get("mode")==="create"?"create":"marketplace",E=u.useMemo(()=>[...x.instances].sort((p,v)=>p.scope.localeCompare(v.scope)),[x.instances]),j=u.useMemo(()=>a===""?void 0:E.find(p=>p.scope===a),[E,a]),Y=j!=null?j.displayName??j.name??j.scope:e(a===""?T==="create"?"pluginStore.createPlugin":"pluginStore.marketplace":"pluginDetail.notFound"),B=(j==null?void 0:j.enabled)===!1?"extension_off":a===""&&T==="marketplace"?"storefront":"extension",V=u.useMemo(()=>[...x.diagnostics,...E.flatMap(p=>p.diagnostics??[])],[E,x.diagnostics]),_=u.useMemo(()=>{const p=$.trim().toLowerCase();return p===""?E:E.filter(v=>{const F=v.displayName??v.name??v.scope,H=v.packageId??v.requestId??"",Q=v.pluginRoot??v.rootDir??"";return`${F} ${v.scope} ${H} ${Q}`.toLowerCase().includes(p)})},[$,E]),L=u.useCallback(async(p,v)=>{D(p);try{await St(p,v),await o(),i.success(e(v?"pluginStore.watchEnabled":"pluginStore.watchDisabled"))}catch(F){console.error("[plugin] failed to update watch mode",F),i.error(e("pluginStore.watchUpdateFailed"))}finally{D(void 0)}},[i,o,e]),z=u.useCallback((p,v,F="workspace")=>{const H=`${F}:${p}`;return R(H),yt(p,v,F).then(async()=>{await o(),i.success(e(v?"pluginStore.pluginEnabled":"pluginStore.pluginDisabled"))}).catch(Q=>{console.error("[plugin] failed to update plugin enabled state",Q),i.error(e("pluginStore.pluginEnabledUpdateFailed"))}).finally(()=>{R(void 0)})},[i,o,e]),X=u.useCallback(p=>{var g;const v=p.enabled!==!1,F=!v,H=p.pluginRoot??p.rootDir,Q=Xe(p),d=((g=p.watch)==null?void 0:g.enabled)===!0,c=!d;return[{key:`details:${p.scope}`,label:e("pluginStore.openDetails"),icon:t.jsx(k,{name:"open_in_new"}),onClick:()=>{n(`/plugins/${encodeURIComponent(p.scope)}`)}},{key:`enabled-workspace:${p.scope}`,label:e(v?"pluginStore.disablePluginInWorkspace":"pluginStore.enablePluginInWorkspace"),icon:t.jsx(k,{name:v?"extension_off":"extension"}),disabled:C===`workspace:${p.scope}`,onClick:()=>{z(p.scope,F,"workspace")}},...Q==="global"?[{key:`enabled-global:${p.scope}`,label:e(v?"pluginStore.disablePluginGlobally":"pluginStore.enablePluginGlobally"),icon:t.jsx(k,{name:"public"}),disabled:C===`global:${p.scope}`,onClick:()=>{z(p.scope,F,"global")}}]:[],{key:`watch:${p.scope}`,label:e(d?"pluginStore.disableWatch":"pluginStore.enableWatch"),icon:t.jsx(k,{name:d?"close":"speed"}),disabled:!v||S===p.scope,onClick:()=>{L(p.scope,c)}},{key:`copy-divider:${p.scope}`,type:"divider"},{key:`copy-scope:${p.scope}`,label:e("pluginStore.copyPluginScope"),icon:t.jsx(k,{name:"fingerprint"}),onClick:()=>{Ae({failureMessage:e("common.copyFailed"),messageApi:i,successMessage:e("pluginStore.pluginScopeCopied"),text:p.scope})}},...H==null||H===""?[]:[{key:`copy-root:${p.scope}`,label:e("pluginStore.copyPluginRoot"),icon:t.jsx(k,{name:"folder_open"}),onClick:()=>{Ae({failureMessage:e("common.copyFailed"),messageApi:i,successMessage:e("pluginStore.pluginRootCopied"),text:H})}}]]},[i,n,e,z,L,C,S]),m=u.useMemo(()=>Cn(_,I,e,X),[X,I,e,_]),w=u.useMemo(()=>t.jsx(wn,{groupMode:I,t:e,onGroupModeChange:W}),[I,e]),P=u.useCallback(p=>{n(`/plugins/${encodeURIComponent(p.key)}`)},[n]);return u.useLayoutEffect(()=>{if(b)return f({activeKey:j==null?void 0:j.scope,ariaLabel:e("pluginStore.installedLabel"),contextMenuItems:y,emptyText:e("pluginStore.empty"),groups:m,key:Re,search:{placeholder:e("pluginStore.searchPlaceholder"),suffix:w,value:$,onChange:U},onSelectItem:P}),()=>l(Re)},[l,P,b,$,w,y,m,j,f,e]),t.jsx(jt,{className:"plugin-store-route",bodyClassName:"plugin-store-route__body",contentInset:!0,header:t.jsx(kt,{actionItems:h,icon:B,onOpenSidebar:r,title:Y}),children:t.jsxs("div",{className:"plugin-store-route__content",children:[t.jsx("div",{className:"plugin-store-route__main",children:a===""?T==="create"?t.jsx(Tt,{}):t.jsx(Dn,{query:N,onQueryChange:K}):j==null?t.jsx("div",{className:"plugin-store-route__not-found",children:t.jsx(ne,{image:ne.PRESENTED_IMAGE_SIMPLE,description:e("pluginDetail.notFound")})}):t.jsx(yn,{plugin:j,snapshot:x,enabledLoading:C===`workspace:${j.scope}`,watchLoading:S===j.scope,onContributionPreferencesChange:()=>M(j.scope),onEnabledChange:p=>void z(j.scope,p,"workspace"),onOptionsChange:()=>o(),onWatchChange:p=>void L(j.scope,p)})}),(C!=null||S!=null)&&t.jsx("div",{className:"plugin-store-route__saving","aria-live":"polite",children:t.jsx(It,{size:"small"})}),V.length>0&&t.jsxs("div",{className:"plugin-store-route__diagnostic-badge","aria-label":e("pluginStore.diagnostics"),children:[t.jsx(k,{name:"bug_report"}),t.jsx("span",{children:V.length})]})]})})}export{Vn as PluginStoreRoute};
|
|
1
|
+
import{r as u,j as t,k as Le,h as Ze,n as et}from"./vendor-react-CnooHTJc.js";import{M as k,i as tt,n as nt,o as it}from"./route-plugin-chrome-DI32l8cC.js";import{D as we,j as at,k as st,m as rt,n as lt,o as ot,S as ct,C as ut,T as J,Q as Ke,bG as dt,bH as pt,bI as gt,bJ as mt,bK as Pe,bL as Me,bM as ht,bN as bt,bO as ft,bP as _t,e as xt,bQ as St,bR as yt,R as jt,f as kt}from"./AuthenticatedApp-CjqSg3Fe.js";import{u as re,e as _e}from"./vendor-state-Djj0Jjxr.js";import{a as Fe,u as vt}from"./use-app-preferences-BZCemhY7.js";import{bF as Oe,aI as ve,B as ae,aD as de,bU as Ae}from"./index-DgZk1SFp.js";import{u as Dt}from"./use-chat-session-actions-BNmm_R8s.js";import{h as Nt,E as ne,T as G,S as Ct}from"./MobileAwareSelect-C3a67aGF.js";import{A as Ge,C as wt}from"./Collapse-v6rPK_Og.js";import{S as Pt}from"./SchemaObjectEditor-COAQ7p3E.js";import{I as le}from"./index-aZ1QdVqZ.js";import{S as se}from"./project-file-tree-icons-Iz30jDs3.js";import{T as Mt}from"./index-CPxqxItX.js";import{A as At}from"./ActionSearchToolbar-DEGf2jhC.js";import{S as It}from"./WorkspaceApp-CokR7Tpr.js";import"./shortcutUtils-HFKOHIG8.js";/* empty css */import"./index-CqhgNUy-.js";import"./client-build-info-tgdsIlyX.js";const Et=()=>{},Ue=(e,i)=>{const n=e.trim(),a=n.toLowerCase();return a.includes("create-plugin")||a.includes("plugin-creator")?n:i("pluginStore.createLandingSendInstruction",{request:n})},$t=(e,i)=>{let n=!1;const a=e.map(s=>s.type!=="text"||n?s:(n=!0,{...s,text:Ue(s.text,i)}));return n?a:[{type:"text",text:i("pluginStore.createLandingAttachmentInstruction")},...a]};function Tt(){const{t:e}=re(),{isCompactLayout:i,isTouchInteraction:n}=Nt(),{data:a}=_e("/api/config",Fe),s=u.useRef(!1),r=u.useMemo(()=>a==null?we:at(a),[a]),[l,b]=u.useState(()=>({...st})),[f,o]=u.useState(()=>({...we})),[M,x]=u.useState(""),[h,y]=u.useState(0),{adapterOptions:C,hasAvailableModels:R,hiddenBuiltinAdapterOptions:S,builtinPreviewModelOptions:D,modelMenuGroups:$,modelSearchOptions:U,recommendedModelOptions:I,selectedAdapter:W,selectedModel:N,selectedModelWithService:K,servicePreviewModelOptions:T,setSelectedAdapter:E,setSelectedModel:j,toggleRecommendedModel:Y,updatingRecommendedModelValue:B}=rt(),{effort:V,setEffort:_,effortOptions:L}=lt(),{permissionMode:z,setPermissionMode:X,permissionModeOptions:m}=ot(),{isCreating:w,isStopping:P,send:p,sendContent:v,interrupt:F}=Dt({modelForQuery:K,hasAvailableModels:R,effort:V,permissionMode:z,adapter:W,sessionTargetDraft:l,workspaceDraft:f,onClearMessages:Et}),H=u.useMemo(()=>[{description:e("pluginStore.starterChatActionDescription"),icon:"add_comment",prompt:e("pluginStore.starterChatActionPrompt"),title:e("pluginStore.starterChatActionTitle")},{description:e("pluginStore.starterLauncherDescription"),icon:"manage_search",prompt:e("pluginStore.starterLauncherPrompt"),title:e("pluginStore.starterLauncherTitle")},{description:e("pluginStore.starterWorkbenchDescription"),icon:"tab",prompt:e("pluginStore.starterWorkbenchPrompt"),title:e("pluginStore.starterWorkbenchTitle")},{description:e("pluginStore.starterRouteDescription"),icon:"route",prompt:e("pluginStore.starterRoutePrompt"),title:e("pluginStore.starterRouteTitle")}],[e]),Q=g=>{x(g),y(A=>A+1)};u.useEffect(()=>{s.current||o({...r})},[r]);const d=t.jsxs("div",{className:"sender-container plugin-create-guide__composer",children:[t.jsx(ct,{initialContent:M,placeholder:e("pluginStore.createLandingPlaceholder"),autoFocus:!0,sessionStatus:w?"running":void 0,onInterrupt:F,stopLoading:P,onSend:g=>p(Ue(g,e)),onSendContent:g=>v($t(g,e)),builtinPreviewModelOptions:D,modelMenuGroups:$,modelSearchOptions:U,recommendedModelOptions:I,servicePreviewModelOptions:T,onToggleRecommendedModel:Y,updatingRecommendedModelValue:B,selectedModel:N,onModelChange:j,effort:V,effortOptions:L,onEffortChange:_,permissionMode:z,permissionModeOptions:m,onPermissionModeChange:X,selectedAdapter:W,adapterOptions:C,hiddenBuiltinAdapterOptions:S,onAdapterChange:E,modelUnavailable:!R,sessionTarget:{draft:l,locked:!1,disabled:w,onChange:b}},h),t.jsx(ut,{draftWorkspace:f,isCreating:w,onDraftWorkspaceChange:g=>{s.current=!0,o(g)}})]}),c=["plugin-create-landing",i||n?"plugin-create-landing--compact":""].filter(Boolean).join(" ");return t.jsxs("div",{className:c,children:[t.jsxs("div",{className:"plugin-create-guide",children:[t.jsxs("div",{className:"plugin-create-guide__header",children:[t.jsx("h2",{children:e("pluginStore.createLandingTitle")}),t.jsx("p",{children:e("pluginStore.createLandingDescription")})]}),t.jsx("div",{className:"plugin-create-guide__grid",children:H.map(g=>t.jsxs("button",{type:"button",className:"plugin-create-guide__item",onClick:()=>Q(g.prompt),children:[t.jsx("span",{className:"material-symbols-rounded plugin-create-guide__icon",children:g.icon}),t.jsxs("span",{className:"plugin-create-guide__item-text",children:[t.jsx("span",{className:"plugin-create-guide__item-title",children:g.title}),t.jsx("span",{className:"plugin-create-guide__item-desc",children:g.description})]})]},g.title))})]}),d]})}const Rt=e=>e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`;function Lt({emptyText:e,error:i,group:n,loading:a,title:s}){const r=(n==null?void 0:n.files)??[];return t.jsx("section",{className:"plugin-detail-route__section plugin-detail-route__asset-section",children:a?t.jsx(Oe,{active:!0,paragraph:{rows:5},title:!1}):i!=null?t.jsx(Ge,{type:"warning",showIcon:!0,message:i}):r.length===0?t.jsx("p",{className:"plugin-detail-route__empty",children:e}):t.jsx("div",{className:"plugin-detail-route__asset-list","aria-label":s,children:r.map(l=>t.jsxs("article",{className:"plugin-detail-route__asset-file",children:[t.jsxs("div",{className:"plugin-detail-route__asset-file-header",children:[t.jsxs("div",{className:"plugin-detail-route__asset-file-title",children:[t.jsx(k,{name:l.contentKind==="markdown"?"article":"code_blocks"}),t.jsx("span",{children:l.path})]}),t.jsxs("div",{className:"plugin-detail-route__asset-file-meta",children:[t.jsx(J,{children:l.contentKind}),t.jsx(J,{children:Rt(l.size)})]})]}),l.content==null?t.jsx("p",{className:"plugin-detail-route__asset-empty",children:e}):l.contentKind==="markdown"?t.jsx("div",{className:"plugin-detail-route__asset-markdown markdown-body",children:t.jsx(Ke,{content:l.content,openLinksInNewTab:!0})}):t.jsx("pre",{className:"plugin-detail-route__asset-code",children:l.content})]},l.path))})})}const Z=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),We=e=>e==null?void 0:e.replace(/_/g,"-").toLowerCase(),Kt=e=>{const i=We(e),n=i==null?void 0:i.split("-")[0];return[i,n,"en"].filter((a,s,r)=>a!=null&&a!==""&&r.indexOf(a)===s)},me=(e,i)=>{if(typeof e=="string")return e;if(!Z(e))return;const n=Object.entries(e).map(([a,s])=>[We(a),typeof s=="string"?s:void 0]).filter(a=>a[0]!=null&&a[1]!=null);if(n.length!==0){for(const a of Kt(i)){const s=n.find(([l])=>l===a);if(s!=null)return s[1];const r=n.find(([l])=>l.split("-")[0]===a);if(r!=null)return r[1]}return n[0][1]}},ge=(e,i,n)=>{const a=me(e[`${i}I18n`],n);if(a!=null)return a;if(Z(e.i18n)){const s=Object.fromEntries(Object.entries(e.i18n).map(([l,b])=>[l,Z(b)&&typeof b[i]=="string"?b[i]:void 0])),r=me(s,n);if(r!=null)return r}return me(e[i],n)},Be=e=>{const i=e["x-oneworks-ui"]??e["x-ui"]??e.ui;return Z(i)?i:{}},oe=(...e)=>e.find(i=>typeof i=="string"&&i.trim()!==""),xe=e=>{const i=e.type;if(typeof i=="string")return i;if(Array.isArray(i))return i.find(n=>typeof n=="string"&&n!=="null");if(Z(e.properties))return"object";if(Array.isArray(e.enum)||Array.isArray(e.oneOf)||Array.isArray(e.anyOf))return"string"},Ft=e=>Z(e.properties)?e.properties:void 0,Ot=e=>Z(e.items)?e.items:void 0,Gt=e=>e.every(i=>typeof i=="string"),ze=(e,i)=>{if(Array.isArray(e.enum)&&Gt(e.enum)){const s=Array.isArray(e.enumNames)?e.enumNames:[];return e.enum.map((r,l)=>({value:r,label:typeof s[l]=="string"?s[l]:r}))}const a=(Array.isArray(e.oneOf)?e.oneOf:Array.isArray(e.anyOf)?e.anyOf:[]).flatMap(s=>!Z(s)||typeof s.const!="string"?[]:[{value:s.const,label:ge(s,"title",i)??s.const,description:ge(s,"description",i)}]);return a.length>0?a:void 0},Ut=e=>{const i=Be(e),n=oe(i.control,i.type,i.widget);if(n==="textarea"||n==="multiline")return"multiline";if(n==="json")return"json";if(ze(e,"en")!=null)return"select";const a=xe(e);if(a==="boolean")return"boolean";if(a==="integer"||a==="number")return"number";if(a==="array"){const s=Ot(e);return s!=null&&xe(s)==="string"?"string[]":"json"}if(a==="string"){const s=oe(e.format);return s==="textarea"||s==="multiline"?"multiline":"string"}return"json"},Wt=e=>e==="boolean"?"toggle_on":e==="number"?"numbers":e==="string[]"?"view_list":e==="select"?"checklist":e==="multiline"?"notes":e==="json"?"data_object":"text_fields",He=(e,i,n,a)=>{const s=Ft(e),r=xe(e),l=Be(e),b=oe(l.control,l.type,l.widget)==="json";if(r==="object"&&s!=null&&!b){for(const[M,x]of Object.entries(s))Z(x)&&He(x,[...i,M],n,a);return}if(i.length===0)return;const f=Ut(e),o=oe(l.icon)??Wt(f);a.push({path:i,type:f,defaultValue:e.default,label:ge(e,"title",n),description:ge(e,"description",n),icon:o,placeholder:oe(l.placeholder,e.placeholder),sensitive:e.writeOnly===!0||e.format==="password"||l.sensitive===!0,options:ze(e,n)})},Bt=e=>{const i=(e==null?void 0:e.schema)??(e==null?void 0:e.jsonSchema);return Z(i)?i:void 0},zt=(e,i)=>{if((e==null?void 0:e.uiSchema)!=null)return e.uiSchema;const n=Bt(e);if(!Z(n))return;const a=[];return He(n,[],i,a),a.length===0?void 0:{fields:a}},Ht=e=>JSON.stringify(e,null,2),De=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),qt=e=>De(e)?e:{},Se=e=>{if(e===void 0)return;if(Array.isArray(e))return e.map(Se).filter(n=>n!==void 0);if(!De(e))return e;const i=Object.entries(e).map(([n,a])=>[n,Se(a)]).filter(n=>n[1]!==void 0);return Object.fromEntries(i)},qe=e=>{const i=Se(e);return De(i)?i:{}},pe=e=>JSON.stringify(qe(e)),Vt=e=>{var i;return{enabled:e.enabled!==!1,id:e.requestId,options:e.options??{},packageId:e.packageId,pluginRoot:e.pluginRoot??e.rootDir,scope:e.scope,sourceGroup:e.sourceGroup,watch:((i=e.watch)==null?void 0:i.enabled)===!0}},Qt=e=>{var i;return e.manifest??{displayName:e.displayName,name:e.name,plugin:{client:e.client,contributions:((i=e.plugin)==null?void 0:i.contributions)??e.contributions}}};function Jt({labels:e,onOptionsChange:i,plugin:n}){var W;const{message:a}=ve.useApp(),{i18n:s,t:r}=re(),l=s.resolvedLanguage??s.language,b=u.useMemo(()=>{var N;return zt((N=n.manifest)==null?void 0:N.config,l)},[(W=n.manifest)==null?void 0:W.config,l]),f=u.useMemo(()=>qt(n.options),[n.options]),[o,M]=u.useState(f),[x,h]=u.useState("idle"),y=u.useRef(),C=u.useRef(0),R=u.useRef(pe(f)),S=u.useCallback(()=>{y.current!=null&&(clearTimeout(y.current),y.current=void 0)},[]);u.useEffect(()=>{S(),M(f),R.current=pe(f),C.current+=1,h("idle")},[S,f,n.scope]),u.useEffect(()=>()=>S(),[S]);const D=u.useCallback(async(N,K)=>{const T=qe(N),E=pe(T);if(R.current===E){C.current===K&&h("idle");return}C.current===K&&h("saving");try{const j=await dt(n.scope,T);R.current=pe(j),C.current===K&&(M(j),h("saved"),await(i==null?void 0:i()))}catch(j){console.error("[plugin] failed to update plugin options",j),C.current===K&&(h("error"),a.error(e.saveFailed))}},[e.saveFailed,a,i,n.scope]),$=u.useCallback(N=>{M(N),S();const K=C.current+1;C.current=K,h("pending"),y.current=setTimeout(()=>{y.current=void 0,D(N,K)},700)},[S,D]),U=[{icon:"settings",key:"instance",title:e.instance,value:Vt(n)},{icon:"data_object",key:"manifest",title:e.manifest,value:Qt(n)}],I=x==="saving"||x==="pending"?e.saving:x==="saved"?e.saved:x==="error"?e.saveFailed:void 0;return t.jsxs("section",{className:"plugin-detail-route__section plugin-detail-route__config-section",children:[t.jsxs("article",{className:"plugin-detail-route__config-form",children:[t.jsxs("div",{className:"plugin-detail-route__config-block-header",children:[t.jsx(k,{name:"tune","aria-hidden":"true"}),t.jsx("h2",{children:e.options}),I!=null&&t.jsx("span",{className:`plugin-detail-route__config-save-state is-${x}`,children:I})]}),b==null?t.jsx(ne,{image:ne.PRESENTED_IMAGE_SIMPLE,description:e.noSchema}):t.jsx(Pt,{value:o,schema:b,onChange:$,t:r})]}),b==null&&t.jsx("div",{className:"plugin-detail-route__config-list",children:U.map(N=>t.jsxs("article",{className:"plugin-detail-route__config-block",children:[t.jsxs("div",{className:"plugin-detail-route__config-block-header",children:[t.jsx(k,{name:N.icon,"aria-hidden":"true"}),t.jsx("h2",{children:N.title})]}),t.jsx("pre",{className:"plugin-detail-route__config-code",children:Ht(N.value)})]},N.key))})]})}const Yt=[{icon:"extension",key:"extensionPoints",labelKey:"pluginDetail.groups.extensionPoints"},{icon:"add_link",key:"extensionContributions",labelKey:"pluginDetail.groups.extensionContributions"},{icon:"dock_to_left",key:"navItems",labelKey:"pluginDetail.groups.navItems"},{icon:"more_horiz",key:"navMoreMenu",labelKey:"pluginDetail.groups.navMoreMenu"},{icon:"vertical_align_top",key:"navFooterBefore",labelKey:"pluginDetail.groups.navFooterBefore"},{icon:"add_comment",key:"chatHeaderActions",labelKey:"pluginDetail.groups.chatHeaderActions"},{icon:"more_vert",key:"chatHeaderMoreMenu",labelKey:"pluginDetail.groups.chatHeaderMoreMenu"},{icon:"dashboard_customize",key:"chatInteractionPanelEmptyActions",labelKey:"pluginDetail.groups.chatInteractionPanelEmptyActions"},{icon:"web_asset",key:"routeHeaderActions",labelKey:"pluginDetail.groups.routeHeaderActions"},{icon:"more_vert",key:"routeMoreMenuItems",labelKey:"pluginDetail.groups.routeMoreMenuItems"},{icon:"left_click",key:"routeSidebarContextMenu",labelKey:"pluginDetail.groups.routeSidebarContextMenu"},{icon:"dock_to_left",key:"routeWindowBarActions",labelKey:"pluginDetail.groups.routeWindowBarActions"},{icon:"add_box",key:"workbenchAddMenu",labelKey:"pluginDetail.groups.workbenchAddMenu"},{icon:"tab",key:"workbenchTabs",labelKey:"pluginDetail.groups.workbenchTabs"},{icon:"view_sidebar",key:"workspaceDrawerTabs",labelKey:"pluginDetail.groups.workspaceDrawerTabs"},{icon:"manage_search",key:"launcherSearchProviders",labelKey:"pluginDetail.groups.launcherSearchProviders"},{icon:"route",key:"routes",labelKey:"pluginDetail.groups.routes"}],Ve=["id","title","targetRoute","targetRoutes","route","routeId","command","mode","target","proxyTarget","extensionPoint","contributionSchema","href","active","activeLabel","activeTitle","danger","disabled","selected","tab","clientView","viewId","placement","icon","activeIcon","shortcut","inputSchema","outputSchema","headerSchema"],Xt={active:"radio_button_checked",activeLabel:"label",activeTitle:"tooltip",clientView:"language",command:"terminal",contributionSchema:"schema",danger:"warning",disabled:"toggle_off",extensionPoint:"extension",headerSchema:"fact_check",href:"open_in_new",id:"fingerprint",inputSchema:"input",mode:"route",outputSchema:"output",icon:"symbol",placement:"dock_to_right",proxyTarget:"hub",route:"link",routeId:"link",shortcut:"keyboard",selected:"check_circle",tab:"layers",target:"api",targetRoute:"filter_alt",targetRoutes:"filter_alt",title:"sell",viewId:"language"},Zt=["all","enabled","disabled"],en={all:"filter_list",disabled:"toggle_off",enabled:"toggle_on"},tn=e=>{var n,a,s;const i=((n=e.plugin)==null?void 0:n.contributions)??e.contributions??((s=(a=e.manifest)==null?void 0:a.plugin)==null?void 0:s.contributions)??{};return i.routeMoreMenuItems!=null||i.routeMoreMenu==null?i:{...i,routeMoreMenuItems:i.routeMoreMenu}},ye=e=>{if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){const i=e.map(n=>ye(n)).filter(n=>n!=null&&n!=="");return i.length===0?void 0:i.join(", ")}if(e!=null&&typeof e=="object")return JSON.stringify(e)},Qe=e=>e==null?void 0:e.replace(/_/g,"-").toLowerCase(),nn=e=>{const i=Qe(e),n=i==null?void 0:i.split("-")[0];return[i,n,"en"].filter((a,s,r)=>a!=null&&r.indexOf(a)===s)},ce=(e,i,n={})=>{const a=ye(e);if(a!=null)return a;if(e==null||typeof e!="object"||Array.isArray(e))return;const s=Object.entries(e).map(([l,b])=>[Qe(l),ye(b)]).filter(l=>l[0]!=null&&l[1]!=null);if(s.length===0)return;const r=nn(i);for(const l of r){const b=s.find(([o])=>o===l);if(b!=null)return b[1];const f=s.find(([o])=>o.split("-")[0]===l);if(f!=null)return f[1]}return n.allowAnyFallback===!1?void 0:s[0][1]},ue=(e,i,n)=>{const a=ce(e[`${i}I18n`],n,{allowAnyFallback:!1});if(a!=null)return a;const s=e.i18n;if(s!=null&&typeof s=="object"&&!Array.isArray(s)){const r=ce(Object.fromEntries(Object.entries(s).map(([l,b])=>[l,b!=null&&typeof b=="object"&&!Array.isArray(b)?b[i]:void 0])),n,{allowAnyFallback:!1});if(r!=null)return r}return ce(e[i],n)},je=(e,i)=>`${e}: ${i??"-"}`,Je=(e,i)=>e!=null&&typeof e=="object"&&!Array.isArray(e)?e:{id:i,value:e},an=(e,i,n)=>{const a=ue(e,"description",i);return a??n},sn=e=>e.trim().toLocaleLowerCase(),rn=(e,i,n)=>{const a=Je(e.value,e.id);return[e.id,ue(a,"title",i),ue(a,"description",i),...Ve.flatMap(s=>[s,n[s],ce(a[s],i)])].filter(s=>s!=null&&s!=="").join(" ").toLocaleLowerCase()},ln=(e,i,n)=>{switch(n){case"disabled":return e.disabled===!0?i:i.filter(a=>a.disabled===!0);case"enabled":return e.disabled===!0?[]:i.filter(a=>a.disabled!==!0);case"all":return i}},on=({disableItemText:e,enableItemText:i,fieldLabels:n,item:a,itemDisabledText:s,language:r,noDescriptionText:l,onItemEnabledChange:b})=>{const f=Je(a.value,a.id),o=ue(f,"title",r)??ue(f,"id",r)??a.id,M=a.disabled===!0?s??l:an(f,r,l),x=Ve.filter(h=>h!=="title").map(h=>[h,ce(f[h],r)]).filter(h=>h[1]!=null);return t.jsxs("div",{className:`plugin-detail-route__contribution-item${a.disabled===!0?" is-disabled":""}`,children:[t.jsx("div",{className:"plugin-detail-route__contribution-main",children:t.jsxs("div",{className:"plugin-detail-route__contribution-title-row",children:[t.jsxs("div",{className:"plugin-detail-route__contribution-title-main",children:[t.jsx("div",{className:"plugin-detail-route__contribution-title",children:o}),t.jsx("p",{className:"plugin-detail-route__contribution-description",children:M})]}),b!=null&&t.jsx(G,{title:a.disabled===!0?i:e,children:t.jsx("span",{className:"plugin-detail-route__contribution-item-toggle",children:t.jsx(se,{"aria-label":a.disabled===!0?i:e,checked:a.disabled!==!0,size:"small",onChange:h=>b(a.id,h),onClick:(h,y)=>y.stopPropagation()})})})]})}),x.length>0&&t.jsx("div",{className:"plugin-detail-route__contribution-tags",children:x.map(([h,y])=>t.jsx(G,{title:je(n[h]??h,y),children:t.jsxs("span",{className:"plugin-detail-route__contribution-tag","aria-label":je(n[h]??h,y),children:[t.jsx(k,{name:Xt[h]??"info","aria-hidden":"true"}),t.jsx("span",{children:n[h]??h}),t.jsx("strong",{children:y})]})},`${h}:${y}`))})]},a.id)};function te({icon:e,label:i,value:n}){const a=je(i,n),s=n==null||n===""?"-":n;return t.jsxs("div",{className:`plugin-detail-route__fact ${n==null||n===""?"is-empty":"is-set"}`,"aria-label":a,children:[t.jsx("span",{className:"plugin-detail-route__fact-icon",children:t.jsx(k,{name:e,"aria-hidden":"true"})}),t.jsxs("span",{className:"plugin-detail-route__fact-main",children:[t.jsx("span",{className:"plugin-detail-route__fact-label",children:i}),t.jsx("span",{className:"plugin-detail-route__fact-value",children:s})]})]})}function cn({enabledHint:e,enabledLoading:i,labels:n,onEnabledChange:a,onWatchChange:s,plugin:r,watchHint:l,watchLoading:b}){var f,o,M,x,h,y;return t.jsxs("section",{className:"plugin-detail-route__overview",children:[t.jsxs("div",{className:"plugin-detail-route__title-row",children:[t.jsxs("div",{className:"plugin-detail-route__title-main",children:[t.jsx(k,{name:"info","aria-hidden":"true"}),t.jsx("h2",{children:n.overview})]}),r.enabled===!1&&t.jsx("div",{className:"plugin-detail-route__title-tags",children:t.jsx(G,{title:n.disabled,children:t.jsx("span",{className:"plugin-detail-route__scope-icon is-danger","aria-label":n.disabled,children:t.jsx(k,{name:"close","aria-hidden":"true"})})})})]}),t.jsxs("div",{className:"plugin-detail-route__facts",children:[t.jsx(te,{icon:"deployed_code",label:n.version,value:r.version}),t.jsx(te,{icon:"download",label:n.requestedVersion,value:r.requestedVersion}),t.jsx(te,{icon:"layers",label:n.package,value:r.packageId}),t.jsx(te,{icon:"link",label:n.request,value:r.requestId}),t.jsx(te,{icon:"folder_open",label:n.root,value:r.pluginRoot??r.rootDir}),t.jsx(te,{icon:"language",label:n.clientEntry,value:r.clientEntryUrl??((f=r.client)==null?void 0:f.entry)}),t.jsx(te,{icon:"tune",label:n.clientDevEntry,value:r.devClientEntryUrl??((o=r.client)==null?void 0:o.devServer)}),t.jsx(te,{icon:"terminal",label:n.serverEntry,value:(h=(x=(M=r.manifest)==null?void 0:M.plugin)==null?void 0:x.server)==null?void 0:h.entry})]}),t.jsx(G,{title:e,children:t.jsxs("span",{className:"plugin-detail-route__watch","aria-label":n.enabled,children:[t.jsxs("span",{className:"plugin-detail-route__watch-main",children:[t.jsx(k,{name:r.enabled===!1?"extension_off":"extension","aria-hidden":"true"}),t.jsx("span",{children:n.enabled})]}),t.jsx(se,{"aria-label":n.enabled,checked:r.enabled!==!1,loading:i,onChange:a})]})}),t.jsx(G,{title:l,children:t.jsxs("span",{className:"plugin-detail-route__watch","aria-label":n.watch,children:[t.jsxs("span",{className:"plugin-detail-route__watch-main",children:[t.jsx(k,{name:"speed","aria-hidden":"true"}),t.jsx("span",{children:n.watch})]}),t.jsx(se,{"aria-label":n.watch,checked:((y=r.watch)==null?void 0:y.enabled)===!0,disabled:r.enabled===!1,loading:b,onChange:s})]})})]})}function un({disableText:e,disabledText:i,disableItemText:n,emptyText:a,enableItemText:s,enableText:r,fieldLabels:l,itemDisabledText:b,language:f,noMatchesText:o,noDescriptionText:M,onItemEnabledChange:x,onRowEnabledChange:h,rows:y,searchPlaceholder:C,showTitle:R=!0,title:S}){var B,V;const{t:D}=re(),[$,U]=u.useState(""),[I,W]=u.useState(!1),[N,K]=u.useState("all"),T=sn($),E=u.useMemo(()=>y.map(_=>{const L=`${_.id} ${_.title}`.toLocaleLowerCase().includes(T),z=T===""||L?_.items:_.items.filter(m=>rn(m,f,l).includes(T)),X=ln(_,z,N);return{..._,items:X}}).filter(_=>_.items.length>0),[l,f,T,y,N]),j=((B=E.find(_=>_.disabled!==!0))==null?void 0:B.id)??((V=E[0])==null?void 0:V.id),Y=y.length===0?a:o;return t.jsxs("section",{className:`plugin-detail-route__section${R?"":" plugin-detail-route__section--flush-top"}`,children:[R&&t.jsx("div",{className:"plugin-detail-route__title-row",children:t.jsxs("div",{className:"plugin-detail-route__title-main",children:[t.jsx(k,{name:"extension"}),t.jsx("h2",{children:S})]})}),y.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"plugin-detail-route__section-toolbar",children:[t.jsx(le,{allowClear:!0,className:"plugin-detail-route__search-input",placeholder:C,prefix:t.jsx(k,{name:"search","aria-hidden":"true"}),value:$,onChange:_=>U(_.target.value)}),t.jsx("div",{className:"plugin-detail-route__section-toolbar-actions",children:t.jsx(G,{title:D("pluginDetail.filter"),children:t.jsx(ae,{className:`plugin-detail-route__section-toolbar-button${I?" is-active":""}`,type:"text","aria-label":D("pluginDetail.filter"),"aria-pressed":I,icon:t.jsx(k,{name:"filter_alt","aria-hidden":"true"}),onClick:()=>W(_=>!_)})})})]}),I&&t.jsx("div",{className:"plugin-detail-route__filter-panel",children:t.jsxs("div",{className:"plugin-detail-route__filter-row",children:[t.jsxs("span",{className:"plugin-detail-route__filter-label",children:[t.jsx(k,{name:"toggle_on","aria-hidden":"true"}),t.jsx("span",{children:D("pluginDetail.filterStatus")})]}),t.jsx("div",{className:"plugin-detail-route__filter-options",children:Zt.map(_=>t.jsx(ae,{className:`plugin-detail-route__filter-option${N===_?" is-active":""}`,type:"text",size:"small",icon:t.jsx(k,{name:en[_],"aria-hidden":"true"}),onClick:()=>K(_),children:D(`pluginDetail.filterStatus_${_}`)},_))})]})})]}),E.length===0?t.jsx("p",{className:"plugin-detail-route__empty",children:Y}):t.jsx(wt,{accordion:!0,bordered:!1,className:"plugin-detail-route__contribution-accordion",defaultActiveKey:j,items:E.map(_=>({children:_.disabled===!0?t.jsxs("p",{className:"plugin-detail-route__contribution-disabled",children:[t.jsx(k,{name:"extension_off","aria-hidden":"true"}),t.jsx("span",{children:i})]}):t.jsx("div",{className:"plugin-detail-route__contribution-list",children:_.items.map(L=>on({disableItemText:n,enableItemText:s,fieldLabels:l,item:L,itemDisabledText:b,language:f,noDescriptionText:M,onItemEnabledChange:x}))}),className:`plugin-detail-route__contribution-group${_.disabled===!0?" is-disabled":""}`,key:_.id,label:t.jsxs("div",{className:"plugin-detail-route__contribution-group-title",children:[t.jsxs("span",{className:"plugin-detail-route__contribution-group-main",children:[t.jsx("span",{className:"plugin-detail-route__contribution-group-icon",children:t.jsx(k,{name:_.icon,"aria-hidden":"true"})}),t.jsx("span",{className:"plugin-detail-route__contribution-group-label",children:_.title})]}),h!=null&&t.jsx(G,{title:_.disabled===!0?r:e,children:t.jsx("span",{className:"plugin-detail-route__contribution-group-toggle",onClick:L=>L.stopPropagation(),children:t.jsx(se,{"aria-label":_.disabled===!0?r:e,checked:_.disabled!==!0,size:"small",onChange:L=>h(_.id,L)})})})]})}))},`${T}:${N}`)]})}function dn({diagnostics:e,emptyText:i,title:n}){return t.jsxs("section",{className:"plugin-detail-route__diagnostics",children:[t.jsxs("div",{className:"plugin-detail-route__title-row",children:[t.jsxs("div",{className:"plugin-detail-route__title-main",children:[t.jsx(k,{name:"info","aria-hidden":"true"}),t.jsx("h2",{children:n})]}),e.length>0&&t.jsx(G,{title:`${n}: ${e.length}`,children:t.jsxs("span",{className:"plugin-detail-route__diagnostic-count","aria-label":`${n}: ${e.length}`,children:[t.jsx(k,{name:"bug_report","aria-hidden":"true"}),t.jsx("span",{children:e.length})]})})]}),e.length===0?t.jsx(G,{title:i,children:t.jsxs("p",{className:"plugin-detail-route__diagnostics-empty","aria-label":i,children:[t.jsx(k,{name:"check","aria-hidden":"true"}),t.jsx("span",{children:i})]})}):e.map((a,s)=>t.jsxs("div",{className:"plugin-detail-route__diagnostic",children:[t.jsx(J,{color:a.level==="error"?"error":a.level==="warning"?"warning":void 0,children:a.level}),t.jsx("span",{children:a.message})]},`${a.message}:${s}`))]})}const pn=/^[a-z][a-z\d+\-.]*:|^\/\//i,gn=(e,i)=>{const n=i.trim();if(n===""||n.startsWith("#")||pn.test(n))return;const a=e.replace(/\\/g,"/").split("/").slice(0,-1).filter(Boolean).join("/"),s=a===""?"/":`/${a}/`;try{const r=new URL(n,`https://plugin.local${s}`);if(r.origin!=="https://plugin.local")return;const l=decodeURIComponent(r.pathname).replace(/^\/+/,"");return l===""?void 0:l}catch{return}},he=e=>e==null?void 0:e.replace(/_/g,"-").toLowerCase(),Ie=(e,i)=>{if(e.length===0)return;const n=he(i);if(n!=null){const a=e.find(l=>he(l.language)===n);if(a!=null)return a.path;const s=n.split("-")[0],r=e.find(l=>{var b;return((b=he(l.language))==null?void 0:b.split("-")[0])===s});if(r!=null)return r.path}return e[0].path};function mn({emptyText:e,error:i,loading:n,preferredLanguage:a,pluginScope:s,readme:r,readmes:l=r==null?[]:[r],showTitle:b=!0,title:f}){const[o,M]=u.useState(()=>Ie(l,a)),x=u.useMemo(()=>l.find(S=>S.path===o)??r,[r,l,o]),h=u.useMemo(()=>l.map(S=>({label:S.language==null?S.path:`${S.language} (${S.path})`,value:S.path})),[l]);u.useEffect(()=>{M(Ie(l,a))},[a,l]);const y=S=>{if(x==null)return;const D=gn(x.path,S);return D==null?void 0:pt(s,D)},C=({alt:S,src:D,title:$})=>{const U=y(D)??D;return t.jsx("img",{src:U,alt:S??"",title:$,loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"})},R=(S,D)=>{const $=y(S);$!=null&&(D.preventDefault(),window.open($,"_blank","noopener,noreferrer"))};return t.jsxs("section",{className:"plugin-detail-route__readme",children:[b&&t.jsxs("div",{className:"plugin-detail-route__title-row",children:[t.jsxs("div",{className:"plugin-detail-route__title-main",children:[t.jsx(k,{name:"article"}),t.jsx("h2",{children:f})]}),x!=null&&t.jsx(J,{children:x.path})]}),h.length>1&&t.jsx("div",{className:"plugin-detail-route__readme-toolbar",children:t.jsx(Ct,{"aria-label":f,options:h,popupMatchSelectWidth:!1,size:"small",value:o,onChange:M})}),n?t.jsx(Oe,{active:!0,paragraph:{rows:5},title:!1}):i!=null?t.jsx(Ge,{type:"warning",showIcon:!0,message:i}):x==null?t.jsx("p",{className:"plugin-detail-route__empty",children:e}):t.jsx("div",{className:"plugin-detail-route__readme-content",children:t.jsx(Ke,{content:x.content,openLinksInNewTab:!0,renderImage:C,onLinkClick:R})})]})}const hn=(e,i,n)=>{const[a,s]=u.useState({groups:[],loading:!1});return u.useEffect(()=>{if(e==null){s({groups:[],loading:!1});return}let r=!1;return s({groups:[],loading:!0}),gt(e.scope).then(l=>{r||s({groups:l,loading:!1})}).catch(l=>{if(r)return;const b=l instanceof Error?l.message:n;s({error:b,groups:[],loading:!1})}),()=>{r=!0}},[n,e,i]),a},bn=(e,i,n)=>{const[a,s]=u.useState({loading:!1,readmes:[]});return u.useEffect(()=>{if(e==null){s({loading:!1,readmes:[]});return}let r=!1;return s({loading:!0,readmes:[]}),mt(e.scope).then(({readme:l,readmes:b})=>{r||s({loading:!1,readme:l,readmes:b})}).catch(l=>{if(r)return;const b=l instanceof Error?l.message:n;s({error:b,loading:!1,readmes:[]})}),()=>{r=!0}},[n,e,i]),a},fn={"chat.header.actions":"pluginDetail.groups.chatHeaderActions","chat.header.moreMenu":"pluginDetail.groups.chatHeaderMoreMenu","chat.interactionPanel.emptyActions":"pluginDetail.groups.chatInteractionPanelEmptyActions","launcher.searchProviders":"pluginDetail.groups.launcherSearchProviders","nav.footer.before":"pluginDetail.groups.navFooterBefore","nav.items":"pluginDetail.groups.navItems","nav.moreMenu":"pluginDetail.groups.navMoreMenu","route.header.actions":"pluginDetail.groups.routeHeaderActions","route.moreMenu.items":"pluginDetail.groups.routeMoreMenuItems","route.sidebar.contextMenu":"pluginDetail.groups.routeSidebarContextMenu","route.windowBar.actions":"pluginDetail.groups.routeWindowBarActions","workbench.addMenu":"pluginDetail.groups.workbenchAddMenu","workbench.tabs":"pluginDetail.groups.workbenchTabs","workspace.drawer.tabs":"pluginDetail.groups.workspaceDrawerTabs"},be="tab",_n=["readme","contributions","config","skills","mcp","hooks"],xn=new Set(_n),Sn=e=>e!=null&&xn.has(e)?e:"readme";function yn({enabledLoading:e,onContributionPreferencesChange:i,onEnabledChange:n,onOptionsChange:a,onWatchChange:s,plugin:r,snapshot:l,watchLoading:b}){const{i18n:f,t:o}=re(),[M,x]=Le(),h=bn(r,l.instances,o("pluginDetail.readmeLoadFailed")),y=hn(r,l.instances,o("pluginDetail.assetsLoadFailed")),[C,R]=u.useState(()=>Pe(r.scope)),[S,D]=u.useState(()=>Me(r.scope));u.useEffect(()=>{R(Pe(r.scope)),D(Me(r.scope))},[r.scope]);const $=u.useMemo(()=>{const m=tn(r);return Yt.map(w=>{const P=m[w.key];return{...w,items:Array.isArray(P)?P:[]}}).filter(w=>w.items.length>0)},[r]),U=u.useMemo(()=>{const m=Object.entries(l.slots).flatMap(([d,c])=>{const g=(c??[]).filter(O=>O.pluginScope===r.scope);if(g.length===0)return[];const A=fn[d],q=A==null?d:o(A);return[{icon:"widgets",id:`slot:${d}`,items:g,title:o("pluginDetail.runtimeSlotLabel",{slot:q})}]}),w=l.routes.filter(d=>d.scope===r.scope).map(d=>({id:d.id,title:d.title,viewId:d.viewId})),P=l.views.filter(d=>d.scope===r.scope).map(d=>({id:d.id})),p=l.launcherProviders.filter(d=>d.scope===r.scope).map(d=>({command:d.command,id:d.id,title:d.title})),v=l.pluginApis.filter(d=>d.pluginScope===r.scope).map(d=>({description:d.description,descriptionI18n:d.descriptionI18n,id:d.id,inputSchema:d.inputSchema,outputSchema:d.outputSchema,title:d.title,titleI18n:d.titleI18n})),F=l.extensionPoints.filter(d=>d.pluginScope===r.scope).map(d=>({contributionSchema:d.contributionSchema,description:d.description,descriptionI18n:d.descriptionI18n,id:d.id,title:d.title,titleI18n:d.titleI18n})),H=Object.values(l.extensionContributions).flat().filter(d=>d.pluginScope===r.scope).map(d=>({command:typeof d.command=="string"?d.command:void 0,description:d.description,descriptionI18n:d.descriptionI18n,extensionPoint:d.extensionPoint,icon:typeof d.icon=="string"?d.icon:void 0,id:d.id,target:d.target,title:d.title,titleI18n:d.titleI18n})),Q=(r.apis??[]).map(d=>({description:d.description,headerSchema:d.headerSchema,id:d.id,inputSchema:d.inputSchema,mode:d.mode,outputSchema:d.outputSchema,proxyTarget:d.proxyTarget,target:d.target,title:d.title}));return[...m,...F.length>0?[{icon:"extension",id:"runtime:extension-points",items:F,title:o("pluginDetail.runtimeExtensionPoints")}]:[],...H.length>0?[{icon:"add_link",id:"runtime:extension-contributions",items:H,title:o("pluginDetail.runtimeExtensionContributions")}]:[],...Q.length>0?[{icon:"api",id:"runtime:apis",items:Q,title:o("pluginDetail.runtimeApis")}]:[],...v.length>0?[{icon:"hub",id:"runtime:plugin-apis",items:v,title:o("pluginDetail.runtimePluginApis")}]:[],...w.length>0?[{icon:"route",id:"runtime:routes",items:w,title:o("pluginDetail.runtimeRoutes")}]:[],...P.length>0?[{icon:"web_asset",id:"runtime:views",items:P,title:o("pluginDetail.runtimeViews")}]:[],...p.length>0?[{icon:"manage_search",id:"runtime:launchers",items:p,title:o("pluginDetail.runtimeLaunchers")}]:[]]},[r.apis,r.scope,l.extensionContributions,l.extensionPoints,l.launcherProviders,l.pluginApis,l.routes,l.slots,l.views,o]),I=u.useMemo(()=>[...l.diagnostics.filter(m=>("pluginScope"in m?m.pluginScope:m.scope)===r.scope),...r.diagnostics??[]],[r,l.diagnostics]),W=u.useMemo(()=>new Set(C),[C]),N=u.useMemo(()=>new Set(S),[S]),K=u.useCallback((m,w)=>{const P=new Set(C);w?P.delete(m):P.add(m);const p=[...P];R(p),ht(r.scope,p),i()},[C,i,r.scope]),T=u.useCallback((m,w)=>{const P=new Set(S);w?P.delete(m):P.add(m);const p=[...P];D(p),bt(r.scope,p),i()},[S,i,r.scope]),E=u.useCallback((m,w)=>w.map((P,p)=>{const v=ft(m,P,p);return{disabled:N.has(v),id:v,value:P}}),[N]),j=u.useMemo(()=>[...$.map(m=>({disabled:W.has(m.key),icon:m.icon,id:m.key,items:E(m.key,m.items),title:o(m.labelKey)})),...U.map(m=>({...m,disabled:W.has(m.id),items:E(m.id,m.items)}))],[$,W,U,o,E]),Y=h.readme==null?o("pluginDetail.readme"):`${o("pluginDetail.readme")}: ${h.readme.path}`,B=`${o("pluginDetail.contributions")}: ${j.length}`,V=u.useMemo(()=>new Map(y.groups.map(m=>[m.kind,m])),[y.groups]),_=m=>V.get(m),L=[{icon:"article",key:"skills",title:o("pluginDetail.skills")},{icon:"deployed_code",key:"mcp",title:o("pluginDetail.mcp")},{icon:"tune",key:"hooks",title:o("pluginDetail.hooks")}],z=Sn(M.get(be)),X=u.useCallback(m=>{x(w=>{const P=new URLSearchParams(w);return m==="readme"?P.delete(be):P.set(be,m),P},{replace:!0})},[x]);return t.jsxs("div",{className:"plugin-detail-route__content",children:[t.jsx("main",{className:"plugin-detail-route__main",children:t.jsx(Mt,{activeKey:z,className:"plugin-detail-route__tabs",onChange:X,items:[{children:t.jsx(mn,{emptyText:o("pluginDetail.readmeEmpty"),error:h.error,loading:h.loading,preferredLanguage:f.resolvedLanguage??f.language,pluginScope:r.scope,readme:h.readme,readmes:h.readmes,showTitle:!1,title:o("pluginDetail.readme")}),key:"readme",label:t.jsx(G,{title:Y,children:t.jsxs("span",{className:"plugin-detail-route__tab-label","aria-label":Y,children:[t.jsx(k,{name:"article","aria-hidden":"true"}),t.jsx("span",{children:o("pluginDetail.readme")})]})})},{children:t.jsx(un,{emptyText:o("pluginDetail.noContributions"),disabledText:o("pluginDetail.contributionDisabled"),disableText:o("pluginDetail.disableContribution"),disableItemText:o("pluginDetail.disableContributionItem"),enableText:o("pluginDetail.enableContribution"),enableItemText:o("pluginDetail.enableContributionItem"),fieldLabels:{clientView:o("pluginDetail.fields.clientView"),command:o("pluginDetail.fields.command"),contributionSchema:o("pluginDetail.fields.contributionSchema"),extensionPoint:o("pluginDetail.fields.extensionPoint"),headerSchema:o("pluginDetail.fields.headerSchema"),href:o("pluginDetail.fields.href"),id:o("pluginDetail.fields.id"),inputSchema:o("pluginDetail.fields.inputSchema"),mode:o("pluginDetail.fields.mode"),outputSchema:o("pluginDetail.fields.outputSchema"),placement:o("pluginDetail.fields.placement"),proxyTarget:o("pluginDetail.fields.proxyTarget"),route:o("pluginDetail.fields.route"),routeId:o("pluginDetail.fields.routeId"),tab:o("pluginDetail.fields.tab"),target:o("pluginDetail.fields.target"),title:o("pluginDetail.fields.title"),viewId:o("pluginDetail.fields.viewId")},itemDisabledText:o("pluginDetail.contributionItemDisabled"),language:f.resolvedLanguage??f.language,noMatchesText:o("pluginDetail.noContributionMatches"),noDescriptionText:o("pluginDetail.noContributionDescription"),onItemEnabledChange:T,onRowEnabledChange:K,rows:j,searchPlaceholder:o("pluginDetail.searchContributions"),showTitle:!1,title:o("pluginDetail.contributions")}),key:"contributions",label:t.jsx(G,{title:B,children:t.jsxs("span",{className:"plugin-detail-route__tab-label","aria-label":B,children:[t.jsx(k,{name:"extension","aria-hidden":"true"}),t.jsx("span",{children:o("pluginDetail.contributions")})]})})},{children:t.jsx(Jt,{labels:{instance:o("pluginDetail.configInstance"),manifest:o("pluginDetail.configManifest"),noSchema:o("pluginDetail.configNoSchema"),options:o("pluginDetail.configOptions"),saved:o("pluginDetail.configSaved"),saveFailed:o("pluginDetail.configSaveFailed"),saving:o("pluginDetail.configSaving")},onOptionsChange:a,plugin:r}),key:"config",label:t.jsx(G,{title:o("pluginDetail.config"),children:t.jsxs("span",{className:"plugin-detail-route__tab-label","aria-label":o("pluginDetail.config"),children:[t.jsx(k,{name:"settings","aria-hidden":"true"}),t.jsx("span",{children:o("pluginDetail.config")})]})})},...L.map(m=>({children:t.jsx(Lt,{emptyText:o("pluginDetail.assetsEmpty"),error:y.error,group:_(m.key),loading:y.loading,title:m.title}),key:m.key,label:t.jsx(G,{title:m.title,children:t.jsxs("span",{className:"plugin-detail-route__tab-label","aria-label":m.title,children:[t.jsx(k,{name:m.icon,"aria-hidden":"true"}),t.jsx("span",{children:m.title})]})})}))]})}),t.jsxs("aside",{className:"plugin-detail-route__side",children:[t.jsx(cn,{labels:{clientDevEntry:o("pluginDetail.clientDevEntry"),clientEntry:o("pluginDetail.clientEntry"),disabled:o("pluginStore.disabled"),enabled:o("pluginStore.enablePluginInWorkspace"),overview:o("pluginDetail.overview"),package:o("pluginDetail.package"),request:o("pluginDetail.request"),requestedVersion:o("pluginDetail.requestedVersion"),root:o("pluginDetail.root"),serverEntry:o("pluginDetail.serverEntry"),version:o("pluginDetail.version"),watch:o("pluginStore.watch")},enabledHint:o("pluginStore.enabledHint"),enabledLoading:e,plugin:r,watchHint:o("pluginStore.watchHint"),watchLoading:b,onEnabledChange:n,onWatchChange:s}),t.jsx(dn,{diagnostics:I,emptyText:o("pluginDetail.diagnosticsEmpty"),title:o("pluginStore.diagnostics")})]})]})}const Ye=["user","project","global"],jn=["all",...Ye],kn=["all","enabled","disabled"],Ee=(e,i)=>{var n,a,s;return((s=(a=(n=e==null?void 0:e.sources)==null?void 0:n[i])==null?void 0:a.plugins)==null?void 0:s.marketplaces)??{}},ke=e=>e.trim().toLowerCase().replace(/\.git$/u,"").replace(/[^a-z0-9._-]+/gu,"-").replace(/^-+|-+$/gu,""),$e=e=>{const i=e.trim().replace(/\/+$/u,"").replace(/\.git$/u,""),n=i.split(/[/:]/u).filter(Boolean).at(-1);return ke(n??i)||"plugin-source"},Te=(e,i)=>{if(i[e]==null)return e;for(let n=2;n<100;n+=1){const a=`${e}-${n}`;if(i[a]==null)return a}return`${e}-${Date.now()}`},vn=e=>{var n,a;const i=(n=e.options)==null?void 0:n.source;if(i==null)return{detail:"",icon:"storefront",title:"-"};switch(i.source){case"git":return{detail:[i.ref,i.path].filter(Boolean).join(" · "),icon:"account_tree",title:i.url};case"github":return{detail:[i.ref,i.path].filter(Boolean).join(" · "),icon:"account_tree",title:i.repo};case"directory":return{detail:"",icon:"folder",title:i.path};case"url":return{detail:"",icon:"link",title:i.url};case"settings":return{detail:i.name??"",icon:"tune",title:((a=i.metadata)==null?void 0:a.pluginRoot)??i.name??"settings"};case"hostPattern":return{detail:"",icon:"language",title:i.hostPattern}}};function Dn({onQueryChange:e,query:i}){var Q,d;const{t:n}=re(),{message:a}=ve.useApp(),{data:s,mutate:r}=_e("/api/config",Fe),{data:l,mutate:b}=_e("/api/plugins/marketplace/catalog",_t),[f,o]=u.useState(""),[M,x]=u.useState(""),[h,y]=u.useState(""),[C,R]=u.useState(""),[S,D]=u.useState(),[$,U]=u.useState(),[I,W]=u.useState(),[N,K]=u.useState("all"),[T,E]=u.useState("all"),j=u.useMemo(()=>Ee(s,"merged"),[s]),Y=((d=(Q=s==null?void 0:s.sources)==null?void 0:Q.user)==null?void 0:d.plugins)??{},B=Y.marketplaces??{},V=(l==null?void 0:l.plugins)??[],_=u.useMemo(()=>new Map(((l==null?void 0:l.sources)??[]).map(c=>[c.key,c])),[l==null?void 0:l.sources]),L=u.useMemo(()=>Object.entries(j).map(([c,g])=>({configSource:Ye.find(A=>Ee(s,A)[c]!=null),entry:g,key:c})).sort((c,g)=>c.key.localeCompare(g.key)),[s,j]),z=i.trim().toLowerCase(),X=u.useMemo(()=>V.filter(c=>{const g=z===""||[c.name,c.description,c.version,c.marketplace,c.marketplaceTitle,c.sourceLabel,...c.skills??[],...c.commands??[],...c.agents??[]].filter(Boolean).join(" ").toLowerCase().includes(z),A=N==="all"||(c.configSource??"user")===N,q=c.enabled;return g&&A&&(T==="all"||(T==="enabled"?q:!q))}),[V,z,N,T]),m=u.useMemo(()=>{const c=ke(f),g=c!==""?c:$e(M);return Te(g,j)},[j,f,M]),w=async(c,g)=>{await vt("user","plugins",{...Y,marketplaces:c}),await r(),await b(),a.success(g)},P=c=>{W(g=>g===c?void 0:c)},p=async c=>{c.preventDefault();const g=M.trim();if(g===""){a.error(n("pluginStore.marketplaceSourceUrlRequired"));return}const A=ke(f),q=A!==""?A:$e(g),O=Te(q,j);D(O);try{await w({...B,[O]:{type:"claude-code",enabled:!0,options:{source:{source:"git",url:g,...h.trim()!==""?{ref:h.trim()}:{},...C.trim()!==""?{path:C.trim()}:{}}}}},n("pluginStore.marketplaceSourceSaved")),o(""),x(""),y(""),R("")}catch(ie){a.error(de(ie,n("pluginStore.marketplaceSourceSaveFailed")))}finally{D(void 0)}},v=async(c,g)=>{D(c.key);try{await w({...B,[c.key]:{...c.entry,enabled:g}},n(g?"pluginStore.marketplaceSourceEnabled":"pluginStore.marketplaceSourceDisabled"))}catch(A){a.error(de(A,n("pluginStore.marketplaceSourceSaveFailed")))}finally{D(void 0)}},F=async(c,g)=>{var q;const A=`${c.marketplace}:${c.name}`;U(A);try{const O=B[c.marketplace]??{type:"claude-code"},ie=((q=O.plugins)==null?void 0:q[c.name])??{};await w({...B,[c.marketplace]:{...O,type:"claude-code",plugins:{...O.plugins,[c.name]:{...ie,enabled:g}}}},n(g?"pluginStore.marketplacePluginEnabled":"pluginStore.marketplacePluginDisabled"))}catch(O){a.error(de(O,n("pluginStore.marketplacePluginSaveFailed")))}finally{U(void 0)}},H=async c=>{D(c);try{const g={...B};delete g[c],await w(g,n("pluginStore.marketplaceSourceRemoved"))}catch(g){a.error(de(g,n("pluginStore.marketplaceSourceSaveFailed")))}finally{D(void 0)}};return t.jsxs("div",{className:"plugin-marketplace",children:[t.jsx(At,{query:i,placeholder:n("pluginStore.marketplaceSearchPlaceholder"),onQueryChange:e,actions:[{active:I==="filter",ariaLabel:n("pluginStore.marketplaceFilter"),icon:"filter_alt",key:"filter",onClick:()=>P("filter"),pressed:I==="filter",title:n("pluginStore.marketplaceFilter")},{active:I==="config",ariaLabel:n("pluginStore.marketplaceConfig"),icon:"tune",key:"config",onClick:()=>P("config"),pressed:I==="config",title:n("pluginStore.marketplaceConfig")}]}),I==="filter"&&t.jsxs("div",{className:"plugin-marketplace__panel plugin-marketplace__panel--filter",children:[t.jsxs("div",{className:"plugin-marketplace__filter-row",children:[t.jsx("span",{className:"plugin-marketplace__filter-label",children:n("pluginStore.marketplaceFilterStatus")}),t.jsx("div",{className:"plugin-marketplace__filter-options",children:kn.map(c=>t.jsx(ae,{className:`plugin-marketplace__filter-option${T===c?" is-active":""}`,type:"text",size:"small",onClick:()=>E(c),children:n(`pluginStore.marketplaceFilterStatus_${c}`)},c))})]}),t.jsxs("div",{className:"plugin-marketplace__filter-row",children:[t.jsx("span",{className:"plugin-marketplace__filter-label",children:n("pluginStore.marketplaceFilterSource")}),t.jsx("div",{className:"plugin-marketplace__filter-options",children:jn.map(c=>t.jsx(ae,{className:`plugin-marketplace__filter-option${N===c?" is-active":""}`,type:"text",size:"small",onClick:()=>K(c),children:n(c==="all"?"pluginStore.marketplaceFilterAll":`config.sources.${c}`)},c))})]})]}),I==="config"&&t.jsxs("div",{className:"plugin-marketplace__panel plugin-marketplace__panel--config",children:[t.jsxs("form",{className:"plugin-marketplace__source-form",onSubmit:c=>void p(c),children:[t.jsx(le,{"aria-label":n("pluginStore.marketplaceSourceName"),placeholder:n("pluginStore.marketplaceSourceName"),value:f,onChange:c=>o(c.target.value)}),t.jsx(le,{"aria-label":n("pluginStore.marketplaceSourceUrl"),placeholder:n("pluginStore.marketplaceSourceUrl"),value:M,onChange:c=>x(c.target.value)}),t.jsxs("div",{className:"plugin-marketplace__source-form-row",children:[t.jsx(le,{"aria-label":n("pluginStore.marketplaceSourceRef"),placeholder:n("pluginStore.marketplaceSourceRef"),value:h,onChange:c=>y(c.target.value)}),t.jsx(le,{"aria-label":n("pluginStore.marketplaceSourcePath"),placeholder:n("pluginStore.marketplaceSourcePath"),value:C,onChange:c=>R(c.target.value)}),t.jsx(G,{title:n("pluginStore.addMarketplaceSource"),children:t.jsx(ae,{className:"plugin-marketplace__icon-button",htmlType:"submit",loading:S===m,"aria-label":n("pluginStore.addMarketplaceSource"),icon:t.jsx(k,{name:"add"})})})]})]}),t.jsx("div",{className:"plugin-marketplace__config-source-list",role:"list",children:L.length===0?t.jsx(ne,{image:ne.PRESENTED_IMAGE_SIMPLE,description:n("pluginStore.marketplaceSourcesEmpty")}):L.map(c=>{const g=vn(c.entry),A=_.get(c.key),q=c.configSource==="user";return t.jsxs("div",{className:"plugin-marketplace__source-item",role:"listitem",children:[t.jsx(k,{className:"plugin-marketplace__source-icon",name:g.icon}),t.jsxs("div",{className:"plugin-marketplace__source-copy",children:[t.jsxs("div",{className:"plugin-marketplace__source-title-row",children:[t.jsx("span",{className:"plugin-marketplace__source-name",children:c.key}),t.jsx(J,{children:n(`config.sources.${c.configSource??"user"}`)}),A!=null&&t.jsx(J,{children:A.pluginCount})]}),t.jsx("span",{className:"plugin-marketplace__source-url",title:g.title,children:g.title}),g.detail!==""&&t.jsx("span",{className:"plugin-marketplace__source-detail",children:g.detail}),(A==null?void 0:A.error)!=null&&t.jsx("span",{className:"plugin-marketplace__source-error",children:A.error})]}),t.jsxs("div",{className:"plugin-marketplace__source-actions",children:[t.jsx(se,{size:"small",checked:c.entry.enabled!==!1,loading:S===c.key,onChange:O=>void v(c,O)}),q&&t.jsx(G,{title:n("pluginStore.removeMarketplaceSource"),children:t.jsx(ae,{className:"plugin-marketplace__icon-button",type:"text","aria-label":n("pluginStore.removeMarketplaceSource"),icon:t.jsx(k,{name:"delete"}),onClick:()=>void H(c.key)})})]})]},c.key)})})]}),t.jsx("div",{className:"plugin-marketplace__content",children:t.jsx("section",{className:"plugin-marketplace__section plugin-marketplace__section--plugins",children:t.jsx("div",{className:"plugin-marketplace__plugin-list",role:"list",children:X.length===0?t.jsx(ne,{image:ne.PRESENTED_IMAGE_SIMPLE,description:n("pluginStore.marketplacePluginsEmpty")}):X.map(c=>{var A,q,O,ie,Ne,Ce;const g=`${c.marketplace}:${c.name}`;return t.jsxs("div",{className:"plugin-marketplace__plugin-item",role:"listitem",children:[t.jsx(k,{className:"plugin-marketplace__plugin-icon",name:"extension"}),t.jsxs("div",{className:"plugin-marketplace__plugin-copy",children:[t.jsxs("div",{className:"plugin-marketplace__plugin-title-row",children:[t.jsx("span",{className:"plugin-marketplace__plugin-name",children:c.name}),t.jsx(J,{children:n(`config.sources.${c.configSource??"user"}`)}),t.jsx(J,{children:c.marketplaceTitle??c.marketplace}),c.version!=null&&t.jsx(J,{children:c.version})]}),c.description!=null&&t.jsx("span",{className:"plugin-marketplace__plugin-description",children:c.description}),t.jsx("span",{className:"plugin-marketplace__plugin-source",title:c.sourceLabel,children:c.sourceLabel}),(((A=c.skills)==null?void 0:A.length)??0)+(((q=c.commands)==null?void 0:q.length)??0)+(((O=c.agents)==null?void 0:O.length)??0)>0&&t.jsxs("div",{className:"plugin-marketplace__plugin-meta",children:[(ie=c.skills)==null?void 0:ie.map(ee=>t.jsx(J,{children:ee},`skill:${ee}`)),(Ne=c.commands)==null?void 0:Ne.map(ee=>t.jsx(J,{children:ee},`command:${ee}`)),(Ce=c.agents)==null?void 0:Ce.map(ee=>t.jsx(J,{children:ee},`agent:${ee}`))]})]}),t.jsx("div",{className:"plugin-marketplace__plugin-actions",children:t.jsx(se,{size:"small",checked:c.enabled,disabled:!c.marketplaceEnabled,loading:$===g,onChange:ee=>void F(c,ee)})})]},g)})})})})]})}const Nn=[{icon:"toggle_on",key:"enabled",labelKey:"pluginStore.groupByEnabled"},{icon:"folder_open",key:"source",labelKey:"pluginStore.groupBySource"}],fe=(e,i)=>({contextMenuItems:i==null?void 0:i(e),icon:e.enabled===!1?"extension_off":"extension",key:e.scope,label:e.displayName??e.name??e.scope,searchText:`${e.displayName??""} ${e.name??""} ${e.scope} ${e.packageId??""} ${e.requestId??""} ${e.pluginRoot??e.rootDir??""}`}),Xe=e=>{var a,s;if(e.sourceGroup!=null)return e.sourceGroup;const i=(e.pluginRoot??e.rootDir??"").replaceAll("\\","/"),n=e.requestId.replaceAll("\\","/");return((a=e.watch)==null?void 0:a.enabled)===!0||i.includes("/.oo/plugins.dev/")?"localDev":((s=e.packageId)==null?void 0:s.startsWith("@oneworks/plugin-"))===!0||i.includes("/packages/plugins/")||i.includes("/plugins/cache/openai-bundled/")||i.includes("/plugins/cache/openai-primary-runtime/")?"builtIn":i.includes("/.oneworks/global/plugins/")?"global":n.startsWith("/")&&!i.includes("/node_modules/")?"localDev":i.includes("/node_modules/")||e.packageId!=null?"local":"global"},Cn=(e,i,n,a)=>i==="source"?[{icon:"deployed_code",key:"builtIn",labelKey:"pluginStore.sourceBuiltIn"},{icon:"public",key:"global",labelKey:"pluginStore.sourceGlobal"},{icon:"folder",key:"local",labelKey:"pluginStore.sourceLocal"},{icon:"code_blocks",key:"localDev",labelKey:"pluginStore.sourceLocalDev"}].map(r=>({icon:r.icon,items:e.filter(l=>Xe(l)===r.key).map(l=>fe(l,a)),key:`source:${r.key}`,label:n(r.labelKey)})):[{icon:"toggle_on",items:e.filter(s=>s.enabled!==!1).map(s=>fe(s,a)),key:"enabled:true",label:n("pluginStore.groupEnabled")},{icon:"toggle_off",items:e.filter(s=>s.enabled===!1).map(s=>fe(s,a)),key:"enabled:false",label:n("pluginStore.groupDisabled")}];function wn({groupMode:e,t:i,onGroupModeChange:n}){return t.jsx("span",{className:"plugin-store-route__group-actions","aria-label":i("pluginStore.groupMode"),children:Nn.map(a=>{const s=e===a.key;return t.jsx(G,{title:i(a.labelKey),children:t.jsx("button",{type:"button",className:["search-toggle-button","plugin-store-route__group-button",s?"is-open":""].filter(Boolean).join(" "),"aria-label":i(a.labelKey),"aria-pressed":s,onMouseDown:r=>r.preventDefault(),onClick:()=>n(a.key),children:t.jsx(k,{className:"search-toggle-icon",name:a.icon})})},a.key)})})}const Re="plugin-store";function Vn(){const{t:e}=re(),{message:i}=ve.useApp(),n=Ze(),{scope:a=""}=et(),[s]=Le(),{openRouteSidebar:r}=xt(),{clearRouteSidebar:l,hasRouteSidebarProvider:b,setRouteSidebar:f}=tt(),{refreshPlugins:o,reloadPlugin:M,snapshot:x}=nt(),{headerActions:h,sidebarContextMenuItems:y}=it("plugins"),[C,R]=u.useState(),[S,D]=u.useState(),[$,U]=u.useState(""),[I,W]=u.useState("enabled"),[N,K]=u.useState(""),T=a===""&&s.get("mode")==="create"?"create":"marketplace",E=u.useMemo(()=>[...x.instances].sort((p,v)=>p.scope.localeCompare(v.scope)),[x.instances]),j=u.useMemo(()=>a===""?void 0:E.find(p=>p.scope===a),[E,a]),Y=j!=null?j.displayName??j.name??j.scope:e(a===""?T==="create"?"pluginStore.createPlugin":"pluginStore.marketplace":"pluginDetail.notFound"),B=(j==null?void 0:j.enabled)===!1?"extension_off":a===""&&T==="marketplace"?"storefront":"extension",V=u.useMemo(()=>[...x.diagnostics,...E.flatMap(p=>p.diagnostics??[])],[E,x.diagnostics]),_=u.useMemo(()=>{const p=$.trim().toLowerCase();return p===""?E:E.filter(v=>{const F=v.displayName??v.name??v.scope,H=v.packageId??v.requestId??"",Q=v.pluginRoot??v.rootDir??"";return`${F} ${v.scope} ${H} ${Q}`.toLowerCase().includes(p)})},[$,E]),L=u.useCallback(async(p,v)=>{D(p);try{await St(p,v),await o(),i.success(e(v?"pluginStore.watchEnabled":"pluginStore.watchDisabled"))}catch(F){console.error("[plugin] failed to update watch mode",F),i.error(e("pluginStore.watchUpdateFailed"))}finally{D(void 0)}},[i,o,e]),z=u.useCallback((p,v,F="workspace")=>{const H=`${F}:${p}`;return R(H),yt(p,v,F).then(async()=>{await o(),i.success(e(v?"pluginStore.pluginEnabled":"pluginStore.pluginDisabled"))}).catch(Q=>{console.error("[plugin] failed to update plugin enabled state",Q),i.error(e("pluginStore.pluginEnabledUpdateFailed"))}).finally(()=>{R(void 0)})},[i,o,e]),X=u.useCallback(p=>{var g;const v=p.enabled!==!1,F=!v,H=p.pluginRoot??p.rootDir,Q=Xe(p),d=((g=p.watch)==null?void 0:g.enabled)===!0,c=!d;return[{key:`details:${p.scope}`,label:e("pluginStore.openDetails"),icon:t.jsx(k,{name:"open_in_new"}),onClick:()=>{n(`/plugins/${encodeURIComponent(p.scope)}`)}},{key:`enabled-workspace:${p.scope}`,label:e(v?"pluginStore.disablePluginInWorkspace":"pluginStore.enablePluginInWorkspace"),icon:t.jsx(k,{name:v?"extension_off":"extension"}),disabled:C===`workspace:${p.scope}`,onClick:()=>{z(p.scope,F,"workspace")}},...Q==="global"?[{key:`enabled-global:${p.scope}`,label:e(v?"pluginStore.disablePluginGlobally":"pluginStore.enablePluginGlobally"),icon:t.jsx(k,{name:"public"}),disabled:C===`global:${p.scope}`,onClick:()=>{z(p.scope,F,"global")}}]:[],{key:`watch:${p.scope}`,label:e(d?"pluginStore.disableWatch":"pluginStore.enableWatch"),icon:t.jsx(k,{name:d?"close":"speed"}),disabled:!v||S===p.scope,onClick:()=>{L(p.scope,c)}},{key:`copy-divider:${p.scope}`,type:"divider"},{key:`copy-scope:${p.scope}`,label:e("pluginStore.copyPluginScope"),icon:t.jsx(k,{name:"fingerprint"}),onClick:()=>{Ae({failureMessage:e("common.copyFailed"),messageApi:i,successMessage:e("pluginStore.pluginScopeCopied"),text:p.scope})}},...H==null||H===""?[]:[{key:`copy-root:${p.scope}`,label:e("pluginStore.copyPluginRoot"),icon:t.jsx(k,{name:"folder_open"}),onClick:()=>{Ae({failureMessage:e("common.copyFailed"),messageApi:i,successMessage:e("pluginStore.pluginRootCopied"),text:H})}}]]},[i,n,e,z,L,C,S]),m=u.useMemo(()=>Cn(_,I,e,X),[X,I,e,_]),w=u.useMemo(()=>t.jsx(wn,{groupMode:I,t:e,onGroupModeChange:W}),[I,e]),P=u.useCallback(p=>{n(`/plugins/${encodeURIComponent(p.key)}`)},[n]);return u.useLayoutEffect(()=>{if(b)return f({activeKey:j==null?void 0:j.scope,ariaLabel:e("pluginStore.installedLabel"),contextMenuItems:y,emptyText:e("pluginStore.empty"),groups:m,key:Re,search:{placeholder:e("pluginStore.searchPlaceholder"),suffix:w,value:$,onChange:U},onSelectItem:P}),()=>l(Re)},[l,P,b,$,w,y,m,j,f,e]),t.jsx(jt,{className:"plugin-store-route",bodyClassName:"plugin-store-route__body",contentInset:!0,header:t.jsx(kt,{actionItems:h,icon:B,onOpenSidebar:r,title:Y}),children:t.jsxs("div",{className:"plugin-store-route__content",children:[t.jsx("div",{className:"plugin-store-route__main",children:a===""?T==="create"?t.jsx(Tt,{}):t.jsx(Dn,{query:N,onQueryChange:K}):j==null?t.jsx("div",{className:"plugin-store-route__not-found",children:t.jsx(ne,{image:ne.PRESENTED_IMAGE_SIMPLE,description:e("pluginDetail.notFound")})}):t.jsx(yn,{plugin:j,snapshot:x,enabledLoading:C===`workspace:${j.scope}`,watchLoading:S===j.scope,onContributionPreferencesChange:()=>M(j.scope),onEnabledChange:p=>void z(j.scope,p,"workspace"),onOptionsChange:()=>o(),onWatchChange:p=>void L(j.scope,p)})}),(C!=null||S!=null)&&t.jsx("div",{className:"plugin-store-route__saving","aria-live":"polite",children:t.jsx(It,{size:"small"})}),V.length>0&&t.jsxs("div",{className:"plugin-store-route__diagnostic-badge","aria-label":e("pluginStore.diagnostics"),children:[t.jsx(k,{name:"bug_report"}),t.jsx("span",{children:V.length})]})]})})}export{Vn as PluginStoreRoute};
|
package/dist/assets/{RouteContainerPanelTabs-BnIptVwq.js → RouteContainerPanelTabs-jxh2d8jI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as H,r as y,R as M,a as jn,c as Kn}from"./vendor-react-CnooHTJc.js";import{bC as Jn}from"./AuthenticatedApp-
|
|
1
|
+
import{j as H,r as y,R as M,a as jn,c as Kn}from"./vendor-react-CnooHTJc.js";import{bC as Jn}from"./AuthenticatedApp-CjqSg3Fe.js";import{B as Di}from"./index-DgZk1SFp.js";import{e as ei,f as ti,v as ii,M as At}from"./route-plugin-chrome-DI32l8cC.js";import{D as ni}from"./shortcutUtils-HFKOHIG8.js";import{T as Yn}from"./MobileAwareSelect-C3a67aGF.js";function Zn({actions:o,closeLabel:e,closeIcon:t="disabled_by_default",fullscreenEnterLabel:i,fullscreenExitLabel:n,fullscreenMinimizedIcon:s="open_in_full",fullscreenMinimizedLabel:l,isFullscreen:a,isMinimized:r=!1,meta:d,onClose:h,onToggleFullscreen:c,title:u}){const p=r?l??i:a?n:i,g=r?s:a?"fullscreen_exit":"fullscreen";return H.jsxs("div",{className:"dock-panel__header",children:[H.jsxs("div",{className:"dock-panel__header-main",children:[u!=null&&H.jsx("div",{className:"dock-panel__title",children:u}),d!=null&&H.jsx("span",{className:"dock-panel__meta",children:d})]}),H.jsx("div",{className:"dock-panel__header-spacer"}),(o!=null||c!=null||h!=null)&&H.jsxs("div",{className:"dock-panel__header-actions",children:[o,c!=null&&p!=null&&H.jsx(Di,{type:"text",className:"dock-panel__close-btn dock-panel__fullscreen-btn","data-dock-panel-no-resize":"true",icon:H.jsx("span",{className:"material-symbols-rounded",children:g}),title:p,"aria-label":p,onClick:c}),h!=null&&e!=null&&H.jsx(Di,{type:"text",className:["dock-panel__close-btn",t==="bottom_panel_close"||t==="bottom_panel_open"?"dock-panel__minimize-btn":""].filter(Boolean).join(" "),"data-dock-panel-no-resize":"true",icon:H.jsx("span",{className:"material-symbols-rounded",children:t}),title:e,"aria-label":e,onClick:h})]})]})}const Xn=180;function qn(){const[o,e]=y.useState(!1),[t,i]=y.useState(!1),n=y.useRef(null),s=y.useCallback(()=>{n.current!=null&&(window.clearTimeout(n.current),n.current=null)},[]),l=y.useCallback(()=>{s(),i(!1),e(!0)},[s]),a=y.useCallback(()=>{s(),i(!0),n.current=window.setTimeout(()=>{e(!1),i(!1),n.current=null},Xn)},[s]),r=y.useCallback(()=>{if(o&&!t){a();return}l()},[l,a,o,t]);return y.useEffect(()=>s,[s]),{enterFullscreen:l,exitFullscreen:a,isFullscreen:o,isFullscreenExiting:t,toggleFullscreen:r}}const Qn=240,qi=180,es=240,Vt=(o,e,t)=>Math.min(Math.max(o,e),Math.max(e,t)),yi=(o,e)=>{if(typeof o=="number")return o;const t=o==null?void 0:o.trim().match(/^(\d+(?:\.\d+)?)%$/);return t==null?qi:e==null?0:Math.max(0,Math.round(e*Number(t[1])/100))},ts=o=>typeof o=="number"?`${o}px`:o,is=o=>(o==null?void 0:o.closest('button, a, input, textarea, select, option, [role="button"], [data-dock-panel-no-resize="true"]'))!=null;function Ar({enterMotion:o="slide-up",allowResize:e=!0,allowFullscreen:t=!1,children:i,className:n,closeIcon:s,closeLabel:l,defaultHeight:a=Qn,footer:r,fullscreenEnterLabel:d,fullscreenExitLabel:h,fullscreenMinimizedIcon:c,fullscreenMinimizedLabel:u,hideHeader:p=!1,isMinimized:g=!1,isResizeDisabled:m=!1,isOpen:f=!0,maxHeight:v=520,meta:b,minimizedHeight:w,minHeight:C=qi,onClose:T,onExpandMinimized:I,resizeLabel:G,storageKey:P,title:F,actions:K}){const L=y.useRef(null),{isFullscreen:j,isFullscreenExiting:ne,toggleFullscreen:U}=qn(),S=j&&!g,[z,ce]=y.useState(null),O=y.useMemo(()=>yi(C,z),[z,C]),[Y,B]=y.useState(()=>f&&o==="slide-up"),be=y.useRef(f),[X,ve]=y.useState(()=>{const N=Number(localStorage.getItem(P)),$=yi(C,null);return Number.isFinite(N)&&N>0?Vt(N,$,v):Vt(a,$,v)}),Z=y.useRef(X),De=e&&!m&&!g&&!S,we=y.useCallback(()=>{const N=L.current;N==null||N.scrollTop===0&&N.scrollLeft===0||N.scrollTo(0,0)},[]);y.useEffect(()=>{const N=be.current;if(be.current=f,!f||o!=="slide-up"){B(!1);return}N||B(!0)},[o,f]),y.useEffect(()=>{if(!Y)return;const N=window.setTimeout(()=>B(!1),es);return()=>window.clearTimeout(N)},[Y]);const ue=y.useCallback(()=>{var ge;const N=(ge=L.current)==null?void 0:ge.parentElement,$=N==null?void 0:N.getBoundingClientRect().height;return $!=null&&Number.isFinite($)?Math.max(0,$):null},[]);y.useEffect(()=>{var Se;const N=()=>ce(ue());N();const $=(Se=L.current)==null?void 0:Se.parentElement;if($==null||typeof ResizeObserver>"u")return;const ge=new ResizeObserver(N);return ge.observe($),()=>ge.disconnect()},[ue]),y.useEffect(()=>{const N=L.current;if(N==null)return;let $=0;const ge=()=>{$===0&&($=window.requestAnimationFrame(()=>{$=0,we()}))};return we(),N.addEventListener("scroll",ge,{passive:!0}),()=>{$!==0&&window.cancelAnimationFrame($),N.removeEventListener("scroll",ge)}},[we]),y.useEffect(()=>{Z.current=X,localStorage.setItem(P,String(X))},[X,P]),y.useEffect(()=>{ve(N=>{var ge,Se;const $=Vt(N,O,v);return $===N?N:(Z.current=$,(ge=L.current)==null||ge.style.setProperty("--dock-panel-height",`${$}px`),(Se=L.current)==null||Se.style.removeProperty("--dock-panel-resize-height"),$)})},[O,v]),y.useEffect(()=>{we()},[S,g,f,X,we]);const fe=y.useCallback(()=>{const N=ue();return N!=null?Math.min(v,N-96):v},[v,ue]),ee=y.useCallback(()=>{var N;return((N=L.current)==null?void 0:N.getBoundingClientRect().height)??X},[X]),le=y.useCallback(N=>{var $;Z.current=N,($=L.current)==null||$.style.setProperty("--dock-panel-resize-height",`${N}px`)},[]),pe=y.useCallback(N=>{var $,ge;Z.current=N,($=L.current)==null||$.style.setProperty("--dock-panel-height",`${N}px`),(ge=L.current)==null||ge.style.removeProperty("--dock-panel-resize-height"),ve(N)},[]),Ce=Jn({axis:"y",cursor:"row-resize",direction:-1,disabled:!De,getMaxValue:fe,getStartValue:ee,max:v,min:O,value:X,onCommit:pe,onPreview:le,onResizeStart:le,shouldIgnorePointerDown:is}),Me=()=>{g&&(I==null||I()),U()},Ke=t||g&&I!=null,vt=typeof i=="function"?i({isFullscreen:S,onToggleFullscreen:Me}):i,de=y.useMemo(()=>({"--dock-panel-height":`${X}px`,"--dock-panel-max-height":`${v}px`,"--dock-panel-min-height":`${O}px`,...w==null?{}:{"--dock-panel-minimized-height":ts(w)}}),[O,v,w,X]);return H.jsxs("div",{ref:L,className:`dock-panel ${Y?"is-entering-slide-up":""} ${f?"is-open":"is-closing"} ${n??""} ${Ce.isResizing?"is-resizing":""} ${g?"is-minimized":""} ${De?"is-resizable":"is-static"} ${m||g||S?"is-resize-disabled":""} ${S?"is-fullscreen":""} ${ne?"is-fullscreen-exiting":""}`,style:de,children:[De&&H.jsx("div",{className:"dock-panel__resize-strip",role:"separator","aria-label":G,"aria-orientation":"horizontal","aria-valuemin":O,"aria-valuemax":v,"aria-valuenow":X,tabIndex:0,title:G,onPointerDown:Ce.handlePointerDown,onKeyDown:Ce.handleKeyDown}),!p&&H.jsx(Zn,{actions:K,closeIcon:s,closeLabel:l,fullscreenEnterLabel:d,fullscreenExitLabel:h,fullscreenMinimizedIcon:c,fullscreenMinimizedLabel:u,isFullscreen:S,isMinimized:g,meta:b,title:F,onClose:T,onToggleFullscreen:Ke?Me:void 0}),H.jsx("div",{className:"dock-panel__body",children:vt}),r!=null&&H.jsx("div",{className:"dock-panel__footer",children:r})]})}/**
|
|
2
2
|
* dockview-core
|
|
3
3
|
* @version 6.2.2
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,r as v}from"./vendor-react-CnooHTJc.js";/* empty css */import{aI as $,B as S}from"./index-
|
|
1
|
+
import{j as o,r as v}from"./vendor-react-CnooHTJc.js";/* empty css */import{aI as $,B as S}from"./index-DgZk1SFp.js";import{u as z}from"./vendor-state-Djj0Jjxr.js";import{I as h}from"./index-aZ1QdVqZ.js";import{T as N,M as k}from"./MobileAwareSelect-C3a67aGF.js";import{T as I}from"./index-CqhgNUy-.js";import{S as B}from"./project-file-tree-icons-Iz30jDs3.js";const K=({title:e,description:t,icon:n,layout:s="inline",children:a})=>o.jsxs("div",{className:`config-view__field-row${s==="stacked"?" config-view__field-row--stacked":""}`,children:[o.jsxs("div",{className:"config-view__field-meta",children:[n!=null&&o.jsx("span",{className:"material-symbols-rounded config-view__field-icon",children:n}),o.jsxs("div",{className:"config-view__field-text",children:[o.jsx("div",{className:"config-view__field-title",children:e}),t!=null&&t!==!1&&t!==""&&o.jsx("div",{className:"config-view__field-desc",children:t})]})]}),o.jsx("div",{className:"config-view__field-control",children:a})]}),ee=e=>e==null?!0:Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1,te=e=>e==null?e:JSON.parse(JSON.stringify(e)),R=(e,t=[])=>e===void 0&&t.length>0?[t]:e==null||typeof e!="object"||Array.isArray(e)?[]:Object.entries(e).flatMap(([n,s])=>R(s,[...t,n])),ne=e=>Array.isArray(e)?"array":e!=null&&typeof e=="object"?"object":typeof e=="number"?"number":typeof e=="boolean"?"boolean":"string",d=e=>e==="string"?"text_fields":e==="number"?"numbers":e==="boolean"?"toggle_on":e==="array"?"view_list":"account_tree",re=(e,t,n,s)=>{if(n.length===0)return s;const a=`config.fields.${t}.${n.join(".")}.label`;return e(a,{defaultValue:s})},oe=(e,t,n)=>{if(n.length===0)return"";const s=`config.fields.${t}.${n.join(".")}.desc`;return e(s,{defaultValue:""})},U=new Set(["authorization","cookie","proxy-authorization","set-cookie"]),M=e=>{const t=e.trim().toLowerCase();return t==="apikeyenv"||t==="api_key_env"||t==="api-key-env"?!1:U.has(t)||/key|token|secret|password/i.test(e)},V=(e,t)=>{if(t.length===0)return e;let n=e;for(const s of t){if(n==null||typeof n!="object")return;n=n[s]}return n},C=(e,t,n)=>{if(t.length===0)return n;const s=e!=null&&typeof e=="object"&&!Array.isArray(e)?{...e}:{};let a=s;for(let c=0;c<t.length-1;c+=1){const u=t[c],g=a[u],m=g!=null&&typeof g=="object"&&!Array.isArray(g)?{...g}:{};a[u]=m,a=m}return a[t[t.length-1]]=n,s},H=({value:e,onChange:t})=>{const{message:n}=$.useApp(),{t:s}=z(),[a,c]=v.useState(()=>JSON.stringify(e??{},null,2));return v.useEffect(()=>{c(JSON.stringify(e??{},null,2))},[e]),o.jsx(h.TextArea,{className:"config-view__complex-editor",value:a,onChange:u=>{c(u.target.value)},onBlur:()=>{try{const u=JSON.parse(a);t==null||t(u),c(JSON.stringify(u??{},null,2))}catch{n.error(s("config.invalidJson")),c(JSON.stringify(e??{},null,2))}},placeholder:s("config.editor.complexPlaceholder"),autoSize:{minRows:6}})},Z=({value:e,onChange:t,t:n})=>o.jsxs("div",{className:"config-view__array-list",children:[e.map((s,a)=>o.jsxs("div",{className:"config-view__array-item",children:[o.jsx(h,{value:s,placeholder:n("config.editor.itemPlaceholder"),onChange:c=>{const u=e.slice();u[a]=c.target.value,t(u)}}),o.jsx(N,{title:n("config.editor.remove"),children:o.jsx(S,{size:"small",type:"text",danger:!0,className:"config-view__icon-button config-view__icon-button--compact","aria-label":n("config.editor.remove"),icon:o.jsx("span",{className:"material-symbols-rounded",children:"delete"}),onClick:()=>{const c=e.slice();c.splice(a,1),t(c)}})})]},`${a}-${s}`)),o.jsx(N,{title:n("config.editor.addItem"),children:o.jsx(S,{size:"small",type:"primary",className:"config-view__icon-button config-view__icon-button--full","aria-label":n("config.editor.addItem"),icon:o.jsx("span",{className:"material-symbols-rounded",children:"add"}),onClick:()=>{t([...e,""])}})})]}),q=e=>e.replace(/_/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase()),se=e=>{const t={};for(const n of(e==null?void 0:e.fields)??[]){if(n.defaultValue===void 0)continue;const s=typeof n.defaultValue=="object"&&n.defaultValue!=null?JSON.parse(JSON.stringify(n.defaultValue)):n.defaultValue;Object.assign(t,C(t,n.path,s))}return t},ie=({schema:e,entryKey:t,entryValue:n})=>{if(e.mode==="keyed"){const c=e.schemas[t];return{itemSchema:c??e.unknownSchema,isKnownEntry:c!=null}}const s=e.discriminatorField??"type",a=V(n,[s]);if(typeof a=="string"){const c=e.schemas[a];return{itemSchema:c??e.unknownSchema,isKnownEntry:c!=null}}return{itemSchema:e.unknownSchema,isKnownEntry:!1}},A=(e=[])=>e.map(t=>({value:t.value,label:t.label??t.value})),G=e=>e.icon!=null?e.icon:e.type==="json"?d("object"):e.type==="string[]"?d("array"):e.type==="select"||e.type==="multiline"?d("string"):e.type==="string"||e.type==="number"||e.type==="boolean"?d(e.type):d("object"),ae=({value:e,schema:t,onChange:n,t:s,hideFieldPaths:a,visibleFieldPaths:c,resolveFieldLabel:u,resolveFieldDescription:g,resolveFieldOptions:m})=>{const O=r=>{if(c!=null&&!c.some(i=>r.path.length===i.length&&r.path.every((y,x)=>y===i[x]))||a!=null&&a.some(i=>r.path.length===i.length&&r.path.every((y,x)=>y===i[x])))return null;const b=V(e,r.path),l=b!==void 0?b:r.defaultValue,_=r.label??q(r.path[r.path.length-1]??""),w=r.description??"",E=(u==null?void 0:u(r,_))??_,J=(g==null?void 0:g(r,w))??w,j=m==null?void 0:m(r),p=i=>{n(C(e,r.path,i))};let f=null;const T=r.type==="json"||r.type==="multiline"||r.type==="string[]";return r.type==="string"&&j!=null?f=o.jsx(k,{allowClear:!0,value:typeof l=="string"&&l!==""?l:void 0,options:A(j),placeholder:r.placeholder,onChange:i=>p(typeof i=="string"?i:void 0)}):r.type==="string"?f=r.sensitive===!0||M(r.path[r.path.length-1]??"")?o.jsx(h.Password,{value:typeof l=="string"?l:"",onChange:y=>p(y.target.value),placeholder:r.placeholder??s("config.editor.secretPlaceholder")}):o.jsx(h,{value:typeof l=="string"?l:"",onChange:y=>p(y.target.value),placeholder:r.placeholder}):r.type==="multiline"?f=o.jsx(h.TextArea,{value:typeof l=="string"?l:"",onChange:i=>p(i.target.value),autoSize:{minRows:2},placeholder:r.placeholder}):r.type==="number"?f=o.jsx(I,{value:typeof l=="number"?l:void 0,onChange:i=>p(typeof i=="number"?i:void 0)}):r.type==="boolean"?f=o.jsx(B,{checked:!!l,onChange:i=>p(i)}):r.type==="string[]"?f=o.jsx(Z,{value:Array.isArray(l)?l.filter(i=>typeof i=="string"):[],onChange:i=>p(i),t:s}):r.type==="select"?f=o.jsx(k,{value:typeof l=="string"?l:void 0,options:A(j??r.options??[]),onChange:i=>p(i)}):f=o.jsx(H,{value:l??{},onChange:i=>p(i)}),o.jsx(K,{title:E,description:J,icon:G(r),layout:T?"stacked":"inline",children:f},r.path.join("."))};return o.jsx("div",{className:"config-view__record-fields",children:t.fields.map(O)})};export{H as C,K as F,ae as S,R as a,re as b,te as c,oe as d,d as e,ne as f,V as g,se as h,ee as i,M as j,Z as k,ie as r,C as s,q as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,r as n,u as M,h as I}from"./vendor-react-CnooHTJc.js";import{C as W,t as k,u as L,D as E,n as v,a as R,B,p as F,b as A,s as H,c as U}from"./index-
|
|
1
|
+
import{j as o,r as n,u as M,h as I}from"./vendor-react-CnooHTJc.js";import{C as W,t as k,u as L,D as E,n as v,a as R,B,p as F,b as A,s as H,c as U}from"./index-DgZk1SFp.js";import{c as Y,I as $}from"./interaction-panel-mobile-debug-pages-CT5eb8Gd.js";import{g as z,b as K,d as V,f as C,p as G,t as T,T as q}from"./use-app-preferences-BZCemhY7.js";import{d as X,u as O}from"./vendor-state-Djj0Jjxr.js";import{u as J,M as Q,P as Z,r as ee}from"./route-plugin-chrome-DI32l8cC.js";import{S as te}from"./index-JwN0oF3c.js";import{T as oe}from"./MobileAwareSelect-C3a67aGF.js";import"./index-aZ1QdVqZ.js";import"./index-CqhgNUy-.js";import"./index-CPxqxItX.js";import"./shortcutUtils-HFKOHIG8.js";const ne=()=>z()??E;function ae(){const t=X(k),{isDarkMode:a,themeMode:i}=L(),e=window.oneworksDesktop,m=(e==null?void 0:e.getDesktopSettings)!=null,[c,s]=n.useState(ne),[r,l]=n.useState(),d=v(K(r))??c,u=V(r);return R(i),n.useEffect(()=>{document.documentElement.classList.toggle("dark",a)},[a]),n.useEffect(()=>{u!=null&&t(u)},[u,t]),n.useEffect(()=>{C(d),G(d)},[d]),n.useEffect(()=>{var f,_;if(!m){l(void 0);return}let b=!1;(f=e==null?void 0:e.getDesktopSettings)==null||f.call(e).then(p=>{b||l(p)}).catch(p=>{b||console.error("[standalone-route] failed to load desktop theme settings",p)});const g=(_=e==null?void 0:e.onDesktopSettingsChange)==null?void 0:_.call(e,p=>{l(p)});return()=>{b=!0,g==null||g()}},[m,e]),n.useEffect(()=>{const b=g=>{if(g.key!==q)return;const f=v(g.newValue)??E;s(f),C(f)};return window.addEventListener("storage",b),()=>window.removeEventListener("storage",b)},[]),n.useMemo(()=>({algorithm:a?T.darkAlgorithm:T.defaultAlgorithm,token:{colorPrimary:d}}),[a,d])}function se({children:t}){const a=ae();return o.jsx(W,{theme:a,children:t})}const j=55,P=100,S=t=>{const a=t!=null&&typeof t=="object"&&!Array.isArray(t)?t:{},i=typeof a.opacity=="number"&&Number.isFinite(a.opacity)?a.opacity:1;return{alwaysOnTop:a.alwaysOnTop===!0,opacity:Math.min(1,Math.max(j/100,i))}};function re(){const t=window.oneworksDesktop,[a,i]=n.useState(()=>({alwaysOnTop:!1,opacity:1}));n.useEffect(()=>{var s;let c=!1;return(s=t==null?void 0:t.getCurrentWindowPresentationState)==null||s.call(t).then(r=>{c||i(S(r))}).catch(()=>{}),()=>{c=!0}},[t]);const e=n.useCallback(c=>{var s;i(r=>({...r,alwaysOnTop:c})),(s=t==null?void 0:t.setCurrentWindowAlwaysOnTop)==null||s.call(t,c).then(r=>i(S(r))).catch(()=>{i(r=>({...r,alwaysOnTop:!c}))})},[t]),m=n.useCallback(c=>{var r;const s=S({opacity:c}).opacity;i(l=>({...l,opacity:s})),(r=t==null?void 0:t.setCurrentWindowOpacity)==null||r.call(t,s).then(l=>i(S(l))).catch(()=>{})},[t]);return{canControlWindow:(t==null?void 0:t.getCurrentWindowPresentationState)!=null,setAlwaysOnTop:e,setOpacity:m,state:a}}function w({active:t,activeIcon:a,activeLabel:i,activeTitle:e,danger:m,disabled:c,icon:s,label:r,title:l,onSelect:d}){const u=t===!0,b=u&&a!=null?a:s,g=u?i??r:r,f=u?e??l??g:l??g;return o.jsx(oe,{title:f,placement:"bottom",children:o.jsx(B,{type:"text",className:["standalone-mobile-debug-route__header-action",u?"is-active":"",m===!0?"is-danger":""].filter(Boolean).join(" "),disabled:c,"aria-label":g,"aria-pressed":t==null?void 0:u,icon:ee({active:u,className:"standalone-mobile-debug-route__header-action-icon",icon:b,materialFilled:u}),onClick:d})})}function ie({actions:t,routeKey:a,title:i}){var l;const{t:e}=O(),m=((l=window.oneworksDesktop)==null?void 0:l.platform)==="darwin",c=J(a),s=re(),r=Math.round(s.state.opacity*100);return o.jsxs("header",{className:"standalone-mobile-debug-route__header",children:[m&&o.jsx("div",{className:"standalone-mobile-debug-route__traffic-space","aria-hidden":"true"}),o.jsxs("div",{className:"standalone-mobile-debug-route__title",title:i,children:[o.jsx(Q,{className:"standalone-mobile-debug-route__title-icon",name:"mobile","aria-hidden":"true"}),o.jsx("span",{className:"standalone-mobile-debug-route__title-text",children:i})]}),o.jsx("div",{className:"standalone-mobile-debug-route__header-drag-fill","aria-hidden":"true"}),o.jsxs("div",{className:"standalone-mobile-debug-route__header-actions","aria-label":e("common.actions","Actions"),children:[c.map(({key:d,...u})=>o.jsx(w,{...u},d)),s.canControlWindow&&o.jsxs(o.Fragment,{children:[o.jsx(w,{active:s.state.alwaysOnTop,icon:"keep",label:e("common.pin","Pin"),onSelect:()=>s.setAlwaysOnTop(!s.state.alwaysOnTop)}),o.jsx(Z,{trigger:"click",placement:"bottomRight",overlayClassName:"standalone-mobile-debug-route__opacity-popover",content:o.jsx("div",{className:"standalone-mobile-debug-route__opacity-control",children:o.jsx(te,{min:j,max:P,value:r,tooltip:{formatter:d=>`${d??r}%`},onChange:d=>s.setOpacity(Number(d)/100)})}),children:o.jsx("span",{className:"standalone-mobile-debug-route__popover-trigger",children:o.jsx(w,{active:r<P,icon:"opacity",label:e("common.opacity","Opacity"),title:`${e("common.opacity","Opacity")} ${r}%`})})})]}),t!=null&&o.jsx("div",{className:"standalone-mobile-debug-route__header-action-group",children:t})]})]})}const ce="standalone.devices",x=t=>t==="settings"?"config":t==="devices"?"devices":"targets";function we(){const{t}=O(),a=M(),i=I(),e=n.useMemo(()=>F(`${a.pathname}${a.search}`),[a.pathname,a.search]),m=t("chat.interactionPanel.mobileDebugTitle"),[c,s]=n.useState(()=>({...Y(m),mode:x(e==null?void 0:e.mode),selectedDeviceId:(e==null?void 0:e.mode)==="debug"?e.deviceId:void 0})),[r,l]=n.useState(null),[d,u]=n.useState(null),b=d??m;n.useEffect(()=>{s(h=>({...h,title:m}))},[m]),n.useEffect(()=>{s(h=>({...h,mode:x(e==null?void 0:e.mode),selectedDeviceId:(e==null?void 0:e.mode)==="debug"?e.deviceId:void 0}))},[e==null?void 0:e.deviceId,e==null?void 0:e.mode]),n.useEffect(()=>{const h=window.requestAnimationFrame(()=>{var y,D;(D=(y=window.oneworksDesktop)==null?void 0:y.markWorkspaceStartupReady)==null||D.call(y)});return()=>window.cancelAnimationFrame(h)},[]);const g=n.useCallback(h=>{s(h)},[]),f=n.useCallback((h,y)=>{window.open(h,"_blank","noopener,noreferrer")},[]),_=n.useCallback(h=>{i(A(h))},[i]),p=n.useCallback(()=>{i(H)},[i]),N=n.useCallback(()=>{i(U)},[i]);return o.jsx(se,{children:o.jsxs("main",{className:"standalone-mobile-debug-route",children:[o.jsx(ie,{actions:r,routeKey:ce,title:b}),o.jsx("section",{className:"standalone-mobile-debug-route__content",children:o.jsx($,{isActive:!0,page:c,onChangePage:g,onOpenDebugUrl:f,onOpenDeviceDebug:_,onOpenDeviceList:p,onOpenDeviceSettings:N,onStandaloneDeviceTitleChange:u,onStandaloneHeaderActionsChange:l})})]})})}export{we as StandaloneMobileDebugRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.standalone-mobile-debug-route{--standalone-mobile-debug-controls-height: 30px;--standalone-mobile-debug-header-height: 38px;--standalone-mobile-debug-header-content-height: 18px;--interaction-panel-hover-bg: color-mix( in srgb, var(--primary-color) 9%, var(--bg-color) );--interaction-panel-active-bg: color-mix( in srgb, var(--primary-color) 12%, var(--bg-color) );--interaction-panel-hover-ring: color-mix( in srgb, var(--primary-color) 26%, transparent );--interaction-panel-press-bg: color-mix( in srgb, var(--primary-color) 16%, var(--bg-color) );--interaction-panel-toolbar-edge-padding: 10px;display:flex;flex-direction:column;width:100vw;height:100vh;min-width:0;min-height:0;overflow:hidden;background-color:var(--bg-color);color:var(--text-color)}.standalone-mobile-debug-route__header{position:relative;z-index:5;display:flex;align-items:center;min-height:var(--standalone-mobile-debug-header-height);height:var(--standalone-mobile-debug-header-height);padding:10px;border-bottom:1px solid var(--border-color);background:var(--bg-color);-webkit-app-region:drag}.standalone-mobile-debug-route__traffic-space{flex:0 0 66px;width:66px;height:100%}.standalone-mobile-debug-route__title{display:inline-flex;align-items:center;min-width:0;max-width:min(420px,48vw);gap:8px;height:var(--standalone-mobile-debug-header-content-height);color:var(--text-color);font-size:13px;font-weight:650;line-height:var(--standalone-mobile-debug-header-content-height);letter-spacing:0;white-space:nowrap;overflow:hidden}.standalone-mobile-debug-route__title-icon{width:var(--standalone-mobile-debug-header-content-height);height:var(--standalone-mobile-debug-header-content-height);min-width:var(--standalone-mobile-debug-header-content-height);font-size:var(--standalone-mobile-debug-header-content-height);line-height:var(--standalone-mobile-debug-header-content-height);color:var(--primary-color)}.standalone-mobile-debug-route__title-text{min-width:0;overflow:hidden;text-overflow:ellipsis}.standalone-mobile-debug-route__header-drag-fill{flex:1;min-width:12px;height:100%}.standalone-mobile-debug-route__header-actions{display:inline-flex;align-items:center;justify-content:flex-end;flex:0 0 auto;gap:4px;min-width:0;-webkit-app-region:no-drag}.standalone-mobile-debug-route__header-action-group,.chat-interaction-panel-mobile-debug__standalone-header-actions{display:inline-flex;align-items:center;gap:8px;min-width:0}.standalone-mobile-debug-route__header-action-group{margin-left:2px}.standalone-mobile-debug-route__popover-trigger{display:inline-flex;height:var(--standalone-mobile-debug-header-content-height)}.standalone-mobile-debug-route__header-action.ant-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--standalone-mobile-debug-header-content-height);min-width:var(--standalone-mobile-debug-header-content-height);height:var(--standalone-mobile-debug-header-content-height);padding:0!important;border:0;border-radius:0;color:var(--secondary-text-color);background:transparent!important;box-shadow:none;line-height:var(--standalone-mobile-debug-header-content-height);transition:color .16s ease}.standalone-mobile-debug-route__header-action.ant-btn:hover,.standalone-mobile-debug-route__header-action.ant-btn:focus-visible{color:var(--primary-color)!important;background:transparent!important}.standalone-mobile-debug-route__header-action.ant-btn:active,.standalone-mobile-debug-route__header-action.ant-btn.is-active{color:var(--primary-color)!important;background:transparent!important}.standalone-mobile-debug-route__header-action.ant-btn.is-danger:hover,.standalone-mobile-debug-route__header-action.ant-btn.is-danger:focus-visible{color:var(--danger-color)!important}.standalone-mobile-debug-route__header-action.ant-btn:disabled,.standalone-mobile-debug-route__header-action.ant-btn:disabled:hover,.standalone-mobile-debug-route__header-action.ant-btn:disabled:focus-visible{color:var(--placeholder-color)!important;background:transparent!important;opacity:.56}.standalone-mobile-debug-route__header-action-icon{width:var(--standalone-mobile-debug-header-content-height);height:var(--standalone-mobile-debug-header-content-height);min-width:var(--standalone-mobile-debug-header-content-height);font-size:var(--standalone-mobile-debug-header-content-height);line-height:var(--standalone-mobile-debug-header-content-height)}.standalone-mobile-debug-route__content{flex:1;display:flex;min-width:0;min-height:0;overflow:hidden}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug{width:100%;height:100%}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__body{height:100%;gap:0;padding:0;overflow:hidden}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-section{height:100%;padding:0;border-top:0}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid{height:100%;gap:0;grid-template-columns:max-content minmax(360px,1fr);grid-template-areas:"screen side";grid-template-rows:minmax(0,1fr)}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__side-tabs{box-sizing:border-box;padding:0}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__side-tabs>.ant-tabs>.ant-tabs-nav{margin-bottom:0}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__element-tree{padding-top:0}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid.is-dock-left{grid-template-columns:minmax(360px,1fr) max-content;grid-template-areas:"side screen"}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid.is-dock-bottom{align-content:start;grid-template-columns:minmax(0,1fr);grid-template-areas:"screen" "side";grid-template-rows:max-content minmax(220px,1fr)}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid.is-dock-left .chat-interaction-panel-mobile-debug__side-tabs{padding:0}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid.is-dock-bottom .chat-interaction-panel-mobile-debug__side-tabs{width:100%;padding:0}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid.is-side-panel-hidden{width:100vw;max-width:none;grid-template-columns:minmax(0,1fr)}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid .chat-interaction-panel-mobile-debug__device-window{--standalone-mobile-debug-screen-height: calc( 100vh - var(--standalone-mobile-debug-header-height) - var(--standalone-mobile-debug-controls-height) );width:auto;height:100%;gap:0;max-width:none;max-height:none}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid.is-side-panel-hidden .chat-interaction-panel-mobile-debug__device-window{--standalone-mobile-debug-screen-height: calc( 100vw / var(--mobile-debug-screen-ratio) );width:100vw;height:calc(var(--standalone-mobile-debug-screen-height) + var(--standalone-mobile-debug-controls-height))}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid.is-dock-bottom .chat-interaction-panel-mobile-debug__device-window{--standalone-mobile-debug-screen-height: min( calc(100vw / var(--mobile-debug-screen-ratio)), calc(58vh - var(--standalone-mobile-debug-controls-height)) );width:auto;height:calc(var(--standalone-mobile-debug-screen-height) + var(--standalone-mobile-debug-controls-height))}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__preview-grid .chat-interaction-panel-mobile-debug__device-shell{width:calc(var(--standalone-mobile-debug-screen-height) * var(--mobile-debug-screen-ratio));height:var(--standalone-mobile-debug-screen-height);flex:0 0 auto;border:0;border-radius:0;background:transparent;box-shadow:none}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__device-titlebar{display:none}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__device-controls{width:calc(var(--standalone-mobile-debug-screen-height) * var(--mobile-debug-screen-ratio));height:var(--standalone-mobile-debug-controls-height);flex:0 0 var(--standalone-mobile-debug-controls-height);gap:18px;background:transparent}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__device-control-btn.ant-btn.ant-btn-text{height:30px;border-radius:0;box-shadow:none;transform:none}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__device-control-btn.ant-btn.ant-btn-text:not(:disabled):not(.ant-btn-disabled):hover,.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__device-control-btn.ant-btn.ant-btn-text:not(:disabled):not(.ant-btn-disabled):focus-visible{background:transparent}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__device-control-btn.ant-btn.ant-btn-text:not(:disabled):not(.ant-btn-disabled):active{transform:none}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__screen-column{height:100%}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__device-window{height:100%;max-height:none}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__screen{min-height:0}.standalone-mobile-debug-route .chat-interaction-panel-mobile-debug__element-list{max-height:none}.standalone-mobile-debug-route__opacity-popover .ant-popover-inner{border-radius:8px;background:var(--popover-bg-color, var(--bg-color));box-shadow:0 14px 34px #0f172a2e}.standalone-mobile-debug-route__opacity-popover .ant-popover-inner-content{padding:10px 12px}.standalone-mobile-debug-route__opacity-control{width:160px;padding:2px 4px}
|