@petercjl/omni-desktop-app 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/assets/Directory-D0rZfh_1.js +1 -0
- package/app/assets/Directory-ZWl5yZd5.css +1 -0
- package/app/assets/EmptyState-COLCkhZs.js +1 -0
- package/app/assets/EvidenceSourceGuide-CEmQ3sdi.js +1 -0
- package/app/assets/{help-tip-DrFaNwFa.js → HelpTip-BcLBMmZW.js} +1 -1
- package/app/assets/{help-tip--AXHiRI4.css → HelpTip-BsHPhMNf.css} +1 -1
- package/app/assets/LineChart-DC_iIB4m.js +36 -0
- package/app/assets/activity-Cj90ZCJa.js +1 -0
- package/app/assets/arrow-right-Bsei-31a.js +1 -0
- package/app/assets/arrow-up-right-CqmbLgtN.js +1 -0
- package/app/assets/chart-column-Dlmnr1y9.js +1 -0
- package/app/assets/check-QN7RSzdG.js +1 -0
- package/app/assets/chevron-down-BoU_rWJ-.js +1 -0
- package/app/assets/chevron-left-D1Tjivki.js +1 -0
- package/app/assets/chevron-right-CGVsdWp6.js +1 -0
- package/app/assets/clock-3-B99KnTzW.js +1 -0
- package/app/assets/demand-planning-client-DVOcsKAy.css +1 -0
- package/app/assets/demand-planning-client-DzZj_Q__.js +130 -0
- package/app/assets/download-D5rXx5AI.js +1 -0
- package/app/assets/entry-B68pyhTH.js +2 -0
- package/app/assets/entry-BzQWDj9a.css +1 -0
- package/app/assets/entry-CKQSyMns.js +2 -0
- package/app/assets/entry-C_j4PEhB.css +1 -0
- package/app/assets/entry-CxmvXNMW.js +1 -0
- package/app/assets/entry-DMn_VQx0.js +2 -0
- package/app/assets/entry-DzUnM_Wl.js +1 -0
- package/app/assets/entry-OPB3MGoc.css +1 -0
- package/app/assets/entry-h5lCV6qJ.js +1 -0
- package/app/assets/flag-Dtu8lW8f.js +1 -0
- package/app/assets/git-branch-Cv69GSy-.js +1 -0
- package/app/assets/group-B6vAoX5c.js +1 -0
- package/app/assets/{index-Bb52bEzu.js → index-CDS2fIqN.js} +4 -4
- package/app/assets/index-DYn6t59z.css +1 -0
- package/app/assets/layers-BaGSABxV.js +1 -0
- package/app/assets/module-host-BzwOcfIf.js +1 -0
- package/app/assets/play-DaJyx8oA.js +1 -0
- package/app/assets/plus-D0cC0DpO.js +1 -0
- package/app/assets/products-BTd3YVqO.css +1 -0
- package/app/assets/products-BxcSNL_f.js +1 -0
- package/app/assets/project-execution-VeMKoL0M.js +1 -0
- package/app/assets/project-public-D9ifVghn.js +4 -0
- package/app/assets/project-public-D9qvuaHV.js +1 -0
- package/app/assets/project-public-DxYr-zt5.js +1 -0
- package/app/assets/project-public-IxjCdnaB.css +1 -0
- package/app/assets/public-DTqkVQos.js +1 -0
- package/app/assets/refresh-cw-OG4-Ic4x.js +1 -0
- package/app/assets/search-I3gdKVV9.js +1 -0
- package/app/assets/ui-public-BJV7qMHh.js +2 -0
- package/app/assets/use-workspace-query-Csm4EkUU.js +1 -0
- package/app/assets/workbench-BeiscSvD.js +2 -0
- package/app/assets/workbench-CrImV0L7.css +1 -0
- package/app/assets/workspace-view-state-C1Tia7X4.js +1 -0
- package/app/index.html +2 -2
- package/package.json +1 -1
- package/release.json +1 -1
- package/release.sig +1 -1
- package/app/assets/LineChart-CEqVLcib.js +0 -33
- package/app/assets/index-CexsTGMB.css +0 -1
- package/app/assets/page-BiH-QrTk.js +0 -1
- package/app/assets/page-ClE1ActL.css +0 -1
- package/app/assets/page-DJnQ4bCG.js +0 -1
- package/app/assets/page-DkSMej77.js +0 -135
- package/app/assets/page-E8U5s4LO.css +0 -1
- package/app/assets/page-LYbG9XZe.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./check-QN7RSzdG.js";import{t as r}from"./arrow-right-Bsei-31a.js";import{t as i}from"./chevron-down-BoU_rWJ-.js";import{t as a}from"./chevron-left-D1Tjivki.js";import{t as o}from"./chevron-right-CGVsdWp6.js";import{t as s}from"./clock-3-B99KnTzW.js";import{t as c}from"./plus-D0cC0DpO.js";import{t as l}from"./refresh-cw-OG4-Ic4x.js";import{t as u}from"./search-I3gdKVV9.js";import{a as d,i as f,l as p,o as m,p as h,r as g,s as _,u as v}from"./index-CDS2fIqN.js";import{n as y}from"./workspace-view-state-C1Tia7X4.js";import"./public-DTqkVQos.js";import{$ as b,A as x,At as S,B as C,C as w,Ct as T,D as ee,Dt as E,E as te,Et as D,F as O,G as k,H as ne,I as A,J as re,K as ie,L as ae,M as j,N as oe,O as M,Ot as N,P,Q as se,R as ce,S as le,St as ue,T as de,Tt as fe,U as pe,V as me,W as he,X as ge,Y as F,Z as I,_ as _e,_t as ve,a as L,at as R,b as ye,bt as z,c as be,ct as xe,d as Se,dt as Ce,et as we,f as Te,ft as Ee,g as De,gt as B,h as Oe,ht as ke,i as Ae,it as je,j as Me,k as Ne,kt as Pe,l as Fe,lt as Ie,m as Le,mt as V,n as Re,nt as ze,o as Be,ot as Ve,p as He,pt as Ue,q as We,r as Ge,rt as Ke,s as qe,st as Je,t as Ye,tt as Xe,u as Ze,ut as Qe,v as $e,vt as et,w as tt,wt as nt,x as rt,xt as it,y as at,yt as ot,z as st}from"./LineChart-DC_iIB4m.js";var ct=_(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),lt=_(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),ut=_(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),dt=_(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ft=_(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),pt=_(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),mt=_(`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`}]]),ht=_(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),H=h(v()),U=g();function gt(e){return(0,U.jsx)(`a`,{...e})}var _t={categoryId:``,month:``,view:`categories`,metric:`sales`,recentYear:!1,q:``,sort:`sales`,direction:`desc`,page:1,pageSize:100,minPrice:``,maxPrice:``};function vt(e,t){return y(`market.`+e,t)}var yt=[[`sales`,`销售额`,`money`],[`marketShare`,`市占率`,`percent`],[`views`,`浏览量`,`number`],[`conversionRate`,`支付转化率`,`percent`],[`unitPrice`,`件单价`,`money`],[`units`,`成交件数`,`number`],[`searches`,`搜索量`,`number`],[`searchShare`,`搜索量占比`,`percent`],[`paidClicks`,`付费点击量`,`number`],[`paidClickShare`,`付费点击量占比`,`percent`],[`listingDays`,`上架天数`,`number`],[`listedProducts`,`在榜商品数`,`number`],[`promotionRoi`,`推广 ROI`,`number`],[`uvValue`,`UV 价值`,`money`],[`viewValue`,`浏览价值`,`money`],[`orderPrice`,`客单价`,`money`],[`orders`,`成交订单数`,`number`],[`cartRate`,`加购率`,`percent`],[`salesYoy`,`销售额同比`,`percent`],[`salesMom`,`销售额环比`,`percent`],[`activeProducts`,`动销商品数`,`number`]],bt=class extends Error{constructor(e,t){super(t),this.status=e}};async function xt(e,t){let n=await fetch(e,{signal:t,credentials:`same-origin`,cache:`no-store`});if(!n.ok)throw new bt(n.status,n.status===403?`企业尚未获得此类目授权`:n.status===401?`登录已失效,请重新登录`:n.status===404||n.status===501?`共享市场查询服务待接入`:`市场服务暂时无法连接`);if(!n.headers.get(`content-type`)?.includes(`application/json`))throw new bt(501,`共享市场查询服务待接入`);return n.json()}var W={analyses:e=>xt(`/v1/market/shop-categories?view=analyses`,e),saveAnalysis:async e=>{let t=await fetch(`/v1/market/shop-categories?view=analyses`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new bt(t.status,n.error||`分析未保存,请稍后重试`);return n},shopLayout:(e,t)=>xt(`/v1/market/shop-categories?`+new URLSearchParams(e),t),bootstrap:e=>xt(`/v1/market/bootstrap`,e),query:(e,t)=>xt(`/v1/market/dashboard?`+new URLSearchParams(Object.entries(e).map(([e,t])=>[e,String(t)])),t),record:(e,t)=>xt(`/v1/market/records/`+encodeURIComponent(e),t),favorite:async(e,t,n)=>{let r=await fetch(`/v1/market/favorites`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,key:t,saved:n})});if(!r.ok)throw Error(`收藏未保存,请检查权限和连接`);return r.json()},distribution:(e,t)=>xt(`/v1/market/price-distribution?`+new URLSearchParams(Object.entries(e).map(([e,t])=>[e,String(t)])),t),shopCategories:(e,t)=>xt(`/v1/market/shop-categories/`+e,t)},St=[`listingDays`,`sales`,`marketShare`,`views`,`conversionRate`,`unitPrice`,`units`,`searches`,`searchShare`,`paidClicks`,`paidClickShare`],Ct=[`sales`,`marketShare`,`views`,`conversionRate`,`unitPrice`,`units`,`searches`,`searchShare`,`paidClicks`,`paidClickShare`,`listedProducts`];function G(e){if(e)try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.href:void 0}catch{return}}function K(e,t=`number`){if(e==null||!Number.isFinite(e))return`—`;if(t===`percent`)return e.toLocaleString(`zh-CN`,{maximumFractionDigits:2})+`%`;if(t===`number`)return e.toLocaleString(`zh-CN`,{maximumFractionDigits:2});let n=Math.abs(e);return(n>=1e8?(e/1e8).toFixed(2)+` 亿`:n>=1e4?(e/1e4).toFixed(2)+` 万`:e.toLocaleString(`zh-CN`,{maximumFractionDigits:2}))+(t===`money`?`元`:``)}function q(e,t){let n=[],r=new Set,i=e.find(e=>e.id===t);for(;i&&!r.has(i.id);)r.add(i.id),n.unshift(i),i=e.find(e=>e.id===i?.parentId);return n}var wt=e=>null;wt.displayName=`Cell`;var Tt=(e,t,n)=>{var r=ke();return(i,a)=>o=>{e?.(i,a,o),r(Me({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Et=e=>{var t=ke();return(n,r)=>i=>{e?.(n,r,i),t(Ne())}},Dt=(e,t,n)=>{var r=ke();return(i,a)=>o=>{e?.(i,a,o),r(x({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Ot=(e,t,n)=>{var r=n??e;if(!ue(r))return ot(r,t,0)},kt=(e,t,n)=>{var r={},i=e.filter(ae),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:Ot(t,n,i[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:Ot(t,n,e.barSize)}));return[...s,...c]};function At(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 jt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?At(Object(n),!0).forEach(function(t){Mt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mt(e,t,n){return(t=Nt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nt(e){var t=Pt(e,`string`);return typeof t==`symbol`?t:t+``}function Pt(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 Ft(e,t,n,r,i){var a=r.length;if(!(a<1)){var o=ot(e,n,0,!0),s,c=[];if(Ue(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=ot(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=Ue(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 It=(e,t,n,r,i,a,o)=>{var s=ue(o)?t:o,c=Ft(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>jt(jt({},e),{},{position:jt(jt({},e.position),{},{offset:e.position.offset-i/2})}))),c},Lt=(e,t)=>{var n=ce(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)}}}},Rt=(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 zt(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&Ue(e.zIndex)?e.zIndex:t}function J(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function Y(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var Bt=(e,t,n)=>j(e,`xAxis`,J(e,t),n),Vt=(e,t,n)=>O(e,`xAxis`,J(e,t),n),Ht=(e,t,n)=>j(e,`yAxis`,Y(e,t),n),Ut=(e,t,n)=>O(e,`yAxis`,Y(e,t),n),Wt=V([I,Bt,Ht,Vt,Ut],(e,t,n,r,i)=>Ce(e,`xAxis`)?je(t,r,!1):je(n,i,!1)),Gt=V([A,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),Kt=e=>Ce(I(e),`xAxis`)?`yAxis`:`xAxis`,qt=(e,t)=>Kt(e)===`yAxis`?Y(e,t):J(e,t),Jt=V([I,Bt,Ht,Vt,Ut,V([Gt,(e,t,n)=>P(e,Kt(e),qt(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var{stackId:n}=e,r=ce(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]])}}}),k,Wt,Gt,ne],(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 xn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}}),Yt=[`id`],Xt=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function Zt(){return Zt=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},Zt.apply(null,arguments)}function Qt(e,t){if(e==null)return{};var n,r,i=$t(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 $t(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 en(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 tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?en(Object(n),!0).forEach(function(t){nn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):en(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nn(e,t,n){return(t=rn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rn(e){var t=an(e,`string`);return typeof t==`symbol`?t:t+``}function an(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 on(e,t){return e&&e!==`none`?e:t}var sn=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:on(r,i),value:Ie(n,t),payload:e}]},cn=H.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:fe,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Ie(o,t),hide:s,type:l,color:on(r,a),unit:c,graphicalItemId:u}};return H.createElement(_e,{tooltipEntrySettings:d})});function ln(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,s=N(r);return H.createElement(He,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function un(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 tn(tn({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return H.createElement(rt,{value:t?i:void 0},n)}function dn(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:d}=a,f=Qt(a,Yt),p=N(f),m=E(f);return H.createElement(H.Fragment,null,t?.length>1&&H.createElement(D,{clipPath:r?`url(#clipPath-${i})`:void 0},H.createElement(re,Zt({},m,{id:d,points:t,connectNulls:l,type:s,baseLine:n,layout:o,stroke:`none`,className:`recharts-area-area`})),c!==`none`&&H.createElement(re,Zt({},p,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:t})),c!==`none`&&u&&Array.isArray(n)&&H.createElement(re,Zt({},p,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:n}))),H.createElement(ln,{points:t,props:f,clipPathId:i}))}function fn(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.y,o=r[r.length-1]?.y;if(!Ue(a)||!Ue(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return T(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),T(c)?H.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function pn(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.x,o=r[r.length-1]?.x;if(!Ue(a)||!Ue(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return T(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),T(c)?H.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function mn(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n===`vertical`?H.createElement(fn,{alpha:t,points:r,baseLine:i,strokeWidth:a}):H.createElement(pn,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function hn(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:f,onAnimationEnd:p}=r,m=ie((0,H.useMemo)(()=>({points:o,baseLine:s}),[o,s]),`recharts-area-`),h=se(),[g,_]=(0,H.useState)(!1),v=!g,y=(0,H.useCallback)(()=>{typeof p==`function`&&p(),_(!1)},[p]),b=(0,H.useCallback)(()=>{typeof f==`function`&&f(),_(!0)},[f]);if(h==null)return null;var x=i.current,S=a.current;return H.createElement(un,{showLabels:v,points:o},r.children,H.createElement(We,{animationId:m,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:y,onAnimationStart:b,key:m},e=>{if(x){var l=x.length/o.length,u=e===1?o:o.map((t,n)=>{var r=Math.floor(n*l);if(x[r]){var i=x[r];return tn(tn({},t),{},{x:z(i.x,t.x,e),y:z(i.y,t.y,e)})}return t}),d=T(s)?z(S,s,e):ue(s)||it(s)?z(S,0,e):s.map((t,n)=>{var r=Math.floor(n*l);if(Array.isArray(S)&&S[r]){var i=S[r];return tn(tn({},t),{},{x:z(i.x,t.x,e),y:z(i.y,t.y,e)})}return t});return e>0&&(i.current=u,a.current=d),H.createElement(dn,{points:u,baseLine:d,needClip:t,clipPathId:n,props:r})}return e>0&&(i.current=o,a.current=s),H.createElement(D,null,c&&H.createElement(`defs`,null,H.createElement(`clipPath`,{id:`animationClipPath-${n}`},H.createElement(mn,{alpha:e,points:o,baseLine:s,layout:h,strokeWidth:r.strokeWidth}))),H.createElement(D,{clipPath:`url(#animationClipPath-${n})`},H.createElement(dn,{points:o,baseLine:s,needClip:t,clipPathId:n,props:r})))}),H.createElement(le,{label:r.label}))}function gn(e){var{needClip:t,clipPathId:n,props:r}=e,i=(0,H.useRef)(null),a=(0,H.useRef)();return H.createElement(hn,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var _n=class extends H.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:f,zIndex:p}=this.props;if(e)return null;var m=S(`recharts-area`,r),h=d,{r:g,strokeWidth:_}=Be(t),v=ye(t),y=g*2+_,b=o?`url(#clipPath-${v?``:`dots-`}${h})`:void 0;return H.createElement(de,{zIndex:p},H.createElement(D,{className:m},o&&H.createElement(`defs`,null,H.createElement(qe,{clipPathId:h,xAxisId:s,yAxisId:c}),!v&&H.createElement(`clipPath`,{id:`clipPath-dots-${h}`},H.createElement(`rect`,{x:a-y/2,y:i-y/2,width:l+y,height:u+y}))),H.createElement(gn,{needClip:o,clipPathId:h,props:this.props})),H.createElement(Se,{points:n,mainColor:on(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:b}),this.props.isRange&&Array.isArray(f)&&H.createElement(Se,{points:f,mainColor:on(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:b}))}},vn={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:st.area};function yn(e){var{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,connectNulls:a,dot:o,fill:s,fillOpacity:c,hide:l,isAnimationActive:u,legendType:d,stroke:f,xAxisId:p,yAxisId:m}=e,h=Qt(e,Xt),g=b(),_=te(),{needClip:v}=be(p,m),y=Xe(),{points:x,isRange:S,baseLine:C}=B(t=>Jt(t,e.id,y))??{},w=Te();if(g!==`horizontal`&&g!==`vertical`||w==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var{height:T,width:ee,x:E,y:D}=w;return!x||!x.length?null:H.createElement(_n,Zt({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:C,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:T,hide:l,layout:g,isAnimationActive:u,isRange:S,legendType:d,needClip:v,points:x,stroke:f,width:ee,left:E,top:D,xAxisId:p,yAxisId:m}))}var bn=(e,t,n,r,i)=>{var a=n??t;if(T(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 xn(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=bn(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=Qe(e,r);Array.isArray(o)?(a=o,_=!0):a=[h,o]}var l=a?.[1]??null,v=l==null||m&&!t&&Qe(e,r)==null;return g?{x:Je({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:Je({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 Sn(e){var t=ve(e,vn),n=Xe();return H.createElement(Oe,{id:t.id,type:`area`},e=>H.createElement(H.Fragment,null,H.createElement(De,{legendPayload:sn(t)}),H.createElement(cn,{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}),H.createElement(Le,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:xe(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),H.createElement(yn,Zt({},t,{id:e}))))}var Cn=H.memo(Sn,ge);Cn.displayName=`Area`;var wn=!0,Tn=`Invariant failed`;function En(e,t){if(!e){if(wn)throw Error(Tn);var n=typeof t==`function`?t():t,r=n?`${Tn}: ${n}`:Tn;throw Error(r)}}function Dn(){return Dn=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},Dn.apply(null,arguments)}function On(e){return H.createElement($e,Dn({shapeType:`rectangle`,activeClassName:`recharts-active-bar`,inActiveClassName:`recharts-inactive-bar`},e))}var kn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,r)=>{if(T(e))return e;var i=T(n)||ue(n);return i?e(n,r):(!i&&En(!1,`minPointSize callback function received a value with type of ${typeof n}. Currently only numbers or null/undefined are supported.`),t)}},An=(e,t,n)=>n,jn=V([A,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`bar`).find(e=>e.id===t)),Mn=V([jn],e=>e?.maxBarSize),Nn=(e,t,n,r)=>r,Pn=V([I,A,J,Y,An],(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`)),Fn=(e,t,n)=>{var r=I(e),i=J(e,t),a=Y(e,t);if(!(i==null||a==null))return r===`horizontal`?P(e,`yAxis`,a,n):P(e,`xAxis`,i,n)},In=V([Pn,pe,(e,t)=>{var n=I(e),r=J(e,t),i=Y(e,t);if(!(r==null||i==null))return n===`horizontal`?oe(e,`xAxis`,r):oe(e,`yAxis`,i)}],kt),Ln=(e,t,n)=>{var r=jn(e,t);if(r==null)return 0;var i=J(e,t),a=Y(e,t);if(i==null||a==null)return 0;var o=I(e),s=he(e),{maxBarSize:c}=r,l=ue(c)?s:c,u,d;return o===`horizontal`?(u=j(e,`xAxis`,i,n),d=O(e,`xAxis`,i,n)):(u=j(e,`yAxis`,a,n),d=O(e,`yAxis`,a,n)),je(u,d,!0)??l??0},Rn=(e,t,n)=>{var r=I(e),i=J(e,t),a=Y(e,t);if(!(i==null||a==null)){var o,s;return r===`horizontal`?(o=j(e,`xAxis`,i,n),s=O(e,`xAxis`,i,n)):(o=j(e,`yAxis`,a,n),s=O(e,`yAxis`,a,n)),je(o,s)}},zn=V([Ke,ze,(e,t,n)=>{var r=J(e,t);if(r!=null)return j(e,`xAxis`,r,n)},(e,t,n)=>{var r=Y(e,t);if(r!=null)return j(e,`yAxis`,r,n)},(e,t,n)=>{var r=J(e,t);if(r!=null)return O(e,`xAxis`,r,n)},(e,t,n)=>{var r=Y(e,t);if(r!=null)return O(e,`yAxis`,r,n)},V([V([In,he,me,C,Ln,Rn,Mn],It),jn],Rt),I,k,Rn,V([Fn,jn],Lt),jn,Nn],(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 br({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})}}),Bn=[`index`];function Vn(){return Vn=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},Vn.apply(null,arguments)}function Hn(e,t){if(e==null)return{};var n,r,i=Un(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 Un(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 Wn=(0,H.createContext)(void 0),Gn=e=>{var t=(0,H.useContext)(Wn);if(t!=null)return t.stackId;if(e!=null)return xe(e)},Kn=(e,t)=>`recharts-bar-stack-clip-path-${e}-${t}`,qn=e=>{var t=(0,H.useContext)(Wn);if(t!=null){var{stackId:n}=t;return`url(#${Kn(n,e)})`}},Jn=e=>{var{index:t}=e,n=Hn(e,Bn),r=qn(t);return H.createElement(D,Vn({className:`recharts-bar-stack-layer`,clipPath:r},n))},Yn=[`onMouseEnter`,`onMouseLeave`,`onClick`],Xn=[`value`,`background`,`tooltipPosition`],Zn=[`id`],Qn=[`onMouseEnter`,`onClick`,`onMouseLeave`];function $n(){return $n=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},$n.apply(null,arguments)}function er(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 X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?er(Object(n),!0).forEach(function(t){tr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):er(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tr(e,t,n){return(t=nr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nr(e){var t=rr(e,`string`);return typeof t==`symbol`?t:t+``}function rr(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 ir(e,t){if(e==null)return{};var n,r,i=ar(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 ar(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 or=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ie(n,t),payload:e}]},sr=H.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:fe,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Ie(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return H.createElement(_e,{tooltipEntrySettings:u})});function cr(e){var t=B(M),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:s,onClick:c}=a,l=ir(a,Yn),u=Tt(o,r,a.id),d=Et(s),f=Dt(c,r,a.id);if(!i||n==null)return null;var p=Pe(i);return H.createElement(de,{zIndex:zt(i,st.barBackground)},n.map((e,n)=>{var{value:a,background:o,tooltipPosition:s}=e,c=ir(e,Xn);if(!o)return null;var m=u(e,n),h=d(e,n),g=f(e,n),_=X(X(X(X(X({option:i,isActive:String(n)===t},c),{},{fill:`#eee`},o),p),et(l,e,n)),{},{onMouseEnter:m,onMouseLeave:h,onClick:g,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return H.createElement(On,$n({key:`background-bar-${n}`},_))}))}function lr(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 X(X({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return H.createElement(rt,{value:t?i:void 0},n)}function ur(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,s=B(M),c=B(ee),l=n&&String(i.originalDataIndex)===s&&(c==null||o===c),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(!1);(0,H.useEffect)(()=>{var e;return l?(d(!0),e=requestAnimationFrame(()=>{p(!0)})):p(!1),()=>{cancelAnimationFrame(e)}},[l]);var m=(0,H.useCallback)(()=>{l||d(!1)},[l]),h=l&&f,g=l||u,_=l?n===!0?t:n:t,v=H.createElement(On,$n({},r,{name:String(r.name)},i,{isActive:h,option:_,index:a,dataKey:o,onTransitionEnd:m}));return g?H.createElement(de,{zIndex:st.activeBar},H.createElement(Jn,{index:i.originalDataIndex},v)):v}function dr(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return H.createElement(On,$n({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function fr(e){var{data:t,props:n}=e,r=N(n)??{},{id:i}=r,a=ir(r,Zn),{shape:o,dataKey:s,activeBar:c}=n,{onMouseEnter:l,onClick:u,onMouseLeave:d}=n,f=ir(n,Qn),p=Tt(l,s,i),m=Et(d),h=Dt(u,s,i);return t?H.createElement(H.Fragment,null,t.map((e,t)=>H.createElement(Jn,$n({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},et(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:h(e,t)}),c?H.createElement(ur,{shape:o,activeBar:c,baseProps:a,entry:e,index:t,dataKey:s}):H.createElement(dr,{shape:o,baseProps:a,entry:e,index:t,dataKey:s})))):null}function pr(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,onAnimationEnd:l,onAnimationStart:u}=t,d=n.current,f=ie(t,`recharts-bar-`),[p,m]=(0,H.useState)(!1),h=!p,g=(0,H.useCallback)(()=>{typeof l==`function`&&l(),m(!1)},[l]),_=(0,H.useCallback)(()=>{typeof u==`function`&&u(),m(!0)},[u]);return H.createElement(lr,{showLabels:h,rects:r},H.createElement(We,{animationId:f,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:g,onAnimationStart:_,key:f},e=>{var a=e===1?r:r?.map((t,n)=>{var r=d&&d[n];if(r)return X(X({},t),{},{x:z(r.x,t.x,e),y:z(r.y,t.y,e),width:z(r.width,t.width,e),height:z(r.height,t.height,e)});if(i===`horizontal`){var a=z(0,t.height,e),o=z(t.stackedBarStart,t.y,e);return X(X({},t),{},{y:o,height:a})}var s=z(0,t.width,e),c=z(t.stackedBarStart,t.x,e);return X(X({},t),{},{width:s,x:c})});return e>0&&(n.current=a??null),a==null?null:H.createElement(D,null,H.createElement(fr,{props:t,data:a}))}),H.createElement(le,{label:t.label}),t.children)}function mr(e){var t=(0,H.useRef)(null);return H.createElement(pr,{previousRectanglesRef:t,props:e})}var hr=0,gr=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:Qe(e,t)}},_r=class extends H.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=S(`recharts-bar`,r),u=c;return H.createElement(D,{className:l,id:c},o&&H.createElement(`defs`,null,H.createElement(qe,{clipPathId:u,xAxisId:i,yAxisId:a})),H.createElement(D,{className:`recharts-bar-rectangles`,clipPath:o?`url(#clipPath-${u})`:void 0},H.createElement(cr,{data:t,dataKey:n,background:s,allOtherBarProps:this.props}),H.createElement(mr,this.props)))}},vr={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:hr,xAxisId:0,yAxisId:0,zIndex:st.bar};function yr(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u}=e,{needClip:d}=be(t,n),f=b(),p=Xe(),m=at(e.children,wt),h=B(t=>zn(t,e.id,p,m));if(f!==`vertical`&&f!==`horizontal`)return null;var g,_=h?.[0];return g=_==null||_.height==null||_.width==null?0:f===`vertical`?_.height/2:_.width/2,H.createElement(Fe,{xAxisId:t,yAxisId:n,data:h,dataPointFormatter:gr,errorBarOffset:g},H.createElement(_r,$n({},e,{layout:f,needClip:d,data:h,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u})))}function br(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:s,yAxis:c,xAxisTicks:l,yAxisTicks:u,stackedData:d,displayedData:f,offset:p,cells:m,parentViewBox:h,dataStartIndex:g}=e,_=t===`horizontal`?c:s,v=d?_.scale.domain():null,y=R({numericAxis:_}),b=_.scale.map(y);return f.map((e,f)=>{var _,x,S,C,w,T;if(d){var ee=d[f+g];if(ee==null)return null;_=Ee(ee,v)}else _=Qe(e,n),Array.isArray(_)||(_=[y,_]);var E=kn(r,hr)(_[1],f);if(t===`horizontal`){var te=c.scale.map(_[0]),D=c.scale.map(_[1]);if(te==null||D==null)return null;x=Ve({axis:s,ticks:l,bandSize:o,offset:a.offset,entry:e,index:f}),S=D??te??void 0,C=a.size;var O=te-D;if(w=it(O)?0:O,T={x,y:p.top,width:C,height:p.height},Math.abs(E)>0&&Math.abs(w)<Math.abs(E)){var k=nt(w||E)*(Math.abs(E)-Math.abs(w));S-=k,w+=k}}else{var ne=s.scale.map(_[0]),A=s.scale.map(_[1]);if(ne==null||A==null)return null;if(x=ne,S=Ve({axis:c,ticks:u,bandSize:o,offset:a.offset,entry:e,index:f}),C=A-ne,w=a.size,T={x:p.left,y:S,width:p.width,height:w},Math.abs(E)>0&&Math.abs(C)<Math.abs(E)){var re=nt(C||E)*(Math.abs(E)-Math.abs(C));C+=re}}return x==null||S==null||C==null||w==null||!i&&(C===0||w===0)?null:X(X({},e),{},{stackedBarStart:b,x,y:S,width:C,height:w,value:d?_:_[1],payload:e,background:T,tooltipPosition:{x:x+C/2,y:S+w/2},parentViewBox:h,originalDataIndex:f},m&&m[f]&&m[f].props)}).filter(Boolean)}function xr(e){var t=ve(e,vr),n=Gn(t.stackId),r=Xe();return H.createElement(Oe,{id:t.id,type:`bar`},e=>H.createElement(H.Fragment,null,H.createElement(De,{legendPayload:or(t)}),H.createElement(sr,{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}),H.createElement(Le,{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}),H.createElement(de,{zIndex:t.zIndex},H.createElement(yr,$n({},t,{id:e})))))}var Sr=H.memo(xr,ge);Sr.displayName=`Bar`;var Cr=[`axis`,`item`],wr=(0,H.forwardRef)((e,t)=>H.createElement(Re,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:Cr,tooltipPayloadSearcher:tt,categoricalChartProps:e,ref:t})),Tr=[`axis`],Er=(0,H.forwardRef)((e,t)=>H.createElement(Re,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:Tr,tooltipPayloadSearcher:tt,categoricalChartProps:e,ref:t})),Z={page:`_page_8zwrx_1`,primary:`_primary_8zwrx_69`,stickyHeader:`_stickyHeader_8zwrx_74`,breadcrumb:`_breadcrumb_8zwrx_83`,filterBar:`_filterBar_8zwrx_86`,tabs:`_tabs_8zwrx_90`,categoryControl:`_categoryControl_8zwrx_135`,dateControl:`_dateControl_8zwrx_136`,count:`_count_8zwrx_144`,period:`_period_8zwrx_159`,yearButton:`_yearButton_8zwrx_164`,segment:`_segment_8zwrx_187`,message:`_message_8zwrx_211`,categoryList:`_categoryList_8zwrx_227`,categoryLegend:`_categoryLegend_8zwrx_231`,categoryHeaders:`_categoryHeaders_8zwrx_253`,categoryRows:`_categoryRows_8zwrx_254`,categoryRow:`_categoryRow_8zwrx_254`,categoryName:`_categoryName_8zwrx_328`,categoryOpen:`_categoryOpen_8zwrx_336`,iconButton:`_iconButton_8zwrx_393`,rowActions:`_rowActions_8zwrx_402`,toolbar:`_toolbar_8zwrx_445`,search:`_search_8zwrx_455`,price:`_price_8zwrx_485`,configButton:`_configButton_8zwrx_509`,tableScroll:`_tableScroll_8zwrx_517`,sort:`_sort_8zwrx_563`,activeSort:`_activeSort_8zwrx_567`,productTable:`_productTable_8zwrx_571`,shopTable:`_shopTable_8zwrx_574`,shopName:`_shopName_8zwrx_592`,sales:`_sales_8zwrx_598`,identity:`_identity_8zwrx_602`,noImage:`_noImage_8zwrx_613`,productTitle:`_productTitle_8zwrx_631`,copyButton:`_copyButton_8zwrx_656`,shopId:`_shopId_8zwrx_663`,linkButton:`_linkButton_8zwrx_669`,anomaly:`_anomaly_8zwrx_676`,pagination:`_pagination_8zwrx_679`,ellipsis:`_ellipsis_8zwrx_719`,notice:`_notice_8zwrx_723`,sources:`_sources_8zwrx_733`,empty:`_empty_8zwrx_750`,emptyState:`_emptyState_8zwrx_757`,seasonBoard:`_seasonBoard_8zwrx_779`,hot:`_hot_8zwrx_785`,cold:`_cold_8zwrx_786`,neutral:`_neutral_8zwrx_787`,yearBoards:`_yearBoards_8zwrx_805`,productGrid:`_productGrid_8zwrx_849`,largeImage:`_largeImage_8zwrx_863`,picker:`_picker_8zwrx_926`,pickerPanel:`_pickerPanel_8zwrx_955`,cascade:`_cascade_8zwrx_987`,selectedCategory:`_selectedCategory_8zwrx_1021`,pickerResults:`_pickerResults_8zwrx_1024`,dialog:`_dialog_8zwrx_1038`,fieldLayout:`_fieldLayout_8zwrx_1079`,fieldTools:`_fieldTools_8zwrx_1098`,dialogActions:`_dialogActions_8zwrx_1134`,chart:`_chart_8zwrx_1142`,detailScope:`_detailScope_8zwrx_1147`,detailMetrics:`_detailMetrics_8zwrx_1152`};function Dr({title:e,children:t,onClose:n}){let r=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let e=document.activeElement;return r.current?.showModal(),()=>e?.focus()},[]),(0,U.jsxs)(`dialog`,{ref:r,className:Z.dialog,onCancel:n,onClick:e=>{e.target===e.currentTarget&&n()},children:[(0,U.jsxs)(`header`,{children:[(0,U.jsx)(`h2`,{children:e}),(0,U.jsx)(`button`,{autoFocus:!0,onClick:n,"aria-label":`关闭弹窗`,children:(0,U.jsx)(f,{size:18})})]}),t]})}function Or({categories:e,value:t,onChoose:n,disabled:r}){let[a,s]=(0,H.useState)(``),[c,l]=(0,H.useState)(``),d=(0,H.useRef)(null);(0,H.useEffect)(()=>{function e(e){let t=d.current;t?.open&&e.target instanceof Node&&!t.contains(e.target)&&(t.open=!1)}return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[]);let f=q(e,c||t);function p(e){n(e),s(``),l(e),d.current&&(d.current.open=!1)}let m=[e.filter(e=>!e.parentId),...f.filter(e=>!e.leaf).map(t=>e.filter(e=>e.parentId===t.id))];return(0,U.jsxs)(`details`,{className:Z.picker,ref:d,onKeyDown:e=>{e.key===`Escape`&&d.current&&(d.current.open=!1,d.current.querySelector(`summary`)?.focus())},children:[(0,U.jsxs)(`summary`,{"aria-label":`选择市场类目`,"aria-disabled":r,onClick:e=>{r&&e.preventDefault()},children:[q(e,t).map(e=>e.name).join(` / `)||`全部类目`,(0,U.jsx)(i,{size:14})]}),(0,U.jsxs)(`div`,{className:Z.pickerPanel,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(u,{size:14}),(0,U.jsx)(`input`,{"aria-label":`查找授权类目`,placeholder:`搜索类目名称`,value:a,onChange:e=>s(e.target.value)})]}),(0,U.jsx)(`button`,{onClick:()=>p(``),children:`全部获准类目`}),a?(0,U.jsx)(`div`,{className:Z.pickerResults,children:e.filter(e=>e.name.includes(a)).slice(0,100).map(t=>(0,U.jsx)(`button`,{onClick:()=>p(t.id),children:q(e,t.id).map(e=>e.name).join(` / `)},t.id))}):(0,U.jsx)(`div`,{className:Z.cascade,children:m.map((e,t)=>(0,U.jsx)(`div`,{children:e.map(e=>(0,U.jsxs)(`div`,{onPointerEnter:t=>{t.pointerType===`mouse`&&l(e.id)},className:f.some(t=>t.id===e.id)?Z.selectedCategory:``,children:[(0,U.jsx)(`button`,{onClick:()=>p(e.id),children:e.name}),!e.leaf&&(0,U.jsx)(`button`,{"aria-label":`展开${e.name}`,"aria-expanded":f.some(t=>t.id===e.id),onClick:()=>l(e.id),children:(0,U.jsx)(o,{size:13})})]},e.id))},t))})]})]})}function kr({columns:e,allowed:t,onSave:n,onClose:r}){let[i,a]=(0,H.useState)(e),[o,s]=(0,H.useState)(null),c=e=>yt.find(t=>t[0]===e)?.[1];function l(e,t){a(n=>{let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),r})}return(0,U.jsxs)(Dr,{title:`自定义数据字段(${i.length}/${t.length})`,onClose:r,children:[(0,U.jsxs)(`div`,{className:Z.fieldLayout,children:[(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`排行榜指标`}),t.map(e=>(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:i.includes(e),onChange:t=>a(n=>t.target.checked?[...n,e]:n.filter(t=>t!==e))}),c(e)]},e))]}),(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:Z.fieldTools,children:[(0,U.jsxs)(`span`,{children:[`已选 `,i.length,`/`,t.length]}),(0,U.jsx)(`button`,{onClick:()=>a(t),children:`恢复默认`}),(0,U.jsx)(`button`,{onClick:()=>a([]),children:`清空`})]}),(0,U.jsx)(`h3`,{children:`当前字段顺序`}),(0,U.jsx)(`ol`,{children:i.map((e,t)=>(0,U.jsxs)(`li`,{draggable:!0,onDragStart:()=>s(e),onDragOver:e=>e.preventDefault(),onDrop:()=>{o&&l(i.indexOf(o),t),s(null)},children:[(0,U.jsxs)(`span`,{children:[`⠿ `,t+1,`. `,c(e)]}),(0,U.jsx)(`button`,{disabled:t===0,"aria-label":`上移${c(e)}`,onClick:()=>l(t,t-1),children:`↑`}),(0,U.jsx)(`button`,{disabled:t===i.length-1,"aria-label":`下移${c(e)}`,onClick:()=>l(t,t+1),children:`↓`})]},e))})]})]}),(0,U.jsxs)(`footer`,{className:Z.dialogActions,children:[(0,U.jsx)(`button`,{onClick:r,children:`取消`}),(0,U.jsx)(`button`,{className:Z.primary,onClick:()=>n(i),children:`确定`})]})]})}function Ar({points:e,metric:t=`sales`}){let n=(0,H.useRef)(null),[r,i]=(0,H.useState)(300);return(0,H.useEffect)(()=>{if(!n.current)return;let e=new ResizeObserver(([e])=>i(Math.max(200,Math.round(e.contentRect.width))));return e.observe(n.current),()=>e.disconnect()},[]),(0,U.jsx)(`div`,{ref:n,className:Z.chart,role:`img`,"aria-label":`月度数据趋势`,children:e.some(e=>e[t]!=null)?(0,U.jsxs)(Er,{width:r,height:260,data:e,margin:{top:15,right:20,left:10,bottom:0},children:[(0,U.jsx)(Ze,{stroke:`#263e57`,vertical:!1}),(0,U.jsx)(Ae,{dataKey:`month`,tick:{fill:`#93adc5`,fontSize:11}}),(0,U.jsx)(Ge,{width:76,tickFormatter:e=>K(e),tick:{fill:`#93adc5`,fontSize:11}}),(0,U.jsx)(w,{contentStyle:{background:`#10243b`,border:`1px solid #355978`,color:`#e4f0fc`},formatter:e=>K(Number(e),t===`sales`?`money`:`number`)}),(0,U.jsx)(Cn,{dataKey:t,type:`monotone`,fill:`#2aaad4`,fillOpacity:.15,stroke:`#4dc9f0`,strokeWidth:2,connectNulls:!1})]}):(0,U.jsx)(`p`,{className:Z.empty,children:`当前记录暂无可追踪的月度数据`})})}var jr=e=>yt.find(t=>t[0]===e)?.[1],Mr=(e,t)=>K(e[t],yt.find(e=>e[0]===t)?.[2]);function Nr({view:e,selection:t,onViewChange:n,onShopLayout:r}={}){let[i,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(null),[f,p]=vt(`query`,_t);(0,H.useEffect)(()=>{p(n=>({...n,...t?{categoryId:t.categoryId}:{},view:e||n.view,page:1}))},[e,t,p]);let[h,g]=(0,H.useState)(!0),[_,v]=(0,H.useState)(``),[y,b]=(0,H.useState)(0),[x,S]=(0,H.useState)(``),[C,w]=vt(`productFields`,St),[T,ee]=vt(`shopFields`,Ct),[E,te]=(0,H.useState)(!1),[D,O]=vt(`grid`,!1),[k,ne]=(0,H.useState)(f.minPrice),[A,re]=(0,H.useState)(f.maxPrice),[ie,ae]=(0,H.useState)([]),[j,oe]=(0,H.useState)(null),[M,N]=(0,H.useState)(null),[P,se]=(0,H.useState)(null),[ce,le]=(0,H.useState)(!1),[ue,de]=(0,H.useState)(``),[fe,pe]=(0,H.useState)([]),[me,he]=(0,H.useState)([]),ge=(0,H.useRef)(null);function F(e){e.view&&n?.(e.view),l(null),v(``),g(!0),p(t=>({...t,...e,page:e.page??1}))}function I(e){let t=i?.categories.find(t=>t.id===e);ne(``),re(``),F({categoryId:e,view:t?.leaf?`products`:`categories`,q:``,minPrice:``,maxPrice:``,sort:`sales`,direction:`desc`})}(0,H.useEffect)(()=>{let e=new AbortController;return(async()=>{if(await Promise.resolve(),!e.signal.aborted){g(!0),v(``),l(null),s(null);try{let t=await W.bootstrap(e.signal);if(e.signal.aborted)return;if(t.contractVersion!==1)throw Error(`市场查询契约版本不兼容`);s(t),ae((t.favorites||[]).map(e=>`${e.kind}:${e.key}`)),p(e=>{let n=t.categories.some(t=>t.id===e.categoryId);return{...e,categoryId:n?e.categoryId:``,view:n||!e.categoryId?e.view:`categories`,month:t.months.includes(e.month)?e.month:t.latestCategoryMonth||t.latestMonth||``}})}catch(t){e.signal.aborted||v(t.message)}finally{e.signal.aborted||g(!1)}}})(),()=>e.abort()},[y,p]),(0,H.useEffect)(()=>{if(!i||i.status!==`ready`||!f.month)return;let e=ge.current;ge.current=f;let t=e&&e.q!==f.q&&e.categoryId===f.categoryId&&e.view===f.view&&e.month===f.month?180:0,n=new AbortController,r=setTimeout(()=>{if(f.view!==`categories`&&!f.categoryId){g(!1),l(null);return}g(!0),W.query(f,n.signal).then(e=>{n.signal.aborted||l(e)}).catch(e=>{n.signal.aborted||(l(null),v(e.message),e.status===403?(s(null),b(e=>e+1)):e.status===401&&s(null))}).finally(()=>{n.signal.aborted||g(!1)})},t);return()=>{clearTimeout(r),n.abort()}},[f,i]),(0,H.useEffect)(()=>{if(!M)return;let e=new AbortController;return(async()=>{if(await Promise.resolve(),!e.signal.aborted){le(!0),de(``),pe([]),he([]),se(M.kind===`record`||M.kind===`shopCategories`?M.record:null);try{if(M.kind===`record`){let t=await W.record(M.record.key,e.signal);e.signal.aborted||se(t)}if(M.kind===`shopCategories`){let t=await W.shopCategories(M.record.key,e.signal);e.signal.aborted||pe(t.rows)}if(M.kind===`distribution`){let t=await W.distribution(f,e.signal);e.signal.aborted||pe(t.rows.map(e=>({name:e.label,sales:e.sales,products:e.products})))}if(M.kind===`categoryTrend`){let t=await W.query({...f,view:`categories`,categoryId:M.category.id},e.signal);e.signal.aborted||he(t.trend)}}catch(t){e.signal.aborted||de(t.message)}finally{e.signal.aborted||le(!1)}}})(),()=>e.abort()},[M,f]);let _e=q(i?.categories||[],f.categoryId),ve=_e.at(-1),L=f.view===`categories`,R=f.view===`products`,ye=i?.months.indexOf(f.month)??-1,z=R?C:T,be=c?.rows||[],xe=c?.categories||[],Se=f.metric===`units`?`units`:`sales`,Ce=c?.availability?.[R?`products`:`shops`],we=Math.max(1,Math.ceil((c?.total||0)/f.pageSize)),Te=f.month?new Date(Date.UTC(Number(f.month.slice(0,4)),Number(f.month.slice(5,7)),0)).toISOString().slice(0,10):``;async function Ee(e){try{if(window.omni){let t=await window.omni.copyText(e);if(!t.ok)throw Error(t.error)}else await navigator.clipboard.writeText(e);S(`编号已复制`)}catch{S(`复制未完成,可选中编号复制`)}}async function De(e,t){if(j)return;let n=`${e}:${t}`,r=!ie.includes(n);oe(n);try{await W.favorite(e,t,r),ae(e=>r?[...e,n]:e.filter(e=>e!==n))}catch(e){S(e.message)}finally{oe(null)}}function B(e,t,n){return(0,U.jsx)(`button`,{className:Z.iconButton,disabled:j!==null,"aria-label":`收藏${n}`,"aria-pressed":ie.includes(`${e}:${t}`),onClick:()=>void De(e,t),children:(0,U.jsx)(ht,{size:14,fill:ie.includes(`${e}:${t}`)?`currentColor`:`none`})})}function Oe(e){return(0,U.jsxs)(`div`,{className:Z.identity,children:[G(e.imageUrl)?(0,U.jsx)(`a`,{href:G(e.imageUrl),target:`_blank`,rel:`noreferrer`,children:(0,U.jsx)(`img`,{src:G(e.imageUrl),alt:e.name||`商品图片`,loading:`lazy`,referrerPolicy:`no-referrer`})}):(0,U.jsx)(`span`,{className:Z.noImage,children:(0,U.jsx)(pt,{size:20})}),(0,U.jsxs)(`div`,{children:[G(e.url)?(0,U.jsx)(`a`,{className:Z.productTitle,href:G(e.url),target:`_blank`,rel:`noreferrer`,children:e.name||`资料缺失`}):(0,U.jsx)(`button`,{className:Z.productTitle,onClick:()=>N({kind:`record`,record:e}),children:e.name||`资料缺失`}),(0,U.jsxs)(`small`,{children:[`商品ID:`,e.id||`编号缺失`,e.id&&(0,U.jsx)(`button`,{className:Z.copyButton,"aria-label":`复制商品编号${e.id}`,onClick:()=>void Ee(e.id),children:(0,U.jsx)(m,{size:12})})]})]})]})}function ke(e,t=!1){let n=t?e.shopUrl:e.url,r=t?e.shopName:e.name;return G(n)?(0,U.jsx)(`a`,{href:G(n),target:`_blank`,rel:`noreferrer`,children:r||`资料缺失`}):(0,U.jsx)(`span`,{children:r||`资料缺失`})}function Ae(e){return(0,U.jsx)(`th`,{children:(0,U.jsxs)(`button`,{onClick:()=>F({sort:e,direction:f.sort===e&&f.direction===`desc`?`asc`:`desc`}),children:[jr(e),(0,U.jsx)(`span`,{className:f.sort===e?Z.activeSort:Z.sort,children:f.sort===e?f.direction===`desc`?`↓`:`↑`:`↕`})]})},e)}function je(e,t){return(0,U.jsxs)(`td`,{className:t===`sales`?Z.sales:void 0,children:[Mr(e,t),t===`conversionRate`&&e[t]!=null&&(e[t]<0||e[t]>100)&&(0,U.jsxs)(`span`,{className:Z.anomaly,title:`来源转化率异常,保留原值`,children:[` `,`!`]})]},t)}function Me(){if(k&&!/^\d{1,9}(\.\d{1,2})?$/.test(k)||A&&!/^\d{1,9}(\.\d{1,2})?$/.test(A)||k&&A&&Number(k)>Number(A)){S(`请填写有效的非负件单价区间`);return}S(``),F({minPrice:k,maxPrice:A})}return(0,U.jsxs)(`section`,{className:Z.page,"aria-label":`市场大盘`,children:[(0,U.jsxs)(`div`,{className:Z.stickyHeader,children:[(0,U.jsxs)(`header`,{className:Z.breadcrumb,"aria-label":`页面路径`,children:[(0,U.jsx)(gt,{href:`/?mode=center&view=overview`,children:`工作台`}),(0,U.jsx)(o,{size:13}),(0,U.jsx)(`button`,{onClick:()=>F({view:`categories`,categoryId:``,q:``,recentYear:!1}),children:`市场洞察`}),_e.map(e=>(0,U.jsxs)(`span`,{children:[(0,U.jsx)(o,{size:13}),(0,U.jsx)(`button`,{onClick:()=>I(e.id),children:e.name})]},e.id)),L&&!_e.length&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(o,{size:13}),(0,U.jsx)(`span`,{children:`全部类目`})]}),!L&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(o,{size:13}),(0,U.jsx)(`span`,{"aria-current":`page`,children:R?`商品排行榜`:`店铺排行榜`})]})]}),(0,U.jsxs)(`section`,{className:Z.filterBar,"aria-label":`市场查询条件`,children:[(0,U.jsxs)(`div`,{className:Z.categoryControl,children:[(0,U.jsx)(Or,{categories:i?.categories||[],value:f.categoryId,onChoose:I,disabled:!i?.categories.length}),L&&(0,U.jsxs)(`span`,{className:Z.count,children:[ve?`子类目`:`类目`,` `,c?xe.length:`—`,` `,`个`]}),L&&(0,U.jsxs)(`div`,{className:Z.categoryLegend,"aria-label":`类目类型颜色说明`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`i`,{"data-leaf":`false`}),`有下级`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`i`,{"data-leaf":`true`}),`叶子类目`]})]}),!L&&(0,U.jsx)(`nav`,{className:Z.tabs,role:`tablist`,"aria-label":`排行榜`,children:[[`products`,`商品排行榜`],[`shops`,`店铺排行榜`]].map(([e,t])=>(0,U.jsx)(`button`,{role:`tab`,"aria-selected":f.view===e,onClick:()=>F({view:e,q:``,sort:`sales`,direction:`desc`,minPrice:``,maxPrice:``}),children:t},e))})]}),(0,U.jsxs)(`div`,{className:Z.dateControl,children:[(0,U.jsxs)(`span`,{className:Z.period,children:[`统计时间:`,c?.period?.start||(f.month?f.month+`-01`:`—`),` `,`至 `,c?.period?.end||Te||`—`]}),(0,U.jsx)(`button`,{className:Z.yearButton,"aria-pressed":f.recentYear,disabled:!i?.months.length,onClick:()=>F({recentYear:!f.recentYear,q:``,sort:`sales`,direction:`desc`}),children:`最近1年`}),(0,U.jsxs)(`select`,{"aria-label":`统计月份`,value:f.month,disabled:!i?.months.length,onChange:e=>F({month:e.target.value,recentYear:!1}),children:[!i?.months.length&&(0,U.jsx)(`option`,{children:`等待可用月份`}),i?.months.map(e=>(0,U.jsxs)(`option`,{value:e,children:[e.replace(`-`,`年`),`月`]},e))]}),(0,U.jsx)(`button`,{"aria-label":`上一个可用月份`,disabled:ye<=0||h,onClick:()=>F({month:i.months[ye-1]}),children:(0,U.jsx)(a,{size:15})}),(0,U.jsx)(`button`,{"aria-label":`下一个可用月份`,disabled:!i||ye>=i.months.length-1||h,onClick:()=>F({month:i.months[ye+1]}),children:(0,U.jsx)(o,{size:15})}),L&&(0,U.jsx)(`div`,{className:Z.segment,children:[[`sales`,`销售额`],[`units`,`销量`],...ve?[[`season`,`行业淡旺季`]]:[]].map(([e,t])=>(0,U.jsx)(`button`,{"aria-pressed":f.metric===e,onClick:()=>F({metric:e}),children:t},e))})]})]})]}),x&&(0,U.jsxs)(`div`,{className:Z.message,role:`status`,children:[x,(0,U.jsx)(`button`,{"aria-label":`关闭提示`,onClick:()=>S(``),children:`×`})]}),_?(0,U.jsxs)(`section`,{className:Z.emptyState,role:`alert`,children:[(0,U.jsx)(d,{size:32}),(0,U.jsx)(`h2`,{children:_}),(0,U.jsx)(`button`,{onClick:()=>b(e=>e+1),children:`重新连接`})]}):i?.status===`no-access`?(0,U.jsxs)(`section`,{className:Z.emptyState,children:[(0,U.jsx)(`h2`,{children:`企业尚未获得市场类目授权`}),(0,U.jsx)(`p`,{children:`企业子账号继承企业的市场类目范围。`})]}):!L&&!f.categoryId?(0,U.jsxs)(`section`,{className:Z.emptyState,children:[(0,U.jsxs)(`h2`,{children:[`选择类目查看`,R?`商品`:`店铺`,`排行榜`]}),(0,U.jsx)(`p`,{children:`使用上方类目选择器,选择你要研究的具体类目。`})]}):(0,U.jsxs)(U.Fragment,{children:[!L&&(0,U.jsxs)(`div`,{className:Z.toolbar,children:[(0,U.jsxs)(`label`,{className:Z.search,children:[R&&!f.recentYear&&(0,U.jsx)(`span`,{children:`商品名称`}),(0,U.jsx)(u,{size:14}),(0,U.jsx)(`input`,{"aria-label":`搜索当前榜单`,placeholder:R?`请输入要搜索的商品名称或ID`:`请输入店铺名称`,value:f.q,onChange:e=>F({q:e.target.value})})]}),f.recentYear?(0,U.jsx)(`div`,{className:Z.segment,children:[`sales`,`views`].map(e=>(0,U.jsx)(`button`,{"aria-pressed":f.sort===e,onClick:()=>F({sort:e}),children:jr(e)},e))}):(0,U.jsxs)(U.Fragment,{children:[R?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{disabled:!i?.capabilities?.priceDistribution||Ce!==`ready`,onClick:()=>N({kind:`distribution`}),children:`客单价分布`}),(0,U.jsxs)(`div`,{className:Z.price,children:[(0,U.jsx)(`span`,{children:`件单价:`}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`input`,{type:`number`,min:`0`,"aria-label":`最低件单价`,value:k,onChange:e=>ne(e.target.value)}),(0,U.jsx)(`span`,{children:`元`})]}),(0,U.jsx)(`span`,{children:`–`}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`input`,{type:`number`,min:`0`,"aria-label":`最高件单价`,value:A,onChange:e=>re(e.target.value)}),(0,U.jsx)(`span`,{children:`元`})]}),(0,U.jsx)(`button`,{className:Z.primary,onClick:Me,children:`确定`}),(f.minPrice||f.maxPrice)&&(0,U.jsx)(`button`,{onClick:()=>{ne(``),re(``),F({minPrice:``,maxPrice:``})},children:`重置`})]}),(0,U.jsxs)(`div`,{className:Z.segment,children:[(0,U.jsxs)(`button`,{"aria-label":`大图视图`,"aria-pressed":D,onClick:()=>O(!0),children:[(0,U.jsx)(ut,{size:13}),`大图`]}),(0,U.jsxs)(`button`,{"aria-label":`列表视图`,"aria-pressed":!D,onClick:()=>O(!1),children:[(0,U.jsx)(ft,{size:13}),`列表`]})]})]}):(0,U.jsx)(`button`,{disabled:!0,title:`来源数据未提供地域字段`,children:`地域分布`}),(0,U.jsx)(`button`,{className:Z.configButton,onClick:()=>te(!0),children:`表格配置`})]})]}),h?(0,U.jsx)(`div`,{className:Z.empty,role:`status`,children:`正在读取市场数据…`}):L?f.metric===`season`?(0,U.jsxs)(`section`,{className:Z.seasonBoard,children:[(0,U.jsxs)(`table`,{children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`行业类目`}),(c?.period?.availableMonths||[]).map(e=>(0,U.jsx)(`th`,{children:e},e))]})}),(0,U.jsx)(`tbody`,{children:c?.season.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.name}),e.months.map(e=>(0,U.jsx)(`td`,{children:(0,U.jsx)(`span`,{className:e.state===`旺季`?Z.hot:e.state===`淡季`?Z.cold:Z.neutral,children:e.state||`资料缺失`})},e.month))]},e.categoryId))})]}),!c?.season.length&&(0,U.jsx)(`p`,{className:Z.empty,children:`淡旺季判定口径尚未配置,当前月份数据保持原值。`})]}):(0,U.jsxs)(`section`,{className:Z.categoryList,"aria-label":`类目列表`,children:[(0,U.jsx)(`div`,{className:Z.categoryHeaders,children:[0,1,2].map(e=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:`类目名称`}),(0,U.jsx)(`span`,{children:f.metric===`units`?`销量`:`销售额`}),(0,U.jsx)(`span`,{children:f.metric===`units`?`销量同比`:`销售额同比`}),(0,U.jsx)(`span`,{children:`店铺数`}),(0,U.jsx)(`span`,{})]},e))}),(0,U.jsx)(`div`,{className:Z.categoryRows,children:xe.map(e=>(0,U.jsxs)(`article`,{className:Z.categoryRow,"data-leaf":e.leaf,children:[(0,U.jsx)(`button`,{className:Z.categoryOpen,"aria-label":e.leaf?`查看${e.name}排行榜`:`进入${e.name}子类目`,onClick:()=>I(e.id)}),(0,U.jsxs)(`div`,{className:Z.categoryName,children:[(0,U.jsxs)(`span`,{title:e.name,children:[e.name,!e.leaf&&(0,U.jsx)(o,{size:12})]}),e.leaf&&(0,U.jsx)(`div`,{className:Z.rowActions,children:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{onClick:()=>F({categoryId:e.id,view:`products`,q:``}),children:`排行榜`}),(0,U.jsx)(`button`,{onClick:()=>N({kind:`categoryTrend`,category:e}),children:`趋势`})]})})]}),(0,U.jsx)(`strong`,{children:K(e[Se],Se===`sales`?`compact`:`number`)}),(0,U.jsx)(`span`,{children:K(f.metric===`units`?e.unitsYoy:e.salesYoy,`percent`)}),(0,U.jsx)(`span`,{children:K(e.shopCount)}),B(`category`,e.id,e.name)]},e.id))}),!xe.length&&(0,U.jsx)(`p`,{className:Z.empty,children:`当前类目已到最细层级,请选择商品或店铺排行榜。`})]}):f.recentYear?(0,U.jsx)(`section`,{className:Z.yearBoards,"aria-label":`最近一年月度榜单`,children:c?.monthlyRankings?.map(e=>(0,U.jsxs)(`article`,{children:[(0,U.jsxs)(`h2`,{children:[e.month.replace(`-`,`年`),`月`]}),(0,U.jsxs)(`table`,{children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`排名`}),(0,U.jsx)(`th`,{children:R?`商品`:`店铺`}),(0,U.jsx)(`th`,{children:f.sort===`views`?`浏览量`:`销售额`})]})}),(0,U.jsx)(`tbody`,{children:e.rows.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.sourceRank??`—`}),(0,U.jsxs)(`td`,{children:[R?Oe(e):ke(e),R&&(0,U.jsx)(`small`,{children:e.shopName||`店铺资料缺失`})]}),(0,U.jsx)(`td`,{children:K(e[f.sort===`views`?`views`:`sales`],f.sort===`views`?`number`:`compact`)})]},e.key))})]}),!e.rows.length&&(0,U.jsx)(`p`,{className:Z.empty,children:e.status===`pending`?`正在导入`:e.status===`missing`?`暂无该月来源数据`:`暂无匹配数据`})]},e.month))}):R&&D?(0,U.jsxs)(`section`,{className:Z.productGrid,children:[be.map(e=>(0,U.jsxs)(`article`,{children:[(0,U.jsxs)(`div`,{className:Z.largeImage,children:[G(e.imageUrl)?(0,U.jsx)(`img`,{src:G(e.imageUrl),alt:e.name||`商品图片`,loading:`lazy`,referrerPolicy:`no-referrer`}):(0,U.jsx)(pt,{size:44}),(0,U.jsxs)(`span`,{children:[`排名 `,e.sourceRank??`—`]}),B(`product`,e.key,e.name||`商品`)]}),Oe(e),(0,U.jsxs)(`p`,{children:[`店铺:`,ke(e,!0)]}),(0,U.jsx)(`dl`,{children:C.map(t=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:jr(t)}),(0,U.jsx)(`dd`,{children:Mr(e,t)})]},t))}),(0,U.jsx)(`button`,{onClick:()=>N({kind:`record`,record:e}),children:`查看销售走势`})]},e.key)),!be.length&&(0,U.jsx)(`p`,{className:Z.empty,children:Ce===`pending`?`当前类目榜单正在导入`:`暂无匹配商品`})]}):(0,U.jsxs)(`section`,{className:Z.tableScroll,"aria-label":R?`商品排行榜`:`店铺排行榜`,children:[(0,U.jsxs)(`table`,{className:R?Z.productTable:Z.shopTable,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`排名`}),R?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`th`,{children:`商品`}),C[0]===`listingDays`&&Ae(`listingDays`),(0,U.jsx)(`th`,{children:`收藏商品`}),(0,U.jsx)(`th`,{children:`店铺`}),(0,U.jsx)(`th`,{children:`销售走势`}),(0,U.jsx)(`th`,{children:`利润测算`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`th`,{children:`店铺ID`}),(0,U.jsx)(`th`,{children:`店铺名称`}),(0,U.jsx)(`th`,{children:`店铺收藏`}),(0,U.jsx)(`th`,{children:`销售走势`}),(0,U.jsx)(`th`,{children:`品类分析`})]}),z.filter(e=>!R||C[0]!==`listingDays`||e!==`listingDays`).map(Ae)]})}),(0,U.jsx)(`tbody`,{children:be.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.sourceRank??`—`}),R?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`td`,{children:Oe(e)}),C[0]===`listingDays`&&je(e,`listingDays`),(0,U.jsx)(`td`,{children:B(`product`,e.key,e.name||`商品`)}),(0,U.jsx)(`td`,{className:Z.shopName,children:ke(e,!0)}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`button`,{className:Z.linkButton,onClick:()=>N({kind:`record`,record:e}),children:`查看`})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`button`,{className:Z.linkButton,disabled:!0,title:`需要成本与费用口径,当前未配置`,children:`测算`})})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`td`,{children:(0,U.jsxs)(`span`,{className:Z.shopId,children:[e.id||`编号缺失`,e.id&&(0,U.jsx)(`button`,{className:Z.copyButton,"aria-label":`复制店铺编号${e.id}`,onClick:()=>void Ee(e.id),children:(0,U.jsx)(m,{size:12})})]})}),(0,U.jsx)(`td`,{className:Z.shopName,children:ke(e)}),(0,U.jsx)(`td`,{children:B(`shop`,e.key,e.name||`店铺`)}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`button`,{className:Z.linkButton,onClick:()=>N({kind:`record`,record:e}),children:`查看`})}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`button`,{className:Z.linkButton,disabled:!e.id,title:e.id?`仅分析获准类目`:`缺少可追踪店铺编号`,onClick:()=>N({kind:`shopCategories`,record:e}),children:`分析`}),r&&e.id&&(0,U.jsx)(`button`,{className:Z.linkButton,onClick:()=>r({id:e.id,name:e.name||e.id},f.month),children:`归档布局`})]})]}),z.filter(e=>!R||C[0]!==`listingDays`||e!==`listingDays`).map(t=>je(e,t))]},e.key))})]}),!be.length&&(0,U.jsx)(`p`,{className:Z.empty,children:Ce===`pending`?`当前月份此类目榜单正在导入`:Ce===`missing`?`该类目暂无本月榜单,请选择其他月份或继续下钻`:`暂无匹配记录`})]}),!L&&!f.recentYear&&(0,U.jsxs)(`footer`,{className:Z.pagination,children:[(0,U.jsxs)(`span`,{children:[`共 `,K(c?.total),` 条 · 保留来源排名`]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`button`,{"aria-label":`上一页`,disabled:f.page<=1||h,onClick:()=>F({page:f.page-1}),children:(0,U.jsx)(a,{size:14})}),Array.from(new Set([1,...Array.from({length:5},(e,t)=>f.page-2+t).filter(e=>e>1&&e<we),we])).map((e,t,n)=>(0,U.jsxs)(`span`,{children:[t>0&&e-n[t-1]>1&&(0,U.jsx)(`span`,{className:Z.ellipsis,children:`…`}),(0,U.jsx)(`button`,{"aria-current":f.page===e?`page`:void 0,onClick:()=>F({page:e}),children:e})]},e)),(0,U.jsx)(`button`,{"aria-label":`下一页`,disabled:f.page>=we||h,onClick:()=>F({page:f.page+1}),children:(0,U.jsx)(o,{size:14})}),(0,U.jsx)(`select`,{"aria-label":`每页条数`,value:f.pageSize,onChange:e=>F({pageSize:Number(e.target.value)}),children:[25,50,100].map(e=>(0,U.jsxs)(`option`,{value:e,children:[e,` 条/页`]},e))}),(0,U.jsxs)(`label`,{children:[`跳至`,(0,U.jsx)(`input`,{"aria-label":`跳转页码`,type:`number`,min:`1`,max:we,defaultValue:f.page,onKeyDown:e=>{if(e.key===`Enter`){let t=Number(e.currentTarget.value);Number.isInteger(t)&&t>=1&&t<=we&&F({page:t})}}},f.page)]})]})]}),c?.notice&&(0,U.jsx)(`p`,{className:Z.notice,children:c.notice})]}),(0,U.jsxs)(`details`,{className:Z.sources,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsx)(dt,{size:13}),`数据来源与口径`]}),(0,U.jsxs)(`p`,{children:[c?.provenance.source||i?.sourceLabel||`共享市场数据库`,` ·`,` `,c?.provenance.updatedAt||`等待服务连接`]}),(0,U.jsx)(`p`,{children:c?.provenance.definition||`空值与零分别保留,按企业一级类目授权查询。`}),(0,U.jsx)(`p`,{children:`历史店铺缺少编号时仍保留榜单记录;缺少名称显示资料缺失,缺少有效链接时显示普通文本。收藏保存在当前账号下。`})]}),E&&(0,U.jsx)(kr,{columns:z,allowed:R?St:Ct,onClose:()=>te(!1),onSave:e=>{R?w(e):ee(e),te(!1)}}),M&&(0,U.jsx)(Dr,{title:M.kind===`distribution`?`件单价分布`:M.kind===`categoryTrend`?M.category.name:M.kind===`shopCategories`?`${M.record.name||`店铺`} · 品类分析`:M.record.name||`资料缺失`,onClose:()=>N(null),children:ue?(0,U.jsx)(`p`,{className:Z.notice,role:`alert`,children:ue}):ce?(0,U.jsx)(`p`,{className:Z.empty,children:`正在读取数据…`}):M.kind===`record`&&P?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:Z.detailScope,children:[f.month,` · 原榜排名 `,P.sourceRank??`—`,` ·`,` `,P.id||`编号缺失`]}),(0,U.jsx)(Ar,{points:P.trend}),(0,U.jsx)(`dl`,{className:Z.detailMetrics,children:yt.map(([e,t,n])=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:t}),(0,U.jsx)(`dd`,{children:K(P[e],n)})]},e))}),P.warnings?.map(e=>(0,U.jsx)(`p`,{className:Z.notice,children:e},e)),(0,U.jsxs)(`p`,{className:Z.detailScope,children:[`来源:`,P.source.file,` · 第 `,P.source.row,` 行`]})]}):M.kind===`categoryTrend`?(0,U.jsx)(Ar,{points:me,metric:f.metric===`units`?`units`:`sales`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:Z.detailScope,children:M.kind===`distribution`?`按当前已入库商品榜单统计,非全市场商品分布`:`仅展示获准类目的店铺指标,各层级分别列示。`}),(0,U.jsxs)(`table`,{children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:M.kind===`distribution`?`件单价区间`:`类目`}),M.kind===`distribution`&&(0,U.jsx)(`th`,{children:`商品数`}),(0,U.jsx)(`th`,{children:`销售额`})]})}),(0,U.jsx)(`tbody`,{children:fe.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.name}),M.kind===`distribution`&&(0,U.jsx)(`td`,{children:K(e.products)}),(0,U.jsx)(`td`,{children:K(e.sales,`money`)})]},e.name))})]}),!fe.length&&(0,U.jsx)(`p`,{className:Z.empty,children:`当前范围暂无可用数据`})]})})]})}function Pr(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 Fr=(e,t)=>JSON.stringify({name:e.trim()||`未命名分析`,config:t});function Ir(e){let[t,n]=y(`market.analysisDraft.`+e.id,e),r=(0,H.useRef)(t);(0,H.useEffect)(()=>{r.current=t},[t]);let i=(0,H.useRef)(t.revision),a=(0,H.useRef)(Fr(e.name,e.config)),o=(0,H.useRef)(Promise.resolve()),[s,c]=(0,H.useState)(!1),[l,u]=(0,H.useState)(``),[d,f]=(0,H.useState)(()=>Fr(e.name,e.config)),p=(0,H.useCallback)(()=>{let e=r.current,t=Fr(e.name,e.config),s=o.current.catch(()=>{}).then(async()=>{if(a.current!==t){c(!0),u(``);try{let r=await W.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=Fr(t.name,t.config);return(0,H.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 Lr(e,t=0){let n=e?new URLSearchParams(e).toString():``,r=n+`:`+t,[i,a]=(0,H.useState)({key:``,data:null,error:``});return(0,H.useEffect)(()=>{if(!n)return;let e=new AbortController;return W.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 Rr=p(),Q={root:`_root_ku7ga_1`,dialog:`_dialog_ku7ga_2`,primary:`_primary_ku7ga_4`,historyHeader:`_historyHeader_ku7ga_5`,eyebrow:`_eyebrow_ku7ga_5`,history:`_history_ku7ga_5`,panelHeading:`_panelHeading_ku7ga_5`,historyList:`_historyList_ku7ga_6`,historyIcon:`_historyIcon_ku7ga_6`,historyTitle:`_historyTitle_ku7ga_6`,emptyHistory:`_emptyHistory_ku7ga_6`,editorHeader:`_editorHeader_ku7ga_7`,inline:`_inline_ku7ga_7`,editorIdentity:`_editorIdentity_ku7ga_7`,editorTools:`_editorTools_ku7ga_7`,nameInput:`_nameInput_ku7ga_7`,saveStatus:`_saveStatus_ku7ga_7`,panel:`_panel_ku7ga_5`,horizontal:`_horizontal_ku7ga_8`,shopName:`_shopName_ku7ga_8`,summaryTable:`_summaryTable_ku7ga_8`,link:`_link_ku7ga_8`,sort:`_sort_ku7ga_8`,note:`_note_ku7ga_9`,error:`_error_ku7ga_9`,empty:`_empty_ku7ga_6`,metricBar:`_metricBar_ku7ga_10`,chartRange:`_chartRange_ku7ga_10`,chart:`_chart_ku7ga_10`,trendChart:`_trendChart_ku7ga_10`,filters:`_filters_ku7ga_11`,columnOptions:`_columnOptions_ku7ga_11`,product:`_product_ku7ga_12`,noImage:`_noImage_ku7ga_12`,categoryCell:`_categoryCell_ku7ga_12`,pagination:`_pagination_ku7ga_12`,productCards:`_productCards_ku7ga_12`,searchForm:`_searchForm_ku7ga_13`,searchResults:`_searchResults_ku7ga_13`,rangeTrack:`_rangeTrack_ku7ga_17`,rangeWindow:`_rangeWindow_ku7ga_17`,rangeHandle:`_rangeHandle_ku7ga_17`,rangeGrip:`_rangeGrip_ku7ga_17`},zr=(e,t,n)=>Math.max(t,Math.min(n,e));function Br(e,t){if(t<=0)return{start:0,size:0};let n=zr(e.size,Math.min(3,t),t);return{start:zr(e.start,0,t-n),size:n}}var Vr=e=>Br({start:0,size:24},e);function Hr(e,t){if(t<=0)return{start:0,end:0,count:0};let n=Br(e,t),r=Math.round(n.size),i=zr(Math.round(n.start),0,t-r);return{start:i,end:i+r,count:r}}var Ur=(e,t,n)=>Br({...e,start:e.start+t},n);function Wr(e,t,n,r){let i=Br(e,r),a=zr(n,0,1),o=Br({start:0,size:i.size*t},r).size;return Br({start:i.start+a*(i.size-o),size:o},r)}function Gr(e,t,n,r){let i=Br(e,r),a=Math.min(3,r);if(t===`start`){let e=i.start+i.size,t=zr(n,0,e-a);return{start:t,size:e-t}}return{...i,size:zr(n,i.start+a,r)-i.start}}function Kr(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 Wr(e,Math.exp(zr(o*.003,-1,1)),a,r)}return Ur(e,o/i*e.size,r)}function qr({view:e,total:t,onChange:n}){let r=(0,H.useRef)(null),i=(0,H.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`?Ur(r.view,a,t):Gr(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=>Gr(e,r,(r===`start`?e.start:e.start+e.size)+i,t)))}return(0,U.jsx)(`div`,{ref:r,className:Q.rangeTrack,"aria-label":`图表显示范围`,onPointerDown:a,onPointerMove:o,onPointerUp:()=>{i.current=null},onPointerCancel:()=>{i.current=null},onLostPointerCapture:()=>{i.current=null},children:(0,U.jsxs)(`div`,{className:Q.rangeWindow,"data-range-part":`pan`,style:{left:`${e.start/t*100}%`,width:`${e.size/t*100}%`},children:[(0,U.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:Q.rangeHandle,children:`Ⅱ`}),(0,U.jsx)(`span`,{className:Q.rangeGrip,"data-range-part":`pan`,"aria-hidden":`true`,children:`···`}),(0,U.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:Q.rangeHandle,children:`Ⅱ`})]})})}function Jr(e,t,n){let r=(0,H.useRef)(null),[i,a]=(0,H.useState)(()=>({scope:e,view:Vr(t)})),o=i.scope===e?Br(i.view,t):Vr(t),s=(0,H.useCallback)(n=>{a(r=>({scope:e,view:Br(n(r.scope===e?r.view:Vr(t)),t)}))},[e,t]);return(0,H.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=>Kr(e,n,r,t))}return e.addEventListener(`wheel`,i,{passive:!1}),()=>e.removeEventListener(`wheel`,i)},[n,t,s]),{plot:r,view:o,indices:Hr(o,t),update:s}}var Yr=[`#469eff`,`#34b9ac`,`#d4a25c`],Xr=[{key:`sales`,label:`销售额`,unit:`元`},{key:`marketShare`,label:`市场占有率`,unit:`%`},{key:`itemCount`,label:`链接数`,unit:`个`},{key:`efficiency`,label:`链接效率`,unit:`元/链接`},{key:`views`,label:`浏览量`,unit:`次`}],$=(e,t=2)=>e==null?`—`:e.toLocaleString(`zh-CN`,{maximumFractionDigits:t}),Zr=e=>e==null?`—`:e>=1e8?$(e/1e8)+`亿`:e>=1e4?$(e/1e4)+`万`:$(e);function Qr({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,U.jsx)(`g`,{transform:`translate(${e},${t+10}) rotate(-45)`,children:(0,U.jsx)(`text`,{textAnchor:`end`,fill:`var(--omni-muted,#91abc5)`,fontSize:10,children:i.map((e,t)=>(0,U.jsx)(`tspan`,{x:0,dy:t?12:0,children:e},t))})})}function $r({categories:e,shops:t,metric:n,onCategory:r,selectedCategory:i,selectedShop:a}){let[o,s]=(0,H.useState)(!1),{plot:c,view:l,indices:u,update:d}=Jr(e.map(e=>e.id).join(`,`),e.length,!o),{start:f,end:p,count:m}=u;function h(t){d(n=>Ur(n,t*m,e.length))}let g=Xr.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,U.jsxs)(`section`,{className:Q.panel,"aria-label":g.label+`品类对比`,children:[(0,U.jsxs)(`div`,{className:Q.panelHeading,children:[(0,U.jsxs)(`h2`,{children:[g.label,(0,U.jsxs)(`small`,{children:[g.unit,` · 点击类目筛选商品`]})]}),(0,U.jsx)(`button`,{"aria-pressed":o,onClick:()=>s(!o),children:o?`查看图表`:`数据对比`})]}),o?(0,U.jsx)(`div`,{className:Q.horizontal,children:(0,U.jsxs)(`table`,{children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`叶子类目`}),t.map((e,t)=>(0,U.jsxs)(`th`,{children:[(0,U.jsx)(`i`,{style:{background:Yr[t]}}),e.name]},e.id))]})}),(0,U.jsx)(`tbody`,{children:e.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(`button`,{className:Q.link,onClick:()=>r(e.id),children:e.name})}),t.map(t=>(0,U.jsx)(`td`,{children:$(e.shops.find(e=>e.shopId===t.id)?.[n])},t.id))]},e.id))})]})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:Q.chartRange,children:[(0,U.jsxs)(`span`,{children:[`第 `,_.length?f+1:0,`–`,p,` 项 / 共 `,_.length,` 项`]}),_.length>12&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{onClick:()=>h(-1),disabled:f===0,children:`上一组`}),(0,U.jsx)(`button`,{onClick:()=>h(1),disabled:p===_.length,children:`下一组`}),(0,U.jsx)(`button`,{"aria-pressed":m===_.length,onClick:()=>d(()=>({start:0,size:_.length})),children:`显示全部`}),(0,U.jsx)(`button`,{"aria-pressed":m===Math.min(24,_.length),onClick:()=>d(()=>Vr(_.length)),children:`紧凑视图`}),(0,U.jsx)(`span`,{children:`滚轮 / 双指滑动平移 · Ctrl+滚轮 / 双指捏合缩放`})]})]}),(0,U.jsx)(`div`,{ref:c,className:Q.chart,"aria-label":`品类图表,可滚轮平移及缩放`,children:(0,U.jsx)(we,{width:`100%`,height:`100%`,children:(0,U.jsxs)(wr,{data:v,margin:{top:12,right:18,bottom:12,left:30},barCategoryGap:`12%`,barGap:2,accessibilityLayer:!0,children:[(0,U.jsx)(Ze,{stroke:`var(--omni-line,#29445f)`,vertical:!1}),(0,U.jsx)(Ae,{dataKey:`name`,interval:0,height:145,tick:(0,U.jsx)(Qr,{})}),(0,U.jsx)(Ge,{tick:{fontSize:10,fill:`var(--omni-muted,#91abc5)`},tickFormatter:e=>n===`sales`||n===`efficiency`?Zr(e):$(e,0),width:70}),(0,U.jsx)(w,{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=>[$(typeof e==`number`?e:null)+` `+g.unit]}),(0,U.jsx)(F,{verticalAlign:`top`,height:34,wrapperStyle:{fontSize:12}}),t.map((e,t)=>(0,U.jsx)(Sr,{isAnimationActive:!1,dataKey:e.id,name:e.name,fill:Yr[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,U.jsx)(wt,{fillOpacity:i&&i===t.id&&(!a||a===e.id)?1:i?.7:1,stroke:i===t.id&&(!a||a===e.id)?`var(--omni-text,#dceaf7)`:void 0,strokeWidth:2},t.id))},e.id))]})})}),_.length>3&&(0,U.jsx)(qr,{view:l,total:_.length,onChange:d})]}),(0,U.jsx)(`p`,{className:Q.note,children:`链接效率=上榜商品销售额 ÷ 去重上榜链接数。浏览量为来源浏览次数;缺失值显示 —。`})]})}function ei({query:e,onClose:t}){let n=(0,H.useRef)(null),r=Lr({...e,view:`analysis-trend`});return(0,H.useEffect)(()=>{let e=document.activeElement;return n.current?.showModal(),()=>e?.focus()},[]),(0,Rr.createPortal)((0,U.jsxs)(`dialog`,{ref:n,className:Q.dialog,onCancel:e=>{e.preventDefault(),t()},onClick:e=>{e.target===e.currentTarget&&t()},"aria-label":`销售走势`,children:[(0,U.jsxs)(`div`,{className:Q.panelHeading,children:[(0,U.jsx)(`h2`,{children:r.data?.title||`销售走势`}),(0,U.jsx)(`button`,{autoFocus:!0,onClick:t,"aria-label":`关闭走势`,children:(0,U.jsx)(f,{size:18})})]}),r.loading?(0,U.jsx)(`p`,{role:`status`,children:`正在读取走势…`}):r.error?(0,U.jsx)(`p`,{role:`alert`,children:r.error}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:Q.trendChart,children:(0,U.jsx)(we,{width:`100%`,height:`100%`,children:(0,U.jsxs)(Ye,{data:r.data?.points,margin:{top:20,right:15,bottom:12,left:12},children:[(0,U.jsx)(Ze,{stroke:`var(--omni-line,#29445f)`,vertical:!1}),(0,U.jsx)(Ae,{dataKey:`month`,tick:{fontSize:10}}),(0,U.jsx)(Ge,{tickFormatter:Zr,tick:{fontSize:10},width:70}),(0,U.jsx)(w,{contentStyle:{background:`var(--omni-bg,#0a1524)`,border:`1px solid var(--omni-line,#29445f)`},formatter:e=>[Zr(typeof e==`number`?e:null),`销售额(元)`]}),(0,U.jsx)(L,{dataKey:`sales`,name:`销售额`,stroke:Yr[0],strokeWidth:2,dot:{r:3},connectNulls:!1})]})})}),(0,U.jsx)(`p`,{className:Q.note,children:r.data?.notice})]})]}),document.body)}var ti=[[`shop`,`店铺`],[`category`,`叶子类目`],[`sales`,`销售额`],[`salesYoy`,`销售额同比`],[`salesMom`,`销售额环比`],[`views`,`浏览量`],[`units`,`成交件数`],[`unitPrice`,`件单价`],[`marketShare`,`市占率`],[`trends`,`走势`]],ni=new Set([`sales`,`salesYoy`,`salesMom`,`views`,`units`,`unitPrice`,`marketShare`]);function ri(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 ii({row:e}){let t=ri(e.imageUrl,!0);return t?(0,U.jsx)(`img`,{src:t,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`}):(0,U.jsx)(`span`,{className:Q.noImage,children:`商品`})}function ai({config:e,layout:t,taxonomy:n,onChange:r,onTrend:i}){let[s,c]=(0,H.useState)(1),[l,d]=(0,H.useState)(e.q),[f,p]=(0,H.useState)(!1),m=[e.month,e.recentYear,e.category,e.shopFilter,e.q,e.sort,e.direction,e.shops.join(`,`)].join(`:`),[h,g]=(0,H.useState)(m),_=m===h?s:1,v=Lr({view:`analysis-items`,month:e.month,recentYear:String(e.recentYear),shops:e.shops.join(`,`),category:e.category,shopFilter:e.shopFilter,q:e.q,sort:e.sort,direction:e.direction,page:String(_),pageSize:`25`}),y=ti.filter(([t])=>e.columns.includes(t)),b=new Set(t.categories.flatMap(e=>q(n,e.id).map(e=>e.id))),x=n.filter(e=>b.has(e.id)).map(e=>({id:e.id,name:q(n,e.id).map(e=>e.name).join(` / `)})).sort((e,t)=>e.name.localeCompare(t.name,`zh-CN`));function S(t,n){i({kind:n,product:t.id,category:t.categoryId,shops:e.shops.join(`,`),shopFilter:t.shopId,month:e.month})}function C(e,t){if(t===`shop`)return e.shopName;if(t===`category`)return q(n,e.categoryId).map(e=>e.name).join(` / `)||e.categoryName;if(t===`trends`)return(0,U.jsxs)(`span`,{className:Q.inline,children:[(0,U.jsx)(`button`,{className:Q.link,onClick:()=>S(e,`product`),children:`商品`}),(0,U.jsx)(`button`,{className:Q.link,onClick:()=>S(e,`category`),children:`类目`})]});let r=e[t];return typeof r==`number`?t===`sales`||t===`unitPrice`?Zr(r):[`salesYoy`,`salesMom`,`marketShare`].includes(t)?$(r)+`%`:$(r,0):`—`}let w=e=>(0,U.jsxs)(`div`,{className:Q.product,children:[(0,U.jsx)(ii,{row:e}),(0,U.jsxs)(`div`,{children:[ri(e.url)?(0,U.jsx)(`a`,{href:ri(e.url),target:`_blank`,rel:`noreferrer`,children:e.name}):(0,U.jsx)(`b`,{children:e.name}),(0,U.jsxs)(`small`,{children:[`ID `,e.id,` · 原榜 `,e.sourceRank==null?`—`:`#`+e.sourceRank,e.conflicting?` · 指标冲突,保留为空`:``]})]})]});return(0,U.jsxs)(`section`,{className:Q.panel,"aria-label":`上榜商品链接列表`,children:[(0,U.jsxs)(`div`,{className:Q.panelHeading,children:[(0,U.jsxs)(`h2`,{children:[`上榜商品链接`,(0,U.jsxs)(`small`,{children:[$(v.data?.total,0),` 条`]})]}),(0,U.jsxs)(`div`,{className:Q.inline,children:[(0,U.jsx)(`button`,{"aria-label":`商品大图`,"aria-pressed":e.productView===`grid`,onClick:()=>r({productView:`grid`}),children:(0,U.jsx)(ut,{size:14})}),(0,U.jsx)(`button`,{"aria-label":`商品列表`,"aria-pressed":e.productView===`list`,onClick:()=>r({productView:`list`}),children:(0,U.jsx)(ft,{size:14})}),(0,U.jsxs)(`button`,{"aria-expanded":f,onClick:()=>p(!f),children:[(0,U.jsx)(mt,{size:14}),`表格配置`]})]})]}),(0,U.jsxs)(`div`,{className:Q.filters,children:[(0,U.jsxs)(`label`,{children:[`类目`,(0,U.jsxs)(`select`,{"aria-label":`上榜商品类目筛选`,value:b.has(e.category)?e.category:``,onChange:e=>r({category:e.target.value}),children:[(0,U.jsx)(`option`,{value:``,children:`全部上榜类目`}),x.map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,U.jsxs)(`label`,{children:[`店铺`,(0,U.jsxs)(`select`,{"aria-label":`上榜商品店铺筛选`,value:e.shopFilter,onChange:e=>r({shopFilter:e.target.value}),children:[(0,U.jsx)(`option`,{value:``,children:`全部对比店铺`}),t.shops.map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,U.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),r({q:l.trim()})},children:[(0,U.jsx)(u,{size:14}),(0,U.jsx)(`input`,{"aria-label":`搜索上榜商品`,value:l,onChange:e=>d(e.target.value),placeholder:`商品名称 / ID`,maxLength:100}),(0,U.jsx)(`button`,{type:`submit`,children:`搜索`})]}),e.category&&(0,U.jsx)(`button`,{className:Q.link,onClick:()=>r({category:``}),children:`清除类目筛选`})]}),f&&(0,U.jsxs)(`fieldset`,{className:Q.columnOptions,children:[(0,U.jsx)(`legend`,{children:`显示字段`}),ti.map(([t,n])=>(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.columns.includes(t),onChange:n=>r({columns:n.target.checked?[...e.columns,t]:e.columns.filter(e=>e!==t)})}),n]},t))]}),v.loading?(0,U.jsx)(`div`,{className:Q.empty,role:`status`,children:`正在读取上榜商品…`}):v.error?(0,U.jsx)(`div`,{className:Q.error,role:`alert`,children:v.error}):v.data?.rows.length?e.productView===`grid`?(0,U.jsx)(`div`,{className:Q.productCards,children:v.data.rows.map(e=>(0,U.jsxs)(`article`,{children:[w(e),(0,U.jsx)(`dl`,{children:y.map(([t,n])=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:n}),(0,U.jsx)(`dd`,{children:C(e,t)})]},t))})]},`${e.shopId}:${e.categoryId}:${e.id}`))}):(0,U.jsx)(`div`,{className:Q.horizontal,children:(0,U.jsxs)(`table`,{children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`序号`}),(0,U.jsx)(`th`,{children:`商品`}),y.map(([t,n])=>(0,U.jsx)(`th`,{children:ni.has(t)?(0,U.jsxs)(`button`,{className:Q.sort,onClick:()=>r({sort:t,direction:e.sort===t&&e.direction===`desc`?`asc`:`desc`}),children:[n,e.sort===t&&(e.direction===`desc`?(0,U.jsx)(ct,{size:12}):(0,U.jsx)(lt,{size:12}))]}):n},t))]})}),(0,U.jsx)(`tbody`,{children:v.data.rows.map((e,t)=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:(v.data.page-1)*25+t+1}),(0,U.jsx)(`td`,{children:w(e)}),y.map(([t])=>(0,U.jsx)(`td`,{className:t===`category`?Q.categoryCell:void 0,children:C(e,t)},t))]},`${e.shopId}:${e.categoryId}:${e.id}`))})]})}):(0,U.jsx)(`div`,{className:Q.empty,children:`当前筛选下暂无已完成入库的上榜商品。`}),v.data&&(0,U.jsxs)(`div`,{className:Q.pagination,children:[(0,U.jsx)(`span`,{children:v.data.notice}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`button`,{"aria-label":`上榜商品上一页`,disabled:v.data.page<=1,onClick:()=>{g(m),c(v.data.page-1)},children:(0,U.jsx)(a,{size:15})}),(0,U.jsxs)(`span`,{children:[v.data.page,` / `,Math.max(1,Math.ceil(v.data.total/25))]}),(0,U.jsx)(`button`,{"aria-label":`上榜商品下一页`,disabled:v.data.page*25>=v.data.total,onClick:()=>{g(m),c(v.data.page+1)},children:(0,U.jsx)(o,{size:15})})]})]})]})}function oi({month:e,selected:t,onAdd:n,onClose:r}){let[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(``),l=(0,H.useRef)(null),d=(0,H.useRef)(null),p=Lr(o?{view:`shop-search`,month:e,q:o}:null);return(0,H.useEffect)(()=>{let e=document.activeElement;return l.current?.showModal(),d.current?.focus(),()=>e?.focus()},[]),(0,U.jsxs)(`dialog`,{ref:l,className:Q.dialog,onCancel:e=>{e.preventDefault(),r()},onClick:e=>{e.target===e.currentTarget&&r()},"aria-label":`添加对比店铺`,children:[(0,U.jsxs)(`div`,{className:Q.panelHeading,children:[(0,U.jsx)(`h2`,{children:`添加对比店铺`}),(0,U.jsx)(`button`,{"aria-label":`关闭店铺搜索`,onClick:r,children:(0,U.jsx)(f,{size:18})})]}),(0,U.jsx)(`p`,{className:Q.note,children:`最多对比 3 家店铺,搜索范围为企业获准类目。`}),(0,U.jsxs)(`form`,{className:Q.searchForm,onSubmit:e=>{e.preventDefault(),s(i.trim())},children:[(0,U.jsx)(u,{size:16}),(0,U.jsx)(`input`,{ref:d,"aria-label":`搜索对比店铺`,value:i,onChange:e=>a(e.target.value),maxLength:100,placeholder:`输入店铺名称或店铺 ID`}),(0,U.jsx)(`button`,{type:`submit`,disabled:!i.trim()||p.loading,children:`搜索`})]}),p.loading?(0,U.jsx)(`p`,{role:`status`,children:`正在搜索店铺…`}):p.error?(0,U.jsx)(`p`,{role:`alert`,className:Q.error,children:p.error}):o&&(0,U.jsx)(`div`,{className:Q.searchResults,children:p.data?.shops.length?p.data.shops.map(e=>(0,U.jsxs)(`button`,{disabled:t.includes(e.id),onClick:()=>n(e),children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`b`,{children:e.name}),(0,U.jsxs)(`small`,{children:[`ID `,e.id]})]}),t.includes(e.id)?`已添加`:(0,U.jsx)(c,{size:16})]},e.id)):(0,U.jsx)(`p`,{children:`当前月份未找到匹配店铺,可尝试店铺编号或其他月份。`})})]})}function si({analysis:e,bootstrap:r,onBack:i}){let s=Ir(e),d=s.config,[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(0),[_,v]=(0,H.useState)(null),[y,b]=(0,H.useState)(!1),x=Lr(d.shops.length?{view:`shop-layout`,month:d.month,recentYear:String(d.recentYear),shops:d.shops.join(`,`)}:null,h),S=x.data,C=S?.categories.map(e=>({...e,name:q(r.categories,e.id).map(e=>e.name).join(` / `)||e.name}))||[],w=r.months.indexOf(d.month);async function T(){b(!0);try{await s.flush(),i()}catch{b(!1)}}function ee(e){v({kind:`shop`,month:d.month,shops:d.shops.join(`,`),shopFilter:e.id})}return(0,U.jsxs)(`div`,{className:Q.root,children:[(0,U.jsxs)(`header`,{className:Q.editorHeader,children:[(0,U.jsxs)(`div`,{className:Q.editorIdentity,children:[(0,U.jsx)(`button`,{"aria-label":`返回我的分析`,onClick:()=>void T(),disabled:y,children:(0,U.jsx)(t,{size:16})}),(0,U.jsx)(`input`,{"aria-label":`分析名称`,className:Q.nameInput,value:s.name,maxLength:80,onChange:e=>s.setName(e.target.value),onBlur:()=>void s.flush().catch(()=>{})}),(0,U.jsx)(`span`,{className:Q.saveStatus,role:`status`,children:s.error?`保存失败`:s.saving?`保存中…`:s.dirty?`待保存`:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(n,{size:12}),`已自动保存`]})})]}),(0,U.jsxs)(`div`,{className:Q.editorTools,children:[(0,U.jsx)(`button`,{"aria-pressed":d.recentYear,onClick:()=>s.change({recentYear:!d.recentYear}),children:`最近一年`}),(0,U.jsx)(`button`,{"aria-label":`上一数据月份`,disabled:w<=0,onClick:()=>s.change({month:r.months[w-1]}),children:(0,U.jsx)(a,{size:15})}),(0,U.jsx)(`select`,{"aria-label":`分析统计月份`,value:d.month,onChange:e=>s.change({month:e.target.value}),children:r.months.map(e=>(0,U.jsx)(`option`,{children:e},e))}),(0,U.jsx)(`button`,{"aria-label":`下一数据月份`,disabled:w<0||w>=r.months.length-1,onClick:()=>s.change({month:r.months[w+1]}),children:(0,U.jsx)(o,{size:15})}),(0,U.jsx)(`button`,{onClick:()=>void T(),disabled:y,children:`我的分析`}),(0,U.jsx)(`button`,{"aria-label":`刷新分析数据`,onClick:()=>g(e=>e+1),children:(0,U.jsx)(l,{size:15})})]})]}),s.error&&(0,U.jsxs)(`p`,{role:`alert`,className:Q.error,children:[s.error,(0,U.jsx)(`button`,{onClick:()=>void s.flush().catch(()=>{}),children:`重试保存`})]}),(0,U.jsxs)(`section`,{className:Q.panel,"aria-label":`分析店铺汇总`,children:[(0,U.jsxs)(`div`,{className:Q.panelHeading,children:[(0,U.jsxs)(`h2`,{children:[`品类分析`,(0,U.jsxs)(`small`,{children:[d.shops.length,` / 3 家店铺 · `,d.recentYear?`近 12 个月`:`所选月份`]})]}),d.shops.length<3&&(0,U.jsxs)(`button`,{className:Q.primary,onClick:()=>m(!0),children:[(0,U.jsx)(c,{size:15}),`添加对比店铺`]})]}),d.shops.length?x.loading?(0,U.jsx)(`p`,{role:`status`,className:Q.empty,children:`正在查询店铺品类数据…`}):x.error?(0,U.jsx)(`p`,{role:`alert`,className:Q.error,children:x.error}):S&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:Q.horizontal,children:(0,U.jsxs)(`table`,{className:Q.summaryTable,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`店铺`}),(0,U.jsx)(`th`,{children:`销售走势`}),(0,U.jsx)(`th`,{children:`所在地`}),(0,U.jsx)(`th`,{children:`类型`}),(0,U.jsx)(`th`,{children:`店铺上榜销售额`}),(0,U.jsx)(`th`,{children:`上榜链接销售额`}),(0,U.jsx)(`th`,{children:`上榜叶子类目`}),(0,U.jsx)(`th`,{children:`上榜商品链接`}),(0,U.jsx)(`th`,{})]})}),(0,U.jsx)(`tbody`,{children:S.shops.map((e,t)=>(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{children:[(0,U.jsxs)(`div`,{className:Q.shopName,children:[(0,U.jsx)(`i`,{style:{background:Yr[t]}}),(0,U.jsx)(`b`,{children:e.name})]}),(0,U.jsxs)(`small`,{children:[`ID `,e.id,d.recentYear?` · 店铺榜覆盖 ${e.availableMonths} 个月`:``]})]}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`button`,{className:Q.link,onClick:()=>ee(e),children:`查看`})}),(0,U.jsx)(`td`,{children:e.location||`—`}),(0,U.jsx)(`td`,{children:e.shopType||`—`}),(0,U.jsx)(`td`,{children:Zr(e.summary.sales)}),(0,U.jsx)(`td`,{children:Zr(e.summary.productSales)}),(0,U.jsx)(`td`,{children:e.categoryCount}),(0,U.jsx)(`td`,{children:$(e.summary.itemCount,0)}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`button`,{"aria-label":`移除${e.name}`,onClick:()=>s.change({shops:d.shops.filter(t=>t!==e.id),category:``,shopFilter:``}),children:(0,U.jsx)(f,{size:14})})})]},e.id))})]})}),(0,U.jsx)(`p`,{className:Q.note,children:S.notice})]}):(0,U.jsxs)(`div`,{className:Q.empty,children:[(0,U.jsx)(u,{size:28}),(0,U.jsx)(`h3`,{children:`从一家店铺开始分析`}),(0,U.jsx)(`p`,{children:`添加店铺后查看上榜销售表现、品类布局和商品链接。`}),(0,U.jsx)(`button`,{className:Q.primary,onClick:()=>m(!0),children:`添加首家店铺`})]})]}),S&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:Q.metricBar,role:`group`,"aria-label":`品类对比指标`,children:[Xr.map(e=>(0,U.jsx)(`button`,{"aria-pressed":d.metric===e.key,onClick:()=>s.change({metric:e.key}),children:e.label},e.key)),(0,U.jsxs)(`span`,{children:[C.length,` 个上榜叶子类目`]})]}),C.length?(0,U.jsx)($r,{categories:C,shops:S.shops,metric:d.metric,selectedCategory:d.category,selectedShop:d.shopFilter,onCategory:(e,t)=>s.change({category:e,shopFilter:t||``})},d.shops.join(`,`)+d.month+d.recentYear):(0,U.jsx)(`div`,{className:Q.empty,children:`所选月份及权限范围内暂无可展示的上榜叶子类目。`}),(0,U.jsx)(ai,{config:d,layout:S,taxonomy:r.categories,onChange:s.change,onTrend:v})]}),p&&(0,U.jsx)(oi,{month:d.month,selected:d.shops,onClose:()=>m(!1),onAdd:e=>{s.change({shops:[...d.shops,e.id],category:``,shopFilter:``}),s.name===`未命名分析`&&s.setName(e.name+`品类分析`),m(!1)}}),_&&(0,U.jsx)(ei,{query:_,onClose:()=>v(null)})]})}function ci({launch:t,onConsumeLaunch:n}){let[i,a]=(0,H.useState)(null),[o,l]=(0,H.useState)([]),[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(!0),[m,h]=(0,H.useState)(``),[g,_]=(0,H.useState)(!1),[v,y]=(0,H.useState)(0),b=(0,H.useRef)(``);(0,H.useEffect)(()=>{let e=new AbortController;return Promise.all([W.bootstrap(e.signal),W.analyses(e.signal)]).then(([t,n])=>{e.signal.aborted||(a(t),l(n.analyses),h(``),p(!1))}).catch(t=>{e.signal.aborted||(h(t instanceof Error?t.message:`分析记录读取失败`),p(!1))}),()=>e.abort()},[v]),(0,H.useEffect)(()=>{if(!t||!i||b.current===t.id)return;b.current=t.id;let e={...Pr(t.month),shops:[t.shop.id]};W.saveAnalysis({id:t.id,name:t.shop.name+`品类分析`,config:e,revision:0}).then(e=>{d(e),n?.()}).catch(e=>h(e instanceof Error?e.message:`创建分析失败`))},[t,i,n]);async function x(){if(!(!i?.latestMonth||g)){_(!0),h(``);try{d(await W.saveAnalysis({id:crypto.randomUUID(),name:`未命名分析`,config:Pr(i.latestMonth),revision:0}))}catch(e){h(e instanceof Error?e.message:`创建分析失败`)}finally{_(!1)}}}return u&&i?(0,U.jsx)(si,{analysis:u,bootstrap:i,onBack:()=>{d(null),y(e=>e+1)}},u.id):(0,U.jsxs)(`main`,{className:Q.root,children:[(0,U.jsxs)(`header`,{className:Q.historyHeader,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:Q.eyebrow,children:`市场大盘 / 我的分析`}),(0,U.jsx)(`h1`,{children:`店铺品类布局`}),(0,U.jsx)(`p`,{children:`从历史分析继续,或新建一份店铺对比。`})]}),(0,U.jsxs)(`button`,{className:Q.primary,onClick:()=>void x(),disabled:f||g||!i?.latestMonth,children:[(0,U.jsx)(c,{size:16}),g?`正在创建…`:`新建分析`]})]}),m&&(0,U.jsxs)(`div`,{className:Q.error,role:`alert`,children:[m,(0,U.jsx)(`button`,{onClick:()=>y(e=>e+1),children:`重新读取`})]}),(0,U.jsxs)(`section`,{className:Q.history,"aria-label":`历史分析记录`,children:[(0,U.jsxs)(`div`,{className:Q.panelHeading,children:[(0,U.jsxs)(`h2`,{children:[(0,U.jsx)(s,{size:16}),`历史分析`,(0,U.jsxs)(`small`,{children:[o.length,` 份`]})]}),(0,U.jsx)(`span`,{className:Q.note,children:`方案按当前账号自动保存`})]}),f?(0,U.jsx)(`p`,{role:`status`,className:Q.empty,children:`正在读取历史分析…`}):o.length?(0,U.jsx)(`div`,{className:Q.historyList,children:o.map(t=>(0,U.jsxs)(`button`,{onClick:()=>d(t),children:[(0,U.jsx)(`span`,{className:Q.historyIcon,children:(0,U.jsx)(e,{size:21})}),(0,U.jsxs)(`span`,{className:Q.historyTitle,children:[(0,U.jsx)(`b`,{children:t.name}),(0,U.jsxs)(`small`,{children:[t.config.month,` · `,t.config.recentYear?`近一年 · `:``,t.config.shops.length?`${t.config.shops.length} 家店铺`:`尚未添加店铺`,` · `,Xr.find(e=>e.key===t.config.metric)?.label]})]}),(0,U.jsx)(`time`,{children:new Date(t.updatedAt).toLocaleString(`zh-CN`,{timeZone:`Asia/Shanghai`,hour12:!1})}),(0,U.jsx)(r,{size:16})]},t.id))}):!m&&(0,U.jsxs)(`div`,{className:Q.emptyHistory,children:[(0,U.jsx)(e,{size:35}),(0,U.jsx)(`h3`,{children:`还没有历史分析`}),(0,U.jsx)(`p`,{children:`新建分析后添加店铺,逐步查看品类和上榜商品。`})]})]})]})}var li={home:`_home_12rl6_1`,top:`_top_12rl6_2`,panel:`_panel_12rl6_6`,row:`_row_12rl6_7`,empty:`_empty_12rl6_9`};function ui({onOpen:e}){let[t,n]=(0,H.useState)(null),[r,i]=(0,H.useState)({}),[a,o]=(0,H.useState)(``),[s,c]=(0,H.useState)(0);return(0,H.useEffect)(()=>{let e=new AbortController;return W.bootstrap(e.signal).then(async t=>{if(e.signal.aborted)return;n(t),o(``);let r=(t.favorites||[]).filter(e=>e.kind!==`category`),a={};for(let t=0;t<r.length;t+=6)if(await Promise.all(r.slice(t,t+6).map(async t=>{try{a[t.key]=await W.record(t.key,e.signal)}catch{}})),e.signal.aborted)return;i(a)}).catch(()=>{e.signal.aborted||o(`市场关注读取失败,请重试`)}),()=>e.abort()},[s]),(0,U.jsxs)(`div`,{className:li.home,children:[(0,U.jsxs)(`div`,{className:li.top,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{children:`我的市场关注`}),(0,U.jsx)(`p`,{children:`当前账号收藏的类目、商品和店铺`})]}),(0,U.jsx)(`button`,{onClick:()=>c(e=>e+1),children:`刷新关注`})]}),a&&(0,U.jsx)(`p`,{role:`alert`,children:a}),(0,U.jsxs)(`section`,{className:li.panel,children:[!t&&!a&&(0,U.jsx)(`p`,{role:`status`,children:`正在读取关注…`}),t&&!t.favorites?.length&&(0,U.jsx)(`p`,{className:li.empty,children:`在类目、商品或店铺旁点击收藏,即可在这里快速查看。`}),t?.favorites?.map(n=>{let i=t.categories.find(e=>e.id===n.key),a=r[n.key],o=n.kind===`category`?i?.id:a?.categoryId;return(0,U.jsxs)(`button`,{className:li.row,disabled:!o,onClick:()=>e({categoryId:o,view:n.kind===`category`?i?.leaf?`products`:`categories`:n.kind===`shop`?`shops`:`products`}),children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`b`,{children:n.kind===`category`?i?.name||`类目已不可用`:a?.name||`记录读取中或已不可用`}),(0,U.jsx)(`small`,{children:n.kind===`category`&&i?q(t.categories,i.id).map(e=>e.name).join(` › `):n.kind===`shop`?`店铺收藏`:`商品收藏`})]}),(0,U.jsx)(`span`,{children:`打开 →`})]},n.kind+n.key)})]})]})}function di({section:e,onSection:t}){let[n,r]=y(`market.analysisLaunch`,null),[i,a]=(0,H.useState)();return e===`shop-layout`?(0,U.jsx)(ci,{launch:n,onConsumeLaunch:()=>r(null)}):e===`favorites`?(0,U.jsx)(ui,{onOpen:e=>{a(e),t(e.view)}}):(0,U.jsx)(Nr,{onShopLayout:(e,n)=>{r({id:crypto.randomUUID(),shop:e,month:n}),t(`shop-layout`)},view:[`categories`,`products`,`shops`].find(t=>t===e)||`categories`,selection:i,onViewChange:e=>t(e,{replace:!0})})}export{di as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._home_fjsdx_1{max-width:1600px;color:var(--omni-text,var(--omni-paint-ink-dbe8f5,#dbe8f5));margin:0 auto}._top_fjsdx_2{justify-content:space-between;align-items:center;gap:24px;margin-bottom:22px;display:flex}._home_fjsdx_1 h1{letter-spacing:.5px;margin:8px 0;font-size:27px}._home_fjsdx_1 p{color:var(--omni-muted,var(--omni-paint-ink-91abc5,#91abc5));margin:6px 0;font-size:12px;line-height:1.8}._eyebrow_fjsdx_5{color:var(--omni-accent,var(--omni-paint-ink-61d6f1,#61d6f1));letter-spacing:1.3px;font-size:11px}._home_fjsdx_1 button{font:inherit;color:var(--omni-text,var(--omni-paint-ink-dbe8f5,#dbe8f5));border:1px solid var(--omni-line,var(--omni-paint-line-294468,#294468));text-align:left;cursor:pointer;background:0 0;border-radius:6px;align-items:center;gap:8px;padding:8px 12px;font-size:12px;display:inline-flex}._home_fjsdx_1 button:hover{border-color:var(--omni-accent,var(--omni-paint-line-61d6f1,#61d6f1));background:var(--omni-field,var(--omni-paint-surface-10243c,#10243c))}._home_fjsdx_1 button:focus-visible{outline:2px solid var(--omni-accent,var(--omni-paint-line-61d6f1,#61d6f1));outline-offset:3px}._search_fjsdx_9{border:1px solid var(--omni-line,var(--omni-paint-line-294468,#294468));background:var(--omni-field,var(--omni-paint-surface-10243c,#10243c));border-radius:8px;align-items:center;gap:10px;width:320px;max-width:100%;margin:0;padding:0 12px;display:flex}._home_fjsdx_1 ._search_fjsdx_9 input{min-width:0;color:inherit;background:0 0;border:0;outline:0;margin:0;padding:10px 0;font-size:12px}._resume_fjsdx_11{border:1px solid var(--omni-line,var(--omni-paint-line-315775,#315775));background:linear-gradient(110deg,var(--omni-panel,var(--omni-paint-surface-173650,#173650)),var(--omni-bg,var(--omni-paint-surface-0a1729,#0a1729)));border-radius:12px;justify-content:space-between;align-items:center;gap:20px;margin-bottom:18px;padding:22px 26px;display:flex}._home_fjsdx_1 h2{margin:0 0 12px;font-size:15px;font-weight:600}._resume_fjsdx_11 h2{margin:8px 0;font-size:20px}._resume_fjsdx_11>button{background:var(--omni-panel,var(--omni-paint-surface-173650,#173650));flex-shrink:0}._grid_fjsdx_15{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:18px;display:grid}._panel_fjsdx_16{border:1px solid var(--omni-line,var(--omni-paint-line-294468,#294468));background:var(--omni-panel,var(--omni-paint-surface-102239,#102239));border-radius:10px;min-width:0;padding:20px 22px}._heading_fjsdx_17{justify-content:space-between;align-items:center;gap:14px;margin-bottom:8px;display:flex}._heading_fjsdx_17 h2{margin:0}._heading_fjsdx_17>span{color:var(--omni-muted,var(--omni-paint-ink-91abc5,#91abc5));font-size:11px}._heading_fjsdx_17>button{padding:5px 8px;font-size:11px}._home_fjsdx_1 ._row_fjsdx_21{border:0;border-bottom:1px solid var(--omni-line,var(--omni-paint-line-294468,#294468));border-radius:0;justify-content:space-between;align-items:center;gap:14px;width:100%;padding:13px 0;display:flex}._row_fjsdx_21>span{min-width:0}._row_fjsdx_21 b{overflow-wrap:anywhere;font-size:12px;font-weight:500}._row_fjsdx_21 small,._visit_fjsdx_22 small{color:var(--omni-muted,var(--omni-paint-ink-91abc5,#91abc5));margin-top:5px;font-size:11px;line-height:1.6;display:block}._row_fjsdx_21 svg{color:var(--omni-muted,var(--omni-paint-ink-91abc5,#91abc5));flex-shrink:0}._home_fjsdx_1 ._empty_fjsdx_24{color:var(--omni-muted,var(--omni-paint-ink-91abc5,#91abc5));padding:18px 0;font-size:12px}._shortcuts_fjsdx_25{grid-template-columns:1fr 1fr;gap:10px;display:grid}._shortcuts_fjsdx_25 button{gap:10px;padding:13px}._shortcuts_fjsdx_25 svg:first-child{color:var(--omni-accent,var(--omni-paint-ink-61d6f1,#61d6f1))}._shortcuts_fjsdx_25 svg:last-child{margin-left:auto}._visit_fjsdx_22{border-bottom:1px solid var(--omni-line,var(--omni-paint-line-294468,#294468));align-items:center;gap:8px;display:flex}._visit_fjsdx_22>button:first-child{border:0;flex:1;min-width:0;padding:14px 0}._visit_fjsdx_22 span{flex:1;min-width:0}._visit_fjsdx_22 b{overflow-wrap:anywhere;font-size:12px;font-weight:500}._visit_fjsdx_22>button:last-child{padding:7px}._visit_fjsdx_22 button[aria-pressed=true]{color:var(--omni-accent,var(--omni-paint-ink-61d6f1,#61d6f1))}._error_fjsdx_29{border:1px solid var(--omni-paint-line-a57b48,#a57b48);color:var(--omni-paint-danger-e3bb83,#e3bb83);border-radius:8px;justify-content:space-between;align-items:center;margin:12px 0;padding:12px 16px;font-size:12px;display:flex}@media (width<=1100px){._top_fjsdx_2{flex-direction:column;align-items:flex-start;gap:12px}._grid_fjsdx_15{grid-template-columns:1fr}._search_fjsdx_9{width:100%}}@media (width<=650px){._resume_fjsdx_11{flex-direction:column;align-items:flex-start;padding:18px}._panel_fjsdx_16{padding:16px}._home_fjsdx_1 h1{font-size:23px}}:root[data-omni-theme=light]{--omni-paint-ink-dbe8f5:#252831;--omni-paint-ink-91abc5:#626e80;--omni-paint-ink-61d6f1:#626e80;--omni-paint-line-294468:#dde1eb;--omni-paint-line-61d6f1:#dde1eb;--omni-paint-surface-10243c:#fff;--omni-paint-line-315775:#dde1eb;--omni-paint-surface-173650:#fff;--omni-paint-surface-0a1729:#f5f6fa;--omni-paint-surface-102239:#fff;--omni-paint-line-a57b48:#dde1eb;--omni-paint-danger-e3bb83:#b83a4a}:root[data-omni-theme=dark]{--omni-paint-ink-dbe8f5:#dceaf7;--omni-paint-ink-91abc5:#91a9bd;--omni-paint-ink-61d6f1:#91a9bd;--omni-paint-line-294468:#2c435b;--omni-paint-line-61d6f1:#2c435b;--omni-paint-surface-10243c:#102235;--omni-paint-line-315775:#2c435b;--omni-paint-surface-173650:#102235;--omni-paint-surface-0a1729:#0b1727;--omni-paint-surface-102239:#102235;--omni-paint-line-a57b48:#2c435b;--omni-paint-danger-e3bb83:#ff8996}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./arrow-right-Bsei-31a.js";import{t}from"./chart-column-Dlmnr1y9.js";import{t as n}from"./clock-3-B99KnTzW.js";import{t as r}from"./git-branch-Cv69GSy-.js";import{t as i}from"./layers-BaGSABxV.js";import{t as a}from"./search-I3gdKVV9.js";import{p as o,r as s,s as c,u as l}from"./index-CDS2fIqN.js";import{n as u}from"./module-host-BzwOcfIf.js";import{n as d}from"./workspace-view-state-C1Tia7X4.js";import"./public-DTqkVQos.js";import{t as f}from"./activity-Cj90ZCJa.js";var p=c(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),m=c(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),h=o(l(),1);async function g(e){let t=await Promise.allSettled([e(`/command-center`),e(`/growth-center`)]),n=[],r=[],i=[],a=t[0],o=t[1];if(a.status===`fulfilled`){let e=a.value?.projects;Array.isArray(e)?r=e.filter(e=>!e.simulated):n.push(`项目状态返回格式异常`)}else n.push(`项目状态读取失败,请重试`);if(o.status===`fulfilled`){let e=o.value?.catalog;Array.isArray(e)?i=e.filter(e=>e.mode!==`simulated`):n.push(`资料目录返回格式异常`)}else n.push(`资料目录读取失败,请重试`);return{projects:r,datasets:i,errors:n}}var _={home:`_home_fjsdx_1`,top:`_top_fjsdx_2`,eyebrow:`_eyebrow_fjsdx_5`,search:`_search_fjsdx_9`,resume:`_resume_fjsdx_11`,grid:`_grid_fjsdx_15`,panel:`_panel_fjsdx_16`,heading:`_heading_fjsdx_17`,row:`_row_fjsdx_21`,visit:`_visit_fjsdx_22`,empty:`_empty_fjsdx_24`,shortcuts:`_shortcuts_fjsdx_25`,error:`_error_fjsdx_29`},v=s(),y=e=>Number.isFinite(Date.parse(e))?new Date(e).toLocaleString(`zh-CN`,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}):`时间未标注`;function b({mode:o,api:s,visits:c,pins:l,onPin:u,onGo:b,onOpen:x,onModule:S,onCreate:C}){let[w,T]=(0,h.useState)([]),[E,D]=(0,h.useState)([]),[O,k]=(0,h.useState)([]),[A,j]=(0,h.useState)(!0),[M,N]=(0,h.useState)(0),[P,F]=d(`home.search`,``);(0,h.useEffect)(()=>{let e=!0;return g(s).then(t=>{e&&(T(t.projects),D(t.datasets),k(t.errors),j(!1))}),()=>{e=!1}},[s,M]);let I=e=>e.toLowerCase().includes(P.trim().toLowerCase()),L=[...w].sort((e,t)=>t.updated.localeCompare(e.updated)).filter(e=>I(e.name)),R=[...E].sort((e,t)=>t.created.localeCompare(e.created)).filter(e=>I(e.title+e.projectName)),z=f(w),B={recent:`最近访问`,favorites:`我的收藏`}[o]||`从这里开始今天的工作`;function V(t){return t.length?(0,v.jsx)(`div`,{className:_.rows,children:t.filter(e=>I(e.title)).map(t=>{let r=l.some(e=>e.key===t.key);return(0,v.jsxs)(`div`,{className:_.visit,children:[(0,v.jsxs)(`button`,{onClick:()=>b(t.route),children:[(0,v.jsx)(n,{size:17}),(0,v.jsxs)(`span`,{children:[(0,v.jsx)(`b`,{children:t.title}),(0,v.jsx)(`small`,{children:y(t.at)})]}),(0,v.jsx)(e,{size:16})]}),(0,v.jsx)(`button`,{"aria-label":`${r?`取消固定`:`固定`}${t.title}`,"aria-pressed":r,onClick:()=>u(t),children:(0,v.jsx)(m,{size:16})})]},t.key)})}):(0,v.jsx)(`p`,{className:_.empty,children:o===`favorites`?`在最近访问中固定常用页面,即可在这里快速进入。`:`打开市场、商品、项目或资料后,这里会保留本次登录的访问位置。`})}let H=(0,v.jsxs)(`section`,{className:_.panel,children:[(0,v.jsxs)(`div`,{className:_.heading,children:[(0,v.jsx)(`h2`,{children:`需要你处理`}),(0,v.jsx)(`span`,{children:A?`读取中`:`${z.length} 项`})]}),z.slice(0,5).map(({project:t,step:n})=>(0,v.jsxs)(`button`,{className:_.row,onClick:()=>x(t.id,n.target),children:[(0,v.jsxs)(`span`,{children:[(0,v.jsxs)(`b`,{children:[n.name,` · `,n.state===`attention`?`待复核`:`待确认`]}),(0,v.jsxs)(`small`,{children:[t.name,` · `,n.description]})]}),(0,v.jsx)(e,{size:16})]},t.id+n.id)),!A&&!z.length&&(0,v.jsx)(`p`,{className:_.empty,children:O.length?`连接恢复后显示待处理事项。`:`当前没有待复核或待确认的阶段。`})]});return(0,v.jsxs)(`div`,{className:_.home,children:[(0,v.jsxs)(`div`,{className:_.top,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:_.eyebrow,children:`山海 · OMNI`}),(0,v.jsx)(`h1`,{children:B}),(0,v.jsx)(`p`,{children:`连接市场机会、经营行动与项目资料`})]}),(0,v.jsxs)(`label`,{className:_.search,children:[(0,v.jsx)(a,{size:17}),(0,v.jsx)(`input`,{"aria-label":`搜索首页项目、资料和访问记录`,value:P,onChange:e=>F(e.target.value),placeholder:`查找项目、资料或访问记录`})]})]}),O.length>0&&(0,v.jsxs)(`div`,{role:`alert`,className:_.error,children:[O.join(`;`),(0,v.jsx)(`button`,{onClick:()=>{j(!0),N(e=>e+1)},children:`重试`})]}),A&&(0,v.jsx)(`p`,{role:`status`,className:_.empty,children:`正在读取当前账号的项目与资料…`}),o===`recent`||o===`favorites`?(0,v.jsx)(`section`,{className:_.panel,children:V(o===`recent`?c:l)}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`section`,{className:_.resume,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:_.eyebrow,children:`继续上次工作`}),(0,v.jsx)(`h2`,{children:c[0]?.title||`选择一个入口,开始你的工作`}),(0,v.jsx)(`p`,{children:c[0]?`${c[0].moduleLabel} · ${y(c[0].at)}`:`查看市场,或建立一个商品项目,逐步积累证据与判断。`})]}),(0,v.jsxs)(`button`,{onClick:()=>c[0]?b(c[0].route):S(`market`),children:[c[0]?`继续处理`:`查看市场`,(0,v.jsx)(e,{size:17})]})]}),(0,v.jsxs)(`div`,{className:_.grid,children:[H,(0,v.jsxs)(`section`,{className:_.panel,children:[(0,v.jsx)(`h2`,{children:`常用入口`}),(0,v.jsx)(`div`,{className:_.shortcuts,children:[[`market`,`查市场`,t],[`products`,`查看商品`,i],[`projects`,`打开项目`,r],[`data`,`查找资料`,p]].map(([t,n,r])=>(0,v.jsxs)(`button`,{onClick:()=>S(String(t)),children:[(0,v.jsx)(r,{size:20}),(0,v.jsx)(`span`,{children:String(n)}),(0,v.jsx)(e,{size:14})]},String(t)))}),l.length>0&&V(l.slice(0,3))]}),(0,v.jsxs)(`section`,{className:_.panel,children:[(0,v.jsxs)(`div`,{className:_.heading,children:[(0,v.jsx)(`h2`,{children:`最近项目`}),(0,v.jsx)(`button`,{onClick:C,children:`+ 新建项目`})]}),L.slice(0,4).map(t=>(0,v.jsxs)(`button`,{className:_.row,onClick:()=>x(t.id,{tab:`overview`}),children:[(0,v.jsxs)(`span`,{children:[(0,v.jsx)(`b`,{children:t.name}),(0,v.jsxs)(`small`,{children:[t.statusLabel,` · 下一步:`,t.next.name]}),(0,v.jsx)(`small`,{children:y(t.updated)})]}),(0,v.jsx)(e,{size:16})]},t.id)),!A&&!L.length&&(0,v.jsx)(`p`,{className:_.empty,children:P?`没有匹配的项目。`:`建立第一个项目,将市场机会转化为具体方案。`})]}),(0,v.jsxs)(`section`,{className:_.panel,children:[(0,v.jsxs)(`div`,{className:_.heading,children:[(0,v.jsx)(`h2`,{children:`最近资料`}),(0,v.jsx)(`button`,{onClick:()=>S(`data`),children:`全部资料 →`})]}),R.slice(0,5).map(t=>(0,v.jsxs)(`button`,{className:_.row,onClick:()=>x(t.project,{tab:`data`,datasetId:t.id}),children:[(0,v.jsxs)(`span`,{children:[(0,v.jsx)(`b`,{children:t.title}),(0,v.jsxs)(`small`,{children:[t.projectName,` · `,y(t.created)]})]}),(0,v.jsx)(e,{size:16})]},t.id)),!A&&!R.length&&(0,v.jsx)(`p`,{className:_.empty,children:P?`没有匹配的资料。`:`项目中归档的数据集会出现在这里。`})]})]})]})]})}function x(e,t){return e.some(e=>e.key===t.key)?e.filter(e=>e.key!==t.key):[t,...e].slice(0,20)}function S({section:e}){let t=u(),[n,r]=d(`home.pins`,[]);return(0,v.jsx)(b,{mode:e,...t,pins:n,onPin:e=>r(t=>x(t,e))})}export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./index-CDS2fIqN.js";var t=e(`flag`,[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./index-CDS2fIqN.js";var t=e(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function e(e,t,n,r,i){let a={format:`product-incubation-v1`,project_id:t.project,itemId:t.itemId,dataMode:t.mode,tier:n,note:r,qualification:i,created:new Date().toISOString()},o=new TextEncoder().encode(JSON.stringify(a)),s=``;for(let e of o)s+=String.fromCharCode(e);await e(`/`+t.project+`/file`,{name:`商品分组-${t.itemId}-${Date.now()}.json`,kind:`analysis`,source:`用户在孵化工作台手动确认的商品分组;不代表已启动投放`,base64:btoa(s)})}export{e as t};
|