@v587d/capital-generation 2.26.0 → 2.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ window.__ModuleLoader__.load({
5
5
  var module = { exports: {} }
6
6
  var exports = module.exports
7
7
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' })
8
- "use strict";var te=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Qe=Object.prototype.hasOwnProperty;var Ye=(a,t,i)=>()=>{if(i)throw i[0];try{return a&&(t=a(a=0)),t}catch(n){throw i=[n],n}};var Je=(a,t)=>{for(var i in t)te(a,i,{get:t[i],enumerable:!0})},Ve=(a,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ke(t))!Qe.call(a,s)&&s!==i&&te(a,s,{get:()=>t[s],enumerable:!(n=Be(t,s))||n.enumerable});return a};var Xe=a=>Ve(te({},"__esModule",{value:!0}),a);var ge={};Je(ge,{ASSET_TYPES:()=>Ze,HOLDABLE_ASSET_TYPES:()=>me,MAX_ROW_WEIGHT_PCT:()=>aa,MAX_TOTAL_WEIGHT_PCT:()=>ta,holdingWeight:()=>we,isHoldable:()=>ea,otherHeldWeightPct:()=>fe,weightCeiling:()=>ia});var Ze,me,ea,aa,ta,we,fe,ia,be=Ye(()=>{"use strict";Ze=["a-share","a-share-index","fund-etf","hk-stock","hk-index","us-stock","us-index"],me=["a-share","fund-etf","hk-stock","us-stock"],ea=a=>me.includes(a?.asset_type),aa=100,ta=120,we=a=>a?.holding===null||a?.holding===void 0?0:a?.holding?.weight_pct??0,fe=(a,t)=>a.reduce((i,n)=>n?.thscode===t?i:i+we(n),0),ia=(a,t)=>Math.max(0,Math.min(100,120-fe(a,t)))});var{createElement:e,useEffect:Y,useRef:sa,useState:b}=require("react"),{createSnapshotStore:la}=require("@deepseek-ai/dsh-client-store"),{IconChecklistOutlineRegular:J,IconCloseOutlineRegular:xe,IconDatabaseOutlineRegular:ra,IconEllipsisOutlineRegular:Pe,IconGoalOutlineRegular:Te,IconListPenOutlineRegular:na,IconPinOutlineRegular:Re,IconRefreshOutlineRegular:He,IconSearchOutlineRegular:Ie,IconTrashOutlineRegular:se,Menu:le,MenuItemButton:V,Modal:oa,Switch:ca}=require("@deepseek-ai/dsh-client-ui-primitives"),{isHoldable:ye,weightCeiling:Me}=(be(),Xe(ge)),H="capital-watchlist",D="capital.watchlist",ve="conversation.input.overlay",ke="/capital-watchlist",da="capital-generation",pa=300,ie=10,Ne="capital-watchlist-css",ha={"command.label":"\u81EA\u9009\u80A1","command.description":"\u6DFB\u52A0 / \u67E5\u770B / \u5220\u9664\u81EA\u9009\u80A1",title:"\u81EA\u9009\u80A1",close:"\u5173\u95ED",searchPlaceholder:"\u8F93\u5165\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\uFF0C\u652F\u6301A\u80A1/\u6E2F\u80A1/\u7F8E\u80A1",add:"\u6DFB\u52A0",added:"\u5DF2\u6DFB\u52A0",refreshing:"\u5237\u65B0\u4E2D\u2026",refresh:"\u5237\u65B0\u62A5\u4EF7",loading:"\u6B63\u5728\u8BFB\u53D6\u6E05\u5355\u2026",empty:"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1\uFF0C\u7528\u4E0A\u9762\u7684\u8F93\u5165\u6846\u6DFB\u52A0\u3002",colName:"\u540D\u79F0",colQuote:"\u6700\u65B0\u4EF7 / \u6DA8\u8DCC\u5E45",colAction:"\u64CD\u4F5C",updated:"\u66F4\u65B0\u65F6\u95F4",notRefreshed:"\u672A\u5237\u65B0",stale:"\u4E0A\u4E00\u6B21\u5FEB\u7167",exchangeTime:"\u4EA4\u6613\u6240\u65F6\u95F4",noChangePct:"\u6682\u65E0\u6DA8\u8DCC\u6570\u636E",typeAShare:"A\u80A1",typeHkStock:"\u6E2F\u80A1",typeUsStock:"\u7F8E\u80A1",typeAIndex:"A\u6307",typeHkIndex:"\u6E2F\u6307",typeUsIndex:"\u7F8E\u6307",kindStock:"\u80A1\u7968",kindIndex:"\u6307\u6570",kindEtf:"ETF",remove:"\u79FB\u9664",more:"\u66F4\u591A",pin:"\u7F6E\u9876",holdingWeightLabel:"\u6301\u4ED3\u6BD4\u4F8B",holdingStepper:"\u6301\u4ED3\u6BD4\u4F8B\uFF08\u6BCF\u6863 10 \u4E2A\u767E\u5206\u70B9\uFF09",holdingStepUp:"\u589E\u52A0\u6301\u4ED3\u6BD4\u4F8B",holdingStepDown:"\u51CF\u5C11\u6301\u4ED3\u6BD4\u4F8B",holdingName:"\u6301\u4ED3",predict:"\u9884\u6D4B",predictTip:"AI\u9884\u6D4B",review:"\u590D\u76D8",reviewTip:"AI\u590D\u76D8",predictPromptPrefix:"\u8BF7\u9884\u6D4B ",predictPromptSuffix:"\uFF1A\u672A\u6765 5 \u4E2A\u4EA4\u6613\u65E5\u7684\u8D70\u52BF\u4E0E\u5173\u952E\u70B9\u4F4D\uFF0C\u8BF4\u660E\u4F9D\u636E\uFF0C\u5E76\u7ED9\u51FA\u5224\u65AD\u7684\u4E0D\u786E\u5B9A\u6027\u3002",reviewPromptPrefix:"\u8BF7\u590D\u76D8 ",reviewPromptSuffix:"\uFF1A\u4ECA\u65E5\u8D70\u52BF\u4E0E\u91CF\u4EF7\u3001\u8FD1 20 \u65E5\u8D8B\u52BF\u3001\u57FA\u7840\u9762\u3001\u6D88\u606F\u9762\uFF0C\u7ED9\u51FA\u7ED3\u8BBA\u548C\u5FC5\u8981\u98CE\u9669\u8BC4\u4F30\u3002",searching:"\u641C\u7D22\u4E2D\u2026",composingHint:"\u8F93\u5165\u5B8C\u6210\u540E\u81EA\u52A8\u641C\u7D22",clearInput:"\u6E05\u7A7A\u8F93\u5165",confirmTitle:"\u786E\u8BA4\u79FB\u9664\uFF1F",confirmDescPrefix:"\u786E\u5B9A\u5C06 ",confirmDescSuffix:" \u4ECE\u81EA\u9009\u4E2D\u79FB\u9664\u5417\uFF1F",confirmCancel:"\u53D6\u6D88",confirmOk:"\u786E\u8BA4\u79FB\u9664",truncated:"\u6CA1\u6709\u66F4\u591A\uFF0C\u8BF7\u8F93\u5165\u51C6\u786E\u7684\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\u3002",filterAll:"\u5168\u90E8",filterLabel:"\u6309\u5E02\u573A\u7B5B\u9009\u5019\u9009",filterNoHit:"\u8FD9\u4E2A\u5E02\u573A\u4E0B\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\u3002",noHit:"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\uFF08A\u80A1 / \u6E2F\u80A1 / \u7F8E\u80A1\uFF0C\u542B\u6307\u6570\u4E0E\u573A\u5185\u57FA\u91D1\uFF09\u3002","error.invalid_query":"\u8F93\u5165\u4E0D\u88AB\u63A5\u53D7","error.not_found":"\u6CA1\u6709\u627E\u5230\u8BE5\u6807\u7684","error.ambiguous":"\u547D\u4E2D\u591A\u6761\uFF0C\u8BF7\u4ECE\u5019\u9009\u91CC\u9009\u4E00\u6761","error.list_full":"\u81EA\u9009\u80A1\u6700\u591A {max} \u6761\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.list_full_noMax":"\u81EA\u9009\u80A1\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.credential_missing":"\u672A\u914D\u7F6E Fuyao \u5BC6\u94A5\uFF1A\u5728\u300C\u63D2\u4EF6\u300D\u9875\u7684 \u81EA\u52A8\u6A21\u5F0F\u5361\u7247\u91CC\u586B API Key\uFF08\u53EA\u5F71\u54CD A \u80A1\u90A3\u4E00\u8DEF\uFF0C\u6E2F\u7F8E\u80A1\u7167\u5E38\u7528\uFF09","error.rate_limited":"\u884C\u60C5\u670D\u52A1\u9650\u6D41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.fuyao_unavailable":"A \u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.tencent_unavailable":"\u6E2F\u7F8E\u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.quote_unavailable":"\u8BE5\u6807\u7684\u6CA1\u6709\u53EF\u7528\u62A5\u4EF7","error.refresh_timeout":"\u5237\u65B0\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.store_unavailable":"\u81EA\u9009\u80A1\u5B58\u50A8\u4E0D\u53EF\u7528","error.unauthorized":"\u767B\u5F55\u72B6\u6001\u5DF2\u5931\u6548\uFF1A\u8BF7\u5148\u56DE\u5230\u5BBF\u4E3B\u7A97\u53E3\u91CD\u65B0\u767B\u5F55",errorSuffix:"\uFF08\u5176\u4ED6\u6807\u7684\u4ECD\u662F\u4E0A\u4E00\u6B21\u6210\u529F\u5FEB\u7167\uFF09","partial.a-share":"A \u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.hk":"\u6E2F\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.us":"\u7F8E\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","desk.panel":"\u81EA\u9009\u80A1","desk.title":"\u81EA\u9009\u80A1\u884C\u60C5\u5DE5\u4F5C\u53F0","desk.refresh":"\u5237\u65B0\u884C\u60C5","desk.refreshing":"\u5237\u65B0\u4E2D\u2026","desk.loading":"\u6B63\u5728\u8BFB\u53D6\u81EA\u9009\u80A1\u2026","desk.lastUpdate":"\u6700\u8FD1\u66F4\u65B0","desk.notRefreshed":"\u672A\u5237\u65B0","desk.filter":"\u7B5B\u9009\u6807\u7684","desk.filterPlaceholder":"\u540D\u79F0\u6216\u4EE3\u7801","desk.group":"\u5206\u7EC4","desk.allGroups":"\u5168\u90E8","desk.newGroup":"\u5206\u7EC4\u540D\u79F0","desk.createGroup":"\u65B0\u5EFA","desk.deleteGroup":"\u5220\u9664\u5206\u7EC4","desk.noGroup":"\u672A\u5206\u7EC4","desk.more":"\u66F4\u591A\u64CD\u4F5C","desk.noGroupYet":"\u8FD8\u6CA1\u6709\u5206\u7EC4","desk.pin":"\u7F6E\u9876","desk.remove":"\u79FB\u9664","desk.removeHint":"\u518D\u70B9\u4E00\u6B21\u5220\u9664\u6309\u94AE\u786E\u8BA4\u79FB\u9664","desk.cancel":"\u53D6\u6D88","desk.empty":"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1","desk.emptyHint":"\u7528\u8F93\u5165\u6846\u7684\u300C\u81EA\u9009\u80A1\u300D\u9762\u677F\u6DFB\u52A0\u6807\u7684\uFF0C\u8FD9\u91CC\u4F1A\u540C\u6B65\u663E\u793A\u3002","desk.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684","desk.noMatchHint":"\u6362\u4E2A\u5173\u952E\u8BCD\uFF0C\u6216\u5207\u56DE\u300C\u5168\u90E8\u300D\u5206\u7EC4\u3002","desk.selectHint":"\u9009\u62E9\u4E00\u53EA\u6807\u7684\u67E5\u770B\u8BE6\u60C5","desk.selectHintBody":"\u5DE6\u4FA7\u5217\u8868\u6309\u5206\u7EC4\u7B5B\u9009\uFF1B\u9009\u4E2D\u540E\u8FD9\u91CC\u663E\u793A\u62A5\u4EF7\u3001\u5206\u65F6\u4E0E\u6210\u4EA4\u91CF\u3002","desk.intraday":"\u5F53\u65E5\u5206\u65F6","desk.intradayEmpty":"\u5F53\u524D\u884C\u60C5\u63A5\u53E3\u53EA\u8FD4\u56DE\u6700\u65B0\u5FEB\u7167","desk.intradayEmptyHint":"\u63A5\u5165\u5206\u65F6\u5E8F\u5217\u540E\uFF0C\u8FD9\u91CC\u76F4\u63A5\u7ED8\u5236\u5F53\u65E5\u8D70\u52BF\u3002","desk.volume":"\u6210\u4EA4\u91CF","desk.volumeEmpty":"\u6682\u65E0\u6210\u4EA4\u91CF\u6570\u636E","desk.capturedAt":"\u5FEB\u7167\u65F6\u95F4","desk.sourceTime":"\u4EA4\u6613\u6240\u65F6\u95F4","desk.groupsOf":"\u6240\u5C5E\u5206\u7EC4","desk.kind":"\u6807\u7684\u7C7B\u578B","desk.colName":"\u540D\u79F0","desk.colPrice":"\u6700\u65B0","desk.colChange":"\u6DA8\u8DCC","desk.colAction":"\u64CD\u4F5C","desk.loadFailed":"\u81EA\u9009\u80A1\u670D\u52A1\u6682\u4E0D\u53EF\u7528"},ua={"command.label":"Watchlist","command.description":"Add / view / remove watched symbols",title:"Watchlist",close:"Close",searchPlaceholder:"Symbol code or name \u2014 A-share / HK / US",add:"Add",added:"Added",refreshing:"Refreshing\u2026",refresh:"Refresh quotes",loading:"Loading list\u2026",empty:"No symbols yet \u2014 use the input above to add one.",colName:"Symbol",colQuote:"Last / change",colAction:"Actions",updated:"Updated",notRefreshed:"Not refreshed",stale:"last snapshot",exchangeTime:"exchange time",noChangePct:"No change data yet",typeAShare:"A-Share",typeHkStock:"HK",typeUsStock:"US",typeAIndex:"A-Index",typeHkIndex:"HK-Index",typeUsIndex:"US-Index",kindStock:"stock",kindIndex:"index",kindEtf:"ETF",remove:"Remove",more:"More",pin:"Pin to top",holdingWeightLabel:"Holding weight",holdingStepper:"Holding weight, in steps of 10 percentage points",holdingStepUp:"Increase holding weight",holdingStepDown:"Decrease holding weight",holdingName:"Holding",predict:"Predict",predictTip:"AI prediction",review:"Review",reviewTip:"AI review",predictPromptPrefix:"Predict ",predictPromptSuffix:" over the next 5 sessions: the likely path and key levels, the evidence behind the call, and how uncertain it is.",reviewPromptPrefix:"Review ",reviewPromptSuffix:" with today's trend and volume, the last 20 sessions, fundamental, news, then a conclusion and the necessary risks analysis.",searching:"Searching\u2026",composingHint:"Search runs when you finish typing",clearInput:"Clear input",confirmTitle:"Remove this symbol?",confirmDescPrefix:"Remove ",confirmDescSuffix:" from your watchlist?",confirmCancel:"Cancel",confirmOk:"Remove",truncated:"No more candidates \u2014 enter an accurate code or name.",filterAll:"All",filterLabel:"Filter candidates by market",filterNoHit:"No matching symbol in this market.",noHit:"No matching symbol (A-share / HK / US, including indices and listed funds).","error.invalid_query":"Input not accepted","error.not_found":"Symbol not found","error.ambiguous":"Multiple hits \u2014 pick one candidate","error.list_full":"Watchlist holds at most {max} symbols \u2014 remove one first","error.list_full_noMax":"Watchlist is full \u2014 remove one first","error.credential_missing":"No Fuyao API key: set it on the Capital card in the Plugins page (A-share quotes only \u2014 HK and US keep working)","error.rate_limited":"Quote service is rate limited \u2014 try again later","error.fuyao_unavailable":"A-share quotes unavailable \u2014 try again later","error.tencent_unavailable":"HK / US quotes unavailable \u2014 try again later","error.quote_unavailable":"No quote for this symbol","error.refresh_timeout":"Refresh timed out \u2014 try again later","error.store_unavailable":"Watchlist storage unavailable","error.unauthorized":"Session expired \u2014 sign back in to the host first",errorSuffix:" (other symbols still show their last good snapshot)","partial.a-share":"A-share search unavailable: ","partial.hk":"HK search unavailable: ","partial.us":"US search unavailable: ","desk.panel":"Watchlist","desk.title":"Watchlist market desk","desk.refresh":"Refresh quotes","desk.refreshing":"Refreshing\u2026","desk.loading":"Loading watchlist\u2026","desk.lastUpdate":"Last update","desk.notRefreshed":"Not refreshed","desk.filter":"Filter symbols","desk.filterPlaceholder":"Name or code","desk.group":"Group","desk.allGroups":"All","desk.newGroup":"Group name","desk.createGroup":"Create","desk.deleteGroup":"Delete group","desk.noGroup":"Ungrouped","desk.more":"More actions","desk.noGroupYet":"No groups yet","desk.pin":"Pin","desk.remove":"Remove","desk.removeHint":"Press remove again to confirm","desk.cancel":"Cancel","desk.empty":"No symbols yet","desk.emptyHint":"Add symbols from the watchlist panel in the composer; they appear here.","desk.noMatch":"No symbols match","desk.noMatchHint":"Try another term, or switch back to All.","desk.selectHint":"Select a symbol","desk.selectHintBody":"The left list filters by group; the quote, intraday and volume panels follow the selection.","desk.intraday":"Intraday","desk.intradayEmpty":"The quote endpoint returns a snapshot only","desk.intradayEmptyHint":"Once an intraday series is available, the same-session trend draws here.","desk.volume":"Volume","desk.volumeEmpty":"No volume data","desk.capturedAt":"Captured","desk.sourceTime":"Exchange time","desk.groupsOf":"Groups","desk.kind":"Instrument","desk.colName":"Symbol","desk.colPrice":"Last","desk.colChange":"Change","desk.colAction":"Actions","desk.loadFailed":"Watchlist service unavailable"},ma={"a-share":"typeAShare","hk-stock":"typeHkStock","us-stock":"typeUsStock","a-share-index":"typeAIndex","hk-index":"typeHkIndex","us-index":"typeUsIndex","fund-etf":"typeAShare"},wa={"a-share":"kindStock","hk-stock":"kindStock","us-stock":"kindStock","a-share-index":"kindIndex","hk-index":"kindIndex","us-index":"kindIndex","fund-etf":"kindEtf"};function Oe(a,t){let i=ma[a];return i===void 0?String(a??""):t(i)}function fa(a,t){let i=wa[a];return i===void 0?String(a??""):t(i)}var ga=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\u00AD\u200B-\u200F\u2028\u2029\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/gu;function L(a){return String(a??"").replace(ga,"")}function $(a){return Array.isArray(a)?a.map(t=>t===null||typeof t!="object"?t:{...t,name:L(t.name)}):a}var ba={"a-share":"capital-watchlist-tag-cn","a-share-index":"capital-watchlist-tag-cn","fund-etf":"capital-watchlist-tag-cn","hk-stock":"capital-watchlist-tag-hk","hk-index":"capital-watchlist-tag-hk","us-stock":"capital-watchlist-tag-us","us-index":"capital-watchlist-tag-us"},Ge=[{id:"all"},{id:"cn",label:"CN"},{id:"hk",label:"HK"},{id:"us",label:"US"}],_e=a=>a.exchange==="HK"?"hk":a.exchange==="US"?"us":"cn",xa=`
8
+ "use strict";var ze=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var zt=Object.prototype.hasOwnProperty;var Tt=(t,a,i)=>()=>{if(i)throw i[0];try{return t&&(a=t(t=0)),a}catch(r){throw i=[r],r}};var Ht=(t,a)=>{for(var i in a)ze(t,i,{get:a[i],enumerable:!0})},Pt=(t,a,i,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of At(a))!zt.call(t,s)&&s!==i&&ze(t,s,{get:()=>a[s],enumerable:!(r=Mt(a,s))||r.enumerable});return t};var Et=t=>Pt(ze({},"__esModule",{value:!0}),t);var Ye={};Ht(Ye,{ASSET_TYPES:()=>Rt,HOLDABLE_ASSET_TYPES:()=>We,MAX_ROW_WEIGHT_PCT:()=>Ot,MAX_TOTAL_WEIGHT_PCT:()=>It,holdingWeight:()=>Ke,isHoldable:()=>Ft,otherHeldWeightPct:()=>Qe,weightCeiling:()=>Lt});var Rt,We,Ft,Ot,It,Ke,Qe,Lt,Ve=Tt(()=>{"use strict";Rt=["a-share","a-share-index","fund-etf","hk-stock","hk-index","us-stock","us-index"],We=["a-share","fund-etf","hk-stock","us-stock"],Ft=t=>We.includes(t?.asset_type),Ot=100,It=120,Ke=t=>t?.holding===null||t?.holding===void 0?0:t?.holding?.weight_pct??0,Qe=(t,a)=>t.reduce((i,r)=>r?.thscode===a?i:i+Ke(r),0),Lt=(t,a)=>Math.max(0,Math.min(100,120-Qe(t,a)))});var{createElement:e,useEffect:ge,useRef:Ue,useState:A}=require("react"),{createSnapshotStore:Ut}=require("@deepseek-ai/dsh-client-store"),{IconChecklistOutlineRegular:ke,IconCloseOutlineRegular:Xe,IconDatabaseOutlineRegular:jt,IconEllipsisOutlineRegular:ot,IconGoalOutlineRegular:ct,IconListPenOutlineRegular:Dt,IconPinOutlineRegular:dt,IconRefreshOutlineRegular:Re,IconSearchOutlineRegular:pt,IconTrashOutlineRegular:Fe,Menu:Oe,MenuItemButton:Ne,Modal:Gt,Switch:qt}=require("@deepseek-ai/dsh-client-ui-primitives"),{isHoldable:Ze,weightCeiling:ht}=(Ve(),Et(Ye)),he="capital-watchlist",fe="capital.watchlist",Je="conversation.input.overlay",et="/capital-watchlist",Bt="capital-generation",Wt=300,Te=10,tt="capital-watchlist-css",Kt={"command.label":"\u81EA\u9009\u80A1","command.description":"\u6DFB\u52A0 / \u67E5\u770B / \u5220\u9664\u81EA\u9009\u80A1",title:"\u81EA\u9009\u80A1",close:"\u5173\u95ED",searchPlaceholder:"\u8F93\u5165\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\uFF0C\u652F\u6301A\u80A1/\u6E2F\u80A1/\u7F8E\u80A1",add:"\u6DFB\u52A0",added:"\u5DF2\u6DFB\u52A0",refreshing:"\u5237\u65B0\u4E2D\u2026",refresh:"\u5237\u65B0\u62A5\u4EF7",loading:"\u6B63\u5728\u8BFB\u53D6\u6E05\u5355\u2026",empty:"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1\uFF0C\u7528\u4E0A\u9762\u7684\u8F93\u5165\u6846\u6DFB\u52A0\u3002",colName:"\u540D\u79F0",colQuote:"\u6700\u65B0\u4EF7 / \u6DA8\u8DCC\u5E45",colAction:"\u64CD\u4F5C",updated:"\u66F4\u65B0\u65F6\u95F4",notRefreshed:"\u672A\u5237\u65B0",stale:"\u4E0A\u4E00\u6B21\u5FEB\u7167",exchangeTime:"\u4EA4\u6613\u6240\u65F6\u95F4",noChangePct:"\u6682\u65E0\u6DA8\u8DCC\u6570\u636E",typeAShare:"A\u80A1",typeHkStock:"\u6E2F\u80A1",typeUsStock:"\u7F8E\u80A1",typeAIndex:"A\u6307",typeHkIndex:"\u6E2F\u6307",typeUsIndex:"\u7F8E\u6307",kindStock:"\u80A1\u7968",kindIndex:"\u6307\u6570",kindEtf:"ETF",remove:"\u79FB\u9664",more:"\u66F4\u591A",pin:"\u7F6E\u9876",holdingWeightLabel:"\u6301\u4ED3\u6BD4\u4F8B",holdingStepper:"\u6301\u4ED3\u6BD4\u4F8B\uFF08\u6BCF\u6863 10 \u4E2A\u767E\u5206\u70B9\uFF09",holdingStepUp:"\u589E\u52A0\u6301\u4ED3\u6BD4\u4F8B",holdingStepDown:"\u51CF\u5C11\u6301\u4ED3\u6BD4\u4F8B",holdingName:"\u6301\u4ED3",predict:"\u9884\u6D4B",predictTip:"AI\u9884\u6D4B",review:"\u590D\u76D8",reviewTip:"AI\u590D\u76D8",predictPromptPrefix:"\u8BF7\u9884\u6D4B ",predictPromptSuffix:"\uFF1A\u672A\u6765 5 \u4E2A\u4EA4\u6613\u65E5\u7684\u8D70\u52BF\u4E0E\u5173\u952E\u70B9\u4F4D\uFF0C\u8BF4\u660E\u4F9D\u636E\uFF0C\u5E76\u7ED9\u51FA\u5224\u65AD\u7684\u4E0D\u786E\u5B9A\u6027\u3002",reviewPromptPrefix:"\u8BF7\u590D\u76D8 ",reviewPromptSuffix:"\uFF1A\u4ECA\u65E5\u8D70\u52BF\u4E0E\u91CF\u4EF7\u3001\u8FD1 20 \u65E5\u8D8B\u52BF\u3001\u57FA\u7840\u9762\u3001\u6D88\u606F\u9762\uFF0C\u7ED9\u51FA\u7ED3\u8BBA\u548C\u5FC5\u8981\u98CE\u9669\u8BC4\u4F30\u3002",searching:"\u641C\u7D22\u4E2D\u2026",composingHint:"\u8F93\u5165\u5B8C\u6210\u540E\u81EA\u52A8\u641C\u7D22",clearInput:"\u6E05\u7A7A\u8F93\u5165",confirmTitle:"\u786E\u8BA4\u79FB\u9664\uFF1F",confirmDescPrefix:"\u786E\u5B9A\u5C06 ",confirmDescSuffix:" \u4ECE\u81EA\u9009\u4E2D\u79FB\u9664\u5417\uFF1F",confirmCancel:"\u53D6\u6D88",confirmOk:"\u786E\u8BA4\u79FB\u9664",truncated:"\u6CA1\u6709\u66F4\u591A\uFF0C\u8BF7\u8F93\u5165\u51C6\u786E\u7684\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\u3002",filterAll:"\u5168\u90E8",filterLabel:"\u6309\u5E02\u573A\u7B5B\u9009\u5019\u9009",filterNoHit:"\u8FD9\u4E2A\u5E02\u573A\u4E0B\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\u3002",noHit:"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\uFF08A\u80A1 / \u6E2F\u80A1 / \u7F8E\u80A1\uFF0C\u542B\u6307\u6570\u4E0E\u573A\u5185\u57FA\u91D1\uFF09\u3002","error.invalid_query":"\u8F93\u5165\u4E0D\u88AB\u63A5\u53D7","error.not_found":"\u6CA1\u6709\u627E\u5230\u8BE5\u6807\u7684","error.ambiguous":"\u547D\u4E2D\u591A\u6761\uFF0C\u8BF7\u4ECE\u5019\u9009\u91CC\u9009\u4E00\u6761","error.list_full":"\u81EA\u9009\u80A1\u6700\u591A {max} \u6761\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.list_full_noMax":"\u81EA\u9009\u80A1\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.credential_missing":"\u672A\u914D\u7F6E Fuyao \u5BC6\u94A5\uFF1A\u5728\u300C\u63D2\u4EF6\u300D\u9875\u7684 \u81EA\u52A8\u6A21\u5F0F\u5361\u7247\u91CC\u586B API Key\uFF08\u53EA\u5F71\u54CD A \u80A1\u90A3\u4E00\u8DEF\uFF0C\u6E2F\u7F8E\u80A1\u7167\u5E38\u7528\uFF09","error.rate_limited":"\u884C\u60C5\u670D\u52A1\u9650\u6D41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.fuyao_unavailable":"A \u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.tencent_unavailable":"\u6E2F\u7F8E\u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.quote_unavailable":"\u8BE5\u6807\u7684\u6CA1\u6709\u53EF\u7528\u62A5\u4EF7","error.refresh_timeout":"\u5237\u65B0\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.store_unavailable":"\u81EA\u9009\u80A1\u5B58\u50A8\u4E0D\u53EF\u7528","error.unauthorized":"\u767B\u5F55\u72B6\u6001\u5DF2\u5931\u6548\uFF1A\u8BF7\u5148\u56DE\u5230\u5BBF\u4E3B\u7A97\u53E3\u91CD\u65B0\u767B\u5F55",errorSuffix:"\uFF08\u5176\u4ED6\u6807\u7684\u4ECD\u662F\u4E0A\u4E00\u6B21\u6210\u529F\u5FEB\u7167\uFF09","partial.a-share":"A \u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.hk":"\u6E2F\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.us":"\u7F8E\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","desk.panel":"\u81EA\u9009\u80A1","desk.title":"\u81EA\u9009\u80A1\u884C\u60C5\u5DE5\u4F5C\u53F0","desk.refresh":"\u5237\u65B0\u884C\u60C5","desk.refreshing":"\u5237\u65B0\u4E2D\u2026","desk.loading":"\u6B63\u5728\u8BFB\u53D6\u81EA\u9009\u80A1\u2026","desk.lastUpdate":"\u6700\u8FD1\u66F4\u65B0","desk.notRefreshed":"\u672A\u5237\u65B0","desk.filter":"\u7B5B\u9009\u6807\u7684","desk.filterPlaceholder":"\u540D\u79F0\u6216\u4EE3\u7801","desk.group":"\u5206\u7EC4","desk.allGroups":"\u5168\u90E8","desk.newGroup":"\u5206\u7EC4\u540D\u79F0","desk.createGroup":"\u65B0\u5EFA","desk.deleteGroup":"\u5220\u9664\u5206\u7EC4","desk.noGroup":"\u672A\u5206\u7EC4","desk.more":"\u66F4\u591A\u64CD\u4F5C","desk.noGroupYet":"\u8FD8\u6CA1\u6709\u5206\u7EC4","desk.pin":"\u7F6E\u9876","desk.remove":"\u79FB\u9664","desk.removeHint":"\u518D\u70B9\u4E00\u6B21\u5220\u9664\u6309\u94AE\u786E\u8BA4\u79FB\u9664","desk.cancel":"\u53D6\u6D88","desk.empty":"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1","desk.emptyHint":"\u7528\u8F93\u5165\u6846\u7684\u300C\u81EA\u9009\u80A1\u300D\u9762\u677F\u6DFB\u52A0\u6807\u7684\uFF0C\u8FD9\u91CC\u4F1A\u540C\u6B65\u663E\u793A\u3002","desk.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684","desk.noMatchHint":"\u6362\u4E2A\u5173\u952E\u8BCD\uFF0C\u6216\u5207\u56DE\u300C\u5168\u90E8\u300D\u5206\u7EC4\u3002","desk.selectHint":"\u9009\u62E9\u4E00\u53EA\u6807\u7684\u67E5\u770B\u8BE6\u60C5","desk.selectHintBody":"\u5DE6\u4FA7\u5217\u8868\u6309\u5206\u7EC4\u7B5B\u9009\uFF1B\u9009\u4E2D\u540E\u8FD9\u91CC\u663E\u793A\u62A5\u4EF7\u3001\u5206\u65F6\u4E0E\u6210\u4EA4\u91CF\u3002","desk.intraday":"\u5206\u65F6","desk.trendLoading":"\u6B63\u5728\u8BFB\u53D6\u5206\u65F6\u2026","desk.trendUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u5206\u65F6\u6570\u636E","desk.trendUnavailableHint":"\u573A\u5916\u7F8E\u80A1\u4E0E\u90E8\u5206\u6D77\u5916\u6307\u6570\u6CA1\u6709\u5206\u65F6\u6E90\uFF0C\u8FD9\u91CC\u4E0D\u753B\u5047\u8D70\u52BF\u3002","desk.trendError":"\u5206\u65F6\u52A0\u8F7D\u5931\u8D25","desk.retry":"\u91CD\u8BD5","desk.daily":"\u65E5K","desk.fold":"\u6536\u8D77","desk.unfold":"\u5C55\u5F00","desk.adjustQfq":"\u524D\u590D\u6743","desk.klineLoading":"\u6B63\u5728\u8BFB\u53D6\u65E5K\u2026","desk.klineError":"\u65E5K\u52A0\u8F7D\u5931\u8D25","desk.klineUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u65E5K\u6570\u636E","desk.klineUnavailableHint":"\u6E2F\u7F8E\u80A1\u6307\u6570\u53EA\u6709\u5206\u65F6\uFF0C\u6CA1\u6709\u53EF\u7528\u7684\u65E5\u7EBF\u5E8F\u5217","desk.kOpen":"\u5F00","desk.kHigh":"\u9AD8","desk.kLow":"\u4F4E","desk.kClose":"\u6536","desk.trendLive":"\u76D8\u4E2D","desk.trendClosed":"\u6536\u76D8","desk.trendPrevious":"\u4E0A\u4E00\u4EA4\u6613\u65E5","desk.trendStale":"\u6570\u636E\u6EDE\u540E","desk.trendOpen":"\u4ECA\u5F00","desk.trendHigh":"\u6700\u9AD8","desk.trendLow":"\u6700\u4F4E","desk.trendAvg":"\u5747\u4EF7","desk.trendVolume":"\u6210\u4EA4\u91CF","desk.trendAmount":"\u6210\u4EA4\u989D","desk.lot":"\u624B","desk.share":"\u80A1","desk.trendZoneUs":"\u7F8E\u4E1C","desk.trendZoneHk":"\u9999\u6E2F","desk.capturedAt":"\u884C\u60C5\u65F6\u95F4","desk.groupsOf":"\u6240\u5C5E\u5206\u7EC4","desk.kind":"\u6807\u7684\u7C7B\u578B","desk.colName":"\u540D\u79F0","desk.colPrice":"\u6700\u65B0","desk.colChange":"\u6DA8\u8DCC","desk.colAction":"\u64CD\u4F5C","desk.loadFailed":"\u81EA\u9009\u80A1\u670D\u52A1\u6682\u4E0D\u53EF\u7528"},Qt={"command.label":"Watchlist","command.description":"Add / view / remove watched symbols",title:"Watchlist",close:"Close",searchPlaceholder:"Symbol code or name \u2014 A-share / HK / US",add:"Add",added:"Added",refreshing:"Refreshing\u2026",refresh:"Refresh quotes",loading:"Loading list\u2026",empty:"No symbols yet \u2014 use the input above to add one.",colName:"Symbol",colQuote:"Last / change",colAction:"Actions",updated:"Updated",notRefreshed:"Not refreshed",stale:"last snapshot",exchangeTime:"exchange time",noChangePct:"No change data yet",typeAShare:"A-Share",typeHkStock:"HK",typeUsStock:"US",typeAIndex:"A-Index",typeHkIndex:"HK-Index",typeUsIndex:"US-Index",kindStock:"stock",kindIndex:"index",kindEtf:"ETF",remove:"Remove",more:"More",pin:"Pin to top",holdingWeightLabel:"Holding weight",holdingStepper:"Holding weight, in steps of 10 percentage points",holdingStepUp:"Increase holding weight",holdingStepDown:"Decrease holding weight",holdingName:"Holding",predict:"Predict",predictTip:"AI prediction",review:"Review",reviewTip:"AI review",predictPromptPrefix:"Predict ",predictPromptSuffix:" over the next 5 sessions: the likely path and key levels, the evidence behind the call, and how uncertain it is.",reviewPromptPrefix:"Review ",reviewPromptSuffix:" with today's trend and volume, the last 20 sessions, fundamental, news, then a conclusion and the necessary risks analysis.",searching:"Searching\u2026",composingHint:"Search runs when you finish typing",clearInput:"Clear input",confirmTitle:"Remove this symbol?",confirmDescPrefix:"Remove ",confirmDescSuffix:" from your watchlist?",confirmCancel:"Cancel",confirmOk:"Remove",truncated:"No more candidates \u2014 enter an accurate code or name.",filterAll:"All",filterLabel:"Filter candidates by market",filterNoHit:"No matching symbol in this market.",noHit:"No matching symbol (A-share / HK / US, including indices and listed funds).","error.invalid_query":"Input not accepted","error.not_found":"Symbol not found","error.ambiguous":"Multiple hits \u2014 pick one candidate","error.list_full":"Watchlist holds at most {max} symbols \u2014 remove one first","error.list_full_noMax":"Watchlist is full \u2014 remove one first","error.credential_missing":"No Fuyao API key: set it on the Capital card in the Plugins page (A-share quotes only \u2014 HK and US keep working)","error.rate_limited":"Quote service is rate limited \u2014 try again later","error.fuyao_unavailable":"A-share quotes unavailable \u2014 try again later","error.tencent_unavailable":"HK / US quotes unavailable \u2014 try again later","error.quote_unavailable":"No quote for this symbol","error.refresh_timeout":"Refresh timed out \u2014 try again later","error.store_unavailable":"Watchlist storage unavailable","error.unauthorized":"Session expired \u2014 sign back in to the host first",errorSuffix:" (other symbols still show their last good snapshot)","partial.a-share":"A-share search unavailable: ","partial.hk":"HK search unavailable: ","partial.us":"US search unavailable: ","desk.panel":"Watchlist","desk.title":"Watchlist market desk","desk.refresh":"Refresh quotes","desk.refreshing":"Refreshing\u2026","desk.loading":"Loading watchlist\u2026","desk.lastUpdate":"Last update","desk.notRefreshed":"Not refreshed","desk.filter":"Filter symbols","desk.filterPlaceholder":"Name or code","desk.group":"Group","desk.allGroups":"All","desk.newGroup":"Group name","desk.createGroup":"Create","desk.deleteGroup":"Delete group","desk.noGroup":"Ungrouped","desk.more":"More actions","desk.noGroupYet":"No groups yet","desk.pin":"Pin","desk.remove":"Remove","desk.removeHint":"Press remove again to confirm","desk.cancel":"Cancel","desk.empty":"No symbols yet","desk.emptyHint":"Add symbols from the watchlist panel in the composer; they appear here.","desk.noMatch":"No symbols match","desk.noMatchHint":"Try another term, or switch back to All.","desk.selectHint":"Select a symbol","desk.selectHintBody":"The left list filters by group; the quote, intraday and volume panels follow the selection.","desk.intraday":"Intraday","desk.trendLoading":"Loading intraday\u2026","desk.trendUnavailable":"No intraday series for this market","desk.trendUnavailableHint":"OTC US lines and some overseas indices have no intraday source; nothing is drawn to fill the gap.","desk.trendError":"Intraday failed to load","desk.retry":"Retry","desk.daily":"Daily","desk.fold":"Collapse","desk.unfold":"Expand","desk.adjustQfq":"Forward-adjusted","desk.klineLoading":"Loading daily bars\u2026","desk.klineError":"Daily bars failed to load","desk.klineUnavailable":"No daily bars for this market","desk.klineUnavailableHint":"HK/US indices carry an intraday series only","desk.kOpen":"Open","desk.kHigh":"High","desk.kLow":"Low","desk.kClose":"Close","desk.trendLive":"Live","desk.trendClosed":"Closed","desk.trendPrevious":"Previous session","desk.trendStale":"Stale","desk.trendOpen":"Open","desk.trendHigh":"High","desk.trendLow":"Low","desk.trendAvg":"VWAP","desk.trendVolume":"Volume","desk.trendAmount":"Turnover","desk.lot":"lots","desk.share":"shares","desk.trendZoneUs":"ET","desk.trendZoneHk":"HK","desk.capturedAt":"As of","desk.groupsOf":"Groups","desk.kind":"Instrument","desk.colName":"Symbol","desk.colPrice":"Last","desk.colChange":"Change","desk.colAction":"Actions","desk.loadFailed":"Watchlist service unavailable"},Yt={"a-share":"typeAShare","hk-stock":"typeHkStock","us-stock":"typeUsStock","a-share-index":"typeAIndex","hk-index":"typeHkIndex","us-index":"typeUsIndex","fund-etf":"typeAShare"},Vt={"a-share":"kindStock","hk-stock":"kindStock","us-stock":"kindStock","a-share-index":"kindIndex","hk-index":"kindIndex","us-index":"kindIndex","fund-etf":"kindEtf"};function ut(t,a){let i=Yt[t];return i===void 0?String(t??""):a(i)}function Xt(t,a){let i=Vt[t];return i===void 0?String(t??""):a(i)}var Zt=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\u00AD\u200B-\u200F\u2028\u2029\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/gu;function xe(t){return String(t??"").replace(Zt,"")}function ce(t){return Array.isArray(t)?t.map(a=>a===null||typeof a!="object"?a:{...a,name:xe(a.name)}):t}var Jt={"a-share":"capital-watchlist-tag-cn","a-share-index":"capital-watchlist-tag-cn","fund-etf":"capital-watchlist-tag-cn","hk-stock":"capital-watchlist-tag-hk","hk-index":"capital-watchlist-tag-hk","us-stock":"capital-watchlist-tag-us","us-index":"capital-watchlist-tag-us"},wt=[{id:"all"},{id:"cn",label:"CN"},{id:"hk",label:"HK"},{id:"us",label:"US"}],at=t=>t.exchange==="HK"?"hk":t.exchange==="US"?"us":"cn",ea=`
9
9
  .capital-watchlist-dialog.capital-watchlist-dialog { width: min(420px, 92vw); max-height: 100%; padding: 0; gap: 0; border-radius: 18px; }
10
10
  .capital-watchlist-card { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-radius: 18px; --capital-watchlist-up: #d1493f; --capital-watchlist-down: #17a063; --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2); --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2); }
11
11
  .capital-watchlist-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 20px 14px; }
@@ -127,8 +127,8 @@ window.__ModuleLoader__.load({
127
127
  /* Theme has no global border-box reset; the official item padding would overflow the list. */
128
128
  .capital-watchlist-rows button { box-sizing: border-box; }
129
129
  /* --- \u884C\u60C5\u5DE5\u4F5C\u53F0\uFF1A\u5DE6\u4FA7\u680F\u5165\u53E3 + main \u9762\u677F\u3002\u5361\u7247\u8D70\u53D1\u4E1D\u7EBF\uFF0C\u6D6E\u5C42\u4EA4\u7ED9\u5B98\u65B9 Menu\u3002 --- */
130
- .cwd-page { height: 100%; min-height: 0; overflow-y: auto; --cwd-body-h: clamp(520px, 78vh, 860px); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); --cwd-card: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1)); --capital-watchlist-up: #d1493f; --capital-watchlist-down: #17a063; }
131
- .cwd-inner { max-width: 1180px; margin: 0 auto; padding: 28px 32px 44px; }
130
+ .cwd-page { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow-y: auto; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); --cwd-card: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1)); --capital-watchlist-up: #d1493f; --capital-watchlist-down: #17a063; }
131
+ .cwd-inner { display: flex; flex: 1; flex-direction: column; width: 100%; min-height: 0; max-width: 1180px; margin: 0 auto; padding: 24px 32px 32px; }
132
132
  .cwd-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
