@lumyne/omni-desktop-app 0.1.16 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/{CartesianChart-CGNvk6St.js → CartesianChart-aa0EJ6w3.js} +1 -1
- package/app/assets/{CollaborationWorkspace-YQKm5DVb.js → CollaborationWorkspace-mIgLrpSm.js} +1 -1
- package/app/assets/{CompetitorAnalysis-BGZeiXTW.js → CompetitorAnalysis-Ct6wLjw6.js} +1 -1
- package/app/assets/EmptyState-CpQOdGYD.js +1 -0
- package/app/assets/{ErrorBarContext-BRHs6mfT.js → ErrorBarContext-BeuyujN4.js} +1 -1
- package/app/assets/{EvidenceSourceGuide-ByFna5T0.js → EvidenceSourceGuide-BeBcvVcI.js} +1 -1
- package/app/assets/{FavoritePicker-DLuTORpI.js → FavoritePicker-LfvebaXO.js} +1 -1
- package/app/assets/{Favorites-BL-1v7QD.js → Favorites-C6Xd2Vyz.js} +1 -1
- package/app/assets/{HelpTip-DaIyNCfF.js → HelpTip-BfrAVfV_.js} +1 -1
- package/app/assets/{LineChart-Dg6rxQct.js → LineChart-tppycNHl.js} +1 -1
- package/app/assets/{Opportunities-Dw5CnA2W.js → Opportunities-BfmikZ5o.js} +1 -1
- package/app/assets/{ProgressiveRows-DfUZC_6R.js → ProgressiveRows-CNmxc71t.js} +1 -1
- package/app/assets/{ShopLayoutPage-AkChJyxu.js → ShopLayoutPage-B943t2t1.js} +1 -1
- package/app/assets/{TrendChart-DURd5oGd.js → TrendChart-Doe6C5Aa.js} +1 -1
- package/app/assets/arrow-down-Dm8ejo47.js +1 -0
- package/app/assets/arrow-left-CrtjcWhu.js +1 -0
- package/app/assets/arrow-up-right-FAUwydEi.js +1 -0
- package/app/assets/{book-open-Bce54GC0.js → book-open-BHnwW_0N.js} +1 -1
- package/app/assets/{calendar-days-A-WQG43X.js → calendar-days-DQXKth-z.js} +1 -1
- package/app/assets/{chart-column-DueDyWTO.js → chart-column-B3ugUaKH.js} +1 -1
- package/app/assets/{chart-no-axes-combined-0SqHx_x6.js → chart-no-axes-combined-DbjiVuVa.js} +1 -1
- package/app/assets/check-B7m80-Hk.js +1 -0
- package/app/assets/chevron-down-9e3l9_Db.js +1 -0
- package/app/assets/chevron-right-DyOe1NsY.js +1 -0
- package/app/assets/{clock-3-BpHSopJF.js → clock-3-TXgD8tS6.js} +1 -1
- package/app/assets/{components-HGHI0_0I.js → components-DMbkJLkK.js} +2 -2
- package/app/assets/{download-Dsft-5wR.js → download-BMipQ3n8.js} +1 -1
- package/app/assets/entry-C4p4TKbJ.js +1 -0
- package/app/assets/{entry-TXFczQeM.js → entry-CGu91Jpg.js} +2 -2
- package/app/assets/{entry-CJFtoBLa.js → entry-CeW_5ZGi.js} +1 -1
- package/app/assets/{entry-CNxdnf29.js → entry-Cxj3NkyT.js} +3 -3
- package/app/assets/{entry-CZo_9EKi.js → entry-DcwBlAO0.js} +2 -2
- package/app/assets/{entry-DQEAnjCp.js → entry-aDwWfs__.js} +1 -1
- package/app/assets/{favorites.module-D06hxuat.js → favorites.module-CaTR2ido.js} +1 -1
- package/app/assets/{file-text-BpkjdOot.js → file-text-D6meDmAz.js} +1 -1
- package/app/assets/{getRadiusAndStrokeWidthFromDot-BX82bq7e.js → getRadiusAndStrokeWidthFromDot-zEte6bM_.js} +1 -1
- package/app/assets/{grid-2x2-Cb1v7yqK.js → grid-2x2-sRKLAhuD.js} +1 -1
- package/app/assets/{index-CShNDEcL.js → index-Dfy2jMWq.js} +2 -2
- package/app/assets/{layers-C4KI3Uxn.js → layers-B4gCFnEm.js} +1 -1
- package/app/assets/{layout-dashboard-CTmjmcDE.js → layout-dashboard-C54_ZKS5.js} +1 -1
- package/app/assets/{link-2-BrR_cwPw.js → link-2-CC7rgyRC.js} +1 -1
- package/app/assets/{list-Djz-XKts.js → list-DI2UZ46g.js} +1 -1
- package/app/assets/{module-host-rk0glcaW.js → module-host-BIy_fI1T.js} +1 -1
- package/app/assets/{orbit-Bw_YF8Ru.js → orbit-tMF8WRbG.js} +1 -1
- package/app/assets/{package-b8jiLApm.js → package-rnaOiBPn.js} +1 -1
- package/app/assets/play-DjZ3mG-r.js +1 -0
- package/app/assets/plus-_W4OFi32.js +1 -0
- package/app/assets/{products-DTLdF8-b.js → products-6S_LnOq6.js} +1 -1
- package/app/assets/{project-public-DQMVYsEz.js → project-public-B9DNEfwS.js} +1 -1
- package/app/assets/{project-public-CnKWSlv4.js → project-public-DN0-E_G2.js} +1 -1
- package/app/assets/public-Csb687JC.js +1 -0
- package/app/assets/{refresh-cw-BwEoF6sI.js → refresh-cw-CiIEylYp.js} +1 -1
- package/app/assets/search-DlLds8Ae.js +1 -0
- package/app/assets/{star-CjnKtEU7.js → star-CcsEzP_q.js} +1 -1
- package/app/assets/trending-up-CWfLLrC6.js +1 -0
- package/app/assets/{triangle-alert-3SxL0RNM.js → triangle-alert-CEMUxCrJ.js} +1 -1
- package/app/assets/{ui-public-4hoRHIFG.js → ui-public-DVwBGbKN.js} +1 -1
- package/app/assets/{workbench-DRbHsOSr.js → workbench-jvMSCBRw.js} +2 -2
- package/app/assets/{workspace-view-state-DRhGUGLj.js → workspace-view-state-BuK4-c0r.js} +1 -1
- package/app/desktop/main.mjs +10 -9
- package/app/index.html +1 -1
- package/app/tools/bootstrap.bin +0 -0
- package/package.json +1 -1
- package/release.json +1 -1
- package/release.sig +1 -1
- package/app/assets/EmptyState-BrzYB6Fm.js +0 -1
- package/app/assets/arrow-down-f54IiPCV.js +0 -1
- package/app/assets/arrow-left-D6ZJJ6TV.js +0 -1
- package/app/assets/arrow-up-right-D1eLXOum.js +0 -1
- package/app/assets/check-DpavxwQP.js +0 -1
- package/app/assets/chevron-down-DjHGm5jP.js +0 -1
- package/app/assets/chevron-right-D8cbEJBE.js +0 -1
- package/app/assets/entry-bIaBkZxY.js +0 -1
- package/app/assets/play-eKkJOouQ.js +0 -1
- package/app/assets/plus-CuQU-dIh.js +0 -1
- package/app/assets/public-D27wclc8.js +0 -1
- package/app/assets/search-BDEOXxcW.js +0 -1
- package/app/assets/trending-up-BPVwzUjj.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,v as t,x as n}from"./index-CShNDEcL.js";import{t as r}from"./ProgressiveRows-DfUZC_6R.js";import{$ as i,A as a,At as o,C as s,D as c,Dt as l,E as u,Et as d,F as f,Ht as p,L as m,Lt as h,M as g,N as _,O as v,Ot as y,P as ee,R as b,S as x,St as S,T as C,Tt as w,U as T,Ut as E,Vt as te,W as D,X as O,a as k,at as A,bt as j,ct as ne,d as M,dt as N,f as re,ft as ie,g as ae,h as oe,ht as P,i as se,it as ce,j as le,jt as ue,k as F,kt as de,l as fe,mt as pe,ot as me,p as he,q as ge,rt as _e,st as ve,t as ye,u as be,ut as xe,v as Se,vt as I,w as Ce,wt as we,x as Te,y as L,yt as R,z as Ee}from"./CartesianChart-CGNvk6St.js";import{n as De,t as Oe}from"./ErrorBarContext-BRHs6mfT.js";import{n as z,t as B}from"./graphicalItemSelectors-DCiyiwSe.js";import{n as V,r as ke,t as Ae}from"./favorites.module-D06hxuat.js";var H=e=>null;H.displayName=`Cell`;var je=(e,t,n)=>{var r=R();return(i,a)=>o=>{e?.(i,a,o),r(C({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Me=e=>{var t=R();return(n,r)=>i=>{e?.(n,r,i),t(s())}},Ne=(e,t,n)=>{var r=R();return(i,a)=>o=>{e?.(i,a,o),r(Ce({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Pe=(e,t,n)=>{var r=n??e;if(!y(r))return w(r,t,0)},Fe=(e,t,n)=>{var r={},i=e.filter(le),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var[r,i]=e;return{stackId:r,dataKeys:i.map(e=>e.dataKey),barSize:Pe(t,n,i[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:Pe(t,n,e.barSize)}));return[...s,...c]};function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function U(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ie(Object(n),!0).forEach(function(t){Le(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Le(e,t,n){return(t=Re(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Re(e){var t=ze(e,`string`);return typeof t==`symbol`?t:t+``}function ze(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Be(e,t,n,r,i){var a=r.length;if(!(a<1)){var o=w(e,n,0,!0),s,c=[];if(P(r[0]?.barSize)){var l=!1,u=n/a,d=r.reduce((e,t)=>e+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:((n-d)/2>>0)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var p=w(t,n,0,!0);n-2*p-(a-1)*o<=0&&(o=0);var m=(n-2*p-(a-1)*o)/a;m>1&&(m>>=0);var h=P(i)?Math.min(m,i):m;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+o)*n+(m-h)/2,size:h}}],c)}return s}}var Ve=(e,t,n,r,i,a,o)=>{var s=y(o)?t:o,c=Be(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>U(U({},e),{},{position:U(U({},e.position),{},{offset:e.position.offset-i/2})}))),c},He=(e,t)=>{var n=g(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(e=>e.key===n)}}}},Ue=(e,t)=>{if(!(e==null||t==null)){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function We(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&P(e.zIndex)?e.zIndex:t}var Ge=!0,W=`Invariant failed`;function Ke(e,t){if(!e){if(Ge)throw Error(W);var n=typeof t==`function`?t():t,r=n?`${W}: ${n}`:W;throw Error(r)}}var G=n(t());function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(null,arguments)}function q(e){return G.createElement(De,K({shapeType:`rectangle`,activeClassName:`recharts-active-bar`,inActiveClassName:`recharts-inactive-bar`},e))}var qe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,r)=>{if(de(e))return e;var i=de(n)||y(n);return i?e(n,r):(!i&&Ke(!1,`minPointSize callback function received a value with type of ${typeof n}. Currently only numbers or null/undefined are supported.`),t)}},Je=(e,t,n)=>n,J=I([a,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`bar`).find(e=>e.id===t)),Ye=I([J],e=>e?.maxBarSize),Xe=(e,t,n,r)=>r,Ze=I([O,a,B,z,Je],(e,t,n,r,i)=>t.filter(t=>e===`horizontal`?t.xAxisId===n:t.yAxisId===r).filter(e=>e.isPanorama===i).filter(e=>e.hide===!1).filter(e=>e.type===`bar`)),Qe=(e,t,n)=>{var r=O(e),i=B(e,t),a=z(e,t);if(!(i==null||a==null))return r===`horizontal`?v(e,`yAxis`,a,n):v(e,`xAxis`,i,n)},$e=I([Ze,m,(e,t)=>{var n=O(e),r=B(e,t),i=z(e,t);if(!(r==null||i==null))return n===`horizontal`?c(e,`xAxis`,r):c(e,`yAxis`,i)}],Fe),et=(e,t,n)=>{var r=J(e,t);if(r==null)return 0;var i=B(e,t),a=z(e,t);if(i==null||a==null)return 0;var o=O(e),s=b(e),{maxBarSize:c}=r,l=y(c)?s:c,d,f;return o===`horizontal`?(d=u(e,`xAxis`,i,n),f=F(e,`xAxis`,i,n)):(d=u(e,`yAxis`,a,n),f=F(e,`yAxis`,a,n)),me(d,f,!0)??l??0},tt=(e,t,n)=>{var r=O(e),i=B(e,t),a=z(e,t);if(!(i==null||a==null)){var o,s;return r===`horizontal`?(o=u(e,`xAxis`,i,n),s=F(e,`xAxis`,i,n)):(o=u(e,`yAxis`,a,n),s=F(e,`yAxis`,a,n)),me(o,s)}},nt=I([A,ce,(e,t,n)=>{var r=B(e,t);if(r!=null)return u(e,`xAxis`,r,n)},(e,t,n)=>{var r=z(e,t);if(r!=null)return u(e,`yAxis`,r,n)},(e,t,n)=>{var r=B(e,t);if(r!=null)return F(e,`xAxis`,r,n)},(e,t,n)=>{var r=z(e,t);if(r!=null)return F(e,`yAxis`,r,n)},I([I([$e,b,f,ee,et,tt,Ye],Ve),J],Ue),O,Ee,tt,I([Qe,J],He),J,Xe],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:h}=c;if(!(d==null||o==null||t==null||s!==`horizontal`&&s!==`vertical`||n==null||r==null||i==null||a==null||l==null)){var{data:g}=d,_=g!=null&&g.length>0?g:p?.slice(m,h+1);if(_!=null)return Pt({layout:s,barSettings:d,pos:o,parentViewBox:t,bandSize:l,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:_,offset:e,cells:f,dataStartIndex:m})}}),rt=[`index`];function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function it(e,t){if(e==null)return{};var n,r,i=at(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function at(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ot=(0,G.createContext)(void 0),st=e=>{var t=(0,G.useContext)(ot);if(t!=null)return t.stackId;if(e!=null)return xe(e)},ct=(e,t)=>`recharts-bar-stack-clip-path-${e}-${t}`,lt=e=>{var t=(0,G.useContext)(ot);if(t!=null){var{stackId:n}=t;return`url(#${ct(n,e)})`}},ut=e=>{var{index:t}=e,n=it(e,rt),r=lt(t);return G.createElement(h,Y({className:`recharts-bar-stack-layer`,clipPath:r},n))},dt=[`onMouseEnter`,`onMouseLeave`,`onClick`],ft=[`value`,`background`,`tooltipPosition`],pt=[`id`],mt=[`onMouseEnter`,`onClick`,`onMouseLeave`];function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X.apply(null,arguments)}function ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ht(Object(n),!0).forEach(function(t){gt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gt(e,t,n){return(t=_t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _t(e){var t=vt(e,`string`);return typeof t==`symbol`?t:t+``}function vt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Q(e,t){if(e==null)return{};var n,r,i=yt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var bt=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:N(n,t),payload:e}]},xt=G.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:s,tooltipType:c,id:l}=e,u={dataDefinedOnItem:void 0,getPosition:ue,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:N(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return G.createElement(re,{tooltipEntrySettings:u})});function St(e){var t=j(x),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:s,onClick:c}=a,l=Q(a,dt),u=je(o,r,a.id),d=Me(s),f=Ne(c,r,a.id);if(!i||n==null)return null;var m=p(i);return G.createElement(L,{zIndex:We(i,_.barBackground)},n.map((e,n)=>{var{value:a,background:o,tooltipPosition:s}=e,c=Q(e,ft);if(!o)return null;var p=u(e,n),h=d(e,n),g=f(e,n),_=Z(Z(Z(Z(Z({option:i,isActive:String(n)===t},c),{},{fill:`#eee`},o),m),we(l,e,n)),{},{onMouseEnter:p,onMouseLeave:h,onClick:g,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return G.createElement(q,X({key:`background-bar-${n}`},_))}))}function Ct(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return Z(Z({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return G.createElement(oe,{value:t?i:void 0},n)}function wt(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,s=j(x),c=j(Te),l=n&&String(i.originalDataIndex)===s&&(c==null||o===c),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(!1);(0,G.useEffect)(()=>{var e;return l?(d(!0),e=requestAnimationFrame(()=>{p(!0)})):p(!1),()=>{cancelAnimationFrame(e)}},[l]);var m=(0,G.useCallback)(()=>{l||d(!1)},[l]),h=l&&f,g=l||u,v=l?n===!0?t:n:t,y=G.createElement(q,X({},r,{name:String(r.name)},i,{isActive:h,option:v,index:a,dataKey:o,onTransitionEnd:m}));return g?G.createElement(L,{zIndex:_.activeBar},G.createElement(ut,{index:i.originalDataIndex},y)):y}function Tt(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return G.createElement(q,X({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function Et(e){var{data:t,props:n}=e,r=te(n)??{},{id:i}=r,a=Q(r,pt),{shape:o,dataKey:s,activeBar:c}=n,{onMouseEnter:l,onClick:u,onMouseLeave:d}=n,f=Q(n,mt),p=je(l,s,i),m=Me(d),h=Ne(u,s,i);return t?G.createElement(G.Fragment,null,t.map((e,t)=>G.createElement(ut,X({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},we(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:h(e,t)}),c?G.createElement(wt,{shape:o,activeBar:c,baseProps:a,entry:e,index:t,dataKey:s}):G.createElement(Tt,{shape:o,baseProps:a,entry:e,index:t,dataKey:s})))):null}function Dt(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,onAnimationEnd:l,onAnimationStart:u}=t,f=n.current,p=T(t,`recharts-bar-`),[m,g]=(0,G.useState)(!1),_=!m,v=(0,G.useCallback)(()=>{typeof l==`function`&&l(),g(!1)},[l]),y=(0,G.useCallback)(()=>{typeof u==`function`&&u(),g(!0)},[u]);return G.createElement(Ct,{showLabels:_,rects:r},G.createElement(D,{animationId:p,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:v,onAnimationStart:y,key:p},e=>{var a=e===1?r:r?.map((t,n)=>{var r=f&&f[n];if(r)return Z(Z({},t),{},{x:d(r.x,t.x,e),y:d(r.y,t.y,e),width:d(r.width,t.width,e),height:d(r.height,t.height,e)});if(i===`horizontal`){var a=d(0,t.height,e),o=d(t.stackedBarStart,t.y,e);return Z(Z({},t),{},{y:o,height:a})}var s=d(0,t.width,e),c=d(t.stackedBarStart,t.x,e);return Z(Z({},t),{},{width:s,x:c})});return e>0&&(n.current=a??null),a==null?null:G.createElement(h,null,G.createElement(Et,{props:t,data:a}))}),G.createElement(ae,{label:t.label}),t.children)}function Ot(e){var t=(0,G.useRef)(null);return G.createElement(Dt,{previousRectanglesRef:t,props:e})}var kt=0,At=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:ie(e,t)}},jt=class extends G.PureComponent{render(){var{hide:e,data:t,dataKey:n,className:r,xAxisId:i,yAxisId:a,needClip:o,background:s,id:c}=this.props;if(e||t==null)return null;var l=E(`recharts-bar`,r),u=c;return G.createElement(h,{className:l,id:c},o&&G.createElement(`defs`,null,G.createElement(se,{clipPathId:u,xAxisId:i,yAxisId:a})),G.createElement(h,{className:`recharts-bar-rectangles`,clipPath:o?`url(#clipPath-${u})`:void 0},G.createElement(St,{data:t,dataKey:n,background:s,allOtherBarProps:this.props}),G.createElement(Ot,this.props)))}},Mt={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:kt,xAxisId:0,yAxisId:0,zIndex:_.bar};function Nt(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:o,activeBar:s,animationBegin:c,animationDuration:l,animationEasing:u,isAnimationActive:d}=e,{needClip:f}=k(t,n),p=i(),m=_e(),h=he(e.children,H),g=j(t=>nt(t,e.id,m,h));if(p!==`vertical`&&p!==`horizontal`)return null;var _,v=g?.[0];return _=v==null||v.height==null||v.width==null?0:p===`vertical`?v.height/2:v.width/2,G.createElement(Oe,{xAxisId:t,yAxisId:n,data:g,dataPointFormatter:At,errorBarOffset:_},G.createElement(jt,X({},e,{layout:p,needClip:f,data:g,xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:o,activeBar:s,animationBegin:c,animationDuration:l,animationEasing:u,isAnimationActive:d})))}function Pt(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:s,xAxis:c,yAxis:u,xAxisTicks:d,yAxisTicks:f,stackedData:p,displayedData:m,offset:h,cells:g,parentViewBox:_,dataStartIndex:v}=e,y=t===`horizontal`?u:c,ee=p?y.scale.domain():null,b=ve({numericAxis:y}),x=y.scale.map(b);return m.map((e,m)=>{var y,S,C,w,T,E;if(p){var te=p[m+v];if(te==null)return null;y=pe(te,ee)}else y=ie(e,n),Array.isArray(y)||(y=[b,y]);var D=qe(r,kt)(y[1],m);if(t===`horizontal`){var O=u.scale.map(y[0]),k=u.scale.map(y[1]);if(O==null||k==null)return null;S=ne({axis:c,ticks:d,bandSize:s,offset:a.offset,entry:e,index:m}),C=k??O??void 0,w=a.size;var A=O-k;if(T=l(A)?0:A,E={x:S,y:h.top,width:w,height:h.height},Math.abs(D)>0&&Math.abs(T)<Math.abs(D)){var j=o(T||D)*(Math.abs(D)-Math.abs(T));C-=j,T+=j}}else{var M=c.scale.map(y[0]),N=c.scale.map(y[1]);if(M==null||N==null)return null;if(S=M,C=ne({axis:u,ticks:f,bandSize:s,offset:a.offset,entry:e,index:m}),w=N-M,T=a.size,E={x:h.left,y:C,width:h.width,height:T},Math.abs(D)>0&&Math.abs(w)<Math.abs(D)){var re=o(w||D)*(Math.abs(D)-Math.abs(w));w+=re}}return S==null||C==null||w==null||T==null||!i&&(w===0||T===0)?null:Z(Z({},e),{},{stackedBarStart:x,x:S,y:C,width:w,height:T,value:p?y:y[1],payload:e,background:E,tooltipPosition:{x:S+w/2,y:C+T/2},parentViewBox:_,originalDataIndex:m},g&&g[m]&&g[m].props)}).filter(Boolean)}function Ft(e){var t=S(e,Mt),n=st(t.stackId),r=_e();return G.createElement(be,{id:t.id,type:`bar`},e=>G.createElement(G.Fragment,null,G.createElement(M,{legendPayload:bt(t)}),G.createElement(xt,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),G.createElement(fe,{type:`bar`,id:e,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),G.createElement(L,{zIndex:t.zIndex},G.createElement(Nt,X({},t,{id:e})))))}var It=G.memo(Ft,ge);It.displayName=`Bar`;var Lt=[`axis`,`item`],Rt=(0,G.forwardRef)((e,t)=>G.createElement(ye,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:Lt,tooltipPayloadSearcher:Se,categoricalChartProps:e,ref:t})),$=e();function zt({kind:e,selectedIds:t=[],onSelect:n}){let i=ke(e);return(0,$.jsxs)(`div`,{className:Ae.picker,children:[i.loading&&(0,$.jsxs)(`p`,{role:`status`,children:[`正在读取收藏`,V[e],`…`]}),i.error&&(0,$.jsxs)(`p`,{role:`alert`,children:[i.error,(0,$.jsx)(`button`,{onClick:i.refresh,children:`重试`})]}),!i.loading&&!i.error&&!i.items.length&&(0,$.jsxs)(`p`,{children:[`暂无收藏`,V[e],`,可先在排行榜或“我的收藏”中添加。`]}),(0,$.jsx)(r,{items:i.items,resetKey:e,onVisibleCount:i.onVisibleCount,children:r=>{let a=i.resolve(r.key),o=a.category?.id||a.record?.id,s=!!o&&t.includes(o);return(0,$.jsxs)(`button`,{className:Ae.pickRow,disabled:!o||s,onClick:()=>n(a),children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`b`,{children:a.category?.name||a.record?.name||`收藏资料待更新`}),(0,$.jsx)(`small`,{children:a.category?a.categoryPath||a.category.name:o?`${V[e]} ID:${o}`:`资料尚未就绪`})]}),(0,$.jsx)(`span`,{children:s?`已选择`:`选择`})]},r.key)}})]})}export{H as i,Rt as n,It as r,zt as t};
|
|
1
|
+
import{c as e,v as t,x as n}from"./index-Dfy2jMWq.js";import{t as r}from"./ProgressiveRows-CNmxc71t.js";import{$ as i,A as a,At as o,C as s,D as c,Dt as l,E as u,Et as d,F as f,Ht as p,L as m,Lt as h,M as g,N as _,O as v,Ot as y,P as ee,R as b,S as x,St as S,T as C,Tt as w,U as T,Ut as E,Vt as te,W as D,X as O,a as k,at as A,bt as j,ct as ne,d as M,dt as N,f as re,ft as ie,g as ae,h as oe,ht as P,i as se,it as ce,j as le,jt as ue,k as F,kt as de,l as fe,mt as pe,ot as me,p as he,q as ge,rt as _e,st as ve,t as ye,u as be,ut as xe,v as Se,vt as I,w as Ce,wt as we,x as Te,y as L,yt as R,z as Ee}from"./CartesianChart-aa0EJ6w3.js";import{n as De,t as Oe}from"./ErrorBarContext-BeuyujN4.js";import{n as z,t as B}from"./graphicalItemSelectors-DCiyiwSe.js";import{n as V,r as ke,t as Ae}from"./favorites.module-CaTR2ido.js";var H=e=>null;H.displayName=`Cell`;var je=(e,t,n)=>{var r=R();return(i,a)=>o=>{e?.(i,a,o),r(C({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Me=e=>{var t=R();return(n,r)=>i=>{e?.(n,r,i),t(s())}},Ne=(e,t,n)=>{var r=R();return(i,a)=>o=>{e?.(i,a,o),r(Ce({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Pe=(e,t,n)=>{var r=n??e;if(!y(r))return w(r,t,0)},Fe=(e,t,n)=>{var r={},i=e.filter(le),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var[r,i]=e;return{stackId:r,dataKeys:i.map(e=>e.dataKey),barSize:Pe(t,n,i[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:Pe(t,n,e.barSize)}));return[...s,...c]};function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function U(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ie(Object(n),!0).forEach(function(t){Le(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Le(e,t,n){return(t=Re(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Re(e){var t=ze(e,`string`);return typeof t==`symbol`?t:t+``}function ze(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Be(e,t,n,r,i){var a=r.length;if(!(a<1)){var o=w(e,n,0,!0),s,c=[];if(P(r[0]?.barSize)){var l=!1,u=n/a,d=r.reduce((e,t)=>e+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:((n-d)/2>>0)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var p=w(t,n,0,!0);n-2*p-(a-1)*o<=0&&(o=0);var m=(n-2*p-(a-1)*o)/a;m>1&&(m>>=0);var h=P(i)?Math.min(m,i):m;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+o)*n+(m-h)/2,size:h}}],c)}return s}}var Ve=(e,t,n,r,i,a,o)=>{var s=y(o)?t:o,c=Be(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>U(U({},e),{},{position:U(U({},e.position),{},{offset:e.position.offset-i/2})}))),c},He=(e,t)=>{var n=g(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(e=>e.key===n)}}}},Ue=(e,t)=>{if(!(e==null||t==null)){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function We(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&P(e.zIndex)?e.zIndex:t}var Ge=!0,W=`Invariant failed`;function Ke(e,t){if(!e){if(Ge)throw Error(W);var n=typeof t==`function`?t():t,r=n?`${W}: ${n}`:W;throw Error(r)}}var G=n(t());function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(null,arguments)}function q(e){return G.createElement(De,K({shapeType:`rectangle`,activeClassName:`recharts-active-bar`,inActiveClassName:`recharts-inactive-bar`},e))}var qe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,r)=>{if(de(e))return e;var i=de(n)||y(n);return i?e(n,r):(!i&&Ke(!1,`minPointSize callback function received a value with type of ${typeof n}. Currently only numbers or null/undefined are supported.`),t)}},Je=(e,t,n)=>n,J=I([a,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`bar`).find(e=>e.id===t)),Ye=I([J],e=>e?.maxBarSize),Xe=(e,t,n,r)=>r,Ze=I([O,a,B,z,Je],(e,t,n,r,i)=>t.filter(t=>e===`horizontal`?t.xAxisId===n:t.yAxisId===r).filter(e=>e.isPanorama===i).filter(e=>e.hide===!1).filter(e=>e.type===`bar`)),Qe=(e,t,n)=>{var r=O(e),i=B(e,t),a=z(e,t);if(!(i==null||a==null))return r===`horizontal`?v(e,`yAxis`,a,n):v(e,`xAxis`,i,n)},$e=I([Ze,m,(e,t)=>{var n=O(e),r=B(e,t),i=z(e,t);if(!(r==null||i==null))return n===`horizontal`?c(e,`xAxis`,r):c(e,`yAxis`,i)}],Fe),et=(e,t,n)=>{var r=J(e,t);if(r==null)return 0;var i=B(e,t),a=z(e,t);if(i==null||a==null)return 0;var o=O(e),s=b(e),{maxBarSize:c}=r,l=y(c)?s:c,d,f;return o===`horizontal`?(d=u(e,`xAxis`,i,n),f=F(e,`xAxis`,i,n)):(d=u(e,`yAxis`,a,n),f=F(e,`yAxis`,a,n)),me(d,f,!0)??l??0},tt=(e,t,n)=>{var r=O(e),i=B(e,t),a=z(e,t);if(!(i==null||a==null)){var o,s;return r===`horizontal`?(o=u(e,`xAxis`,i,n),s=F(e,`xAxis`,i,n)):(o=u(e,`yAxis`,a,n),s=F(e,`yAxis`,a,n)),me(o,s)}},nt=I([A,ce,(e,t,n)=>{var r=B(e,t);if(r!=null)return u(e,`xAxis`,r,n)},(e,t,n)=>{var r=z(e,t);if(r!=null)return u(e,`yAxis`,r,n)},(e,t,n)=>{var r=B(e,t);if(r!=null)return F(e,`xAxis`,r,n)},(e,t,n)=>{var r=z(e,t);if(r!=null)return F(e,`yAxis`,r,n)},I([I([$e,b,f,ee,et,tt,Ye],Ve),J],Ue),O,Ee,tt,I([Qe,J],He),J,Xe],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:h}=c;if(!(d==null||o==null||t==null||s!==`horizontal`&&s!==`vertical`||n==null||r==null||i==null||a==null||l==null)){var{data:g}=d,_=g!=null&&g.length>0?g:p?.slice(m,h+1);if(_!=null)return Pt({layout:s,barSettings:d,pos:o,parentViewBox:t,bandSize:l,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:_,offset:e,cells:f,dataStartIndex:m})}}),rt=[`index`];function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function it(e,t){if(e==null)return{};var n,r,i=at(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function at(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ot=(0,G.createContext)(void 0),st=e=>{var t=(0,G.useContext)(ot);if(t!=null)return t.stackId;if(e!=null)return xe(e)},ct=(e,t)=>`recharts-bar-stack-clip-path-${e}-${t}`,lt=e=>{var t=(0,G.useContext)(ot);if(t!=null){var{stackId:n}=t;return`url(#${ct(n,e)})`}},ut=e=>{var{index:t}=e,n=it(e,rt),r=lt(t);return G.createElement(h,Y({className:`recharts-bar-stack-layer`,clipPath:r},n))},dt=[`onMouseEnter`,`onMouseLeave`,`onClick`],ft=[`value`,`background`,`tooltipPosition`],pt=[`id`],mt=[`onMouseEnter`,`onClick`,`onMouseLeave`];function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X.apply(null,arguments)}function ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ht(Object(n),!0).forEach(function(t){gt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gt(e,t,n){return(t=_t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _t(e){var t=vt(e,`string`);return typeof t==`symbol`?t:t+``}function vt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Q(e,t){if(e==null)return{};var n,r,i=yt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var bt=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:N(n,t),payload:e}]},xt=G.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:s,tooltipType:c,id:l}=e,u={dataDefinedOnItem:void 0,getPosition:ue,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:N(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return G.createElement(re,{tooltipEntrySettings:u})});function St(e){var t=j(x),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:s,onClick:c}=a,l=Q(a,dt),u=je(o,r,a.id),d=Me(s),f=Ne(c,r,a.id);if(!i||n==null)return null;var m=p(i);return G.createElement(L,{zIndex:We(i,_.barBackground)},n.map((e,n)=>{var{value:a,background:o,tooltipPosition:s}=e,c=Q(e,ft);if(!o)return null;var p=u(e,n),h=d(e,n),g=f(e,n),_=Z(Z(Z(Z(Z({option:i,isActive:String(n)===t},c),{},{fill:`#eee`},o),m),we(l,e,n)),{},{onMouseEnter:p,onMouseLeave:h,onClick:g,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return G.createElement(q,X({key:`background-bar-${n}`},_))}))}function Ct(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return Z(Z({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return G.createElement(oe,{value:t?i:void 0},n)}function wt(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,s=j(x),c=j(Te),l=n&&String(i.originalDataIndex)===s&&(c==null||o===c),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(!1);(0,G.useEffect)(()=>{var e;return l?(d(!0),e=requestAnimationFrame(()=>{p(!0)})):p(!1),()=>{cancelAnimationFrame(e)}},[l]);var m=(0,G.useCallback)(()=>{l||d(!1)},[l]),h=l&&f,g=l||u,v=l?n===!0?t:n:t,y=G.createElement(q,X({},r,{name:String(r.name)},i,{isActive:h,option:v,index:a,dataKey:o,onTransitionEnd:m}));return g?G.createElement(L,{zIndex:_.activeBar},G.createElement(ut,{index:i.originalDataIndex},y)):y}function Tt(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return G.createElement(q,X({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function Et(e){var{data:t,props:n}=e,r=te(n)??{},{id:i}=r,a=Q(r,pt),{shape:o,dataKey:s,activeBar:c}=n,{onMouseEnter:l,onClick:u,onMouseLeave:d}=n,f=Q(n,mt),p=je(l,s,i),m=Me(d),h=Ne(u,s,i);return t?G.createElement(G.Fragment,null,t.map((e,t)=>G.createElement(ut,X({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},we(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:h(e,t)}),c?G.createElement(wt,{shape:o,activeBar:c,baseProps:a,entry:e,index:t,dataKey:s}):G.createElement(Tt,{shape:o,baseProps:a,entry:e,index:t,dataKey:s})))):null}function Dt(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,onAnimationEnd:l,onAnimationStart:u}=t,f=n.current,p=T(t,`recharts-bar-`),[m,g]=(0,G.useState)(!1),_=!m,v=(0,G.useCallback)(()=>{typeof l==`function`&&l(),g(!1)},[l]),y=(0,G.useCallback)(()=>{typeof u==`function`&&u(),g(!0)},[u]);return G.createElement(Ct,{showLabels:_,rects:r},G.createElement(D,{animationId:p,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:v,onAnimationStart:y,key:p},e=>{var a=e===1?r:r?.map((t,n)=>{var r=f&&f[n];if(r)return Z(Z({},t),{},{x:d(r.x,t.x,e),y:d(r.y,t.y,e),width:d(r.width,t.width,e),height:d(r.height,t.height,e)});if(i===`horizontal`){var a=d(0,t.height,e),o=d(t.stackedBarStart,t.y,e);return Z(Z({},t),{},{y:o,height:a})}var s=d(0,t.width,e),c=d(t.stackedBarStart,t.x,e);return Z(Z({},t),{},{width:s,x:c})});return e>0&&(n.current=a??null),a==null?null:G.createElement(h,null,G.createElement(Et,{props:t,data:a}))}),G.createElement(ae,{label:t.label}),t.children)}function Ot(e){var t=(0,G.useRef)(null);return G.createElement(Dt,{previousRectanglesRef:t,props:e})}var kt=0,At=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:ie(e,t)}},jt=class extends G.PureComponent{render(){var{hide:e,data:t,dataKey:n,className:r,xAxisId:i,yAxisId:a,needClip:o,background:s,id:c}=this.props;if(e||t==null)return null;var l=E(`recharts-bar`,r),u=c;return G.createElement(h,{className:l,id:c},o&&G.createElement(`defs`,null,G.createElement(se,{clipPathId:u,xAxisId:i,yAxisId:a})),G.createElement(h,{className:`recharts-bar-rectangles`,clipPath:o?`url(#clipPath-${u})`:void 0},G.createElement(St,{data:t,dataKey:n,background:s,allOtherBarProps:this.props}),G.createElement(Ot,this.props)))}},Mt={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:kt,xAxisId:0,yAxisId:0,zIndex:_.bar};function Nt(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:o,activeBar:s,animationBegin:c,animationDuration:l,animationEasing:u,isAnimationActive:d}=e,{needClip:f}=k(t,n),p=i(),m=_e(),h=he(e.children,H),g=j(t=>nt(t,e.id,m,h));if(p!==`vertical`&&p!==`horizontal`)return null;var _,v=g?.[0];return _=v==null||v.height==null||v.width==null?0:p===`vertical`?v.height/2:v.width/2,G.createElement(Oe,{xAxisId:t,yAxisId:n,data:g,dataPointFormatter:At,errorBarOffset:_},G.createElement(jt,X({},e,{layout:p,needClip:f,data:g,xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:o,activeBar:s,animationBegin:c,animationDuration:l,animationEasing:u,isAnimationActive:d})))}function Pt(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:s,xAxis:c,yAxis:u,xAxisTicks:d,yAxisTicks:f,stackedData:p,displayedData:m,offset:h,cells:g,parentViewBox:_,dataStartIndex:v}=e,y=t===`horizontal`?u:c,ee=p?y.scale.domain():null,b=ve({numericAxis:y}),x=y.scale.map(b);return m.map((e,m)=>{var y,S,C,w,T,E;if(p){var te=p[m+v];if(te==null)return null;y=pe(te,ee)}else y=ie(e,n),Array.isArray(y)||(y=[b,y]);var D=qe(r,kt)(y[1],m);if(t===`horizontal`){var O=u.scale.map(y[0]),k=u.scale.map(y[1]);if(O==null||k==null)return null;S=ne({axis:c,ticks:d,bandSize:s,offset:a.offset,entry:e,index:m}),C=k??O??void 0,w=a.size;var A=O-k;if(T=l(A)?0:A,E={x:S,y:h.top,width:w,height:h.height},Math.abs(D)>0&&Math.abs(T)<Math.abs(D)){var j=o(T||D)*(Math.abs(D)-Math.abs(T));C-=j,T+=j}}else{var M=c.scale.map(y[0]),N=c.scale.map(y[1]);if(M==null||N==null)return null;if(S=M,C=ne({axis:u,ticks:f,bandSize:s,offset:a.offset,entry:e,index:m}),w=N-M,T=a.size,E={x:h.left,y:C,width:h.width,height:T},Math.abs(D)>0&&Math.abs(w)<Math.abs(D)){var re=o(w||D)*(Math.abs(D)-Math.abs(w));w+=re}}return S==null||C==null||w==null||T==null||!i&&(w===0||T===0)?null:Z(Z({},e),{},{stackedBarStart:x,x:S,y:C,width:w,height:T,value:p?y:y[1],payload:e,background:E,tooltipPosition:{x:S+w/2,y:C+T/2},parentViewBox:_,originalDataIndex:m},g&&g[m]&&g[m].props)}).filter(Boolean)}function Ft(e){var t=S(e,Mt),n=st(t.stackId),r=_e();return G.createElement(be,{id:t.id,type:`bar`},e=>G.createElement(G.Fragment,null,G.createElement(M,{legendPayload:bt(t)}),G.createElement(xt,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),G.createElement(fe,{type:`bar`,id:e,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),G.createElement(L,{zIndex:t.zIndex},G.createElement(Nt,X({},t,{id:e})))))}var It=G.memo(Ft,ge);It.displayName=`Bar`;var Lt=[`axis`,`item`],Rt=(0,G.forwardRef)((e,t)=>G.createElement(ye,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:Lt,tooltipPayloadSearcher:Se,categoricalChartProps:e,ref:t})),$=e();function zt({kind:e,selectedIds:t=[],onSelect:n}){let i=ke(e);return(0,$.jsxs)(`div`,{className:Ae.picker,children:[i.loading&&(0,$.jsxs)(`p`,{role:`status`,children:[`正在读取收藏`,V[e],`…`]}),i.error&&(0,$.jsxs)(`p`,{role:`alert`,children:[i.error,(0,$.jsx)(`button`,{onClick:i.refresh,children:`重试`})]}),!i.loading&&!i.error&&!i.items.length&&(0,$.jsxs)(`p`,{children:[`暂无收藏`,V[e],`,可先在排行榜或“我的收藏”中添加。`]}),(0,$.jsx)(r,{items:i.items,resetKey:e,onVisibleCount:i.onVisibleCount,children:r=>{let a=i.resolve(r.key),o=a.category?.id||a.record?.id,s=!!o&&t.includes(o);return(0,$.jsxs)(`button`,{className:Ae.pickRow,disabled:!o||s,onClick:()=>n(a),children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`b`,{children:a.category?.name||a.record?.name||`收藏资料待更新`}),(0,$.jsx)(`small`,{children:a.category?a.categoryPath||a.category.name:o?`${V[e]} ID:${o}`:`资料尚未就绪`})]}),(0,$.jsx)(`span`,{children:s?`已选择`:`选择`})]},r.key)}})]})}export{H as i,Rt as n,It as r,zt as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./package-
|
|
1
|
+
import{t as e}from"./package-rnaOiBPn.js";import{c as t,v as n,x as r}from"./index-Dfy2jMWq.js";import{t as i}from"./ProgressiveRows-CNmxc71t.js";import{c as a,i as o,o as s,t as c}from"./components-DMbkJLkK.js";import{s as l}from"./format-B2iJpu8S.js";import{t as u}from"./api-SsFxK3hw.js";import{n as d}from"./competitor-analysis-XIYJL66C.js";import{n as f,r as p,t as m}from"./favorites.module-CaTR2ido.js";var h=r(n(),1),g=t();function _({record:t,kind:n}){let r=l(t?.imageUrl),i=l(t?.url),a=n===`shop`?`店铺`:`商品`;return(0,g.jsxs)(`div`,{className:m.recordInfo,children:[n===`product`&&(0,g.jsx)(`div`,{className:m.thumbnail,children:r?(0,g.jsx)(s,{src:r,name:t?.name||`收藏商品`}):(0,g.jsx)(`span`,{children:(0,g.jsx)(e,{size:25})})}),(0,g.jsxs)(`div`,{className:m.recordText,children:[(0,g.jsx)(`b`,{children:t?.name||`收藏资料待更新`}),(0,g.jsxs)(`div`,{className:m.metadata,children:[(0,g.jsxs)(`span`,{children:[a,` ID:`,t?.id||`暂缺`]}),t?.id&&(0,g.jsx)(o,{text:t.id,label:`复制`+a+`ID`,title:`复制`+a+` ID`})]}),(0,g.jsx)(`div`,{className:m.metadata,children:i?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,children:[a,`链接`]}),(0,g.jsx)(o,{text:i,label:`复制`+a+`链接`,title:`复制`+a+`链接`})]}):(0,g.jsxs)(`span`,{children:[a,`链接暂缺`]})}),n===`product`&&t?.imageMonth&&(0,g.jsxs)(`small`,{children:[`图片来源:`,t.imageMonth,` 榜单`]})]})]})}function v({boot:e,initialKind:t,busy:n,onSave:r}){let[o,s]=(0,h.useState)(t),[l,d]=(0,h.useState)(``),[p,_]=(0,h.useState)(e.latestMonth||e.months.at(-1)||``),[v,y]=(0,h.useState)(``),[b,x]=(0,h.useState)([]),[S,C]=(0,h.useState)(!1),[w,T]=(0,h.useState)(``),E=(0,h.useRef)(null);(0,h.useEffect)(()=>()=>E.current?.abort(),[]);function D(){E.current?.abort(),x([]),C(!1),T(``)}let O=t=>e.favorites?.some(e=>e.kind===o&&e.key===t);async function k(e){await r(o,e,!0)&&T(`已添加到我的收藏`)}async function A(){if(o===`category`){await k(l);return}E.current?.abort();let e=new AbortController;E.current=e,C(!0),T(``),x([]);try{let t=await u.query({...a,view:o===`shop`?`shops`:`products`,categoryId:l,month:p,q:v.trim(),pageSize:25},e.signal);e.signal.aborted||(x(t.rows),t.rows.length||T(`该类目与月份暂无匹配记录,可调整名称或筛选条件。`))}catch(t){e.signal.aborted||T(t instanceof Error?t.message:`搜索失败`)}finally{e.signal.aborted||C(!1)}}return(0,g.jsxs)(`section`,{className:m.adder,"aria-label":`直接添加收藏`,children:[(0,g.jsx)(`h2`,{children:`添加收藏`}),(0,g.jsx)(`p`,{children:`选择获准类目;店铺和商品从对应月份的已入库榜单中搜索确认。`}),(0,g.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),A()},children:[(0,g.jsxs)(`label`,{children:[`收藏类型`,(0,g.jsx)(`select`,{"aria-label":`收藏类型`,value:o,onChange:e=>{D(),s(e.target.value)},children:Object.keys(f).map(e=>(0,g.jsx)(`option`,{value:e,children:f[e]},e))})]}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`span`,{children:`类目`}),(0,g.jsx)(c,{categories:e.categories,value:l,onChoose:e=>{D(),d(e)},disabled:!e.categories.length,favoriteIds:(e.favorites||[]).filter(e=>e.kind===`category`).map(e=>e.key)})]}),o!==`category`&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`label`,{children:[`月份`,(0,g.jsx)(`select`,{"aria-label":`收藏搜索月份`,value:p,onChange:e=>{D(),_(e.target.value)},children:e.months.map(e=>(0,g.jsx)(`option`,{children:e},e))})]}),(0,g.jsxs)(`label`,{children:[f[o],`搜索`,(0,g.jsx)(`input`,{"aria-label":`搜索待收藏记录`,value:v,maxLength:100,placeholder:o===`shop`?`输入店铺名称`:`输入商品名称或 ID`,onChange:e=>{D(),y(e.target.value)}})]})]}),(0,g.jsx)(`button`,{type:`submit`,disabled:n||S||!l||(o===`category`?!!O(l):!p||!v.trim()),children:o===`category`?O(l)?`已收藏`:`收藏此类目`:S?`搜索中…`:`搜索`})]}),w&&(0,g.jsx)(`p`,{role:`status`,children:w}),(0,g.jsx)(i,{items:b,children:e=>(0,g.jsxs)(`div`,{className:m.row,children:[(0,g.jsxs)(`span`,{children:[(0,g.jsx)(`b`,{children:e.name||`名称缺失`}),(0,g.jsxs)(`small`,{children:[`ID `,e.id||`缺失`,` · `,p]})]}),(0,g.jsx)(`button`,{disabled:n||!!O(e.key),onClick:()=>void k(e.key),children:O(e.key)?`已收藏`:`收藏`})]},e.key)})]})}function y({kind:e,busy:t,onSave:n,favorites:r}){let[i,a]=(0,h.useState)(null),[o,s]=(0,h.useState)(``);return(0,h.useEffect)(()=>{let e=new AbortController;return u.bootstrap(e.signal).then(t=>{e.signal.aborted||a(t)}).catch(t=>{e.signal.aborted||s(t instanceof Error?t.message:`添加资料读取失败`)}),()=>e.abort()},[]),o?(0,g.jsx)(`p`,{role:`alert`,children:o}):i?(0,g.jsx)(v,{boot:{...i,favorites:r},initialKind:e,busy:t,onSave:n}):(0,g.jsx)(`p`,{role:`status`,children:`正在加载可添加的类目与月份…`})}function b({competitorIds:e=[],onAddCompetitor:t,onOpenCompetitors:n}){let[r,a]=(0,h.useState)(``),[o,s]=(0,h.useState)(`category`),[c,l]=(0,h.useState)(!1),u=p(o);return(0,g.jsxs)(`div`,{className:m.home,children:[(0,g.jsxs)(`div`,{className:m.top,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h1`,{children:`我的收藏`}),(0,g.jsx)(`p`,{children:`管理当前账号的类目、店铺和商品收藏,供查询与分析时选择。`})]}),(0,g.jsxs)(`div`,{className:m.actions,children:[n&&(0,g.jsxs)(`button`,{onClick:n,children:[`竞品分析(`,e.length,`/`,2,`)`]}),(0,g.jsx)(`button`,{"aria-expanded":c,onClick:()=>l(e=>!e),children:c?`收起添加`:`添加收藏`}),(0,g.jsx)(`button`,{onClick:u.refresh,children:`刷新收藏`})]})]}),(0,g.jsx)(`nav`,{className:m.tabs,"aria-label":`收藏分类`,children:Object.keys(f).map(e=>(0,g.jsxs)(`button`,{"aria-pressed":o===e,onClick:()=>s(e),children:[f[e],`(`,u.collection?u.collection.counts[e]:`—`,`)`]},e))}),r&&(0,g.jsx)(`p`,{role:`status`,children:r}),u.error&&(0,g.jsx)(`p`,{role:`alert`,children:u.error}),u.syncError&&(0,g.jsx)(`p`,{role:`status`,children:u.syncError}),u.syncing&&(0,g.jsx)(`p`,{role:`status`,children:`正在后台更新收藏资料…`}),c&&(0,g.jsx)(y,{kind:o,favorites:u.collection?.entries||[],busy:!!u.busy,onSave:u.save},o),(0,g.jsxs)(`section`,{className:m.panel,"aria-label":f[o]+`收藏列表`,children:[u.loading&&(0,g.jsx)(`p`,{role:`status`,children:`正在读取收藏…`}),!u.loading&&!u.error&&!u.items.length&&(0,g.jsxs)(`p`,{className:m.empty,children:[`暂无收藏`,f[o],`,可直接添加或在排行榜中点击星标收藏。`]}),(0,g.jsx)(i,{items:u.items,resetKey:o,onVisibleCount:u.onVisibleCount,children:n=>{let{category:r,record:i,categoryPath:s}=u.resolve(n.key);return(0,g.jsxs)(`div`,{className:m.row,children:[o===`category`?(0,g.jsxs)(`span`,{children:[(0,g.jsx)(`b`,{children:r?.name||`收藏资料待更新`}),(0,g.jsx)(`small`,{children:s||r?.name})]}):(0,g.jsx)(_,{record:i,kind:o}),(0,g.jsxs)(`div`,{className:m.actions,children:[o===`product`&&t&&(0,g.jsx)(`button`,{disabled:!d(i?.id)||e.includes(i?.id||``)||e.length>=2,onClick:()=>{if(i?.id)try{t({id:i.id,name:i.name||`商品 ${i.id}`,imageUrl:i.imageUrl,shopName:i.shopName}),a(`已加入竞品分析,可继续选择或点击上方竞品分析查看`)}catch(e){a(e instanceof Error?e.message:`添加未完成`)}},children:e.includes(i?.id||``)?`已加入分析`:e.length>=2?`已满 2 个`:`加入竞品分析`}),(0,g.jsx)(`button`,{disabled:!!u.busy,"aria-label":`取消收藏`+(r?.name||i?.name||f[o]),onClick:()=>void u.save(o,n.key,!1),children:`取消收藏`})]})]},n.kind+n.key)}})]})]})}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as t,v as n,x as r}from"./index-
|
|
1
|
+
import{_ as e,c as t,v as n,x as r}from"./index-Dfy2jMWq.js";var i=r(n(),1),a=r(e(),1),o={trigger:`_trigger_10do5_1`,bubble:`_bubble_10do5_3`},s=t();function c({label:e,children:t}){let n=(0,i.useId)(),r=(0,i.useRef)(null),c=(0,i.useRef)(null),[l,u]=(0,i.useState)(!1),[d,f]=(0,i.useState)(null),p=(0,i.useRef)(!1),m=(0,i.useRef)(!1),h=(0,i.useRef)(null);function g(){h.current&&clearTimeout(h.current),u(!0)}function _(){h.current=setTimeout(()=>{!m.current&&document.activeElement!==r.current&&v()},160)}(0,i.useEffect)(()=>()=>{h.current&&clearTimeout(h.current)},[]);function v(){h.current&&clearTimeout(h.current),m.current=!1,u(!1),f(null)}return(0,i.useEffect)(()=>{if(!l)return;function e(){let e=r.current?.getBoundingClientRect(),t=c.current?.getBoundingClientRect();if(!e||!t)return;let n=document.documentElement.clientWidth,i=window.innerHeight;f({left:Math.max(8,Math.min(e.left,n-t.width-8)),top:Math.max(8,e.bottom+8+t.height<=i-8?e.bottom+8:e.top-t.height-8)})}function t(e){!r.current?.contains(e.target)&&!c.current?.contains(e.target)&&v()}function n(e){e.key===`Escape`&&v()}return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,n),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0),document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,n)}},[l]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`button`,{ref:r,type:`button`,className:o.trigger,"aria-label":e+`:使用说明`,"aria-describedby":l?n:void 0,"aria-expanded":l,onPointerDown:()=>{p.current=l},onClick:e=>{e.stopPropagation();let t=e.detail===0?!m.current:!p.current;m.current=t,u(t)},onFocus:g,onBlur:()=>{m.current||v()},onMouseEnter:g,onMouseLeave:_,children:`?`}),l&&typeof document<`u`&&(0,a.createPortal)((0,s.jsx)(`span`,{ref:c,id:n,role:`tooltip`,className:o.bubble,style:{left:d?.left??8,top:d?.top??8,visibility:d?`visible`:`hidden`},onMouseEnter:g,onMouseLeave:_,children:t}),document.body)]})}export{c as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,v as t,x as n}from"./index-
|
|
1
|
+
import{_ as e,v as t,x as n}from"./index-Dfy2jMWq.js";import{$ as r,A as i,B as a,E as o,Et as s,It as c,J as l,Lt as u,N as d,Ot as f,Q as p,Rt as m,St as h,U as g,Ut as _,Vt as v,W as y,X as b,Y as x,_t as S,a as C,bt as w,c as T,d as E,dt as D,et as O,f as k,ft as A,g as ee,gt as te,h as ne,i as re,jt as ie,k as j,l as ae,lt as oe,m as se,ot as M,pt as ce,q as N,rt as P,t as le,tt as ue,u as de,v as fe,vt as F,wt as pe,xt as me,y as he,yt as I,zt as ge}from"./CartesianChart-aa0EJ6w3.js";import{n as _e,r as ve,t as ye}from"./ErrorBarContext-BeuyujN4.js";import{n as be,r as xe,t as Se}from"./getRadiusAndStrokeWidthFromDot-zEte6bM_.js";var Ce=n(e()),L=n(t());function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(null,arguments)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?z(Object(n),!0).forEach(function(t){we(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function we(e,t,n){return(t=Te(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Te(e){var t=Ee(e,`string`);return typeof t==`symbol`?t:t+``}function Ee(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var V=32,De={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function Oe(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function ke(e){var{data:t,iconType:n,inactiveColor:r}=e,i=V/2,a=V/6,o=V/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return L.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:Oe(t.payload),x1:0,y1:i,x2:V,y2:i,className:`recharts-legend-icon`});if(c===`line`)return L.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o}
|
|
2
2
|
A${a},${a},0,1,1,${2*o},${i}
|
|
3
3
|
H${V}M${2*o},${i}
|
|
4
4
|
A${a},${a},0,1,1,${o},${i}`,className:`recharts-legend-icon`});if(c===`rect`)return L.createElement(`path`,{stroke:`none`,fill:s,d:`M0,${V/8}h${V}v${V*3/4}h${-V}z`,className:`recharts-legend-icon`});if(L.isValidElement(t.legendIcon)){var l=B({},t);return delete l.legendIcon,L.cloneElement(t.legendIcon,l)}return L.createElement(ve,{fill:s,cx:i,cy:i,size:V,sizeType:`diameter`,type:c})}function Ae(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:s}=e,c={x:0,y:0,width:V,height:V},l={display:r===`horizontal`?`inline-block`:`block`,marginRight:10},u={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,r)=>{var d=t.formatter||i,f=_({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?B({},s):{};p.color=t.inactive?a:p.color||t.color;var h=d?d(t.value,t,r):t.value;return L.createElement(`li`,R({className:f,style:l,key:`legend-item-${r}`},pe(e,t,r)),L.createElement(m,{width:n,height:n,viewBox:c,style:u,"aria-label":`${h} legend icon`},L.createElement(ke,{data:t,iconType:o,inactiveColor:a})),L.createElement(`span`,{className:`recharts-legend-item-text`,style:p},h))})}var je=e=>{var t=h(e,De),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return L.createElement(`ul`,{className:`recharts-default-legend`,style:a},L.createElement(Ae,R({},t,{payload:n})))};function Me(){return w(S)}var Ne=[`contextPayload`];function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H.apply(null,arguments)}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function W(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?U(Object(n),!0).forEach(function(t){Pe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Pe(e,t,n){return(t=Fe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e){var t=Ie(e,`string`);return typeof t==`symbol`?t:t+``}function Ie(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Le(e,t){if(e==null)return{};var n,r,i=Re(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Re(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ze(e){return e.value}function Be(e){var{contextPayload:t}=e,n=Le(e,Ne),r=me(t,e.payloadUniqBy,ze),i=W(W({},n),{},{payload:r});return L.isValidElement(e.content)?L.cloneElement(e.content,i):typeof e.content==`function`?L.createElement(e.content,i):L.createElement(je,i)}function Ve(e,t,n,r,i,a){var{layout:o,align:s,verticalAlign:c}=t,l,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l=s===`center`&&o===`vertical`?{left:((r||0)-a.width)/2}:s===`right`?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u=c===`middle`?{top:((i||0)-a.height)/2}:c===`bottom`?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),W(W({},l),u)}function He(e){var t=I();return(0,L.useEffect)(()=>{t(l(e))},[t,e]),null}function Ue(e){var t=I();return(0,L.useEffect)(()=>(t(x(e)),()=>{t(x({width:0,height:0}))}),[t,e]),null}function We(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var Ge={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,layout:`horizontal`,verticalAlign:`bottom`};function Ke(e){var t=h(e,Ge),n=Me(),r=c(),i=ue(),{width:a,height:o,wrapperStyle:s,portal:l}=t,[u,d]=te([n]),f=O(),m=p();if(f==null||m==null)return null;var g=f-(i?.left||0)-(i?.right||0),_=We(t.layout,o,a,g),v=l?s:W(W({position:`absolute`,width:_?.width||a||`auto`,height:_?.height||o||`auto`},Ve(s,t,i,f,m,u)),s),y=l??r;return y==null||n==null?null:(0,Ce.createPortal)(L.createElement(`div`,{className:`recharts-legend-wrapper`,style:v,ref:d},L.createElement(He,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!l&&L.createElement(Ue,{width:u.width,height:u.height}),L.createElement(Be,H({},t,_,{margin:i,chartWidth:f,chartHeight:m,contextPayload:n}))),y)}var G=L.memo(Ke,N);G.displayName=`Legend`;var K=(e,t,n,r)=>o(e,`xAxis`,t,r),q=(e,t,n,r)=>j(e,`xAxis`,t,r),J=(e,t,n,r)=>o(e,`yAxis`,n,r),Y=(e,t,n,r)=>j(e,`yAxis`,n,r),qe=F([b,K,J,q,Y],(e,t,n,r,i)=>ce(e,`xAxis`)?M(t,r,!1):M(n,i,!1)),Je=(e,t,n,r,i)=>i;function Ye(e){return e.type===`line`}var Xe=F([b,K,J,q,Y,F([i,Je],(e,t)=>e.filter(Ye).find(e=>e.id===t)),qe,a],(e,t,n,r,i,a,o,s)=>{var{chartData:c,dataStartIndex:l,dataEndIndex:u}=s;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var{dataKey:d,data:f}=a,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return yt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}}),Ze=[`id`],Qe=[`type`,`layout`,`connectNulls`,`needClip`,`shape`],$e=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X.apply(null,arguments)}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Z(Object(n),!0).forEach(function(t){et(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function et(e,t,n){return(t=tt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tt(e){var t=nt(e,`string`);return typeof t==`symbol`?t:t+``}function nt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function $(e,t){if(e==null)return{};var n,r,i=rt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var it=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:D(n,t),payload:e}]},at=L.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:ie,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:D(o,t),hide:s,type:l,color:r,unit:c,graphicalItemId:u}};return L.createElement(k,{tooltipEntrySettings:d})}),ot=(e,t)=>`${t}px ${e}px`;function st(e,t){for(var n=e.length%2==0?e:[...e,0],r=[],i=0;i<t;++i)r.push(...n);return r}var ct=(e,t,n)=>{var r=n.reduce((e,t)=>e+t,0);if(!r)return ot(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],s=0,c=0;s<n.length;c+=(l=n[s])??0,++s){var l,u=n[s];if(u!=null&&c+u>a){o=[...n.slice(0,s),a-c];break}}var d=o.length%2==0?[0,t]:[t];return[...st(n,i),...o,...d].map(e=>`${e}px`).join(`, `)};function lt(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:s}=r,c=v($(r,Ze));return L.createElement(xe,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function ut(e){var{showLabels:t,children:n,points:r}=e,i=(0,L.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return Q(Q({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return L.createElement(ne,{value:t?i:void 0},n)}function dt(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:s,connectNulls:c,needClip:l,shape:u}=a,d=Q(Q({},ge($(a,Qe))),{},{fill:`none`,className:`recharts-line-curve`,clipPath:l?`url(#clipPath-${t})`:void 0,points:r,type:o,layout:s,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return L.createElement(L.Fragment,null,r?.length>1&&L.createElement(_e,X({shapeType:`curve`,option:u},d,{pathRef:n})),L.createElement(lt,{points:r,clipPathId:t,props:a}))}function ft(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function pt(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:c,isAnimationActive:l,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:p,width:m,height:h,onAnimationEnd:_,onAnimationStart:v}=n,b=i.current,x=g(o,`recharts-line-`),S=(0,L.useRef)(x),[C,w]=(0,L.useState)(!1),T=!C,E=(0,L.useCallback)(()=>{typeof _==`function`&&_(),w(!1)},[_]),D=(0,L.useCallback)(()=>{typeof v==`function`&&v(),w(!0)},[v]),O=ft(r.current),k=(0,L.useRef)(0);S.current!==x&&(k.current=a.current,S.current=x);var A=k.current;return L.createElement(ut,{points:o,showLabels:T},n.children,L.createElement(y,{animationId:x,begin:u,duration:d,isActive:l,easing:f,onAnimationEnd:E,onAnimationStart:D,key:x},e=>{var u=s(A,O+A,e),d=Math.min(u,O),f=l?c?ct(d,O,`${c}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):ot(O,d):c==null?void 0:String(c);if(e>0&&O>0&&(i.current=o,a.current=Math.max(a.current,d)),b){var g=b.length/o.length,_=e===1?o:o.map((t,n)=>{var r=Math.floor(n*g);if(b[r]){var i=b[r];return Q(Q({},t),{},{x:s(i.x,t.x,e),y:s(i.y,t.y,e)})}return p?Q(Q({},t),{},{x:s(m*2,t.x,e),y:s(h/2,t.y,e)}):Q(Q({},t),{},{x:t.x,y:t.y})});return i.current=_,L.createElement(dt,{props:n,points:_,clipPathId:t,pathRef:r,strokeDasharray:f})}return L.createElement(dt,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:f})}),L.createElement(ee,{label:n.label}))}function mt(e){var{clipPathId:t,props:n}=e,r=(0,L.useRef)(null),i=(0,L.useRef)(0),a=(0,L.useRef)(null);return L.createElement(pt,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var ht=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:A(e.payload,t)}),gt=class extends L.Component{render(){var{hide:e,dot:t,points:n,className:r,xAxisId:i,yAxisId:a,top:o,left:s,width:c,height:l,id:d,needClip:f,zIndex:p}=this.props;if(e)return null;var m=_(`recharts-line`,r),h=d,{r:g,strokeWidth:v}=Se(t),y=se(t),b=g*2+v,x=f?`url(#clipPath-${y?``:`dots-`}${h})`:void 0;return L.createElement(he,{zIndex:p},L.createElement(u,{className:m},f&&L.createElement(`defs`,null,L.createElement(re,{clipPathId:h,xAxisId:i,yAxisId:a}),!y&&L.createElement(`clipPath`,{id:`clipPath-dots-${h}`},L.createElement(`rect`,{x:s-b/2,y:o-b/2,width:c+b,height:l+b}))),L.createElement(ye,{xAxisId:i,yAxisId:a,data:n,dataPointFormatter:ht,errorBarOffset:0},L.createElement(mt,{props:this.props,clipPathId:h}))),L.createElement(be,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:x}))}},_t={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:d.line,type:`linear`};function vt(e){var t=h(e,_t),{activeDot:n,animateNewValues:i,animationBegin:a,animationDuration:o,animationEasing:s,connectNulls:c,dot:l,hide:u,isAnimationActive:d,label:f,legendType:p,xAxisId:m,yAxisId:g,id:_}=t,v=$(t,$e),{needClip:y}=C(m,g),b=T(),x=r(),S=P(),E=w(e=>Xe(e,m,g,S,_));if(x!==`horizontal`&&x!==`vertical`||E==null||b==null)return null;var{height:D,width:O,x:k,y:A}=b;return L.createElement(gt,X({},v,{id:_,connectNulls:c,dot:l,activeDot:n,animateNewValues:i,animationBegin:a,animationDuration:o,animationEasing:s,isAnimationActive:d,hide:u,label:f,legendType:p,xAxisId:m,yAxisId:g,points:E,layout:x,height:D,width:O,left:k,top:A,needClip:y}))}function yt(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:s,displayedData:c}=e;return c.map((e,c)=>{var l=A(e,o);if(t===`horizontal`)return{x:oe({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(f(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=f(l)?null:n.scale.map(l),d=oe({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function bt(e){var t=h(e,_t),n=P();return L.createElement(de,{id:t.id,type:`line`},e=>L.createElement(L.Fragment,null,L.createElement(E,{legendPayload:it(t)}),L.createElement(at,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),L.createElement(ae,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),L.createElement(vt,X({},t,{id:e}))))}var xt=L.memo(bt,N);xt.displayName=`Line`;var St=[`axis`],Ct=(0,L.forwardRef)((e,t)=>L.createElement(le,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:St,tooltipPayloadSearcher:fe,categoricalChartProps:e,ref:t}));export{xt as n,G as r,Ct as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./arrow-left-D6ZJJ6TV.js";import{t}from"./arrow-up-right-D1eLXOum.js";import{t as n}from"./refresh-cw-BwEoF6sI.js";import{t as r}from"./search-BDEOXxcW.js";import{t as i}from"./trending-up-BPVwzUjj.js";import{c as a,v as o,x as s}from"./index-CShNDEcL.js";import{a as c,l,s as u,t as d}from"./components-HGHI0_0I.js";import{i as f,s as p,t as m}from"./format-B2iJpu8S.js";import{t as h}from"./api-SsFxK3hw.js";import{t as g}from"./market.module-MVB-GO7b.js";var _=s(o(),1),v={page:`_page_4wowc_1`,header:`_header_4wowc_2`,sectionHeader:`_sectionHeader_4wowc_4`,eyebrow:`_eyebrow_4wowc_5`,period:`_period_4wowc_6`,periodComparison:`_periodComparison_4wowc_9`,muted:`_muted_4wowc_11`,coverage:`_coverage_4wowc_11`,scope:`_scope_4wowc_12`,filters:`_filters_4wowc_14`,filterFields:`_filterFields_4wowc_15`,filterActions:`_filterActions_4wowc_16`,search:`_search_4wowc_22`,rule:`_rule_4wowc_25`,stats:`_stats_4wowc_26`,tableWrap:`_tableWrap_4wowc_35`,textButton:`_textButton_4wowc_43`,positive:`_positive_4wowc_45`,signals:`_signals_4wowc_46`,pager:`_pager_4wowc_49`,empty:`_empty_4wowc_51`,method:`_method_4wowc_53`,context:`_context_4wowc_55`,productSection:`_productSection_4wowc_59`,product:`_product_4wowc_59`},y=a(),b={minGrowth:`20`,minSales:`1000000`,minBase:`100000`,maxShops:`500`,q:``},x={...b,minSales:`10000`,minBase:`10000`},S=e=>e==null?`—`:`${e>0?`+`:``}${f(e,`percent`)}`;function C(e,t){let n=e?new URLSearchParams(e).toString():``,r=n+`:`+t,[i,a]=(0,_.useState)({key:``,data:null,error:``});return(0,_.useEffect)(()=>{if(!n)return;let e=new AbortController;return h.opportunities(Object.fromEntries(new URLSearchParams(n)),e.signal).then(t=>{e.signal.aborted||a({key:r,data:t,error:``})}).catch(t=>{e.signal.aborted||a({key:r,data:null,error:t instanceof Error?t.message:`机会数据读取失败`})}),()=>e.abort()},[n,r]),i.key===r?{...i,loading:!1}:{data:null,error:``,loading:!!n}}function w({value:e,onApply:t,products:n=!1}){let[i,a]=(0,_.useState)(e);function o(e){e.preventDefault(),t(i)}return(0,y.jsxs)(`form`,{className:v.filters,onSubmit:o,children:[(0,y.jsxs)(`div`,{className:v.filterFields,children:[(0,y.jsxs)(`label`,{children:[`环比增长 ≥`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`input`,{"aria-label":`最低环比增长`,type:`number`,min:`0`,max:`10000`,step:`0.01`,required:!0,value:i.minGrowth,onChange:e=>a({...i,minGrowth:e.target.value})}),`%`]})]}),(0,y.jsxs)(`label`,{children:[`本月销售额 ≥`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`input`,{"aria-label":`最低本月销售额(万元)`,type:`number`,min:`0`,max:`100000000`,step:`0.01`,required:!0,value:i.minSales===``?``:Number(i.minSales)/1e4,onChange:e=>a({...i,minSales:e.target.value===``?``:String(Math.round(Number(e.target.value)*1e6)/100)})}),`万元`]})]}),(0,y.jsxs)(`label`,{children:[`上月销售额 ≥`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`input`,{"aria-label":`最低上月销售额(万元)`,type:`number`,min:`0`,max:`100000000`,step:`0.01`,required:!0,value:i.minBase===``?``:Number(i.minBase)/1e4,onChange:e=>a({...i,minBase:e.target.value===``?``:String(Math.round(Number(e.target.value)*1e6)/100)})}),`万元`]})]}),!n&&(0,y.jsxs)(`label`,{children:[`店铺数 ≤`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`input`,{"aria-label":`最多竞争店铺数`,type:`number`,min:`1`,max:`1000000000`,step:`1`,required:!0,value:i.maxShops,onChange:e=>a({...i,maxShops:e.target.value})}),`家`]})]})]}),(0,y.jsxs)(`div`,{className:v.filterActions,children:[(0,y.jsxs)(`label`,{className:v.search,children:[`关键词`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(r,{size:14}),(0,y.jsx)(`input`,{"aria-label":n?`搜索机会商品`:`搜索机会类目`,placeholder:n?`商品名称 / ID`:`类目名称`,maxLength:120,value:i.q,onChange:e=>a({...i,q:e.target.value})})]})]}),(0,y.jsx)(`button`,{className:g.primary,type:`submit`,children:`筛选机会`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>{let e=n?x:b;a(e),t(e)},children:`重置`})]})]})}function T({page:e,total:t,onChange:n}){let r=Math.max(1,Math.ceil(t/25));return(0,y.jsxs)(`div`,{className:v.pager,children:[(0,y.jsxs)(`span`,{children:[`共 `,f(t),` 个候选`]}),(0,y.jsx)(`button`,{disabled:e<=1,onClick:()=>n(e-1),children:`上一页`}),(0,y.jsxs)(`span`,{children:[e,` / `,r]}),(0,y.jsx)(`button`,{disabled:e>=r,onClick:()=>n(e+1),children:`下一页`})]})}function E({message:e,retry:t}){return(0,y.jsxs)(`div`,{className:v.empty,role:`alert`,children:[(0,y.jsx)(`p`,{children:e}),(0,y.jsxs)(`button`,{onClick:t,children:[(0,y.jsx)(n,{size:14}),`重新读取`]})]})}function D({row:e}){return(0,y.jsxs)(`div`,{className:v.signals,children:[(0,y.jsx)(`span`,{children:e.salesGrowth!=null&&e.salesGrowth>0&&e.previousGrowth!=null&&e.previousGrowth>0?`连续两月增长`:`持续性待验证`}),(0,y.jsx)(`small`,{children:e.salesYoy==null?`去年同月未覆盖`:`同比 ${S(e.salesYoy)}`})]})}function O({record:e,onClose:t}){let[n,r]=(0,_.useState)({data:null,error:``});return(0,_.useEffect)(()=>{let t=new AbortController;return h.record(e.key,t.signal).then(e=>{t.signal.aborted||r({data:e,error:``})}).catch(e=>{t.signal.aborted||r({data:null,error:e instanceof Error?e.message:`走势读取失败`})}),()=>t.abort()},[e.key]),(0,y.jsx)(c,{title:e.name||e.id||`商品走势`,onClose:t,children:n.error?(0,y.jsx)(`p`,{role:`alert`,children:n.error}):n.data?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(u,{points:n.data.trend}),(0,y.jsx)(`p`,{className:v.muted,children:`金额单位元;缺失月份不补零。同月冲突记录保持缺口。`}),n.data.warnings?.map(e=>(0,y.jsx)(`p`,{children:e},e))]}):(0,y.jsx)(`p`,{role:`status`,children:`正在读取商品走势…`})})}function k({month:n,categoryId:r,onBack:i,onOpenCategory:a}){let[o,s]=l(`opportunityProductFilters`,x),[c,d]=(0,_.useState)(1),[m,h]=(0,_.useState)(`salesIncrease`),[g,b]=(0,_.useState)(0),[k,A]=(0,_.useState)(null),{data:j,error:M,loading:N}=C({kind:`products`,month:n,categoryId:r,...o,sort:m,page:String(c)},g),P=j?.category;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:v.header,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{onClick:i,children:[(0,y.jsx)(e,{size:14}),`机会市场`]}),(0,y.jsx)(`h1`,{children:P?.name||`赛道详情`}),(0,y.jsxs)(`p`,{children:[n,` 对比 `,j?.previousMonth||`上月`,` · 在赛道中寻找增长商品`]})]}),(0,y.jsxs)(`button`,{onClick:()=>a(r,n),children:[`查看完整商品榜`,(0,y.jsx)(t,{size:14})]})]}),N&&(0,y.jsx)(`p`,{className:v.empty,role:`status`,children:`正在比较相邻月份的商品数据…`}),M&&(0,y.jsx)(E,{message:M,retry:()=>b(e=>e+1)}),j&&P&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:v.stats,children:[(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`类目销售额`}),(0,y.jsx)(`strong`,{children:f(P.sales,`money`)}),(0,y.jsxs)(`small`,{children:[`环比 `,S(P.salesGrowth)]})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`类目店铺数`}),(0,y.jsxs)(`strong`,{children:[f(P.shopCount),` `,(0,y.jsx)(`i`,{children:`家`})]}),(0,y.jsxs)(`small`,{children:[`环比 `,S(P.shopGrowth)]})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`平均每店市场规模`}),(0,y.jsx)(`strong`,{children:f(P.salesPerShop,`money`)}),(0,y.jsx)(`small`,{children:`类目销售额 ÷ 店铺数,不代表利润`})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`增长延续性`}),(0,y.jsx)(`strong`,{children:P.previousGrowth!=null&&P.previousGrowth>0&&P.salesGrowth!=null&&P.salesGrowth>0?`连续两月增长`:`需要继续观察`}),(0,y.jsxs)(`small`,{children:[`上期环比 `,S(P.previousGrowth)]})]})]}),(0,y.jsxs)(`div`,{className:v.context,children:[(0,y.jsxs)(`section`,{children:[(0,y.jsxs)(`h2`,{children:[`类目销售趋势 `,(0,y.jsx)(`small`,{children:`近 12 个自然月 · 元`})]}),(0,y.jsx)(u,{points:j.trend})]}),(0,y.jsxs)(`aside`,{children:[(0,y.jsx)(`h2`,{children:`入场前,还要验证`}),(0,y.jsx)(`p`,{children:`店铺数量少只是竞争初筛,可能存在头部垄断、资质门槛或需求过小。`}),(0,y.jsxs)(`ul`,{children:[(0,y.jsx)(`li`,{children:`结合完整店铺榜确认头部集中度与品牌壁垒。`}),(0,y.jsx)(`li`,{children:`对照同比和多个周期,区分季节性、活动与持续增长。`}),(0,y.jsx)(`li`,{children:`核算毛利、投放成本、供应链及资质;当前数据不包含这些成本。`})]}),(0,y.jsx)(D,{row:P})]})]}),(0,y.jsxs)(`section`,{className:v.productSection,children:[(0,y.jsxs)(`div`,{className:v.sectionHeader,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`h2`,{children:[`机会商品 `,(0,y.jsx)(`small`,{children:`同一商品 ID 的跨月增长`})]}),(0,y.jsx)(`p`,{children:`展示该类目的增长候选,商品本身的同款竞争尚未判定。`})]}),(0,y.jsxs)(`label`,{children:[`排序 `,(0,y.jsxs)(`select`,{"aria-label":`机会商品排序`,value:m,onChange:e=>{h(e.target.value),d(1)},children:[(0,y.jsx)(`option`,{value:`salesIncrease`,children:`销售增量优先`}),(0,y.jsx)(`option`,{value:`salesGrowth`,children:`增长率优先`}),(0,y.jsx)(`option`,{value:`sales`,children:`销售规模优先`})]})]})]}),(0,y.jsx)(w,{products:!0,value:o,onApply:e=>{s(e),d(1)}}),j.availability.current!==`ready`||j.availability.previous!==`ready`?(0,y.jsxs)(`div`,{className:v.empty,children:[(0,y.jsx)(`h3`,{children:`这两个月的商品榜暂不能完整对比`}),(0,y.jsxs)(`p`,{children:[n,`:`,j.availability.current===`ready`?`已就绪`:j.availability.current===`pending`?`导入中`:`未覆盖`,`;`,j.previousMonth,`:`,j.availability.previous===`ready`?`已就绪`:j.availability.previous===`pending`?`导入中`:`未覆盖`,`。`]}),(0,y.jsx)(`p`,{children:`补齐后再计算增长,缺失榜单不会作为零销售额。`})]}):(0,y.jsxs)(y.Fragment,{children:[j.coverage&&(0,y.jsxs)(`p`,{className:v.coverage,children:[`本月 `,f(j.coverage.current),` 个已识别商品 · 可比 `,f(j.coverage.comparable),` 个 · 本月首次观察 `,f(j.coverage.newlyObserved),` 个 · 零基数或缺值 `,f(j.coverage.invalidBase),` 个 · 销售额冲突 `,f(j.coverage.conflicts),` 个`]}),j.rows.length?(0,y.jsx)(`div`,{className:v.tableWrap,children:(0,y.jsxs)(`table`,{children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{children:`商品 / 店铺`}),(0,y.jsx)(`th`,{children:`本月销售额`}),(0,y.jsx)(`th`,{children:`上月销售额`}),(0,y.jsx)(`th`,{children:`增长金额`}),(0,y.jsx)(`th`,{children:`环比增长`}),(0,y.jsx)(`th`,{children:`件单价`}),(0,y.jsx)(`th`,{children:`查看`})]})}),(0,y.jsx)(`tbody`,{children:j.rows.map(e=>(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`td`,{children:(0,y.jsxs)(`div`,{className:v.product,children:[p(e.imageUrl)&&(0,y.jsx)(`img`,{src:p(e.imageUrl),alt:``,loading:`lazy`}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`button`,{className:v.textButton,onClick:()=>A(e),children:e.name||e.id}),(0,y.jsxs)(`small`,{children:[e.shopName||`店铺名称未提供`,` · `,e.id]})]})]})}),(0,y.jsx)(`td`,{children:f(e.sales,`money`)}),(0,y.jsx)(`td`,{children:f(e.previousSales,`money`)}),(0,y.jsxs)(`td`,{className:v.positive,children:[`+`,f(e.salesIncrease,`money`)]}),(0,y.jsx)(`td`,{className:v.positive,children:S(e.salesGrowth)}),(0,y.jsx)(`td`,{children:f(e.unitPrice,`money`)}),(0,y.jsxs)(`td`,{children:[(0,y.jsx)(`button`,{onClick:()=>A(e),children:`走势`}),p(e.url)&&(0,y.jsx)(`a`,{href:p(e.url),target:`_blank`,rel:`noreferrer`,children:`商品链接 ↗`})]})]},e.id))})]})}):(0,y.jsxs)(`div`,{className:v.empty,children:[(0,y.jsx)(`h3`,{children:`没有符合当前条件的商品`}),(0,y.jsx)(`p`,{children:`可以调整增长率或销售额门槛;首次观察到的商品不等于新品,也不直接判为增长机会。`})]}),(0,y.jsx)(T,{page:c,total:j.total,onChange:d})]})]})]}),k&&(0,y.jsx)(O,{record:k,onClose:()=>A(null)})]})}function A({onOpenCategory:e}){let[n,r]=(0,_.useState)(0),[a,o]=(0,_.useState)({revision:-1,data:null,error:``}),[s,c]=l(`opportunityMonth`,``),[u,p]=l(`opportunityScope`,``),[x,O]=l(`opportunityFilters`,b),[A,j]=l(`opportunitySort`,`salesIncrease`),[M,N]=l(`opportunityPage`,1),[P,F]=l(`opportunitySelected`,null);(0,_.useEffect)(()=>{let e=new AbortController;return h.bootstrap(e.signal).then(t=>{e.signal.aborted||o({revision:n,data:t,error:``})}).catch(t=>{e.signal.aborted||o({revision:n,data:null,error:t instanceof Error?t.message:`市场数据读取失败`})}),()=>e.abort()},[n]);let I=a.revision===n?a.data:null,L=I?.status===`ready`&&I.capabilities?.opportunities,{data:R,error:z,loading:B}=C(L&&!P?{kind:`markets`,month:s,categoryId:u,...x,sort:A,page:String(M)}:null,n),V=()=>r(e=>e+1);return(0,y.jsxs)(`main`,{className:`${g.page} ${v.page}`,children:[!I&&a.revision!==n&&(0,y.jsx)(`p`,{className:v.empty,role:`status`,children:`正在读取市场范围…`}),a.revision===n&&a.error&&(0,y.jsx)(E,{message:a.error,retry:V}),I&&!L&&(0,y.jsx)(E,{message:I.status===`no-access`?`企业尚未获得市场类目授权`:I.status===`unpublished`?`市场数据尚未就绪`:`机会发现服务暂未就绪`,retry:V}),L&&P?(0,y.jsx)(k,{...P,onBack:()=>F(null),onOpenCategory:e},P.categoryId+P.month):L&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:v.header,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{className:v.eyebrow,children:[(0,y.jsx)(i,{size:15}),`市场洞察 / 机会发现`]}),(0,y.jsx)(`h1`,{children:`找到增长中的细分赛道`}),(0,y.jsx)(`p`,{children:`先看需求增长与竞争店铺,再进入赛道寻找增长商品。`})]}),(0,y.jsxs)(`div`,{className:v.period,children:[(0,y.jsxs)(`label`,{children:[`统计月份 `,(0,y.jsxs)(`select`,{"aria-label":`机会市场统计月份`,value:s||R?.month||``,onChange:e=>{c(e.target.value),N(1)},children:[(0,y.jsx)(`option`,{value:``,children:`最近可比月份`}),(R?.months||I.months).map(e=>(0,y.jsxs)(`option`,{value:e,children:[e,R?.missingStatisticsMonths?.includes(e)?` · 类目统计待补齐`:``]},e))]})]}),(0,y.jsxs)(`div`,{className:v.periodComparison,children:[(0,y.jsx)(`span`,{children:`对比月份`}),(0,y.jsx)(`strong`,{children:R?.previousMonth||`自动匹配上月`})]})]})]}),(0,y.jsxs)(`div`,{className:v.scope,children:[(0,y.jsx)(d,{categories:I.categories,favoriteIds:(I.favorites||[]).filter(e=>e.kind===`category`).map(e=>e.key),value:u,disabled:!1,onChoose:e=>{p(e),N(1)}}),(0,y.jsx)(`span`,{children:`只比较叶子类目,避免父子类目重复计算`})]}),(0,y.jsx)(w,{value:x,onApply:e=>{O(e),N(1)}}),(0,y.jsx)(`p`,{className:v.rule,children:`同时要求:销售额增速高于店铺数增速。门槛是可调整的筛选条件,不是行业通用标准。`}),B&&(0,y.jsx)(`p`,{className:v.empty,role:`status`,children:`正在筛选机会市场…`}),z&&(0,y.jsx)(E,{message:z,retry:V}),R?.month&&R.missingStatisticsMonths?.includes(R.month)&&(0,y.jsxs)(`div`,{className:v.empty,role:`status`,children:[(0,y.jsxs)(`h3`,{children:[R.month,` 榜单已入库,类目统计待补齐`]}),(0,y.jsx)(`p`,{children:`商品和店铺榜单可以查看;市场销售额与店铺数尚缺类目月度统计,补齐后可进行相邻月机会筛选。`}),(0,y.jsxs)(`button`,{onClick:()=>e(u,R.month),children:[`查看本月商品榜`,(0,y.jsx)(t,{size:14})]})]}),R?.previousMonth&&R.missingStatisticsMonths?.includes(R.previousMonth)&&!R.missingStatisticsMonths.includes(R.month||``)&&(0,y.jsxs)(`p`,{className:v.rule,role:`status`,children:[`对比月份 `,R.previousMonth,` 的类目统计待补齐,本月机会筛选暂无完整环比依据。`]}),R&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:v.stats,children:[(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`当前范围叶子类目`}),(0,y.jsx)(`strong`,{children:f(R.coverage.scanned)})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`相邻月数据可比`}),(0,y.jsx)(`strong`,{children:f(R.coverage.comparable)})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`符合条件的机会候选`}),(0,y.jsx)(`strong`,{className:v.positive,children:f(R.total)})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`缺失 / 零基数排除`}),(0,y.jsx)(`strong`,{children:f(R.coverage.excluded)})]})]}),(0,y.jsxs)(`div`,{className:v.sectionHeader,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{children:`机会市场`}),(0,y.jsx)(`p`,{children:`店铺数用于竞争初筛;点击候选查看趋势和机会商品。`})]}),(0,y.jsxs)(`label`,{children:[`排序 `,(0,y.jsxs)(`select`,{"aria-label":`机会市场排序`,value:A,onChange:e=>{j(e.target.value),N(1)},children:[(0,y.jsx)(`option`,{value:`salesIncrease`,children:`销售增量优先`}),(0,y.jsx)(`option`,{value:`salesGrowth`,children:`增长率优先`}),(0,y.jsx)(`option`,{value:`sales`,children:`销售规模优先`}),(0,y.jsx)(`option`,{value:`shopCount`,children:`店铺数量从少到多`})]})]})]}),R.rows.length?(0,y.jsx)(`div`,{className:v.tableWrap,children:(0,y.jsxs)(`table`,{children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{children:`机会赛道 / 增长信号`}),(0,y.jsx)(`th`,{children:`本月销售额`}),(0,y.jsx)(`th`,{children:`增长金额`}),(0,y.jsx)(`th`,{children:`环比增长`}),(0,y.jsx)(`th`,{children:`店铺数`}),(0,y.jsx)(`th`,{children:`店铺数环比`}),(0,y.jsx)(`th`,{children:`平均每店市场规模`}),(0,y.jsx)(`th`,{children:`查看`})]})}),(0,y.jsx)(`tbody`,{children:R.rows.map(e=>(0,y.jsxs)(`tr`,{children:[(0,y.jsxs)(`td`,{children:[(0,y.jsx)(`button`,{className:v.textButton,onClick:()=>F({categoryId:e.id,month:R.month}),children:e.name}),(0,y.jsx)(`small`,{children:m(I.categories,e.id).slice(0,-1).map(e=>e.name).join(` / `)}),(0,y.jsx)(D,{row:e})]}),(0,y.jsxs)(`td`,{children:[f(e.sales,`money`),(0,y.jsxs)(`small`,{children:[`上月 `,f(e.previousSales,`money`)]})]}),(0,y.jsxs)(`td`,{className:v.positive,children:[`+`,f(e.salesIncrease,`money`)]}),(0,y.jsx)(`td`,{className:v.positive,children:S(e.salesGrowth)}),(0,y.jsxs)(`td`,{children:[f(e.shopCount),` 家`]}),(0,y.jsx)(`td`,{children:S(e.shopGrowth)}),(0,y.jsx)(`td`,{children:f(e.salesPerShop,`money`)}),(0,y.jsx)(`td`,{children:(0,y.jsxs)(`button`,{onClick:()=>F({categoryId:e.id,month:R.month}),children:[`看机会商品`,(0,y.jsx)(t,{size:13})]})})]},e.id))})]})}):(0,y.jsxs)(`div`,{className:v.empty,children:[(0,y.jsx)(`h3`,{children:`当前条件下没有机会候选`}),(0,y.jsx)(`p`,{children:R.coverage.comparable===0?`相邻月份的销售额或店铺数缺少可比数据,不会把缺失月份当零。`:`可以切换类目或调整门槛;没有命中不代表市场不存在机会。`}),R.comparableMonths.at(-1)&&R.comparableMonths.at(-1)!==R.month&&(0,y.jsxs)(`button`,{onClick:()=>{c(R.comparableMonths.at(-1)),N(1)},children:[`查看最近可比月 `,R.comparableMonths.at(-1)]})]}),(0,y.jsx)(T,{page:M,total:R.total,onChange:N}),(0,y.jsxs)(`details`,{className:v.method,children:[(0,y.jsx)(`summary`,{children:`筛选依据与使用边界`}),(0,y.jsxs)(`p`,{children:[R.provenance.source,`。增长率 =(本月销售额 − 上月销售额)÷ 上月销售额;相邻自然月比较,不跨缺月。销售额、店铺数缺失及零基数不参与机会筛选。各类目独立比较,不做跨层级加总。`]}),(0,y.jsx)(`p`,{children:`销售增长快于店铺增长,表示平均每店市场规模扩大,仍不等于每家店增长。店铺少可能来自集中度、准入门槛或数据覆盖;需要进一步检查头部品牌、季节性、流量成本和利润。商品榜为已入库样本,首次观察不等于新上架。`})]})]})]})]})}export{A as default};
|
|
1
|
+
import{t as e}from"./arrow-left-CrtjcWhu.js";import{t}from"./arrow-up-right-FAUwydEi.js";import{t as n}from"./refresh-cw-CiIEylYp.js";import{t as r}from"./search-DlLds8Ae.js";import{t as i}from"./trending-up-CWfLLrC6.js";import{c as a,v as o,x as s}from"./index-Dfy2jMWq.js";import{a as c,l,s as u,t as d}from"./components-DMbkJLkK.js";import{i as f,s as p,t as m}from"./format-B2iJpu8S.js";import{t as h}from"./api-SsFxK3hw.js";import{t as g}from"./market.module-MVB-GO7b.js";var _=s(o(),1),v={page:`_page_4wowc_1`,header:`_header_4wowc_2`,sectionHeader:`_sectionHeader_4wowc_4`,eyebrow:`_eyebrow_4wowc_5`,period:`_period_4wowc_6`,periodComparison:`_periodComparison_4wowc_9`,muted:`_muted_4wowc_11`,coverage:`_coverage_4wowc_11`,scope:`_scope_4wowc_12`,filters:`_filters_4wowc_14`,filterFields:`_filterFields_4wowc_15`,filterActions:`_filterActions_4wowc_16`,search:`_search_4wowc_22`,rule:`_rule_4wowc_25`,stats:`_stats_4wowc_26`,tableWrap:`_tableWrap_4wowc_35`,textButton:`_textButton_4wowc_43`,positive:`_positive_4wowc_45`,signals:`_signals_4wowc_46`,pager:`_pager_4wowc_49`,empty:`_empty_4wowc_51`,method:`_method_4wowc_53`,context:`_context_4wowc_55`,productSection:`_productSection_4wowc_59`,product:`_product_4wowc_59`},y=a(),b={minGrowth:`20`,minSales:`1000000`,minBase:`100000`,maxShops:`500`,q:``},x={...b,minSales:`10000`,minBase:`10000`},S=e=>e==null?`—`:`${e>0?`+`:``}${f(e,`percent`)}`;function C(e,t){let n=e?new URLSearchParams(e).toString():``,r=n+`:`+t,[i,a]=(0,_.useState)({key:``,data:null,error:``});return(0,_.useEffect)(()=>{if(!n)return;let e=new AbortController;return h.opportunities(Object.fromEntries(new URLSearchParams(n)),e.signal).then(t=>{e.signal.aborted||a({key:r,data:t,error:``})}).catch(t=>{e.signal.aborted||a({key:r,data:null,error:t instanceof Error?t.message:`机会数据读取失败`})}),()=>e.abort()},[n,r]),i.key===r?{...i,loading:!1}:{data:null,error:``,loading:!!n}}function w({value:e,onApply:t,products:n=!1}){let[i,a]=(0,_.useState)(e);function o(e){e.preventDefault(),t(i)}return(0,y.jsxs)(`form`,{className:v.filters,onSubmit:o,children:[(0,y.jsxs)(`div`,{className:v.filterFields,children:[(0,y.jsxs)(`label`,{children:[`环比增长 ≥`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`input`,{"aria-label":`最低环比增长`,type:`number`,min:`0`,max:`10000`,step:`0.01`,required:!0,value:i.minGrowth,onChange:e=>a({...i,minGrowth:e.target.value})}),`%`]})]}),(0,y.jsxs)(`label`,{children:[`本月销售额 ≥`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`input`,{"aria-label":`最低本月销售额(万元)`,type:`number`,min:`0`,max:`100000000`,step:`0.01`,required:!0,value:i.minSales===``?``:Number(i.minSales)/1e4,onChange:e=>a({...i,minSales:e.target.value===``?``:String(Math.round(Number(e.target.value)*1e6)/100)})}),`万元`]})]}),(0,y.jsxs)(`label`,{children:[`上月销售额 ≥`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`input`,{"aria-label":`最低上月销售额(万元)`,type:`number`,min:`0`,max:`100000000`,step:`0.01`,required:!0,value:i.minBase===``?``:Number(i.minBase)/1e4,onChange:e=>a({...i,minBase:e.target.value===``?``:String(Math.round(Number(e.target.value)*1e6)/100)})}),`万元`]})]}),!n&&(0,y.jsxs)(`label`,{children:[`店铺数 ≤`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`input`,{"aria-label":`最多竞争店铺数`,type:`number`,min:`1`,max:`1000000000`,step:`1`,required:!0,value:i.maxShops,onChange:e=>a({...i,maxShops:e.target.value})}),`家`]})]})]}),(0,y.jsxs)(`div`,{className:v.filterActions,children:[(0,y.jsxs)(`label`,{className:v.search,children:[`关键词`,(0,y.jsxs)(`span`,{children:[(0,y.jsx)(r,{size:14}),(0,y.jsx)(`input`,{"aria-label":n?`搜索机会商品`:`搜索机会类目`,placeholder:n?`商品名称 / ID`:`类目名称`,maxLength:120,value:i.q,onChange:e=>a({...i,q:e.target.value})})]})]}),(0,y.jsx)(`button`,{className:g.primary,type:`submit`,children:`筛选机会`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>{let e=n?x:b;a(e),t(e)},children:`重置`})]})]})}function T({page:e,total:t,onChange:n}){let r=Math.max(1,Math.ceil(t/25));return(0,y.jsxs)(`div`,{className:v.pager,children:[(0,y.jsxs)(`span`,{children:[`共 `,f(t),` 个候选`]}),(0,y.jsx)(`button`,{disabled:e<=1,onClick:()=>n(e-1),children:`上一页`}),(0,y.jsxs)(`span`,{children:[e,` / `,r]}),(0,y.jsx)(`button`,{disabled:e>=r,onClick:()=>n(e+1),children:`下一页`})]})}function E({message:e,retry:t}){return(0,y.jsxs)(`div`,{className:v.empty,role:`alert`,children:[(0,y.jsx)(`p`,{children:e}),(0,y.jsxs)(`button`,{onClick:t,children:[(0,y.jsx)(n,{size:14}),`重新读取`]})]})}function D({row:e}){return(0,y.jsxs)(`div`,{className:v.signals,children:[(0,y.jsx)(`span`,{children:e.salesGrowth!=null&&e.salesGrowth>0&&e.previousGrowth!=null&&e.previousGrowth>0?`连续两月增长`:`持续性待验证`}),(0,y.jsx)(`small`,{children:e.salesYoy==null?`去年同月未覆盖`:`同比 ${S(e.salesYoy)}`})]})}function O({record:e,onClose:t}){let[n,r]=(0,_.useState)({data:null,error:``});return(0,_.useEffect)(()=>{let t=new AbortController;return h.record(e.key,t.signal).then(e=>{t.signal.aborted||r({data:e,error:``})}).catch(e=>{t.signal.aborted||r({data:null,error:e instanceof Error?e.message:`走势读取失败`})}),()=>t.abort()},[e.key]),(0,y.jsx)(c,{title:e.name||e.id||`商品走势`,onClose:t,children:n.error?(0,y.jsx)(`p`,{role:`alert`,children:n.error}):n.data?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(u,{points:n.data.trend}),(0,y.jsx)(`p`,{className:v.muted,children:`金额单位元;缺失月份不补零。同月冲突记录保持缺口。`}),n.data.warnings?.map(e=>(0,y.jsx)(`p`,{children:e},e))]}):(0,y.jsx)(`p`,{role:`status`,children:`正在读取商品走势…`})})}function k({month:n,categoryId:r,onBack:i,onOpenCategory:a}){let[o,s]=l(`opportunityProductFilters`,x),[c,d]=(0,_.useState)(1),[m,h]=(0,_.useState)(`salesIncrease`),[g,b]=(0,_.useState)(0),[k,A]=(0,_.useState)(null),{data:j,error:M,loading:N}=C({kind:`products`,month:n,categoryId:r,...o,sort:m,page:String(c)},g),P=j?.category;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:v.header,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{onClick:i,children:[(0,y.jsx)(e,{size:14}),`机会市场`]}),(0,y.jsx)(`h1`,{children:P?.name||`赛道详情`}),(0,y.jsxs)(`p`,{children:[n,` 对比 `,j?.previousMonth||`上月`,` · 在赛道中寻找增长商品`]})]}),(0,y.jsxs)(`button`,{onClick:()=>a(r,n),children:[`查看完整商品榜`,(0,y.jsx)(t,{size:14})]})]}),N&&(0,y.jsx)(`p`,{className:v.empty,role:`status`,children:`正在比较相邻月份的商品数据…`}),M&&(0,y.jsx)(E,{message:M,retry:()=>b(e=>e+1)}),j&&P&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:v.stats,children:[(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`类目销售额`}),(0,y.jsx)(`strong`,{children:f(P.sales,`money`)}),(0,y.jsxs)(`small`,{children:[`环比 `,S(P.salesGrowth)]})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`类目店铺数`}),(0,y.jsxs)(`strong`,{children:[f(P.shopCount),` `,(0,y.jsx)(`i`,{children:`家`})]}),(0,y.jsxs)(`small`,{children:[`环比 `,S(P.shopGrowth)]})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`平均每店市场规模`}),(0,y.jsx)(`strong`,{children:f(P.salesPerShop,`money`)}),(0,y.jsx)(`small`,{children:`类目销售额 ÷ 店铺数,不代表利润`})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`增长延续性`}),(0,y.jsx)(`strong`,{children:P.previousGrowth!=null&&P.previousGrowth>0&&P.salesGrowth!=null&&P.salesGrowth>0?`连续两月增长`:`需要继续观察`}),(0,y.jsxs)(`small`,{children:[`上期环比 `,S(P.previousGrowth)]})]})]}),(0,y.jsxs)(`div`,{className:v.context,children:[(0,y.jsxs)(`section`,{children:[(0,y.jsxs)(`h2`,{children:[`类目销售趋势 `,(0,y.jsx)(`small`,{children:`近 12 个自然月 · 元`})]}),(0,y.jsx)(u,{points:j.trend})]}),(0,y.jsxs)(`aside`,{children:[(0,y.jsx)(`h2`,{children:`入场前,还要验证`}),(0,y.jsx)(`p`,{children:`店铺数量少只是竞争初筛,可能存在头部垄断、资质门槛或需求过小。`}),(0,y.jsxs)(`ul`,{children:[(0,y.jsx)(`li`,{children:`结合完整店铺榜确认头部集中度与品牌壁垒。`}),(0,y.jsx)(`li`,{children:`对照同比和多个周期,区分季节性、活动与持续增长。`}),(0,y.jsx)(`li`,{children:`核算毛利、投放成本、供应链及资质;当前数据不包含这些成本。`})]}),(0,y.jsx)(D,{row:P})]})]}),(0,y.jsxs)(`section`,{className:v.productSection,children:[(0,y.jsxs)(`div`,{className:v.sectionHeader,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`h2`,{children:[`机会商品 `,(0,y.jsx)(`small`,{children:`同一商品 ID 的跨月增长`})]}),(0,y.jsx)(`p`,{children:`展示该类目的增长候选,商品本身的同款竞争尚未判定。`})]}),(0,y.jsxs)(`label`,{children:[`排序 `,(0,y.jsxs)(`select`,{"aria-label":`机会商品排序`,value:m,onChange:e=>{h(e.target.value),d(1)},children:[(0,y.jsx)(`option`,{value:`salesIncrease`,children:`销售增量优先`}),(0,y.jsx)(`option`,{value:`salesGrowth`,children:`增长率优先`}),(0,y.jsx)(`option`,{value:`sales`,children:`销售规模优先`})]})]})]}),(0,y.jsx)(w,{products:!0,value:o,onApply:e=>{s(e),d(1)}}),j.availability.current!==`ready`||j.availability.previous!==`ready`?(0,y.jsxs)(`div`,{className:v.empty,children:[(0,y.jsx)(`h3`,{children:`这两个月的商品榜暂不能完整对比`}),(0,y.jsxs)(`p`,{children:[n,`:`,j.availability.current===`ready`?`已就绪`:j.availability.current===`pending`?`导入中`:`未覆盖`,`;`,j.previousMonth,`:`,j.availability.previous===`ready`?`已就绪`:j.availability.previous===`pending`?`导入中`:`未覆盖`,`。`]}),(0,y.jsx)(`p`,{children:`补齐后再计算增长,缺失榜单不会作为零销售额。`})]}):(0,y.jsxs)(y.Fragment,{children:[j.coverage&&(0,y.jsxs)(`p`,{className:v.coverage,children:[`本月 `,f(j.coverage.current),` 个已识别商品 · 可比 `,f(j.coverage.comparable),` 个 · 本月首次观察 `,f(j.coverage.newlyObserved),` 个 · 零基数或缺值 `,f(j.coverage.invalidBase),` 个 · 销售额冲突 `,f(j.coverage.conflicts),` 个`]}),j.rows.length?(0,y.jsx)(`div`,{className:v.tableWrap,children:(0,y.jsxs)(`table`,{children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{children:`商品 / 店铺`}),(0,y.jsx)(`th`,{children:`本月销售额`}),(0,y.jsx)(`th`,{children:`上月销售额`}),(0,y.jsx)(`th`,{children:`增长金额`}),(0,y.jsx)(`th`,{children:`环比增长`}),(0,y.jsx)(`th`,{children:`件单价`}),(0,y.jsx)(`th`,{children:`查看`})]})}),(0,y.jsx)(`tbody`,{children:j.rows.map(e=>(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`td`,{children:(0,y.jsxs)(`div`,{className:v.product,children:[p(e.imageUrl)&&(0,y.jsx)(`img`,{src:p(e.imageUrl),alt:``,loading:`lazy`}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`button`,{className:v.textButton,onClick:()=>A(e),children:e.name||e.id}),(0,y.jsxs)(`small`,{children:[e.shopName||`店铺名称未提供`,` · `,e.id]})]})]})}),(0,y.jsx)(`td`,{children:f(e.sales,`money`)}),(0,y.jsx)(`td`,{children:f(e.previousSales,`money`)}),(0,y.jsxs)(`td`,{className:v.positive,children:[`+`,f(e.salesIncrease,`money`)]}),(0,y.jsx)(`td`,{className:v.positive,children:S(e.salesGrowth)}),(0,y.jsx)(`td`,{children:f(e.unitPrice,`money`)}),(0,y.jsxs)(`td`,{children:[(0,y.jsx)(`button`,{onClick:()=>A(e),children:`走势`}),p(e.url)&&(0,y.jsx)(`a`,{href:p(e.url),target:`_blank`,rel:`noreferrer`,children:`商品链接 ↗`})]})]},e.id))})]})}):(0,y.jsxs)(`div`,{className:v.empty,children:[(0,y.jsx)(`h3`,{children:`没有符合当前条件的商品`}),(0,y.jsx)(`p`,{children:`可以调整增长率或销售额门槛;首次观察到的商品不等于新品,也不直接判为增长机会。`})]}),(0,y.jsx)(T,{page:c,total:j.total,onChange:d})]})]})]}),k&&(0,y.jsx)(O,{record:k,onClose:()=>A(null)})]})}function A({onOpenCategory:e}){let[n,r]=(0,_.useState)(0),[a,o]=(0,_.useState)({revision:-1,data:null,error:``}),[s,c]=l(`opportunityMonth`,``),[u,p]=l(`opportunityScope`,``),[x,O]=l(`opportunityFilters`,b),[A,j]=l(`opportunitySort`,`salesIncrease`),[M,N]=l(`opportunityPage`,1),[P,F]=l(`opportunitySelected`,null);(0,_.useEffect)(()=>{let e=new AbortController;return h.bootstrap(e.signal).then(t=>{e.signal.aborted||o({revision:n,data:t,error:``})}).catch(t=>{e.signal.aborted||o({revision:n,data:null,error:t instanceof Error?t.message:`市场数据读取失败`})}),()=>e.abort()},[n]);let I=a.revision===n?a.data:null,L=I?.status===`ready`&&I.capabilities?.opportunities,{data:R,error:z,loading:B}=C(L&&!P?{kind:`markets`,month:s,categoryId:u,...x,sort:A,page:String(M)}:null,n),V=()=>r(e=>e+1);return(0,y.jsxs)(`main`,{className:`${g.page} ${v.page}`,children:[!I&&a.revision!==n&&(0,y.jsx)(`p`,{className:v.empty,role:`status`,children:`正在读取市场范围…`}),a.revision===n&&a.error&&(0,y.jsx)(E,{message:a.error,retry:V}),I&&!L&&(0,y.jsx)(E,{message:I.status===`no-access`?`企业尚未获得市场类目授权`:I.status===`unpublished`?`市场数据尚未就绪`:`机会发现服务暂未就绪`,retry:V}),L&&P?(0,y.jsx)(k,{...P,onBack:()=>F(null),onOpenCategory:e},P.categoryId+P.month):L&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:v.header,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{className:v.eyebrow,children:[(0,y.jsx)(i,{size:15}),`市场洞察 / 机会发现`]}),(0,y.jsx)(`h1`,{children:`找到增长中的细分赛道`}),(0,y.jsx)(`p`,{children:`先看需求增长与竞争店铺,再进入赛道寻找增长商品。`})]}),(0,y.jsxs)(`div`,{className:v.period,children:[(0,y.jsxs)(`label`,{children:[`统计月份 `,(0,y.jsxs)(`select`,{"aria-label":`机会市场统计月份`,value:s||R?.month||``,onChange:e=>{c(e.target.value),N(1)},children:[(0,y.jsx)(`option`,{value:``,children:`最近可比月份`}),(R?.months||I.months).map(e=>(0,y.jsxs)(`option`,{value:e,children:[e,R?.missingStatisticsMonths?.includes(e)?` · 类目统计待补齐`:``]},e))]})]}),(0,y.jsxs)(`div`,{className:v.periodComparison,children:[(0,y.jsx)(`span`,{children:`对比月份`}),(0,y.jsx)(`strong`,{children:R?.previousMonth||`自动匹配上月`})]})]})]}),(0,y.jsxs)(`div`,{className:v.scope,children:[(0,y.jsx)(d,{categories:I.categories,favoriteIds:(I.favorites||[]).filter(e=>e.kind===`category`).map(e=>e.key),value:u,disabled:!1,onChoose:e=>{p(e),N(1)}}),(0,y.jsx)(`span`,{children:`只比较叶子类目,避免父子类目重复计算`})]}),(0,y.jsx)(w,{value:x,onApply:e=>{O(e),N(1)}}),(0,y.jsx)(`p`,{className:v.rule,children:`同时要求:销售额增速高于店铺数增速。门槛是可调整的筛选条件,不是行业通用标准。`}),B&&(0,y.jsx)(`p`,{className:v.empty,role:`status`,children:`正在筛选机会市场…`}),z&&(0,y.jsx)(E,{message:z,retry:V}),R?.month&&R.missingStatisticsMonths?.includes(R.month)&&(0,y.jsxs)(`div`,{className:v.empty,role:`status`,children:[(0,y.jsxs)(`h3`,{children:[R.month,` 榜单已入库,类目统计待补齐`]}),(0,y.jsx)(`p`,{children:`商品和店铺榜单可以查看;市场销售额与店铺数尚缺类目月度统计,补齐后可进行相邻月机会筛选。`}),(0,y.jsxs)(`button`,{onClick:()=>e(u,R.month),children:[`查看本月商品榜`,(0,y.jsx)(t,{size:14})]})]}),R?.previousMonth&&R.missingStatisticsMonths?.includes(R.previousMonth)&&!R.missingStatisticsMonths.includes(R.month||``)&&(0,y.jsxs)(`p`,{className:v.rule,role:`status`,children:[`对比月份 `,R.previousMonth,` 的类目统计待补齐,本月机会筛选暂无完整环比依据。`]}),R&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:v.stats,children:[(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`当前范围叶子类目`}),(0,y.jsx)(`strong`,{children:f(R.coverage.scanned)})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`相邻月数据可比`}),(0,y.jsx)(`strong`,{children:f(R.coverage.comparable)})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`符合条件的机会候选`}),(0,y.jsx)(`strong`,{className:v.positive,children:f(R.total)})]}),(0,y.jsxs)(`article`,{children:[(0,y.jsx)(`span`,{children:`缺失 / 零基数排除`}),(0,y.jsx)(`strong`,{children:f(R.coverage.excluded)})]})]}),(0,y.jsxs)(`div`,{className:v.sectionHeader,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{children:`机会市场`}),(0,y.jsx)(`p`,{children:`店铺数用于竞争初筛;点击候选查看趋势和机会商品。`})]}),(0,y.jsxs)(`label`,{children:[`排序 `,(0,y.jsxs)(`select`,{"aria-label":`机会市场排序`,value:A,onChange:e=>{j(e.target.value),N(1)},children:[(0,y.jsx)(`option`,{value:`salesIncrease`,children:`销售增量优先`}),(0,y.jsx)(`option`,{value:`salesGrowth`,children:`增长率优先`}),(0,y.jsx)(`option`,{value:`sales`,children:`销售规模优先`}),(0,y.jsx)(`option`,{value:`shopCount`,children:`店铺数量从少到多`})]})]})]}),R.rows.length?(0,y.jsx)(`div`,{className:v.tableWrap,children:(0,y.jsxs)(`table`,{children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{children:`机会赛道 / 增长信号`}),(0,y.jsx)(`th`,{children:`本月销售额`}),(0,y.jsx)(`th`,{children:`增长金额`}),(0,y.jsx)(`th`,{children:`环比增长`}),(0,y.jsx)(`th`,{children:`店铺数`}),(0,y.jsx)(`th`,{children:`店铺数环比`}),(0,y.jsx)(`th`,{children:`平均每店市场规模`}),(0,y.jsx)(`th`,{children:`查看`})]})}),(0,y.jsx)(`tbody`,{children:R.rows.map(e=>(0,y.jsxs)(`tr`,{children:[(0,y.jsxs)(`td`,{children:[(0,y.jsx)(`button`,{className:v.textButton,onClick:()=>F({categoryId:e.id,month:R.month}),children:e.name}),(0,y.jsx)(`small`,{children:m(I.categories,e.id).slice(0,-1).map(e=>e.name).join(` / `)}),(0,y.jsx)(D,{row:e})]}),(0,y.jsxs)(`td`,{children:[f(e.sales,`money`),(0,y.jsxs)(`small`,{children:[`上月 `,f(e.previousSales,`money`)]})]}),(0,y.jsxs)(`td`,{className:v.positive,children:[`+`,f(e.salesIncrease,`money`)]}),(0,y.jsx)(`td`,{className:v.positive,children:S(e.salesGrowth)}),(0,y.jsxs)(`td`,{children:[f(e.shopCount),` 家`]}),(0,y.jsx)(`td`,{children:S(e.shopGrowth)}),(0,y.jsx)(`td`,{children:f(e.salesPerShop,`money`)}),(0,y.jsx)(`td`,{children:(0,y.jsxs)(`button`,{onClick:()=>F({categoryId:e.id,month:R.month}),children:[`看机会商品`,(0,y.jsx)(t,{size:13})]})})]},e.id))})]})}):(0,y.jsxs)(`div`,{className:v.empty,children:[(0,y.jsx)(`h3`,{children:`当前条件下没有机会候选`}),(0,y.jsx)(`p`,{children:R.coverage.comparable===0?`相邻月份的销售额或店铺数缺少可比数据,不会把缺失月份当零。`:`可以切换类目或调整门槛;没有命中不代表市场不存在机会。`}),R.comparableMonths.at(-1)&&R.comparableMonths.at(-1)!==R.month&&(0,y.jsxs)(`button`,{onClick:()=>{c(R.comparableMonths.at(-1)),N(1)},children:[`查看最近可比月 `,R.comparableMonths.at(-1)]})]}),(0,y.jsx)(T,{page:M,total:R.total,onChange:N}),(0,y.jsxs)(`details`,{className:v.method,children:[(0,y.jsx)(`summary`,{children:`筛选依据与使用边界`}),(0,y.jsxs)(`p`,{children:[R.provenance.source,`。增长率 =(本月销售额 − 上月销售额)÷ 上月销售额;相邻自然月比较,不跨缺月。销售额、店铺数缺失及零基数不参与机会筛选。各类目独立比较,不做跨层级加总。`]}),(0,y.jsx)(`p`,{children:`销售增长快于店铺增长,表示平均每店市场规模扩大,仍不等于每家店增长。店铺少可能来自集中度、准入门槛或数据覆盖;需要进一步检查头部品牌、季节性、流量成本和利润。商品榜为已入库样本,首次观察不等于新上架。`})]})]})]})]})}export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,v as t,x as n}from"./index-
|
|
1
|
+
import{c as e,v as t,x as n}from"./index-Dfy2jMWq.js";var r=n(t(),1),i=e();function a({items:e,children:t,columns:n,batchSize:a=24,onVisibleCount:o,resetKey:s}){let c=s??e,[l,u]=(0,r.useState)({identity:c,count:a}),d=l.identity===c?l.count:a,f=(0,r.useRef)(null),p=d<e.length;function m(){u(t=>({identity:c,count:Math.min(e.length,(t.identity===c?t.count:a)+a)}))}(0,r.useEffect)(()=>{o?.(Math.min(d,e.length))},[d,e.length,o]),(0,r.useEffect)(()=>{let t=f.current;if(!t||!p||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&u(t=>({identity:c,count:Math.min(e.length,(t.identity===c?t.count:a)+a)}))},{rootMargin:`180px`});return n.observe(t),()=>n.disconnect()},[e,c,a,d,p]);let h=p&&(0,i.jsxs)(`button`,{ref:f,type:`button`,onClick:m,children:[`加载更多(`,Math.min(d,e.length),`/`,e.length,`)`]});return(0,i.jsxs)(i.Fragment,{children:[e.slice(0,d).map((e,n)=>(0,i.jsx)(r.Fragment,{children:t(e,n)},n)),h&&(n?(0,i.jsx)(`tr`,{children:(0,i.jsx)(`td`,{colSpan:n,children:h})}):(0,i.jsx)(`div`,{style:{gridColumn:`1 / -1`,flexShrink:0},children:h}))]})}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./arrow-down-f54IiPCV.js";import{t}from"./arrow-left-D6ZJJ6TV.js";import{n,t as r}from"./clock-3-BpHSopJF.js";import{t as i}from"./chart-no-axes-combined-0SqHx_x6.js";import{t as a}from"./check-DpavxwQP.js";import{n as o}from"./link-2-BrR_cwPw.js";import{t as s}from"./chevron-right-D8cbEJBE.js";import{t as c}from"./grid-2x2-Cb1v7yqK.js";import{t as l}from"./list-Djz-XKts.js";import{t as u}from"./plus-CuQU-dIh.js";import{t as d}from"./refresh-cw-BwEoF6sI.js";import{t as f}from"./search-BDEOXxcW.js";import{_ as p,c as m,h,l as g,v as _,x as v}from"./index-CShNDEcL.js";import{n as y}from"./workspace-view-state-DRhGUGLj.js";import"./public-D27wclc8.js";import{t as b}from"./ProgressiveRows-DfUZC_6R.js";import{t as x}from"./format-B2iJpu8S.js";import{t as S}from"./api-SsFxK3hw.js";import{_ as C,n as w,nt as T,o as E,r as D}from"./CartesianChart-CGNvk6St.js";import{n as O,r as k,t as ee}from"./LineChart-Dg6rxQct.js";import{i as te,n as A,r as ne,t as re}from"./FavoritePicker-DLuTORpI.js";var ie=h(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),ae=h(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),j=v(_(),1);function M(e=``){return{month:e,shops:[],metric:`sales`,category:``,shopFilter:``,recentYear:!1,productView:`list`,columns:[`shop`,`category`,`sales`,`salesYoy`,`salesMom`,`views`,`trends`],q:``,sort:`sales`,direction:`desc`}}var N=(e,t)=>JSON.stringify({name:e.trim()||`未命名分析`,config:t});function P(e){let[t,n]=y(`market.analysisDraft.`+e.id,e),r=(0,j.useRef)(t);(0,j.useEffect)(()=>{r.current=t},[t]);let i=(0,j.useRef)(t.revision),a=(0,j.useRef)(N(e.name,e.config)),o=(0,j.useRef)(Promise.resolve()),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(()=>N(e.name,e.config)),p=(0,j.useCallback)(()=>{let e=r.current,t=N(e.name,e.config),s=o.current.catch(()=>{}).then(async()=>{if(a.current!==t){c(!0),u(``);try{let r=await S.saveAnalysis({id:e.id,name:e.name.trim()||`未命名分析`,config:e.config,revision:i.current});i.current=r.revision,a.current=t,f(t),n(e=>({...e,revision:r.revision,updatedAt:r.updatedAt}))}catch(e){throw u(e instanceof Error?e.message:`自动保存失败`),e}finally{c(!1)}}});return o.current=s,s},[n]),m=N(t.name,t.config);return(0,j.useEffect)(()=>{if(m===a.current)return;let e=setTimeout(()=>void p().catch(()=>{}),700);return()=>clearTimeout(e)},[m,d,p]),{draft:t,config:t.config,name:t.name,saving:s,error:l,dirty:m!==d,flush:p,setName:e=>n(t=>({...t,name:e})),change:e=>n(t=>({...t,config:{...t.config,...e}}))}}function F(e,t=0){let n=e?new URLSearchParams(e).toString():``,r=n+`:`+t,[i,a]=(0,j.useState)({key:``,data:null,error:``});return(0,j.useEffect)(()=>{if(!n)return;let e=new AbortController;return S.shopLayout(Object.fromEntries(new URLSearchParams(n)),e.signal).then(t=>{e.signal.aborted||a({key:r,data:t,error:``})}).catch(t=>{e.signal.aborted||a({key:r,data:null,error:t instanceof Error?t.message:`数据读取失败`})}),()=>e.abort()},[n,r]),i.key===r?{...i,loading:!1}:{data:null,error:``,loading:!!n}}var oe=v(p(),1),I={root:`_root_mxmkq_1`,dialog:`_dialog_mxmkq_2`,primary:`_primary_mxmkq_4`,historyHeader:`_historyHeader_mxmkq_5`,eyebrow:`_eyebrow_mxmkq_5`,history:`_history_mxmkq_5`,panelHeading:`_panelHeading_mxmkq_5`,historyList:`_historyList_mxmkq_6`,historyIcon:`_historyIcon_mxmkq_6`,historyTitle:`_historyTitle_mxmkq_6`,emptyHistory:`_emptyHistory_mxmkq_6`,editorHeader:`_editorHeader_mxmkq_7`,inline:`_inline_mxmkq_7`,editorIdentity:`_editorIdentity_mxmkq_7`,editorTools:`_editorTools_mxmkq_7`,nameInput:`_nameInput_mxmkq_7`,saveStatus:`_saveStatus_mxmkq_7`,panel:`_panel_mxmkq_5`,horizontal:`_horizontal_mxmkq_8`,shopName:`_shopName_mxmkq_8`,summaryTable:`_summaryTable_mxmkq_8`,link:`_link_mxmkq_8`,sort:`_sort_mxmkq_8`,note:`_note_mxmkq_9`,error:`_error_mxmkq_9`,empty:`_empty_mxmkq_6`,metricBar:`_metricBar_mxmkq_10`,chartRange:`_chartRange_mxmkq_10`,chart:`_chart_mxmkq_10`,trendChart:`_trendChart_mxmkq_10`,filters:`_filters_mxmkq_11`,columnOptions:`_columnOptions_mxmkq_11`,product:`_product_mxmkq_12`,noImage:`_noImage_mxmkq_12`,categoryCell:`_categoryCell_mxmkq_12`,pagination:`_pagination_mxmkq_12`,productCards:`_productCards_mxmkq_12`,cardImage:`_cardImage_mxmkq_15`,cardDetails:`_cardDetails_mxmkq_18`,searchForm:`_searchForm_mxmkq_23`,searchResults:`_searchResults_mxmkq_23`,rangeTrack:`_rangeTrack_mxmkq_27`,rangeWindow:`_rangeWindow_mxmkq_27`,rangeHandle:`_rangeHandle_mxmkq_27`,rangeGrip:`_rangeGrip_mxmkq_27`},L=(e,t,n)=>Math.max(t,Math.min(n,e));function R(e,t){if(t<=0)return{start:0,size:0};let n=L(e.size,Math.min(3,t),t);return{start:L(e.start,0,t-n),size:n}}var z=e=>R({start:0,size:24},e);function se(e,t){if(t<=0)return{start:0,end:0,count:0};let n=R(e,t),r=Math.round(n.size),i=L(Math.round(n.start),0,t-r);return{start:i,end:i+r,count:r}}var B=(e,t,n)=>R({...e,start:e.start+t},n);function V(e,t,n,r){let i=R(e,r),a=L(n,0,1),o=R({start:0,size:i.size*t},r).size;return R({start:i.start+a*(i.size-o),size:o},r)}function H(e,t,n,r){let i=R(e,r),a=Math.min(3,r);if(t===`start`){let e=i.start+i.size,t=L(n,0,e-a);return{start:t,size:e-t}}return{...i,size:L(n,i.start+a,r)-i.start}}function U(e,t,n,r){let i=Math.max(1,n.width),a=t.deltaMode===1?16:t.deltaMode===2?i:1,o=(Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY)*a;if(t.ctrlKey||t.metaKey){let a=(t.clientX-n.left)/i;return V(e,Math.exp(L(o*.003,-1,1)),a,r)}return B(e,o/i*e.size,r)}var W=m();function G({view:e,total:t,onChange:n}){let r=(0,j.useRef)(null),i=(0,j.useRef)(null);function a(t){if(t.button!==0||!r.current)return;let n=t.target.closest(`[data-range-part]`)?.dataset.rangePart;n!==`pan`&&n!==`start`&&n!==`end`||(i.current={kind:n,x:t.clientX,width:r.current.getBoundingClientRect().width,view:e,pointer:t.pointerId},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault())}function o(e){let r=i.current;if(!r||r.pointer!==e.pointerId)return;let a=(e.clientX-r.x)/Math.max(1,r.width)*t;n(()=>r.kind===`pan`?B(r.view,a,t):H(r.view,r.kind,(r.kind===`start`?r.view.start:r.view.start+r.view.size)+a,t))}function s(e,r){let i=e.key===`ArrowLeft`?-1:+(e.key===`ArrowRight`);i&&(e.preventDefault(),n(e=>H(e,r,(r===`start`?e.start:e.start+e.size)+i,t)))}return(0,W.jsx)(`div`,{ref:r,className:I.rangeTrack,"aria-label":`图表显示范围`,onPointerDown:a,onPointerMove:o,onPointerUp:()=>{i.current=null},onPointerCancel:()=>{i.current=null},onLostPointerCapture:()=>{i.current=null},children:(0,W.jsxs)(`div`,{className:I.rangeWindow,"data-range-part":`pan`,style:{left:`${e.start/t*100}%`,width:`${e.size/t*100}%`},children:[(0,W.jsx)(`span`,{role:`slider`,tabIndex:0,"aria-label":`起始类目`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":Math.round(e.start)+1,"data-range-part":`start`,onKeyDown:e=>s(e,`start`),className:I.rangeHandle,children:`Ⅱ`}),(0,W.jsx)(`span`,{className:I.rangeGrip,"data-range-part":`pan`,"aria-hidden":`true`,children:`···`}),(0,W.jsx)(`span`,{role:`slider`,tabIndex:0,"aria-label":`结束类目`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":Math.round(e.start+e.size),"data-range-part":`end`,onKeyDown:e=>s(e,`end`),className:I.rangeHandle,children:`Ⅱ`})]})})}function ce(e,t,n){let r=(0,j.useRef)(null),[i,a]=(0,j.useState)(()=>({scope:e,view:z(t)})),o=i.scope===e?R(i.view,t):z(t),s=(0,j.useCallback)(n=>{a(r=>({scope:e,view:R(n(r.scope===e?r.view:z(t)),t)}))},[e,t]);return(0,j.useEffect)(()=>{let e=r.current;if(!e||!n||t<2)return;function i(n){if(!e||!n.deltaX&&!n.deltaY)return;n.preventDefault(),n.stopPropagation();let r=(e.querySelector(`.recharts-cartesian-grid`)||e).getBoundingClientRect();s(e=>U(e,n,r,t))}return e.addEventListener(`wheel`,i,{passive:!1}),()=>e.removeEventListener(`wheel`,i)},[n,t,s]),{plot:r,view:o,indices:se(o,t),update:s}}var K=[`var(--omni-chart-primary,#469eff)`,`var(--omni-chart-teal,#34b9ac)`,`var(--omni-chart-orange,#d4a25c)`],q=[{key:`sales`,label:`销售额`,unit:`元`},{key:`marketShare`,label:`市场占有率`,unit:`%`},{key:`itemCount`,label:`链接数`,unit:`个`},{key:`efficiency`,label:`链接效率`,unit:`元/链接`},{key:`views`,label:`浏览量`,unit:`次`}],J=(e,t=2)=>e==null?`—`:e.toLocaleString(`zh-CN`,{maximumFractionDigits:t}),Y=e=>e==null?`—`:e>=1e8?J(e/1e8)+`亿`:e>=1e4?J(e/1e4)+`万`:J(e);function le({x:e=0,y:t=0,payload:n}){let r=Array.from(String(n?.value||``)),i=[];for(let e=0;e<r.length;e+=16)i.push(r.slice(e,e+16).join(``));return(0,W.jsx)(`g`,{transform:`translate(${e},${t+10}) rotate(-45)`,children:(0,W.jsx)(`text`,{textAnchor:`end`,fill:`var(--omni-muted,var(--omni-chart-primary,#91abc5))`,fontSize:10,children:i.map((e,t)=>(0,W.jsx)(`tspan`,{x:0,dy:t?12:0,children:e},t))})})}function ue({categories:e,shops:t,metric:n,onCategory:r,selectedCategory:i,selectedShop:a}){let[o,s]=(0,j.useState)(!1),{plot:c,view:l,indices:u,update:d}=ce(e.map(e=>e.id).join(`,`),e.length,!o),{start:f,end:p,count:m}=u;function h(t){d(n=>B(n,t*m,e.length))}let g=q.find(e=>e.key===n),_=e.map(e=>({id:e.id,name:e.name,...Object.fromEntries(t.map(t=>[t.id,e.shops.find(e=>e.shopId===t.id)?.[n]??null]))})),v=_.slice(f,p);return(0,W.jsxs)(`section`,{className:I.panel,"aria-label":g.label+`品类对比`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsxs)(`h2`,{children:[g.label,(0,W.jsxs)(`small`,{children:[g.unit,` · 点击类目筛选商品`]})]}),(0,W.jsx)(`button`,{"aria-pressed":o,onClick:()=>s(!o),children:o?`查看图表`:`数据对比`})]}),o?(0,W.jsx)(`div`,{className:I.horizontal,children:(0,W.jsxs)(`table`,{children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`叶子类目`}),t.map((e,t)=>(0,W.jsxs)(`th`,{children:[(0,W.jsx)(`i`,{style:{background:K[t]}}),e.name]},e.id))]})}),(0,W.jsx)(`tbody`,{children:(0,W.jsx)(b,{items:e||[],columns:t.length+1,children:e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:(0,W.jsx)(`button`,{className:I.link,onClick:()=>r(e.id),children:e.name})}),t.map(t=>(0,W.jsx)(`td`,{children:J(e.shops.find(e=>e.shopId===t.id)?.[n])},t.id))]},e.id)})})]})}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:I.chartRange,children:[(0,W.jsxs)(`span`,{children:[`第 `,_.length?f+1:0,`–`,p,` 项 / 共 `,_.length,` 项`]}),_.length>12&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{onClick:()=>h(-1),disabled:f===0,children:`上一组`}),(0,W.jsx)(`button`,{onClick:()=>h(1),disabled:p===_.length,children:`下一组`}),(0,W.jsx)(`button`,{"aria-pressed":m===_.length,onClick:()=>d(()=>({start:0,size:_.length})),children:`显示全部`}),(0,W.jsx)(`button`,{"aria-pressed":m===Math.min(24,_.length),onClick:()=>d(()=>z(_.length)),children:`紧凑视图`}),(0,W.jsx)(`span`,{children:`滚轮 / 双指滑动平移 · Ctrl+滚轮 / 双指捏合缩放`})]})]}),(0,W.jsx)(`div`,{ref:c,className:I.chart,"aria-label":`品类图表,可滚轮平移及缩放`,children:(0,W.jsx)(T,{width:`100%`,height:`100%`,children:(0,W.jsxs)(A,{data:v,margin:{top:12,right:18,bottom:12,left:30},barCategoryGap:`12%`,barGap:2,accessibilityLayer:!0,children:[(0,W.jsx)(E,{stroke:`var(--omni-line,var(--omni-chart-track,#29445f))`,vertical:!1}),(0,W.jsx)(D,{dataKey:`name`,interval:0,height:145,tick:(0,W.jsx)(le,{})}),(0,W.jsx)(w,{tick:{fontSize:10,fill:`var(--omni-muted,#91abc5)`},tickFormatter:e=>n===`sales`||n===`efficiency`?Y(e):J(e,0),width:70}),(0,W.jsx)(C,{cursor:{fill:`var(--omni-panel,#132d49)`,opacity:.4},contentStyle:{background:`var(--omni-bg,#0a1524)`,border:`1px solid var(--omni-line,#29445f)`,borderRadius:8},formatter:e=>[J(typeof e==`number`?e:null)+` `+g.unit]}),(0,W.jsx)(k,{verticalAlign:`top`,height:34,wrapperStyle:{fontSize:12}}),t.map((e,t)=>(0,W.jsx)(ne,{isAnimationActive:!1,dataKey:e.id,name:e.name,fill:K[t],maxBarSize:28,radius:[3,3,0,0],onClick:t=>{let n=v[t.originalDataIndex];n&&r(n.id,e.id)},children:v.map(t=>(0,W.jsx)(te,{fillOpacity:i&&i===t.id&&(!a||a===e.id)?1:i?.7:1,stroke:i===t.id&&(!a||a===e.id)?`var(--omni-text,var(--omni-chart-primary,#dceaf7))`:void 0,strokeWidth:2},t.id))},e.id))]})})}),_.length>3&&(0,W.jsx)(G,{view:l,total:_.length,onChange:d})]}),(0,W.jsx)(`p`,{className:I.note,children:`链接效率=上榜商品销售额 ÷ 去重上榜链接数。浏览量为来源浏览次数;缺失值显示 —。`})]})}function de({query:e,onClose:t}){let n=(0,j.useRef)(null),r=F({...e,view:`analysis-trend`});return(0,j.useEffect)(()=>{let e=document.activeElement;return n.current?.showModal(),()=>e?.focus()},[]),(0,oe.createPortal)((0,W.jsxs)(`dialog`,{ref:n,className:I.dialog,onCancel:e=>{e.preventDefault(),t()},onClick:e=>{e.target===e.currentTarget&&t()},"aria-label":`销售走势`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsx)(`h2`,{children:r.data?.title||`销售走势`}),(0,W.jsx)(`button`,{autoFocus:!0,onClick:t,"aria-label":`关闭走势`,children:(0,W.jsx)(g,{size:18})})]}),r.loading?(0,W.jsx)(`p`,{role:`status`,children:`正在读取走势…`}):r.error?(0,W.jsx)(`p`,{role:`alert`,children:r.error}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:I.trendChart,children:(0,W.jsx)(T,{width:`100%`,height:`100%`,children:(0,W.jsxs)(ee,{data:r.data?.points,margin:{top:20,right:15,bottom:12,left:12},children:[(0,W.jsx)(E,{stroke:`var(--omni-line,var(--omni-chart-track,#29445f))`,vertical:!1}),(0,W.jsx)(D,{dataKey:`month`,tick:{fontSize:10}}),(0,W.jsx)(w,{tickFormatter:Y,tick:{fontSize:10},width:70}),(0,W.jsx)(C,{contentStyle:{background:`var(--omni-bg,#0a1524)`,border:`1px solid var(--omni-line,#29445f)`},formatter:e=>[Y(typeof e==`number`?e:null),`销售额(元)`]}),(0,W.jsx)(O,{dataKey:`sales`,name:`销售额`,stroke:K[0],strokeWidth:2,dot:{r:3},connectNulls:!1})]})})}),(0,W.jsx)(`p`,{className:I.note,children:r.data?.notice})]})]}),document.body)}var X=[[`shop`,`店铺`],[`category`,`叶子类目`],[`sales`,`销售额`],[`salesYoy`,`销售额同比`],[`salesMom`,`销售额环比`],[`views`,`浏览量`],[`units`,`成交件数`],[`unitPrice`,`件单价`],[`marketShare`,`市占率`],[`trends`,`走势`]],Z=new Set([`sales`,`salesYoy`,`salesMom`,`views`,`units`,`unitPrice`,`marketShare`]);function Q(e,t=!1){try{let n=new URL(e||``);return n.protocol===`https:`&&(t?n.hostname.endsWith(`.alicdn.com`):/\.(taobao|tmall)\.com$/.test(n.hostname))?n.href:void 0}catch{return}}function $({row:e}){let t=Q(e.imageUrl,!0);return t?(0,W.jsx)(`img`,{src:t,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`}):(0,W.jsx)(`span`,{className:I.noImage,children:`商品`})}function fe({config:t,layout:n,taxonomy:r,onChange:i,onTrend:a}){let[u,d]=(0,j.useState)(1),[p,m]=(0,j.useState)(t.q),[h,g]=(0,j.useState)(!1),_=[t.month,t.recentYear,t.category,t.shopFilter,t.q,t.sort,t.direction,t.shops.join(`,`)].join(`:`),[v,y]=(0,j.useState)(_),S=_===v?u:1,C=F({view:`analysis-items`,month:t.month,recentYear:String(t.recentYear),shops:t.shops.join(`,`),category:t.category,shopFilter:t.shopFilter,q:t.q,sort:t.sort,direction:t.direction,page:String(S),pageSize:`25`}),w=X.filter(([e])=>t.columns.includes(e)),T=new Set(n.categories.flatMap(e=>x(r,e.id).map(e=>e.id))),E=r.filter(e=>T.has(e.id)).map(e=>({id:e.id,name:x(r,e.id).map(e=>e.name).join(` / `)})).sort((e,t)=>e.name.localeCompare(t.name,`zh-CN`));function D(e,n){a({kind:n,product:e.id,category:e.categoryId,shops:t.shops.join(`,`),shopFilter:e.shopId,month:t.month})}function O(e,t){if(t===`shop`)return e.shopName;if(t===`category`)return x(r,e.categoryId).map(e=>e.name).join(` / `)||e.categoryName;if(t===`trends`)return(0,W.jsxs)(`span`,{className:I.inline,children:[(0,W.jsx)(`button`,{className:I.link,onClick:()=>D(e,`product`),children:`商品`}),(0,W.jsx)(`button`,{className:I.link,onClick:()=>D(e,`category`),children:`类目`})]});let n=e[t];return typeof n==`number`?t===`sales`||t===`unitPrice`?Y(n):[`salesYoy`,`salesMom`,`marketShare`].includes(t)?J(n)+`%`:J(n,0):`—`}let k=(e,t=!0)=>(0,W.jsxs)(`div`,{className:I.product,children:[t&&(0,W.jsx)($,{row:e}),(0,W.jsxs)(`div`,{children:[Q(e.url)?(0,W.jsx)(`a`,{href:Q(e.url),target:`_blank`,rel:`noreferrer`,children:e.name}):(0,W.jsx)(`b`,{children:e.name}),(0,W.jsxs)(`small`,{children:[`ID `,e.id,` · 原榜 `,e.sourceRank==null?`—`:`#`+e.sourceRank,e.conflicting?` · 指标冲突,保留为空`:``]})]})]});return(0,W.jsxs)(`section`,{className:I.panel,"aria-label":`上榜商品链接列表`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsxs)(`h2`,{children:[`上榜商品链接`,(0,W.jsxs)(`small`,{children:[J(C.data?.total,0),` 条`]})]}),(0,W.jsxs)(`div`,{className:I.inline,children:[(0,W.jsx)(`button`,{"aria-label":`商品大图`,"aria-pressed":t.productView===`grid`,onClick:()=>i({productView:`grid`}),children:(0,W.jsx)(c,{size:14})}),(0,W.jsx)(`button`,{"aria-label":`商品列表`,"aria-pressed":t.productView===`list`,onClick:()=>i({productView:`list`}),children:(0,W.jsx)(l,{size:14})}),(0,W.jsxs)(`button`,{"aria-expanded":h,onClick:()=>g(!h),children:[(0,W.jsx)(ae,{size:14}),`表格配置`]})]})]}),(0,W.jsxs)(`div`,{className:I.filters,children:[(0,W.jsxs)(`label`,{children:[`类目`,(0,W.jsxs)(`select`,{"aria-label":`上榜商品类目筛选`,value:T.has(t.category)?t.category:``,onChange:e=>i({category:e.target.value}),children:[(0,W.jsx)(`option`,{value:``,children:`全部上榜类目`}),E.map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,W.jsxs)(`label`,{children:[`店铺`,(0,W.jsxs)(`select`,{"aria-label":`上榜商品店铺筛选`,value:t.shopFilter,onChange:e=>i({shopFilter:e.target.value}),children:[(0,W.jsx)(`option`,{value:``,children:`全部对比店铺`}),n.shops.map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i({q:p.trim()})},children:[(0,W.jsx)(f,{size:14}),(0,W.jsx)(`input`,{"aria-label":`搜索上榜商品`,value:p,onChange:e=>m(e.target.value),placeholder:`商品名称 / ID`,maxLength:100}),(0,W.jsx)(`button`,{type:`submit`,children:`搜索`})]}),t.category&&(0,W.jsx)(`button`,{className:I.link,onClick:()=>i({category:``}),children:`清除类目筛选`})]}),h&&(0,W.jsxs)(`fieldset`,{className:I.columnOptions,children:[(0,W.jsx)(`legend`,{children:`显示字段`}),X.map(([e,n])=>(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:t.columns.includes(e),onChange:n=>i({columns:n.target.checked?[...t.columns,e]:t.columns.filter(t=>t!==e)})}),n]},e))]}),C.loading?(0,W.jsx)(`div`,{className:I.empty,role:`status`,children:`正在读取上榜商品…`}):C.error?(0,W.jsx)(`div`,{className:I.error,role:`alert`,children:C.error}):C.data?.rows.length?t.productView===`grid`?(0,W.jsx)(`div`,{className:I.productCards,children:(0,W.jsx)(b,{items:C.data.rows||[],children:e=>(0,W.jsxs)(`article`,{tabIndex:0,"aria-label":e.name,children:[(0,W.jsx)(`div`,{className:I.cardImage,children:(0,W.jsx)($,{row:e})}),(0,W.jsxs)(`div`,{className:I.cardDetails,children:[k(e,!1),(0,W.jsx)(`dl`,{children:w.map(([t,n])=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:n}),(0,W.jsx)(`dd`,{children:O(e,t)})]},t))})]})]},`${e.shopId}:${e.categoryId}:${e.id}`)})}):(0,W.jsx)(`div`,{className:I.horizontal,children:(0,W.jsxs)(`table`,{children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`序号`}),(0,W.jsx)(`th`,{children:`商品`}),w.map(([n,r])=>(0,W.jsx)(`th`,{children:Z.has(n)?(0,W.jsxs)(`button`,{className:I.sort,onClick:()=>i({sort:n,direction:t.sort===n&&t.direction===`desc`?`asc`:`desc`}),children:[r,t.sort===n&&(t.direction===`desc`?(0,W.jsx)(e,{size:12}):(0,W.jsx)(ie,{size:12}))]}):r},n))]})}),(0,W.jsx)(`tbody`,{children:(0,W.jsx)(b,{items:C.data.rows||[],columns:w.length+2,children:(e,t)=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:(C.data.page-1)*25+t+1}),(0,W.jsx)(`td`,{children:k(e)}),w.map(([t])=>(0,W.jsx)(`td`,{className:t===`category`?I.categoryCell:void 0,children:O(e,t)},t))]},`${e.shopId}:${e.categoryId}:${e.id}`)})})]})}):(0,W.jsx)(`div`,{className:I.empty,children:`当前筛选下暂无已完成入库的上榜商品。`}),C.data&&(0,W.jsxs)(`div`,{className:I.pagination,children:[(0,W.jsx)(`span`,{children:C.data.notice}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`button`,{"aria-label":`上榜商品上一页`,disabled:C.data.page<=1,onClick:()=>{y(_),d(C.data.page-1)},children:(0,W.jsx)(o,{size:15})}),(0,W.jsxs)(`span`,{children:[C.data.page,` / `,Math.max(1,Math.ceil(C.data.total/25))]}),(0,W.jsx)(`button`,{"aria-label":`上榜商品下一页`,disabled:C.data.page*25>=C.data.total,onClick:()=>{y(_),d(C.data.page+1)},children:(0,W.jsx)(s,{size:15})})]})]})]})}function pe({month:e,selected:t,onAdd:n,onClose:r}){let[i,a]=(0,j.useState)(``),[o,s]=(0,j.useState)(``),[c,l]=(0,j.useState)(`search`),d=(0,j.useRef)(null),p=(0,j.useRef)(null),m=F(o?{view:`shop-search`,month:e,q:o}:null);return(0,j.useEffect)(()=>{let e=document.activeElement;return d.current?.showModal(),p.current?.focus(),()=>e?.focus()},[]),(0,W.jsxs)(`dialog`,{ref:d,className:I.dialog,onCancel:e=>{e.preventDefault(),r()},onClick:e=>{e.target===e.currentTarget&&r()},"aria-label":`添加对比店铺`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsx)(`h2`,{children:`添加对比店铺`}),(0,W.jsx)(`button`,{"aria-label":`关闭店铺搜索`,onClick:r,children:(0,W.jsx)(g,{size:18})})]}),(0,W.jsx)(`p`,{className:I.note,children:`最多对比 3 家店铺,搜索范围为企业获准类目。`}),(0,W.jsxs)(`div`,{className:I.inline,"aria-label":`店铺选择来源`,children:[(0,W.jsx)(`button`,{"aria-pressed":c===`search`,onClick:()=>l(`search`),children:`搜索店铺`}),(0,W.jsx)(`button`,{"aria-pressed":c===`favorites`,onClick:()=>l(`favorites`),children:`我的收藏`})]}),c===`favorites`?(0,W.jsx)(re,{kind:`shop`,selectedIds:t,onSelect:e=>{let t=e.record;t?.id&&n({id:t.id,name:t.name||t.id})}}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`form`,{className:I.searchForm,onSubmit:e=>{e.preventDefault(),s(i.trim())},children:[(0,W.jsx)(f,{size:16}),(0,W.jsx)(`input`,{ref:p,"aria-label":`搜索对比店铺`,value:i,onChange:e=>a(e.target.value),maxLength:100,placeholder:`输入店铺名称或店铺 ID`}),(0,W.jsx)(`button`,{type:`submit`,disabled:!i.trim()||m.loading,children:`搜索`})]}),m.loading?(0,W.jsx)(`p`,{role:`status`,children:`正在搜索店铺…`}):m.error?(0,W.jsx)(`p`,{role:`alert`,className:I.error,children:m.error}):o&&(0,W.jsx)(`div`,{className:I.searchResults,children:m.data?.shops.length?m.data.shops.map(e=>(0,W.jsxs)(`button`,{disabled:t.includes(e.id),onClick:()=>n(e),children:[(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`b`,{children:e.name}),(0,W.jsxs)(`small`,{children:[`ID `,e.id]})]}),t.includes(e.id)?`已添加`:(0,W.jsx)(u,{size:16})]},e.id)):(0,W.jsx)(`p`,{children:`当前月份未找到匹配店铺,可尝试店铺编号或其他月份。`})})]})]})}function me({analysis:e,bootstrap:n,onBack:r}){let i=P(e),c=i.config,[l,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(0),[_,v]=(0,j.useState)(null),[y,S]=(0,j.useState)(!1),C=F(c.shops.length?{view:`shop-layout`,month:c.month,recentYear:String(c.recentYear),shops:c.shops.join(`,`)}:null,m),w=C.data,T=w?.categories.map(e=>({...e,name:x(n.categories,e.id).map(e=>e.name).join(` / `)||e.name}))||[],E=n.months.indexOf(c.month);async function D(){S(!0);try{await i.flush(),r()}catch{S(!1)}}function O(e){v({kind:`shop`,month:c.month,shops:c.shops.join(`,`),shopFilter:e.id})}return(0,W.jsxs)(`div`,{className:I.root,children:[(0,W.jsxs)(`header`,{className:I.editorHeader,children:[(0,W.jsxs)(`div`,{className:I.editorIdentity,children:[(0,W.jsx)(`button`,{"aria-label":`返回我的分析`,onClick:()=>void D(),disabled:y,children:(0,W.jsx)(t,{size:16})}),(0,W.jsx)(`input`,{"aria-label":`分析名称`,className:I.nameInput,value:i.name,maxLength:80,onChange:e=>i.setName(e.target.value),onBlur:()=>void i.flush().catch(()=>{})}),(0,W.jsx)(`span`,{className:I.saveStatus,role:`status`,children:i.error?`保存失败`:i.saving?`保存中…`:i.dirty?`待保存`:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(a,{size:12}),`已自动保存`]})})]}),(0,W.jsxs)(`div`,{className:I.editorTools,children:[(0,W.jsx)(`button`,{"aria-pressed":c.recentYear,onClick:()=>i.change({recentYear:!c.recentYear}),children:`最近一年`}),(0,W.jsx)(`button`,{"aria-label":`上一数据月份`,disabled:E<=0,onClick:()=>i.change({month:n.months[E-1]}),children:(0,W.jsx)(o,{size:15})}),(0,W.jsx)(`select`,{"aria-label":`分析统计月份`,value:c.month,onChange:e=>i.change({month:e.target.value}),children:n.months.map(e=>(0,W.jsx)(`option`,{children:e},e))}),(0,W.jsx)(`button`,{"aria-label":`下一数据月份`,disabled:E<0||E>=n.months.length-1,onClick:()=>i.change({month:n.months[E+1]}),children:(0,W.jsx)(s,{size:15})}),(0,W.jsx)(`button`,{onClick:()=>void D(),disabled:y,children:`我的分析`}),(0,W.jsx)(`button`,{"aria-label":`刷新分析数据`,onClick:()=>h(e=>e+1),children:(0,W.jsx)(d,{size:15})})]})]}),i.error&&(0,W.jsxs)(`p`,{role:`alert`,className:I.error,children:[i.error,(0,W.jsx)(`button`,{onClick:()=>void i.flush().catch(()=>{}),children:`重试保存`})]}),(0,W.jsxs)(`section`,{className:I.panel,"aria-label":`分析店铺汇总`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsxs)(`h2`,{children:[`品类分析`,(0,W.jsxs)(`small`,{children:[c.shops.length,` / 3 家店铺 · `,c.recentYear?`近 12 个月`:`所选月份`]})]}),c.shops.length<3&&(0,W.jsxs)(`button`,{className:I.primary,onClick:()=>p(!0),children:[(0,W.jsx)(u,{size:15}),`添加对比店铺`]})]}),c.shops.length?C.loading?(0,W.jsx)(`p`,{role:`status`,className:I.empty,children:`正在查询店铺品类数据…`}):C.error?(0,W.jsx)(`p`,{role:`alert`,className:I.error,children:C.error}):w&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:I.horizontal,children:(0,W.jsxs)(`table`,{className:I.summaryTable,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`店铺`}),(0,W.jsx)(`th`,{children:`销售走势`}),(0,W.jsx)(`th`,{children:`所在地`}),(0,W.jsx)(`th`,{children:`类型`}),(0,W.jsx)(`th`,{children:`店铺上榜销售额`}),(0,W.jsx)(`th`,{children:`上榜链接销售额`}),(0,W.jsx)(`th`,{children:`上榜叶子类目`}),(0,W.jsx)(`th`,{children:`上榜商品链接`}),(0,W.jsx)(`th`,{})]})}),(0,W.jsx)(`tbody`,{children:(0,W.jsx)(b,{items:w.shops||[],columns:9,children:(e,t)=>(0,W.jsxs)(`tr`,{children:[(0,W.jsxs)(`td`,{children:[(0,W.jsxs)(`div`,{className:I.shopName,children:[(0,W.jsx)(`i`,{style:{background:K[t]}}),(0,W.jsx)(`b`,{children:e.name})]}),(0,W.jsxs)(`small`,{children:[`ID `,e.id,c.recentYear?` · 店铺榜覆盖 ${e.availableMonths} 个月`:``]})]}),(0,W.jsx)(`td`,{children:(0,W.jsx)(`button`,{className:I.link,onClick:()=>O(e),children:`查看`})}),(0,W.jsx)(`td`,{children:e.location||`—`}),(0,W.jsx)(`td`,{children:e.shopType||`—`}),(0,W.jsx)(`td`,{children:Y(e.summary.sales)}),(0,W.jsx)(`td`,{children:Y(e.summary.productSales)}),(0,W.jsx)(`td`,{children:e.categoryCount}),(0,W.jsx)(`td`,{children:J(e.summary.itemCount,0)}),(0,W.jsx)(`td`,{children:(0,W.jsx)(`button`,{"aria-label":`移除${e.name}`,onClick:()=>i.change({shops:c.shops.filter(t=>t!==e.id),category:``,shopFilter:``}),children:(0,W.jsx)(g,{size:14})})})]},e.id)})})]})}),(0,W.jsx)(`p`,{className:I.note,children:w.notice})]}):(0,W.jsxs)(`div`,{className:I.empty,children:[(0,W.jsx)(f,{size:28}),(0,W.jsx)(`h3`,{children:`从一家店铺开始分析`}),(0,W.jsx)(`p`,{children:`添加店铺后查看上榜销售表现、品类布局和商品链接。`}),(0,W.jsx)(`button`,{className:I.primary,onClick:()=>p(!0),children:`添加首家店铺`})]})]}),w&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:I.metricBar,role:`group`,"aria-label":`品类对比指标`,children:[q.map(e=>(0,W.jsx)(`button`,{"aria-pressed":c.metric===e.key,onClick:()=>i.change({metric:e.key}),children:e.label},e.key)),(0,W.jsxs)(`span`,{children:[T.length,` 个上榜叶子类目`]})]}),T.length?(0,W.jsx)(ue,{categories:T,shops:w.shops,metric:c.metric,selectedCategory:c.category,selectedShop:c.shopFilter,onCategory:(e,t)=>i.change({category:e,shopFilter:t||``})},c.shops.join(`,`)+c.month+c.recentYear):(0,W.jsx)(`div`,{className:I.empty,children:`所选月份及权限范围内暂无可展示的上榜叶子类目。`}),(0,W.jsx)(fe,{config:c,layout:w,taxonomy:n.categories,onChange:i.change,onTrend:v})]}),l&&(0,W.jsx)(pe,{month:c.month,selected:c.shops,onClose:()=>p(!1),onAdd:e=>{i.change({shops:[...c.shops,e.id],category:``,shopFilter:``}),i.name===`未命名分析`&&i.setName(e.name+`品类分析`),p(!1)}}),_&&(0,W.jsx)(de,{query:_,onClose:()=>v(null)})]})}function he({launch:e,onConsumeLaunch:t}){let[a,o]=(0,j.useState)(null),[s,c]=(0,j.useState)([]),[l,d]=(0,j.useState)(null),[f,p]=(0,j.useState)(!0),[m,h]=(0,j.useState)(``),[g,_]=(0,j.useState)(!1),[v,y]=(0,j.useState)(0),b=(0,j.useRef)(``);(0,j.useEffect)(()=>{let e=new AbortController;return Promise.all([S.bootstrap(e.signal),S.analyses(e.signal)]).then(([t,n])=>{e.signal.aborted||(o(t),c(n.analyses),h(``),p(!1))}).catch(t=>{e.signal.aborted||(h(t instanceof Error?t.message:`分析记录读取失败`),p(!1))}),()=>e.abort()},[v]),(0,j.useEffect)(()=>{if(!e||!a||b.current===e.id)return;b.current=e.id;let n={...M(e.month),shops:[e.shop.id]};S.saveAnalysis({id:e.id,name:e.shop.name+`品类分析`,config:n,revision:0}).then(e=>{d(e),t?.()}).catch(e=>h(e instanceof Error?e.message:`创建分析失败`))},[e,a,t]);async function x(){if(!(!a?.latestMonth||g)){_(!0),h(``);try{d(await S.saveAnalysis({id:crypto.randomUUID(),name:`未命名分析`,config:M(a.latestMonth),revision:0}))}catch(e){h(e instanceof Error?e.message:`创建分析失败`)}finally{_(!1)}}}return l&&a?(0,W.jsx)(me,{analysis:l,bootstrap:a,onBack:()=>{d(null),y(e=>e+1)}},l.id):(0,W.jsxs)(`main`,{className:I.root,children:[(0,W.jsxs)(`header`,{className:I.historyHeader,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:I.eyebrow,children:`市场大盘 / 我的分析`}),(0,W.jsx)(`h1`,{children:`店铺品类布局`}),(0,W.jsx)(`p`,{children:`从历史分析继续,或新建一份店铺对比。`})]}),(0,W.jsxs)(`button`,{className:I.primary,onClick:()=>void x(),disabled:f||g||!a?.latestMonth,children:[(0,W.jsx)(u,{size:16}),g?`正在创建…`:`新建分析`]})]}),m&&(0,W.jsxs)(`div`,{className:I.error,role:`alert`,children:[m,(0,W.jsx)(`button`,{onClick:()=>y(e=>e+1),children:`重新读取`})]}),(0,W.jsxs)(`section`,{className:I.history,"aria-label":`历史分析记录`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsxs)(`h2`,{children:[(0,W.jsx)(r,{size:16}),`历史分析`,(0,W.jsxs)(`small`,{children:[s.length,` 份`]})]}),(0,W.jsx)(`span`,{className:I.note,children:`方案按当前账号自动保存`})]}),f?(0,W.jsx)(`p`,{role:`status`,className:I.empty,children:`正在读取历史分析…`}):s.length?(0,W.jsx)(`div`,{className:I.historyList,children:s.map(e=>(0,W.jsxs)(`button`,{onClick:()=>d(e),children:[(0,W.jsx)(`span`,{className:I.historyIcon,children:(0,W.jsx)(i,{size:21})}),(0,W.jsxs)(`span`,{className:I.historyTitle,children:[(0,W.jsx)(`b`,{children:e.name}),(0,W.jsxs)(`small`,{children:[e.config.month,` · `,e.config.recentYear?`近一年 · `:``,e.config.shops.length?`${e.config.shops.length} 家店铺`:`尚未添加店铺`,` · `,q.find(t=>t.key===e.config.metric)?.label]})]}),(0,W.jsx)(`time`,{children:new Date(e.updatedAt).toLocaleString(`zh-CN`,{timeZone:`Asia/Shanghai`,hour12:!1})}),(0,W.jsx)(n,{size:16})]},e.id))}):!m&&(0,W.jsxs)(`div`,{className:I.emptyHistory,children:[(0,W.jsx)(i,{size:35}),(0,W.jsx)(`h3`,{children:`还没有历史分析`}),(0,W.jsx)(`p`,{children:`新建分析后添加店铺,逐步查看品类和上榜商品。`})]})]})]})}export{he as default};
|
|
1
|
+
import{t as e}from"./arrow-down-Dm8ejo47.js";import{t}from"./arrow-left-CrtjcWhu.js";import{n,t as r}from"./clock-3-TXgD8tS6.js";import{t as i}from"./chart-no-axes-combined-DbjiVuVa.js";import{t as a}from"./check-B7m80-Hk.js";import{n as o}from"./link-2-CC7rgyRC.js";import{t as s}from"./chevron-right-DyOe1NsY.js";import{t as c}from"./grid-2x2-sRKLAhuD.js";import{t as l}from"./list-DI2UZ46g.js";import{t as u}from"./plus-_W4OFi32.js";import{t as d}from"./refresh-cw-CiIEylYp.js";import{t as f}from"./search-DlLds8Ae.js";import{_ as p,c as m,h,l as g,v as _,x as v}from"./index-Dfy2jMWq.js";import{n as y}from"./workspace-view-state-BuK4-c0r.js";import"./public-Csb687JC.js";import{t as b}from"./ProgressiveRows-CNmxc71t.js";import{t as x}from"./format-B2iJpu8S.js";import{t as S}from"./api-SsFxK3hw.js";import{_ as C,n as w,nt as T,o as E,r as D}from"./CartesianChart-aa0EJ6w3.js";import{n as O,r as k,t as ee}from"./LineChart-tppycNHl.js";import{i as te,n as A,r as ne,t as re}from"./FavoritePicker-LfvebaXO.js";var ie=h(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),ae=h(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),j=v(_(),1);function M(e=``){return{month:e,shops:[],metric:`sales`,category:``,shopFilter:``,recentYear:!1,productView:`list`,columns:[`shop`,`category`,`sales`,`salesYoy`,`salesMom`,`views`,`trends`],q:``,sort:`sales`,direction:`desc`}}var N=(e,t)=>JSON.stringify({name:e.trim()||`未命名分析`,config:t});function P(e){let[t,n]=y(`market.analysisDraft.`+e.id,e),r=(0,j.useRef)(t);(0,j.useEffect)(()=>{r.current=t},[t]);let i=(0,j.useRef)(t.revision),a=(0,j.useRef)(N(e.name,e.config)),o=(0,j.useRef)(Promise.resolve()),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(()=>N(e.name,e.config)),p=(0,j.useCallback)(()=>{let e=r.current,t=N(e.name,e.config),s=o.current.catch(()=>{}).then(async()=>{if(a.current!==t){c(!0),u(``);try{let r=await S.saveAnalysis({id:e.id,name:e.name.trim()||`未命名分析`,config:e.config,revision:i.current});i.current=r.revision,a.current=t,f(t),n(e=>({...e,revision:r.revision,updatedAt:r.updatedAt}))}catch(e){throw u(e instanceof Error?e.message:`自动保存失败`),e}finally{c(!1)}}});return o.current=s,s},[n]),m=N(t.name,t.config);return(0,j.useEffect)(()=>{if(m===a.current)return;let e=setTimeout(()=>void p().catch(()=>{}),700);return()=>clearTimeout(e)},[m,d,p]),{draft:t,config:t.config,name:t.name,saving:s,error:l,dirty:m!==d,flush:p,setName:e=>n(t=>({...t,name:e})),change:e=>n(t=>({...t,config:{...t.config,...e}}))}}function F(e,t=0){let n=e?new URLSearchParams(e).toString():``,r=n+`:`+t,[i,a]=(0,j.useState)({key:``,data:null,error:``});return(0,j.useEffect)(()=>{if(!n)return;let e=new AbortController;return S.shopLayout(Object.fromEntries(new URLSearchParams(n)),e.signal).then(t=>{e.signal.aborted||a({key:r,data:t,error:``})}).catch(t=>{e.signal.aborted||a({key:r,data:null,error:t instanceof Error?t.message:`数据读取失败`})}),()=>e.abort()},[n,r]),i.key===r?{...i,loading:!1}:{data:null,error:``,loading:!!n}}var oe=v(p(),1),I={root:`_root_mxmkq_1`,dialog:`_dialog_mxmkq_2`,primary:`_primary_mxmkq_4`,historyHeader:`_historyHeader_mxmkq_5`,eyebrow:`_eyebrow_mxmkq_5`,history:`_history_mxmkq_5`,panelHeading:`_panelHeading_mxmkq_5`,historyList:`_historyList_mxmkq_6`,historyIcon:`_historyIcon_mxmkq_6`,historyTitle:`_historyTitle_mxmkq_6`,emptyHistory:`_emptyHistory_mxmkq_6`,editorHeader:`_editorHeader_mxmkq_7`,inline:`_inline_mxmkq_7`,editorIdentity:`_editorIdentity_mxmkq_7`,editorTools:`_editorTools_mxmkq_7`,nameInput:`_nameInput_mxmkq_7`,saveStatus:`_saveStatus_mxmkq_7`,panel:`_panel_mxmkq_5`,horizontal:`_horizontal_mxmkq_8`,shopName:`_shopName_mxmkq_8`,summaryTable:`_summaryTable_mxmkq_8`,link:`_link_mxmkq_8`,sort:`_sort_mxmkq_8`,note:`_note_mxmkq_9`,error:`_error_mxmkq_9`,empty:`_empty_mxmkq_6`,metricBar:`_metricBar_mxmkq_10`,chartRange:`_chartRange_mxmkq_10`,chart:`_chart_mxmkq_10`,trendChart:`_trendChart_mxmkq_10`,filters:`_filters_mxmkq_11`,columnOptions:`_columnOptions_mxmkq_11`,product:`_product_mxmkq_12`,noImage:`_noImage_mxmkq_12`,categoryCell:`_categoryCell_mxmkq_12`,pagination:`_pagination_mxmkq_12`,productCards:`_productCards_mxmkq_12`,cardImage:`_cardImage_mxmkq_15`,cardDetails:`_cardDetails_mxmkq_18`,searchForm:`_searchForm_mxmkq_23`,searchResults:`_searchResults_mxmkq_23`,rangeTrack:`_rangeTrack_mxmkq_27`,rangeWindow:`_rangeWindow_mxmkq_27`,rangeHandle:`_rangeHandle_mxmkq_27`,rangeGrip:`_rangeGrip_mxmkq_27`},L=(e,t,n)=>Math.max(t,Math.min(n,e));function R(e,t){if(t<=0)return{start:0,size:0};let n=L(e.size,Math.min(3,t),t);return{start:L(e.start,0,t-n),size:n}}var z=e=>R({start:0,size:24},e);function se(e,t){if(t<=0)return{start:0,end:0,count:0};let n=R(e,t),r=Math.round(n.size),i=L(Math.round(n.start),0,t-r);return{start:i,end:i+r,count:r}}var B=(e,t,n)=>R({...e,start:e.start+t},n);function V(e,t,n,r){let i=R(e,r),a=L(n,0,1),o=R({start:0,size:i.size*t},r).size;return R({start:i.start+a*(i.size-o),size:o},r)}function H(e,t,n,r){let i=R(e,r),a=Math.min(3,r);if(t===`start`){let e=i.start+i.size,t=L(n,0,e-a);return{start:t,size:e-t}}return{...i,size:L(n,i.start+a,r)-i.start}}function U(e,t,n,r){let i=Math.max(1,n.width),a=t.deltaMode===1?16:t.deltaMode===2?i:1,o=(Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY)*a;if(t.ctrlKey||t.metaKey){let a=(t.clientX-n.left)/i;return V(e,Math.exp(L(o*.003,-1,1)),a,r)}return B(e,o/i*e.size,r)}var W=m();function G({view:e,total:t,onChange:n}){let r=(0,j.useRef)(null),i=(0,j.useRef)(null);function a(t){if(t.button!==0||!r.current)return;let n=t.target.closest(`[data-range-part]`)?.dataset.rangePart;n!==`pan`&&n!==`start`&&n!==`end`||(i.current={kind:n,x:t.clientX,width:r.current.getBoundingClientRect().width,view:e,pointer:t.pointerId},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault())}function o(e){let r=i.current;if(!r||r.pointer!==e.pointerId)return;let a=(e.clientX-r.x)/Math.max(1,r.width)*t;n(()=>r.kind===`pan`?B(r.view,a,t):H(r.view,r.kind,(r.kind===`start`?r.view.start:r.view.start+r.view.size)+a,t))}function s(e,r){let i=e.key===`ArrowLeft`?-1:+(e.key===`ArrowRight`);i&&(e.preventDefault(),n(e=>H(e,r,(r===`start`?e.start:e.start+e.size)+i,t)))}return(0,W.jsx)(`div`,{ref:r,className:I.rangeTrack,"aria-label":`图表显示范围`,onPointerDown:a,onPointerMove:o,onPointerUp:()=>{i.current=null},onPointerCancel:()=>{i.current=null},onLostPointerCapture:()=>{i.current=null},children:(0,W.jsxs)(`div`,{className:I.rangeWindow,"data-range-part":`pan`,style:{left:`${e.start/t*100}%`,width:`${e.size/t*100}%`},children:[(0,W.jsx)(`span`,{role:`slider`,tabIndex:0,"aria-label":`起始类目`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":Math.round(e.start)+1,"data-range-part":`start`,onKeyDown:e=>s(e,`start`),className:I.rangeHandle,children:`Ⅱ`}),(0,W.jsx)(`span`,{className:I.rangeGrip,"data-range-part":`pan`,"aria-hidden":`true`,children:`···`}),(0,W.jsx)(`span`,{role:`slider`,tabIndex:0,"aria-label":`结束类目`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":Math.round(e.start+e.size),"data-range-part":`end`,onKeyDown:e=>s(e,`end`),className:I.rangeHandle,children:`Ⅱ`})]})})}function ce(e,t,n){let r=(0,j.useRef)(null),[i,a]=(0,j.useState)(()=>({scope:e,view:z(t)})),o=i.scope===e?R(i.view,t):z(t),s=(0,j.useCallback)(n=>{a(r=>({scope:e,view:R(n(r.scope===e?r.view:z(t)),t)}))},[e,t]);return(0,j.useEffect)(()=>{let e=r.current;if(!e||!n||t<2)return;function i(n){if(!e||!n.deltaX&&!n.deltaY)return;n.preventDefault(),n.stopPropagation();let r=(e.querySelector(`.recharts-cartesian-grid`)||e).getBoundingClientRect();s(e=>U(e,n,r,t))}return e.addEventListener(`wheel`,i,{passive:!1}),()=>e.removeEventListener(`wheel`,i)},[n,t,s]),{plot:r,view:o,indices:se(o,t),update:s}}var K=[`var(--omni-chart-primary,#469eff)`,`var(--omni-chart-teal,#34b9ac)`,`var(--omni-chart-orange,#d4a25c)`],q=[{key:`sales`,label:`销售额`,unit:`元`},{key:`marketShare`,label:`市场占有率`,unit:`%`},{key:`itemCount`,label:`链接数`,unit:`个`},{key:`efficiency`,label:`链接效率`,unit:`元/链接`},{key:`views`,label:`浏览量`,unit:`次`}],J=(e,t=2)=>e==null?`—`:e.toLocaleString(`zh-CN`,{maximumFractionDigits:t}),Y=e=>e==null?`—`:e>=1e8?J(e/1e8)+`亿`:e>=1e4?J(e/1e4)+`万`:J(e);function le({x:e=0,y:t=0,payload:n}){let r=Array.from(String(n?.value||``)),i=[];for(let e=0;e<r.length;e+=16)i.push(r.slice(e,e+16).join(``));return(0,W.jsx)(`g`,{transform:`translate(${e},${t+10}) rotate(-45)`,children:(0,W.jsx)(`text`,{textAnchor:`end`,fill:`var(--omni-muted,var(--omni-chart-primary,#91abc5))`,fontSize:10,children:i.map((e,t)=>(0,W.jsx)(`tspan`,{x:0,dy:t?12:0,children:e},t))})})}function ue({categories:e,shops:t,metric:n,onCategory:r,selectedCategory:i,selectedShop:a}){let[o,s]=(0,j.useState)(!1),{plot:c,view:l,indices:u,update:d}=ce(e.map(e=>e.id).join(`,`),e.length,!o),{start:f,end:p,count:m}=u;function h(t){d(n=>B(n,t*m,e.length))}let g=q.find(e=>e.key===n),_=e.map(e=>({id:e.id,name:e.name,...Object.fromEntries(t.map(t=>[t.id,e.shops.find(e=>e.shopId===t.id)?.[n]??null]))})),v=_.slice(f,p);return(0,W.jsxs)(`section`,{className:I.panel,"aria-label":g.label+`品类对比`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsxs)(`h2`,{children:[g.label,(0,W.jsxs)(`small`,{children:[g.unit,` · 点击类目筛选商品`]})]}),(0,W.jsx)(`button`,{"aria-pressed":o,onClick:()=>s(!o),children:o?`查看图表`:`数据对比`})]}),o?(0,W.jsx)(`div`,{className:I.horizontal,children:(0,W.jsxs)(`table`,{children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`叶子类目`}),t.map((e,t)=>(0,W.jsxs)(`th`,{children:[(0,W.jsx)(`i`,{style:{background:K[t]}}),e.name]},e.id))]})}),(0,W.jsx)(`tbody`,{children:(0,W.jsx)(b,{items:e||[],columns:t.length+1,children:e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:(0,W.jsx)(`button`,{className:I.link,onClick:()=>r(e.id),children:e.name})}),t.map(t=>(0,W.jsx)(`td`,{children:J(e.shops.find(e=>e.shopId===t.id)?.[n])},t.id))]},e.id)})})]})}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:I.chartRange,children:[(0,W.jsxs)(`span`,{children:[`第 `,_.length?f+1:0,`–`,p,` 项 / 共 `,_.length,` 项`]}),_.length>12&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{onClick:()=>h(-1),disabled:f===0,children:`上一组`}),(0,W.jsx)(`button`,{onClick:()=>h(1),disabled:p===_.length,children:`下一组`}),(0,W.jsx)(`button`,{"aria-pressed":m===_.length,onClick:()=>d(()=>({start:0,size:_.length})),children:`显示全部`}),(0,W.jsx)(`button`,{"aria-pressed":m===Math.min(24,_.length),onClick:()=>d(()=>z(_.length)),children:`紧凑视图`}),(0,W.jsx)(`span`,{children:`滚轮 / 双指滑动平移 · Ctrl+滚轮 / 双指捏合缩放`})]})]}),(0,W.jsx)(`div`,{ref:c,className:I.chart,"aria-label":`品类图表,可滚轮平移及缩放`,children:(0,W.jsx)(T,{width:`100%`,height:`100%`,children:(0,W.jsxs)(A,{data:v,margin:{top:12,right:18,bottom:12,left:30},barCategoryGap:`12%`,barGap:2,accessibilityLayer:!0,children:[(0,W.jsx)(E,{stroke:`var(--omni-line,var(--omni-chart-track,#29445f))`,vertical:!1}),(0,W.jsx)(D,{dataKey:`name`,interval:0,height:145,tick:(0,W.jsx)(le,{})}),(0,W.jsx)(w,{tick:{fontSize:10,fill:`var(--omni-muted,#91abc5)`},tickFormatter:e=>n===`sales`||n===`efficiency`?Y(e):J(e,0),width:70}),(0,W.jsx)(C,{cursor:{fill:`var(--omni-panel,#132d49)`,opacity:.4},contentStyle:{background:`var(--omni-bg,#0a1524)`,border:`1px solid var(--omni-line,#29445f)`,borderRadius:8},formatter:e=>[J(typeof e==`number`?e:null)+` `+g.unit]}),(0,W.jsx)(k,{verticalAlign:`top`,height:34,wrapperStyle:{fontSize:12}}),t.map((e,t)=>(0,W.jsx)(ne,{isAnimationActive:!1,dataKey:e.id,name:e.name,fill:K[t],maxBarSize:28,radius:[3,3,0,0],onClick:t=>{let n=v[t.originalDataIndex];n&&r(n.id,e.id)},children:v.map(t=>(0,W.jsx)(te,{fillOpacity:i&&i===t.id&&(!a||a===e.id)?1:i?.7:1,stroke:i===t.id&&(!a||a===e.id)?`var(--omni-text,var(--omni-chart-primary,#dceaf7))`:void 0,strokeWidth:2},t.id))},e.id))]})})}),_.length>3&&(0,W.jsx)(G,{view:l,total:_.length,onChange:d})]}),(0,W.jsx)(`p`,{className:I.note,children:`链接效率=上榜商品销售额 ÷ 去重上榜链接数。浏览量为来源浏览次数;缺失值显示 —。`})]})}function de({query:e,onClose:t}){let n=(0,j.useRef)(null),r=F({...e,view:`analysis-trend`});return(0,j.useEffect)(()=>{let e=document.activeElement;return n.current?.showModal(),()=>e?.focus()},[]),(0,oe.createPortal)((0,W.jsxs)(`dialog`,{ref:n,className:I.dialog,onCancel:e=>{e.preventDefault(),t()},onClick:e=>{e.target===e.currentTarget&&t()},"aria-label":`销售走势`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsx)(`h2`,{children:r.data?.title||`销售走势`}),(0,W.jsx)(`button`,{autoFocus:!0,onClick:t,"aria-label":`关闭走势`,children:(0,W.jsx)(g,{size:18})})]}),r.loading?(0,W.jsx)(`p`,{role:`status`,children:`正在读取走势…`}):r.error?(0,W.jsx)(`p`,{role:`alert`,children:r.error}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:I.trendChart,children:(0,W.jsx)(T,{width:`100%`,height:`100%`,children:(0,W.jsxs)(ee,{data:r.data?.points,margin:{top:20,right:15,bottom:12,left:12},children:[(0,W.jsx)(E,{stroke:`var(--omni-line,var(--omni-chart-track,#29445f))`,vertical:!1}),(0,W.jsx)(D,{dataKey:`month`,tick:{fontSize:10}}),(0,W.jsx)(w,{tickFormatter:Y,tick:{fontSize:10},width:70}),(0,W.jsx)(C,{contentStyle:{background:`var(--omni-bg,#0a1524)`,border:`1px solid var(--omni-line,#29445f)`},formatter:e=>[Y(typeof e==`number`?e:null),`销售额(元)`]}),(0,W.jsx)(O,{dataKey:`sales`,name:`销售额`,stroke:K[0],strokeWidth:2,dot:{r:3},connectNulls:!1})]})})}),(0,W.jsx)(`p`,{className:I.note,children:r.data?.notice})]})]}),document.body)}var X=[[`shop`,`店铺`],[`category`,`叶子类目`],[`sales`,`销售额`],[`salesYoy`,`销售额同比`],[`salesMom`,`销售额环比`],[`views`,`浏览量`],[`units`,`成交件数`],[`unitPrice`,`件单价`],[`marketShare`,`市占率`],[`trends`,`走势`]],Z=new Set([`sales`,`salesYoy`,`salesMom`,`views`,`units`,`unitPrice`,`marketShare`]);function Q(e,t=!1){try{let n=new URL(e||``);return n.protocol===`https:`&&(t?n.hostname.endsWith(`.alicdn.com`):/\.(taobao|tmall)\.com$/.test(n.hostname))?n.href:void 0}catch{return}}function $({row:e}){let t=Q(e.imageUrl,!0);return t?(0,W.jsx)(`img`,{src:t,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`}):(0,W.jsx)(`span`,{className:I.noImage,children:`商品`})}function fe({config:t,layout:n,taxonomy:r,onChange:i,onTrend:a}){let[u,d]=(0,j.useState)(1),[p,m]=(0,j.useState)(t.q),[h,g]=(0,j.useState)(!1),_=[t.month,t.recentYear,t.category,t.shopFilter,t.q,t.sort,t.direction,t.shops.join(`,`)].join(`:`),[v,y]=(0,j.useState)(_),S=_===v?u:1,C=F({view:`analysis-items`,month:t.month,recentYear:String(t.recentYear),shops:t.shops.join(`,`),category:t.category,shopFilter:t.shopFilter,q:t.q,sort:t.sort,direction:t.direction,page:String(S),pageSize:`25`}),w=X.filter(([e])=>t.columns.includes(e)),T=new Set(n.categories.flatMap(e=>x(r,e.id).map(e=>e.id))),E=r.filter(e=>T.has(e.id)).map(e=>({id:e.id,name:x(r,e.id).map(e=>e.name).join(` / `)})).sort((e,t)=>e.name.localeCompare(t.name,`zh-CN`));function D(e,n){a({kind:n,product:e.id,category:e.categoryId,shops:t.shops.join(`,`),shopFilter:e.shopId,month:t.month})}function O(e,t){if(t===`shop`)return e.shopName;if(t===`category`)return x(r,e.categoryId).map(e=>e.name).join(` / `)||e.categoryName;if(t===`trends`)return(0,W.jsxs)(`span`,{className:I.inline,children:[(0,W.jsx)(`button`,{className:I.link,onClick:()=>D(e,`product`),children:`商品`}),(0,W.jsx)(`button`,{className:I.link,onClick:()=>D(e,`category`),children:`类目`})]});let n=e[t];return typeof n==`number`?t===`sales`||t===`unitPrice`?Y(n):[`salesYoy`,`salesMom`,`marketShare`].includes(t)?J(n)+`%`:J(n,0):`—`}let k=(e,t=!0)=>(0,W.jsxs)(`div`,{className:I.product,children:[t&&(0,W.jsx)($,{row:e}),(0,W.jsxs)(`div`,{children:[Q(e.url)?(0,W.jsx)(`a`,{href:Q(e.url),target:`_blank`,rel:`noreferrer`,children:e.name}):(0,W.jsx)(`b`,{children:e.name}),(0,W.jsxs)(`small`,{children:[`ID `,e.id,` · 原榜 `,e.sourceRank==null?`—`:`#`+e.sourceRank,e.conflicting?` · 指标冲突,保留为空`:``]})]})]});return(0,W.jsxs)(`section`,{className:I.panel,"aria-label":`上榜商品链接列表`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsxs)(`h2`,{children:[`上榜商品链接`,(0,W.jsxs)(`small`,{children:[J(C.data?.total,0),` 条`]})]}),(0,W.jsxs)(`div`,{className:I.inline,children:[(0,W.jsx)(`button`,{"aria-label":`商品大图`,"aria-pressed":t.productView===`grid`,onClick:()=>i({productView:`grid`}),children:(0,W.jsx)(c,{size:14})}),(0,W.jsx)(`button`,{"aria-label":`商品列表`,"aria-pressed":t.productView===`list`,onClick:()=>i({productView:`list`}),children:(0,W.jsx)(l,{size:14})}),(0,W.jsxs)(`button`,{"aria-expanded":h,onClick:()=>g(!h),children:[(0,W.jsx)(ae,{size:14}),`表格配置`]})]})]}),(0,W.jsxs)(`div`,{className:I.filters,children:[(0,W.jsxs)(`label`,{children:[`类目`,(0,W.jsxs)(`select`,{"aria-label":`上榜商品类目筛选`,value:T.has(t.category)?t.category:``,onChange:e=>i({category:e.target.value}),children:[(0,W.jsx)(`option`,{value:``,children:`全部上榜类目`}),E.map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,W.jsxs)(`label`,{children:[`店铺`,(0,W.jsxs)(`select`,{"aria-label":`上榜商品店铺筛选`,value:t.shopFilter,onChange:e=>i({shopFilter:e.target.value}),children:[(0,W.jsx)(`option`,{value:``,children:`全部对比店铺`}),n.shops.map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i({q:p.trim()})},children:[(0,W.jsx)(f,{size:14}),(0,W.jsx)(`input`,{"aria-label":`搜索上榜商品`,value:p,onChange:e=>m(e.target.value),placeholder:`商品名称 / ID`,maxLength:100}),(0,W.jsx)(`button`,{type:`submit`,children:`搜索`})]}),t.category&&(0,W.jsx)(`button`,{className:I.link,onClick:()=>i({category:``}),children:`清除类目筛选`})]}),h&&(0,W.jsxs)(`fieldset`,{className:I.columnOptions,children:[(0,W.jsx)(`legend`,{children:`显示字段`}),X.map(([e,n])=>(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:t.columns.includes(e),onChange:n=>i({columns:n.target.checked?[...t.columns,e]:t.columns.filter(t=>t!==e)})}),n]},e))]}),C.loading?(0,W.jsx)(`div`,{className:I.empty,role:`status`,children:`正在读取上榜商品…`}):C.error?(0,W.jsx)(`div`,{className:I.error,role:`alert`,children:C.error}):C.data?.rows.length?t.productView===`grid`?(0,W.jsx)(`div`,{className:I.productCards,children:(0,W.jsx)(b,{items:C.data.rows||[],children:e=>(0,W.jsxs)(`article`,{tabIndex:0,"aria-label":e.name,children:[(0,W.jsx)(`div`,{className:I.cardImage,children:(0,W.jsx)($,{row:e})}),(0,W.jsxs)(`div`,{className:I.cardDetails,children:[k(e,!1),(0,W.jsx)(`dl`,{children:w.map(([t,n])=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:n}),(0,W.jsx)(`dd`,{children:O(e,t)})]},t))})]})]},`${e.shopId}:${e.categoryId}:${e.id}`)})}):(0,W.jsx)(`div`,{className:I.horizontal,children:(0,W.jsxs)(`table`,{children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`序号`}),(0,W.jsx)(`th`,{children:`商品`}),w.map(([n,r])=>(0,W.jsx)(`th`,{children:Z.has(n)?(0,W.jsxs)(`button`,{className:I.sort,onClick:()=>i({sort:n,direction:t.sort===n&&t.direction===`desc`?`asc`:`desc`}),children:[r,t.sort===n&&(t.direction===`desc`?(0,W.jsx)(e,{size:12}):(0,W.jsx)(ie,{size:12}))]}):r},n))]})}),(0,W.jsx)(`tbody`,{children:(0,W.jsx)(b,{items:C.data.rows||[],columns:w.length+2,children:(e,t)=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:(C.data.page-1)*25+t+1}),(0,W.jsx)(`td`,{children:k(e)}),w.map(([t])=>(0,W.jsx)(`td`,{className:t===`category`?I.categoryCell:void 0,children:O(e,t)},t))]},`${e.shopId}:${e.categoryId}:${e.id}`)})})]})}):(0,W.jsx)(`div`,{className:I.empty,children:`当前筛选下暂无已完成入库的上榜商品。`}),C.data&&(0,W.jsxs)(`div`,{className:I.pagination,children:[(0,W.jsx)(`span`,{children:C.data.notice}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`button`,{"aria-label":`上榜商品上一页`,disabled:C.data.page<=1,onClick:()=>{y(_),d(C.data.page-1)},children:(0,W.jsx)(o,{size:15})}),(0,W.jsxs)(`span`,{children:[C.data.page,` / `,Math.max(1,Math.ceil(C.data.total/25))]}),(0,W.jsx)(`button`,{"aria-label":`上榜商品下一页`,disabled:C.data.page*25>=C.data.total,onClick:()=>{y(_),d(C.data.page+1)},children:(0,W.jsx)(s,{size:15})})]})]})]})}function pe({month:e,selected:t,onAdd:n,onClose:r}){let[i,a]=(0,j.useState)(``),[o,s]=(0,j.useState)(``),[c,l]=(0,j.useState)(`search`),d=(0,j.useRef)(null),p=(0,j.useRef)(null),m=F(o?{view:`shop-search`,month:e,q:o}:null);return(0,j.useEffect)(()=>{let e=document.activeElement;return d.current?.showModal(),p.current?.focus(),()=>e?.focus()},[]),(0,W.jsxs)(`dialog`,{ref:d,className:I.dialog,onCancel:e=>{e.preventDefault(),r()},onClick:e=>{e.target===e.currentTarget&&r()},"aria-label":`添加对比店铺`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsx)(`h2`,{children:`添加对比店铺`}),(0,W.jsx)(`button`,{"aria-label":`关闭店铺搜索`,onClick:r,children:(0,W.jsx)(g,{size:18})})]}),(0,W.jsx)(`p`,{className:I.note,children:`最多对比 3 家店铺,搜索范围为企业获准类目。`}),(0,W.jsxs)(`div`,{className:I.inline,"aria-label":`店铺选择来源`,children:[(0,W.jsx)(`button`,{"aria-pressed":c===`search`,onClick:()=>l(`search`),children:`搜索店铺`}),(0,W.jsx)(`button`,{"aria-pressed":c===`favorites`,onClick:()=>l(`favorites`),children:`我的收藏`})]}),c===`favorites`?(0,W.jsx)(re,{kind:`shop`,selectedIds:t,onSelect:e=>{let t=e.record;t?.id&&n({id:t.id,name:t.name||t.id})}}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`form`,{className:I.searchForm,onSubmit:e=>{e.preventDefault(),s(i.trim())},children:[(0,W.jsx)(f,{size:16}),(0,W.jsx)(`input`,{ref:p,"aria-label":`搜索对比店铺`,value:i,onChange:e=>a(e.target.value),maxLength:100,placeholder:`输入店铺名称或店铺 ID`}),(0,W.jsx)(`button`,{type:`submit`,disabled:!i.trim()||m.loading,children:`搜索`})]}),m.loading?(0,W.jsx)(`p`,{role:`status`,children:`正在搜索店铺…`}):m.error?(0,W.jsx)(`p`,{role:`alert`,className:I.error,children:m.error}):o&&(0,W.jsx)(`div`,{className:I.searchResults,children:m.data?.shops.length?m.data.shops.map(e=>(0,W.jsxs)(`button`,{disabled:t.includes(e.id),onClick:()=>n(e),children:[(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`b`,{children:e.name}),(0,W.jsxs)(`small`,{children:[`ID `,e.id]})]}),t.includes(e.id)?`已添加`:(0,W.jsx)(u,{size:16})]},e.id)):(0,W.jsx)(`p`,{children:`当前月份未找到匹配店铺,可尝试店铺编号或其他月份。`})})]})]})}function me({analysis:e,bootstrap:n,onBack:r}){let i=P(e),c=i.config,[l,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(0),[_,v]=(0,j.useState)(null),[y,S]=(0,j.useState)(!1),C=F(c.shops.length?{view:`shop-layout`,month:c.month,recentYear:String(c.recentYear),shops:c.shops.join(`,`)}:null,m),w=C.data,T=w?.categories.map(e=>({...e,name:x(n.categories,e.id).map(e=>e.name).join(` / `)||e.name}))||[],E=n.months.indexOf(c.month);async function D(){S(!0);try{await i.flush(),r()}catch{S(!1)}}function O(e){v({kind:`shop`,month:c.month,shops:c.shops.join(`,`),shopFilter:e.id})}return(0,W.jsxs)(`div`,{className:I.root,children:[(0,W.jsxs)(`header`,{className:I.editorHeader,children:[(0,W.jsxs)(`div`,{className:I.editorIdentity,children:[(0,W.jsx)(`button`,{"aria-label":`返回我的分析`,onClick:()=>void D(),disabled:y,children:(0,W.jsx)(t,{size:16})}),(0,W.jsx)(`input`,{"aria-label":`分析名称`,className:I.nameInput,value:i.name,maxLength:80,onChange:e=>i.setName(e.target.value),onBlur:()=>void i.flush().catch(()=>{})}),(0,W.jsx)(`span`,{className:I.saveStatus,role:`status`,children:i.error?`保存失败`:i.saving?`保存中…`:i.dirty?`待保存`:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(a,{size:12}),`已自动保存`]})})]}),(0,W.jsxs)(`div`,{className:I.editorTools,children:[(0,W.jsx)(`button`,{"aria-pressed":c.recentYear,onClick:()=>i.change({recentYear:!c.recentYear}),children:`最近一年`}),(0,W.jsx)(`button`,{"aria-label":`上一数据月份`,disabled:E<=0,onClick:()=>i.change({month:n.months[E-1]}),children:(0,W.jsx)(o,{size:15})}),(0,W.jsx)(`select`,{"aria-label":`分析统计月份`,value:c.month,onChange:e=>i.change({month:e.target.value}),children:n.months.map(e=>(0,W.jsx)(`option`,{children:e},e))}),(0,W.jsx)(`button`,{"aria-label":`下一数据月份`,disabled:E<0||E>=n.months.length-1,onClick:()=>i.change({month:n.months[E+1]}),children:(0,W.jsx)(s,{size:15})}),(0,W.jsx)(`button`,{onClick:()=>void D(),disabled:y,children:`我的分析`}),(0,W.jsx)(`button`,{"aria-label":`刷新分析数据`,onClick:()=>h(e=>e+1),children:(0,W.jsx)(d,{size:15})})]})]}),i.error&&(0,W.jsxs)(`p`,{role:`alert`,className:I.error,children:[i.error,(0,W.jsx)(`button`,{onClick:()=>void i.flush().catch(()=>{}),children:`重试保存`})]}),(0,W.jsxs)(`section`,{className:I.panel,"aria-label":`分析店铺汇总`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsxs)(`h2`,{children:[`品类分析`,(0,W.jsxs)(`small`,{children:[c.shops.length,` / 3 家店铺 · `,c.recentYear?`近 12 个月`:`所选月份`]})]}),c.shops.length<3&&(0,W.jsxs)(`button`,{className:I.primary,onClick:()=>p(!0),children:[(0,W.jsx)(u,{size:15}),`添加对比店铺`]})]}),c.shops.length?C.loading?(0,W.jsx)(`p`,{role:`status`,className:I.empty,children:`正在查询店铺品类数据…`}):C.error?(0,W.jsx)(`p`,{role:`alert`,className:I.error,children:C.error}):w&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:I.horizontal,children:(0,W.jsxs)(`table`,{className:I.summaryTable,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`店铺`}),(0,W.jsx)(`th`,{children:`销售走势`}),(0,W.jsx)(`th`,{children:`所在地`}),(0,W.jsx)(`th`,{children:`类型`}),(0,W.jsx)(`th`,{children:`店铺上榜销售额`}),(0,W.jsx)(`th`,{children:`上榜链接销售额`}),(0,W.jsx)(`th`,{children:`上榜叶子类目`}),(0,W.jsx)(`th`,{children:`上榜商品链接`}),(0,W.jsx)(`th`,{})]})}),(0,W.jsx)(`tbody`,{children:(0,W.jsx)(b,{items:w.shops||[],columns:9,children:(e,t)=>(0,W.jsxs)(`tr`,{children:[(0,W.jsxs)(`td`,{children:[(0,W.jsxs)(`div`,{className:I.shopName,children:[(0,W.jsx)(`i`,{style:{background:K[t]}}),(0,W.jsx)(`b`,{children:e.name})]}),(0,W.jsxs)(`small`,{children:[`ID `,e.id,c.recentYear?` · 店铺榜覆盖 ${e.availableMonths} 个月`:``]})]}),(0,W.jsx)(`td`,{children:(0,W.jsx)(`button`,{className:I.link,onClick:()=>O(e),children:`查看`})}),(0,W.jsx)(`td`,{children:e.location||`—`}),(0,W.jsx)(`td`,{children:e.shopType||`—`}),(0,W.jsx)(`td`,{children:Y(e.summary.sales)}),(0,W.jsx)(`td`,{children:Y(e.summary.productSales)}),(0,W.jsx)(`td`,{children:e.categoryCount}),(0,W.jsx)(`td`,{children:J(e.summary.itemCount,0)}),(0,W.jsx)(`td`,{children:(0,W.jsx)(`button`,{"aria-label":`移除${e.name}`,onClick:()=>i.change({shops:c.shops.filter(t=>t!==e.id),category:``,shopFilter:``}),children:(0,W.jsx)(g,{size:14})})})]},e.id)})})]})}),(0,W.jsx)(`p`,{className:I.note,children:w.notice})]}):(0,W.jsxs)(`div`,{className:I.empty,children:[(0,W.jsx)(f,{size:28}),(0,W.jsx)(`h3`,{children:`从一家店铺开始分析`}),(0,W.jsx)(`p`,{children:`添加店铺后查看上榜销售表现、品类布局和商品链接。`}),(0,W.jsx)(`button`,{className:I.primary,onClick:()=>p(!0),children:`添加首家店铺`})]})]}),w&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:I.metricBar,role:`group`,"aria-label":`品类对比指标`,children:[q.map(e=>(0,W.jsx)(`button`,{"aria-pressed":c.metric===e.key,onClick:()=>i.change({metric:e.key}),children:e.label},e.key)),(0,W.jsxs)(`span`,{children:[T.length,` 个上榜叶子类目`]})]}),T.length?(0,W.jsx)(ue,{categories:T,shops:w.shops,metric:c.metric,selectedCategory:c.category,selectedShop:c.shopFilter,onCategory:(e,t)=>i.change({category:e,shopFilter:t||``})},c.shops.join(`,`)+c.month+c.recentYear):(0,W.jsx)(`div`,{className:I.empty,children:`所选月份及权限范围内暂无可展示的上榜叶子类目。`}),(0,W.jsx)(fe,{config:c,layout:w,taxonomy:n.categories,onChange:i.change,onTrend:v})]}),l&&(0,W.jsx)(pe,{month:c.month,selected:c.shops,onClose:()=>p(!1),onAdd:e=>{i.change({shops:[...c.shops,e.id],category:``,shopFilter:``}),i.name===`未命名分析`&&i.setName(e.name+`品类分析`),p(!1)}}),_&&(0,W.jsx)(de,{query:_,onClose:()=>v(null)})]})}function he({launch:e,onConsumeLaunch:t}){let[a,o]=(0,j.useState)(null),[s,c]=(0,j.useState)([]),[l,d]=(0,j.useState)(null),[f,p]=(0,j.useState)(!0),[m,h]=(0,j.useState)(``),[g,_]=(0,j.useState)(!1),[v,y]=(0,j.useState)(0),b=(0,j.useRef)(``);(0,j.useEffect)(()=>{let e=new AbortController;return Promise.all([S.bootstrap(e.signal),S.analyses(e.signal)]).then(([t,n])=>{e.signal.aborted||(o(t),c(n.analyses),h(``),p(!1))}).catch(t=>{e.signal.aborted||(h(t instanceof Error?t.message:`分析记录读取失败`),p(!1))}),()=>e.abort()},[v]),(0,j.useEffect)(()=>{if(!e||!a||b.current===e.id)return;b.current=e.id;let n={...M(e.month),shops:[e.shop.id]};S.saveAnalysis({id:e.id,name:e.shop.name+`品类分析`,config:n,revision:0}).then(e=>{d(e),t?.()}).catch(e=>h(e instanceof Error?e.message:`创建分析失败`))},[e,a,t]);async function x(){if(!(!a?.latestMonth||g)){_(!0),h(``);try{d(await S.saveAnalysis({id:crypto.randomUUID(),name:`未命名分析`,config:M(a.latestMonth),revision:0}))}catch(e){h(e instanceof Error?e.message:`创建分析失败`)}finally{_(!1)}}}return l&&a?(0,W.jsx)(me,{analysis:l,bootstrap:a,onBack:()=>{d(null),y(e=>e+1)}},l.id):(0,W.jsxs)(`main`,{className:I.root,children:[(0,W.jsxs)(`header`,{className:I.historyHeader,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:I.eyebrow,children:`市场大盘 / 我的分析`}),(0,W.jsx)(`h1`,{children:`店铺品类布局`}),(0,W.jsx)(`p`,{children:`从历史分析继续,或新建一份店铺对比。`})]}),(0,W.jsxs)(`button`,{className:I.primary,onClick:()=>void x(),disabled:f||g||!a?.latestMonth,children:[(0,W.jsx)(u,{size:16}),g?`正在创建…`:`新建分析`]})]}),m&&(0,W.jsxs)(`div`,{className:I.error,role:`alert`,children:[m,(0,W.jsx)(`button`,{onClick:()=>y(e=>e+1),children:`重新读取`})]}),(0,W.jsxs)(`section`,{className:I.history,"aria-label":`历史分析记录`,children:[(0,W.jsxs)(`div`,{className:I.panelHeading,children:[(0,W.jsxs)(`h2`,{children:[(0,W.jsx)(r,{size:16}),`历史分析`,(0,W.jsxs)(`small`,{children:[s.length,` 份`]})]}),(0,W.jsx)(`span`,{className:I.note,children:`方案按当前账号自动保存`})]}),f?(0,W.jsx)(`p`,{role:`status`,className:I.empty,children:`正在读取历史分析…`}):s.length?(0,W.jsx)(`div`,{className:I.historyList,children:s.map(e=>(0,W.jsxs)(`button`,{onClick:()=>d(e),children:[(0,W.jsx)(`span`,{className:I.historyIcon,children:(0,W.jsx)(i,{size:21})}),(0,W.jsxs)(`span`,{className:I.historyTitle,children:[(0,W.jsx)(`b`,{children:e.name}),(0,W.jsxs)(`small`,{children:[e.config.month,` · `,e.config.recentYear?`近一年 · `:``,e.config.shops.length?`${e.config.shops.length} 家店铺`:`尚未添加店铺`,` · `,q.find(t=>t.key===e.config.metric)?.label]})]}),(0,W.jsx)(`time`,{children:new Date(e.updatedAt).toLocaleString(`zh-CN`,{timeZone:`Asia/Shanghai`,hour12:!1})}),(0,W.jsx)(n,{size:16})]},e.id))}):!m&&(0,W.jsxs)(`div`,{className:I.emptyHistory,children:[(0,W.jsx)(i,{size:35}),(0,W.jsx)(`h3`,{children:`还没有历史分析`}),(0,W.jsx)(`p`,{children:`新建分析后添加店铺,逐步查看品类和上榜商品。`})]})]})]})}export{he as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,v as t,x as n}from"./index-CShNDEcL.js";import{i as r}from"./format-B2iJpu8S.js";import{t as i}from"./market.module-MVB-GO7b.js";import{$ as a,A as o,Dt as s,E as c,Et as l,I as u,K as d,Lt as f,M as p,N as m,O as h,Ot as g,St as _,U as v,Ut as y,Vt as b,W as x,X as S,Z as ee,_ as C,a as w,b as T,bt as te,c as E,d as D,dt as O,f as k,ft as A,g as ne,h as re,ht as j,i as ie,jt as ae,k as oe,kt as M,l as se,lt as N,m as ce,n as le,o as ue,ot as P,pt as F,q as de,r as fe,rt as I,t as pe,u as me,ut as he,v as ge,vt as L,y as _e,z as ve,zt as ye}from"./CartesianChart-CGNvk6St.js";import{n as R,r as be,t as xe}from"./getRadiusAndStrokeWidthFromDot-BX82bq7e.js";import{n as z,t as B}from"./graphicalItemSelectors-DCiyiwSe.js";var V=(e,t,n)=>c(e,`xAxis`,B(e,t),n),H=(e,t,n)=>oe(e,`xAxis`,B(e,t),n),U=(e,t,n)=>c(e,`yAxis`,z(e,t),n),W=(e,t,n)=>oe(e,`yAxis`,z(e,t),n),Se=L([S,V,U,H,W],(e,t,n,r,i)=>F(e,`xAxis`)?P(t,r,!1):P(n,i,!1)),G=L([o,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),K=e=>F(S(e),`xAxis`)?`yAxis`:`xAxis`,Ce=(e,t)=>K(e)===`yAxis`?z(e,t):B(e,t),we=L([S,V,U,H,W,L([G,(e,t,n)=>h(e,K(e),Ce(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var{stackId:n}=e,r=p(e);if(!(n==null||r==null)){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),ve,Se,G,u],(e,t,n,r,i,a,o,s,c,l)=>{var{chartData:u,dataStartIndex:d,dataEndIndex:f}=o;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var{data:p}=c,m=p&&p.length>0?p:u?.slice(d,f+1);if(m!=null)return Ge({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}}),q=n(t()),Te=[`id`],Ee=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(null,arguments)}function Y(e,t){if(e==null)return{};var n,r,i=De(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function De(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?X(Object(n),!0).forEach(function(t){Oe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oe(e,t,n){return(t=ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ke(e){var t=Ae(e,`string`);return typeof t==`symbol`?t:t+``}function Ae(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Q(e,t){return e&&e!==`none`?e:t}var je=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:Q(r,i),value:O(n,t),payload:e}]},Me=q.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:ae,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:O(o,t),hide:s,type:l,color:Q(r,a),unit:c,graphicalItemId:u}};return q.createElement(k,{tooltipEntrySettings:d})});function Ne(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,s=b(r);return q.createElement(be,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function Pe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return Z(Z({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return q.createElement(re,{value:t?i:void 0},n)}function Fe(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:s,stroke:c,connectNulls:l,isRange:u}=a,{id:p}=a,m=Y(a,Te),h=b(m),g=ye(m);return q.createElement(q.Fragment,null,t?.length>1&&q.createElement(f,{clipPath:r?`url(#clipPath-${i})`:void 0},q.createElement(d,J({},g,{id:p,points:t,connectNulls:l,type:s,baseLine:n,layout:o,stroke:`none`,className:`recharts-area-area`})),c!==`none`&&q.createElement(d,J({},h,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:t})),c!==`none`&&u&&Array.isArray(n)&&q.createElement(d,J({},h,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:n}))),q.createElement(Ne,{points:t,props:m,clipPathId:i}))}function Ie(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.y,o=r[r.length-1]?.y;if(!j(a)||!j(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return M(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),M(c)?q.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function Le(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.x,o=r[r.length-1]?.x;if(!j(a)||!j(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return M(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),M(c)?q.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function Re(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n===`vertical`?q.createElement(Ie,{alpha:t,points:r,baseLine:i,strokeWidth:a}):q.createElement(Le,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function ze(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:c,isAnimationActive:u,animationBegin:d,animationDuration:p,animationEasing:m,onAnimationStart:h,onAnimationEnd:_}=r,y=v((0,q.useMemo)(()=>({points:o,baseLine:c}),[o,c]),`recharts-area-`),b=ee(),[S,C]=(0,q.useState)(!1),w=!S,T=(0,q.useCallback)(()=>{typeof _==`function`&&_(),C(!1)},[_]),te=(0,q.useCallback)(()=>{typeof h==`function`&&h(),C(!0)},[h]);if(b==null)return null;var E=i.current,D=a.current;return q.createElement(Pe,{showLabels:w,points:o},r.children,q.createElement(x,{animationId:y,begin:d,duration:p,isActive:u,easing:m,onAnimationEnd:T,onAnimationStart:te,key:y},e=>{if(E){var d=E.length/o.length,p=e===1?o:o.map((t,n)=>{var r=Math.floor(n*d);if(E[r]){var i=E[r];return Z(Z({},t),{},{x:l(i.x,t.x,e),y:l(i.y,t.y,e)})}return t}),m=M(c)?l(D,c,e):g(c)||s(c)?l(D,0,e):c.map((t,n)=>{var r=Math.floor(n*d);if(Array.isArray(D)&&D[r]){var i=D[r];return Z(Z({},t),{},{x:l(i.x,t.x,e),y:l(i.y,t.y,e)})}return t});return e>0&&(i.current=p,a.current=m),q.createElement(Fe,{points:p,baseLine:m,needClip:t,clipPathId:n,props:r})}return e>0&&(i.current=o,a.current=c),q.createElement(f,null,u&&q.createElement(`defs`,null,q.createElement(`clipPath`,{id:`animationClipPath-${n}`},q.createElement(Re,{alpha:e,points:o,baseLine:c,layout:b,strokeWidth:r.strokeWidth}))),q.createElement(f,{clipPath:`url(#animationClipPath-${n})`},q.createElement(Fe,{points:o,baseLine:c,needClip:t,clipPathId:n,props:r})))}),q.createElement(ne,{label:r.label}))}function Be(e){var{needClip:t,clipPathId:n,props:r}=e,i=(0,q.useRef)(null),a=(0,q.useRef)();return q.createElement(ze,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var Ve=class extends q.PureComponent{render(){var{hide:e,dot:t,points:n,className:r,top:i,left:a,needClip:o,xAxisId:s,yAxisId:c,width:l,height:u,id:d,baseLine:p,zIndex:m}=this.props;if(e)return null;var h=y(`recharts-area`,r),g=d,{r:_,strokeWidth:v}=xe(t),b=ce(t),x=_*2+v,S=o?`url(#clipPath-${b?``:`dots-`}${g})`:void 0;return q.createElement(_e,{zIndex:m},q.createElement(f,{className:h},o&&q.createElement(`defs`,null,q.createElement(ie,{clipPathId:g,xAxisId:s,yAxisId:c}),!b&&q.createElement(`clipPath`,{id:`clipPath-dots-${g}`},q.createElement(`rect`,{x:a-x/2,y:i-x/2,width:l+x,height:u+x}))),q.createElement(Be,{needClip:o,clipPathId:g,props:this.props})),q.createElement(R,{points:n,mainColor:Q(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(p)&&q.createElement(R,{points:p,mainColor:Q(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}},He={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,xAxisId:0,yAxisId:0,zIndex:m.area};function Ue(e){var{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,connectNulls:o,dot:s,fill:c,fillOpacity:l,hide:u,isAnimationActive:d,legendType:f,stroke:p,xAxisId:m,yAxisId:h}=e,g=Y(e,Ee),_=a(),v=T(),{needClip:y}=w(m,h),b=I(),{points:x,isRange:S,baseLine:ee}=te(t=>we(t,e.id,b))??{},C=E();if(_!==`horizontal`&&_!==`vertical`||C==null||v!==`AreaChart`&&v!==`ComposedChart`)return null;var{height:D,width:O,x:k,y:A}=C;return!x||!x.length?null:q.createElement(Ve,J({},g,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:ee,connectNulls:o,dot:s,fill:c,fillOpacity:l,height:D,hide:u,layout:_,isAnimationActive:d,isRange:S,legendType:f,needClip:y,points:x,stroke:p,width:O,left:k,top:A,xAxisId:m,yAxisId:h}))}var We=(e,t,n,r,i)=>{var a=n??t;if(M(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function Ge(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:s,yAxis:c,displayedData:l,dataStartIndex:u,xAxisTicks:d,yAxisTicks:f,bandSize:p}=e,m=i&&i.length,h=We(a,o,n,s,c),g=a===`horizontal`,_=!1,v=l.map((e,n)=>{var a;if(m)a=i[u+n];else{var o=A(e,r);Array.isArray(o)?(a=o,_=!0):a=[h,o]}var l=a?.[1]??null,v=l==null||m&&!t&&A(e,r)==null;return g?{x:N({axis:s,ticks:d,bandSize:p,entry:e,index:n}),y:v?null:c.scale.map(l)??null,value:a,payload:e}:{x:v?null:s.scale.map(l)??null,y:N({axis:c,ticks:f,bandSize:p,entry:e,index:n}),value:a,payload:e}});return{points:v,baseLine:(m||_?v.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return g?{x:e.x,y:t!=null&&e.y!=null?c.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:s.scale.map(t)??null,y:e.y,payload:e.payload}}):g?c.scale.map(h):s.scale.map(h))??0,isRange:_}}function Ke(e){var t=_(e,He),n=I();return q.createElement(me,{id:t.id,type:`area`},e=>q.createElement(q.Fragment,null,q.createElement(D,{legendPayload:je(t)}),q.createElement(Me,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),q.createElement(se,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:he(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),q.createElement(Ue,J({},t,{id:e}))))}var qe=q.memo(Ke,de);qe.displayName=`Area`;var Je=[`axis`],Ye=(0,q.forwardRef)((e,t)=>q.createElement(pe,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:Je,tooltipPayloadSearcher:ge,categoricalChartProps:e,ref:t})),$=e();function Xe({points:e,metric:t=`sales`}){let n=(0,q.useRef)(null),[a,o]=(0,q.useState)(300);return(0,q.useEffect)(()=>{if(!n.current)return;let e=new ResizeObserver(([e])=>o(Math.max(200,Math.round(e.contentRect.width))));return e.observe(n.current),()=>e.disconnect()},[]),(0,$.jsx)(`div`,{ref:n,className:i.chart,role:`img`,"aria-label":`月度数据趋势`,children:e.some(e=>e[t]!=null)?(0,$.jsxs)(Ye,{width:a,height:260,data:e,margin:{top:15,right:20,left:10,bottom:0},children:[(0,$.jsx)(ue,{stroke:`var(--omni-chart-track,#263e57)`,vertical:!1}),(0,$.jsx)(fe,{dataKey:`month`,tick:{fill:`#93adc5`,fontSize:11}}),(0,$.jsx)(le,{width:76,tickFormatter:e=>r(e),tick:{fill:`#93adc5`,fontSize:11}}),(0,$.jsx)(C,{contentStyle:{background:`#10243b`,border:`1px solid #355978`,color:`#e4f0fc`},formatter:e=>r(Number(e),t===`sales`?`money`:`number`)}),(0,$.jsx)(qe,{dataKey:t,type:`monotone`,fill:`var(--omni-chart-primary,#2aaad4)`,fillOpacity:.15,stroke:`var(--omni-chart-primary,#4dc9f0)`,strokeWidth:2,connectNulls:!1})]}):(0,$.jsx)(`p`,{className:i.empty,children:`当前记录暂无可追踪的月度数据`})})}export{Xe as default};
|
|
1
|
+
import{c as e,v as t,x as n}from"./index-Dfy2jMWq.js";import{i as r}from"./format-B2iJpu8S.js";import{t as i}from"./market.module-MVB-GO7b.js";import{$ as a,A as o,Dt as s,E as c,Et as l,I as u,K as d,Lt as f,M as p,N as m,O as h,Ot as g,St as _,U as v,Ut as y,Vt as b,W as x,X as S,Z as ee,_ as C,a as w,b as T,bt as te,c as E,d as D,dt as O,f as k,ft as A,g as ne,h as re,ht as j,i as ie,jt as ae,k as oe,kt as M,l as se,lt as N,m as ce,n as le,o as ue,ot as P,pt as F,q as de,r as fe,rt as I,t as pe,u as me,ut as he,v as ge,vt as L,y as _e,z as ve,zt as ye}from"./CartesianChart-aa0EJ6w3.js";import{n as R,r as be,t as xe}from"./getRadiusAndStrokeWidthFromDot-zEte6bM_.js";import{n as z,t as B}from"./graphicalItemSelectors-DCiyiwSe.js";var V=(e,t,n)=>c(e,`xAxis`,B(e,t),n),H=(e,t,n)=>oe(e,`xAxis`,B(e,t),n),U=(e,t,n)=>c(e,`yAxis`,z(e,t),n),W=(e,t,n)=>oe(e,`yAxis`,z(e,t),n),Se=L([S,V,U,H,W],(e,t,n,r,i)=>F(e,`xAxis`)?P(t,r,!1):P(n,i,!1)),G=L([o,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),K=e=>F(S(e),`xAxis`)?`yAxis`:`xAxis`,Ce=(e,t)=>K(e)===`yAxis`?z(e,t):B(e,t),we=L([S,V,U,H,W,L([G,(e,t,n)=>h(e,K(e),Ce(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var{stackId:n}=e,r=p(e);if(!(n==null||r==null)){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),ve,Se,G,u],(e,t,n,r,i,a,o,s,c,l)=>{var{chartData:u,dataStartIndex:d,dataEndIndex:f}=o;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var{data:p}=c,m=p&&p.length>0?p:u?.slice(d,f+1);if(m!=null)return Ge({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}}),q=n(t()),Te=[`id`],Ee=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(null,arguments)}function Y(e,t){if(e==null)return{};var n,r,i=De(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function De(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?X(Object(n),!0).forEach(function(t){Oe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oe(e,t,n){return(t=ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ke(e){var t=Ae(e,`string`);return typeof t==`symbol`?t:t+``}function Ae(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Q(e,t){return e&&e!==`none`?e:t}var je=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:Q(r,i),value:O(n,t),payload:e}]},Me=q.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:ae,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:O(o,t),hide:s,type:l,color:Q(r,a),unit:c,graphicalItemId:u}};return q.createElement(k,{tooltipEntrySettings:d})});function Ne(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,s=b(r);return q.createElement(be,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function Pe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return Z(Z({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return q.createElement(re,{value:t?i:void 0},n)}function Fe(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:s,stroke:c,connectNulls:l,isRange:u}=a,{id:p}=a,m=Y(a,Te),h=b(m),g=ye(m);return q.createElement(q.Fragment,null,t?.length>1&&q.createElement(f,{clipPath:r?`url(#clipPath-${i})`:void 0},q.createElement(d,J({},g,{id:p,points:t,connectNulls:l,type:s,baseLine:n,layout:o,stroke:`none`,className:`recharts-area-area`})),c!==`none`&&q.createElement(d,J({},h,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:t})),c!==`none`&&u&&Array.isArray(n)&&q.createElement(d,J({},h,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:n}))),q.createElement(Ne,{points:t,props:m,clipPathId:i}))}function Ie(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.y,o=r[r.length-1]?.y;if(!j(a)||!j(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return M(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),M(c)?q.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function Le(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.x,o=r[r.length-1]?.x;if(!j(a)||!j(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return M(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),M(c)?q.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function Re(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n===`vertical`?q.createElement(Ie,{alpha:t,points:r,baseLine:i,strokeWidth:a}):q.createElement(Le,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function ze(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:c,isAnimationActive:u,animationBegin:d,animationDuration:p,animationEasing:m,onAnimationStart:h,onAnimationEnd:_}=r,y=v((0,q.useMemo)(()=>({points:o,baseLine:c}),[o,c]),`recharts-area-`),b=ee(),[S,C]=(0,q.useState)(!1),w=!S,T=(0,q.useCallback)(()=>{typeof _==`function`&&_(),C(!1)},[_]),te=(0,q.useCallback)(()=>{typeof h==`function`&&h(),C(!0)},[h]);if(b==null)return null;var E=i.current,D=a.current;return q.createElement(Pe,{showLabels:w,points:o},r.children,q.createElement(x,{animationId:y,begin:d,duration:p,isActive:u,easing:m,onAnimationEnd:T,onAnimationStart:te,key:y},e=>{if(E){var d=E.length/o.length,p=e===1?o:o.map((t,n)=>{var r=Math.floor(n*d);if(E[r]){var i=E[r];return Z(Z({},t),{},{x:l(i.x,t.x,e),y:l(i.y,t.y,e)})}return t}),m=M(c)?l(D,c,e):g(c)||s(c)?l(D,0,e):c.map((t,n)=>{var r=Math.floor(n*d);if(Array.isArray(D)&&D[r]){var i=D[r];return Z(Z({},t),{},{x:l(i.x,t.x,e),y:l(i.y,t.y,e)})}return t});return e>0&&(i.current=p,a.current=m),q.createElement(Fe,{points:p,baseLine:m,needClip:t,clipPathId:n,props:r})}return e>0&&(i.current=o,a.current=c),q.createElement(f,null,u&&q.createElement(`defs`,null,q.createElement(`clipPath`,{id:`animationClipPath-${n}`},q.createElement(Re,{alpha:e,points:o,baseLine:c,layout:b,strokeWidth:r.strokeWidth}))),q.createElement(f,{clipPath:`url(#animationClipPath-${n})`},q.createElement(Fe,{points:o,baseLine:c,needClip:t,clipPathId:n,props:r})))}),q.createElement(ne,{label:r.label}))}function Be(e){var{needClip:t,clipPathId:n,props:r}=e,i=(0,q.useRef)(null),a=(0,q.useRef)();return q.createElement(ze,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var Ve=class extends q.PureComponent{render(){var{hide:e,dot:t,points:n,className:r,top:i,left:a,needClip:o,xAxisId:s,yAxisId:c,width:l,height:u,id:d,baseLine:p,zIndex:m}=this.props;if(e)return null;var h=y(`recharts-area`,r),g=d,{r:_,strokeWidth:v}=xe(t),b=ce(t),x=_*2+v,S=o?`url(#clipPath-${b?``:`dots-`}${g})`:void 0;return q.createElement(_e,{zIndex:m},q.createElement(f,{className:h},o&&q.createElement(`defs`,null,q.createElement(ie,{clipPathId:g,xAxisId:s,yAxisId:c}),!b&&q.createElement(`clipPath`,{id:`clipPath-dots-${g}`},q.createElement(`rect`,{x:a-x/2,y:i-x/2,width:l+x,height:u+x}))),q.createElement(Be,{needClip:o,clipPathId:g,props:this.props})),q.createElement(R,{points:n,mainColor:Q(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(p)&&q.createElement(R,{points:p,mainColor:Q(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}},He={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,xAxisId:0,yAxisId:0,zIndex:m.area};function Ue(e){var{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,connectNulls:o,dot:s,fill:c,fillOpacity:l,hide:u,isAnimationActive:d,legendType:f,stroke:p,xAxisId:m,yAxisId:h}=e,g=Y(e,Ee),_=a(),v=T(),{needClip:y}=w(m,h),b=I(),{points:x,isRange:S,baseLine:ee}=te(t=>we(t,e.id,b))??{},C=E();if(_!==`horizontal`&&_!==`vertical`||C==null||v!==`AreaChart`&&v!==`ComposedChart`)return null;var{height:D,width:O,x:k,y:A}=C;return!x||!x.length?null:q.createElement(Ve,J({},g,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:ee,connectNulls:o,dot:s,fill:c,fillOpacity:l,height:D,hide:u,layout:_,isAnimationActive:d,isRange:S,legendType:f,needClip:y,points:x,stroke:p,width:O,left:k,top:A,xAxisId:m,yAxisId:h}))}var We=(e,t,n,r,i)=>{var a=n??t;if(M(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function Ge(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:s,yAxis:c,displayedData:l,dataStartIndex:u,xAxisTicks:d,yAxisTicks:f,bandSize:p}=e,m=i&&i.length,h=We(a,o,n,s,c),g=a===`horizontal`,_=!1,v=l.map((e,n)=>{var a;if(m)a=i[u+n];else{var o=A(e,r);Array.isArray(o)?(a=o,_=!0):a=[h,o]}var l=a?.[1]??null,v=l==null||m&&!t&&A(e,r)==null;return g?{x:N({axis:s,ticks:d,bandSize:p,entry:e,index:n}),y:v?null:c.scale.map(l)??null,value:a,payload:e}:{x:v?null:s.scale.map(l)??null,y:N({axis:c,ticks:f,bandSize:p,entry:e,index:n}),value:a,payload:e}});return{points:v,baseLine:(m||_?v.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return g?{x:e.x,y:t!=null&&e.y!=null?c.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:s.scale.map(t)??null,y:e.y,payload:e.payload}}):g?c.scale.map(h):s.scale.map(h))??0,isRange:_}}function Ke(e){var t=_(e,He),n=I();return q.createElement(me,{id:t.id,type:`area`},e=>q.createElement(q.Fragment,null,q.createElement(D,{legendPayload:je(t)}),q.createElement(Me,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),q.createElement(se,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:he(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),q.createElement(Ue,J({},t,{id:e}))))}var qe=q.memo(Ke,de);qe.displayName=`Area`;var Je=[`axis`],Ye=(0,q.forwardRef)((e,t)=>q.createElement(pe,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:Je,tooltipPayloadSearcher:ge,categoricalChartProps:e,ref:t})),$=e();function Xe({points:e,metric:t=`sales`}){let n=(0,q.useRef)(null),[a,o]=(0,q.useState)(300);return(0,q.useEffect)(()=>{if(!n.current)return;let e=new ResizeObserver(([e])=>o(Math.max(200,Math.round(e.contentRect.width))));return e.observe(n.current),()=>e.disconnect()},[]),(0,$.jsx)(`div`,{ref:n,className:i.chart,role:`img`,"aria-label":`月度数据趋势`,children:e.some(e=>e[t]!=null)?(0,$.jsxs)(Ye,{width:a,height:260,data:e,margin:{top:15,right:20,left:10,bottom:0},children:[(0,$.jsx)(ue,{stroke:`var(--omni-chart-track,#263e57)`,vertical:!1}),(0,$.jsx)(fe,{dataKey:`month`,tick:{fill:`#93adc5`,fontSize:11}}),(0,$.jsx)(le,{width:76,tickFormatter:e=>r(e),tick:{fill:`#93adc5`,fontSize:11}}),(0,$.jsx)(C,{contentStyle:{background:`#10243b`,border:`1px solid #355978`,color:`#e4f0fc`},formatter:e=>r(Number(e),t===`sales`?`money`:`number`)}),(0,$.jsx)(qe,{dataKey:t,type:`monotone`,fill:`var(--omni-chart-primary,#2aaad4)`,fillOpacity:.15,stroke:`var(--omni-chart-primary,#4dc9f0)`,strokeWidth:2,connectNulls:!1})]}):(0,$.jsx)(`p`,{className:i.empty,children:`当前记录暂无可追踪的月度数据`})})}export{Xe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./index-
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`book-open`,[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./index-
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`calendar-days`,[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./index-
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]);export{t};
|
package/app/assets/{chart-no-axes-combined-0SqHx_x6.js → chart-no-axes-combined-DbjiVuVa.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./index-
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`chart-no-axes-combined`,[[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14.639V21`,key:`1s85h0`}],[`path`,{d:`M20 10.656V21`,key:`q45596`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18.463V21`,key:`1otddq`}],[`path`,{d:`M8 14.656V21`,key:`1t2idw`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./index-
|
|
1
|
+
import{h as e}from"./index-Dfy2jMWq.js";var t=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),n=e(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]);export{t as n,n as t};
|