@eaera-com/eaera-widgets-v2 0.1.84 → 0.1.86

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.
Files changed (45) hide show
  1. package/dist/components/base/EaeraPagination.mjs +1 -1
  2. package/dist/components/base/EaeraSelect.d.ts +8 -0
  3. package/dist/components/base/EaeraSelect.mjs +1 -1
  4. package/dist/components/base/EaeraSelectStatus.mjs +1 -1
  5. package/dist/components/base/EaeraSelectTag.mjs +1 -1
  6. package/dist/components/chunks/{EaeraDynamicFieldRow-C-VUPCvg.mjs → EaeraDynamicFieldRow-8-utCowK.mjs} +1 -1
  7. package/dist/components/chunks/{EaeraForm-DRMCdjw4.mjs → EaeraForm-DxThA46e.mjs} +1 -1
  8. package/dist/components/chunks/{EaeraPagination-BKcbraqK.mjs → EaeraPagination-7pSl3EwP.mjs} +1 -1
  9. package/dist/components/chunks/EaeraSelect-C-sln89V.mjs +1 -0
  10. package/dist/components/chunks/{EaeraSelectStatus-DF8-Svsr.mjs → EaeraSelectStatus-BMiT4W5a.mjs} +1 -1
  11. package/dist/components/chunks/{EaeraSelectTag-fwPFHO14.mjs → EaeraSelectTag-4WtAOO7m.mjs} +1 -1
  12. package/dist/components/chunks/EaeraTableV2-CIeL4xlB.mjs +1 -0
  13. package/dist/components/chunks/{EaeraWidgetGrowthBalanceProfitChart-nW-rAuUt.mjs → EaeraWidgetGrowthBalanceProfitChart-BK2uhXA1.mjs} +1 -1
  14. package/dist/components/chunks/{EaeraWidgetMarginCalculator-BoV_EWi6.mjs → EaeraWidgetMarginCalculator-Co6Vnjv1.mjs} +1 -1
  15. package/dist/components/chunks/{EaeraWidgetPositionCalculator-DVbflfoJ.mjs → EaeraWidgetPositionCalculator-_DmVt9Os.mjs} +1 -1
  16. package/dist/components/chunks/index-2xA6k2YN.mjs +1 -0
  17. package/dist/components/chunks/{index-Bva_01ak.mjs → index-9V1MulD6.mjs} +1 -1
  18. package/dist/components/chunks/{index-C95yVkcL.mjs → index-B97jyUEn.mjs} +1 -1
  19. package/dist/components/chunks/{index-4sT0yI4F.mjs → index-Bi7fGqMj.mjs} +1 -1
  20. package/dist/components/chunks/{index-DD9Bx0uF.mjs → index-ClzOcTL5.mjs} +1 -1
  21. package/dist/components/chunks/{index-CdY_wl4g.mjs → index-u4AYhvi2.mjs} +1 -1
  22. package/dist/components/composite/EaeraDynamicFieldRow.mjs +1 -1
  23. package/dist/components/composite/EaeraForm.mjs +1 -1
  24. package/dist/components/composite/EaeraTableV2.mjs +1 -1
  25. package/dist/components/custom/EaeraWidgetBasicTradingStatistics.mjs +1 -1
  26. package/dist/components/custom/EaeraWidgetEconomicInsight.mjs +1 -1
  27. package/dist/components/custom/EaeraWidgetGrowthBalanceProfitChart.mjs +1 -1
  28. package/dist/components/custom/EaeraWidgetHeader.mjs +1 -1
  29. package/dist/components/custom/EaeraWidgetIframe.mjs +1 -1
  30. package/dist/components/custom/EaeraWidgetMarginCalculator.mjs +1 -1
  31. package/dist/components/custom/EaeraWidgetPositionCalculator.mjs +1 -1
  32. package/dist/components/custom/EaeraWidgetTechnicalViews.mjs +1 -1
  33. package/dist/components/index.mjs +1 -1
  34. package/dist/components/webtrade/EaeraCfdOrderPlacement.mjs +1 -1
  35. package/dist/components/webtrade/EaeraCfdWatchlist.mjs +1 -1
  36. package/dist/components/webtrade/EaeraOrderPlacement.mjs +1 -1
  37. package/dist/components/webtrade/EaeraTimeNSales.mjs +1 -1
  38. package/dist/components/webtrade/EaeraTradingTable.mjs +1 -1
  39. package/dist/components/webtrade/EaeraWatchlist.mjs +1 -1
  40. package/dist/eaera-widgets-v2.es.js +4090 -4076
  41. package/dist/eaera-widgets-v2.umd.cjs +13 -13
  42. package/package.json +1 -1
  43. package/dist/components/chunks/EaeraSelect-BxZRZofe.mjs +0 -1
  44. package/dist/components/chunks/EaeraTableV2-CyfoAwDF.mjs +0 -1
  45. package/dist/components/chunks/index-CLfZnTKh.mjs +0 -1