133
133
  .cwd-title { margin: 0; font-size: 26px; line-height: 32px; font-weight: 650; letter-spacing: -.2px; }
134
134
  .cwd-headactions { display: flex; align-items: center; gap: 14px; flex: none; }
@@ -136,7 +136,8 @@ window.__ModuleLoader__.load({
136
136
  .cwd-refresh { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 14px; border: .5px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 25%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent); color: var(--dsw-alias-state-business-primary); font-family: inherit; font-size: 13px; line-height: 20px; font-weight: 500; cursor: pointer; }
137
137
  .cwd-refresh:hover:not(:disabled) { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 20%, transparent); }
138
138
  .cwd-refresh:disabled { opacity: .45; cursor: not-allowed; }
139
- .cwd-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(430px, 1.35fr); gap: 22px; align-items: stretch; height: var(--cwd-body-h); }
139
+ .cwd-body { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) minmax(430px, 1.35fr); grid-template-rows: minmax(0, 1fr); gap: 22px; align-items: stretch; min-height: 420px; max-height: 880px; }
140
+ /* \u26D4 \u884C\u9AD8\u5FC5\u987B\u9489\u6B7B\uFF1A\u9690\u5F0F\u884C\u6309\u5185\u5BB9\u81EA\u9002\u5E94\u65F6\uFF0C\u53F3\u680F\u4E00\u65E6\u957F\u9AD8\u5C31\u628A\u884C\u6491\u5F00\uFF0C\u5DE6\u5217\u8DDF\u7740 height:100% \u4E00\u8D77\u53D8\u9AD8\uFF08\u5B9E\u6D4B\u75C7\u72B6\uFF09\u3002 */
140
141
  .cwd-card { display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; border: .5px solid var(--dsw-alias-border-l1); border-radius: 14px; background: var(--cwd-card); overflow: hidden; }
141
142
  .cwd-toolbar { display: flex; flex: none; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: .5px solid var(--dsw-alias-border-l2); }
142
143
  .cwd-field { display: flex; align-items: center; gap: 6px; flex: 1 1 170px; min-width: 0; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-tertiary); }
@@ -171,7 +172,7 @@ window.__ModuleLoader__.load({
171
172
  .cwd-iconbtn { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; }
172
173
  .cwd-iconbtn:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); }
173
174
  .cwd-iconbtn:disabled { opacity: .45; cursor: not-allowed; }
174
- .cwd-detail { display: flex; flex: 1; flex-direction: column; gap: 14px; min-height: 0; padding: 16px; overflow-y: auto; }
175
+ .cwd-detail { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 0; padding: 16px; overflow-y: auto; }
175
176
  .cwd-detailhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
176
177
  .cwd-detailname { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; line-height: 22px; font-weight: 600; }
177
178
  .cwd-detailtext { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@@ -179,19 +180,66 @@ window.__ModuleLoader__.load({
179
180
  .cwd-bigquote { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
180
181
  .cwd-bigprice { font-size: 34px; line-height: 40px; font-weight: 650; font-variant-numeric: tabular-nums; }
181
182
  .cwd-bigpct { font-size: 14px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
182
- .cwd-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
183
- .cwd-metaitem { min-width: 0; }
184
- .cwd-metalabel { font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
185
- .cwd-metavalue { font-size: 12.5px; line-height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
183
+ .cwd-quoterow { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
184
+ .cwd-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; padding-bottom: 4px; }
185
+ .cwd-metaitem { display: flex; align-items: baseline; gap: 6px; }
186
+ .cwd-metalabel { flex: none; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
187
+ .cwd-metavalue { font-size: 12px; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
186
188
  .cwd-block { flex: none; padding-top: 12px; border-top: .5px solid var(--dsw-alias-border-l2); }
187
- .cwd-block-chart { flex: 1; display: flex; flex-direction: column; min-height: 0; }
188
- .cwd-blockhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
189
- .cwd-blocktitle { font-size: 12.5px; line-height: 18px; font-weight: 600; }
190
- .cwd-blocknote { font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
189
+ .cwd-block-chart { flex: 1 1 0; display: flex; flex-direction: column; min-height: 200px; }
190
+ /* Folded block keeps only its title row, so it stops competing for height. */
191
+ .cwd-block-chart.cwd-folded { flex: none; min-height: 0; }
192
+ .cwd-blockhead { display: flex; flex: none; align-items: baseline; gap: 12px; margin-bottom: 8px; }
193
+ .cwd-blocktitle { flex: none; font-size: 12.5px; line-height: 18px; font-weight: 600; }
194
+ .cwd-blocknote { margin-left: auto; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
195
+ .cwd-blockfold { flex: none; padding: 0 2px; border: 0; background: none; font-family: inherit; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); cursor: pointer; }
196
+ .cwd-blockfold:hover { color: var(--dsw-alias-label-primary); }
191
197
  .cwd-chart { flex: 1; min-height: 150px; display: grid; place-items: center; padding: 12px; border: 1px dashed var(--dsw-alias-border-l2); border-radius: 10px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-border-l2) 60%, transparent) 0 1px, transparent 1px 36px), var(--dsw-alias-bg-module-platform); text-align: center; }
192
198
  .cwd-charttext { font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-label-secondary); }
193
199
  .cwd-charthint { margin-top: 4px; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
194
- .cwd-volume { height: 92px; display: grid; place-items: center; border: 1px dashed var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-module-platform); border-radius: 10px; font-size: 12px; color: var(--dsw-alias-label-tertiary); }
200
+ .cwd-chartfail { border-style: solid; background: var(--dsw-alias-bg-module-platform); }
201
+ .cwd-chartfail .cwd-charttext { color: var(--dsw-alias-label-primary); }
202
+ .cwd-fallback { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 360px; }
203
+ .cwd-retry { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-top: 12px; height: 34px; padding: 0 14px; border: .5px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 38%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent); color: var(--dsw-alias-state-business-primary); font-family: inherit; font-size: 12.5px; line-height: 20px; font-weight: 500; cursor: pointer; }
204
+ .cwd-retry:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 22%, transparent); }
205
+ .cwd-retry:active { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 30%, transparent); }
206
+ .cwd-retry:focus-visible { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 60%, transparent); outline-offset: 2px; }
207
+ .cwd-trendstats { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 2px 14px; min-width: 0; }
208
+ .cwd-trendstat { display: flex; align-items: baseline; gap: 5px; font-size: 11px; line-height: 17px; }
209
+ .cwd-trendstat span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
210
+ .cwd-trendstat span:first-child { flex: none; color: var(--dsw-alias-label-tertiary); }
211
+ .cwd-trendstat span:last-child { font-variant-numeric: tabular-nums; }
212
+ .cwd-chartbox { position: relative; flex: 1; min-height: 120px; min-width: 0; overflow: hidden; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); }
213
+ /* The daily pane shares the SVG contract above (absolute child, determinate height): a flexed chart
214
+ next to a scrolled column is exactly how the container used to grow. */
215
+ .cwd-block-kline { flex: 1 1 0; display: flex; flex-direction: column; min-height: 220px; }
216
+ .cwd-klinebox { position: relative; flex: 1; min-height: 140px; min-width: 0; overflow: hidden; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); }
217
+ .cwd-malegend { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 2px 12px; min-width: 0; font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; }
218
+ .cwd-candle-up { fill: var(--capital-watchlist-up); stroke: var(--capital-watchlist-up); stroke-width: 1; }
219
+ .cwd-candle-down { fill: var(--capital-watchlist-down); stroke: var(--capital-watchlist-down); stroke-width: 1; }
220
+ .cwd-maline { fill: none; stroke-width: 1.1; stroke-linejoin: round; }
221
+ .cwd-ma5 { color: var(--dsw-alias-label-primary); stroke: var(--dsw-alias-label-primary); }
222
+ .cwd-ma10 { color: var(--dsw-alias-state-warn-primary); stroke: var(--dsw-alias-state-warn-primary); }
223
+ .cwd-ma20 { color: var(--dsw-alias-brand-primary); stroke: var(--dsw-alias-brand-primary); }
224
+ .cwd-ma60 { color: var(--dsw-alias-label-tertiary); stroke: var(--dsw-alias-label-tertiary); }
225
+ /* \u26D4 \u7EDD\u5BF9\u5B9A\u4F4D\u4E0D\u662F\u4E3A\u4E86\u53E0\u5C42\uFF1ASVG \u4E00\u65E6\u53C2\u4E0E\u6D41\u5F0F\u5E03\u5C40\uFF0CviewBox \u7684\u5BBD\u9AD8\u6BD4\u4F1A\u53CD\u63A8\u7236\u76D2\u9AD8\u5EA6\uFF0C
226
+ \u91CF\u6D4B\u56DE\u5199\u5C31\u628A\u5BB9\u5668\u8D8A\u6491\u8D8A\u5927\uFF08\u5B9E\u6D4B\u9010\u5E27\u589E\u957F\uFF09\u3002\u5B83\u5FC5\u987B\u6C38\u8FDC\u5F71\u54CD\u4E0D\u4E86\u81EA\u5DF1\u7684\u5BB9\u5668\u3002 */
227
+ .cwd-chartsvg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; }
228
+ .cwd-chartaxis { fill: var(--dsw-alias-label-tertiary); font-size: 10.5px; font-variant-numeric: tabular-nums; }
229
+ .cwd-chartbaselabel { fill: var(--dsw-alias-label-secondary); }
230
+ .cwd-chartgrid { stroke: color-mix(in srgb, var(--dsw-alias-border-l2) 55%, transparent); stroke-width: 1; shape-rendering: crispEdges; }
231
+ .cwd-chartsep { stroke: var(--dsw-alias-border-l2); stroke-width: 1; stroke-dasharray: 2 3; }
232
+ .cwd-chartline { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
233
+ .cwd-chartavg { fill: none; stroke: var(--dsw-alias-state-business-primary); stroke-width: 1; stroke-dasharray: 3 3; opacity: .85; }
234
+ .cwd-chartbase { stroke: var(--dsw-alias-label-tertiary); stroke-width: 1; opacity: .7; }
235
+ .cwd-chartcross { stroke: var(--dsw-alias-label-tertiary); stroke-width: 1; stroke-dasharray: 3 3; opacity: .8; }
236
+ .cwd-chartdot { fill: currentColor; }
237
+ .cwd-vol-up { fill: var(--capital-watchlist-up); opacity: .55; }
238
+ .cwd-vol-down { fill: var(--capital-watchlist-down); opacity: .55; }
239
+ .cwd-charttip { position: absolute; top: 8px; min-width: 150px; padding: 7px 9px; border-radius: 8px; border: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1)); pointer-events: none; }
240
+ .cwd-charttiptime { font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
241
+ .cwd-charttipprice { font-size: 13px; line-height: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
242
+ .cwd-charttiprow { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }
195
243
  .cwd-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 34px 18px; text-align: center; }
196
244
  .cwd-emptytitle { font-size: 14px; line-height: 20px; font-weight: 600; }
197
245
  .cwd-emptyhint { margin: 6px 0 0; font-size: 12.5px; line-height: 19px; color: var(--dsw-alias-label-tertiary); }
@@ -204,10 +252,10 @@ window.__ModuleLoader__.load({
204
252
  .cwd-field:focus-within { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 1px; }
205
253
  .cwd-page button:focus-visible, .cwd-groupcreate input:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 1px; }
206
254
  .cwd-skeleton { display: block; height: 12px; border-radius: 6px; background: var(--dsw-alias-bg-skeleton); }
207
- @media (max-width: 1040px) { .cwd-body { grid-template-columns: minmax(0, 1fr); gap: 16px; height: auto; } .cwd-card { height: auto; } .cwd-tablebody { flex: none; max-height: 60vh; } .cwd-chart { flex: none; height: 200px; } }
255
+ @media (max-width: 1040px) { .cwd-body { flex: none; grid-template-columns: minmax(0, 1fr); gap: 16px; height: auto; max-height: none; } .cwd-card { height: auto; } .cwd-tablebody { flex: none; max-height: 60vh; } .cwd-chart { flex: none; height: 200px; } .cwd-chartbox { flex: none; height: 260px; } .cwd-klinebox { flex: none; height: 260px; } .cwd-block-chart, .cwd-block-kline { flex: none; } }
208
256
  @media (max-width: 720px) { .cwd-inner { padding: 20px 16px 32px; } .cwd-thead, .cwd-row { grid-template-columns: minmax(0, 1.5fr) 78px 72px 36px; gap: 8px; } .cwd-thead { padding: 8px 10px; } .cwd-row { padding: 9px 10px; } }
209
- `;function ya(){let a=globalThis.document;if(!a||typeof a.createElement!="function"||a.querySelector(`style[data-${Ne}]`))return;let t=a.createElement("style");t.setAttribute(`data-${Ne}`,""),t.textContent=xa;let i=a.head??a.body;if(!(i===void 0||typeof i.appendChild!="function"))return i.appendChild(t),()=>t.remove()}async function v(a,{query:t,body:i,signal:n}={}){let s=t!==void 0?`${ke}${a}?${t}`:`${ke}${a}`,d=i===void 0?{method:"GET",cache:"no-store",credentials:"same-origin",signal:n}:{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),credentials:"same-origin",signal:n},u=await fetch(s,d),c=await u.text(),o={};try{o=c.length>0?JSON.parse(c):{}}catch{o={}}if(u.ok===!0&&o.ok===!0)return o;let m=typeof o.code=="string"&&o.code.length>0?o.code:u.status===401||u.status===403?"unauthorized":"fuyao_unavailable",k=new Error(m);throw k.code=m,k.candidates=o.candidates,k.limit=o.limit,k}var Se=()=>({open:!1,loading:!1,refreshing:!1,searching:!1,items:[],candidates:[],truncated:!1,marketFilter:"all",query:"",dropdownOpen:!1,rowMenu:null,pendingRemove:null,refreshed_at:null,error:null,searchError:null,searchPartial:null,addError:null,loadError:null,failures:{},composing:!1,pendingSearch:!1}),re=class{constructor(){this.store=la(Se()),this.searchController=null,this.timer=null,this.pending=null,this.lastQuery=null,this.holdingOps=new Map}get state(){return this.store}get snapshot(){return this.store.getSnapshot()}patch(t){this.store.update(i=>Object.assign(i,t))}open(){this.patch({...Se(),open:!0,loading:!0}),this.load().then(()=>this.refresh(),()=>this.patch({loading:!1}))}close(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({open:!1,rowMenu:null,composing:!1,pendingSearch:!1}),this.holdingOps.clear()}async load(){try{let t=await v("/list");this.holdingOps.clear(),this.patch({items:$(t.items)??[],seeded_at:t.seeded_at,loading:!1,loadError:null})}catch(t){throw this.patch({loading:!1,loadError:{code:t.code??"fuyao_unavailable"}}),t}}refresh(){if(this.pending!==null)return this.pending;this.patch({refreshing:!0});let t=v("/refresh",{body:{}}).then(i=>{let n={};for(let u of i.failures??[])n[u.thscode]=u.code;let s=$(i.items),d=s??this.snapshot.items;s!==null&&this.holdingOps.clear(),this.patch({items:d,refreshed_at:i.refreshed_at??this.snapshot.refreshed_at,failures:n,error:i.error?{code:i.error.code,partial:d.length>0&&d.some(u=>n[u.thscode]===void 0)}:null})}).catch(i=>{this.patch({error:{code:i.code??"fuyao_unavailable",partial:this.snapshot.items.some(n=>n.quote!==null)}})}).finally(()=>{this.patch({refreshing:!1}),this.pending=null});return this.pending=t,t}onQueryChange(t,i){let n=t.trim(),s=i===void 0?this.snapshot.composing===!0:i===!0;if(this.patch({query:t,searchError:null,composing:s,dropdownOpen:n.length>0}),this.timer!==null&&clearTimeout(this.timer),n.length===0){this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1});return}n===this.lastQuery&&this.snapshot.pendingSearch===!1||(this.patch({candidates:[],truncated:!1,pendingSearch:!s}),s!==!0&&(this.timer=setTimeout(()=>this.search(n),pa)))}beginComposition(){this.timer!==null&&clearTimeout(this.timer),this.patch({composing:!0})}endComposition(t){this.onQueryChange(t,!1)}hideDropdown(){this.patch({dropdownOpen:!1})}setMarketFilter(t){Ge.some(i=>i.id===t)&&this.patch({marketFilter:t})}toggleRowMenu(t){this.patch({rowMenu:this.snapshot.rowMenu===t?null:t})}closeRowMenu(){this.snapshot.rowMenu!==null&&this.patch({rowMenu:null})}setPendingRemove(t){this.patch({pendingRemove:t??null})}replaceRow(t){let[i]=$([t]);i===void 0||typeof i?.thscode!="string"||this.patch({items:this.snapshot.items.map(n=>n.thscode===i.thscode?i:n)})}async search(t){this.lastQuery=t,this.searchController!==null&&this.searchController.abort();let i=new AbortController;this.searchController=i,this.patch({searching:!0,searchError:null,searchPartial:null});let n=()=>this.snapshot.query.trim()===t;try{let s=await v("/search",{query:`q=${encodeURIComponent(t)}`,signal:i.signal});if(!n()){this.patch({searching:!1});return}this.patch({candidates:$(s.items)??[],truncated:s.truncated===!0,searching:!1,pendingSearch:!1,searchPartial:Array.isArray(s.partial)&&s.partial.length>0?s.partial:null})}catch(s){if(s.name==="AbortError"||(this.lastQuery===t&&(this.lastQuery=null),!n()))return;this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1,searchError:{code:s.code??"fuyao_unavailable"},searchPartial:null})}}async add(t){try{await v("/add",{body:{thscode:t.thscode}})}catch(n){this.patch({addError:{code:n.code??"fuyao_unavailable",candidates:n.candidates,limit:n.limit}}),n.candidates!==void 0&&this.patch({candidates:n.candidates,truncated:!1});return}this.patch({addError:null,candidates:this.snapshot.candidates.map(n=>n.thscode===t.thscode?{...n,in_list:!0}:n)}),await this.load().catch(()=>{}),await this.refresh();let i=this.snapshot.items.find(n=>n.thscode===t.thscode);i!==void 0&&i.quote===null&&this.snapshot.failures[t.thscode]===void 0&&await this.refresh()}async remove(t){let i=this.snapshot.items;this.patch({items:i.filter(n=>n.thscode!==t),rowMenu:null});try{await v("/remove",{body:{thscode:t}}),this.snapshot.addError?.code==="list_full"&&this.patch({addError:null})}catch{this.patch({items:i})}}async pin(t){let i=this.snapshot.items,n=i.find(s=>s.thscode===t);if(n!==void 0){this.patch({items:[n,...i.filter(s=>s.thscode!==t)],rowMenu:null});try{let s=await v("/pin",{body:{thscode:t}});Array.isArray(s.items)&&this.patch({items:$(s.items)})}catch{let s=this.snapshot.items,d=i.map(c=>s.find(o=>o.thscode===c.thscode)).filter(Boolean),u=new Set(d.map(c=>c.thscode));this.patch({items:[...d,...s.filter(c=>!u.has(c.thscode))]})}}}async writeHolding(t,i,n){let s=this.snapshot.items.find(o=>o.thscode===t);if(s===void 0)return;let d=this.holdingOps.get(t)??{seq:0,baseline:s};this.holdingOps.set(t,d);let u=++d.seq;this.patch({items:this.snapshot.items.map(o=>o.thscode===t?n(o):o)});let c=()=>this.holdingOps.get(t)!==d||d.seq!==u;try{let o=await v("/holding",{body:i});if(c())return;this.replaceRow(o.item),d.baseline=o.item??n(s),this.holdingOps.delete(t)}catch{if(c())return;this.replaceRow(d.baseline),this.holdingOps.delete(t)}}markHolding(t,i){return this.writeHolding(t,{thscode:t,weight_pct:i},n=>({...n,holding:{weight_pct:i,marked_at:Date.now()}}))}clearHolding(t){return this.writeHolding(t,{thscode:t,clear:!0},i=>{let n={...i};return delete n.holding,n})}stepHolding(t,i){let n=this.snapshot.items,s=n.find(u=>u.thscode===t)?.holding?.weight_pct;if(typeof s!="number"&&i<0)return;let d=Math.min(Me(n,t),Math.max(0,(typeof s=="number"?s:0)+i));if(d!==s)return this.markHolding(t,d)}async copyToClipboard(){let t=this.snapshot.items.map(i=>[i.thscode,L(i.name),i.asset_type,i.quote?.price??"",i.quote?.change_pct??"",i.quote?.captured_at??""].join(" ")).join(`
210
- `);return await navigator.clipboard.writeText(t),t}dispose(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort()}};function W(a){if(typeof a!="number"||!Number.isFinite(a))return"";let t=new Date(a),i=n=>String(n).padStart(2,"0");return`${i(t.getMonth()+1)}-${i(t.getDate())} ${i(t.getHours())}:${i(t.getMinutes())}`}function X({assetType:a,t}){return e("span",{className:`capital-watchlist-tag ${ba[a]??"capital-watchlist-tag-cn"}`},Oe(a,t))}function va(a,t,i){let n=L(a.name);return`${t(`${i}PromptPrefix`)}${n} (${a.thscode} \xB7 ${fa(a.asset_type,t)})${t(`${i}PromptSuffix`)}`}function ka({quote:a,failureCode:t,refreshing:i,t:n}){let s=t!==void 0;if(a==null)return i===!0?e("div",{className:"capital-watchlist-quote"},e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-price"}),e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-change"})):s?e("div",{className:"capital-watchlist-quote",title:n(`error.${t}`)},e("div",{className:"capital-watchlist-price capital-watchlist-quotefailed"},"\u2014")):e("div",{className:"capital-watchlist-quote"},e("div",{className:"capital-watchlist-price"},n("notRefreshed")));let d=typeof a.change_pct=="number"&&Number.isFinite(a.change_pct),u=d?`${a.change_pct>0?"+":""}${a.change_pct.toFixed(2)}%`:"\u2014",c=s?"capital-watchlist-stale":d?a.change_pct>0?"capital-watchlist-up":a.change_pct<0?"capital-watchlist-down":"capital-watchlist-flat":"capital-watchlist-nodata",o=typeof a.source_time=="string"&&a.source_time.length>0?`${n("exchangeTime")} ${a.source_time}`:"",m=[];return s?m.push(`${n(`error.${t}`)} \xB7 ${n("stale")} ${W(a.captured_at)}`):d||m.push(n("noChangePct")),o.length>0&&m.push(o),e("div",{className:"capital-watchlist-quote",title:m.length===0?void 0:m.join(" \xB7 ")},e("div",{className:s?"capital-watchlist-price capital-watchlist-stale":"capital-watchlist-price"},a.price.toFixed(2)),e("div",{className:`capital-watchlist-change ${c}`},u))}function Na(a,t){if(t.code!=="list_full")return a(`error.${t.code}`);let i=t.limit;return typeof i!="number"||!Number.isFinite(i)?a("error.list_full_noMax"):a("error.list_full").replace("{max}",String(i))}function _a(a,t){let i=a?.weight_pct;return i==null?t("holdingName"):`${t("holdingName")} ${i}%`}function Sa(a,t){let i=`${a.name} ${a.ticker}`;return a.holding===null||a.holding===void 0?i:`${i} \xB7 ${_a(a.holding,t)}`}function Ca({useDialog:a,surface:t,t:i,inputActions:n}){let s=a(l=>l),[d,u]=b(!1),[c,o]=b(null),m=s.pendingRemove??null;if(Y(()=>()=>t.dispose(),[t]),!s.open)return null;let k=s.dropdownOpen===!0,C=m!==null,I=l=>{if(l.key==="Escape"){if(C){l.stopPropagation(),t.setPendingRemove(null);return}k&&(l.stopPropagation(),t.hideDropdown())}},f=l=>{if(!k)return;let y=l.relatedTarget;y!=null&&l.currentTarget?.contains?.(y)===!0||t.hideDropdown()},A=s.error,_=A==null?null:e("p",{className:"capital-watchlist-notice",role:"alert","data-code":A.code},`${i(`error.${A.code}`)}${A.partial===!0?i("errorSuffix"):""}`),M=(l,y)=>{n.insertText(va(l,i,y),n.captureInsertion())===!0&&t.close()},P=s.marketFilter==="all"?s.candidates:s.candidates.filter(l=>_e(l)===s.marketFilter),T={all:s.candidates.length,cn:0,hk:0,us:0};for(let l of s.candidates)T[_e(l)]+=1;let q=s.candidates.length===0?null:e("div",{className:"capital-watchlist-filter",role:"group","aria-label":i("filterLabel")},Ge.map(l=>e("button",{key:l.id,type:"button",className:"capital-watchlist-filterbtn","aria-pressed":s.marketFilter===l.id,onClick:()=>t.setMarketFilter(l.id)},e("span",{className:"capital-watchlist-filterlabel"},l.id==="all"?i("filterAll"):l.label),e("span",{className:"capital-watchlist-filtercount"},String(T[l.id]))))),B=k?e("div",{className:"capital-watchlist-dropdown","aria-label":i("title"),"data-menu-material":"translucent"},q,e("div",{className:"capital-watchlist-options",role:"listbox","aria-label":i("title")},P.map(l=>e("button",{key:l.thscode,type:"button",role:"option",className:"capital-watchlist-option",title:l.name,"aria-disabled":l.in_list===!0||c===l.thscode,onClick:()=>{l.in_list===!0||c===l.thscode||(u(!0),o(l.thscode),t.add(l).finally(()=>{u(!1),o(null)}))}},e("span",{className:"capital-watchlist-optionmain"},e("span",{className:"capital-watchlist-optionname"},l.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-optioncode"},l.thscode),e(X,{assetType:l.asset_type,t:i}))),e("span",{className:"capital-watchlist-addbtn","data-state":l.in_list===!0?"added":"idle"},l.in_list===!0?i("added"):i("add")))),s.truncated===!0&&P.length>0?e("div",{className:"capital-watchlist-hint capital-watchlist-endhint"},i("truncated")):null),s.composing===!0?e("div",{className:"capital-watchlist-hint"},i("composingHint")):s.searching===!0||s.pendingSearch===!0?e("div",{className:"capital-watchlist-hint"},i("searching")):s.searchError!==null&&s.searchError!==void 0?e("div",{className:"capital-watchlist-hint capital-watchlist-searcherror",role:"alert","data-code":s.searchError.code},i(`error.${s.searchError.code}`)):s.candidates.length===0?e("div",{className:"capital-watchlist-hint"},i("noHit")):P.length===0?e("div",{className:"capital-watchlist-hint","data-filter":s.marketFilter},i("filterNoHit")):null,...(s.searchPartial??[]).map(l=>e("div",{key:`partial-${l.market}`,className:"capital-watchlist-hint capital-watchlist-searcherror",role:"status","data-market":l.market,"data-code":l.code},`${i(`partial.${l.market}`)}${i(`error.${l.code}`)}`))):null,K=s.items.length===0?null:e("div",{className:"capital-watchlist-grid capital-watchlist-head"},e("span",null,i("colName")),e("span",{className:"capital-watchlist-quote"},i("colQuote")),e("span",{className:"capital-watchlist-headaction"},i("colAction"))),Z=s.loadError!==null&&s.loadError!==void 0?e("p",{className:"capital-watchlist-empty capital-watchlist-loaderror",role:"alert","data-code":s.loadError.code},i(`error.${s.loadError.code}`)):e("p",{className:"capital-watchlist-empty"},i("empty")),O=s.loading?e("p",{className:"capital-watchlist-empty"},i("loading")):s.items.length===0?Z:e("div",{className:k?"capital-watchlist-list capital-watchlist-list-open":"capital-watchlist-list"},s.items.map((l,y)=>{let R=l.holding!==null&&l.holding!==void 0,x=l.holding?.weight_pct,S=ye(l)||R,F=Me(s.items,l.thscode),ee=!R||x===null||x===void 0||x<=0,ne=(typeof x=="number"?x:0)+ie>F;return e("div",{key:l.thscode,className:"capital-watchlist-grid capital-watchlist-row","data-thscode":l.thscode},e("span",{className:"capital-watchlist-namewrap"},e("span",{className:R?"capital-watchlist-name capital-watchlist-name-held":"capital-watchlist-name",title:Sa(l,i)},l.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-code"},l.ticker),e(X,{assetType:l.asset_type,t:i}))),e(ka,{quote:l.quote,failureCode:s.failures[l.thscode],refreshing:s.refreshing,t:i}),e("span",{className:"capital-watchlist-rowactions"},e("button",{type:"button",className:"capital-watchlist-predict",disabled:d,title:i("predictTip"),"aria-label":`${i("predict")} ${l.name}`,onClick:()=>M(l,"predict")},e(Te,{size:14})),e("button",{type:"button",className:"capital-watchlist-review",disabled:d,title:i("reviewTip"),"aria-label":`${i("review")} ${l.name}`,onClick:()=>M(l,"review")},e(na,{size:14})),e(le,{open:s.rowMenu===l.thscode,anchor:e("button",{type:"button",className:"capital-watchlist-more",disabled:d,title:i("more"),"aria-label":`${i("more")} ${l.name}`,"aria-haspopup":"menu","aria-expanded":s.rowMenu===l.thscode,onClick:()=>t.toggleRowMenu(l.thscode)},e(Pe,{size:14})),items:[{id:"pin",label:i("pin"),icon:e(Re,{size:14}),disabled:y===0}],children:[...S?[e("div",{key:"holding-check",role:"group","aria-label":i("holdingName"),className:"capital-watchlist-checkrow"},e("span",{className:"capital-watchlist-checkicon","aria-hidden":"true"},e(ra,{size:14})),e("span",{className:"capital-watchlist-checklabel"},i("holdingName")),e(ca,{checked:R,disabled:d,label:i("holdingName"),onChange:U=>U?t.markHolding(l.thscode,null):t.clearHolding(l.thscode)}))]:[],...R&&ye(l)?[e("div",{key:"holding-step",className:"capital-watchlist-stepper",role:"group","aria-label":i("holdingStepper")},e("span",{className:"capital-watchlist-stepperlabel"},i("holdingWeightLabel")),e("span",{className:"capital-watchlist-stepperline"},e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepDown"),disabled:ee,onClick:()=>t.stepHolding(l.thscode,-ie)},"\u2212"),e("span",{className:typeof x=="number"?"capital-watchlist-stepperreadout":"capital-watchlist-stepperreadout capital-watchlist-stepperplaceholder",role:"status"},typeof x=="number"?`${x}%`:`0~${F}`),e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepUp"),title:`0~${F}`,disabled:ne,onClick:()=>t.stepHolding(l.thscode,ie)},"+")))]:[],e(V,{key:"remove",danger:!0,separatorBefore:!0,icon:e(se,{size:14}),onSelect:()=>{t.closeRowMenu(),t.setPendingRemove(l)}},i("remove"))],onSelect:U=>{U==="pin"&&(t.closeRowMenu(),t.pin(l.thscode))},onClose:()=>t.closeRowMenu(),align:"end",portal:!0,listClassName:"capital-watchlist-rows",className:"capital-watchlist-actions"})))})),G=e("div",{className:C?"capital-watchlist-confirm capital-watchlist-confirm-open":"capital-watchlist-confirm","aria-hidden":C?void 0:"true"},e("div",{className:"capital-watchlist-confirmbox",role:C?"alertdialog":void 0,"aria-label":i("confirmTitle")},e("div",{className:"capital-watchlist-confirmtitle"},i("confirmTitle")),C?e("p",{className:"capital-watchlist-confirmdesc"},i("confirmDescPrefix"),e("strong",null,`${m.name} \xB7 ${m.ticker}`),i("confirmDescSuffix")):null,e("div",{className:"capital-watchlist-confirmactions"},e("button",{type:"button",className:"capital-watchlist-confirmbtn",onClick:()=>t.setPendingRemove(null)},i("confirmCancel")),e("button",{type:"button",className:"capital-watchlist-confirmbtn capital-watchlist-confirmdanger",onClick:()=>{let l=m;t.setPendingRemove(null),l!==null&&t.remove(l.thscode)}},i("confirmOk")))));return e(oa,{open:!0,onClose:()=>t.close(),title:i("title"),headless:!0,shortcutModal:"watchlist",className:"capital-watchlist-dialog"},e("div",{className:"capital-watchlist-card",onKeyDown:I},e("div",{className:"capital-watchlist-header"},e("h2",{className:"capital-watchlist-title"},i("title")),e("button",{type:"button",className:"capital-watchlist-close","aria-label":i("close"),onClick:()=>t.close()},e(xe,{size:14}))),e("div",{className:"capital-watchlist-search",onBlur:f},e("div",{className:"capital-watchlist-field"},e("span",{className:"capital-watchlist-searchicon"},e(Ie,{size:16})),e("input",{className:"capital-watchlist-input","data-modal-autofocus":!0,value:s.query,placeholder:i("searchPlaceholder"),onChange:l=>t.onQueryChange(l.target.value,l.isComposing),onCompositionStart:()=>t.beginComposition(),onCompositionEnd:l=>t.endComposition(l.target.value)}),s.query.length>0?e("button",{type:"button",className:"capital-watchlist-clear",title:i("clearInput"),"aria-label":i("clearInput"),onMouseDown:l=>l.preventDefault(),onClick:()=>t.onQueryChange("",!1)},e(xe,{size:12})):null),B),s.addError!==null&&s.addError!==void 0?e("p",{className:"capital-watchlist-adderror",role:"status","data-code":s.addError.code},Na(i,s.addError)):null,K,O,e("div",{className:"capital-watchlist-footer"},e("div",{className:"capital-watchlist-footcol"},e("button",{type:"button",className:"capital-watchlist-refresh",disabled:s.refreshing||d,onClick:()=>{t.refresh()}},e(He,{size:14}),s.refreshing?i("refreshing"):i("refresh")),_),e("span",{className:"capital-watchlist-updated"},`${i("updated")} ${s.refreshed_at===null||s.refreshed_at===void 0?i("notRefreshed"):W(s.refreshed_at)}`)),G))}var Ce=`${H}:desk`,Fe="capital.watchlist.desk.groups.v1",E="__all__";function Aa(){let a={names:[],assignments:{}};try{let t=JSON.parse(localStorage.getItem(Fe)??"{}");return t===null||typeof t!="object"||!Array.isArray(t.names)||t.assignments===null||typeof t.assignments!="object"?a:{names:t.names.filter(i=>typeof i=="string"&&i.length>0).slice(0,20),assignments:t.assignments}}catch{return a}}function Ea(a){try{localStorage.setItem(Fe,JSON.stringify(a))}catch{}}var Q=(a,t)=>{let i=a.assignments[t];return Array.isArray(i)?i:[]},Ae=a=>a!=null&&typeof a.change_pct=="number"&&Number.isFinite(a.change_pct)?a.change_pct:null,Ee=a=>a===null?"cwd-flat":a>0?"cwd-up":a<0?"cwd-down":"cwd-flat",ze=a=>a===null?"\u2014":`${a>0?"+":""}${a.toFixed(2)}%`,za=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),$e=a=>a!=null&&typeof a.price=="number"&&Number.isFinite(a.price)?za.format(a.price):"\u2014";function $a({size:a=18}){return e("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e("path",{d:"M4 19V5"}),e("path",{d:"M4 19h16"}),e("path",{d:"m7 15 3-4 3 2 5-7"}),e("circle",{cx:18,cy:6,r:1.4,fill:"currentColor",stroke:"none"}))}function Pa({t:a}){let[t,i]=b([]),[n,s]=b(!0),[d,u]=b(!1),[c,o]=b(null),[m,k]=b({}),[C,I]=b(null),[f,A]=b(Aa),[_,M]=b(E),[P,T]=b(!1),[q,B]=b(""),[K,Z]=b(""),[O,G]=b(null),[l,y]=b(null),[R,x]=b(null),S=sa(!0);Y(()=>(S.current=!0,()=>{S.current=!1}),[]),Y(()=>{Ea(f)},[f]);let F=r=>{let w=$(r.items);Array.isArray(w)&&i(w);let p={};for(let h of r.failures??[])h!==null&&typeof h=="object"&&typeof h.thscode=="string"&&(p[h.thscode]=h.code);k(p),typeof r.refreshed_at=="number"&&o(r.refreshed_at),I(r.error!==void 0&&r.error!==null&&typeof r.error.code=="string"?r.error.code:null)};Y(()=>{let r=!1;return(async()=>{try{let p=await v("/list");if(r)return;let h=$(p.items)??[];i(h),G(N=>N!==null?N:typeof h[0]?.thscode=="string"?h[0].thscode:null)}catch(p){r||I(p.code??"load_failed");return}finally{r||s(!1)}try{let p=await v("/refresh",{body:{}});r||F(p)}catch(p){r||I(p.code??"fuyao_unavailable")}})(),()=>{r=!0}},[]);let ee=async()=>{if(!d){u(!0);try{let r=await v("/refresh",{body:{}});S.current&&F(r)}catch(r){S.current&&I(r.code??"fuyao_unavailable")}finally{S.current&&u(!1)}}},ne=async r=>{let w=t;y(null),i(w.filter(p=>p.thscode!==r)),O===r&&G(null);try{await v("/remove",{body:{thscode:r}})}catch{S.current&&i(w)}},U=async r=>{let w=t,p=w.find(h=>h.thscode===r);if(p!==void 0){i([p,...w.filter(h=>h.thscode!==r)]);try{let h=await v("/pin",{body:{thscode:r}});Array.isArray(h.items)&&S.current&&i($(h.items))}catch{S.current&&i(w)}}},oe=()=>{let r=q.trim();r.length===0||r===E||f.names.includes(r)||(A({names:[...f.names,r],assignments:f.assignments}),B(""),M(r))},je=r=>{if(r===E)return;let w={};for(let[p,h]of Object.entries(f.assignments)){let N=(Array.isArray(h)?h:[]).filter(j=>j!==r);N.length>0&&(w[p]=N)}A({names:f.names.filter(p=>p!==r),assignments:w}),M(E),T(!1)},De=(r,w)=>{let p=Q(f,r),h=p.includes(w)?p.filter(j=>j!==w):[...p,w],N={...f.assignments};h.length===0?delete N[r]:N[r]=h,A({names:f.names,assignments:N})},ce=K.trim().toLowerCase(),de=t.filter(r=>_!==E&&!Q(f,r.thscode).includes(_)?!1:ce.length===0?!0:[r.name,r.thscode,r.ticker].some(w=>typeof w=="string"&&w.toLowerCase().includes(ce))),g=O===null?null:t.find(r=>r.thscode===O)??null,Le=[{id:E,label:a("desk.allGroups"),icon:_===E?e(J,{size:14}):void 0}].concat(f.names.map(r=>({id:r,label:r,icon:_===r?e(J,{size:14}):void 0}))),qe=de.map((r,w)=>{let p=Ae(r.quote),h=m[r.thscode],N=Q(f,r.thscode),j=O===r.thscode,ue=h===void 0?void 0:a(`error.${h}`),ae=R===r.thscode;return e("div",{key:r.thscode,className:"cwd-row",role:"listitem","aria-current":j?"true":void 0,onClick:z=>{z.target.closest(".cwd-rowactions")===null&&G(r.thscode)}},e("button",{type:"button",className:"cwd-cellname","aria-pressed":j,onClick:()=>G(r.thscode)},e("span",{className:"cwd-nameline"},e("span",{className:"cwd-nametext",title:r.name},L(r.name)),e(X,{assetType:r.asset_type,t:a})),e("span",{className:"cwd-codeline"},e("span",{className:"cwd-code"},r.thscode))),e("div",{className:h===void 0?"cwd-price":"cwd-price cwd-stale",title:ue},$e(r.quote)),e("div",{className:`cwd-pct ${Ee(p)}`,title:ue},ze(p)),e("div",{className:"cwd-rowactions"},e(le,{open:ae,anchor:e("button",{type:"button",className:"cwd-iconbtn",title:a("desk.more"),"aria-label":`${a("desk.more")} ${r.name}`,"aria-haspopup":"menu","aria-expanded":ae,onClick:()=>{y(null),x(ae?null:r.thscode)}},e(Pe,{size:16})),items:[{id:"pin",label:a("desk.pin"),icon:e(Re,{size:14}),disabled:w===0}],children:[...f.names.length===0?[e("div",{key:"no-group",className:"cwd-menuhint"},a("desk.noGroupYet"))]:f.names.map(z=>e(V,{key:`group:${z}`,icon:N.includes(z)?e(J,{size:14}):void 0,onSelect:()=>De(r.thscode,z)},z)),e(V,{key:"remove",danger:!0,separatorBefore:!0,icon:e(se,{size:14}),onSelect:()=>{x(null),y(r)}},a("desk.remove"))],onSelect:z=>{z==="pin"&&(x(null),U(r.thscode))},onClose:()=>x(null),align:"end",portal:!0,listClassName:"cwd-menulist"})))}),Ue=n?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},a("desk.loading"))):t.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},a("desk.empty")),e("p",{className:"cwd-emptyhint"},a("desk.emptyHint"))):de.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},a("desk.noMatch")),e("p",{className:"cwd-emptyhint"},a("desk.noMatchHint"))):e("div",{className:"cwd-tablebody",role:"list","aria-label":a("desk.title")},qe),pe=g===null?[]:Q(f,g.thscode),he=g===null?null:Ae(g.quote),We=g===null?e("div",{className:"cwd-card"},e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},a("desk.selectHint")),e("p",{className:"cwd-emptyhint"},a("desk.selectHintBody")))):e("div",{className:"cwd-card"},e("div",{className:"cwd-detail"},e("div",{className:"cwd-detailhead"},e("div",{style:{minWidth:0}},e("div",{className:"cwd-detailname"},e("span",{className:"cwd-detailtext",title:g.name},L(g.name)),e(X,{assetType:g.asset_type,t:a})),e("div",{className:"cwd-detailcode"},g.thscode))),e("div",{className:"cwd-bigquote"},e("span",{className:"cwd-bigprice"},$e(g.quote)),e("span",{className:`cwd-bigpct ${Ee(he)}`},ze(he))),e("div",{className:"cwd-meta"},e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},a("desk.capturedAt")),e("div",{className:"cwd-metavalue"},g.quote===null||g.quote===void 0?a("desk.notRefreshed"):W(g.quote.captured_at)||a("desk.notRefreshed"))),e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},a("desk.sourceTime")),e("div",{className:"cwd-metavalue"},typeof g.quote?.source_time=="string"&&g.quote.source_time.length>0?g.quote.source_time:"\u2014")),e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},a("desk.groupsOf")),e("div",{className:"cwd-metavalue"},pe.length===0?a("desk.noGroup"):pe.join(" / "))),e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},a("desk.kind")),e("div",{className:"cwd-metavalue"},Oe(g.asset_type,a)))),e("div",{className:"cwd-block cwd-block-chart"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},a("desk.intraday")),e("span",{className:"cwd-blocknote"},c===null?a("desk.notRefreshed"):W(c))),e("div",{className:"cwd-chart"},e("div",null,e("div",{className:"cwd-charttext"},a("desk.intradayEmpty")),e("div",{className:"cwd-charthint"},a("desk.intradayEmptyHint"))))),e("div",{className:"cwd-block"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},a("desk.volume"))),e("div",{className:"cwd-volume"},a("desk.volumeEmpty")))));return e("div",{className:"cwd-page"},e("div",{className:"cwd-inner"},e("header",{className:"cwd-head"},e("h1",{className:"cwd-title"},a("desk.title")),e("div",{className:"cwd-headactions"},e("span",{className:"cwd-updated"},`${a("desk.lastUpdate")} ${c===null?a("desk.notRefreshed"):W(c)}`),e("button",{type:"button",className:"cwd-refresh",disabled:d,onClick:()=>{ee()}},e(He,{size:14}),a(d?"desk.refreshing":"desk.refresh")))),e("div",{className:"cwd-body"},e("section",{className:"cwd-card"},e("div",{className:"cwd-toolbar"},e("label",{className:"cwd-field"},e(Ie,{size:14}),e("input",{type:"text",value:K,placeholder:a("desk.filterPlaceholder"),"aria-label":a("desk.filter"),onChange:r=>Z(r.target.value)})),e(le,{open:P,anchor:e("button",{type:"button",className:"cwd-pill","aria-haspopup":"menu","aria-expanded":P,"aria-label":a("desk.group"),onClick:()=>T(!P)},e(Te,{size:14}),e("span",null,_===E?a("desk.allGroups"):_)),items:Le,children:_===E?[]:[e(V,{key:"delete-group",danger:!0,separatorBefore:!0,icon:e(se,{size:14}),onSelect:()=>je(_)},a("desk.deleteGroup"))],onSelect:r=>{T(!1),M(r)},onClose:()=>T(!1),align:"start",portal:!0,listClassName:"cwd-menulist"}),e("div",{className:"cwd-groupcreate"},e("input",{type:"text",value:q,maxLength:20,placeholder:a("desk.newGroup"),"aria-label":a("desk.newGroup"),onChange:r=>B(r.target.value),onKeyDown:r=>{r.key==="Enter"&&oe()}}),e("button",{type:"button",className:"cwd-pill",disabled:q.trim().length===0,onClick:oe},a("desk.createGroup")))),C===null?null:e("div",{className:"cwd-error",role:"alert"},a(C==="load_failed"?"desk.loadFailed":`error.${C}`)),l===null?null:e("div",{className:"cwd-notice cwd-notice-danger"},e("span",null,`${a("desk.removeHint")} \xB7 ${L(l.name)}`),e("button",{type:"button",className:"cwd-pill",onClick:()=>y(null)},a("desk.cancel"))),e("div",{className:"cwd-thead",role:"row"},e("span",null,a("desk.colName")),e("span",{className:"cwd-right"},a("desk.colPrice")),e("span",{className:"cwd-right"},a("desk.colChange")),e("span",{className:"cwd-right"},a("desk.colAction"))),Ue),e("aside",null,We))))}function Ta(a){a.effect(ya,`${H}: styles`),a.effect(()=>a.locale.register(D,{zh:ha,en:ua}),`${H}: dictionaries`);let t=new Map,i=c=>{let o=t.get(c);return o===void 0&&(o=new re,t.set(c,o)),o};a.effect(()=>()=>{for(let c of t.values())c.dispose();t.clear()},`${H}: per-session surfaces`);let n=c=>{let m=a.sessions?.list?.getSnapshot?.().byId?.[c]?.projectionValues?.agentPreset;return typeof m=="string"?m:void 0},s=new Set,d=c=>{let o=n(c);return o!==void 0?o===da:(s.has(c)||(s.add(c),Promise.resolve(a.sessions?.refreshProjections?.(c)).catch(()=>{})),!1)};a.slots.inject(ve,()=>a.slots.register({name:ve,id:"capital-watchlist-dialog",order:3,locale:D,inject:c=>{let o=i(c);return{hooks:{dialog:o.state},surface:o}}},Ca));let u=a.locale.bind(D);a.slots.inject("main",()=>a.slots.register({name:"main",key:Ce,locale:D},Pa)),a.slots.inject("sidebar.panellist",()=>a.slots.register({name:"sidebar.panellist",id:Ce,order:12,locale:D,label:()=>u("desk.panel")},$a)),a.inject(["commandUi"],c=>{let o=a.locale.bind(D);c.effect(()=>c.commandUi.register({name:"watchlist",label:()=>o("command.label"),description:()=>o("command.description"),icon:J,available:m=>d(m.sessionId),ui:{kind:"action",run:m=>{i(m.sessionId).open()}}}),`${H}: /watchlist contribution`)}),a.logger?.info?.(`${H}: \u5BA2\u6237\u7AEF\u534A\u8FB9\u5DF2\u6302\u8F7D\uFF08/watchlist \u83DC\u5355\u884C + \u81EA\u9009\u80A1\u5F39\u7A97\uFF09`)}exports.name=H;exports.inject=["slots","locale","commandUi","sessions"];exports.apply=Ta;
257
+ `;function ta(){let t=globalThis.document;if(!t||typeof t.createElement!="function"||t.querySelector(`style[data-${tt}]`))return;let a=t.createElement("style");a.setAttribute(`data-${tt}`,""),a.textContent=ea;let i=t.head??t.body;if(!(i===void 0||typeof i.appendChild!="function"))return i.appendChild(a),()=>a.remove()}async function W(t,{query:a,body:i,signal:r}={}){let s=a!==void 0?`${et}${t}?${a}`:`${et}${t}`,w=i===void 0?{method:"GET",cache:"no-store",credentials:"same-origin",signal:r}:{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),credentials:"same-origin",signal:r},g=await fetch(s,w),c=await g.text(),d={};try{d=c.length>0?JSON.parse(c):{}}catch{d={}}if(g.ok===!0&&d.ok===!0)return d;let x=typeof d.code=="string"&&d.code.length>0?d.code:g.status===401||g.status===403?"unauthorized":"fuyao_unavailable",k=new Error(x);throw k.code=x,k.detail=typeof d.message=="string"&&d.message.length>0?d.message:null,k.candidates=d.candidates,k.limit=d.limit,k}var it=()=>({open:!1,loading:!1,refreshing:!1,searching:!1,items:[],candidates:[],truncated:!1,marketFilter:"all",query:"",dropdownOpen:!1,rowMenu:null,pendingRemove:null,refreshed_at:null,error:null,searchError:null,searchPartial:null,addError:null,loadError:null,failures:{},composing:!1,pendingSearch:!1}),Ie=class{constructor(){this.store=Ut(it()),this.searchController=null,this.timer=null,this.pending=null,this.lastQuery=null,this.holdingOps=new Map}get state(){return this.store}get snapshot(){return this.store.getSnapshot()}patch(a){this.store.update(i=>Object.assign(i,a))}open(){this.patch({...it(),open:!0,loading:!0}),this.load().then(()=>this.refresh(),()=>this.patch({loading:!1}))}close(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({open:!1,rowMenu:null,composing:!1,pendingSearch:!1}),this.holdingOps.clear()}async load(){try{let a=await W("/list");this.holdingOps.clear(),this.patch({items:ce(a.items)??[],seeded_at:a.seeded_at,loading:!1,loadError:null})}catch(a){throw this.patch({loading:!1,loadError:{code:a.code??"fuyao_unavailable"}}),a}}refresh(){if(this.pending!==null)return this.pending;this.patch({refreshing:!0});let a=W("/refresh",{body:{}}).then(i=>{let r={};for(let g of i.failures??[])r[g.thscode]=g.code;let s=ce(i.items),w=s??this.snapshot.items;s!==null&&this.holdingOps.clear(),this.patch({items:w,refreshed_at:i.refreshed_at??this.snapshot.refreshed_at,failures:r,error:i.error?{code:i.error.code,partial:w.length>0&&w.some(g=>r[g.thscode]===void 0)}:null})}).catch(i=>{this.patch({error:{code:i.code??"fuyao_unavailable",partial:this.snapshot.items.some(r=>r.quote!==null)}})}).finally(()=>{this.patch({refreshing:!1}),this.pending=null});return this.pending=a,a}onQueryChange(a,i){let r=a.trim(),s=i===void 0?this.snapshot.composing===!0:i===!0;if(this.patch({query:a,searchError:null,composing:s,dropdownOpen:r.length>0}),this.timer!==null&&clearTimeout(this.timer),r.length===0){this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1});return}r===this.lastQuery&&this.snapshot.pendingSearch===!1||(this.patch({candidates:[],truncated:!1,pendingSearch:!s}),s!==!0&&(this.timer=setTimeout(()=>this.search(r),Wt)))}beginComposition(){this.timer!==null&&clearTimeout(this.timer),this.patch({composing:!0})}endComposition(a){this.onQueryChange(a,!1)}hideDropdown(){this.patch({dropdownOpen:!1})}setMarketFilter(a){wt.some(i=>i.id===a)&&this.patch({marketFilter:a})}toggleRowMenu(a){this.patch({rowMenu:this.snapshot.rowMenu===a?null:a})}closeRowMenu(){this.snapshot.rowMenu!==null&&this.patch({rowMenu:null})}setPendingRemove(a){this.patch({pendingRemove:a??null})}replaceRow(a){let[i]=ce([a]);i===void 0||typeof i?.thscode!="string"||this.patch({items:this.snapshot.items.map(r=>r.thscode===i.thscode?i:r)})}async search(a){this.lastQuery=a,this.searchController!==null&&this.searchController.abort();let i=new AbortController;this.searchController=i,this.patch({searching:!0,searchError:null,searchPartial:null});let r=()=>this.snapshot.query.trim()===a;try{let s=await W("/search",{query:`q=${encodeURIComponent(a)}`,signal:i.signal});if(!r()){this.patch({searching:!1});return}this.patch({candidates:ce(s.items)??[],truncated:s.truncated===!0,searching:!1,pendingSearch:!1,searchPartial:Array.isArray(s.partial)&&s.partial.length>0?s.partial:null})}catch(s){if(s.name==="AbortError"||(this.lastQuery===a&&(this.lastQuery=null),!r()))return;this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1,searchError:{code:s.code??"fuyao_unavailable"},searchPartial:null})}}async add(a){try{await W("/add",{body:{thscode:a.thscode}})}catch(r){this.patch({addError:{code:r.code??"fuyao_unavailable",candidates:r.candidates,limit:r.limit}}),r.candidates!==void 0&&this.patch({candidates:r.candidates,truncated:!1});return}this.patch({addError:null,candidates:this.snapshot.candidates.map(r=>r.thscode===a.thscode?{...r,in_list:!0}:r)}),await this.load().catch(()=>{}),await this.refresh();let i=this.snapshot.items.find(r=>r.thscode===a.thscode);i!==void 0&&i.quote===null&&this.snapshot.failures[a.thscode]===void 0&&await this.refresh()}async remove(a){let i=this.snapshot.items;this.patch({items:i.filter(r=>r.thscode!==a),rowMenu:null});try{await W("/remove",{body:{thscode:a}}),this.snapshot.addError?.code==="list_full"&&this.patch({addError:null})}catch{this.patch({items:i})}}async pin(a){let i=this.snapshot.items,r=i.find(s=>s.thscode===a);if(r!==void 0){this.patch({items:[r,...i.filter(s=>s.thscode!==a)],rowMenu:null});try{let s=await W("/pin",{body:{thscode:a}});Array.isArray(s.items)&&this.patch({items:ce(s.items)})}catch{let s=this.snapshot.items,w=i.map(c=>s.find(d=>d.thscode===c.thscode)).filter(Boolean),g=new Set(w.map(c=>c.thscode));this.patch({items:[...w,...s.filter(c=>!g.has(c.thscode))]})}}}async writeHolding(a,i,r){let s=this.snapshot.items.find(d=>d.thscode===a);if(s===void 0)return;let w=this.holdingOps.get(a)??{seq:0,baseline:s};this.holdingOps.set(a,w);let g=++w.seq;this.patch({items:this.snapshot.items.map(d=>d.thscode===a?r(d):d)});let c=()=>this.holdingOps.get(a)!==w||w.seq!==g;try{let d=await W("/holding",{body:i});if(c())return;this.replaceRow(d.item),w.baseline=d.item??r(s),this.holdingOps.delete(a)}catch{if(c())return;this.replaceRow(w.baseline),this.holdingOps.delete(a)}}markHolding(a,i){return this.writeHolding(a,{thscode:a,weight_pct:i},r=>({...r,holding:{weight_pct:i,marked_at:Date.now()}}))}clearHolding(a){return this.writeHolding(a,{thscode:a,clear:!0},i=>{let r={...i};return delete r.holding,r})}stepHolding(a,i){let r=this.snapshot.items,s=r.find(g=>g.thscode===a)?.holding?.weight_pct;if(typeof s!="number"&&i<0)return;let w=Math.min(ht(r,a),Math.max(0,(typeof s=="number"?s:0)+i));if(w!==s)return this.markHolding(a,w)}async copyToClipboard(){let a=this.snapshot.items.map(i=>[i.thscode,xe(i.name),i.asset_type,i.quote?.price??"",i.quote?.change_pct??"",i.quote?.captured_at??""].join(" ")).join(`
258
+ `);return await navigator.clipboard.writeText(a),a}dispose(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort()}};function $e(t){if(typeof t!="number"||!Number.isFinite(t))return"";let a=new Date(t),i=r=>String(r).padStart(2,"0");return`${i(a.getMonth()+1)}-${i(a.getDate())} ${i(a.getHours())}:${i(a.getMinutes())}`}function Se({assetType:t,t:a}){return e("span",{className:`capital-watchlist-tag ${Jt[t]??"capital-watchlist-tag-cn"}`},ut(t,a))}function aa(t,a,i){let r=xe(t.name);return`${a(`${i}PromptPrefix`)}${r} (${t.thscode} \xB7 ${Xt(t.asset_type,a)})${a(`${i}PromptSuffix`)}`}function ia({quote:t,failureCode:a,refreshing:i,t:r}){let s=a!==void 0;if(t==null)return i===!0?e("div",{className:"capital-watchlist-quote"},e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-price"}),e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-change"})):s?e("div",{className:"capital-watchlist-quote",title:r(`error.${a}`)},e("div",{className:"capital-watchlist-price capital-watchlist-quotefailed"},"\u2014")):e("div",{className:"capital-watchlist-quote"},e("div",{className:"capital-watchlist-price"},r("notRefreshed")));let w=typeof t.change_pct=="number"&&Number.isFinite(t.change_pct),g=w?`${t.change_pct>0?"+":""}${t.change_pct.toFixed(2)}%`:"\u2014",c=s?"capital-watchlist-stale":w?t.change_pct>0?"capital-watchlist-up":t.change_pct<0?"capital-watchlist-down":"capital-watchlist-flat":"capital-watchlist-nodata",d=typeof t.source_time=="string"&&t.source_time.length>0?`${r("exchangeTime")} ${t.source_time}`:"",x=[];return s?x.push(`${r(`error.${a}`)} \xB7 ${r("stale")} ${$e(t.captured_at)}`):w||x.push(r("noChangePct")),d.length>0&&x.push(d),e("div",{className:"capital-watchlist-quote",title:x.length===0?void 0:x.join(" \xB7 ")},e("div",{className:s?"capital-watchlist-price capital-watchlist-stale":"capital-watchlist-price"},t.price.toFixed(2)),e("div",{className:`capital-watchlist-change ${c}`},g))}function sa(t,a){if(a.code!=="list_full")return t(`error.${a.code}`);let i=a.limit;return typeof i!="number"||!Number.isFinite(i)?t("error.list_full_noMax"):t("error.list_full").replace("{max}",String(i))}function la(t,a){let i=t?.weight_pct;return i==null?a("holdingName"):`${a("holdingName")} ${i}%`}function na(t,a){let i=`${t.name} ${t.ticker}`;return t.holding===null||t.holding===void 0?i:`${i} \xB7 ${la(t.holding,a)}`}function ra({useDialog:t,surface:a,t:i,inputActions:r}){let s=t(n=>n),[w,g]=A(!1),[c,d]=A(null),x=s.pendingRemove??null;if(ge(()=>()=>a.dispose(),[a]),!s.open)return null;let k=s.dropdownOpen===!0,S=x!==null,G=n=>{if(n.key==="Escape"){if(S){n.stopPropagation(),a.setPendingRemove(null);return}k&&(n.stopPropagation(),a.hideDropdown())}},N=n=>{if(!k)return;let C=n.relatedTarget;C!=null&&n.currentTarget?.contains?.(C)===!0||a.hideDropdown()},I=s.error,T=I==null?null:e("p",{className:"capital-watchlist-notice",role:"alert","data-code":I.code},`${i(`error.${I.code}`)}${I.partial===!0?i("errorSuffix"):""}`),q=(n,C)=>{r.insertText(aa(n,i,C),r.captureInsertion())===!0&&a.close()},H=s.marketFilter==="all"?s.candidates:s.candidates.filter(n=>at(n)===s.marketFilter),z={all:s.candidates.length,cn:0,hk:0,us:0};for(let n of s.candidates)z[at(n)]+=1;let V=s.candidates.length===0?null:e("div",{className:"capital-watchlist-filter",role:"group","aria-label":i("filterLabel")},wt.map(n=>e("button",{key:n.id,type:"button",className:"capital-watchlist-filterbtn","aria-pressed":s.marketFilter===n.id,onClick:()=>a.setMarketFilter(n.id)},e("span",{className:"capital-watchlist-filterlabel"},n.id==="all"?i("filterAll"):n.label),e("span",{className:"capital-watchlist-filtercount"},String(z[n.id]))))),ae=k?e("div",{className:"capital-watchlist-dropdown","aria-label":i("title"),"data-menu-material":"translucent"},V,e("div",{className:"capital-watchlist-options",role:"listbox","aria-label":i("title")},H.map(n=>e("button",{key:n.thscode,type:"button",role:"option",className:"capital-watchlist-option",title:n.name,"aria-disabled":n.in_list===!0||c===n.thscode,onClick:()=>{n.in_list===!0||c===n.thscode||(g(!0),d(n.thscode),a.add(n).finally(()=>{g(!1),d(null)}))}},e("span",{className:"capital-watchlist-optionmain"},e("span",{className:"capital-watchlist-optionname"},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-optioncode"},n.thscode),e(Se,{assetType:n.asset_type,t:i}))),e("span",{className:"capital-watchlist-addbtn","data-state":n.in_list===!0?"added":"idle"},n.in_list===!0?i("added"):i("add")))),s.truncated===!0&&H.length>0?e("div",{className:"capital-watchlist-hint capital-watchlist-endhint"},i("truncated")):null),s.composing===!0?e("div",{className:"capital-watchlist-hint"},i("composingHint")):s.searching===!0||s.pendingSearch===!0?e("div",{className:"capital-watchlist-hint"},i("searching")):s.searchError!==null&&s.searchError!==void 0?e("div",{className:"capital-watchlist-hint capital-watchlist-searcherror",role:"alert","data-code":s.searchError.code},i(`error.${s.searchError.code}`)):s.candidates.length===0?e("div",{className:"capital-watchlist-hint"},i("noHit")):H.length===0?e("div",{className:"capital-watchlist-hint","data-filter":s.marketFilter},i("filterNoHit")):null,...(s.searchPartial??[]).map(n=>e("div",{key:`partial-${n.market}`,className:"capital-watchlist-hint capital-watchlist-searcherror",role:"status","data-market":n.market,"data-code":n.code},`${i(`partial.${n.market}`)}${i(`error.${n.code}`)}`))):null,ie=s.items.length===0?null:e("div",{className:"capital-watchlist-grid capital-watchlist-head"},e("span",null,i("colName")),e("span",{className:"capital-watchlist-quote"},i("colQuote")),e("span",{className:"capital-watchlist-headaction"},i("colAction"))),X=s.loadError!==null&&s.loadError!==void 0?e("p",{className:"capital-watchlist-empty capital-watchlist-loaderror",role:"alert","data-code":s.loadError.code},i(`error.${s.loadError.code}`)):e("p",{className:"capital-watchlist-empty"},i("empty")),L=s.loading?e("p",{className:"capital-watchlist-empty"},i("loading")):s.items.length===0?X:e("div",{className:k?"capital-watchlist-list capital-watchlist-list-open":"capital-watchlist-list"},s.items.map((n,C)=>{let P=n.holding!==null&&n.holding!==void 0,$=n.holding?.weight_pct,F=Ze(n)||P,K=ht(s.items,n.thscode),R=!P||$===null||$===void 0||$<=0,Q=(typeof $=="number"?$:0)+Te>K;return e("div",{key:n.thscode,className:"capital-watchlist-grid capital-watchlist-row","data-thscode":n.thscode},e("span",{className:"capital-watchlist-namewrap"},e("span",{className:P?"capital-watchlist-name capital-watchlist-name-held":"capital-watchlist-name",title:na(n,i)},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-code"},n.ticker),e(Se,{assetType:n.asset_type,t:i}))),e(ia,{quote:n.quote,failureCode:s.failures[n.thscode],refreshing:s.refreshing,t:i}),e("span",{className:"capital-watchlist-rowactions"},e("button",{type:"button",className:"capital-watchlist-predict",disabled:w,title:i("predictTip"),"aria-label":`${i("predict")} ${n.name}`,onClick:()=>q(n,"predict")},e(ct,{size:14})),e("button",{type:"button",className:"capital-watchlist-review",disabled:w,title:i("reviewTip"),"aria-label":`${i("review")} ${n.name}`,onClick:()=>q(n,"review")},e(Dt,{size:14})),e(Oe,{open:s.rowMenu===n.thscode,anchor:e("button",{type:"button",className:"capital-watchlist-more",disabled:w,title:i("more"),"aria-label":`${i("more")} ${n.name}`,"aria-haspopup":"menu","aria-expanded":s.rowMenu===n.thscode,onClick:()=>a.toggleRowMenu(n.thscode)},e(ot,{size:14})),items:[{id:"pin",label:i("pin"),icon:e(dt,{size:14}),disabled:C===0}],children:[...F?[e("div",{key:"holding-check",role:"group","aria-label":i("holdingName"),className:"capital-watchlist-checkrow"},e("span",{className:"capital-watchlist-checkicon","aria-hidden":"true"},e(jt,{size:14})),e("span",{className:"capital-watchlist-checklabel"},i("holdingName")),e(qt,{checked:P,disabled:w,label:i("holdingName"),onChange:j=>j?a.markHolding(n.thscode,null):a.clearHolding(n.thscode)}))]:[],...P&&Ze(n)?[e("div",{key:"holding-step",className:"capital-watchlist-stepper",role:"group","aria-label":i("holdingStepper")},e("span",{className:"capital-watchlist-stepperlabel"},i("holdingWeightLabel")),e("span",{className:"capital-watchlist-stepperline"},e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepDown"),disabled:R,onClick:()=>a.stepHolding(n.thscode,-Te)},"\u2212"),e("span",{className:typeof $=="number"?"capital-watchlist-stepperreadout":"capital-watchlist-stepperreadout capital-watchlist-stepperplaceholder",role:"status"},typeof $=="number"?`${$}%`:`0~${K}`),e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepUp"),title:`0~${K}`,disabled:Q,onClick:()=>a.stepHolding(n.thscode,Te)},"+")))]:[],e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Fe,{size:14}),onSelect:()=>{a.closeRowMenu(),a.setPendingRemove(n)}},i("remove"))],onSelect:j=>{j==="pin"&&(a.closeRowMenu(),a.pin(n.thscode))},onClose:()=>a.closeRowMenu(),align:"end",portal:!0,listClassName:"capital-watchlist-rows",className:"capital-watchlist-actions"})))})),U=e("div",{className:S?"capital-watchlist-confirm capital-watchlist-confirm-open":"capital-watchlist-confirm","aria-hidden":S?void 0:"true"},e("div",{className:"capital-watchlist-confirmbox",role:S?"alertdialog":void 0,"aria-label":i("confirmTitle")},e("div",{className:"capital-watchlist-confirmtitle"},i("confirmTitle")),S?e("p",{className:"capital-watchlist-confirmdesc"},i("confirmDescPrefix"),e("strong",null,`${x.name} \xB7 ${x.ticker}`),i("confirmDescSuffix")):null,e("div",{className:"capital-watchlist-confirmactions"},e("button",{type:"button",className:"capital-watchlist-confirmbtn",onClick:()=>a.setPendingRemove(null)},i("confirmCancel")),e("button",{type:"button",className:"capital-watchlist-confirmbtn capital-watchlist-confirmdanger",onClick:()=>{let n=x;a.setPendingRemove(null),n!==null&&a.remove(n.thscode)}},i("confirmOk")))));return e(Gt,{open:!0,onClose:()=>a.close(),title:i("title"),headless:!0,shortcutModal:"watchlist",className:"capital-watchlist-dialog"},e("div",{className:"capital-watchlist-card",onKeyDown:G},e("div",{className:"capital-watchlist-header"},e("h2",{className:"capital-watchlist-title"},i("title")),e("button",{type:"button",className:"capital-watchlist-close","aria-label":i("close"),onClick:()=>a.close()},e(Xe,{size:14}))),e("div",{className:"capital-watchlist-search",onBlur:N},e("div",{className:"capital-watchlist-field"},e("span",{className:"capital-watchlist-searchicon"},e(pt,{size:16})),e("input",{className:"capital-watchlist-input","data-modal-autofocus":!0,value:s.query,placeholder:i("searchPlaceholder"),onChange:n=>a.onQueryChange(n.target.value,n.isComposing),onCompositionStart:()=>a.beginComposition(),onCompositionEnd:n=>a.endComposition(n.target.value)}),s.query.length>0?e("button",{type:"button",className:"capital-watchlist-clear",title:i("clearInput"),"aria-label":i("clearInput"),onMouseDown:n=>n.preventDefault(),onClick:()=>a.onQueryChange("",!1)},e(Xe,{size:12})):null),ae),s.addError!==null&&s.addError!==void 0?e("p",{className:"capital-watchlist-adderror",role:"status","data-code":s.addError.code},sa(i,s.addError)):null,ie,L,e("div",{className:"capital-watchlist-footer"},e("div",{className:"capital-watchlist-footcol"},e("button",{type:"button",className:"capital-watchlist-refresh",disabled:s.refreshing||w,onClick:()=>{a.refresh()}},e(Re,{size:14}),s.refreshing?i("refreshing"):i("refresh")),T),e("span",{className:"capital-watchlist-updated"},`${i("updated")} ${s.refreshed_at===null||s.refreshed_at===void 0?i("notRefreshed"):$e(s.refreshed_at)}`)),U))}var st=`${he}:desk`,mt="capital.watchlist.desk.groups.v1",ne="__all__",He=0,Pe=0;function oa(){let t={names:[],assignments:{}};try{let a=JSON.parse(localStorage.getItem(mt)??"{}");return a===null||typeof a!="object"||!Array.isArray(a.names)||a.assignments===null||typeof a.assignments!="object"?t:{names:a.names.filter(i=>typeof i=="string"&&i.length>0).slice(0,20),assignments:a.assignments}}catch{return t}}function ca(t){try{localStorage.setItem(mt,JSON.stringify(t))}catch{}}var Ee=(t,a)=>{let i=t.assignments[a];return Array.isArray(i)?i:[]},lt=t=>t!=null&&typeof t.change_pct=="number"&&Number.isFinite(t.change_pct)?t.change_pct:null,Le=t=>t===null?"cwd-flat":t>0?"cwd-up":t<0?"cwd-down":"cwd-flat",_e=t=>t===null?"\u2014":`${t>0?"+":""}${t.toFixed(2)}%`,ft=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),nt=t=>t!=null&&typeof t.price=="number"&&Number.isFinite(t.price)?ft.format(t.price):"\u2014",E=t=>typeof t=="number"&&Number.isFinite(t)?ft.format(t):"\u2014";function je(t,a=2){if(typeof t!="number"||!Number.isFinite(t))return"\u2014";let i=Math.abs(t);return i>=1e8?`${(t/1e8).toFixed(a)}\u4EBF`:i>=1e4?`${(t/1e4).toFixed(a)}\u4E07`:new Intl.NumberFormat("en-US",{maximumFractionDigits:a}).format(t)}var da=t=>typeof t=="string"&&t.length>=5?Number(t.slice(0,2))*60+Number(t.slice(3,5)):0;function De(t,a,i){let r=je(t);return r==="\u2014"?r:a==="lot"?`${r}${i("desk.lot")}`:a==="share"?`${r}${i("desk.share")}`:r}function pa(t,a){let i=je(t);return i==="\u2014"||a==null||a==="CNY"?i:`${i} ${a}`}var rt={"a-share":[[570,690],[780,900]],hk:[[570,720],[780,960]],us:[[570,960]]},ha=t=>`${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`;function ua(t){let a=[],i=0;for(let[r,s]of rt[t]??rt.us)a.push([r,s,i]),i+=s-r;return{spans:a,total:i}}function wa(t,a){for(let[i,r,s]of t.spans){if(a<=i)return s;if(a<r)return s+a-i}return t.total}function ma(t){let a=[];for(let[i,r,s]of t.spans)for(let w=i;w<=r;w+=30){let g=s+w-i;(a.length===0||a[a.length-1].slot!==g)&&a.push({time:ha(w),slot:g})}return a}function fa({data:t,t:a}){let[i,r]=A({width:720,height:300}),[s,w]=A(null),g=Ue(null);ge(()=>{let h=g.current;if(h==null)return;let p=()=>{let B=h.getBoundingClientRect();if(!(B.width>0)||!(B.height>0))return;let ee=Math.max(280,Math.round(B.width)),we=Math.max(180,Math.round(B.height));r(be=>Math.abs(be.width-ee)<2&&Math.abs(be.height-we)<2?be:{width:ee,height:we})};if(p(),typeof ResizeObserver>"u")return;let Y=new ResizeObserver(p);return Y.observe(h),()=>Y.disconnect()},[]);let c=t.points,d=t.prev_close,x=i.width,k=i.height,S=66,G=54,N=12,I=18,T=Math.round(Math.min(70,Math.max(30,k*.22))),q=Math.max(60,k-N-I-T-10),H=Math.max(60,x-S-G),z=ua(t.market),V=H/z.total,ae=c.map(h=>h[1]),ie=Math.min(d,...ae),X=Math.max(d,...ae),L=(X-ie)*.06||Math.max(X*.002,.01),U=ie-L,n=X+L,C=h=>N+(n-h)/(n-U)*q,P=c.map(h=>wa(z,da(h[0]))),$=h=>S+h*V,F=$(P[0]).toFixed(1),K=$(P[c.length-1]).toFixed(1),R=t.last===null||t.last>=d?"up":"down",Q=R==="up"?"var(--capital-watchlist-up)":"var(--capital-watchlist-down)",j=c.map((h,p)=>`${p===0?"M":"L"}${$(P[p]).toFixed(1)} ${C(h[1]).toFixed(1)}`).join(""),ue=(N+q).toFixed(1),b=`${j}L${K} ${ue}L${F} ${ue}Z`,se=c.reduce((h,p,Y)=>p[2]===null?h:`${h}${h===""?"M":"L"}${$(P[Y]).toFixed(1)} ${C(p[2]).toFixed(1)}`,""),Z=N+q+10,te=Math.max(1,...c.map(h=>h[3]??0)),le=Math.max(1,Math.min(10,V*.72)),re=C(d),ye=[0,1,2,3,4].map(h=>{let p=U+(n-U)*h/4;return{value:p,y:C(p),pct:(p-d)/d*100}}).filter(h=>Math.abs(h.y-re)>9),de=z.spans.length>1?z.spans[1][2]:null,o=ma(z),y=x>=620?1:2,O=o.filter((h,p)=>p%y===0||p===o.length-1),_=s===null||s<0||s>=c.length?null:c[s],J=_===null?0:$(P[s]),M=_===null?0:C(_[1]),pe=Math.min(x-172,Math.max(8,J+12)),ve=`${t.thscode} ${t.session_date??""} ${a("desk.intraday")} \xB7 ${a("desk.trendOpen")} ${E(t.open)} \xB7 ${a("desk.trendHigh")} ${E(t.high)} \xB7 ${a("desk.trendLow")} ${E(t.low)} \xB7 ${a("desk.trendAvg")} ${E(t.avg)}`,Ce=h=>{let p=h.currentTarget.getBoundingClientRect();if(!(p.width>0))return;let Y=Math.max(0,Math.min(z.total,(h.clientX-p.left-S)/H*z.total)),B=0;for(let ee=1;ee<P.length;ee+=1)Math.abs(P[ee]-Y)<Math.abs(P[B]-Y)&&(B=ee);w(B)};return e("div",{className:"cwd-chartbox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${x} ${k}`,role:"img","aria-label":ve,onPointerMove:Ce,onPointerLeave:()=>w(null)},e("defs",null,e("linearGradient",{id:"cwd-trend-fill",x1:"0",y1:"0",x2:"0",y2:"1"},e("stop",{offset:"0%",style:{stopColor:Q,stopOpacity:.2}}),e("stop",{offset:"100%",style:{stopColor:Q,stopOpacity:0}}))),ye.map(h=>e("g",{key:`grid-${h.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:S,x2:S+H,y1:h.y,y2:h.y}),e("text",{className:"cwd-chartaxis",x:S-8,y:h.y+3.5,textAnchor:"end"},E(h.value)),e("text",{className:"cwd-chartaxis",x:S+H+8,y:h.y+3.5},`${h.pct>0?"+":""}${h.pct.toFixed(2)}%`))),O.map(h=>e("line",{key:`grid-${h.time}`,className:"cwd-chartgrid",x1:$(h.slot),x2:$(h.slot),y1:N,y2:Z+T})),de===null?null:e("line",{className:"cwd-chartsep",x1:$(de),x2:$(de),y1:N,y2:Z+T}),e("path",{className:"cwd-chartarea",d:b,fill:"url(#cwd-trend-fill)"}),c.map((h,p)=>{let Y=h[3]??0,B=Math.max(0,Y/te*T),ee=p===0?d:c[p-1][1],we=$(P[p]+.5);return e("rect",{key:`vol-${p}`,className:h[1]>=ee?"cwd-vol-up":"cwd-vol-down",x:Math.min(S+H-le,Math.max(S,we-le/2)).toFixed(1),y:(Z+T-B).toFixed(1),width:le.toFixed(1),height:Math.max(.5,B).toFixed(1)})}),e("path",{className:"cwd-chartline",d:j,style:{stroke:Q}}),se===""?null:e("path",{className:"cwd-chartavg",d:se}),e("line",{className:"cwd-chartbase",x1:S,x2:S+H,y1:re,y2:re,strokeDasharray:"4 3"}),e("text",{className:"cwd-chartaxis cwd-chartbaselabel",x:S-8,y:re+3.5,textAnchor:"end"},E(d)),O.map(h=>e("text",{key:`tick-${h.time}`,className:"cwd-chartaxis",x:$(h.slot),y:k-5,textAnchor:h.slot===0?"start":h.slot>=z.total?"end":"middle"},h.time)),_===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:J,x2:J,y1:N,y2:Z+T}),e("line",{className:"cwd-chartcross",x1:S,x2:S+H,y1:M,y2:M}),e("circle",{className:`cwd-chartdot ${R==="up"?"cwd-up":"cwd-down"}`,cx:J,cy:M,r:3}))),_===null?null:e("div",{className:"cwd-charttip",style:{left:`${pe}px`}},e("div",{className:"cwd-charttiptime"},_[0]),e("div",{className:`cwd-charttipprice ${R==="up"?"cwd-up":"cwd-down"}`},`${E(_[1])} ${_e((_[1]-d)/d*100)}`),_[2]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendAvg")),e("span",null,E(_[2]))),_[3]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,De(_[3],t.volume_unit,a)))))}function gt(t,a){let i=new Array(t.length).fill(null),r=0;for(let s=0;s<t.length;s+=1)r+=t[s].close,s>=a&&(r-=t[s-a].close),s>=a-1&&(i[s]=r/a);return i}var xt=[5,10,20,60];function ga({data:t,t:a}){let[i,r]=A({width:720,height:300}),[s,w]=A(null),g=Ue(null);ge(()=>{let o=g.current;if(o==null)return;let y=()=>{let _=o.getBoundingClientRect();if(!(_.width>0)||!(_.height>0))return;let J=Math.max(280,Math.round(_.width)),M=Math.max(180,Math.round(_.height));r(pe=>Math.abs(pe.width-J)<2&&Math.abs(pe.height-M)<2?pe:{width:J,height:M})};if(y(),typeof ResizeObserver>"u")return;let O=new ResizeObserver(y);return O.observe(o),()=>O.disconnect()},[]);let c=t.bars,d=i.width,x=i.height,k=66,S=54,G=10,N=18,I=Math.round(Math.min(64,Math.max(28,x*.2))),T=Math.max(60,x-G-N-I-12),q=Math.max(60,d-k-S),H=q/Math.max(1,c.length),z=Math.max(1,Math.min(14,H*.62)),V=Math.max(...c.map(o=>o.high)),ae=Math.min(...c.map(o=>o.low)),ie=(V-ae)*.06||Math.max(V*.01,.01),X=V+ie,L=ae-ie,U=o=>G+(X-o)/(X-L)*T,n=o=>k+(o+.5)*H,C=G+T+12,P=Math.max(1,...c.map(o=>o.volume)),$=o=>o/P*I,F=xt.map(o=>({window:o,values:gt(c,o)})),K=o=>o.reduce((y,O,_)=>O===null?y:`${y}${y===""?"M":"L"}${n(_).toFixed(1)} ${U(O).toFixed(1)}`,""),R=[];for(let o=0;o<c.length;o+=1){let y=c[o].date.slice(5,7);(o===0||y!==c[o-1].date.slice(5,7))&&R.push({index:o,month:y})}let Q=R.length>1?(R[1].index-R[0].index)*H:Number.POSITIVE_INFINITY,j=R.map((o,y)=>({index:o.index,label:y===0&&Q>=56?`${c[o.index].date.slice(0,4)}/${o.month}`:o.month})),ue=[0,1,2,3,4].map(o=>{let y=X-(X-L)*o/4;return{value:y,y:U(y)}}),b=s===null||s<0||s>=c.length?null:c[s],se=b===null?0:n(s),Z=b===null?0:U(b.close),te=s===null||s<=0?null:c[s-1].close,le=b===null||te===null||te<=0?null:(b.close-te)/te*100,re=Math.min(d-186,Math.max(8,se+12)),ye=`${t.thscode} ${a("desk.daily")} \xB7 ${c.length} \xB7 ${E(c[c.length-1].close)}`,de=o=>{let y=o.currentTarget.getBoundingClientRect();if(!(y.width>0))return;let O=Math.round((o.clientX-y.left-k)/H-.5);w(Math.max(0,Math.min(c.length-1,O)))};return e("div",{className:"cwd-klinebox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${d} ${x}`,role:"img","aria-label":ye,onPointerMove:de,onPointerLeave:()=>w(null)},ue.map(o=>e("g",{key:`grid-${o.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:k,x2:k+q,y1:o.y,y2:o.y}),e("text",{className:"cwd-chartaxis",x:k-8,y:o.y+3.5,textAnchor:"end"},E(o.value)))),j.map(o=>e("g",{key:`tick-${o.index}`},e("line",{className:"cwd-chartgrid",x1:n(o.index),x2:n(o.index),y1:G,y2:C+I}),e("text",{className:"cwd-chartaxis",x:n(o.index),y:x-5,textAnchor:o.index===0?"start":"middle"},o.label))),c.map((o,y)=>{let O=Math.max(.5,$(o.volume));return e("rect",{key:`vol-${o.date}`,className:o.close>=o.open?"cwd-vol-up":"cwd-vol-down",x:(n(y)-z/2).toFixed(1),y:(C+I-O).toFixed(1),width:z.toFixed(1),height:O.toFixed(1)})}),e("text",{className:"cwd-chartaxis",x:k-8,y:C+8,textAnchor:"end"},je(P)),c.map((o,y)=>{let O=U(o.open),_=U(o.close),J=Math.min(O,_),M=Math.max(.8,Math.abs(_-O));return e("g",{key:`bar-${o.date}`,className:o.close>=o.open?"cwd-candle-up":"cwd-candle-down"},e("line",{x1:n(y).toFixed(1),x2:n(y).toFixed(1),y1:U(o.high).toFixed(1),y2:U(o.low).toFixed(1)}),e("rect",{x:(n(y)-z/2).toFixed(1),y:J.toFixed(1),width:z.toFixed(1),height:M.toFixed(1)}))}),F.map(o=>{let y=K(o.values);return y===""?null:e("path",{key:`ma-${o.window}`,className:`cwd-maline cwd-ma${o.window}`,d:y})}),b===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:se,x2:se,y1:G,y2:C+I}),e("line",{className:"cwd-chartcross",x1:k,x2:k+q,y1:Z,y2:Z}))),b===null?null:e("div",{className:"cwd-charttip",style:{left:`${re}px`}},e("div",{className:"cwd-charttiptime"},b.date),e("div",{className:`cwd-charttipprice ${Le(le)}`},`${E(b.close)} ${_e(le)}`),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kOpen")),e("span",null,E(b.open)),e("span",null,a("desk.kHigh")),e("span",null,E(b.high))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kLow")),e("span",null,E(b.low)),e("span",null,a("desk.kClose")),e("span",null,E(b.close))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,De(b.volume,t.volume_unit,a)))))}function xa({size:t=18}){return e("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e("path",{d:"M4 19V5"}),e("path",{d:"M4 19h16"}),e("path",{d:"m7 15 3-4 3 2 5-7"}),e("circle",{cx:18,cy:6,r:1.4,fill:"currentColor",stroke:"none"}))}function ba({t}){let[a,i]=A([]),[r,s]=A(!0),[w,g]=A(!1),[c,d]=A(null),[x,k]=A({}),[S,G]=A(null),[N,I]=A(oa),[T,q]=A(ne),[H,z]=A(!1),[V,ae]=A(""),[ie,X]=A(""),[L,U]=A(null),[n,C]=A(null),[P,$]=A(null),[F,K]=A({status:"idle",data:null,code:null,detail:null}),[R,Q]=A({status:"idle",data:null,code:null,detail:null}),[j,ue]=A(!1),b=Ue(!0);ge(()=>(b.current=!0,()=>{b.current=!1}),[]),ge(()=>{ca(N)},[N]);let se=l=>{let m=ce(l.items);Array.isArray(m)&&i(m);let f={};for(let u of l.failures??[])u!==null&&typeof u=="object"&&typeof u.thscode=="string"&&(f[u.thscode]=u.code);k(f),typeof l.refreshed_at=="number"&&d(l.refreshed_at),G(l.error!==void 0&&l.error!==null&&typeof l.error.code=="string"?l.error.code:null)},Z=async(l,m={})=>{if(typeof l!="string"||l.length===0){K({status:"idle",data:null,code:null,detail:null}),Q({status:"idle",data:null,code:null,detail:null});return}let f=He+=1;K(u=>({status:"loading",data:u.data!==null&&u.data.thscode===l?u.data:null,code:null,detail:null}));try{let u=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,v=await W("/trend",{query:u});if(!b.current||f!==He)return;K({status:"ready",data:v,code:null,detail:null})}catch(u){if(!b.current||f!==He)return;let v=typeof u?.code=="string"?u.code:"trend_unavailable",D=typeof u?.detail=="string"&&u.detail.length>0?u.detail:null;K({status:v==="trend_unavailable"?"unavailable":"error",data:null,code:v,detail:D})}},te=async(l,m={})=>{if(typeof l!="string"||l.length===0){Q({status:"idle",data:null,code:null,detail:null});return}let f=Pe+=1;Q(u=>({status:"loading",data:u.data!==null&&u.data.thscode===l?u.data:null,code:null,detail:null}));try{let u=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,v=await W("/kline",{query:u});if(!b.current||f!==Pe)return;Q({status:"ready",data:v,code:null,detail:null})}catch(u){if(!b.current||f!==Pe)return;let v=typeof u?.code=="string"?u.code:"kline_unavailable",D=typeof u?.detail=="string"&&u.detail.length>0?u.detail:null;Q({status:v==="kline_unavailable"?"unavailable":"error",data:null,code:v,detail:D})}},le=l=>{U(l),Z(l),te(l)};ge(()=>{let l=!1;return(async()=>{try{let f=await W("/list");if(l)return;let u=ce(f.items)??[];i(u);let v=typeof u[0]?.thscode=="string"?u[0].thscode:null;U(D=>D!==null?D:v),v!==null&&(Z(v),te(v))}catch(f){l||G(f.code??"load_failed");return}finally{l||s(!1)}try{let f=await W("/refresh",{body:{}});l||se(f)}catch(f){l||G(f.code??"fuyao_unavailable")}})(),()=>{l=!0}},[]);let re=async()=>{if(!w){g(!0);try{let l=await W("/refresh",{body:{}});b.current&&se(l),b.current&&L!==null&&(Z(L,{bust:!0}),te(L,{bust:!0}))}catch(l){b.current&&G(l.code??"fuyao_unavailable")}finally{b.current&&g(!1)}}},ye=async l=>{let m=a;C(null),i(m.filter(f=>f.thscode!==l)),L===l&&(U(null),K({status:"idle",data:null,code:null,detail:null}));try{await W("/remove",{body:{thscode:l}})}catch{b.current&&i(m)}},de=async l=>{let m=a,f=m.find(u=>u.thscode===l);if(f!==void 0){i([f,...m.filter(u=>u.thscode!==l)]);try{let u=await W("/pin",{body:{thscode:l}});Array.isArray(u.items)&&b.current&&i(ce(u.items))}catch{b.current&&i(m)}}},o=()=>{let l=V.trim();l.length===0||l===ne||N.names.includes(l)||(I({names:[...N.names,l],assignments:N.assignments}),ae(""),q(l))},y=l=>{if(l===ne)return;let m={};for(let[f,u]of Object.entries(N.assignments)){let v=(Array.isArray(u)?u:[]).filter(D=>D!==l);v.length>0&&(m[f]=v)}I({names:N.names.filter(f=>f!==l),assignments:m}),q(ne),z(!1)},O=(l,m)=>{let f=Ee(N,l),u=f.includes(m)?f.filter(D=>D!==m):[...f,m],v={...N.assignments};u.length===0?delete v[l]:v[l]=u,I({names:N.names,assignments:v})},_=ie.trim().toLowerCase(),J=a.filter(l=>T!==ne&&!Ee(N,l.thscode).includes(T)?!1:_.length===0?!0:[l.name,l.thscode,l.ticker].some(m=>typeof m=="string"&&m.toLowerCase().includes(_))),M=L===null?null:a.find(l=>l.thscode===L)??null,pe=[{id:ne,label:t("desk.allGroups"),icon:T===ne?e(ke,{size:14}):void 0}].concat(N.names.map(l=>({id:l,label:l,icon:T===l?e(ke,{size:14}):void 0}))),ve=l=>{if(F.status!=="ready"||F.data===null||F.data.thscode!==l.thscode||typeof F.data.last!="number")return l.quote;let m=F.data.prev_close;return{price:F.data.last,change_pct:m>0?(F.data.last-m)/m*100:null}},Ce=J.map((l,m)=>{let f=ve(l),u=lt(f),v=x[l.thscode],D=Ee(N,l.thscode),qe=L===l.thscode,Be=v===void 0?void 0:t(`error.${v}`),Ae=P===l.thscode;return e("div",{key:l.thscode,className:"cwd-row",role:"listitem","aria-current":qe?"true":void 0,onClick:oe=>{oe.target.closest(".cwd-rowactions")===null&&le(l.thscode)}},e("button",{type:"button",className:"cwd-cellname","aria-pressed":qe,onClick:()=>le(l.thscode)},e("span",{className:"cwd-nameline"},e("span",{className:"cwd-nametext",title:l.name},xe(l.name)),e(Se,{assetType:l.asset_type,t})),e("span",{className:"cwd-codeline"},e("span",{className:"cwd-code"},l.thscode))),e("div",{className:v===void 0?"cwd-price":"cwd-price cwd-stale",title:Be},nt(f)),e("div",{className:`cwd-pct ${Le(u)}`,title:Be},_e(u)),e("div",{className:"cwd-rowactions"},e(Oe,{open:Ae,anchor:e("button",{type:"button",className:"cwd-iconbtn",title:t("desk.more"),"aria-label":`${t("desk.more")} ${l.name}`,"aria-haspopup":"menu","aria-expanded":Ae,onClick:()=>{C(null),$(Ae?null:l.thscode)}},e(ot,{size:16})),items:[{id:"pin",label:t("desk.pin"),icon:e(dt,{size:14}),disabled:m===0}],children:[...N.names.length===0?[e("div",{key:"no-group",className:"cwd-menuhint"},t("desk.noGroupYet"))]:N.names.map(oe=>e(Ne,{key:`group:${oe}`,icon:D.includes(oe)?e(ke,{size:14}):void 0,onSelect:()=>O(l.thscode,oe)},oe)),e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Fe,{size:14}),onSelect:()=>{$(null),C(l)}},t("desk.remove"))],onSelect:oe=>{oe==="pin"&&($(null),de(l.thscode))},onClose:()=>$(null),align:"end",portal:!0,listClassName:"cwd-menulist"})))}),h=r?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.loading"))):a.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.empty")),e("p",{className:"cwd-emptyhint"},t("desk.emptyHint"))):J.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.noMatch")),e("p",{className:"cwd-emptyhint"},t("desk.noMatchHint"))):e("div",{className:"cwd-tablebody",role:"list","aria-label":t("desk.title")},Ce),p=F.status==="ready"?F.data:null,Y=p!==null&&M!==null&&p.thscode===M.thscode&&typeof p.last=="number",B=M===null?null:ve(M),ee=lt(B),we=Y?p.points[p.points.length-1][0]:null,be=Y&&p.market==="us"?` ${t("desk.trendZoneUs")}`:"",bt=Y?`${String(p.session_date??"").slice(5)} ${we}${be}`.trim():M===null||M.quote===null||M.quote===void 0?t("desk.notRefreshed"):$e(M.quote.captured_at)||t("desk.notRefreshed"),Me=p===null||p.market==="a-share"?"":` ${t(p.market==="us"?"desk.trendZoneUs":"desk.trendZoneHk")}`,yt=p===null?F.status==="loading"?t("desk.trendLoading"):F.status==="error"?t("desk.trendError"):"":p.session_status==="live"?`${p.stale?t("desk.trendStale"):t("desk.trendLive")}${Me} \xB7 ${p.points[p.points.length-1][0]}`:p.session_status==="closed"?`${p.session_date??""} ${t("desk.trendClosed")}${Me}`:`${t("desk.trendPrevious")} ${p.session_date??""}${Me}`,vt=p===null?null:e("div",{className:"cwd-trendstats"},...[[t("desk.trendOpen"),E(p.open)],[t("desk.trendHigh"),E(p.high)],[t("desk.trendLow"),E(p.low)],[t("desk.trendAvg"),E(p.avg)],[t("desk.trendVolume"),De(p.volume,p.volume_unit,t)],[t("desk.trendAmount"),pa(p.amount,p.currency)]].map(([l,m])=>e("div",{key:l,className:"cwd-trendstat"},e("span",null,l),e("span",{title:m},m)))),Ge=(l,m,f=null)=>{let u=l.status==="error"?m.error:l.status==="loading"?m.loading:m.unavailable,v=l.status==="error"?l.detail:l.status==="unavailable"?m.hint:null,D=l.status==="error"&&f!==null;return e("div",{className:D?"cwd-chart cwd-chartfail":"cwd-chart"},e("div",{className:"cwd-fallback"},e("div",{className:"cwd-charttext"},u),v==null||v.length===0?null:e("div",{className:"cwd-charthint"},v),D?e("button",{type:"button",className:"cwd-retry",onClick:f.onClick},e(Re,{size:14}),e("span",null,t("desk.retry"))):null))},kt=p!==null?e(fa,{key:p.thscode,data:p,t}):Ge(F,{error:t("desk.trendError"),loading:t("desk.trendLoading"),unavailable:t("desk.trendUnavailable"),hint:t("desk.trendUnavailableHint")},{onClick:()=>{Z(L,{bust:!0})}}),me=R.status==="ready"&&Array.isArray(R.data?.bars)&&R.data.bars.length>0?R.data:null,Nt=me===null?R.status==="loading"?t("desk.klineLoading"):R.status==="error"?t("desk.klineError"):"":t("desk.adjustQfq"),$t=me===null?null:e("div",{className:"cwd-malegend"},...xt.map(l=>{let m=gt(me.bars,l),f=m[m.length-1];return e("span",{key:l,className:`cwd-malegenditem cwd-ma${l}`},`MA${l} ${f==null?"\u2014":E(f)}`)})),St=me!==null?e(ga,{key:me.thscode,data:me,t}):Ge(R,{error:t("desk.klineError"),loading:t("desk.klineLoading"),unavailable:t("desk.klineUnavailable"),hint:t("desk.klineUnavailableHint")},{onClick:()=>{te(L,{bust:!0})}}),_t=e("div",{className:"cwd-block cwd-block-kline"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.daily")),$t,e("span",{className:"cwd-blocknote"},Nt)),St),Ct=M===null?e("div",{className:"cwd-card"},e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.selectHint")),e("p",{className:"cwd-emptyhint"},t("desk.selectHintBody")))):e("div",{className:"cwd-card"},e("div",{className:"cwd-detail"},e("div",{className:"cwd-detailhead"},e("div",{style:{minWidth:0}},e("div",{className:"cwd-detailname"},e("span",{className:"cwd-detailtext",title:M.name},xe(M.name)),e(Se,{assetType:M.asset_type,t})),e("div",{className:"cwd-detailcode"},M.thscode))),e("div",{className:"cwd-quoterow"},e("div",{className:"cwd-bigquote"},e("span",{className:"cwd-bigprice"},nt(B)),e("span",{className:`cwd-bigpct ${Le(ee)}`},_e(ee))),e("div",{className:"cwd-meta"},e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},t("desk.capturedAt")),e("div",{className:"cwd-metavalue"},bt)),e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},t("desk.kind")),e("div",{className:"cwd-metavalue"},ut(M.asset_type,t))))),e("div",{className:j?"cwd-block cwd-block-chart cwd-folded":"cwd-block cwd-block-chart"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.intraday")),j?null:vt,e("span",{className:"cwd-blocknote"},yt),e("button",{type:"button",className:"cwd-blockfold","aria-expanded":j?"false":"true",onClick:()=>ue(!j)},t(j?"desk.unfold":"desk.fold"))),j?null:kt),_t));return e("div",{className:"cwd-page"},e("div",{className:"cwd-inner"},e("header",{className:"cwd-head"},e("h1",{className:"cwd-title"},t("desk.title")),e("div",{className:"cwd-headactions"},e("span",{className:"cwd-updated"},`${t("desk.lastUpdate")} ${c===null?t("desk.notRefreshed"):$e(c)}`),e("button",{type:"button",className:"cwd-refresh",disabled:w,onClick:()=>{re()}},e(Re,{size:14}),t(w?"desk.refreshing":"desk.refresh")))),e("div",{className:"cwd-body"},e("section",{className:"cwd-card"},e("div",{className:"cwd-toolbar"},e("label",{className:"cwd-field"},e(pt,{size:14}),e("input",{type:"text",value:ie,placeholder:t("desk.filterPlaceholder"),"aria-label":t("desk.filter"),onChange:l=>X(l.target.value)})),e(Oe,{open:H,anchor:e("button",{type:"button",className:"cwd-pill","aria-haspopup":"menu","aria-expanded":H,"aria-label":t("desk.group"),onClick:()=>z(!H)},e(ct,{size:14}),e("span",null,T===ne?t("desk.allGroups"):T)),items:pe,children:T===ne?[]:[e(Ne,{key:"delete-group",danger:!0,separatorBefore:!0,icon:e(Fe,{size:14}),onSelect:()=>y(T)},t("desk.deleteGroup"))],onSelect:l=>{z(!1),q(l)},onClose:()=>z(!1),align:"start",portal:!0,listClassName:"cwd-menulist"}),e("div",{className:"cwd-groupcreate"},e("input",{type:"text",value:V,maxLength:20,placeholder:t("desk.newGroup"),"aria-label":t("desk.newGroup"),onChange:l=>ae(l.target.value),onKeyDown:l=>{l.key==="Enter"&&o()}}),e("button",{type:"button",className:"cwd-pill",disabled:V.trim().length===0,onClick:o},t("desk.createGroup")))),S===null?null:e("div",{className:"cwd-error",role:"alert"},t(S==="load_failed"?"desk.loadFailed":`error.${S}`)),n===null?null:e("div",{className:"cwd-notice cwd-notice-danger"},e("span",null,`${t("desk.removeHint")} \xB7 ${xe(n.name)}`),e("button",{type:"button",className:"cwd-pill",onClick:()=>C(null)},t("desk.cancel"))),e("div",{className:"cwd-thead",role:"row"},e("span",null,t("desk.colName")),e("span",{className:"cwd-right"},t("desk.colPrice")),e("span",{className:"cwd-right"},t("desk.colChange")),e("span",{className:"cwd-right"},t("desk.colAction"))),h),e("aside",null,Ct))))}function ya(t){t.effect(ta,`${he}: styles`),t.effect(()=>t.locale.register(fe,{zh:Kt,en:Qt}),`${he}: dictionaries`);let a=new Map,i=c=>{let d=a.get(c);return d===void 0&&(d=new Ie,a.set(c,d)),d};t.effect(()=>()=>{for(let c of a.values())c.dispose();a.clear()},`${he}: per-session surfaces`);let r=c=>{let x=t.sessions?.list?.getSnapshot?.().byId?.[c]?.projectionValues?.agentPreset;return typeof x=="string"?x:void 0},s=new Set,w=c=>{let d=r(c);return d!==void 0?d===Bt:(s.has(c)||(s.add(c),Promise.resolve(t.sessions?.refreshProjections?.(c)).catch(()=>{})),!1)};t.slots.inject(Je,()=>t.slots.register({name:Je,id:"capital-watchlist-dialog",order:3,locale:fe,inject:c=>{let d=i(c);return{hooks:{dialog:d.state},surface:d}}},ra));let g=t.locale.bind(fe);t.slots.inject("main",()=>t.slots.register({name:"main",key:st,locale:fe},ba)),t.slots.inject("sidebar.panellist",()=>t.slots.register({name:"sidebar.panellist",id:st,order:12,locale:fe,label:()=>g("desk.panel")},xa)),t.inject(["commandUi"],c=>{let d=t.locale.bind(fe);c.effect(()=>c.commandUi.register({name:"watchlist",label:()=>d("command.label"),description:()=>d("command.description"),icon:ke,available:x=>w(x.sessionId),ui:{kind:"action",run:x=>{i(x.sessionId).open()}}}),`${he}: /watchlist contribution`)}),t.logger?.info?.(`${he}: \u5BA2\u6237\u7AEF\u534A\u8FB9\u5DF2\u6302\u8F7D\uFF08/watchlist \u83DC\u5355\u884C + \u81EA\u9009\u80A1\u5F39\u7A97\uFF09`)}exports.name=he;exports.inject=["slots","locale","commandUi","sessions"];exports.apply=ya;
211
259
  return module.exports
212
260
  },
213
261
  })