@@ -1 +1 @@
1
- import{ref as e,watch as a,computed as l,provide as s,inject as t,defineComponent as o,shallowRef as i,openBlock as n,createElementBlock as r,createElementVNode as m,createVNode as c,unref as d,createSlots as u,withCtx as p,renderSlot as v,normalizeStyle as b,toDisplayString as _,Fragment as y,renderList as g,normalizeClass as f,createBlock as S,resolveDynamicComponent as w,onMounted as z,nextTick as k,onBeforeUnmount as T,useSlots as L,normalizeProps as N,guardReactiveProps as E}from"vue";import{a as C}from"./vendor-vueuse-core-B96HGhR7.mjs";import{useI18n as V}from"vue-i18n";import"element-plus";import"element-plus/es";import{ChevronUp as x,ChevronDown as O,Search as j}from"@lucide/vue";import"./vendor-email-misspelled-0hsXkSSK.mjs";import{_ as F}from"./EaeraInput-CkbcAxy0.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import P from"../composite/EaeraDropdownV2.mjs";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import"./vendor-sortablejs-D3DyHO5Y.mjs";import{_ as H}from"./EaeraTableV2-CyfoAwDF.mjs";const M=Symbol("EAERA_TIME_N_SALES_CONTEXT_KEY"),$=(t,o)=>{const{t:i}=V(),n=e(t.searchValue),r=e(t.minTradeSize),m=e(!1);a(()=>t.searchValue,e=>{n.value=e}),a(()=>t.minTradeSize,e=>{r.value=e});const c=(e,a)=>{const l=i(e);return"string"==typeof l&&l.trim().length>0?l:a},d=l(()=>[{key:"date",label:c("time-and-sales.table.date","Date"),minWidth:50},{key:"time",label:c("time-and-sales.table.time","Time"),minWidth:60},{key:"price",label:c("time-and-sales.table.price","Price"),minWidth:70,align:"right"},{key:"size",label:c("time-and-sales.table.size","Size"),minWidth:50,align:"right"}].map(e=>({...e,cellClass:"fs-10",cell:{dataClass:"text-primary"}}))),u=l(()=>({searchValue:n.value,minTradeSize:r.value,showingDropdown:m.value}));a(u,e=>{o("stateChange",e)},{immediate:!0});const p={searchValue:l({get:()=>n.value,set:e=>{n.value=e,o("update:searchValue",e)}}),searchPlaceholder:l(()=>t.searchPlaceholder??""),searchOptions:l(()=>t.searchOptions??[]),selectedSearchOption:l(()=>t.selectedSearchOption??""),loadingSearchOptions:l(()=>t.loadingSearchOptions??!1),minTradeSize:l({get:()=>r.value,set:e=>{r.value=e,o("update:minTradeSize",e)}}),minTradeSizePlaceholder:l(()=>t.minTradeSizePlaceholder||c("time-and-sales.table.size","Size")),rows:l(()=>t.rows??[]),fields:l(()=>t.fields&&t.fields.length>0?t.fields:d.value),tableHeight:l(()=>Number(t.tableHeight)||0),tableMaxHeight:l(()=>`${Math.max((Number(t.tableHeight)||0)-16,0)}px`),loading:l(()=>t.loading??!1),fetchingSymbolLabel:l(()=>t.fetchingSymbolLabel||c("market.search.fetching-symbol","Fetching symbol")),symbolNotFoundLabel:l(()=>t.symbolNotFoundLabel||c("market.search.symbol-not-found","Symbol not found")),emptyLabel:l(()=>t.emptyLabel||c("time-and-sales.table.empty","No data")),showingDropdown:l({get:()=>m.value,set:e=>{m.value=e}}),state:u,onResize:(e,a)=>o("resize",e,a),onSelectSearchOption:e=>o("select-search-option",e),onLoadMore:()=>o("load-more")};return s(M,p),p},D=()=>{const e=t(M);if(!e)throw new Error("useEaeraTimeNSales must be used inside EaeraTimeNSales");return e},R={class:"custom-time-n-sales-search__row"},W={class:"custom-time-n-sales-search__symbol-field"},A={class:"custom-time-n-sales-search__dropdown-anchor"},I={key:0,class:"custom-time-n-sales-search__empty body-sm text-placeholder"},B={key:0},q={key:1},U={key:1,class:"custom-time-n-sales-search__option-list"},K=["onClick"],X={class:"body-md__w"},Y={class:"body-sm"},G={class:"custom-time-n-sales-search__size-field"},J={class:"custom-time-n-sales-search__size-icons"},Q=o({__name:"EaeraTimeNSalesSearch",setup(s){const{searchValue:t,searchPlaceholder:o,searchOptions:z,selectedSearchOption:k,loadingSearchOptions:T,minTradeSize:L,minTradeSizePlaceholder:N,fetchingSymbolLabel:E,symbolNotFoundLabel:V,showingDropdown:H,onSelectSearchOption:M}=D(),$=i(null),Q=e(),{width:Z}=C($),ee=l(()=>`${Math.max(Z.value,200)}px`),ae=e(t.value),le=e(!1),se=l({get:()=>L.value,set:e=>{L.value=e}});a(t,e=>{ae.value=e});const te=e=>{le.value||(t.value=e)},oe=()=>{le.value=!0},ie=e=>{t.value=e.data},ne=e=>{le.value=!1;const a=e.data??ae.value;t.value=a},re=e=>{M(e)},me=e=>{H.value=e},ce=()=>{L.value=(e=>{const a=Number(e);return!Number.isFinite(a)||a<1?"":`${a}`})(L.value)},de=()=>{const e=Number(L.value||"1"),a=Number.isFinite(e)&&e>=1?e:1;L.value=`${a+1}`},ue=()=>{const e=Number(L.value||"1"),a=Number.isFinite(e)&&e>=1?e:1;L.value=`${Math.max(1,a-1)}`},he=l(()=>[{value:"up",icon:x,onClick:de},{value:"down",icon:O,onClick:ue}]);return a(t,e=>{e?Q.value?.openDropdown():Q.value?.closeDropdown()},{immediate:!0}),(e,a)=>(n(),r("div",{ref_key:"searchRef",ref:$,class:"custom-time-n-sales-search"},[m("div",R,[m("div",W,[c(d(F),{modelValue:ae.value,"onUpdate:modelValue":a[0]||(a[0]=e=>ae.value=e),placeholder:d(o),clearable:"",class:"watchlist-input custom-time-n-sales-search__symbol-input",onInput:te,onCompositionstart:oe,onCompositionupdate:ie,onCompositionend:ne},u({_:2},[d(t)?void 0:{name:"suffix",fn:p(()=>[c(d(j),{size:16,class:"icon-primary"})]),key:"0"}]),1032,["modelValue","placeholder"]),m("div",A,[c(d(P),{ref_key:"dropdownRef",ref:Q,trigger:"click",placement:"bottom-start",class:"custom-time-n-sales-search__dropdown",onVisibleChange:me},{dropdown:p(()=>[v(e.$slots,"dropdown",{options:d(z),selected:d(k),minWidth:ee.value,loading:d(T),fetchingSymbolLabel:d(E),symbolNotFoundLabel:d(V),selectOption:re},()=>[m("div",{class:"custom-time-n-sales-search__dropdown-panel",style:b({minWidth:ee.value})},[d(T)||!d(z).length?(n(),r("div",I,[d(T)?(n(),r("div",B,_(d(E)),1)):(n(),r("div",q,_(d(V)),1))])):(n(),r("div",U,[(n(!0),r(y,null,g(d(z),e=>(n(),r("div",{key:e.value,class:f(["custom-time-n-sales-search__option",e.value===d(k)&&"is-selected"]),onClick:a=>re(e.value)},[m("div",X,_(e.label),1),m("div",Y,_(e.description),1)],10,K))),128))]))],4)])]),default:p(()=>[a[2]||(a[2]=m("div",{class:"custom-time-n-sales-search__dropdown-trigger"},null,-1))]),_:3},512)])]),m("div",G,[c(d(F),{modelValue:se.value,"onUpdate:modelValue":a[1]||(a[1]=e=>se.value=e),class:"watchlist-input custom-time-n-sales-search__size-input",placeholder:d(N),onChange:ce,onInput:ce},{suffix:p(()=>[m("div",J,[(n(!0),r(y,null,g(he.value,e=>(n(),S(w(e.icon),{key:e.value,size:12,class:"icon-primary custom-time-n-sales-search__size-icon",onClick:e.onClick},null,8,["onClick"]))),128))])]),_:1},8,["modelValue","placeholder"])])])],512))}}),Z={class:"custom-time-n-sales-table"},ee=o({__name:"EaeraTimeNSalesTable",setup(a){const{rows:l,fields:s,tableMaxHeight:t,loading:o,emptyLabel:u,onLoadMore:v}=D(),b=e(),y=i(null),g=()=>{const e=y.value;e&&((e,a=50)=>{const{scrollTop:l,clientHeight:s,scrollHeight:t}=e;return l+s>=t-a})(e)&&v()},f=()=>{g()};let S=null;const w=()=>{null==S&&(S=requestAnimationFrame(()=>{S=null,g()}))};return z(async()=>{await k(),(()=>{const e=b.value?.$el;if(!e)return;const a=e.querySelector(".el-scrollbar__wrap");a&&(y.value=a,a.addEventListener("scroll",f,{passive:!0}),a.addEventListener("wheel",w,{passive:!0}))})()}),T(()=>{(()=>{const e=y.value;e&&(e.removeEventListener("scroll",f),e.removeEventListener("wheel",w),y.value=null)})(),null!=S&&(cancelAnimationFrame(S),S=null)}),(e,a)=>(n(),r("div",Z,[c(d(H),{ref_key:"tableRef",ref:b,class:"watchlist-table custom-time-n-sales-table__table",items:d(l),fields:d(s),"max-height":d(t),stripe:!1,"hide-footer":"",loading:d(o)},{empty:p(()=>[m("div",null,_(d(u)),1)]),_:1},8,["items","fields","max-height","loading"])]))}}),ae={class:"custom-time-n-sales"},le={class:"custom-time-n-sales__table"},se=o({__name:"index",props:{searchValue:{},searchPlaceholder:{},searchOptions:{},selectedSearchOption:{},loadingSearchOptions:{type:Boolean},minTradeSize:{},minTradeSizePlaceholder:{},rows:{},fields:{},tableHeight:{},loading:{type:Boolean},fetchingSymbolLabel:{},symbolNotFoundLabel:{},emptyLabel:{}},emits:["resize","update:searchValue","select-search-option","update:minTradeSize","load-more","stateChange"],setup(e,{expose:l,emit:s}){const t=L(),o=i(null),{width:b,height:_}=C(o),y=$(e,s);return l({state:y.state}),a([b,_],()=>{o.value&&y.onResize(b.value,_.value)}),(e,a)=>(n(),r("div",ae,[m("div",{ref_key:"searchRef",ref:o,class:"custom-time-n-sales__search"},[c(d(Q),null,u({_:2},[d(t)["search-dropdown"]?{name:"dropdown",fn:p(a=>[v(e.$slots,"search-dropdown",N(E(a)))]),key:"0"}:void 0]),1024)],512),m("div",le,[c(d(ee))])]))}});export{se as _,$ as p,D as u};
1
+ import{ref as e,watch as a,computed as l,provide as s,inject as t,defineComponent as o,shallowRef as i,openBlock as n,createElementBlock as r,createElementVNode as m,createVNode as c,unref as d,createSlots as u,withCtx as p,renderSlot as v,normalizeStyle as b,toDisplayString as _,Fragment as y,renderList as g,normalizeClass as f,createBlock as S,resolveDynamicComponent as w,onMounted as z,nextTick as k,onBeforeUnmount as T,useSlots as L,normalizeProps as N,guardReactiveProps as E}from"vue";import{a as C}from"./vendor-vueuse-core-B96HGhR7.mjs";import{useI18n as V}from"vue-i18n";import"element-plus";import"element-plus/es";import{ChevronUp as x,ChevronDown as O,Search as j}from"@lucide/vue";import"./vendor-email-misspelled-0hsXkSSK.mjs";import{_ as F}from"./EaeraInput-CkbcAxy0.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import P from"../composite/EaeraDropdownV2.mjs";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import"./vendor-sortablejs-D3DyHO5Y.mjs";import{_ as H}from"./EaeraTableV2-CIeL4xlB.mjs";const M=Symbol("EAERA_TIME_N_SALES_CONTEXT_KEY"),$=(t,o)=>{const{t:i}=V(),n=e(t.searchValue),r=e(t.minTradeSize),m=e(!1);a(()=>t.searchValue,e=>{n.value=e}),a(()=>t.minTradeSize,e=>{r.value=e});const c=(e,a)=>{const l=i(e);return"string"==typeof l&&l.trim().length>0?l:a},d=l(()=>[{key:"date",label:c("time-and-sales.table.date","Date"),minWidth:50},{key:"time",label:c("time-and-sales.table.time","Time"),minWidth:60},{key:"price",label:c("time-and-sales.table.price","Price"),minWidth:70,align:"right"},{key:"size",label:c("time-and-sales.table.size","Size"),minWidth:50,align:"right"}].map(e=>({...e,cellClass:"fs-10",cell:{dataClass:"text-primary"}}))),u=l(()=>({searchValue:n.value,minTradeSize:r.value,showingDropdown:m.value}));a(u,e=>{o("stateChange",e)},{immediate:!0});const p={searchValue:l({get:()=>n.value,set:e=>{n.value=e,o("update:searchValue",e)}}),searchPlaceholder:l(()=>t.searchPlaceholder??""),searchOptions:l(()=>t.searchOptions??[]),selectedSearchOption:l(()=>t.selectedSearchOption??""),loadingSearchOptions:l(()=>t.loadingSearchOptions??!1),minTradeSize:l({get:()=>r.value,set:e=>{r.value=e,o("update:minTradeSize",e)}}),minTradeSizePlaceholder:l(()=>t.minTradeSizePlaceholder||c("time-and-sales.table.size","Size")),rows:l(()=>t.rows??[]),fields:l(()=>t.fields&&t.fields.length>0?t.fields:d.value),tableHeight:l(()=>Number(t.tableHeight)||0),tableMaxHeight:l(()=>`${Math.max((Number(t.tableHeight)||0)-16,0)}px`),loading:l(()=>t.loading??!1),fetchingSymbolLabel:l(()=>t.fetchingSymbolLabel||c("market.search.fetching-symbol","Fetching symbol")),symbolNotFoundLabel:l(()=>t.symbolNotFoundLabel||c("market.search.symbol-not-found","Symbol not found")),emptyLabel:l(()=>t.emptyLabel||c("time-and-sales.table.empty","No data")),showingDropdown:l({get:()=>m.value,set:e=>{m.value=e}}),state:u,onResize:(e,a)=>o("resize",e,a),onSelectSearchOption:e=>o("select-search-option",e),onLoadMore:()=>o("load-more")};return s(M,p),p},D=()=>{const e=t(M);if(!e)throw new Error("useEaeraTimeNSales must be used inside EaeraTimeNSales");return e},R={class:"custom-time-n-sales-search__row"},W={class:"custom-time-n-sales-search__symbol-field"},A={class:"custom-time-n-sales-search__dropdown-anchor"},I={key:0,class:"custom-time-n-sales-search__empty body-sm text-placeholder"},B={key:0},q={key:1},U={key:1,class:"custom-time-n-sales-search__option-list"},K=["onClick"],X={class:"body-md__w"},Y={class:"body-sm"},G={class:"custom-time-n-sales-search__size-field"},J={class:"custom-time-n-sales-search__size-icons"},Q=o({__name:"EaeraTimeNSalesSearch",setup(s){const{searchValue:t,searchPlaceholder:o,searchOptions:z,selectedSearchOption:k,loadingSearchOptions:T,minTradeSize:L,minTradeSizePlaceholder:N,fetchingSymbolLabel:E,symbolNotFoundLabel:V,showingDropdown:H,onSelectSearchOption:M}=D(),$=i(null),Q=e(),{width:Z}=C($),ee=l(()=>`${Math.max(Z.value,200)}px`),ae=e(t.value),le=e(!1),se=l({get:()=>L.value,set:e=>{L.value=e}});a(t,e=>{ae.value=e});const te=e=>{le.value||(t.value=e)},oe=()=>{le.value=!0},ie=e=>{t.value=e.data},ne=e=>{le.value=!1;const a=e.data??ae.value;t.value=a},re=e=>{M(e)},me=e=>{H.value=e},ce=()=>{L.value=(e=>{const a=Number(e);return!Number.isFinite(a)||a<1?"":`${a}`})(L.value)},de=()=>{const e=Number(L.value||"1"),a=Number.isFinite(e)&&e>=1?e:1;L.value=`${a+1}`},ue=()=>{const e=Number(L.value||"1"),a=Number.isFinite(e)&&e>=1?e:1;L.value=`${Math.max(1,a-1)}`},he=l(()=>[{value:"up",icon:x,onClick:de},{value:"down",icon:O,onClick:ue}]);return a(t,e=>{e?Q.value?.openDropdown():Q.value?.closeDropdown()},{immediate:!0}),(e,a)=>(n(),r("div",{ref_key:"searchRef",ref:$,class:"custom-time-n-sales-search"},[m("div",R,[m("div",W,[c(d(F),{modelValue:ae.value,"onUpdate:modelValue":a[0]||(a[0]=e=>ae.value=e),placeholder:d(o),clearable:"",class:"watchlist-input custom-time-n-sales-search__symbol-input",onInput:te,onCompositionstart:oe,onCompositionupdate:ie,onCompositionend:ne},u({_:2},[d(t)?void 0:{name:"suffix",fn:p(()=>[c(d(j),{size:16,class:"icon-primary"})]),key:"0"}]),1032,["modelValue","placeholder"]),m("div",A,[c(d(P),{ref_key:"dropdownRef",ref:Q,trigger:"click",placement:"bottom-start",class:"custom-time-n-sales-search__dropdown",onVisibleChange:me},{dropdown:p(()=>[v(e.$slots,"dropdown",{options:d(z),selected:d(k),minWidth:ee.value,loading:d(T),fetchingSymbolLabel:d(E),symbolNotFoundLabel:d(V),selectOption:re},()=>[m("div",{class:"custom-time-n-sales-search__dropdown-panel",style:b({minWidth:ee.value})},[d(T)||!d(z).length?(n(),r("div",I,[d(T)?(n(),r("div",B,_(d(E)),1)):(n(),r("div",q,_(d(V)),1))])):(n(),r("div",U,[(n(!0),r(y,null,g(d(z),e=>(n(),r("div",{key:e.value,class:f(["custom-time-n-sales-search__option",e.value===d(k)&&"is-selected"]),onClick:a=>re(e.value)},[m("div",X,_(e.label),1),m("div",Y,_(e.description),1)],10,K))),128))]))],4)])]),default:p(()=>[a[2]||(a[2]=m("div",{class:"custom-time-n-sales-search__dropdown-trigger"},null,-1))]),_:3},512)])]),m("div",G,[c(d(F),{modelValue:se.value,"onUpdate:modelValue":a[1]||(a[1]=e=>se.value=e),class:"watchlist-input custom-time-n-sales-search__size-input",placeholder:d(N),onChange:ce,onInput:ce},{suffix:p(()=>[m("div",J,[(n(!0),r(y,null,g(he.value,e=>(n(),S(w(e.icon),{key:e.value,size:12,class:"icon-primary custom-time-n-sales-search__size-icon",onClick:e.onClick},null,8,["onClick"]))),128))])]),_:1},8,["modelValue","placeholder"])])])],512))}}),Z={class:"custom-time-n-sales-table"},ee=o({__name:"EaeraTimeNSalesTable",setup(a){const{rows:l,fields:s,tableMaxHeight:t,loading:o,emptyLabel:u,onLoadMore:v}=D(),b=e(),y=i(null),g=()=>{const e=y.value;e&&((e,a=50)=>{const{scrollTop:l,clientHeight:s,scrollHeight:t}=e;return l+s>=t-a})(e)&&v()},f=()=>{g()};let S=null;const w=()=>{null==S&&(S=requestAnimationFrame(()=>{S=null,g()}))};return z(async()=>{await k(),(()=>{const e=b.value?.$el;if(!e)return;const a=e.querySelector(".el-scrollbar__wrap");a&&(y.value=a,a.addEventListener("scroll",f,{passive:!0}),a.addEventListener("wheel",w,{passive:!0}))})()}),T(()=>{(()=>{const e=y.value;e&&(e.removeEventListener("scroll",f),e.removeEventListener("wheel",w),y.value=null)})(),null!=S&&(cancelAnimationFrame(S),S=null)}),(e,a)=>(n(),r("div",Z,[c(d(H),{ref_key:"tableRef",ref:b,class:"watchlist-table custom-time-n-sales-table__table",items:d(l),fields:d(s),"max-height":d(t),stripe:!1,"hide-footer":"",loading:d(o)},{empty:p(()=>[m("div",null,_(d(u)),1)]),_:1},8,["items","fields","max-height","loading"])]))}}),ae={class:"custom-time-n-sales"},le={class:"custom-time-n-sales__table"},se=o({__name:"index",props:{searchValue:{},searchPlaceholder:{},searchOptions:{},selectedSearchOption:{},loadingSearchOptions:{type:Boolean},minTradeSize:{},minTradeSizePlaceholder:{},rows:{},fields:{},tableHeight:{},loading:{type:Boolean},fetchingSymbolLabel:{},symbolNotFoundLabel:{},emptyLabel:{}},emits:["resize","update:searchValue","select-search-option","update:minTradeSize","load-more","stateChange"],setup(e,{expose:l,emit:s}){const t=L(),o=i(null),{width:b,height:_}=C(o),y=$(e,s);return l({state:y.state}),a([b,_],()=>{o.value&&y.onResize(b.value,_.value)}),(e,a)=>(n(),r("div",ae,[m("div",{ref_key:"searchRef",ref:o,class:"custom-time-n-sales__search"},[c(d(Q),null,u({_:2},[d(t)["search-dropdown"]?{name:"dropdown",fn:p(a=>[v(e.$slots,"search-dropdown",N(E(a)))]),key:"0"}:void 0]),1024)],512),m("div",le,[c(d(ee))])]))}});export{se as _,$ as p,D as u};
@@ -1 +1 @@
1
- import{ref as e,watch as o,computed as s,provide as r,inject as a,defineComponent as t,unref as l,openBlock as i,createElementBlock as d,createElementVNode as n,toDisplayString as c,createVNode as u,normalizeClass as m,withCtx as p,createCommentVNode as _,shallowRef as v,createTextVNode as b,isRef as y,resolveComponent as f,createBlock as g}from"vue";import{a as k}from"./vendor-vueuse-core-B96HGhR7.mjs";import{useI18n as S}from"vue-i18n";import"element-plus";import"element-plus/es";import{Plus as P,Minus as C,Info as j}from"@lucide/vue";import"./vendor-email-misspelled-0hsXkSSK.mjs";import{_ as w}from"./EaeraSelect-BxZRZofe.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import"./vendor-sortablejs-D3DyHO5Y.mjs";import{_ as O}from"./EaeraInput-CkbcAxy0.mjs";import{_ as E}from"./EaeraButton-BPVKRBOn.mjs";const $={Market:"MARKET",Limit:"LIMIT",Stop:"STOP",StopLimit:"STOP_LIMIT"},A={Day:"DAY",GTC:"GTC"},T={Buy:"BUY",Sell:"SELL"},L={JoinBid:"join-bid",Reverse:"reverse",JoinAsk:"join-ask",CloseAllPositions:"close-all-positions",FlattenAll:"flatten-all",CancelOrders:"cancel-orders"},z=Symbol("EAERA_ORDER_PLACEMENT_CONTEXT_KEY"),D=(a,t)=>{const l=e(a.orderType),i=e(a.orderDuration),d=e({...a.orderPrices});o(()=>a.orderType,e=>{l.value=e}),o(()=>a.orderDuration,e=>{i.value=e}),o(()=>a.orderPrices,e=>{d.value={...e}},{deep:!0});const n=s(()=>({disabledState:a.disabledState,viewingSymbol:a.viewingSymbol,position:a.position,orderType:l.value,orderDuration:i.value,orderPrices:{...d.value},invalidPrice:a.invalidPrice,loading:a.loading}));o(n,e=>{t("stateChange",e)},{immediate:!0});const c={disabledState:s(()=>a.disabledState),viewingSymbol:s(()=>a.viewingSymbol),position:s(()=>a.position),orderType:s({get:()=>l.value,set:e=>{l.value=e,t("update:orderType",e)}}),orderDuration:s({get:()=>i.value,set:e=>{i.value=e,t("update:orderDuration",e)}}),orderPrices:s(()=>d.value),invalidPrice:s(()=>a.invalidPrice),loading:s(()=>a.loading),state:n,setOrderPrice:(e,o)=>{d.value={...d.value,[e]:o},t("update:orderPrice",e,o)},submitSideOrder:(e,o)=>t("submit-side-order",e,o),joinBid:e=>t("join-bid",e),joinAsk:e=>t("join-ask",e),reverse:()=>t("reverse"),closeAllPositions:()=>t("close-all-positions"),flattenAll:()=>t("flatten-all"),cancelOrders:()=>t("cancel-orders"),onSymbolInfo:()=>t("symbol-info"),onResize:(e,o)=>t("resize",e,o)};return r(z,c),c},V=()=>{const e=a(z);if(!e)throw new Error("useEaeraOrderPlacement must be used inside EaeraOrderPlacement");return e},I={key:0,class:"custom-order-advanced"},N={class:"custom-order-advanced__price-row"},R={key:0,class:"custom-order-advanced__field"},x={class:"custom-order-advanced__label"},M={class:"custom-order-advanced__control"},B={key:0,class:"custom-order-advanced__error"},U={key:1,class:"custom-order-advanced__field"},F={class:"custom-order-advanced__label"},J={class:"custom-order-advanced__control"},G={key:0,class:"custom-order-advanced__error"},K={class:"custom-order-advanced__duration"},Y={class:"custom-order-advanced__label"},q={class:"custom-order-advanced__control"},X=t({__name:"EaeraOrderPlacementAdvanced",props:{invalidOrderPriceLabel:{}},setup(e){const o=e,{t:r}=S(),{viewingSymbol:a,orderType:t,orderDuration:v,orderPrices:b,invalidPrice:y,disabledState:f,setOrderPrice:g}=V(),k=s(()=>Object.values(A).map(e=>({label:r(`orders.durations.${e}`),value:e}))),E=s(()=>o.invalidOrderPriceLabel||r("orders.invalid-order-price")),T=s({get:()=>v.value,set:e=>{v.value=e}}),L=s({get:()=>b.value[$.Limit],set:e=>g($.Limit,e)}),z=s({get:()=>b.value[$.Stop],set:e=>g($.Stop,e)}),D=(e,o)=>{f.value.disabled||g(o,(e=>{const o=String(e??"").replace(/,/g,"").replace(/[^0-9.]/g,""),[s="",...r]=o.split("."),a=r.join("");return a.length?`${s}.${a}`:s})(e))},X=(e,o)=>{if(f.value.disabled)return;const s=Number(a.value?.tickSize)||0;if(!s)return;const r=(String(s).split(".")[1]??"").length,t=Number(b.value[e]||0),l=Number((t+o*s).toFixed(r));g(e,l)};return(e,o)=>l(t)?(i(),d("div",I,[n("div",N,[l($).Stop!==l(t)?(i(),d("div",R,[n("div",x,c(e.$t("orders.limit-price")),1),n("div",M,[u(l(O),{modelValue:L.value,"onUpdate:modelValue":o[2]||(o[2]=e=>L.value=e),class:m(["custom-order-advanced__input order-input",{"is-error":l(y).limit}]),disabled:l(f).disabled,onInput:o[3]||(o[3]=e=>D(e,l($).Limit))},{prefix:p(()=>[u(l(C),{size:20,onClick:o[0]||(o[0]=e=>X(l($).Limit,-1))})]),suffix:p(()=>[u(l(P),{size:20,onClick:o[1]||(o[1]=e=>X(l($).Limit,1))})]),_:1},8,["modelValue","class","disabled"])]),l(y).limit?(i(),d("div",B,[u(l(j),{size:18}),n("span",null,c(E.value),1)])):_("",!0)])):_("",!0),l($).Limit!==l(t)?(i(),d("div",U,[n("div",F,c(e.$t("orders.stop-price")),1),n("div",J,[u(l(O),{modelValue:z.value,"onUpdate:modelValue":o[6]||(o[6]=e=>z.value=e),class:m(["custom-order-advanced__input order-input",{"is-error":l(y).stop}]),controls:"",min:1,disabled:l(f).disabled,onInput:o[7]||(o[7]=e=>D(e,l($).Stop))},{prefix:p(()=>[u(l(C),{size:20,onClick:o[4]||(o[4]=e=>X(l($).Stop,-1))})]),suffix:p(()=>[u(l(P),{size:20,onClick:o[5]||(o[5]=e=>X(l($).Stop,1))})]),_:1},8,["modelValue","class","disabled"])]),l(y).stop?(i(),d("div",G,[u(l(j),{size:18}),n("span",null,c(E.value),1)])):_("",!0)])):_("",!0)]),n("div",K,[n("div",Y,c(e.$t("orders.duration")),1),n("div",q,[u(l(w),{modelValue:T.value,"onUpdate:modelValue":o[8]||(o[8]=e=>T.value=e),class:"custom-order-advanced__select",options:k.value,placeholder:"Select",disabled:l(f).disabled},null,8,["modelValue","options","disabled"])])])])):_("",!0)}}),H={key:0,class:"custom-order-actions__position-row"},Q={key:0,class:"custom-order-actions__position"},W={key:1,class:"custom-order-actions__empty"},Z={class:"custom-order-actions__actions"},ee={class:"custom-order-actions__row custom-order-actions__row--primary"},oe={class:"custom-order-actions__row custom-order-actions__row--secondary"},se={class:"custom-order-actions__row custom-order-actions__row--tertiary"},re=t({__name:"EaeraOrderPlacementActions",setup(o){const{t:r}=S(),{viewingSymbol:a,position:t,loading:y,orderType:f,disabledState:g,submitSideOrder:P,joinBid:C,joinAsk:j,reverse:w,closeAllPositions:A,flattenAll:z,cancelOrders:D}=V(),I=e(1),N=v(null),{width:R}=k(N),x=s(()=>r(`orders.types.${f.value||$.Market}`)),M=()=>Math.max(1,Number(I.value)||1),B=e=>{P(e,M())},U=()=>{C(M())},F=()=>{j(M())},J=e=>((e,o)=>{const s=Number(e??0);if(!Number.isFinite(s))return"0";if(!o)return s.toLocaleString();try{return new Intl.NumberFormat(void 0,{style:"currency",currency:o,currencyDisplay:"narrowSymbol",maximumFractionDigits:6}).format(s)}catch{return`${s.toLocaleString()} ${o}`}})(e,a.value?.currency),G=e=>{const o=Number(e);return o>0?"custom-order-actions__upl custom-order-actions__upl--positive":o<0?"custom-order-actions__upl custom-order-actions__upl--negative":"custom-order-actions__upl"};return(e,o)=>(i(),d("div",{ref_key:"orderActionsRef",ref:N,class:"custom-order-actions"},[l(a)?(i(),d("div",H,[l(t)?(i(),d("span",Q,[n("span",null,"+"+c(l(t).quantity),1),o[4]||(o[4]=n("span",null,"@",-1)),n("span",null,c(l(t).entryPrice),1),n("span",{class:m(G(l(t).unrealizedPnl))},[o[3]||(o[3]=b(" UP&L ",-1)),n("span",null,c(J(l(t).unrealizedPnl)),1)],2)])):(i(),d("span",W,c(e.$t("orders.no-active-position")),1))])):_("",!0),n("div",Z,[n("div",ee,[u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",color:"success",loading:l(y)[l(T).Buy],disabled:l(g).disabled,onClick:o[0]||(o[0]=e=>B(l(T).Buy))},{default:p(()=>[n("span",{class:m(["custom-order-actions__button-label",{"is-compact":l(R)<330}])},c(e.$t("orders.actions.buy",{count:I.value,type:x.value})),3)]),_:1},8,["loading","disabled"]),u(l(O),{modelValue:I.value,"onUpdate:modelValue":o[1]||(o[1]=e=>I.value=e),modelModifiers:{number:!0},type:"number",class:"custom-order-actions__volume-input order-input-number",controls:"",min:1,step:1,"step-strictly":"",precision:0,disabled:l(g).disabled},null,8,["modelValue","disabled"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",color:"danger",loading:l(y)[l(T).Sell],disabled:l(g).disabled,onClick:o[2]||(o[2]=e=>B(l(T).Sell))},{default:p(()=>[n("span",{class:m(["custom-order-actions__button-label",{"is-compact":l(R)<330}])},c(e.$t("orders.actions.sell",{count:I.value,type:x.value})),3)]),_:1},8,["loading","disabled"])]),n("div",oe,[u(l(E),{class:"custom-order-actions__button custom-order-actions__button--half",loading:l(y)[l(L).JoinBid],disabled:l(g).disabled,onClick:U},{default:p(()=>[n("span",null,c(e.$t("orders.actions.join-bid")),1)]),_:1},8,["loading","disabled"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--third",loading:l(y)[l(L).Reverse],disabled:l(g).disabled,onClick:l(w)},{default:p(()=>[n("span",null,c(e.$t("orders.actions.reverse")),1)]),_:1},8,["loading","disabled","onClick"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--half",loading:l(y)[l(L).JoinAsk],disabled:l(g).disabled,onClick:F},{default:p(()=>[n("span",null,c(e.$t("orders.actions.join-ask")),1)]),_:1},8,["loading","disabled"])]),n("div",se,[u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",loading:l(y)[l(L).CloseAllPositions],disabled:l(g).disabled,onClick:l(A)},{default:p(()=>[n("span",null,c(e.$t("orders.actions.close-position")),1)]),_:1},8,["loading","disabled","onClick"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",loading:l(y)[l(L).FlattenAll],disabled:l(g).disabled,onClick:l(z)},{default:p(()=>[n("span",null,c(e.$t("orders.actions.flatten-all")),1)]),_:1},8,["loading","disabled","onClick"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",loading:l(y)[l(L).CancelOrders],disabled:l(g).disabled,onClick:l(D)},{default:p(()=>[n("span",null,c(e.$t("orders.actions.cancel-orders")),1)]),_:1},8,["loading","disabled","onClick"])])])],512))}}),ae={class:"custom-order-info"},te={class:"custom-order-info__select-type"},le={key:0,class:"custom-order-info__symbol"},ie={class:"custom-order-info__symbol-text"},de={key:1,class:"custom-order-info__inactive-message"},ne=t({__name:"EaeraOrderPlacementInfo",setup(e){const{locale:o,t:r}=S(),{disabledState:a,orderType:t,viewingSymbol:p,onSymbolInfo:v}=V(),b=s(()=>(o.value,Object.values($).filter(e=>e!==$.Market).map(e=>({label:r(`orders.types.${e}`),value:e})))),f=()=>{a.value.disabled||(t.value="")},g=()=>{p.value&&v()},k=s(()=>a.value.isMissingUser?r("watch-list.symbol-info.state.no-account-selected"):p.value&&"active"!==p.value.state?r(`watch-list.symbol-info.state.${p.value.state}`):"");return(e,o)=>(i(),d("div",ae,[n("div",te,[n("div",{class:m(["custom-order-info__select-item","custom-order-info__select-item--market",{"is-active":!l(t),"is-disabled":l(a).disabled}]),onClick:f},c(e.$t("orders.types.MARKET")),3),u(l(w),{modelValue:l(t),"onUpdate:modelValue":o[0]||(o[0]=e=>y(t)?t.value=e:null),class:m(["custom-order-info__select-item borderless-select","custom-order-info__select-item--select",{"is-active":!!l(t)}]),options:b.value,placeholder:e.$t("orders.types.PENDING_ORDER"),clearable:"",disabled:l(a).disabled},null,8,["modelValue","class","options","placeholder","disabled"])]),l(p)?(i(),d("div",le,[n("div",{class:"custom-order-info__symbol-link",onClick:g},[n("span",ie,c(l(p).tickerSymbol),1),u(l(j),{size:16,class:"custom-order-info__symbol-icon"})])])):_("",!0),k.value?(i(),d("div",de,[u(l(j),{size:16}),n("span",null,c(k.value),1)])):_("",!0)]))}}),ce={class:"custom-order-placement__content"},ue=t({__name:"index",props:{disabledState:{},viewingSymbol:{},position:{},orderType:{},orderDuration:{},orderPrices:{},invalidPrice:{},loading:{},invalidOrderPriceLabel:{}},emits:["resize","update:orderType","update:orderDuration","update:orderPrice","submit-side-order","join-bid","join-ask","reverse","close-all-positions","flatten-all","cancel-orders","symbol-info","stateChange"],setup(e,{expose:s,emit:r}){const a=v(null),{width:t,height:d}=k(a),c=e,m=D(c,r);return s({state:m.state}),o([t,d],()=>{a.value&&m.onResize(t.value,d.value)}),(e,o)=>{const s=f("client-only");return i(),g(s,null,{default:p(()=>[n("div",{ref_key:"orderRef",ref:a,class:"custom-order-placement__wrapper"},[n("div",ce,[u(l(ne)),u(l(X),{"invalid-order-price-label":c.invalidOrderPriceLabel},null,8,["invalid-order-price-label"]),u(l(re))])],512)]),_:1})}}});export{L as E,ue as _,A as a,T as b,$ as c,D as p,V as u};
1
+ import{ref as e,watch as o,computed as s,provide as r,inject as a,defineComponent as t,unref as l,openBlock as i,createElementBlock as d,createElementVNode as n,toDisplayString as c,createVNode as u,normalizeClass as m,withCtx as p,createCommentVNode as _,shallowRef as v,createTextVNode as b,isRef as y,resolveComponent as f,createBlock as g}from"vue";import{a as k}from"./vendor-vueuse-core-B96HGhR7.mjs";import{useI18n as S}from"vue-i18n";import"element-plus";import"element-plus/es";import{Plus as P,Minus as C,Info as j}from"@lucide/vue";import"./vendor-email-misspelled-0hsXkSSK.mjs";import{_ as w}from"./EaeraSelect-C-sln89V.mjs";import"./vendor-unorm-DkILX5Kw.mjs";import"./useEaeraInputPhoneNumber-B72aLnQs.mjs";import"@element-plus/icons-vue";import"echarts/core";import"echarts/renderers";import"echarts/charts";import"echarts/components";import"vue-echarts";import"./vendor-currency-symbol-map-3_wzZimq.mjs";import"./vendor-sortablejs-D3DyHO5Y.mjs";import{_ as O}from"./EaeraInput-CkbcAxy0.mjs";import{_ as E}from"./EaeraButton-BPVKRBOn.mjs";const $={Market:"MARKET",Limit:"LIMIT",Stop:"STOP",StopLimit:"STOP_LIMIT"},A={Day:"DAY",GTC:"GTC"},T={Buy:"BUY",Sell:"SELL"},L={JoinBid:"join-bid",Reverse:"reverse",JoinAsk:"join-ask",CloseAllPositions:"close-all-positions",FlattenAll:"flatten-all",CancelOrders:"cancel-orders"},z=Symbol("EAERA_ORDER_PLACEMENT_CONTEXT_KEY"),D=(a,t)=>{const l=e(a.orderType),i=e(a.orderDuration),d=e({...a.orderPrices});o(()=>a.orderType,e=>{l.value=e}),o(()=>a.orderDuration,e=>{i.value=e}),o(()=>a.orderPrices,e=>{d.value={...e}},{deep:!0});const n=s(()=>({disabledState:a.disabledState,viewingSymbol:a.viewingSymbol,position:a.position,orderType:l.value,orderDuration:i.value,orderPrices:{...d.value},invalidPrice:a.invalidPrice,loading:a.loading}));o(n,e=>{t("stateChange",e)},{immediate:!0});const c={disabledState:s(()=>a.disabledState),viewingSymbol:s(()=>a.viewingSymbol),position:s(()=>a.position),orderType:s({get:()=>l.value,set:e=>{l.value=e,t("update:orderType",e)}}),orderDuration:s({get:()=>i.value,set:e=>{i.value=e,t("update:orderDuration",e)}}),orderPrices:s(()=>d.value),invalidPrice:s(()=>a.invalidPrice),loading:s(()=>a.loading),state:n,setOrderPrice:(e,o)=>{d.value={...d.value,[e]:o},t("update:orderPrice",e,o)},submitSideOrder:(e,o)=>t("submit-side-order",e,o),joinBid:e=>t("join-bid",e),joinAsk:e=>t("join-ask",e),reverse:()=>t("reverse"),closeAllPositions:()=>t("close-all-positions"),flattenAll:()=>t("flatten-all"),cancelOrders:()=>t("cancel-orders"),onSymbolInfo:()=>t("symbol-info"),onResize:(e,o)=>t("resize",e,o)};return r(z,c),c},V=()=>{const e=a(z);if(!e)throw new Error("useEaeraOrderPlacement must be used inside EaeraOrderPlacement");return e},I={key:0,class:"custom-order-advanced"},N={class:"custom-order-advanced__price-row"},R={key:0,class:"custom-order-advanced__field"},x={class:"custom-order-advanced__label"},M={class:"custom-order-advanced__control"},B={key:0,class:"custom-order-advanced__error"},U={key:1,class:"custom-order-advanced__field"},F={class:"custom-order-advanced__label"},J={class:"custom-order-advanced__control"},G={key:0,class:"custom-order-advanced__error"},K={class:"custom-order-advanced__duration"},Y={class:"custom-order-advanced__label"},q={class:"custom-order-advanced__control"},X=t({__name:"EaeraOrderPlacementAdvanced",props:{invalidOrderPriceLabel:{}},setup(e){const o=e,{t:r}=S(),{viewingSymbol:a,orderType:t,orderDuration:v,orderPrices:b,invalidPrice:y,disabledState:f,setOrderPrice:g}=V(),k=s(()=>Object.values(A).map(e=>({label:r(`orders.durations.${e}`),value:e}))),E=s(()=>o.invalidOrderPriceLabel||r("orders.invalid-order-price")),T=s({get:()=>v.value,set:e=>{v.value=e}}),L=s({get:()=>b.value[$.Limit],set:e=>g($.Limit,e)}),z=s({get:()=>b.value[$.Stop],set:e=>g($.Stop,e)}),D=(e,o)=>{f.value.disabled||g(o,(e=>{const o=String(e??"").replace(/,/g,"").replace(/[^0-9.]/g,""),[s="",...r]=o.split("."),a=r.join("");return a.length?`${s}.${a}`:s})(e))},X=(e,o)=>{if(f.value.disabled)return;const s=Number(a.value?.tickSize)||0;if(!s)return;const r=(String(s).split(".")[1]??"").length,t=Number(b.value[e]||0),l=Number((t+o*s).toFixed(r));g(e,l)};return(e,o)=>l(t)?(i(),d("div",I,[n("div",N,[l($).Stop!==l(t)?(i(),d("div",R,[n("div",x,c(e.$t("orders.limit-price")),1),n("div",M,[u(l(O),{modelValue:L.value,"onUpdate:modelValue":o[2]||(o[2]=e=>L.value=e),class:m(["custom-order-advanced__input order-input",{"is-error":l(y).limit}]),disabled:l(f).disabled,onInput:o[3]||(o[3]=e=>D(e,l($).Limit))},{prefix:p(()=>[u(l(C),{size:20,onClick:o[0]||(o[0]=e=>X(l($).Limit,-1))})]),suffix:p(()=>[u(l(P),{size:20,onClick:o[1]||(o[1]=e=>X(l($).Limit,1))})]),_:1},8,["modelValue","class","disabled"])]),l(y).limit?(i(),d("div",B,[u(l(j),{size:18}),n("span",null,c(E.value),1)])):_("",!0)])):_("",!0),l($).Limit!==l(t)?(i(),d("div",U,[n("div",F,c(e.$t("orders.stop-price")),1),n("div",J,[u(l(O),{modelValue:z.value,"onUpdate:modelValue":o[6]||(o[6]=e=>z.value=e),class:m(["custom-order-advanced__input order-input",{"is-error":l(y).stop}]),controls:"",min:1,disabled:l(f).disabled,onInput:o[7]||(o[7]=e=>D(e,l($).Stop))},{prefix:p(()=>[u(l(C),{size:20,onClick:o[4]||(o[4]=e=>X(l($).Stop,-1))})]),suffix:p(()=>[u(l(P),{size:20,onClick:o[5]||(o[5]=e=>X(l($).Stop,1))})]),_:1},8,["modelValue","class","disabled"])]),l(y).stop?(i(),d("div",G,[u(l(j),{size:18}),n("span",null,c(E.value),1)])):_("",!0)])):_("",!0)]),n("div",K,[n("div",Y,c(e.$t("orders.duration")),1),n("div",q,[u(l(w),{modelValue:T.value,"onUpdate:modelValue":o[8]||(o[8]=e=>T.value=e),class:"custom-order-advanced__select",options:k.value,placeholder:"Select",disabled:l(f).disabled},null,8,["modelValue","options","disabled"])])])])):_("",!0)}}),H={key:0,class:"custom-order-actions__position-row"},Q={key:0,class:"custom-order-actions__position"},W={key:1,class:"custom-order-actions__empty"},Z={class:"custom-order-actions__actions"},ee={class:"custom-order-actions__row custom-order-actions__row--primary"},oe={class:"custom-order-actions__row custom-order-actions__row--secondary"},se={class:"custom-order-actions__row custom-order-actions__row--tertiary"},re=t({__name:"EaeraOrderPlacementActions",setup(o){const{t:r}=S(),{viewingSymbol:a,position:t,loading:y,orderType:f,disabledState:g,submitSideOrder:P,joinBid:C,joinAsk:j,reverse:w,closeAllPositions:A,flattenAll:z,cancelOrders:D}=V(),I=e(1),N=v(null),{width:R}=k(N),x=s(()=>r(`orders.types.${f.value||$.Market}`)),M=()=>Math.max(1,Number(I.value)||1),B=e=>{P(e,M())},U=()=>{C(M())},F=()=>{j(M())},J=e=>((e,o)=>{const s=Number(e??0);if(!Number.isFinite(s))return"0";if(!o)return s.toLocaleString();try{return new Intl.NumberFormat(void 0,{style:"currency",currency:o,currencyDisplay:"narrowSymbol",maximumFractionDigits:6}).format(s)}catch{return`${s.toLocaleString()} ${o}`}})(e,a.value?.currency),G=e=>{const o=Number(e);return o>0?"custom-order-actions__upl custom-order-actions__upl--positive":o<0?"custom-order-actions__upl custom-order-actions__upl--negative":"custom-order-actions__upl"};return(e,o)=>(i(),d("div",{ref_key:"orderActionsRef",ref:N,class:"custom-order-actions"},[l(a)?(i(),d("div",H,[l(t)?(i(),d("span",Q,[n("span",null,"+"+c(l(t).quantity),1),o[4]||(o[4]=n("span",null,"@",-1)),n("span",null,c(l(t).entryPrice),1),n("span",{class:m(G(l(t).unrealizedPnl))},[o[3]||(o[3]=b(" UP&L ",-1)),n("span",null,c(J(l(t).unrealizedPnl)),1)],2)])):(i(),d("span",W,c(e.$t("orders.no-active-position")),1))])):_("",!0),n("div",Z,[n("div",ee,[u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",color:"success",loading:l(y)[l(T).Buy],disabled:l(g).disabled,onClick:o[0]||(o[0]=e=>B(l(T).Buy))},{default:p(()=>[n("span",{class:m(["custom-order-actions__button-label",{"is-compact":l(R)<330}])},c(e.$t("orders.actions.buy",{count:I.value,type:x.value})),3)]),_:1},8,["loading","disabled"]),u(l(O),{modelValue:I.value,"onUpdate:modelValue":o[1]||(o[1]=e=>I.value=e),modelModifiers:{number:!0},type:"number",class:"custom-order-actions__volume-input order-input-number",controls:"",min:1,step:1,"step-strictly":"",precision:0,disabled:l(g).disabled},null,8,["modelValue","disabled"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",color:"danger",loading:l(y)[l(T).Sell],disabled:l(g).disabled,onClick:o[2]||(o[2]=e=>B(l(T).Sell))},{default:p(()=>[n("span",{class:m(["custom-order-actions__button-label",{"is-compact":l(R)<330}])},c(e.$t("orders.actions.sell",{count:I.value,type:x.value})),3)]),_:1},8,["loading","disabled"])]),n("div",oe,[u(l(E),{class:"custom-order-actions__button custom-order-actions__button--half",loading:l(y)[l(L).JoinBid],disabled:l(g).disabled,onClick:U},{default:p(()=>[n("span",null,c(e.$t("orders.actions.join-bid")),1)]),_:1},8,["loading","disabled"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--third",loading:l(y)[l(L).Reverse],disabled:l(g).disabled,onClick:l(w)},{default:p(()=>[n("span",null,c(e.$t("orders.actions.reverse")),1)]),_:1},8,["loading","disabled","onClick"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--half",loading:l(y)[l(L).JoinAsk],disabled:l(g).disabled,onClick:F},{default:p(()=>[n("span",null,c(e.$t("orders.actions.join-ask")),1)]),_:1},8,["loading","disabled"])]),n("div",se,[u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",loading:l(y)[l(L).CloseAllPositions],disabled:l(g).disabled,onClick:l(A)},{default:p(()=>[n("span",null,c(e.$t("orders.actions.close-position")),1)]),_:1},8,["loading","disabled","onClick"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",loading:l(y)[l(L).FlattenAll],disabled:l(g).disabled,onClick:l(z)},{default:p(()=>[n("span",null,c(e.$t("orders.actions.flatten-all")),1)]),_:1},8,["loading","disabled","onClick"]),u(l(E),{class:"custom-order-actions__button custom-order-actions__button--fill custom-order-actions__button--padded",loading:l(y)[l(L).CancelOrders],disabled:l(g).disabled,onClick:l(D)},{default:p(()=>[n("span",null,c(e.$t("orders.actions.cancel-orders")),1)]),_:1},8,["loading","disabled","onClick"])])])],512))}}),ae={class:"custom-order-info"},te={class:"custom-order-info__select-type"},le={key:0,class:"custom-order-info__symbol"},ie={class:"custom-order-info__symbol-text"},de={key:1,class:"custom-order-info__inactive-message"},ne=t({__name:"EaeraOrderPlacementInfo",setup(e){const{locale:o,t:r}=S(),{disabledState:a,orderType:t,viewingSymbol:p,onSymbolInfo:v}=V(),b=s(()=>(o.value,Object.values($).filter(e=>e!==$.Market).map(e=>({label:r(`orders.types.${e}`),value:e})))),f=()=>{a.value.disabled||(t.value="")},g=()=>{p.value&&v()},k=s(()=>a.value.isMissingUser?r("watch-list.symbol-info.state.no-account-selected"):p.value&&"active"!==p.value.state?r(`watch-list.symbol-info.state.${p.value.state}`):"");return(e,o)=>(i(),d("div",ae,[n("div",te,[n("div",{class:m(["custom-order-info__select-item","custom-order-info__select-item--market",{"is-active":!l(t),"is-disabled":l(a).disabled}]),onClick:f},c(e.$t("orders.types.MARKET")),3),u(l(w),{modelValue:l(t),"onUpdate:modelValue":o[0]||(o[0]=e=>y(t)?t.value=e:null),class:m(["custom-order-info__select-item borderless-select","custom-order-info__select-item--select",{"is-active":!!l(t)}]),options:b.value,placeholder:e.$t("orders.types.PENDING_ORDER"),clearable:"",disabled:l(a).disabled},null,8,["modelValue","class","options","placeholder","disabled"])]),l(p)?(i(),d("div",le,[n("div",{class:"custom-order-info__symbol-link",onClick:g},[n("span",ie,c(l(p).tickerSymbol),1),u(l(j),{size:16,class:"custom-order-info__symbol-icon"})])])):_("",!0),k.value?(i(),d("div",de,[u(l(j),{size:16}),n("span",null,c(k.value),1)])):_("",!0)]))}}),ce={class:"custom-order-placement__content"},ue=t({__name:"index",props:{disabledState:{},viewingSymbol:{},position:{},orderType:{},orderDuration:{},orderPrices:{},invalidPrice:{},loading:{},invalidOrderPriceLabel:{}},emits:["resize","update:orderType","update:orderDuration","update:orderPrice","submit-side-order","join-bid","join-ask","reverse","close-all-positions","flatten-all","cancel-orders","symbol-info","stateChange"],setup(e,{expose:s,emit:r}){const a=v(null),{width:t,height:d}=k(a),c=e,m=D(c,r);return s({state:m.state}),o([t,d],()=>{a.value&&m.onResize(t.value,d.value)}),(e,o)=>{const s=f("client-only");return i(),g(s,null,{default:p(()=>[n("div",{ref_key:"orderRef",ref:a,class:"custom-order-placement__wrapper"},[n("div",ce,[u(l(ne)),u(l(X),{"invalid-order-price-label":c.invalidOrderPriceLabel},null,8,["invalid-order-price-label"]),u(l(re))])],512)]),_:1})}}});export{L as E,ue as _,A as a,T as b,$ as c,D as p,V as u};
@@ -1 +1 @@
1
- import{_ as e}from"./EaeraDivider-Dggvc36a.mjs";import{_ as a}from"./EaeraButton-BPVKRBOn.mjs";import{_ as l}from"./EaeraSelect-BxZRZofe.mjs";import{defineComponent as s,computed as t,openBlock as o,createElementBlock as r,createElementVNode as d,normalizeClass as i,createVNode as n,createCommentVNode as p,toDisplayString as m,unref as u,createTextVNode as c,Fragment as x,ref as b,withCtx as v}from"vue";import{_ as f}from"./EaeraInputNumber-COC6rdNn.mjs";import{Info as y,TriangleAlert as g,Ban as k,Send as E}from"@lucide/vue";import{_ as P}from"./EaeraInput-CkbcAxy0.mjs";import{_ as w}from"./EaeraCheckbox-C_faN0pV.mjs";import{_ as L}from"./EaeraSwitch-BI3E0zPf.mjs";const _={key:0,class:"flex flex-row gap-lg w-full"},V={key:0,class:"flex flex-col gap-xs flex-1 min-w-0"},T={key:1,class:"flex flex-col gap-xs flex-1 min-w-0"},B=s({__name:"OrderPriceRow",props:{orderType:{},price:{},stopLimitPrice:{},priceError:{type:Boolean},disabled:{type:Boolean}},emits:["update:price","update:stopLimitPrice"],setup(e,{emit:a}){const l=e,s=a,m=["buy_stop_limit","sell_stop_limit"],u=["market"],c=t(()=>!u.includes(l.orderType)),x=t(()=>m.includes(l.orderType));return(a,l)=>{const t=f;return c.value||x.value?(o(),r("div",_,[c.value?(o(),r("div",V,[d("span",{class:i(["text-label-md",e.priceError?"text-[var(--er-text-danger)]":"text-[var(--er-text-primary)]"])}," Price ",2),n(t,{value:e.price,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:1e-5,disabled:e.disabled},class:i(["w-full",e.priceError?"ring-1 ring-[var(--er-text-danger)]":""]),onHandleChange:l[0]||(l[0]=e=>s("update:price",e??0))},null,8,["value","other-props","class"])])):p("",!0),x.value?(o(),r("div",T,[l[2]||(l[2]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Stop Limit Price",-1)),n(t,{value:e.stopLimitPrice,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:1e-5,disabled:e.disabled},class:"w-full",onHandleChange:l[1]||(l[1]=e=>s("update:stopLimitPrice",e??0))},null,8,["value","other-props"])])):p("",!0)])):p("",!0)}}}),z={class:"flex flex-col gap-xs w-full"},U={class:"flex items-center justify-between"},I={class:"flex items-center gap-1"},S={class:"text-body-xs text-[var(--er-text-secondary)]"},C={class:"text-body-xs text-[var(--er-text-secondary)]"},O=s({__name:"OrderVolumeRow",props:{volume:{},symbol:{},margin:{},pipValue:{},marginBlocked:{type:Boolean},pipBlocked:{type:Boolean},disabled:{type:Boolean}},emits:["update:volume"],setup(e,{emit:a}){const l=a;return(a,s)=>{const t=f;return o(),r("div",z,[d("div",U,[s[1]||(s[1]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Volume",-1)),d("div",I,[d("span",S,m(e.symbol),1),n(u(y),{size:12,class:"text-[var(--er-icon-secondary)]"})])]),n(t,{value:e.volume,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:.01,disabled:e.disabled},class:"w-full",onHandleChange:s[0]||(s[0]=e=>l("update:volume",e??0))},null,8,["value","other-props"]),d("span",C,[s[2]||(s[2]=c(" Margin ",-1)),d("span",{class:i(e.marginBlocked?"text-[var(--er-text-muted)]":"")},m(e.marginBlocked?"—":e.margin),3),s[3]||(s[3]=c(" / Pip Value ",-1)),d("span",{class:i(e.pipBlocked?"text-[var(--er-text-muted)]":"")},m(e.pipBlocked?"—":e.pipValue),3)])])}}}),j={class:"flex flex-col gap-md w-full"},H={class:"flex items-center gap-xs"},M={class:"flex flex-row gap-lg w-full"},A={class:"flex flex-col gap-xs flex-1 min-w-0"},q={class:"flex items-center gap-xs"},F={class:"flex flex-col gap-xs flex-1 min-w-0"},R={class:"flex items-center justify-end gap-xs"},W={class:"flex flex-col gap-xs w-full"},N={class:"flex items-center gap-xs"},Y={class:"text-body-xs text-[var(--er-text-secondary)] ml-auto"},D=s({__name:"OrderAdvancedPanel",props:{advanced:{type:Boolean},stopLossEnabled:{type:Boolean},stopLossValue:{},takeProfitEnabled:{type:Boolean},takeProfitValue:{},comment:{},commentMax:{},disabled:{type:Boolean}},emits:["update:advanced","update:stopLossEnabled","update:stopLossValue","update:takeProfitEnabled","update:takeProfitValue","update:comment"],setup(e,{emit:a}){const l=a;return(a,s)=>{const t=L,i=w,u=f,c=P;return o(),r("div",j,[d("div",H,[s[6]||(s[6]=d("span",{class:"text-label-md text-[var(--er-text-brand)]"},"Advanced",-1)),n(t,{"model-value":e.advanced,size:"sm",disabled:e.disabled,"onUpdate:modelValue":s[0]||(s[0]=e=>l("update:advanced",e))},null,8,["model-value","disabled"])]),e.advanced?(o(),r(x,{key:0},[d("div",M,[d("div",A,[d("div",q,[n(i,{"model-value":e.stopLossEnabled,size:"sm",color:"success",disabled:e.disabled,"onUpdate:modelValue":s[1]||(s[1]=e=>l("update:stopLossEnabled",e))},null,8,["model-value","disabled"]),s[7]||(s[7]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Stop Loss",-1))]),n(u,{value:e.stopLossValue,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:1e-5,disabled:e.disabled||!e.stopLossEnabled},class:"w-full",onHandleChange:s[2]||(s[2]=e=>l("update:stopLossValue",e??0))},null,8,["value","other-props"])]),d("div",F,[d("div",R,[s[8]||(s[8]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Take Profit",-1)),n(i,{"model-value":e.takeProfitEnabled,size:"sm",disabled:e.disabled,"onUpdate:modelValue":s[3]||(s[3]=e=>l("update:takeProfitEnabled",e))},null,8,["model-value","disabled"])]),n(u,{value:e.takeProfitValue,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:1e-5,disabled:e.disabled||!e.takeProfitEnabled},class:"w-full",onHandleChange:s[4]||(s[4]=e=>l("update:takeProfitValue",e??0))},null,8,["value","other-props"])])]),d("div",W,[d("div",N,[s[9]||(s[9]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Comment",-1)),d("span",Y,m((e.comment||"").length)+"/"+m(e.commentMax),1)]),n(c,{value:e.comment,placeholder:"Add comment",size:"sm",disabled:e.disabled,class:"w-full",onHandleChange:s[5]||(s[5]=e=>l("update:comment",e))},null,8,["value","disabled"])])],64)):p("",!0)])}}}),G=["market","buy_limit","sell_limit","buy_stop","sell_stop","buy_stop_limit","sell_stop_limit"];function J(e,a,l,s){const o=b(!1),r=b(!1),d=t(()=>"market"===e.value.orderType),i=t(()=>{const l=a.value.find(a=>a.value===e.value.orderType);return l?.label??e.value.orderType}),n=t(()=>a.value.map(e=>({label:e.label,value:e.value}))),p=t(()=>l.value.isTradable),m=t(()=>!d.value),u=t(()=>m.value&&e.value.price<=0),c=t(()=>e.value.volume<=0),x=t(()=>!s.value&&p.value&&!c.value&&!u.value),v=t(()=>r.value&&u.value),f=e=>{r.value=!0,x.value&&(r.value=!1,e())},y=t(()=>!s.value&&p.value);return{showUnsupportedWarning:o,handleOrderTypeChange:(e,a)=>{if(!(e=>G.includes(e))(e))return o.value=!0,void setTimeout(()=>{o.value=!1},3e3);o.value=!1,a(e)},isMarket:d,orderTypeLabel:i,orderTypeOptions:n,isTradable:p,isPriceRequired:m,isPriceInvalid:u,isVolumeInvalid:c,showPriceError:v,canSubmit:x,isFieldBlocked:e=>l.value.blockedFields.includes(e),canEditOrder:y,handleBuy:e=>{f(e)},handleSell:e=>{f(e)},handleSubmit:e=>{f(e)}}}const K={class:"flex flex-col gap-md w-full"},Q={key:0,class:"flex items-center gap-xs bg-[var(--er-surface-warning)] rounded-sm p-sm"},X={class:"flex items-center gap-xs text-body-sm text-[var(--er-text-warning)]"},Z={class:"flex flex-col gap-md w-full"},$={key:0,class:"flex items-center gap-xs bg-[var(--er-surface-warning)] rounded-sm p-sm"},ee={class:"flex items-center gap-xs text-body-sm text-[var(--er-text-warning)]"},ae={key:1,class:"flex items-center gap-xs text-body-xs text-[var(--er-text-danger)]"},le={key:2,class:"flex items-center gap-xs"},se={key:3,class:"flex flex-row gap-md w-full"},te={class:"flex flex-col"},oe={class:"text-body-xs opacity-80"},re={class:"flex flex-col"},de={class:"text-body-xs opacity-80"},ie={key:4,class:"flex flex-row gap-sm w-full"},ne={key:5,class:"flex items-center justify-center gap-xs bg-[var(--er-surface-danger)] rounded-sm p-sm"},pe={class:"flex items-center gap-xs text-body-sm text-[var(--er-text-danger)]"},me={key:6},ue={class:"flex items-center gap-xs"},ce=s({__name:"index",props:{symbolInfo:{},symbolState:{},form:{},orderTypes:{},readOnly:{type:Boolean}},emits:["update:orderType","update:price","update:stopLimitPrice","update:volume","update:advanced","update:stopLossEnabled","update:stopLossValue","update:takeProfitEnabled","update:takeProfitValue","update:comment","submit"],setup(s,{emit:x}){const b=s,f=x,y=t(()=>b.form),P=t(()=>b.orderTypes),w=t(()=>b.symbolState),L=t(()=>b.readOnly),_=t(()=>b.readOnly),{showUnsupportedWarning:V,handleOrderTypeChange:T,isMarket:z,orderTypeLabel:U,orderTypeOptions:I,isTradable:S,showPriceError:C,isFieldBlocked:j,canEditOrder:H,handleBuy:M,handleSell:A,handleSubmit:q}=J(y,P,w,L),F=e=>{T(e,e=>f("update:orderType",e))},R=e=>String(e).replace(",","."),W=e=>{const a=b.form,l="market"===a.orderType,s=R(l?"buy"===e?b.symbolInfo.ask:b.symbolInfo.bid:a.price);return{side:e,symbol:b.symbolInfo.symbol,orderType:a.orderType,volume:a.volume,executionPrice:s,stopLoss:a.stopLossEnabled?a.stopLossValue:void 0,takeProfit:a.takeProfitEnabled?a.takeProfitValue:void 0,comment:a.comment}},N=e=>{"buy"===e?M(()=>f("submit",W("buy"))):A(()=>f("submit",W("sell")))},Y=()=>{const e=b.form.orderType.startsWith("sell_")?"sell":"buy";q(()=>f("submit",W(e)))};return(t,x)=>{const b=l,y=a,P=e;return o(),r("div",K,[u(V)?(o(),r("div",Q,[d("div",X,[n(u(g),{size:14}),x[13]||(x[13]=d("span",null,"Unsupported order type requested. Staying on previous type.",-1))])])):p("",!0),d("div",Z,[_.value?(o(),r("div",$,[d("div",ee,[n(u(g),{size:14}),x[14]||(x[14]=d("span",null,"No active account selected — trading actions are unavailable.",-1))])])):p("",!0),n(b,{"model-value":s.form.orderType,options:u(I),size:"sm",class:"w-full",disabled:!u(H),"onUpdate:modelValue":F},null,8,["model-value","options","disabled"]),n(B,{"order-type":s.form.orderType,price:s.form.price,"stop-limit-price":s.form.stopLimitPrice,"price-error":u(C),disabled:!u(H),"onUpdate:price":x[0]||(x[0]=e=>u(H)&&f("update:price",e)),"onUpdate:stopLimitPrice":x[1]||(x[1]=e=>u(H)&&f("update:stopLimitPrice",e))},null,8,["order-type","price","stop-limit-price","price-error","disabled"]),u(C)?(o(),r("div",ae,[n(u(g),{size:14}),d("span",null,"Price is required for "+m(u(U)),1)])):p("",!0),u(z)?p("",!0):(o(),r("div",le,[x[15]||(x[15]=d("span",{class:"text-caption-sm text-[var(--er-text-primary)]"},"Bid",-1)),d("span",{class:i(["text-body-xs",u(j)("bid")?"text-[var(--er-text-muted)]":"text-[var(--er-text-secondary)]"])},m(u(j)("bid")?"—":s.symbolInfo.bid),3),x[16]||(x[16]=d("span",{class:"text-body-xs text-[var(--er-text-secondary)]"},"/",-1)),x[17]||(x[17]=d("span",{class:"text-caption-sm text-[var(--er-text-primary)]"},"Ask",-1)),d("span",{class:i(["text-body-xs",u(j)("ask")?"text-[var(--er-text-muted)]":"text-[var(--er-text-secondary)]"])},m(u(j)("ask")?"—":s.symbolInfo.ask),3)])),n(O,{volume:s.form.volume,symbol:s.symbolInfo.symbol,margin:s.symbolInfo.margin,"pip-value":s.symbolInfo.pipValue,"margin-blocked":u(j)("margin"),"pip-blocked":u(j)("pipValue"),disabled:!u(H),"onUpdate:volume":x[2]||(x[2]=e=>u(H)&&f("update:volume",e))},null,8,["volume","symbol","margin","pip-value","margin-blocked","pip-blocked","disabled"]),u(z)&&!s.form.advancedEnabled?(o(),r("div",se,[n(y,{color:"danger",size:"lg",class:"flex-1 flex-col !h-auto py-sm",disabled:!u(H),onClick:x[3]||(x[3]=e=>N("sell"))},{default:v(()=>[d("div",te,[x[18]||(x[18]=d("span",{class:"text-label-lg"},"SELL",-1)),d("span",oe,m(u(j)("bid")?"—":s.symbolInfo.bid),1)])]),_:1},8,["disabled"]),n(y,{color:"success",size:"lg",class:"flex-1 flex-col !h-auto py-sm",disabled:!u(H),onClick:x[4]||(x[4]=e=>N("buy"))},{default:v(()=>[d("div",re,[x[19]||(x[19]=d("span",{class:"text-label-lg"},"BUY",-1)),d("span",de,m(u(j)("ask")?"—":s.symbolInfo.ask),1)])]),_:1},8,["disabled"])])):p("",!0),u(z)&&s.form.advancedEnabled?(o(),r("div",ie,[n(y,{color:"danger",size:"md",class:"flex-1",disabled:!u(H),onClick:x[5]||(x[5]=e=>N("sell"))},{default:v(()=>[...x[20]||(x[20]=[c(" SELL ",-1)])]),_:1},8,["disabled"]),n(y,{color:"success",size:"md",class:"flex-1",disabled:!u(H),onClick:x[6]||(x[6]=e=>N("buy"))},{default:v(()=>[...x[21]||(x[21]=[c(" BUY ",-1)])]),_:1},8,["disabled"])])):p("",!0),n(P,{class:"m-0"}),n(D,{advanced:s.form.advancedEnabled,"stop-loss-enabled":s.form.stopLossEnabled,"stop-loss-value":s.form.stopLossValue,"take-profit-enabled":s.form.takeProfitEnabled,"take-profit-value":s.form.takeProfitValue,comment:s.form.comment,"comment-max":s.form.commentMaxLength,disabled:!u(H),"onUpdate:advanced":x[7]||(x[7]=e=>u(H)&&f("update:advanced",e)),"onUpdate:stopLossEnabled":x[8]||(x[8]=e=>u(H)&&f("update:stopLossEnabled",e)),"onUpdate:stopLossValue":x[9]||(x[9]=e=>u(H)&&f("update:stopLossValue",e)),"onUpdate:takeProfitEnabled":x[10]||(x[10]=e=>u(H)&&f("update:takeProfitEnabled",e)),"onUpdate:takeProfitValue":x[11]||(x[11]=e=>u(H)&&f("update:takeProfitValue",e)),"onUpdate:comment":x[12]||(x[12]=e=>u(H)&&f("update:comment",e))},null,8,["advanced","stop-loss-enabled","stop-loss-value","take-profit-enabled","take-profit-value","comment","comment-max","disabled"]),u(S)?p("",!0):(o(),r("div",ne,[d("div",pe,[n(u(k),{size:14}),d("span",null,m(s.symbolInfo.symbol)+" is not tradable — order submission blocked",1)])])),!u(z)||s.form.advancedEnabled?(o(),r("div",me,[n(y,{color:"success",size:"lg",disabled:!u(H),class:"w-full",onClick:Y},{default:v(()=>[d("div",ue,[n(u(E)),x[22]||(x[22]=d("span",null,"Send Order",-1))])]),_:1},8,["disabled"])])):p("",!0)])])}}});export{ce as _,J as u};
1
+ import{_ as e}from"./EaeraDivider-Dggvc36a.mjs";import{_ as a}from"./EaeraButton-BPVKRBOn.mjs";import{_ as l}from"./EaeraSelect-C-sln89V.mjs";import{defineComponent as s,computed as t,openBlock as o,createElementBlock as r,createElementVNode as d,normalizeClass as i,createVNode as n,createCommentVNode as p,toDisplayString as m,unref as u,createTextVNode as c,Fragment as x,ref as b,withCtx as v}from"vue";import{_ as f}from"./EaeraInputNumber-COC6rdNn.mjs";import{Info as y,TriangleAlert as g,Ban as k,Send as E}from"@lucide/vue";import{_ as P}from"./EaeraInput-CkbcAxy0.mjs";import{_ as w}from"./EaeraCheckbox-C_faN0pV.mjs";import{_ as L}from"./EaeraSwitch-BI3E0zPf.mjs";const _={key:0,class:"flex flex-row gap-lg w-full"},V={key:0,class:"flex flex-col gap-xs flex-1 min-w-0"},T={key:1,class:"flex flex-col gap-xs flex-1 min-w-0"},B=s({__name:"OrderPriceRow",props:{orderType:{},price:{},stopLimitPrice:{},priceError:{type:Boolean},disabled:{type:Boolean}},emits:["update:price","update:stopLimitPrice"],setup(e,{emit:a}){const l=e,s=a,m=["buy_stop_limit","sell_stop_limit"],u=["market"],c=t(()=>!u.includes(l.orderType)),x=t(()=>m.includes(l.orderType));return(a,l)=>{const t=f;return c.value||x.value?(o(),r("div",_,[c.value?(o(),r("div",V,[d("span",{class:i(["text-label-md",e.priceError?"text-[var(--er-text-danger)]":"text-[var(--er-text-primary)]"])}," Price ",2),n(t,{value:e.price,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:1e-5,disabled:e.disabled},class:i(["w-full",e.priceError?"ring-1 ring-[var(--er-text-danger)]":""]),onHandleChange:l[0]||(l[0]=e=>s("update:price",e??0))},null,8,["value","other-props","class"])])):p("",!0),x.value?(o(),r("div",T,[l[2]||(l[2]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Stop Limit Price",-1)),n(t,{value:e.stopLimitPrice,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:1e-5,disabled:e.disabled},class:"w-full",onHandleChange:l[1]||(l[1]=e=>s("update:stopLimitPrice",e??0))},null,8,["value","other-props"])])):p("",!0)])):p("",!0)}}}),z={class:"flex flex-col gap-xs w-full"},U={class:"flex items-center justify-between"},I={class:"flex items-center gap-1"},S={class:"text-body-xs text-[var(--er-text-secondary)]"},C={class:"text-body-xs text-[var(--er-text-secondary)]"},O=s({__name:"OrderVolumeRow",props:{volume:{},symbol:{},margin:{},pipValue:{},marginBlocked:{type:Boolean},pipBlocked:{type:Boolean},disabled:{type:Boolean}},emits:["update:volume"],setup(e,{emit:a}){const l=a;return(a,s)=>{const t=f;return o(),r("div",z,[d("div",U,[s[1]||(s[1]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Volume",-1)),d("div",I,[d("span",S,m(e.symbol),1),n(u(y),{size:12,class:"text-[var(--er-icon-secondary)]"})])]),n(t,{value:e.volume,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:.01,disabled:e.disabled},class:"w-full",onHandleChange:s[0]||(s[0]=e=>l("update:volume",e??0))},null,8,["value","other-props"]),d("span",C,[s[2]||(s[2]=c(" Margin ",-1)),d("span",{class:i(e.marginBlocked?"text-[var(--er-text-muted)]":"")},m(e.marginBlocked?"—":e.margin),3),s[3]||(s[3]=c(" / Pip Value ",-1)),d("span",{class:i(e.pipBlocked?"text-[var(--er-text-muted)]":"")},m(e.pipBlocked?"—":e.pipValue),3)])])}}}),j={class:"flex flex-col gap-md w-full"},H={class:"flex items-center gap-xs"},M={class:"flex flex-row gap-lg w-full"},A={class:"flex flex-col gap-xs flex-1 min-w-0"},q={class:"flex items-center gap-xs"},F={class:"flex flex-col gap-xs flex-1 min-w-0"},R={class:"flex items-center justify-end gap-xs"},W={class:"flex flex-col gap-xs w-full"},N={class:"flex items-center gap-xs"},Y={class:"text-body-xs text-[var(--er-text-secondary)] ml-auto"},D=s({__name:"OrderAdvancedPanel",props:{advanced:{type:Boolean},stopLossEnabled:{type:Boolean},stopLossValue:{},takeProfitEnabled:{type:Boolean},takeProfitValue:{},comment:{},commentMax:{},disabled:{type:Boolean}},emits:["update:advanced","update:stopLossEnabled","update:stopLossValue","update:takeProfitEnabled","update:takeProfitValue","update:comment"],setup(e,{emit:a}){const l=a;return(a,s)=>{const t=L,i=w,u=f,c=P;return o(),r("div",j,[d("div",H,[s[6]||(s[6]=d("span",{class:"text-label-md text-[var(--er-text-brand)]"},"Advanced",-1)),n(t,{"model-value":e.advanced,size:"sm",disabled:e.disabled,"onUpdate:modelValue":s[0]||(s[0]=e=>l("update:advanced",e))},null,8,["model-value","disabled"])]),e.advanced?(o(),r(x,{key:0},[d("div",M,[d("div",A,[d("div",q,[n(i,{"model-value":e.stopLossEnabled,size:"sm",color:"success",disabled:e.disabled,"onUpdate:modelValue":s[1]||(s[1]=e=>l("update:stopLossEnabled",e))},null,8,["model-value","disabled"]),s[7]||(s[7]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Stop Loss",-1))]),n(u,{value:e.stopLossValue,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:1e-5,disabled:e.disabled||!e.stopLossEnabled},class:"w-full",onHandleChange:s[2]||(s[2]=e=>l("update:stopLossValue",e??0))},null,8,["value","other-props"])]),d("div",F,[d("div",R,[s[8]||(s[8]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Take Profit",-1)),n(i,{"model-value":e.takeProfitEnabled,size:"sm",disabled:e.disabled,"onUpdate:modelValue":s[3]||(s[3]=e=>l("update:takeProfitEnabled",e))},null,8,["model-value","disabled"])]),n(u,{value:e.takeProfitValue,placeholder:"0",controls:!0,size:"sm","other-props":{min:0,step:1e-5,disabled:e.disabled||!e.takeProfitEnabled},class:"w-full",onHandleChange:s[4]||(s[4]=e=>l("update:takeProfitValue",e??0))},null,8,["value","other-props"])])]),d("div",W,[d("div",N,[s[9]||(s[9]=d("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Comment",-1)),d("span",Y,m((e.comment||"").length)+"/"+m(e.commentMax),1)]),n(c,{value:e.comment,placeholder:"Add comment",size:"sm",disabled:e.disabled,class:"w-full",onHandleChange:s[5]||(s[5]=e=>l("update:comment",e))},null,8,["value","disabled"])])],64)):p("",!0)])}}}),G=["market","buy_limit","sell_limit","buy_stop","sell_stop","buy_stop_limit","sell_stop_limit"];function J(e,a,l,s){const o=b(!1),r=b(!1),d=t(()=>"market"===e.value.orderType),i=t(()=>{const l=a.value.find(a=>a.value===e.value.orderType);return l?.label??e.value.orderType}),n=t(()=>a.value.map(e=>({label:e.label,value:e.value}))),p=t(()=>l.value.isTradable),m=t(()=>!d.value),u=t(()=>m.value&&e.value.price<=0),c=t(()=>e.value.volume<=0),x=t(()=>!s.value&&p.value&&!c.value&&!u.value),v=t(()=>r.value&&u.value),f=e=>{r.value=!0,x.value&&(r.value=!1,e())},y=t(()=>!s.value&&p.value);return{showUnsupportedWarning:o,handleOrderTypeChange:(e,a)=>{if(!(e=>G.includes(e))(e))return o.value=!0,void setTimeout(()=>{o.value=!1},3e3);o.value=!1,a(e)},isMarket:d,orderTypeLabel:i,orderTypeOptions:n,isTradable:p,isPriceRequired:m,isPriceInvalid:u,isVolumeInvalid:c,showPriceError:v,canSubmit:x,isFieldBlocked:e=>l.value.blockedFields.includes(e),canEditOrder:y,handleBuy:e=>{f(e)},handleSell:e=>{f(e)},handleSubmit:e=>{f(e)}}}const K={class:"flex flex-col gap-md w-full"},Q={key:0,class:"flex items-center gap-xs bg-[var(--er-surface-warning)] rounded-sm p-sm"},X={class:"flex items-center gap-xs text-body-sm text-[var(--er-text-warning)]"},Z={class:"flex flex-col gap-md w-full"},$={key:0,class:"flex items-center gap-xs bg-[var(--er-surface-warning)] rounded-sm p-sm"},ee={class:"flex items-center gap-xs text-body-sm text-[var(--er-text-warning)]"},ae={key:1,class:"flex items-center gap-xs text-body-xs text-[var(--er-text-danger)]"},le={key:2,class:"flex items-center gap-xs"},se={key:3,class:"flex flex-row gap-md w-full"},te={class:"flex flex-col"},oe={class:"text-body-xs opacity-80"},re={class:"flex flex-col"},de={class:"text-body-xs opacity-80"},ie={key:4,class:"flex flex-row gap-sm w-full"},ne={key:5,class:"flex items-center justify-center gap-xs bg-[var(--er-surface-danger)] rounded-sm p-sm"},pe={class:"flex items-center gap-xs text-body-sm text-[var(--er-text-danger)]"},me={key:6},ue={class:"flex items-center gap-xs"},ce=s({__name:"index",props:{symbolInfo:{},symbolState:{},form:{},orderTypes:{},readOnly:{type:Boolean}},emits:["update:orderType","update:price","update:stopLimitPrice","update:volume","update:advanced","update:stopLossEnabled","update:stopLossValue","update:takeProfitEnabled","update:takeProfitValue","update:comment","submit"],setup(s,{emit:x}){const b=s,f=x,y=t(()=>b.form),P=t(()=>b.orderTypes),w=t(()=>b.symbolState),L=t(()=>b.readOnly),_=t(()=>b.readOnly),{showUnsupportedWarning:V,handleOrderTypeChange:T,isMarket:z,orderTypeLabel:U,orderTypeOptions:I,isTradable:S,showPriceError:C,isFieldBlocked:j,canEditOrder:H,handleBuy:M,handleSell:A,handleSubmit:q}=J(y,P,w,L),F=e=>{T(e,e=>f("update:orderType",e))},R=e=>String(e).replace(",","."),W=e=>{const a=b.form,l="market"===a.orderType,s=R(l?"buy"===e?b.symbolInfo.ask:b.symbolInfo.bid:a.price);return{side:e,symbol:b.symbolInfo.symbol,orderType:a.orderType,volume:a.volume,executionPrice:s,stopLoss:a.stopLossEnabled?a.stopLossValue:void 0,takeProfit:a.takeProfitEnabled?a.takeProfitValue:void 0,comment:a.comment}},N=e=>{"buy"===e?M(()=>f("submit",W("buy"))):A(()=>f("submit",W("sell")))},Y=()=>{const e=b.form.orderType.startsWith("sell_")?"sell":"buy";q(()=>f("submit",W(e)))};return(t,x)=>{const b=l,y=a,P=e;return o(),r("div",K,[u(V)?(o(),r("div",Q,[d("div",X,[n(u(g),{size:14}),x[13]||(x[13]=d("span",null,"Unsupported order type requested. Staying on previous type.",-1))])])):p("",!0),d("div",Z,[_.value?(o(),r("div",$,[d("div",ee,[n(u(g),{size:14}),x[14]||(x[14]=d("span",null,"No active account selected — trading actions are unavailable.",-1))])])):p("",!0),n(b,{"model-value":s.form.orderType,options:u(I),size:"sm",class:"w-full",disabled:!u(H),"onUpdate:modelValue":F},null,8,["model-value","options","disabled"]),n(B,{"order-type":s.form.orderType,price:s.form.price,"stop-limit-price":s.form.stopLimitPrice,"price-error":u(C),disabled:!u(H),"onUpdate:price":x[0]||(x[0]=e=>u(H)&&f("update:price",e)),"onUpdate:stopLimitPrice":x[1]||(x[1]=e=>u(H)&&f("update:stopLimitPrice",e))},null,8,["order-type","price","stop-limit-price","price-error","disabled"]),u(C)?(o(),r("div",ae,[n(u(g),{size:14}),d("span",null,"Price is required for "+m(u(U)),1)])):p("",!0),u(z)?p("",!0):(o(),r("div",le,[x[15]||(x[15]=d("span",{class:"text-caption-sm text-[var(--er-text-primary)]"},"Bid",-1)),d("span",{class:i(["text-body-xs",u(j)("bid")?"text-[var(--er-text-muted)]":"text-[var(--er-text-secondary)]"])},m(u(j)("bid")?"—":s.symbolInfo.bid),3),x[16]||(x[16]=d("span",{class:"text-body-xs text-[var(--er-text-secondary)]"},"/",-1)),x[17]||(x[17]=d("span",{class:"text-caption-sm text-[var(--er-text-primary)]"},"Ask",-1)),d("span",{class:i(["text-body-xs",u(j)("ask")?"text-[var(--er-text-muted)]":"text-[var(--er-text-secondary)]"])},m(u(j)("ask")?"—":s.symbolInfo.ask),3)])),n(O,{volume:s.form.volume,symbol:s.symbolInfo.symbol,margin:s.symbolInfo.margin,"pip-value":s.symbolInfo.pipValue,"margin-blocked":u(j)("margin"),"pip-blocked":u(j)("pipValue"),disabled:!u(H),"onUpdate:volume":x[2]||(x[2]=e=>u(H)&&f("update:volume",e))},null,8,["volume","symbol","margin","pip-value","margin-blocked","pip-blocked","disabled"]),u(z)&&!s.form.advancedEnabled?(o(),r("div",se,[n(y,{color:"danger",size:"lg",class:"flex-1 flex-col !h-auto py-sm",disabled:!u(H),onClick:x[3]||(x[3]=e=>N("sell"))},{default:v(()=>[d("div",te,[x[18]||(x[18]=d("span",{class:"text-label-lg"},"SELL",-1)),d("span",oe,m(u(j)("bid")?"—":s.symbolInfo.bid),1)])]),_:1},8,["disabled"]),n(y,{color:"success",size:"lg",class:"flex-1 flex-col !h-auto py-sm",disabled:!u(H),onClick:x[4]||(x[4]=e=>N("buy"))},{default:v(()=>[d("div",re,[x[19]||(x[19]=d("span",{class:"text-label-lg"},"BUY",-1)),d("span",de,m(u(j)("ask")?"—":s.symbolInfo.ask),1)])]),_:1},8,["disabled"])])):p("",!0),u(z)&&s.form.advancedEnabled?(o(),r("div",ie,[n(y,{color:"danger",size:"md",class:"flex-1",disabled:!u(H),onClick:x[5]||(x[5]=e=>N("sell"))},{default:v(()=>[...x[20]||(x[20]=[c(" SELL ",-1)])]),_:1},8,["disabled"]),n(y,{color:"success",size:"md",class:"flex-1",disabled:!u(H),onClick:x[6]||(x[6]=e=>N("buy"))},{default:v(()=>[...x[21]||(x[21]=[c(" BUY ",-1)])]),_:1},8,["disabled"])])):p("",!0),n(P,{class:"m-0"}),n(D,{advanced:s.form.advancedEnabled,"stop-loss-enabled":s.form.stopLossEnabled,"stop-loss-value":s.form.stopLossValue,"take-profit-enabled":s.form.takeProfitEnabled,"take-profit-value":s.form.takeProfitValue,comment:s.form.comment,"comment-max":s.form.commentMaxLength,disabled:!u(H),"onUpdate:advanced":x[7]||(x[7]=e=>u(H)&&f("update:advanced",e)),"onUpdate:stopLossEnabled":x[8]||(x[8]=e=>u(H)&&f("update:stopLossEnabled",e)),"onUpdate:stopLossValue":x[9]||(x[9]=e=>u(H)&&f("update:stopLossValue",e)),"onUpdate:takeProfitEnabled":x[10]||(x[10]=e=>u(H)&&f("update:takeProfitEnabled",e)),"onUpdate:takeProfitValue":x[11]||(x[11]=e=>u(H)&&f("update:takeProfitValue",e)),"onUpdate:comment":x[12]||(x[12]=e=>u(H)&&f("update:comment",e))},null,8,["advanced","stop-loss-enabled","stop-loss-value","take-profit-enabled","take-profit-value","comment","comment-max","disabled"]),u(S)?p("",!0):(o(),r("div",ne,[d("div",pe,[n(u(k),{size:14}),d("span",null,m(s.symbolInfo.symbol)+" is not tradable — order submission blocked",1)])])),!u(z)||s.form.advancedEnabled?(o(),r("div",me,[n(y,{color:"success",size:"lg",disabled:!u(H),class:"w-full",onClick:Y},{default:v(()=>[d("div",ue,[n(u(E)),x[22]||(x[22]=d("span",null,"Send Order",-1))])]),_:1},8,["disabled"])])):p("",!0)])])}}});export{ce as _,J as u};
@@ -1 +1 @@
1
- import{_ as e}from"./EaeraTableV2-CyfoAwDF.mjs";import{_ as l}from"./EaeraTag-DsDZxISm.mjs";import{_ as t}from"./EaeraSelect-BxZRZofe.mjs";import{_ as s}from"./EaeraButton-BPVKRBOn.mjs";import{_ as a}from"./EaeraInput-CkbcAxy0.mjs";import{defineComponent as o,openBlock as i,createBlock as r,withCtx as n,createElementVNode as c,createVNode as d,createTextVNode as m,createElementBlock as u,normalizeClass as v,toDisplayString as b,createCommentVNode as y,ref as p,shallowRef as g,computed as x,unref as f,withModifiers as C,resolveDynamicComponent as w}from"vue";import{X as L,Plus as S,ArrowUp as k,ArrowDown as _,ArrowDownUp as A,Star as N,ListPlus as $}from"@lucide/vue";import{_ as j}from"./EaeraDialog-uLsXC20k.mjs";import{a as D}from"./vendor-vueuse-core-B96HGhR7.mjs";import{b as z}from"./iconSvg-B2wrn2gi.mjs";const T={class:"flex flex-col gap-xs"},R={class:"m-0 text-title-md text-[var(--er-text-primary)]"},O={class:"flex w-full flex-col gap-md py-sm"},V={class:"flex justify-end gap-sm"},I=o({__name:"AddSymbolToListDialog",props:{dialogVisible:{type:Boolean},symbol:{},selectedListId:{},customListOptions:{},message:{},canAdd:{type:Boolean}},emits:["close","add","update:selectedListId"],setup(e,{emit:l}){const a=l;return(l,o)=>{const p=t,g=s,x=j;return i(),r(x,{"dialog-visible":e.dialogVisible,width:"400px","append-body":"","destroy-on-close":"","close-on-click-modal":!1,onClose:o[3]||(o[3]=e=>a("close"))},{header:n(()=>[c("div",T,[c("p",R," Add "+b(e.symbol?.symbol)+" to list ",1),o[4]||(o[4]=c("p",{class:"m-0 text-body-xs text-[var(--er-text-secondary)]"}," Existing memberships are kept unique. ",-1))])]),default:n(()=>[c("div",O,[d(p,{value:e.selectedListId,options:e.customListOptions,placeholder:"Select custom list","translate-label":!1,size:"md",class:"w-full",onChange:o[0]||(o[0]=e=>a("update:selectedListId",e))},null,8,["value","options"]),e.message?(i(),u("p",{key:0,class:v(["m-0 text-body-xs",e.message.includes("already")?"text-[var(--er-text-warning)]":"text-[var(--er-text-success)]"])},b(e.message),3)):y("",!0)])]),footer:n(()=>[c("div",V,[d(g,{color:"contrast",onClick:o[1]||(o[1]=e=>a("close"))},{default:n(()=>[...o[5]||(o[5]=[m("Close",-1)])]),_:1}),d(g,{color:"primary",disabled:!e.canAdd,onClick:o[2]||(o[2]=e=>a("add"))},{default:n(()=>[...o[6]||(o[6]=[m(" Add ",-1)])]),_:1},8,["disabled"])])]),_:1},8,["dialog-visible"])}}}),M={class:"flex flex-col gap-md py-sm"},F={class:"flex flex-col gap-xs"},E={class:"flex flex-col gap-xs"},U={key:0,class:"m-0 text-body-xs text-[var(--er-text-danger)]"},P={class:"flex justify-end gap-sm"},H=o({__name:"CreateCustomListDialog",props:{dialogVisible:{type:Boolean},listName:{},selectedSymbols:{},symbolOptions:{},error:{}},emits:["close","create","update:listName","update:selectedSymbols"],setup(e,{emit:l}){const o=l,v=e=>{o("update:selectedSymbols",e)};return(l,p)=>{const g=a,x=t,f=s,C=j;return i(),r(C,{"dialog-visible":e.dialogVisible,width:"420px","append-body":"","destroy-on-close":"","close-on-click-modal":!1,onClose:p[3]||(p[3]=e=>o("close"))},{header:n(()=>[...p[4]||(p[4]=[c("div",{class:"flex flex-col gap-xs"},[c("p",{class:"m-0 text-title-md text-[var(--er-text-primary)]"},"Create custom list"),c("p",{class:"m-0 text-body-xs text-[var(--er-text-secondary)]"}," Save a reusable set of symbols for Market Watch. ")],-1)])]),default:n(()=>[c("div",M,[c("div",F,[p[5]||(p[5]=c("span",{class:"text-label-md text-[var(--er-text-primary)]"},"List name",-1)),d(g,{value:e.listName,placeholder:"London Open",size:"md",onHandleChange:p[0]||(p[0]=e=>o("update:listName",e))},null,8,["value"])]),c("div",E,[p[6]||(p[6]=c("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Symbols",-1)),d(x,{value:e.selectedSymbols,options:e.symbolOptions,multiple:"",filterable:"",clearable:"",size:"md",class:"w-full",onChange:v},null,8,["value","options"])]),e.error?(i(),u("p",U,b(e.error),1)):y("",!0)])]),footer:n(()=>[c("div",P,[d(f,{color:"contrast",onClick:p[1]||(p[1]=e=>o("close"))},{default:n(()=>[...p[7]||(p[7]=[m("Cancel",-1)])]),_:1}),d(f,{color:"primary",onClick:p[2]||(p[2]=e=>o("create"))},{default:n(()=>[...p[8]||(p[8]=[m("Create",-1)])]),_:1})])]),_:1},8,["dialog-visible"])}}}),B="archived-commodities",q="custom:",K=["symbol","lastPrice","volume"],W=[{label:"All Symbols",value:"all"},{label:"Favorites",value:"favorites"},{label:"Forex Majors",value:"forex-majors"},{label:"Metals",value:"metals"},{label:"Crypto",value:"crypto"},{label:"Archived Commodities",value:B,available:!1}],G={xauusd:["coin","usd"],xagusd:["coin","usd"]},J=[{key:"symbol",label:"Symbol",sortable:!0,sort_key:"symbol",minWidth:164,customHeaderClass:"flex justify-start items-center",headerLabelClass:"text-label-md text-[var(--er-text-secondary)]",cellClass:"watchlist-symbol-column",align:"left"},{key:"lastPrice",label:"Last Price",sortable:!0,sort_key:"lastPrice",width:104,align:"right",customHeaderClass:"flex justify-end items-center",headerLabelClass:"text-label-md text-[var(--er-text-secondary)]",cellClass:"watchlist-price-column"},{key:"volume",label:"Volume",sortable:!0,sort_key:"volume",width:88,align:"right",customHeaderClass:"flex justify-end items-center",headerLabelClass:"text-label-md text-[var(--er-text-secondary)]",cellClass:"watchlist-price-column"}],Q=e=>`${q}${e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}-${Date.now()}`,X=e=>!!e&&K.includes(e);function Y(e,l){const t=p("all"),s=p(0),a=p(""),o=p({}),i=p(""),r=p(!1),n=p(""),c=p([]),d=p(""),m=p(!1),u=p(null),v=p(void 0),b=p(""),y=p({}),f=p([{id:`${q}metals-watch`,name:"Metals Watch",symbols:[]}]),C=g(null),w=g(null),{height:L}=D(C),{height:S}=D(w),k=x(()=>{const l=new Map;return e().forEach(e=>{l.has(e.symbol)||l.set(e.symbol,e)}),l}),_=x(()=>Array.from(k.value.values()).map(e=>({label:e.symbol,value:e.symbol}))),A=x(()=>f.value.map(e=>({label:e.name,value:e.id}))),N=x(()=>A.value),$=x(()=>[...W,...f.value.map(e=>({label:e.name,value:e.id,available:!0}))]),j=x(()=>Z(t.value)),z=x(()=>{if("favorites"===t.value)return e().filter(e=>P(e));if("all"===t.value)return e();const l=Z(t.value);return l?l.symbols.map(e=>k.value.get(e)).filter(e=>!!e):e().filter(e=>e.category===t.value)}),T=x(()=>{const e=a.value.trim().toLowerCase(),l=z.value.map(H);return e?l.filter(l=>l.symbol.toLowerCase().includes(e)||l.name.toLowerCase().includes(e)):l}),R=x(()=>{if(!L.value)return;const e=S.value+16,l=Math.floor(L.value-e);return Math.max(160,l)}),O=x(()=>{const e=o.value.key,l=o.value.direction;return X(e)&&l?[...T.value].sort((t,s)=>{const a=M(t,e),o=M(s,e),i=F(a,o);return"asc"===l?i:-i}):T.value}),V=x(()=>{const e=a.value.trim();if(e&&0===O.value.length)return`No symbols match “${e}” in the current view. Clear search to restore the list.`;const l=j.value;return l&&0===l.symbols.length?`${l.name} has no symbols. Add symbols to this list or choose another view.`:"No symbols match the current view."}),I=x(()=>f.value.length>0),M=(e,l)=>"lastPrice"===l||"volume"===l?E(e[l]):e.symbol,F=(e,l)=>"number"==typeof e&&"number"==typeof l?e-l:String(e).localeCompare(String(l)),E=e=>{const l=e.trim().toUpperCase(),t=l.endsWith("K")?1e3:l.endsWith("M")?1e6:1;return Number(l.replace(/,/g,"").replace(/[^\d.-]/g,""))*t||0},U=e=>{const l=e.symbol.toLowerCase(),t=G[l];return t||[l.slice(0,3),l.slice(3,6)||"usd"]},P=e=>y.value[e.symbol]??!!e.isFavorite,H=e=>({...e,isFavorite:P(e)}),K=()=>{r.value=!1,d.value=""},Y=()=>{m.value=!1,u.value=null,b.value=""},Z=e=>f.value.find(l=>l.id===e),ee=x(()=>{const e=j.value;return e?e.name:$.value.find(e=>e.value===t.value)?.label??"All Symbols"});return{selectedView:t,viewSelectRenderKey:s,searchText:a,sorting:o,viewNotice:i,createListDialogVisible:r,newListName:n,newListSymbols:c,createListError:d,addToListDialogVisible:m,symbolPendingListAdd:u,selectedCustomListId:v,addToListMessage:b,canAddToCustomList:I,panelBodyRef:C,filterControlsRef:w,viewOptions:$,tableFields:J,symbolOptions:_,customListOptions:A,customListSelectOptions:N,hasSelectedCustomList:()=>!!v.value,tableHeight:R,tableRows:O,emptyStateMessage:V,handleSymbolChange:(e,l)=>{l(e)},handleSearchChange:e=>{a.value=e},clearSearch:()=>{a.value=""},handleViewChange:e=>{const l=$.value.find(l=>l.value===e);if(!1===l?.available||e===B)return i.value=`${l?.label??e} is unavailable for this account. Current view remains ${ee.value}.`,void(s.value+=1);t.value=e,i.value=""},handleRowClick:(e,l)=>{l(e.symbol)},handleSortChanged:e=>{if(!e.key&&!e.direction)return o.value={},void(i.value="");X(String(e.key))?(o.value={key:e.key,direction:e.direction},i.value=""):i.value="Unsupported sort column ignored. Keeping the prior ordering."},getRowClass:({row:e})=>e.symbol===l()?"watchlist-row is-active":"watchlist-row",sortDirection:e=>{if(X(e)&&o.value.key===e)return o.value.direction},baseIcon:e=>U(e)[0],quoteIcon:e=>U(e)[1],toggleFavorite:e=>{y.value={...y.value,[e.symbol]:!P(e)}},openCreateListDialog:()=>{r.value=!0,n.value="",c.value=[],d.value=""},closeCreateListDialog:K,handleNewListNameChange:e=>{n.value=e,d.value=""},handleNewListSymbolsChange:e=>{c.value=Array.isArray(e)?e:e?[e]:[],d.value=""},createCustomList:()=>{const e=(e=>e.trim().replace(/\s+/g," "))(n.value);if(!e)return void(d.value="List name is required.");if(f.value.some(l=>l.name.trim().toLowerCase()===e.toLowerCase()))return void(d.value="List names must be unique.");const l=Array.from(new Set(c.value)),s={id:Q(e),name:e,symbols:l};f.value=[...f.value,s],t.value=s.id,i.value=`${e} created with ${l.length} symbol${1===l.length?"":"s"}.`,K()},openAddToListDialog:e=>{u.value=e,v.value=void 0,b.value="",m.value=!0},closeAddToListDialog:Y,handleSelectedCustomListChange:e=>{v.value=e||void 0,b.value=""},addSymbolToSelectedList:()=>{const e=u.value?.symbol,l=v.value,s=l?Z(l):void 0;e&&s?s.symbols.includes(e)?b.value=`${e} is already in ${s.name}.`:(f.value=f.value.map(l=>l.id===s.id?{...l,symbols:[...l.symbols,e]}:l),t.value=s.id,Y(),i.value=`${e} added to ${s.name}.`):b.value="Select a custom list first."},resetCategory:()=>{t.value="all",i.value=""},resetSort:()=>{o.value={}}}}const Z={class:"grid grid-cols-2 gap-lg"},ee={class:"flex items-center justify-center gap-xs"},le={key:0,class:"rounded-xs bg-[var(--er-surface-warning)] px-sm py-xs text-body-xs text-[var(--er-text-warning)]"},te={class:"watchlist-symbol-cell flex items-center gap-sm"},se={class:"watchlist-symbol-badge","aria-hidden":"true"},ae={class:"watchlist-symbol-meta flex-1"},oe={class:"flex items-center gap-xs"},ie={class:"whitespace-nowrap text-body-sm text-[var(--er-text-primary)]"},re=["aria-label","onClick"],ne=["disabled","aria-label","onClick"],ce={class:"watchlist-symbol-name text-body-xs text-[var(--er-text-secondary)]"},de={class:"watchlist-price-cell text-body-xs text-[var(--er-text-primary)]"},me={class:"watchlist-price-cell text-body-xs text-[var(--er-text-primary)]"},ue={class:"flex h-[120px] items-center justify-center px-md text-center text-body-sm text-[var(--er-text-secondary)]"},ve=o({__name:"index",props:{symbols:{},selectedSymbol:{}},emits:["selectSymbol"],setup(o,{expose:p,emit:g}){const x=o,j=g,{selectedView:D,viewSelectRenderKey:T,searchText:R,viewNotice:O,createListDialogVisible:V,newListName:M,newListSymbols:F,createListError:E,addToListDialogVisible:U,symbolPendingListAdd:P,selectedCustomListId:B,addToListMessage:q,canAddToCustomList:K,panelBodyRef:W,filterControlsRef:G,viewOptions:J,tableFields:Q,symbolOptions:X,customListOptions:ve,customListSelectOptions:be,hasSelectedCustomList:ye,tableHeight:pe,tableRows:ge,emptyStateMessage:he,handleSearchChange:xe,clearSearch:fe,handleViewChange:Ce,handleRowClick:we,handleSortChanged:Le,getRowClass:Se,sortDirection:ke,baseIcon:_e,quoteIcon:Ae,toggleFavorite:Ne,openCreateListDialog:$e,closeCreateListDialog:je,handleNewListNameChange:De,handleNewListSymbolsChange:ze,createCustomList:Te,openAddToListDialog:Re,closeAddToListDialog:Oe,handleSelectedCustomListChange:Ve,addSymbolToSelectedList:Ie,resetCategory:Me,resetSort:Fe}=Y(()=>x.symbols,()=>x.selectedSymbol),Ee=e=>{we(e,e=>j("selectSymbol",e))};return p({resetCategory:Me,resetSort:Fe}),(o,p)=>{const g=a,x=s,j=t,Y=l,ve=e;return i(),u("div",{ref_key:"panelBodyRef",ref:W,class:"h-full min-h-0 flex flex-col gap-lg bg-[var(--er-surface-container)] px-sm py-md"},[c("div",{ref_key:"filterControlsRef",ref:G,class:"flex flex-col gap-sm"},[c("div",Z,[d(g,{value:f(R),placeholder:"Search symbol",size:"md",class:"watchlist-input-control w-full",onHandleChange:f(xe)},{suffix:n(()=>[f(R)?(i(),u("button",{key:0,type:"button",class:"watchlist-clear-button","aria-label":"Clear symbol search",onClick:p[0]||(p[0]=C((...e)=>f(fe)&&f(fe)(...e),["stop"]))},[d(f(L),{size:14})])):y("",!0)]),_:1},8,["value","onHandleChange"]),(i(),r(j,{key:f(T),value:f(D),options:f(J),size:"md",class:"watchlist-control w-full",onChange:f(Ce)},{footer:n(()=>[d(x,{size:"sm",color:"contrast",background:!1,class:"w-full",onClick:f($e)},{default:n(()=>[c("div",ee,[d(f(S),{size:14}),p[1]||(p[1]=c("span",null,"Create custom list",-1))])]),_:1},8,["onClick"])]),_:1},8,["value","options","onChange"]))]),f(O)?(i(),u("div",le,b(f(O)),1)):y("",!0)],512),d(ve,{class:"watchlist-custom-table min-h-0 flex-1","allow-sort-reset":"","hide-footer":"",height:f(pe),"max-height":f(pe),"table-layout":"fixed",size:"small",items:f(ge),fields:f(Q),"total-rows":f(ge).length,stripe:!1,"show-filter-by-default":!1,"row-class-name":f(Se),onOnRowClick:Ee,"onUpdate:onSortChanged":f(Le)},{"cell(symbol)":n(({item:e})=>[c("div",te,[c("div",se,[(i(),r(w(f(z)(f(_e)(e))),{size:18,class:"watchlist-symbol-badge-icon watchlist-symbol-badge-icon--base"})),(i(),r(w(f(z)(f(Ae)(e))),{size:18,class:"watchlist-symbol-badge-icon watchlist-symbol-badge-icon--quote"}))]),c("div",ae,[c("div",oe,[c("span",ie,b(e.symbol),1),c("button",{type:"button",class:"watchlist-row-action","aria-label":e.isFavorite?`Remove ${e.symbol} from favorites`:`Add ${e.symbol} to favorites`,onClick:C(l=>f(Ne)(e),["stop"])},[d(f(N),{size:16,"stroke-width":1.8,fill:e.isFavorite?"var(--er-text-warning)":"none",class:v(e.isFavorite?"text-[var(--er-text-warning)]":"text-[var(--er-icon-secondary)]")},null,8,["fill","class"])],8,re),c("button",{type:"button",class:"watchlist-row-action",disabled:!f(K),"aria-label":`Add ${e.symbol} to a custom list`,onClick:C(l=>f(Re)(e),["stop"])},[d(f($),{size:15})],8,ne),"closed"===e.marketStatus?(i(),r(Y,{key:0,color:"warning",size:"sm"},{default:n(()=>[...p[2]||(p[2]=[m(" Closed ",-1)])]),_:1})):y("",!0)]),c("p",ce,b(e.name),1)])])]),"cell(lastPrice)":n(({item:e})=>[c("span",de,b(e.lastPrice),1)]),"cell(volume)":n(({item:e})=>[c("span",me,b(e.volume),1)]),"sort-icon":n(({sortKey:e})=>["asc"===f(ke)(e)?(i(),r(f(k),{key:0})):"desc"===f(ke)(e)?(i(),r(f(_),{key:1,size:16})):(i(),r(f(A),{key:2,size:16}))]),empty:n(()=>[c("div",ue,b(f(he)),1)]),_:1},8,["height","max-height","items","fields","total-rows","row-class-name","onUpdate:onSortChanged"]),d(H,{"dialog-visible":f(V),"list-name":f(M),"selected-symbols":f(F),"symbol-options":f(X),error:f(E),onClose:f(je),onCreate:f(Te),"onUpdate:listName":f(De),"onUpdate:selectedSymbols":f(ze)},null,8,["dialog-visible","list-name","selected-symbols","symbol-options","error","onClose","onCreate","onUpdate:listName","onUpdate:selectedSymbols"]),d(I,{"dialog-visible":f(U),symbol:f(P),"selected-list-id":f(B),"custom-list-options":f(be),message:f(q),"can-add":f(ye)(),onClose:f(Oe),onAdd:f(Ie),"onUpdate:selectedListId":f(Ve)},null,8,["dialog-visible","symbol","selected-list-id","custom-list-options","message","can-add","onClose","onAdd","onUpdate:selectedListId"])],512)}}});export{ve as _,Y as u};
1
+ import{_ as e}from"./EaeraTableV2-CIeL4xlB.mjs";import{_ as l}from"./EaeraTag-DsDZxISm.mjs";import{_ as t}from"./EaeraSelect-C-sln89V.mjs";import{_ as s}from"./EaeraButton-BPVKRBOn.mjs";import{_ as a}from"./EaeraInput-CkbcAxy0.mjs";import{defineComponent as o,openBlock as i,createBlock as r,withCtx as n,createElementVNode as c,createVNode as d,createTextVNode as m,createElementBlock as u,normalizeClass as v,toDisplayString as b,createCommentVNode as y,ref as p,shallowRef as g,computed as x,unref as f,withModifiers as C,resolveDynamicComponent as w}from"vue";import{X as L,Plus as S,ArrowUp as k,ArrowDown as _,ArrowDownUp as A,Star as N,ListPlus as $}from"@lucide/vue";import{_ as j}from"./EaeraDialog-uLsXC20k.mjs";import{a as D}from"./vendor-vueuse-core-B96HGhR7.mjs";import{b as z}from"./iconSvg-B2wrn2gi.mjs";const T={class:"flex flex-col gap-xs"},R={class:"m-0 text-title-md text-[var(--er-text-primary)]"},O={class:"flex w-full flex-col gap-md py-sm"},V={class:"flex justify-end gap-sm"},I=o({__name:"AddSymbolToListDialog",props:{dialogVisible:{type:Boolean},symbol:{},selectedListId:{},customListOptions:{},message:{},canAdd:{type:Boolean}},emits:["close","add","update:selectedListId"],setup(e,{emit:l}){const a=l;return(l,o)=>{const p=t,g=s,x=j;return i(),r(x,{"dialog-visible":e.dialogVisible,width:"400px","append-body":"","destroy-on-close":"","close-on-click-modal":!1,onClose:o[3]||(o[3]=e=>a("close"))},{header:n(()=>[c("div",T,[c("p",R," Add "+b(e.symbol?.symbol)+" to list ",1),o[4]||(o[4]=c("p",{class:"m-0 text-body-xs text-[var(--er-text-secondary)]"}," Existing memberships are kept unique. ",-1))])]),default:n(()=>[c("div",O,[d(p,{value:e.selectedListId,options:e.customListOptions,placeholder:"Select custom list","translate-label":!1,size:"md",class:"w-full",onChange:o[0]||(o[0]=e=>a("update:selectedListId",e))},null,8,["value","options"]),e.message?(i(),u("p",{key:0,class:v(["m-0 text-body-xs",e.message.includes("already")?"text-[var(--er-text-warning)]":"text-[var(--er-text-success)]"])},b(e.message),3)):y("",!0)])]),footer:n(()=>[c("div",V,[d(g,{color:"contrast",onClick:o[1]||(o[1]=e=>a("close"))},{default:n(()=>[...o[5]||(o[5]=[m("Close",-1)])]),_:1}),d(g,{color:"primary",disabled:!e.canAdd,onClick:o[2]||(o[2]=e=>a("add"))},{default:n(()=>[...o[6]||(o[6]=[m(" Add ",-1)])]),_:1},8,["disabled"])])]),_:1},8,["dialog-visible"])}}}),M={class:"flex flex-col gap-md py-sm"},F={class:"flex flex-col gap-xs"},E={class:"flex flex-col gap-xs"},U={key:0,class:"m-0 text-body-xs text-[var(--er-text-danger)]"},P={class:"flex justify-end gap-sm"},H=o({__name:"CreateCustomListDialog",props:{dialogVisible:{type:Boolean},listName:{},selectedSymbols:{},symbolOptions:{},error:{}},emits:["close","create","update:listName","update:selectedSymbols"],setup(e,{emit:l}){const o=l,v=e=>{o("update:selectedSymbols",e)};return(l,p)=>{const g=a,x=t,f=s,C=j;return i(),r(C,{"dialog-visible":e.dialogVisible,width:"420px","append-body":"","destroy-on-close":"","close-on-click-modal":!1,onClose:p[3]||(p[3]=e=>o("close"))},{header:n(()=>[...p[4]||(p[4]=[c("div",{class:"flex flex-col gap-xs"},[c("p",{class:"m-0 text-title-md text-[var(--er-text-primary)]"},"Create custom list"),c("p",{class:"m-0 text-body-xs text-[var(--er-text-secondary)]"}," Save a reusable set of symbols for Market Watch. ")],-1)])]),default:n(()=>[c("div",M,[c("div",F,[p[5]||(p[5]=c("span",{class:"text-label-md text-[var(--er-text-primary)]"},"List name",-1)),d(g,{value:e.listName,placeholder:"London Open",size:"md",onHandleChange:p[0]||(p[0]=e=>o("update:listName",e))},null,8,["value"])]),c("div",E,[p[6]||(p[6]=c("span",{class:"text-label-md text-[var(--er-text-primary)]"},"Symbols",-1)),d(x,{value:e.selectedSymbols,options:e.symbolOptions,multiple:"",filterable:"",clearable:"",size:"md",class:"w-full",onChange:v},null,8,["value","options"])]),e.error?(i(),u("p",U,b(e.error),1)):y("",!0)])]),footer:n(()=>[c("div",P,[d(f,{color:"contrast",onClick:p[1]||(p[1]=e=>o("close"))},{default:n(()=>[...p[7]||(p[7]=[m("Cancel",-1)])]),_:1}),d(f,{color:"primary",onClick:p[2]||(p[2]=e=>o("create"))},{default:n(()=>[...p[8]||(p[8]=[m("Create",-1)])]),_:1})])]),_:1},8,["dialog-visible"])}}}),B="archived-commodities",q="custom:",K=["symbol","lastPrice","volume"],W=[{label:"All Symbols",value:"all"},{label:"Favorites",value:"favorites"},{label:"Forex Majors",value:"forex-majors"},{label:"Metals",value:"metals"},{label:"Crypto",value:"crypto"},{label:"Archived Commodities",value:B,available:!1}],G={xauusd:["coin","usd"],xagusd:["coin","usd"]},J=[{key:"symbol",label:"Symbol",sortable:!0,sort_key:"symbol",minWidth:164,customHeaderClass:"flex justify-start items-center",headerLabelClass:"text-label-md text-[var(--er-text-secondary)]",cellClass:"watchlist-symbol-column",align:"left"},{key:"lastPrice",label:"Last Price",sortable:!0,sort_key:"lastPrice",width:104,align:"right",customHeaderClass:"flex justify-end items-center",headerLabelClass:"text-label-md text-[var(--er-text-secondary)]",cellClass:"watchlist-price-column"},{key:"volume",label:"Volume",sortable:!0,sort_key:"volume",width:88,align:"right",customHeaderClass:"flex justify-end items-center",headerLabelClass:"text-label-md text-[var(--er-text-secondary)]",cellClass:"watchlist-price-column"}],Q=e=>`${q}${e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}-${Date.now()}`,X=e=>!!e&&K.includes(e);function Y(e,l){const t=p("all"),s=p(0),a=p(""),o=p({}),i=p(""),r=p(!1),n=p(""),c=p([]),d=p(""),m=p(!1),u=p(null),v=p(void 0),b=p(""),y=p({}),f=p([{id:`${q}metals-watch`,name:"Metals Watch",symbols:[]}]),C=g(null),w=g(null),{height:L}=D(C),{height:S}=D(w),k=x(()=>{const l=new Map;return e().forEach(e=>{l.has(e.symbol)||l.set(e.symbol,e)}),l}),_=x(()=>Array.from(k.value.values()).map(e=>({label:e.symbol,value:e.symbol}))),A=x(()=>f.value.map(e=>({label:e.name,value:e.id}))),N=x(()=>A.value),$=x(()=>[...W,...f.value.map(e=>({label:e.name,value:e.id,available:!0}))]),j=x(()=>Z(t.value)),z=x(()=>{if("favorites"===t.value)return e().filter(e=>P(e));if("all"===t.value)return e();const l=Z(t.value);return l?l.symbols.map(e=>k.value.get(e)).filter(e=>!!e):e().filter(e=>e.category===t.value)}),T=x(()=>{const e=a.value.trim().toLowerCase(),l=z.value.map(H);return e?l.filter(l=>l.symbol.toLowerCase().includes(e)||l.name.toLowerCase().includes(e)):l}),R=x(()=>{if(!L.value)return;const e=S.value+16,l=Math.floor(L.value-e);return Math.max(160,l)}),O=x(()=>{const e=o.value.key,l=o.value.direction;return X(e)&&l?[...T.value].sort((t,s)=>{const a=M(t,e),o=M(s,e),i=F(a,o);return"asc"===l?i:-i}):T.value}),V=x(()=>{const e=a.value.trim();if(e&&0===O.value.length)return`No symbols match “${e}” in the current view. Clear search to restore the list.`;const l=j.value;return l&&0===l.symbols.length?`${l.name} has no symbols. Add symbols to this list or choose another view.`:"No symbols match the current view."}),I=x(()=>f.value.length>0),M=(e,l)=>"lastPrice"===l||"volume"===l?E(e[l]):e.symbol,F=(e,l)=>"number"==typeof e&&"number"==typeof l?e-l:String(e).localeCompare(String(l)),E=e=>{const l=e.trim().toUpperCase(),t=l.endsWith("K")?1e3:l.endsWith("M")?1e6:1;return Number(l.replace(/,/g,"").replace(/[^\d.-]/g,""))*t||0},U=e=>{const l=e.symbol.toLowerCase(),t=G[l];return t||[l.slice(0,3),l.slice(3,6)||"usd"]},P=e=>y.value[e.symbol]??!!e.isFavorite,H=e=>({...e,isFavorite:P(e)}),K=()=>{r.value=!1,d.value=""},Y=()=>{m.value=!1,u.value=null,b.value=""},Z=e=>f.value.find(l=>l.id===e),ee=x(()=>{const e=j.value;return e?e.name:$.value.find(e=>e.value===t.value)?.label??"All Symbols"});return{selectedView:t,viewSelectRenderKey:s,searchText:a,sorting:o,viewNotice:i,createListDialogVisible:r,newListName:n,newListSymbols:c,createListError:d,addToListDialogVisible:m,symbolPendingListAdd:u,selectedCustomListId:v,addToListMessage:b,canAddToCustomList:I,panelBodyRef:C,filterControlsRef:w,viewOptions:$,tableFields:J,symbolOptions:_,customListOptions:A,customListSelectOptions:N,hasSelectedCustomList:()=>!!v.value,tableHeight:R,tableRows:O,emptyStateMessage:V,handleSymbolChange:(e,l)=>{l(e)},handleSearchChange:e=>{a.value=e},clearSearch:()=>{a.value=""},handleViewChange:e=>{const l=$.value.find(l=>l.value===e);if(!1===l?.available||e===B)return i.value=`${l?.label??e} is unavailable for this account. Current view remains ${ee.value}.`,void(s.value+=1);t.value=e,i.value=""},handleRowClick:(e,l)=>{l(e.symbol)},handleSortChanged:e=>{if(!e.key&&!e.direction)return o.value={},void(i.value="");X(String(e.key))?(o.value={key:e.key,direction:e.direction},i.value=""):i.value="Unsupported sort column ignored. Keeping the prior ordering."},getRowClass:({row:e})=>e.symbol===l()?"watchlist-row is-active":"watchlist-row",sortDirection:e=>{if(X(e)&&o.value.key===e)return o.value.direction},baseIcon:e=>U(e)[0],quoteIcon:e=>U(e)[1],toggleFavorite:e=>{y.value={...y.value,[e.symbol]:!P(e)}},openCreateListDialog:()=>{r.value=!0,n.value="",c.value=[],d.value=""},closeCreateListDialog:K,handleNewListNameChange:e=>{n.value=e,d.value=""},handleNewListSymbolsChange:e=>{c.value=Array.isArray(e)?e:e?[e]:[],d.value=""},createCustomList:()=>{const e=(e=>e.trim().replace(/\s+/g," "))(n.value);if(!e)return void(d.value="List name is required.");if(f.value.some(l=>l.name.trim().toLowerCase()===e.toLowerCase()))return void(d.value="List names must be unique.");const l=Array.from(new Set(c.value)),s={id:Q(e),name:e,symbols:l};f.value=[...f.value,s],t.value=s.id,i.value=`${e} created with ${l.length} symbol${1===l.length?"":"s"}.`,K()},openAddToListDialog:e=>{u.value=e,v.value=void 0,b.value="",m.value=!0},closeAddToListDialog:Y,handleSelectedCustomListChange:e=>{v.value=e||void 0,b.value=""},addSymbolToSelectedList:()=>{const e=u.value?.symbol,l=v.value,s=l?Z(l):void 0;e&&s?s.symbols.includes(e)?b.value=`${e} is already in ${s.name}.`:(f.value=f.value.map(l=>l.id===s.id?{...l,symbols:[...l.symbols,e]}:l),t.value=s.id,Y(),i.value=`${e} added to ${s.name}.`):b.value="Select a custom list first."},resetCategory:()=>{t.value="all",i.value=""},resetSort:()=>{o.value={}}}}const Z={class:"grid grid-cols-2 gap-lg"},ee={class:"flex items-center justify-center gap-xs"},le={key:0,class:"rounded-xs bg-[var(--er-surface-warning)] px-sm py-xs text-body-xs text-[var(--er-text-warning)]"},te={class:"watchlist-symbol-cell flex items-center gap-sm"},se={class:"watchlist-symbol-badge","aria-hidden":"true"},ae={class:"watchlist-symbol-meta flex-1"},oe={class:"flex items-center gap-xs"},ie={class:"whitespace-nowrap text-body-sm text-[var(--er-text-primary)]"},re=["aria-label","onClick"],ne=["disabled","aria-label","onClick"],ce={class:"watchlist-symbol-name text-body-xs text-[var(--er-text-secondary)]"},de={class:"watchlist-price-cell text-body-xs text-[var(--er-text-primary)]"},me={class:"watchlist-price-cell text-body-xs text-[var(--er-text-primary)]"},ue={class:"flex h-[120px] items-center justify-center px-md text-center text-body-sm text-[var(--er-text-secondary)]"},ve=o({__name:"index",props:{symbols:{},selectedSymbol:{}},emits:["selectSymbol"],setup(o,{expose:p,emit:g}){const x=o,j=g,{selectedView:D,viewSelectRenderKey:T,searchText:R,viewNotice:O,createListDialogVisible:V,newListName:M,newListSymbols:F,createListError:E,addToListDialogVisible:U,symbolPendingListAdd:P,selectedCustomListId:B,addToListMessage:q,canAddToCustomList:K,panelBodyRef:W,filterControlsRef:G,viewOptions:J,tableFields:Q,symbolOptions:X,customListOptions:ve,customListSelectOptions:be,hasSelectedCustomList:ye,tableHeight:pe,tableRows:ge,emptyStateMessage:he,handleSearchChange:xe,clearSearch:fe,handleViewChange:Ce,handleRowClick:we,handleSortChanged:Le,getRowClass:Se,sortDirection:ke,baseIcon:_e,quoteIcon:Ae,toggleFavorite:Ne,openCreateListDialog:$e,closeCreateListDialog:je,handleNewListNameChange:De,handleNewListSymbolsChange:ze,createCustomList:Te,openAddToListDialog:Re,closeAddToListDialog:Oe,handleSelectedCustomListChange:Ve,addSymbolToSelectedList:Ie,resetCategory:Me,resetSort:Fe}=Y(()=>x.symbols,()=>x.selectedSymbol),Ee=e=>{we(e,e=>j("selectSymbol",e))};return p({resetCategory:Me,resetSort:Fe}),(o,p)=>{const g=a,x=s,j=t,Y=l,ve=e;return i(),u("div",{ref_key:"panelBodyRef",ref:W,class:"h-full min-h-0 flex flex-col gap-lg bg-[var(--er-surface-container)] px-sm py-md"},[c("div",{ref_key:"filterControlsRef",ref:G,class:"flex flex-col gap-sm"},[c("div",Z,[d(g,{value:f(R),placeholder:"Search symbol",size:"md",class:"watchlist-input-control w-full",onHandleChange:f(xe)},{suffix:n(()=>[f(R)?(i(),u("button",{key:0,type:"button",class:"watchlist-clear-button","aria-label":"Clear symbol search",onClick:p[0]||(p[0]=C((...e)=>f(fe)&&f(fe)(...e),["stop"]))},[d(f(L),{size:14})])):y("",!0)]),_:1},8,["value","onHandleChange"]),(i(),r(j,{key:f(T),value:f(D),options:f(J),size:"md",class:"watchlist-control w-full",onChange:f(Ce)},{footer:n(()=>[d(x,{size:"sm",color:"contrast",background:!1,class:"w-full",onClick:f($e)},{default:n(()=>[c("div",ee,[d(f(S),{size:14}),p[1]||(p[1]=c("span",null,"Create custom list",-1))])]),_:1},8,["onClick"])]),_:1},8,["value","options","onChange"]))]),f(O)?(i(),u("div",le,b(f(O)),1)):y("",!0)],512),d(ve,{class:"watchlist-custom-table min-h-0 flex-1","allow-sort-reset":"","hide-footer":"",height:f(pe),"max-height":f(pe),"table-layout":"fixed",size:"small",items:f(ge),fields:f(Q),"total-rows":f(ge).length,stripe:!1,"show-filter-by-default":!1,"row-class-name":f(Se),onOnRowClick:Ee,"onUpdate:onSortChanged":f(Le)},{"cell(symbol)":n(({item:e})=>[c("div",te,[c("div",se,[(i(),r(w(f(z)(f(_e)(e))),{size:18,class:"watchlist-symbol-badge-icon watchlist-symbol-badge-icon--base"})),(i(),r(w(f(z)(f(Ae)(e))),{size:18,class:"watchlist-symbol-badge-icon watchlist-symbol-badge-icon--quote"}))]),c("div",ae,[c("div",oe,[c("span",ie,b(e.symbol),1),c("button",{type:"button",class:"watchlist-row-action","aria-label":e.isFavorite?`Remove ${e.symbol} from favorites`:`Add ${e.symbol} to favorites`,onClick:C(l=>f(Ne)(e),["stop"])},[d(f(N),{size:16,"stroke-width":1.8,fill:e.isFavorite?"var(--er-text-warning)":"none",class:v(e.isFavorite?"text-[var(--er-text-warning)]":"text-[var(--er-icon-secondary)]")},null,8,["fill","class"])],8,re),c("button",{type:"button",class:"watchlist-row-action",disabled:!f(K),"aria-label":`Add ${e.symbol} to a custom list`,onClick:C(l=>f(Re)(e),["stop"])},[d(f($),{size:15})],8,ne),"closed"===e.marketStatus?(i(),r(Y,{key:0,color:"warning",size:"sm"},{default:n(()=>[...p[2]||(p[2]=[m(" Closed ",-1)])]),_:1})):y("",!0)]),c("p",ce,b(e.name),1)])])]),"cell(lastPrice)":n(({item:e})=>[c("span",de,b(e.lastPrice),1)]),"cell(volume)":n(({item:e})=>[c("span",me,b(e.volume),1)]),"sort-icon":n(({sortKey:e})=>["asc"===f(ke)(e)?(i(),r(f(k),{key:0})):"desc"===f(ke)(e)?(i(),r(f(_),{key:1,size:16})):(i(),r(f(A),{key:2,size:16}))]),empty:n(()=>[c("div",ue,b(f(he)),1)]),_:1},8,["height","max-height","items","fields","total-rows","row-class-name","onUpdate:onSortChanged"]),d(H,{"dialog-visible":f(V),"list-name":f(M),"selected-symbols":f(F),"symbol-options":f(X),error:f(E),onClose:f(je),onCreate:f(Te),"onUpdate:listName":f(De),"onUpdate:selectedSymbols":f(ze)},null,8,["dialog-visible","list-name","selected-symbols","symbol-options","error","onClose","onCreate","onUpdate:listName","onUpdate:selectedSymbols"]),d(I,{"dialog-visible":f(U),symbol:f(P),"selected-list-id":f(B),"custom-list-options":f(be),message:f(q),"can-add":f(ye)(),onClose:f(Oe),onAdd:f(Ie),"onUpdate:selectedListId":f(Ve)},null,8,["dialog-visible","symbol","selected-list-id","custom-list-options","message","can-add","onClose","onAdd","onUpdate:selectedListId"])],512)}}});export{ve as _,Y as u};
@@ -1 +1 @@
1
- import{_ as m}from"../chunks/EaeraDynamicFieldRow-C-VUPCvg.mjs";import"vue";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"element-plus";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"element-plus/es";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraInputNumber-COC6rdNn.mjs";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"@lucide/vue";import"../chunks/EaeraRadio-Dz6nSJu0.mjs";import"../chunks/EaeraCountryField-CrX6AtMI.mjs";import"../chunks/EaeraCountryFlag-Vr9lnLti.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/vendor-unorm-DkILX5Kw.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraInputPhoneNumber-YIRrq5-L.mjs";import"../chunks/useEaeraInputPhoneNumber-B72aLnQs.mjs";import"../chunks/phoneNumbers-Bmtkxd5J.mjs";import"../chunks/vendor-libphonenumber-js-bhez_Ujn.mjs";import"../chunks/EaeraSelectV2-C8auhaRC.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraSwitch-BI3E0zPf.mjs";export{m as default};
1
+ import{_ as m}from"../chunks/EaeraDynamicFieldRow-8-utCowK.mjs";import"vue";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"element-plus";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"element-plus/es";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraInputNumber-COC6rdNn.mjs";import"../chunks/EaeraSelect-C-sln89V.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"@lucide/vue";import"../chunks/EaeraRadio-Dz6nSJu0.mjs";import"../chunks/EaeraCountryField-CrX6AtMI.mjs";import"../chunks/EaeraCountryFlag-Vr9lnLti.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/vendor-unorm-DkILX5Kw.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraInputPhoneNumber-YIRrq5-L.mjs";import"../chunks/useEaeraInputPhoneNumber-B72aLnQs.mjs";import"../chunks/phoneNumbers-Bmtkxd5J.mjs";import"../chunks/vendor-libphonenumber-js-bhez_Ujn.mjs";import"../chunks/EaeraSelectV2-C8auhaRC.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraSwitch-BI3E0zPf.mjs";export{m as default};
@@ -1 +1 @@
1
- import{_ as e}from"../chunks/EaeraForm-DRMCdjw4.mjs";import"element-plus/es";import"vue";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"element-plus";import"../chunks/EaeraEmailSuggestion-DyhqpIEZ.mjs";import"../chunks/EaeraTooltip-BIlULHv4.mjs";import"../chunks/vendor-email-misspelled-0hsXkSSK.mjs";import"../chunks/EaeraCascadeSelect-CoSX_ACV.mjs";import"@lucide/vue";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"../chunks/EaeraCheckBoxList-ZKnHu1T9.mjs";import"../chunks/EaeraDatePicker-Bwt5r5gk.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraRadio-Dz6nSJu0.mjs";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraSwitch-BI3E0zPf.mjs";import"../chunks/EaeraTimePicker-B4e4R3pD.mjs";import"../chunks/EaeraTree-CwZK7lqG.mjs";import"../chunks/EaeraTreeSelect-mLNgcoOv.mjs";import"../chunks/EaeraAutoComplete-DLjCHpAH.mjs";import"../chunks/EaeraInputTag-BIYG3daA.mjs";import"../chunks/EaeraCountryField-CrX6AtMI.mjs";import"../chunks/EaeraCountryFlag-Vr9lnLti.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/vendor-unorm-DkILX5Kw.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraInputPhone-Cui1yXmx.mjs";import"../chunks/phoneNumbers-Bmtkxd5J.mjs";import"../chunks/vendor-libphonenumber-js-bhez_Ujn.mjs";import"../chunks/EaeraInputPhoneNumber-YIRrq5-L.mjs";import"../chunks/useEaeraInputPhoneNumber-B72aLnQs.mjs";import"../chunks/EaeraSelectV2-C8auhaRC.mjs";import"../chunks/EaeraSelectGroup-DxK2CWYf.mjs";import"../chunks/EaeraSelectOther-BICVMrjI.mjs";import"../chunks/EaeraInputNumber-COC6rdNn.mjs";import"@element-plus/icons-vue";export{e as default};
1
+ import{_ as e}from"../chunks/EaeraForm-DxThA46e.mjs";import"element-plus/es";import"vue";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"element-plus";import"../chunks/EaeraEmailSuggestion-DyhqpIEZ.mjs";import"../chunks/EaeraTooltip-BIlULHv4.mjs";import"../chunks/vendor-email-misspelled-0hsXkSSK.mjs";import"../chunks/EaeraCascadeSelect-CoSX_ACV.mjs";import"@lucide/vue";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"../chunks/EaeraCheckBoxList-ZKnHu1T9.mjs";import"../chunks/EaeraDatePicker-Bwt5r5gk.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraRadio-Dz6nSJu0.mjs";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraSelect-C-sln89V.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraSwitch-BI3E0zPf.mjs";import"../chunks/EaeraTimePicker-B4e4R3pD.mjs";import"../chunks/EaeraTree-CwZK7lqG.mjs";import"../chunks/EaeraTreeSelect-mLNgcoOv.mjs";import"../chunks/EaeraAutoComplete-DLjCHpAH.mjs";import"../chunks/EaeraInputTag-BIYG3daA.mjs";import"../chunks/EaeraCountryField-CrX6AtMI.mjs";import"../chunks/EaeraCountryFlag-Vr9lnLti.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/vendor-unorm-DkILX5Kw.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraInputPhone-Cui1yXmx.mjs";import"../chunks/phoneNumbers-Bmtkxd5J.mjs";import"../chunks/vendor-libphonenumber-js-bhez_Ujn.mjs";import"../chunks/EaeraInputPhoneNumber-YIRrq5-L.mjs";import"../chunks/useEaeraInputPhoneNumber-B72aLnQs.mjs";import"../chunks/EaeraSelectV2-C8auhaRC.mjs";import"../chunks/EaeraSelectGroup-DxK2CWYf.mjs";import"../chunks/EaeraSelectOther-BICVMrjI.mjs";import"../chunks/EaeraInputNumber-COC6rdNn.mjs";import"@element-plus/icons-vue";export{e as default};
@@ -1 +1 @@
1
- import{_ as e}from"../chunks/EaeraTableV2-CyfoAwDF.mjs";import"element-plus/es";import"vue";import"element-plus";import"../chunks/vendor-vueuse-core-B96HGhR7.mjs";import"vue-i18n";import"../chunks/vendor-sortablejs-D3DyHO5Y.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"@lucide/vue";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"../chunks/EaeraDatePicker-Bwt5r5gk.mjs";import"../chunks/EaeraPagination-BKcbraqK.mjs";import"../chunks/EaeraSelectTag-fwPFHO14.mjs";import"../chunks/EaeraTag-DsDZxISm.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/EaeraSelectStatus-DF8-Svsr.mjs";import"../chunks/EaeraEmpty-CnGp7eaH.mjs";import"../chunks/EaeraDataCard-quCx0w35.mjs";import"../chunks/EaeraDropdown-DceV8QiO.mjs";export{e as default};
1
+ import{_ as e}from"../chunks/EaeraTableV2-CIeL4xlB.mjs";import"element-plus/es";import"vue";import"element-plus";import"../chunks/vendor-vueuse-core-B96HGhR7.mjs";import"vue-i18n";import"../chunks/vendor-sortablejs-D3DyHO5Y.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"@lucide/vue";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraSelect-C-sln89V.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"../chunks/EaeraDatePicker-Bwt5r5gk.mjs";import"../chunks/EaeraPagination-7pSl3EwP.mjs";import"../chunks/EaeraSelectTag-4WtAOO7m.mjs";import"../chunks/EaeraTag-DsDZxISm.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/EaeraSelectStatus-BMiT4W5a.mjs";import"../chunks/EaeraEmpty-CnGp7eaH.mjs";import"../chunks/EaeraDataCard-quCx0w35.mjs";import"../chunks/EaeraDropdown-DceV8QiO.mjs";export{e as default};
@@ -1 +1 @@
1
- import{_ as e}from"../chunks/EaeraWidgetBasicTradingStatistics-B_vLQ-YR.mjs";import"element-plus/es";import"vue";import"../chunks/formatMoney-CbiPk6ER.mjs";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";import"../chunks/vendor-currency-symbol-map-3_wzZimq.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraTooltip-BIlULHv4.mjs";export{e as default};
1
+ import{_ as e}from"../chunks/EaeraWidgetBasicTradingStatistics-B_vLQ-YR.mjs";import"element-plus/es";import"vue";import"../chunks/formatMoney-CbiPk6ER.mjs";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-C-sln89V.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";import"../chunks/vendor-currency-symbol-map-3_wzZimq.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraTooltip-BIlULHv4.mjs";export{e as default};
@@ -1 +1 @@
1
- import{_ as e}from"../chunks/EaeraWidgetEconomicInsight-DABV7t3S.mjs";import"element-plus/es";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";export{e as default};
1
+ import{_ as e}from"../chunks/EaeraWidgetEconomicInsight-DABV7t3S.mjs";import"element-plus/es";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-C-sln89V.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";export{e as default};
@@ -1 +1 @@
1
- import{_ as e}from"../chunks/EaeraWidgetGrowthBalanceProfitChart-nW-rAuUt.mjs";import"element-plus/es";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"vue";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"@lucide/vue";import"../chunks/EaeraSegmented-BED7en5R.mjs";import"vue-i18n";export{e as default};
1
+ import{_ as e}from"../chunks/EaeraWidgetGrowthBalanceProfitChart-BK2uhXA1.mjs";import"element-plus/es";import"../chunks/EaeraSelect-C-sln89V.mjs";import"vue";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"@lucide/vue";import"../chunks/EaeraSegmented-BED7en5R.mjs";import"vue-i18n";export{e as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as l,onMounted as a,openBlock as s,createElementBlock as d,createElementVNode as i,renderSlot as r,createVNode as o,unref as c,toDisplayString as n,createCommentVNode as u}from"vue";import{EllipsisVertical as p}from"@lucide/vue";import{_ as m}from"../chunks/EaeraSelect-BxZRZofe.mjs";import{_ as g}from"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";import"element-plus/es";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";const _={class:"widget-header"},v={class:"widget-header__content"},f={class:"widget-header__wrapper"},w={class:"widget-header__title leading-normal whitespace-nowrap"},k={key:0,class:"widget-header__filter"},S=g(e({__name:"EaeraWidgetHeader",props:{title:{default:""},showFilter:{type:Boolean,default:!1},filterOptions:{default:()=>[]},globalSelectedAccount:{default:()=>{}},lastSelectedAccount:{default:()=>null}},emits:["filterChanged"],setup(e,{emit:g}){const S=e,j=g,b=t(null);return l(()=>S.lastSelectedAccount,e=>{e&&0!=Object.keys(e).length&&(b.value&&Object.keys(b.value).length>0||(b.value=e,j("filterChanged",b.value)))},{deep:!0,immediate:!0}),l(()=>S.globalSelectedAccount,e=>{e&&0!=Object.keys(e).length&&(b.value=e,j("filterChanged",b.value))},{deep:!0}),a(()=>{S.lastSelectedAccount&&Object.keys(S.lastSelectedAccount).length>0&&(b.value=S.lastSelectedAccount)}),(t,l)=>(s(),d("div",_,[i("div",v,[r(t.$slots,"header",{},()=>[o(c(p),{size:16})],!0),i("div",f,[i("div",w,n(e.title),1),e.showFilter?(s(),d("div",k,[o(m,{modelValue:b.value,"onUpdate:modelValue":l[0]||(l[0]=e=>b.value=e),placeholder:" ","popper-class":"widget-header__filter__popper",options:S.filterOptions,"is-value-item":!0,onChange:l[1]||(l[1]=e=>{j("filterChanged",e)})},null,8,["modelValue","options"])])):u("",!0)])]),l[2]||(l[2]=i("hr",{class:"widget-header__divider"},null,-1))]))}}),[["__scopeId","data-v-e424a818"]]);export{S as default};
1
+ import{defineComponent as e,ref as t,watch as l,onMounted as a,openBlock as s,createElementBlock as d,createElementVNode as i,renderSlot as r,createVNode as o,unref as c,toDisplayString as n,createCommentVNode as u}from"vue";import{EllipsisVertical as p}from"@lucide/vue";import{_ as m}from"../chunks/EaeraSelect-C-sln89V.mjs";import{_ as g}from"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";import"element-plus/es";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";const _={class:"widget-header"},v={class:"widget-header__content"},f={class:"widget-header__wrapper"},w={class:"widget-header__title leading-normal whitespace-nowrap"},k={key:0,class:"widget-header__filter"},S=g(e({__name:"EaeraWidgetHeader",props:{title:{default:""},showFilter:{type:Boolean,default:!1},filterOptions:{default:()=>[]},globalSelectedAccount:{default:()=>{}},lastSelectedAccount:{default:()=>null}},emits:["filterChanged"],setup(e,{emit:g}){const S=e,j=g,b=t(null);return l(()=>S.lastSelectedAccount,e=>{e&&0!=Object.keys(e).length&&(b.value&&Object.keys(b.value).length>0||(b.value=e,j("filterChanged",b.value)))},{deep:!0,immediate:!0}),l(()=>S.globalSelectedAccount,e=>{e&&0!=Object.keys(e).length&&(b.value=e,j("filterChanged",b.value))},{deep:!0}),a(()=>{S.lastSelectedAccount&&Object.keys(S.lastSelectedAccount).length>0&&(b.value=S.lastSelectedAccount)}),(t,l)=>(s(),d("div",_,[i("div",v,[r(t.$slots,"header",{},()=>[o(c(p),{size:16})],!0),i("div",f,[i("div",w,n(e.title),1),e.showFilter?(s(),d("div",k,[o(m,{modelValue:b.value,"onUpdate:modelValue":l[0]||(l[0]=e=>b.value=e),placeholder:" ","popper-class":"widget-header__filter__popper",options:S.filterOptions,"is-value-item":!0,onChange:l[1]||(l[1]=e=>{j("filterChanged",e)})},null,8,["modelValue","options"])])):u("",!0)])]),l[2]||(l[2]=i("hr",{class:"widget-header__divider"},null,-1))]))}}),[["__scopeId","data-v-e424a818"]]);export{S as default};
@@ -1 +1 @@
1
- import{_ as e}from"../chunks/EaeraWidgetIframe-KQqHR8b4.mjs";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"element-plus/es";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";export{e as default};
1
+ import{_ as e}from"../chunks/EaeraWidgetIframe-KQqHR8b4.mjs";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-C-sln89V.mjs";import"element-plus/es";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";export{e as default};
@@ -1 +1 @@
1
- import{_ as e}from"../chunks/EaeraWidgetMarginCalculator-BoV_EWi6.mjs";import"element-plus/es";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";import"../chunks/EaeraForm-DRMCdjw4.mjs";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"../chunks/EaeraEmailSuggestion-DyhqpIEZ.mjs";import"../chunks/EaeraTooltip-BIlULHv4.mjs";import"../chunks/vendor-email-misspelled-0hsXkSSK.mjs";import"../chunks/EaeraCascadeSelect-CoSX_ACV.mjs";import"../chunks/EaeraCheckBoxList-ZKnHu1T9.mjs";import"../chunks/EaeraDatePicker-Bwt5r5gk.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraRadio-Dz6nSJu0.mjs";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraSwitch-BI3E0zPf.mjs";import"../chunks/EaeraTimePicker-B4e4R3pD.mjs";import"../chunks/EaeraTree-CwZK7lqG.mjs";import"../chunks/EaeraTreeSelect-mLNgcoOv.mjs";import"../chunks/EaeraAutoComplete-DLjCHpAH.mjs";import"../chunks/EaeraInputTag-BIYG3daA.mjs";import"../chunks/EaeraCountryField-CrX6AtMI.mjs";import"../chunks/EaeraCountryFlag-Vr9lnLti.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/vendor-unorm-DkILX5Kw.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraInputPhone-Cui1yXmx.mjs";import"../chunks/phoneNumbers-Bmtkxd5J.mjs";import"../chunks/vendor-libphonenumber-js-bhez_Ujn.mjs";import"../chunks/EaeraInputPhoneNumber-YIRrq5-L.mjs";import"../chunks/useEaeraInputPhoneNumber-B72aLnQs.mjs";import"../chunks/EaeraSelectV2-C8auhaRC.mjs";import"../chunks/EaeraSelectGroup-DxK2CWYf.mjs";import"../chunks/EaeraSelectOther-BICVMrjI.mjs";import"../chunks/EaeraInputNumber-COC6rdNn.mjs";import"@element-plus/icons-vue";import"vue-i18n";export{e as default};
1
+ import{_ as e}from"../chunks/EaeraWidgetMarginCalculator-Co6Vnjv1.mjs";import"element-plus/es";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-C-sln89V.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";import"../chunks/EaeraForm-DxThA46e.mjs";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"../chunks/EaeraEmailSuggestion-DyhqpIEZ.mjs";import"../chunks/EaeraTooltip-BIlULHv4.mjs";import"../chunks/vendor-email-misspelled-0hsXkSSK.mjs";import"../chunks/EaeraCascadeSelect-CoSX_ACV.mjs";import"../chunks/EaeraCheckBoxList-ZKnHu1T9.mjs";import"../chunks/EaeraDatePicker-Bwt5r5gk.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraRadio-Dz6nSJu0.mjs";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraSwitch-BI3E0zPf.mjs";import"../chunks/EaeraTimePicker-B4e4R3pD.mjs";import"../chunks/EaeraTree-CwZK7lqG.mjs";import"../chunks/EaeraTreeSelect-mLNgcoOv.mjs";import"../chunks/EaeraAutoComplete-DLjCHpAH.mjs";import"../chunks/EaeraInputTag-BIYG3daA.mjs";import"../chunks/EaeraCountryField-CrX6AtMI.mjs";import"../chunks/EaeraCountryFlag-Vr9lnLti.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/vendor-unorm-DkILX5Kw.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraInputPhone-Cui1yXmx.mjs";import"../chunks/phoneNumbers-Bmtkxd5J.mjs";import"../chunks/vendor-libphonenumber-js-bhez_Ujn.mjs";import"../chunks/EaeraInputPhoneNumber-YIRrq5-L.mjs";import"../chunks/useEaeraInputPhoneNumber-B72aLnQs.mjs";import"../chunks/EaeraSelectV2-C8auhaRC.mjs";import"../chunks/EaeraSelectGroup-DxK2CWYf.mjs";import"../chunks/EaeraSelectOther-BICVMrjI.mjs";import"../chunks/EaeraInputNumber-COC6rdNn.mjs";import"@element-plus/icons-vue";import"vue-i18n";export{e as default};
@@ -1 +1 @@
1
- import{_ as e}from"../chunks/EaeraWidgetPositionCalculator-DVbflfoJ.mjs";import"element-plus/es";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";import"../chunks/EaeraForm-DRMCdjw4.mjs";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"../chunks/EaeraEmailSuggestion-DyhqpIEZ.mjs";import"../chunks/EaeraTooltip-BIlULHv4.mjs";import"../chunks/vendor-email-misspelled-0hsXkSSK.mjs";import"../chunks/EaeraCascadeSelect-CoSX_ACV.mjs";import"../chunks/EaeraCheckBoxList-ZKnHu1T9.mjs";import"../chunks/EaeraDatePicker-Bwt5r5gk.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraRadio-Dz6nSJu0.mjs";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraSwitch-BI3E0zPf.mjs";import"../chunks/EaeraTimePicker-B4e4R3pD.mjs";import"../chunks/EaeraTree-CwZK7lqG.mjs";import"../chunks/EaeraTreeSelect-mLNgcoOv.mjs";import"../chunks/EaeraAutoComplete-DLjCHpAH.mjs";import"../chunks/EaeraInputTag-BIYG3daA.mjs";import"../chunks/EaeraCountryField-CrX6AtMI.mjs";import"../chunks/EaeraCountryFlag-Vr9lnLti.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/vendor-unorm-DkILX5Kw.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraInputPhone-Cui1yXmx.mjs";import"../chunks/phoneNumbers-Bmtkxd5J.mjs";import"../chunks/vendor-libphonenumber-js-bhez_Ujn.mjs";import"../chunks/EaeraInputPhoneNumber-YIRrq5-L.mjs";import"../chunks/useEaeraInputPhoneNumber-B72aLnQs.mjs";import"../chunks/EaeraSelectV2-C8auhaRC.mjs";import"../chunks/EaeraSelectGroup-DxK2CWYf.mjs";import"../chunks/EaeraSelectOther-BICVMrjI.mjs";import"../chunks/EaeraInputNumber-COC6rdNn.mjs";import"@element-plus/icons-vue";import"../chunks/formatMoney-CbiPk6ER.mjs";import"vue-i18n";export{e as default};
1
+ import{_ as e}from"../chunks/EaeraWidgetPositionCalculator-_DmVt9Os.mjs";import"element-plus/es";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-C-sln89V.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";import"../chunks/EaeraForm-DxThA46e.mjs";import"../chunks/EaeraButton-BPVKRBOn.mjs";import"../chunks/EaeraEmailSuggestion-DyhqpIEZ.mjs";import"../chunks/EaeraTooltip-BIlULHv4.mjs";import"../chunks/vendor-email-misspelled-0hsXkSSK.mjs";import"../chunks/EaeraCascadeSelect-CoSX_ACV.mjs";import"../chunks/EaeraCheckBoxList-ZKnHu1T9.mjs";import"../chunks/EaeraDatePicker-Bwt5r5gk.mjs";import"../chunks/EaeraDateTimePicker-Hv_ma8qU.mjs";import"../chunks/EaeraRadio-Dz6nSJu0.mjs";import"../chunks/EaeraInput-CkbcAxy0.mjs";import"../chunks/eventListener-o1XlgLVq.mjs";import"../chunks/EaeraSwitch-BI3E0zPf.mjs";import"../chunks/EaeraTimePicker-B4e4R3pD.mjs";import"../chunks/EaeraTree-CwZK7lqG.mjs";import"../chunks/EaeraTreeSelect-mLNgcoOv.mjs";import"../chunks/EaeraAutoComplete-DLjCHpAH.mjs";import"../chunks/EaeraInputTag-BIYG3daA.mjs";import"../chunks/EaeraCountryField-CrX6AtMI.mjs";import"../chunks/EaeraCountryFlag-Vr9lnLti.mjs";import"../chunks/iconSvg-B2wrn2gi.mjs";import"../chunks/vendor-unorm-DkILX5Kw.mjs";import"../chunks/vendor-dayjs-BwyIiGHg.mjs";import"../chunks/EaeraInputPhone-Cui1yXmx.mjs";import"../chunks/phoneNumbers-Bmtkxd5J.mjs";import"../chunks/vendor-libphonenumber-js-bhez_Ujn.mjs";import"../chunks/EaeraInputPhoneNumber-YIRrq5-L.mjs";import"../chunks/useEaeraInputPhoneNumber-B72aLnQs.mjs";import"../chunks/EaeraSelectV2-C8auhaRC.mjs";import"../chunks/EaeraSelectGroup-DxK2CWYf.mjs";import"../chunks/EaeraSelectOther-BICVMrjI.mjs";import"../chunks/EaeraInputNumber-COC6rdNn.mjs";import"@element-plus/icons-vue";import"../chunks/formatMoney-CbiPk6ER.mjs";import"vue-i18n";export{e as default};
@@ -1 +1 @@
1
- import{_ as e}from"../chunks/EaeraWidgetTechnicalViews-n9xUnNE4.mjs";import"element-plus/es";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-BxZRZofe.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";export{e as default};
1
+ import{_ as e}from"../chunks/EaeraWidgetTechnicalViews-n9xUnNE4.mjs";import"element-plus/es";import"vue";import"./EaeraWidgetHeader.mjs";import"@lucide/vue";import"../chunks/EaeraSelect-C-sln89V.mjs";import"../chunks/EaeraSpinner-DzMwUlR7.mjs";import"../chunks/EaeraCheckbox-C_faN0pV.mjs";import"element-plus";import"../chunks/_plugin-vue_export-helper-BCo6x5W8.mjs";export{e as default};