@next-bricks/nav 1.11.33 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +17 -17
- package/dist/chunks/{8518.d3b0f3ac.js → 8518.92aaa235.js} +2 -2
- package/dist/chunks/8518.92aaa235.js.map +1 -0
- package/dist/chunks/9043.01c7dd1e.js +3 -0
- package/dist/chunks/9043.01c7dd1e.js.map +1 -0
- package/dist/chunks/eo-nav-menu.1d01b159.js +2 -0
- package/dist/chunks/eo-nav-menu.1d01b159.js.map +1 -0
- package/dist/chunks/{main.48aec84a.js → main.afc0d726.js} +2 -2
- package/dist/chunks/{main.48aec84a.js.map → main.afc0d726.js.map} +1 -1
- package/dist/examples.json +4 -4
- package/dist/{index.15af380e.js → index.477d9af4.js} +2 -2
- package/dist/{index.15af380e.js.map → index.477d9af4.js.map} +1 -1
- package/dist/manifest.json +57 -52
- package/dist/types.json +40 -30
- package/dist-types/nav-menu/index.d.ts +2 -1
- package/dist-types/nav-menu/utils.d.ts +2 -2
- package/docs/eo-nav-menu.md +99 -48
- package/package.json +2 -2
- package/dist/chunks/8518.d3b0f3ac.js.map +0 -1
- package/dist/chunks/9043.981abb1e.js +0 -3
- package/dist/chunks/9043.981abb1e.js.map +0 -1
- package/dist/chunks/eo-nav-menu.af5f8c67.js +0 -2
- package/dist/chunks/eo-nav-menu.af5f8c67.js.map +0 -1
- /package/dist/chunks/{9043.981abb1e.js.LICENSE.txt → 9043.01c7dd1e.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "bricks/nav",
|
|
3
3
|
"bricks": [
|
|
4
|
-
"nav.launchpad-config",
|
|
5
4
|
"nav.easyops-navbar-alerts",
|
|
5
|
+
"nav.launchpad-config",
|
|
6
6
|
"nav.app-bar-wrapper",
|
|
7
7
|
"nav.nav-logo"
|
|
8
8
|
],
|
|
9
9
|
"elements": [
|
|
10
10
|
"eo-nav-menu",
|
|
11
|
+
"eo-launchpad-button",
|
|
11
12
|
"eo-launchpad-button-v2",
|
|
12
13
|
"eo-launchpad-quick-access",
|
|
13
|
-
"eo-launchpad-recent-visits",
|
|
14
14
|
"eo-search-launchpad",
|
|
15
15
|
"eo-app-bar-wrapper",
|
|
16
|
+
"eo-launchpad-recent-visits",
|
|
16
17
|
"eo-frame-breadcrumb",
|
|
17
18
|
"eo-sidebar-menu-item",
|
|
18
19
|
"eo-sidebar-menu-group",
|
|
@@ -22,9 +23,8 @@
|
|
|
22
23
|
"eo-sidebar-sub-menu",
|
|
23
24
|
"eo-directory",
|
|
24
25
|
"eo-directory-tree",
|
|
25
|
-
"eo-directory-tree-internal-node",
|
|
26
26
|
"eo-directory-tree-leaf",
|
|
27
|
-
"eo-
|
|
27
|
+
"eo-directory-tree-internal-node"
|
|
28
28
|
],
|
|
29
29
|
"processors": [],
|
|
30
30
|
"editors": [],
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"eo-input",
|
|
39
39
|
"eo-tooltip"
|
|
40
40
|
],
|
|
41
|
+
"eo-launchpad-button": [
|
|
42
|
+
"eo-icon",
|
|
43
|
+
"eo-link"
|
|
44
|
+
],
|
|
41
45
|
"eo-launchpad-button-v2": [
|
|
42
46
|
"basic.lock-body-scroll",
|
|
43
47
|
"eo-icon",
|
|
@@ -45,31 +49,31 @@
|
|
|
45
49
|
"basic.show-dialog",
|
|
46
50
|
"basic.show-notification"
|
|
47
51
|
],
|
|
52
|
+
"nav.easyops-navbar-alerts": [
|
|
53
|
+
"eo-icon",
|
|
54
|
+
"eo-link"
|
|
55
|
+
],
|
|
48
56
|
"nav.launchpad-config": [
|
|
49
57
|
"eo-icon",
|
|
50
58
|
"eo-link",
|
|
51
59
|
"eo-dropdown-actions",
|
|
52
60
|
"basic.show-dialog"
|
|
53
61
|
],
|
|
54
|
-
"nav.easyops-navbar-alerts": [
|
|
55
|
-
"eo-icon",
|
|
56
|
-
"eo-link"
|
|
57
|
-
],
|
|
58
62
|
"eo-launchpad-quick-access": [
|
|
59
63
|
"eo-icon",
|
|
60
64
|
"eo-link",
|
|
61
65
|
"basic.show-dialog",
|
|
62
66
|
"basic.show-notification"
|
|
63
67
|
],
|
|
64
|
-
"eo-launchpad
|
|
65
|
-
"eo-link",
|
|
68
|
+
"eo-search-launchpad": [
|
|
66
69
|
"eo-icon",
|
|
70
|
+
"eo-link",
|
|
67
71
|
"basic.show-dialog",
|
|
68
72
|
"basic.show-notification"
|
|
69
73
|
],
|
|
70
|
-
"eo-
|
|
71
|
-
"eo-icon",
|
|
74
|
+
"eo-launchpad-recent-visits": [
|
|
72
75
|
"eo-link",
|
|
76
|
+
"eo-icon",
|
|
73
77
|
"basic.show-dialog",
|
|
74
78
|
"basic.show-notification"
|
|
75
79
|
],
|
|
@@ -126,11 +130,7 @@
|
|
|
126
130
|
"nav.nav-logo": [
|
|
127
131
|
"eo-icon",
|
|
128
132
|
"eo-link"
|
|
129
|
-
],
|
|
130
|
-
"eo-launchpad-button": [
|
|
131
|
-
"eo-icon",
|
|
132
|
-
"eo-link"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
|
-
"filePath": "bricks/nav/dist/index.
|
|
135
|
+
"filePath": "bricks/nav/dist/index.477d9af4.js"
|
|
136
136
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_nav=globalThis.webpackChunk_next_bricks_nav||[]).push([[8518],{1283:(e,t,r)=>{r.d(t,{s:()=>f});var a=r(8769),o=r.n(a),n=r(3373),i=r.n(n),l=r(9527),c=r(1030),s=r(1389),p=r(4612),u=r(7522),m=r(6419);(0,m.initializeReactI18n)(u.NS,u.I);const d=(0,s.wrapBrick)("eo-popover"),g=(0,s.wrapBrick)("eo-search",{onChange:"change",onSearch:"search"}),h=(0,s.wrapBrick)("eo-icon"),v="threeLevelCategoryMenu",x=6;function f(e){const{t}=(0,m.useTranslation)(u.NS),{menuItem:r,selectedKey:n}=e,s=r.items,[f,E]=(0,a.useState)([]),[b,y]=(0,a.useState)(""),_=(0,a.useRef)(null),k=`${v}_${r.title}`,C=(0,a.useMemo)((()=>new p.G(localStorage)),[]),w=C.getItem(k)||[],A=()=>{var e;null===(e=_.current)||void 0===e||e.click()};return o().createElement("div",{className:"three-level-menu-container"},o().createElement("div",{className:"three-level-menu-search-container",onClick:e=>{e.stopPropagation()}},o().createElement(g,{placeholder:t(u.K.SEARCH_BY_MENU_NAME),onSearch:e=>{if(y(e.detail),e.detail){const t=(0,c.uniq)([e.detail,...w]);t.length>x&&t.pop(),C.setItem(k,t),E(s.flatMap((e=>e.items||[])).filter((t=>t.text.toLowerCase().includes(e.detail.trim().toLowerCase()))))}else E([])},onFocus:A,onBlur:A}),o().createElement(d,{trigger:"click",placement:"bottom-start",anchorDisplay:"block",distance:0},o().createElement("div",{slot:"anchor",ref:_}),o().createElement("div",{className:"three-level-menu-search-result"},!!f.length&&f.map((e=>(0,l.q5)(e,{width:"100%"}))),b&&!f.length&&o().createElement("div",{style:{height:"100px",textAlign:"center",lineHeight:"100px"}},t(u.K.NO_DATA))))),!!w.length&&o().createElement("div",{className:"three-level-menu-search-history-container"},o().createElement("div",{className:"three-level-menu-search-history-title"},t(u.K.SEARCH_HISTORY),o().createElement(h,{lib:"antd",theme:"outlined",icon:"delete",className:"three-level-menu-search-history-icon"})),o().createElement("div",null,w.map((e=>o().createElement("span",{key:e,className:"three-level-menu-search-history-text"},e))))),o().createElement("div",{className:"three-level-menu-item-container",style:{gridTemplateColumns:`repeat(${s.length>4?4:s.length},1fr)`}},s.map(((e,t)=>{var r;return o().createElement("div",{key:t},o().createElement("div",{className:"three-level-menu-item-title-container"},o().createElement("span",{className:"three-level-menu-item-title-icon"}),o().createElement("span",{className:"three-level-menu-item-title"},e.title)),null===(r=e.items)||void 0===r?void 0:r.map((e=>o().createElement("span",{key:e.key,className:i()({active:!!e.key&&n.includes(e.key)})},(0,l.q5)(e,{width:"100%"})))))}))))}},7522:(e,t,r)=>{r.d(t,{I:()=>n,K:()=>a,NS:()=>o});let a=function(e){return e.SEARCH_BY_MENU_NAME="SEARCH_BY_MENU_NAME",e.SEARCH_HISTORY="SEARCH_HISTORY",e.NO_DATA="NO_DATA",e.QUICK_ACCESS="QUICK_ACCESS",e.REMOVE_ITEM_FROM_QUICK_ACCESS="REMOVE_ITEM_FROM_QUICK_ACCESS",e.ADD_ITEM_TO_QUICK_ACCESS="ADD_ITEM_TO_QUICK_ACCESS",e.NO_DATA_TIPS_IN_QUICK_ACCESS="NO_DATA_TIPS_IN_QUICK_ACCESS",e.SITE_MAP_SEARCH_RECOMMEND="SITE_MAP_SEARCH_RECOMMEND",e.MAX_COLLECT_COUNT_TIPS="MAX_COLLECT_COUNT_TIPS",e.NO_DATA_SEARCH_INFO="NO_DATA_SEARCH_INFO",e.SEARCH_ITEM_PLACEHOLDER="SEARCH_ITEM_PLACEHOLDER",e}({});const o="bricks/nav/nav-menu",n={en:{SEARCH_BY_MENU_NAME:"Search by menu name",SEARCH_HISTORY:"Search history",NO_DATA:"No data",QUICK_ACCESS:"Quick Access",REMOVE_ITEM_FROM_QUICK_ACCESS:"Remove from Quick Access",ADD_ITEM_TO_QUICK_ACCESS:"Add to Quick Access",NO_DATA_TIPS_IN_QUICK_ACCESS:"No quick access resources have been added yet. Please add from the list below or after searching",SITE_MAP_SEARCH_RECOMMEND:"Search recommend",MAX_COLLECT_COUNT_TIPS:"Need to delete some favorites in order to add",NO_DATA_SEARCH_INFO:"The search result is empty, please enter again",SEARCH_ITEM_PLACEHOLDER:"Please enter keywords to search"},zh:{SEARCH_BY_MENU_NAME:"通过菜单名称搜索",SEARCH_HISTORY:"历史搜索",NO_DATA:"暂无数据",QUICK_ACCESS:"快捷访问",REMOVE_ITEM_FROM_QUICK_ACCESS:"从快捷访问移除",ADD_ITEM_TO_QUICK_ACCESS:"添加至快捷访问",NO_DATA_TIPS_IN_QUICK_ACCESS:"暂未添加快捷访问资源,从下方列表或搜索后添加",SITE_MAP_SEARCH_RECOMMEND:"搜索推荐",MAX_COLLECT_COUNT_TIPS:"需删除部分收藏,才能添加",NO_DATA_SEARCH_INFO:"搜索结果为空,请重新输入",SEARCH_ITEM_PLACEHOLDER:"请输入关键词搜索"}}},9044:(e,t,r)=>{r.d(t,{bw:()=>L});var a=r(8769),o=r.n(a),n=r(1389),i=r(9575),l=r(3373),c=r.n(l),s=r(7522),p=r(4586),u=r(5343),m=r(4156);let d=function(e){return e.Left="left",e.Right="right",e}({});const g="sidebarMenuCollect",h=o().createContext({});var v=r(1030),x=r(9435);const f=new class{constructor(e){(0,p.A)(this,"maxCollectLength",void 0),(0,p.A)(this,"collectMap",new Map),(0,p.A)(this,"collectPromise",new Map),this.maxCollectLength=e??10}getFavoritesById(e){return(0,v.cloneDeep)(this.collectMap.get(e))??[]}async fetchFavorites(e){const t=this.collectPromise.get(e);if(t){return this.collectMap.get(e)||t}const r=(0,u.Q)({module:g,collectionName:e}).then((t=>{var r;const a=null===(r=t.payloads)||void 0===r?void 0:r.map((e=>e.extInfo)).filter(Boolean);return this.collectMap.set(e,a),a}));return this.collectPromise.set(e,r),r}setItemAsFavorite(e,t){const r=this.getFavoritesById(e);r.length>=this.maxCollectLength&&r.pop(),r.unshift(t),this.updateFavoriteItems(e,r)}updateFavoriteItems(e,t){try{this.collectMap.set(e,t),(0,m.B)({module:g,collectionName:e,payloads:null==t?void 0:t.map((e=>({name:e.text,url:e.to,extInfo:e})))})}catch(e){(0,x.handleHttpError)(e)}}equalItem(e,t){return e.text===t.text&&e.to===t.to}removeItemFromFavorite(e,t){const r=this.getFavoritesById(e),a=r.findIndex((e=>this.equalItem(e,t)));-1!==a&&(r.splice(a,1),this.updateFavoriteItems(e,r))}isCollected(e,t){return this.getFavoritesById(e).some((e=>this.equalItem(e,t)))}toggleFavorite(e,t){if(this.isCollected(e,t))this.removeItemFromFavorite(e,t);else{if(this.checkMaxCapacity(e))return;this.setItemAsFavorite(e,t)}}moveFavoriteTo(e,t){const{from:r,to:a,direction:o}=t,n=this.getFavoritesById(e);if(this.equalItem(r,a))return n;const i=n.findIndex((e=>this.equalItem(e,r)));if(-1!==i){n.splice(i,1);const t=n.findIndex((e=>this.equalItem(e,a)));-1!==t&&(o===d.Left?n.splice(t,0,r):n.splice(t+1,0,r),this.updateFavoriteItems(e,n))}return n}checkMaxCapacity(e){return this.getFavoritesById(e).length>=this.maxCollectLength}};var E=r(6419);(0,E.initializeReactI18n)(s.NS,s.I);const b=(0,n.wrapBrick)("eo-link"),y=(0,n.wrapBrick)("eo-icon"),_=(0,n.wrapBrick)("eo-tooltip");function k(e){let{data:t,onDragOver:r,direction:n}=e;const{groupId:i,onFavoriteUpdate:l}=(0,a.useContext)(h);return o().createElement("div",{className:"indicate-wrapper","data-direction":n,"data-to":t.to,onDragEnter:e=>e.target.style.background="var(--palette-blue-1)",onDragLeave:e=>e.target.style.background="transparent","data-text":t.text,onDragOver:r,onDrop:e=>{const r=JSON.parse(e.dataTransfer.getData("application/json")),a=f.moveFavoriteTo(i,{from:r,to:t,direction:n});null==l||l(a)}})}function C(e){const{data:t,suffix:r,className:n}=e,{allowDrag:i,onDragStart:l,overElement:s,direction:p,onDragEnd:u,onDragOver:m}=(0,a.useContext)(h),g=(0,a.useRef)(null),[v,x]=(0,a.useState)(!1),f=(0,a.useMemo)((()=>s&&s.dataset.to==t.to&&s.dataset.text==s.dataset.text),[s,t]);return o().createElement(o().Fragment,null,f&&p===d.Left&&o().createElement(k,{data:t,onDragOver:m,direction:d.Left}),o().createElement(b,{"data-to":t.to,"data-text":t.text,ref:g,draggable:!0,onDragStart:e=>{var r;i?(x(!0),null===(r=e.dataTransfer)||void 0===r||r.setData("application/json",JSON.stringify(t)),null==l||l(e)):e.preventDefault()},onDragEnd:e=>{x(!1),null==u||u(e)},onDragOver:e=>{e.dataTransfer.dropEffect="none",null==m||m(e)},className:c()("tag-container",n,{"is-drag":v}),url:t.to,href:t.href,target:t.target},o().createElement("span",{className:"tag-text ellipsis",title:t.text},t.text),o().createElement("span",{className:"tag-suffix",onClick:e=>e.preventDefault()},r)),f&&p===d.Right&&o().createElement(k,{data:t,onDragOver:m,direction:d.Right}))}function w(e){const{t}=(0,E.useTranslation)(s.NS),{onAllowDrag:r}=(0,a.useContext)(h),{data:n,onFavorite:i,groupId:l}=e,c=(0,a.useRef)(),p=(0,a.useRef)(),u=(0,a.useCallback)((()=>{f.removeItemFromFavorite(l,n),null==i||i(f.getFavoritesById(l))}),[l,n,i]),m=()=>{null==r||r(!0)};(0,a.useEffect)((()=>{const e=p.current;return e.addEventListener("click",u),()=>{e.removeEventListener("click",u)}}),[u]),(0,a.useEffect)((()=>{const e=c.current,t=e=>{e.preventDefault()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[]);const d=(0,a.useMemo)((()=>o().createElement("div",{className:"operation",ref:c},o().createElement(_,{content:t(s.K.REMOVE_ITEM_FROM_QUICK_ACCESS),hoist:!0,placement:"bottom",className:"close"},o().createElement(y,{lib:"antd",icon:"close",ref:p})),o().createElement("span",{className:"drag-wrapper",onMouseDown:m},":::"))),[t,u]);return o().createElement(C,{className:"visit-container",suffix:d,data:n})}function A(e){let{onFavorite:t,className:r,groupId:n,data:l,active:p}=e;const{t:u}=(0,E.useTranslation)(s.NS),m=(0,a.useRef)(),d=e=>{e.preventDefault(),f.toggleFavorite(n,l),null==t||t(f.getFavoritesById(n))};return(0,a.useEffect)((()=>{const e=m.current;return e.addEventListener("click",d),()=>{e.removeEventListener("click",d)}}),[]),o().createElement(_,{content:p?u(s.K.REMOVE_ITEM_FROM_QUICK_ACCESS):f.checkMaxCapacity(n)?u(s.K.MAX_COLLECT_COUNT_TIPS):u(s.K.ADD_ITEM_TO_QUICK_ACCESS),className:c()("star-icon",r)},o().createElement(y,(0,i.A)({ref:m,className:c()({active:p}),lib:"antd",icon:"star"},p?{theme:"filled"}:{})))}function S(e){const{data:t,className:r,groupId:n,onFavorite:i,active:l}=e,s=(0,a.useMemo)((()=>o().createElement(A,{groupId:n,active:l,className:"star",data:t,onFavorite:i})),[t,n,i,l]);return o().createElement(C,{className:c()("recommend-container",r),suffix:s,data:t})}function I(e,t){"group"===e.type&&Array.isArray(e.items)?function(e,t){for(const r of e)I(r,t)}(e.items,t):t.push(e)}const N=(0,n.wrapBrick)("eo-link"),M=240;function T(e){const{groupId:t,selectedKey:r,onFavorite:a}=e,n=function(e){const t=new Map,r=new Set;return null==e||e.forEach((e=>{const a=e.groupFrom??"default";r.add(a);const o=t.get(a);o?o.push(e):t.set(a,[e])})),Array.from(r).map((e=>({groupFrom:e,groups:t.get(e)})))}(e.groups);return o().createElement("div",{className:"group-view"},n.map(((e,n)=>o().createElement("div",{key:n},0!==n&&o().createElement("div",{className:"divider"}),"default"===e.groupFrom?o().createElement(O,{groupId:t,selectedKey:r,groups:e.groups,onFavorite:a}):o().createElement(R,{groupId:t,selectedKey:r,groups:e.groups,onFavorite:a})))))}function O(e){const{groupId:t,onFavorite:r,selectedKey:n,groups:i}=e,l=o().useRef(null),[c,s]=(0,a.useState)();return(0,a.useEffect)((()=>{const e=new ResizeObserver((e=>{for(const t of e)if(t.target===l.current){const e=t.contentRect.width;e&&s(Math.floor(e/M))}}));return e.observe(l.current),()=>e.disconnect()}),[]),o().createElement("div",{className:"group",ref:l,style:c<(null==i?void 0:i.length)?{columnCount:c,columnWidth:M}:{display:"grid",gridTemplateColumns:`repeat(auto-fit, ${M}px)`}},i.map((e=>o().createElement("div",{key:e.key,className:"group-item"},o().createElement("div",{className:"title"},e.title),o().createElement("div",{className:"content"},e.items.map((e=>o().createElement(D,{key:e.key,groupId:t,selectedKey:n,data:e,onFavorite:r}))))))))}function R(e){const{groupId:t,onFavorite:r,selectedKey:a,groups:n}=e;return o().createElement("div",{className:"custom-group"},n.map((e=>o().createElement("div",{key:e.key},o().createElement("div",{className:"title"},e.title),o().createElement("div",{className:"custom-content",style:{display:"grid",gridTemplateColumns:`repeat(auto-fit, ${M}px)`}},e.items.map((e=>o().createElement(D,{key:e.key,selectedKey:a,groupId:t,data:e,onFavorite:r}))))))))}function D(e){const{data:t,groupId:r,onFavorite:a,selectedKey:n}=e;return o().createElement(N,{key:t.key,icon:t.icon,url:t.to,href:t.href,target:t.target,className:c()("item-link",{active:null==n?void 0:n.includes(t.key)})},o().createElement("span",{className:"ellipsis",title:t.text},t.text),o().createElement("span",{className:"icon-wrapper"},o().createElement(A,{active:f.isCollected(r,t),groupId:r,data:t,onFavorite:a})))}const F=(0,n.wrapBrick)("eo-icon"),K=(0,n.wrapBrick)("eo-input",{onValueChange:"change"});function L(e){const{t}=(0,E.useTranslation)(s.NS),{menuGroup:r,selectedKey:n,visible:i}=e,l=r.groupId,[p,u]=(0,a.useState)([]),m=(0,a.useMemo)((()=>function(e){const t=[];return I(e,t),t}(r)),[r]),[g,x]=(0,a.useState)(),[b,y]=(0,a.useState)([]),[_,k]=(0,a.useState)(),[C,A]=(0,a.useState)(),[N,M]=(0,a.useState)(),[O,R]=(0,a.useState)(),[D,L]=(0,a.useState)(!1);(0,a.useEffect)((()=>{i&&!D&&L(!0)}),[i,D]);const H=e=>{u(e)},P=(0,a.useCallback)((e=>{const t=e.detail;x(e.detail),y(t?m.filter((t=>t.text.toLowerCase().includes(e.detail.toLowerCase()))):m)}),[m]),U=(0,a.useMemo)((()=>(0,v.debounce)(P,200)),[P]),B=(0,a.useMemo)((()=>(0,v.throttle)((e=>{e.preventDefault();const t=function(e){let t=e;for(;t;){if(t.draggable||"indicate-wrapper"===t.className)return t;t=t.parentElement}}(e.target);if(A(t),t&&function(e,t){return e&&t&&!(e.dataset.to===t.dataset.to&&e.dataset.text===t.dataset.text)}(t,_))if("indicate-wrapper"===t.className)R(t.dataset.direction);else{const{width:r,left:a}=t.getBoundingClientRect(),o=e.clientX>a+r/2;R(o?d.Right:d.Left)}else R(void 0)}))),[_]);return(0,a.useEffect)((()=>{(async()=>{if(i){const e=await f.fetchFavorites(l);u(e)}})()}),[l,i]),D&&o().createElement("div",{className:"site-map"},o().createElement("div",{className:"search-wrapper"},o().createElement(K,{className:"search-input",style:{width:"100%"},onValueChange:U,placeholder:t(s.K.SEARCH_ITEM_PLACEHOLDER)},o().createElement(F,{slot:"prefix",lib:"antd",icon:"search"}))),!g&&o().createElement("div",null,0!==p.length&&o().createElement("div",{className:c()("visit-access",{hasData:p.length})},o().createElement("span",{className:"title"},t(s.K.QUICK_ACCESS)),o().createElement(h.Provider,{value:{groupId:l,overElement:C,direction:O,allowDrag:N,onDragStart:e=>{k(e.target)},onDragOver:B,onDragEnd:()=>{k(void 0),R(void 0),M(!1)},onAllowDrag:e=>{M(e)},onFavoriteUpdate:H}},o().createElement("div",{className:"tag-wrapper"},p.map((e=>o().createElement(w,{onFavorite:H,groupId:l,key:e.key,data:e})))))),o().createElement(T,{groupId:l,selectedKey:n,groups:r.items,onFavorite:H})),g&&o().createElement("div",{className:"search-panel"},o().createElement("span",{className:"title"},t(s.K.SITE_MAP_SEARCH_RECOMMEND)),b.length?o().createElement("div",{className:"recommend-wrapper"},b.map((e=>o().createElement(S,{key:e.key,groupId:l,data:e,onFavorite:H,active:f.isCollected(l,e)})))):o().createElement("div",{className:"no-data-tips"},t(s.K.NO_DATA_SEARCH_INFO))))}},9527:(e,t,r)=>{r.d(t,{Gn:()=>u,IZ:()=>c,Wf:()=>s,q5:()=>p});var a=r(8769),o=r.n(a),n=r(1389);const i=(0,n.wrapBrick)("eo-icon"),l=(0,n.wrapBrick)("eo-link");function c(e){return"group"===e.type}function s(e,t){return Boolean("subMenu"===e.type||t&&"group"===e.type)}const p=(e,t)=>o().createElement(l,{type:"plain",key:e.key,url:e.to,href:e.href,target:e.target,style:t},o().createElement("span",{className:"menu-item-label"},e.text)),u=(e,t)=>o().createElement("span",{key:e.key,className:"menu-item-label"},e.title,t&&o().createElement(i,{lib:"fa",icon:"angle-right"}))},2605:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,':root{--eo-three-level-menu-search-input-background:linear-gradient(90deg,#e8eef6 0%,rgba(233,234,243,0) 100%);--eo-three-level-menu-hover-color:#6bb3ff;--eo-three-level-menu-title-color:#0b5ad9;--eo-three-level-menu-active-color:#1a7aff;--eo-three-level-menu-search-tag-color:rgb(89,89,89);--eo-three-level-menu-search-tag-background:rgb(245,245,245)}html[data-theme="dark"],\nhtml[data-theme="dark-v2"]{--eo-three-level-menu-search-input-background:linear-gradient(124deg,rgba(255,255,255,0.36) 0%,rgba(255,255,255,0) 100%);--eo-three-level-menu-hover-color:rgba(54,95,175,0.85);--eo-three-level-menu-title-color:#6597e8;--eo-three-level-menu-active-color:#3f75dd;--eo-three-level-menu-search-tag-color:rgb(140,140,140);--eo-three-level-menu-search-tag-background:rgb(107,107,107)}',""]);const l=i},6370:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,":host{display:inline-block;background:none}:host::part(menu-item),\neo-link{display:block}eo-menu-item{margin:4px 0}.sub-menu-wrapper eo-menu-item:first-child,\n.group-wrapper eo-menu-item:first-child{margin-top:0}.sub-menu-wrapper eo-menu-item:last-child{margin-bottom:0}.nav-menu-wrapper{display:flex;align-items:center;gap:8px;white-space:nowrap}.popover .sub-menu-item-label{padding:2px 0px;color:var(--color-normal-text)}.popover.subprime{display:block;width:100%}.sub-menu-wrapper{min-width:160px;max-height:calc(100vh - 100px);background-color:var(--antd-dropdown-menu-bg);padding:12px 0;border-radius:6px;box-shadow:0px 4px 12px 0px rgba(17,37,64,0.08);overflow-x:hidden;overflow-y:auto}.overflow-menu-wrapper{display:flex;flex-direction:column}.sub-menu-wrapper > eo-menu-item{display:block;width:100%}.sub-menu-wrapper > eo-menu-item .menu-item-label,\n.sub-menu-wrapper > eo-popover .menu-item-label,\n.sub-menu-wrapper > .group-wrapper > eo-popover .menu-item-label,\n.sub-menu-wrapper > .group-wrapper > eo-menu-item .menu-item-label{display:block;width:100%;padding:7px 24px;box-sizing:border-box;line-height:22px;color:var(--color-normal-text)}.sub-menu-wrapper > eo-popover.subprime .menu-item-label,\n.sub-menu-wrapper > .group-wrapper > eo-popover.subprime .menu-item-label{display:flex;justify-content:space-between;align-items:center}.sub-menu-wrapper .menu-item-label{border-radius:0}.menu-item-label{display:inline-block;cursor:pointer;border-radius:4px;padding:1px 8px;line-height:22px;color:var(--nav-menu-item-label-color)}.menu-item-label:hover{background-color:var(--top-menu-item-hover-bg)}.group-label{padding-left:16px;font-size:12px;color:var(--palette-gray-7);padding:8px 16px;line-height:20px;margin-top:4px}.sub-menu-wrapper .group-label:first-child{margin-top:0px}.sub-menu-wrapper eo-menu-item[active] .menu-item-label{background:var(--top-menu-item-selected-bg);color:var(--color-brand);font-weight:500}.three-level-menu-container{max-width:980px;max-height:510px;overflow:auto;min-width:160px}.three-level-menu-item-container{display:grid;gap:20px;margin-top:13px;padding:5px 10px}.three-level-menu-item-title-container{display:flex;align-items:center}.three-level-menu-item-title-icon{width:4px;height:4px;background-color:var(--eo-three-level-menu-title-color);margin-right:4px;transform:rotate(45deg)}.three-level-menu-item-title{font-size:14px;font-family:PingFang-SC-Medium,PingFang-SC;font-weight:500;color:var(--eo-three-level-menu-title-color)}.three-level-menu-container .menu-item-label{margin-top:4px;margin-left:4px;padding:4px;width:100%}.three-level-menu-container .active .menu-item-label{color:var(--eo-three-level-menu-active-color)}.three-level-menu-search-result .menu-item-label{margin:0px}.three-level-menu-container .menu-item-label:hover{color:var(--eo-three-level-menu-hover-color)}.three-level-menu-popover .sub-menu-wrapper{padding-top:0px}.three-level-menu-search-container{background:var(--eo-three-level-menu-search-input-background);padding:5px 10px}.three-level-menu-search-result{min-width:187px;max-width:328px;max-height:324px;background-color:var(--antd-dropdown-menu-bg);box-shadow:0px 4px 12px 0px rgba(17,37,64,0.08);overflow:scroll}.three-level-menu-search-history-container{padding:5px 10px}.three-level-menu-search-history-text{background:var(--eo-three-level-menu-search-tag-background);border-radius:2px;font-size:7px;line-height:11px;display:inline-block;height:11px;padding:4px;color:var(--eo-three-level-menu-search-tag-color);margin-right:8px}.three-level-menu-search-history-title{color:#8c8c8c;margin:10px 0;display:flex;align-items:center}.three-level-menu-search-history-icon{margin-left:5px}.sub-menu-sit-map-wrapper{box-sizing:border-box;width:calc(100vw);padding:0 60px 24px;max-height:520px;background-color:var(--antd-dropdown-menu-bg);border-radius:6px;box-shadow:0px 4px 12px 0px rgba(17,37,64,0.08);overflow-x:hidden;overflow-y:auto}.overflow-menu-item{position:absolute;opacity:0;height:0;pointer-events:none}.in-group-site-map{width:auto;padding:0 20px}",""]);const l=i.toString()},1122:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,'.group .item-link, .custom-group .item-link{font-weight:400}.group .item-link:hover, .custom-group .item-link:hover{background-color:var(--color-fill-bg-base-1)}.group .item-link:hover::part(link), .custom-group .item-link:hover::part(link){color:var(--color-brand-hover)}.group .item-link:hover::part(icon), .custom-group .item-link:hover::part(icon){color:var(--color-brand-hover)}.group .item-link.active::part(link),\n .custom-group .item-link.active::part(link),\n .group .item-link.active::part(icon),\n .custom-group .item-link.active::part(icon){color:var(--palette-blue-8)}.group .item-link::part(link), .custom-group .item-link::part(link){padding:8px 12px 8px 24px;display:flex;gap:4px;color:var(--color-header-text)}.group .item-link::part(icon), .custom-group .item-link::part(icon){color:var(--color-normal-text)}.group .title, .custom-group .title{padding:8px 16px 8px 24px;font-size:16px;font-weight:500;position:relative}.group .title::before, .custom-group .title::before{content:"";position:absolute;width:6px;height:6px;top:17px;left:9px;transform:rotate(45deg);background:var(--color-secondary-text)}.group .content .icon-wrapper, .custom-group .content .icon-wrapper, .group .custom-content .icon-wrapper, .custom-group .custom-content .icon-wrapper{color:var(--color-secondary-text);font-size:16px;display:none;margin-left:auto}.group .content .item-link:hover .icon-wrapper, .custom-group .content .item-link:hover .icon-wrapper, .group .custom-content .item-link:hover .icon-wrapper, .custom-group .custom-content .item-link:hover .icon-wrapper{display:block}.group .content .item-link:hover .icon-wrapper:hover, .custom-group .content .item-link:hover .icon-wrapper:hover, .group .custom-content .item-link:hover .icon-wrapper:hover, .custom-group .custom-content .item-link:hover .icon-wrapper:hover{color:var(--color-brand-hover)}.group .content, .custom-group .content{display:flex;flex-direction:column}.group .group-item, .custom-group .group-item{page-break-inside:avoid;break-inside:avoid}.group-view{min-height:300px}.group-view .divider{height:2px;background:var(--color-text-divider-line);margin:16px 0}',""]);const l=i.toString()},839:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,".tag-container::part(link){display:flex;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;-moz-user-select:none;justify-content:space-between;background-color:var(--color-fill-bg-base-1);border-radius:2px;padding:1px 6px}.tag-container .tag-text{color:var(--color-normal-text);font-weight:400}.tag-container:hover .tag-text{color:var(--color-brand-hover)}.tag-container .tag-suffix{display:inline-flex;font-size:12px;gap:4px;align-items:center;color:var(--color-secondary-text)}.tag-container.is-drag{opacity:0.4}.indicate-wrapper{border:1px dashed var(--color-brand-hover);border-radius:4px;height:20px;margin:2px 0}.close{display:inline-flex;margin-top:2px;padding:0 2px}.close:hover{color:var(--color-error)}.drag-wrapper{cursor:move}.drag-wrapper:hover{color:var(--color-brand-hover)}.star-icon{display:flex;alignitems:center;color:var(--color-secondary-text)}.star-icon:hover{color:var(--color-brand-hover)}.star-icon .active{color:var(--palette-yellow-6)}.recommend-container:hover .star{display:inline-flex}.recommend-container .star{font-size:13px;display:none}.visit-container:hover .operation{display:inline-flex;align-items:center}.visit-container .operation{display:none}",""]);const l=i.toString()},9998:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,'.site-map .search-wrapper{position:sticky;top:0;z-index:9999;padding-top:24px;padding-bottom:16px;background:var(--antd-dropdown-menu-bg)}.site-map .search-input::part(affix-wrapper){border:none;border-bottom:1px solid var(--antd-input-border-color);border-radius:0px;background:transparent}.site-map .visit-access .title, .site-map .search-panel .title{display:inline-block;padding:2px 16px 2px 24px;font-weight:500;line-height:24px;position:relative}.site-map .visit-access .title::before, .site-map .search-panel .title::before{content:"";position:absolute;width:6px;height:6px;top:10px;left:9px;border-radius:50%;background:var(--color-secondary-text)}.site-map .visit-access .no-data-tips, .site-map .search-panel .no-data-tips{display:flex;margin:16px 0 32px;align-items:center;justify-content:center;color:var(--color-secondary-text)}.site-map .visit-access{margin-bottom:8px}.site-map .visit-access.hasData{display:flex}.site-map .visit-access .tag-wrapper{flex:1;display:grid;grid-template-columns:repeat(auto-fit,200px);gap:8px}.site-map .ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.site-map .search-panel .recommend-wrapper{margin-top:16px;display:grid;grid-template-columns:repeat(auto-fit,200px);gap:8px}',""]);const l=i.toString()},4211:(e,t,r)=>{var a=r(2591),o=r.n(a),n=r(1740),i=r.n(n),l=r(8128),c=r.n(l),s=r(855),p=r.n(s),u=r(3051),m=r.n(u),d=r(3656),g=r.n(d),h=r(2605),v={};v.styleTagTransform=g(),v.setAttributes=p(),v.insert=c().bind(null,"head"),v.domAPI=i(),v.insertStyleElement=m(),o()(h.A,v),h.A&&h.A.locals&&h.A.locals},764:(e,t,r)=>{r.d(t,{IZ:()=>i,LP:()=>c,Wf:()=>l});var a=r(1201),o=r(9435),n=r(1030);function i(e){return"group"===e.type}function l(e,t){return Boolean("subMenu"===e.type||t&&"group"===e.type)}function c(e,t,r,p){const u=[],m=[],d=[];let g=0;return e&&e.forEach((e=>{if(e.key=""===p?`${g}`:`${p}.${g}`,i(e)||l(e)){const a=c(e.items,t,r,e.key);u.push(...a.selectedKeys),(a.selectedKeys.length||e.defaultExpanded)&&m.push(e.key),m.push(...a.openedKeys),d.push(...a.matchedKeys)}else if(function(e,t,r){if(!e.to)return!1;const i="object"==typeof e.to?e.to:(0,a.parsePath)(e.to),l=i.pathname.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1");let c=!!(0,o.matchPath)(t,{path:l,exact:e.exact});if(c&&e.activeMatchSearch&&(c=s(r,i.search)),!c&&Array.isArray(e.activeIncludes))for(const i of e.activeIncludes){let e,l=!0;(0,n.isObject)(i)?(e=Array.isArray(i.path)?i.path:[i.path],l=i.exact):e=[i];for(const n of e){var p;let e;const i=n.includes("?");if(i&&(e=(0,a.parsePath)(n)),c=!!(0,o.matchPath)(t,{path:i?e.pathname:n,exact:l}),c&&null!==(p=e)&&void 0!==p&&p.search&&(c=s(r,e.search)),c)break}if(c)break}if(c&&Array.isArray(e.activeExcludes))for(const r of e.activeExcludes){let e,a=!0;(0,n.isObject)(r)?(e=Array.isArray(r.path)?r.path:[r.path],a=r.exact):e=[r];for(const r of e)if(c=!(0,o.matchPath)(t,{path:r,exact:a}),!c)break;if(!c)break}return c}(e,t,r)){u.push(String(e.key));const t=e.key.split(".");for(let e=0;e<t.length;e++)d.push(t.slice(0,e+1).join("."))}g+=1})),u.length&&""!==p&&m.push(p),{selectedKeys:u,openedKeys:m,matchedKeys:d}}function s(e,t){const r=new URLSearchParams(e),a=new URLSearchParams(t);for(const[e,t]of a.entries())if((r.get(e)??"")!==t)return!1;return!0}}}]);
|
|
2
|
-
//# sourceMappingURL=8518.
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_nav=globalThis.webpackChunk_next_bricks_nav||[]).push([[8518],{1283:(e,t,r)=>{r.d(t,{s:()=>f});var a=r(8769),o=r.n(a),n=r(3373),i=r.n(n),l=r(9527),c=r(1030),s=r(1389),p=r(4612),u=r(7522),m=r(6419);(0,m.initializeReactI18n)(u.NS,u.I);const d=(0,s.wrapBrick)("eo-popover"),g=(0,s.wrapBrick)("eo-search",{onChange:"change",onSearch:"search"}),h=(0,s.wrapBrick)("eo-icon"),v="threeLevelCategoryMenu",x=6;function f(e){const{t}=(0,m.useTranslation)(u.NS),{menuItem:r,selectedKey:n}=e,s=r.items,[f,E]=(0,a.useState)([]),[b,y]=(0,a.useState)(""),_=(0,a.useRef)(null),k=`${v}_${r.title}`,C=(0,a.useMemo)((()=>new p.G(localStorage)),[]),w=C.getItem(k)||[],A=()=>{var e;null===(e=_.current)||void 0===e||e.click()};return o().createElement("div",{className:"three-level-menu-container"},o().createElement("div",{className:"three-level-menu-search-container",onClick:e=>{e.stopPropagation()}},o().createElement(g,{placeholder:t(u.K.SEARCH_BY_MENU_NAME),onSearch:e=>{if(y(e.detail),e.detail){const t=(0,c.uniq)([e.detail,...w]);t.length>x&&t.pop(),C.setItem(k,t),E(s.flatMap((e=>e.items||[])).filter((t=>t.text.toLowerCase().includes(e.detail.trim().toLowerCase()))))}else E([])},onFocus:A,onBlur:A}),o().createElement(d,{trigger:"click",placement:"bottom-start",anchorDisplay:"block",distance:0},o().createElement("div",{slot:"anchor",ref:_}),o().createElement("div",{className:"three-level-menu-search-result"},!!f.length&&f.map((e=>(0,l.q5)(e,{width:"100%"}))),b&&!f.length&&o().createElement("div",{style:{height:"100px",textAlign:"center",lineHeight:"100px"}},t(u.K.NO_DATA))))),!!w.length&&o().createElement("div",{className:"three-level-menu-search-history-container"},o().createElement("div",{className:"three-level-menu-search-history-title"},t(u.K.SEARCH_HISTORY),o().createElement(h,{lib:"antd",theme:"outlined",icon:"delete",className:"three-level-menu-search-history-icon"})),o().createElement("div",null,w.map((e=>o().createElement("span",{key:e,className:"three-level-menu-search-history-text"},e))))),o().createElement("div",{className:"three-level-menu-item-container",style:{gridTemplateColumns:`repeat(${s.length>4?4:s.length},1fr)`}},s.map(((e,t)=>{var r;return o().createElement("div",{key:t},o().createElement("div",{className:"three-level-menu-item-title-container"},o().createElement("span",{className:"three-level-menu-item-title-icon"}),o().createElement("span",{className:"three-level-menu-item-title"},e.title)),null===(r=e.items)||void 0===r?void 0:r.map((e=>o().createElement("span",{key:e.key,className:i()({active:!!e.key&&n.includes(e.key)})},(0,l.q5)(e,{width:"100%"})))))}))))}},7522:(e,t,r)=>{r.d(t,{I:()=>n,K:()=>a,NS:()=>o});let a=function(e){return e.SEARCH_BY_MENU_NAME="SEARCH_BY_MENU_NAME",e.SEARCH_HISTORY="SEARCH_HISTORY",e.NO_DATA="NO_DATA",e.QUICK_ACCESS="QUICK_ACCESS",e.REMOVE_ITEM_FROM_QUICK_ACCESS="REMOVE_ITEM_FROM_QUICK_ACCESS",e.ADD_ITEM_TO_QUICK_ACCESS="ADD_ITEM_TO_QUICK_ACCESS",e.NO_DATA_TIPS_IN_QUICK_ACCESS="NO_DATA_TIPS_IN_QUICK_ACCESS",e.SITE_MAP_SEARCH_RECOMMEND="SITE_MAP_SEARCH_RECOMMEND",e.MAX_COLLECT_COUNT_TIPS="MAX_COLLECT_COUNT_TIPS",e.NO_DATA_SEARCH_INFO="NO_DATA_SEARCH_INFO",e.SEARCH_ITEM_PLACEHOLDER="SEARCH_ITEM_PLACEHOLDER",e}({});const o="bricks/nav/nav-menu",n={en:{SEARCH_BY_MENU_NAME:"Search by menu name",SEARCH_HISTORY:"Search history",NO_DATA:"No data",QUICK_ACCESS:"Quick Access",REMOVE_ITEM_FROM_QUICK_ACCESS:"Remove from Quick Access",ADD_ITEM_TO_QUICK_ACCESS:"Add to Quick Access",NO_DATA_TIPS_IN_QUICK_ACCESS:"No quick access resources have been added yet. Please add from the list below or after searching",SITE_MAP_SEARCH_RECOMMEND:"Search recommend",MAX_COLLECT_COUNT_TIPS:"Need to delete some favorites in order to add",NO_DATA_SEARCH_INFO:"The search result is empty, please enter again",SEARCH_ITEM_PLACEHOLDER:"Please enter keywords to search"},zh:{SEARCH_BY_MENU_NAME:"通过菜单名称搜索",SEARCH_HISTORY:"历史搜索",NO_DATA:"暂无数据",QUICK_ACCESS:"快捷访问",REMOVE_ITEM_FROM_QUICK_ACCESS:"从快捷访问移除",ADD_ITEM_TO_QUICK_ACCESS:"添加至快捷访问",NO_DATA_TIPS_IN_QUICK_ACCESS:"暂未添加快捷访问资源,从下方列表或搜索后添加",SITE_MAP_SEARCH_RECOMMEND:"搜索推荐",MAX_COLLECT_COUNT_TIPS:"需删除部分收藏,才能添加",NO_DATA_SEARCH_INFO:"搜索结果为空,请重新输入",SEARCH_ITEM_PLACEHOLDER:"请输入关键词搜索"}}},9044:(e,t,r)=>{r.d(t,{bw:()=>L});var a=r(8769),o=r.n(a),n=r(1389),i=r(9575),l=r(3373),c=r.n(l),s=r(7522),p=r(4586),u=r(5343),m=r(4156);let d=function(e){return e.Left="left",e.Right="right",e}({});const g="sidebarMenuCollect",h=o().createContext({});var v=r(1030),x=r(9435);const f=new class{constructor(e){(0,p.A)(this,"maxCollectLength",void 0),(0,p.A)(this,"collectMap",new Map),(0,p.A)(this,"collectPromise",new Map),this.maxCollectLength=e??10}getFavoritesById(e){return(0,v.cloneDeep)(this.collectMap.get(e))??[]}async fetchFavorites(e){const t=this.collectPromise.get(e);if(t){return this.collectMap.get(e)||t}const r=(0,u.Q)({module:g,collectionName:e}).then((t=>{var r;const a=null===(r=t.payloads)||void 0===r?void 0:r.map((e=>e.extInfo)).filter(Boolean);return this.collectMap.set(e,a),a}));return this.collectPromise.set(e,r),r}setItemAsFavorite(e,t){const r=this.getFavoritesById(e);r.length>=this.maxCollectLength&&r.pop(),r.unshift(t),this.updateFavoriteItems(e,r)}updateFavoriteItems(e,t){try{this.collectMap.set(e,t),(0,m.B)({module:g,collectionName:e,payloads:null==t?void 0:t.map((e=>({name:e.text,url:e.to,extInfo:e})))})}catch(e){(0,x.handleHttpError)(e)}}equalItem(e,t){return e.text===t.text&&e.to===t.to}removeItemFromFavorite(e,t){const r=this.getFavoritesById(e),a=r.findIndex((e=>this.equalItem(e,t)));-1!==a&&(r.splice(a,1),this.updateFavoriteItems(e,r))}isCollected(e,t){return this.getFavoritesById(e).some((e=>this.equalItem(e,t)))}toggleFavorite(e,t){if(this.isCollected(e,t))this.removeItemFromFavorite(e,t);else{if(this.checkMaxCapacity(e))return;this.setItemAsFavorite(e,t)}}moveFavoriteTo(e,t){const{from:r,to:a,direction:o}=t,n=this.getFavoritesById(e);if(this.equalItem(r,a))return n;const i=n.findIndex((e=>this.equalItem(e,r)));if(-1!==i){n.splice(i,1);const t=n.findIndex((e=>this.equalItem(e,a)));-1!==t&&(o===d.Left?n.splice(t,0,r):n.splice(t+1,0,r),this.updateFavoriteItems(e,n))}return n}checkMaxCapacity(e){return this.getFavoritesById(e).length>=this.maxCollectLength}};var E=r(6419);(0,E.initializeReactI18n)(s.NS,s.I);const b=(0,n.wrapBrick)("eo-link"),y=(0,n.wrapBrick)("eo-icon"),_=(0,n.wrapBrick)("eo-tooltip");function k(e){let{data:t,onDragOver:r,direction:n}=e;const{groupId:i,onFavoriteUpdate:l}=(0,a.useContext)(h);return o().createElement("div",{className:"indicate-wrapper","data-direction":n,"data-to":t.to,onDragEnter:e=>e.target.style.background="var(--palette-blue-1)",onDragLeave:e=>e.target.style.background="transparent","data-text":t.text,onDragOver:r,onDrop:e=>{const r=JSON.parse(e.dataTransfer.getData("application/json")),a=f.moveFavoriteTo(i,{from:r,to:t,direction:n});null==l||l(a)}})}function C(e){const{data:t,suffix:r,className:n}=e,{allowDrag:i,onDragStart:l,overElement:s,direction:p,onDragEnd:u,onDragOver:m}=(0,a.useContext)(h),g=(0,a.useRef)(null),[v,x]=(0,a.useState)(!1),f=(0,a.useMemo)((()=>s&&s.dataset.to==t.to&&s.dataset.text==s.dataset.text),[s,t]);return o().createElement(o().Fragment,null,f&&p===d.Left&&o().createElement(k,{data:t,onDragOver:m,direction:d.Left}),o().createElement(b,{"data-to":t.to,"data-text":t.text,ref:g,draggable:!0,onDragStart:e=>{var r;i?(x(!0),null===(r=e.dataTransfer)||void 0===r||r.setData("application/json",JSON.stringify(t)),null==l||l(e)):e.preventDefault()},onDragEnd:e=>{x(!1),null==u||u(e)},onDragOver:e=>{e.dataTransfer.dropEffect="none",null==m||m(e)},className:c()("tag-container",n,{"is-drag":v}),url:t.to,href:t.href,target:t.target},o().createElement("span",{className:"tag-text ellipsis",title:t.text},t.text),o().createElement("span",{className:"tag-suffix",onClick:e=>e.preventDefault()},r)),f&&p===d.Right&&o().createElement(k,{data:t,onDragOver:m,direction:d.Right}))}function w(e){const{t}=(0,E.useTranslation)(s.NS),{onAllowDrag:r}=(0,a.useContext)(h),{data:n,onFavorite:i,groupId:l}=e,c=(0,a.useRef)(),p=(0,a.useRef)(),u=(0,a.useCallback)((()=>{f.removeItemFromFavorite(l,n),null==i||i(f.getFavoritesById(l))}),[l,n,i]),m=()=>{null==r||r(!0)};(0,a.useEffect)((()=>{const e=p.current;return e.addEventListener("click",u),()=>{e.removeEventListener("click",u)}}),[u]),(0,a.useEffect)((()=>{const e=c.current,t=e=>{e.preventDefault()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[]);const d=(0,a.useMemo)((()=>o().createElement("div",{className:"operation",ref:c},o().createElement(_,{content:t(s.K.REMOVE_ITEM_FROM_QUICK_ACCESS),hoist:!0,placement:"bottom",className:"close"},o().createElement(y,{lib:"antd",icon:"close",ref:p})),o().createElement("span",{className:"drag-wrapper",onMouseDown:m},":::"))),[t,u]);return o().createElement(C,{className:"visit-container",suffix:d,data:n})}function A(e){let{onFavorite:t,className:r,groupId:n,data:l,active:p}=e;const{t:u}=(0,E.useTranslation)(s.NS),m=(0,a.useRef)(),d=e=>{e.preventDefault(),f.toggleFavorite(n,l),null==t||t(f.getFavoritesById(n))};return(0,a.useEffect)((()=>{const e=m.current;return e.addEventListener("click",d),()=>{e.removeEventListener("click",d)}}),[]),o().createElement(_,{content:p?u(s.K.REMOVE_ITEM_FROM_QUICK_ACCESS):f.checkMaxCapacity(n)?u(s.K.MAX_COLLECT_COUNT_TIPS):u(s.K.ADD_ITEM_TO_QUICK_ACCESS),className:c()("star-icon",r)},o().createElement(y,(0,i.A)({ref:m,className:c()({active:p}),lib:"antd",icon:"star"},p?{theme:"filled"}:{})))}function S(e){const{data:t,className:r,groupId:n,onFavorite:i,active:l}=e,s=(0,a.useMemo)((()=>o().createElement(A,{groupId:n,active:l,className:"star",data:t,onFavorite:i})),[t,n,i,l]);return o().createElement(C,{className:c()("recommend-container",r),suffix:s,data:t})}function I(e,t){"group"===e.type&&Array.isArray(e.items)?function(e,t){for(const r of e)I(r,t)}(e.items,t):t.push(e)}const N=(0,n.wrapBrick)("eo-link"),M=240;function T(e){const{groupId:t,selectedKey:r,onFavorite:a}=e,n=function(e){const t=new Map,r=new Set;return null==e||e.forEach((e=>{const a=e.groupFrom??"default";r.add(a);const o=t.get(a);o?o.push(e):t.set(a,[e])})),Array.from(r).map((e=>({groupFrom:e,groups:t.get(e)})))}(e.groups);return o().createElement("div",{className:"group-view"},n.map(((e,n)=>o().createElement("div",{key:n},0!==n&&o().createElement("div",{className:"divider"}),"default"===e.groupFrom?o().createElement(O,{groupId:t,selectedKey:r,groups:e.groups,onFavorite:a}):o().createElement(R,{groupId:t,selectedKey:r,groups:e.groups,onFavorite:a})))))}function O(e){const{groupId:t,onFavorite:r,selectedKey:n,groups:i}=e,l=o().useRef(null),[c,s]=(0,a.useState)();return(0,a.useEffect)((()=>{const e=new ResizeObserver((e=>{for(const t of e)if(t.target===l.current){const e=t.contentRect.width;e&&s(Math.floor(e/M))}}));return e.observe(l.current),()=>e.disconnect()}),[]),o().createElement("div",{className:"group",ref:l,style:c<(null==i?void 0:i.length)?{columnCount:c,columnWidth:M}:{display:"grid",gridTemplateColumns:`repeat(auto-fit, ${M}px)`}},i.map((e=>o().createElement("div",{key:e.key,className:"group-item"},o().createElement("div",{className:"title"},e.title),o().createElement("div",{className:"content"},e.items.map((e=>o().createElement(D,{key:e.key,groupId:t,selectedKey:n,data:e,onFavorite:r}))))))))}function R(e){const{groupId:t,onFavorite:r,selectedKey:a,groups:n}=e;return o().createElement("div",{className:"custom-group"},n.map((e=>o().createElement("div",{key:e.key},o().createElement("div",{className:"title"},e.title),o().createElement("div",{className:"custom-content",style:{display:"grid",gridTemplateColumns:`repeat(auto-fit, ${M}px)`}},e.items.map((e=>o().createElement(D,{key:e.key,selectedKey:a,groupId:t,data:e,onFavorite:r}))))))))}function D(e){const{data:t,groupId:r,onFavorite:a,selectedKey:n}=e;return o().createElement(N,{key:t.key,icon:t.icon,url:t.to,href:t.href,target:t.target,className:c()("item-link",{active:null==n?void 0:n.includes(t.key)})},o().createElement("span",{className:"ellipsis",title:t.text},t.text),o().createElement("span",{className:"icon-wrapper"},o().createElement(A,{active:f.isCollected(r,t),groupId:r,data:t,onFavorite:a})))}const F=(0,n.wrapBrick)("eo-icon"),K=(0,n.wrapBrick)("eo-input",{onValueChange:"change"});function L(e){const{t}=(0,E.useTranslation)(s.NS),{menuGroup:r,selectedKey:n,visible:i}=e,l=r.groupId,[p,u]=(0,a.useState)([]),m=(0,a.useMemo)((()=>function(e){const t=[];return I(e,t),t}(r)),[r]),[g,x]=(0,a.useState)(),[b,y]=(0,a.useState)([]),[_,k]=(0,a.useState)(),[C,A]=(0,a.useState)(),[N,M]=(0,a.useState)(),[O,R]=(0,a.useState)(),[D,L]=(0,a.useState)(!1);(0,a.useEffect)((()=>{i&&!D&&L(!0)}),[i,D]);const H=e=>{u(e)},P=(0,a.useCallback)((e=>{const t=e.detail;x(e.detail),y(t?m.filter((t=>t.text.toLowerCase().includes(e.detail.toLowerCase()))):m)}),[m]),U=(0,a.useMemo)((()=>(0,v.debounce)(P,200)),[P]),B=(0,a.useMemo)((()=>(0,v.throttle)((e=>{e.preventDefault();const t=function(e){let t=e;for(;t;){if(t.draggable||"indicate-wrapper"===t.className)return t;t=t.parentElement}}(e.target);if(A(t),t&&function(e,t){return e&&t&&!(e.dataset.to===t.dataset.to&&e.dataset.text===t.dataset.text)}(t,_))if("indicate-wrapper"===t.className)R(t.dataset.direction);else{const{width:r,left:a}=t.getBoundingClientRect(),o=e.clientX>a+r/2;R(o?d.Right:d.Left)}else R(void 0)}))),[_]);return(0,a.useEffect)((()=>{(async()=>{if(i){const e=await f.fetchFavorites(l);u(e)}})()}),[l,i]),D&&o().createElement("div",{className:"site-map"},o().createElement("div",{className:"search-wrapper"},o().createElement(K,{className:"search-input",style:{width:"100%"},onValueChange:U,placeholder:t(s.K.SEARCH_ITEM_PLACEHOLDER)},o().createElement(F,{slot:"prefix",lib:"antd",icon:"search"}))),!g&&o().createElement("div",null,0!==p.length&&o().createElement("div",{className:c()("visit-access",{hasData:p.length})},o().createElement("span",{className:"title"},t(s.K.QUICK_ACCESS)),o().createElement(h.Provider,{value:{groupId:l,overElement:C,direction:O,allowDrag:N,onDragStart:e=>{k(e.target)},onDragOver:B,onDragEnd:()=>{k(void 0),R(void 0),M(!1)},onAllowDrag:e=>{M(e)},onFavoriteUpdate:H}},o().createElement("div",{className:"tag-wrapper"},p.map((e=>o().createElement(w,{onFavorite:H,groupId:l,key:e.key,data:e})))))),o().createElement(T,{groupId:l,selectedKey:n,groups:r.items,onFavorite:H})),g&&o().createElement("div",{className:"search-panel"},o().createElement("span",{className:"title"},t(s.K.SITE_MAP_SEARCH_RECOMMEND)),b.length?o().createElement("div",{className:"recommend-wrapper"},b.map((e=>o().createElement(S,{key:e.key,groupId:l,data:e,onFavorite:H,active:f.isCollected(l,e)})))):o().createElement("div",{className:"no-data-tips"},t(s.K.NO_DATA_SEARCH_INFO))))}},9527:(e,t,r)=>{r.d(t,{Gn:()=>u,IZ:()=>c,Wf:()=>s,q5:()=>p});var a=r(8769),o=r.n(a),n=r(1389);const i=(0,n.wrapBrick)("eo-icon"),l=(0,n.wrapBrick)("eo-link");function c(e){return"group"===e.type}function s(e,t){return Boolean("subMenu"===e.type||t&&"group"===e.type)}const p=(e,t,r)=>o().createElement(l,{type:"plain",key:e.key,url:e.to,href:e.href,target:e.target,style:t},o().createElement("span",{className:"menu-item-label",style:{...r}},e.text)),u=(e,t,r)=>o().createElement("span",{key:e.key,className:"menu-item-label",style:{...r}},e.title,t&&o().createElement(i,{lib:"fa",icon:"angle-right"}))},2605:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,':root{--eo-three-level-menu-search-input-background:linear-gradient(90deg,#e8eef6 0%,rgba(233,234,243,0) 100%);--eo-three-level-menu-hover-color:#6bb3ff;--eo-three-level-menu-title-color:#0b5ad9;--eo-three-level-menu-active-color:#1a7aff;--eo-three-level-menu-search-tag-color:rgb(89,89,89);--eo-three-level-menu-search-tag-background:rgb(245,245,245)}html[data-theme="dark"],\nhtml[data-theme="dark-v2"]{--eo-three-level-menu-search-input-background:linear-gradient(124deg,rgba(255,255,255,0.36) 0%,rgba(255,255,255,0) 100%);--eo-three-level-menu-hover-color:rgba(54,95,175,0.85);--eo-three-level-menu-title-color:#6597e8;--eo-three-level-menu-active-color:#3f75dd;--eo-three-level-menu-search-tag-color:rgb(140,140,140);--eo-three-level-menu-search-tag-background:rgb(107,107,107)}',""]);const l=i},6370:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,":host{display:inline-block;background:none}:host::part(menu-item),\neo-link{display:block}eo-menu-item{margin:4px 0}.sub-menu-wrapper eo-menu-item:first-child,\n.group-wrapper eo-menu-item:first-child{margin-top:0}.sub-menu-wrapper eo-menu-item:last-child{margin-bottom:0}.nav-menu-wrapper{display:flex;align-items:center;gap:8px;white-space:nowrap}.popover .sub-menu-item-label{padding:2px 0px;color:var(--color-normal-text)}.popover.subprime{display:block;width:100%}.sub-menu-wrapper{min-width:160px;max-height:calc(100vh - 100px);background-color:var(--antd-dropdown-menu-bg);padding:12px 0;border-radius:6px;box-shadow:0px 4px 12px 0px rgba(17,37,64,0.08);overflow-x:hidden;overflow-y:auto}.overflow-menu-wrapper{display:flex;flex-direction:column}.sub-menu-wrapper > eo-menu-item{display:block;width:100%}.sub-menu-wrapper > eo-menu-item .menu-item-label,\n.sub-menu-wrapper > eo-popover .menu-item-label,\n.sub-menu-wrapper > .group-wrapper > eo-popover .menu-item-label,\n.sub-menu-wrapper > .group-wrapper > eo-menu-item .menu-item-label{display:block;width:100%;padding:7px 24px;box-sizing:border-box;line-height:22px;color:var(--color-normal-text)}.sub-menu-wrapper > eo-popover.subprime .menu-item-label,\n.sub-menu-wrapper > .group-wrapper > eo-popover.subprime .menu-item-label{display:flex;justify-content:space-between;align-items:center}.sub-menu-wrapper .menu-item-label{border-radius:0}.menu-item-label{display:inline-block;cursor:pointer;border-radius:4px;padding:1px 8px;line-height:22px;color:var(--nav-menu-item-label-color)}.menu-item-label:hover{background-color:var(--top-menu-item-hover-bg)}.group-label{padding-left:16px;font-size:12px;color:var(--palette-gray-7);padding:8px 16px;line-height:20px;margin-top:4px}.sub-menu-wrapper .group-label:first-child{margin-top:0px}.sub-menu-wrapper eo-menu-item[active] .menu-item-label{background:var(--top-menu-item-selected-bg);color:var(--color-brand);font-weight:500}.three-level-menu-container{max-width:980px;max-height:510px;overflow:auto;min-width:160px}.three-level-menu-item-container{display:grid;gap:20px;margin-top:13px;padding:5px 10px}.three-level-menu-item-title-container{display:flex;align-items:center}.three-level-menu-item-title-icon{width:4px;height:4px;background-color:var(--eo-three-level-menu-title-color);margin-right:4px;transform:rotate(45deg)}.three-level-menu-item-title{font-size:14px;font-family:PingFang-SC-Medium,PingFang-SC;font-weight:500;color:var(--eo-three-level-menu-title-color)}.three-level-menu-container .menu-item-label{margin-top:4px;margin-left:4px;padding:4px;width:100%}.three-level-menu-container .active .menu-item-label{color:var(--eo-three-level-menu-active-color)}.three-level-menu-search-result .menu-item-label{margin:0px}.three-level-menu-container .menu-item-label:hover{color:var(--eo-three-level-menu-hover-color)}.three-level-menu-popover .sub-menu-wrapper{padding-top:0px}.three-level-menu-search-container{background:var(--eo-three-level-menu-search-input-background);padding:5px 10px}.three-level-menu-search-result{min-width:187px;max-width:328px;max-height:324px;background-color:var(--antd-dropdown-menu-bg);box-shadow:0px 4px 12px 0px rgba(17,37,64,0.08);overflow:scroll}.three-level-menu-search-history-container{padding:5px 10px}.three-level-menu-search-history-text{background:var(--eo-three-level-menu-search-tag-background);border-radius:2px;font-size:7px;line-height:11px;display:inline-block;height:11px;padding:4px;color:var(--eo-three-level-menu-search-tag-color);margin-right:8px}.three-level-menu-search-history-title{color:#8c8c8c;margin:10px 0;display:flex;align-items:center}.three-level-menu-search-history-icon{margin-left:5px}.sub-menu-sit-map-wrapper{box-sizing:border-box;width:calc(100vw);padding:0 60px 24px;max-height:520px;background-color:var(--antd-dropdown-menu-bg);border-radius:6px;box-shadow:0px 4px 12px 0px rgba(17,37,64,0.08);overflow-x:hidden;overflow-y:auto}.overflow-menu-item{position:absolute;opacity:0;height:0;pointer-events:none}.in-group-site-map{width:auto;padding:0 20px}",""]);const l=i.toString()},1122:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,'.group .item-link, .custom-group .item-link{font-weight:400}.group .item-link:hover, .custom-group .item-link:hover{background-color:var(--color-fill-bg-base-1)}.group .item-link:hover::part(link), .custom-group .item-link:hover::part(link){color:var(--color-brand-hover)}.group .item-link:hover::part(icon), .custom-group .item-link:hover::part(icon){color:var(--color-brand-hover)}.group .item-link.active::part(link),\n .custom-group .item-link.active::part(link),\n .group .item-link.active::part(icon),\n .custom-group .item-link.active::part(icon){color:var(--palette-blue-8)}.group .item-link::part(link), .custom-group .item-link::part(link){padding:8px 12px 8px 24px;display:flex;gap:4px;color:var(--color-header-text)}.group .item-link::part(icon), .custom-group .item-link::part(icon){color:var(--color-normal-text)}.group .title, .custom-group .title{padding:8px 16px 8px 24px;font-size:16px;font-weight:500;position:relative}.group .title::before, .custom-group .title::before{content:"";position:absolute;width:6px;height:6px;top:17px;left:9px;transform:rotate(45deg);background:var(--color-secondary-text)}.group .content .icon-wrapper, .custom-group .content .icon-wrapper, .group .custom-content .icon-wrapper, .custom-group .custom-content .icon-wrapper{color:var(--color-secondary-text);font-size:16px;display:none;margin-left:auto}.group .content .item-link:hover .icon-wrapper, .custom-group .content .item-link:hover .icon-wrapper, .group .custom-content .item-link:hover .icon-wrapper, .custom-group .custom-content .item-link:hover .icon-wrapper{display:block}.group .content .item-link:hover .icon-wrapper:hover, .custom-group .content .item-link:hover .icon-wrapper:hover, .group .custom-content .item-link:hover .icon-wrapper:hover, .custom-group .custom-content .item-link:hover .icon-wrapper:hover{color:var(--color-brand-hover)}.group .content, .custom-group .content{display:flex;flex-direction:column}.group .group-item, .custom-group .group-item{page-break-inside:avoid;break-inside:avoid}.group-view{min-height:300px}.group-view .divider{height:2px;background:var(--color-text-divider-line);margin:16px 0}',""]);const l=i.toString()},839:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,".tag-container::part(link){display:flex;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;-moz-user-select:none;justify-content:space-between;background-color:var(--color-fill-bg-base-1);border-radius:2px;padding:1px 6px}.tag-container .tag-text{color:var(--color-normal-text);font-weight:400}.tag-container:hover .tag-text{color:var(--color-brand-hover)}.tag-container .tag-suffix{display:inline-flex;font-size:12px;gap:4px;align-items:center;color:var(--color-secondary-text)}.tag-container.is-drag{opacity:0.4}.indicate-wrapper{border:1px dashed var(--color-brand-hover);border-radius:4px;height:20px;margin:2px 0}.close{display:inline-flex;margin-top:2px;padding:0 2px}.close:hover{color:var(--color-error)}.drag-wrapper{cursor:move}.drag-wrapper:hover{color:var(--color-brand-hover)}.star-icon{display:flex;alignitems:center;color:var(--color-secondary-text)}.star-icon:hover{color:var(--color-brand-hover)}.star-icon .active{color:var(--palette-yellow-6)}.recommend-container:hover .star{display:inline-flex}.recommend-container .star{font-size:13px;display:none}.visit-container:hover .operation{display:inline-flex;align-items:center}.visit-container .operation{display:none}",""]);const l=i.toString()},9998:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6758),o=r.n(a),n=r(935),i=r.n(n)()(o());i.push([e.id,'.site-map .search-wrapper{position:sticky;top:0;z-index:9999;padding-top:24px;padding-bottom:16px;background:var(--antd-dropdown-menu-bg)}.site-map .search-input::part(affix-wrapper){border:none;border-bottom:1px solid var(--antd-input-border-color);border-radius:0px;background:transparent}.site-map .visit-access .title, .site-map .search-panel .title{display:inline-block;padding:2px 16px 2px 24px;font-weight:500;line-height:24px;position:relative}.site-map .visit-access .title::before, .site-map .search-panel .title::before{content:"";position:absolute;width:6px;height:6px;top:10px;left:9px;border-radius:50%;background:var(--color-secondary-text)}.site-map .visit-access .no-data-tips, .site-map .search-panel .no-data-tips{display:flex;margin:16px 0 32px;align-items:center;justify-content:center;color:var(--color-secondary-text)}.site-map .visit-access{margin-bottom:8px}.site-map .visit-access.hasData{display:flex}.site-map .visit-access .tag-wrapper{flex:1;display:grid;grid-template-columns:repeat(auto-fit,200px);gap:8px}.site-map .ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.site-map .search-panel .recommend-wrapper{margin-top:16px;display:grid;grid-template-columns:repeat(auto-fit,200px);gap:8px}',""]);const l=i.toString()},4211:(e,t,r)=>{var a=r(2591),o=r.n(a),n=r(1740),i=r.n(n),l=r(8128),c=r.n(l),s=r(855),p=r.n(s),u=r(3051),m=r.n(u),d=r(3656),g=r.n(d),h=r(2605),v={};v.styleTagTransform=g(),v.setAttributes=p(),v.insert=c().bind(null,"head"),v.domAPI=i(),v.insertStyleElement=m(),o()(h.A,v),h.A&&h.A.locals&&h.A.locals},764:(e,t,r)=>{r.d(t,{IZ:()=>i,LP:()=>c,Wf:()=>l});var a=r(1201),o=r(9435),n=r(1030);function i(e){return"group"===e.type}function l(e,t){return Boolean("subMenu"===e.type||t&&"group"===e.type)}function c(e,t,r,p){const u=[],m=[],d=[];let g=0;return e&&e.forEach((e=>{if(e.key=""===p?`${g}`:`${p}.${g}`,i(e)||l(e)){const a=c(e.items,t,r,e.key);u.push(...a.selectedKeys),(a.selectedKeys.length||e.defaultExpanded)&&m.push(e.key),m.push(...a.openedKeys),d.push(...a.matchedKeys)}else if(function(e,t,r){if(!e.to)return!1;const i="object"==typeof e.to?e.to:(0,a.parsePath)(e.to),l=i.pathname.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1");let c=!!(0,o.matchPath)(t,{path:l,exact:e.exact});if(c&&e.activeMatchSearch&&(c=s(r,i.search)),!c&&Array.isArray(e.activeIncludes))for(const i of e.activeIncludes){let e,l=!0;(0,n.isObject)(i)?(e=Array.isArray(i.path)?i.path:[i.path],l=i.exact):e=[i];for(const n of e){var p;let e;const i=n.includes("?");if(i&&(e=(0,a.parsePath)(n)),c=!!(0,o.matchPath)(t,{path:i?e.pathname:n,exact:l}),c&&null!==(p=e)&&void 0!==p&&p.search&&(c=s(r,e.search)),c)break}if(c)break}if(c&&Array.isArray(e.activeExcludes))for(const r of e.activeExcludes){let e,a=!0;(0,n.isObject)(r)?(e=Array.isArray(r.path)?r.path:[r.path],a=r.exact):e=[r];for(const r of e)if(c=!(0,o.matchPath)(t,{path:r,exact:a}),!c)break;if(!c)break}return c}(e,t,r)){u.push(String(e.key));const t=e.key.split(".");for(let e=0;e<t.length;e++)d.push(t.slice(0,e+1).join("."))}g+=1})),u.length&&""!==p&&m.push(p),{selectedKeys:u,openedKeys:m,matchedKeys:d}}function s(e,t){const r=new URLSearchParams(e),a=new URLSearchParams(t);for(const[e,t]of a.entries())if((r.get(e)??"")!==t)return!1;return!0}}}]);
|
|
2
|
+
//# sourceMappingURL=8518.92aaa235.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks/8518.92aaa235.js","mappings":"wPAoBAA,EAAAA,EAAAA,qBAAoBC,EAAAA,GAAIC,EAAAA,GACxB,MAAMC,GAAiBC,EAAAA,EAAAA,WAAiC,cAmBlDC,GAAgBD,EAAAA,EAAAA,WAKpB,YAAa,CACbE,SAAU,SACVC,SAAU,WAGNC,GAAcJ,EAAAA,EAAAA,WAAyC,WAMvDK,EAAuB,yBACvBC,EAAmB,EAClB,SAASC,EACdC,GAEA,MAAM,IAAQC,EAAAA,EAAAA,gBAAeZ,EAAAA,KACvB,SAAEa,EAAQ,YAAEC,GAAgBH,EAC5BI,EAAQF,EAASE,OAChBC,EAAcC,IAAmBC,E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///./src/nav-menu/i18n.ts","webpack:///./src/nav-menu/site-map/constants.ts","webpack:///./src/nav-menu/site-map/CollectService.ts","webpack:///./src/nav-menu/site-map/ItemTag.tsx","webpack:///./src/nav-menu/site-map/processor.ts","webpack:///./src/nav-menu/site-map/GroupItem.tsx","webpack:///./src/nav-menu/site-map/SiteMapItem.tsx","webpack:///./src/nav-menu/utils.tsx","webpack:///./src/nav-menu/host-context.css","webpack:///./src/nav-menu/nav-menu.shadow.css","webpack:///./src/nav-menu/site-map/GroupItem.shadow.css","webpack:///./src/nav-menu/site-map/ItemTag.shadow.css","webpack:///./src/nav-menu/site-map/SiteMapItem.shadow.css","webpack:///./src/nav-menu/host-context.css?ac7e","webpack:///../../src/menu.ts"],"sourcesContent":["import React, { useMemo, useState, useRef } from \"react\";\nimport classnames from \"classnames\";\nimport { renderLinkCom } from \"./utils.js\";\nimport { uniq } from \"lodash\";\nimport type {\n SidebarMenuGroup,\n SidebarMenuItem,\n SidebarMenuSimpleItem,\n} from \"@next-shared/general/types\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { ReactNextElement } from \"@next-core/react-element\";\nimport type { Popover, PopoverProps } from \"@next-bricks/basic/popover\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { JsonStorage } from \"@next-shared/general/JsonStorage\";\nimport { K, NS, locales } from \"./i18n.js\";\nimport { useTranslation, initializeReactI18n } from \"@next-core/i18n/react\";\n\ninitializeReactI18n(NS, locales);\nconst WrappedPopover = wrapBrick<Popover, PopoverProps>(\"eo-popover\");\ninterface SearchProps {\n value?: string;\n placeholder?: string;\n autoFocus?: boolean;\n clearable?: boolean;\n trim?: boolean;\n debounceTime?: number;\n}\n\ninterface SearchEvents {\n change: CustomEvent<string>;\n search: CustomEvent<string>;\n}\n\ninterface SearchEventsMap {\n onChange: \"change\";\n onSearch: \"search\";\n}\nconst WrappedSearch = wrapBrick<\n ReactNextElement,\n SearchProps,\n SearchEvents,\n SearchEventsMap\n>(\"eo-search\", {\n onChange: \"change\",\n onSearch: \"search\",\n});\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\ninterface ThreeLevelMenuPopoverContentProps {\n menuItem: SidebarMenuGroup;\n selectedKey: string[];\n}\nconst LOCAL_STORAGE_PREFIX = \"threeLevelCategoryMenu\";\nconst maxVisitorLength = 6;\nexport function ThreeLevelMenuPopoverContent(\n props: ThreeLevelMenuPopoverContentProps\n): React.ReactElement {\n const { t } = useTranslation(NS);\n const { menuItem, selectedKey } = props;\n const items = menuItem.items as SidebarMenuGroup[];\n const [searchResult, setSearchResult] = useState<SidebarMenuSimpleItem[]>([]);\n const [searchKey, setSearchKey] = useState(\"\");\n const triggerRef = useRef<HTMLDivElement>(null);\n const nameSpace = `${LOCAL_STORAGE_PREFIX}_${menuItem.title}`;\n const storage = useMemo(() => new JsonStorage(localStorage), []);\n const searchHistory = (storage.getItem(nameSpace) as string[]) || [];\n\n const handleSearch = (e: CustomEvent<string>) => {\n setSearchKey(e.detail);\n if (e.detail) {\n const list = uniq([e.detail, ...searchHistory]);\n if (list.length > maxVisitorLength) {\n list.pop();\n }\n storage.setItem(nameSpace, list);\n setSearchResult(\n items\n .flatMap((i) => (i.items as SidebarMenuSimpleItem[]) || [])\n .filter((i) =>\n (i.text as string)\n .toLowerCase()\n .includes((e.detail as string).trim().toLowerCase())\n )\n );\n } else {\n setSearchResult([]);\n }\n };\n\n const popoverTriggerClick = () => {\n triggerRef.current?.click();\n };\n\n return (\n <div className={\"three-level-menu-container\"}>\n <div\n className=\"three-level-menu-search-container\"\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n <WrappedSearch\n placeholder={t(K.SEARCH_BY_MENU_NAME) as string}\n onSearch={handleSearch}\n onFocus={popoverTriggerClick}\n onBlur={popoverTriggerClick}\n />\n <WrappedPopover\n trigger=\"click\"\n placement={\"bottom-start\"}\n anchorDisplay=\"block\"\n distance={0}\n >\n <div slot=\"anchor\" ref={triggerRef}></div>\n {\n <div className=\"three-level-menu-search-result\">\n {!!searchResult.length &&\n searchResult.map((i) => renderLinkCom(i, { width: \"100%\" }))}\n {searchKey && !searchResult.length && (\n <div\n style={{\n height: \"100px\",\n textAlign: \"center\",\n lineHeight: \"100px\",\n }}\n >\n {t(K.NO_DATA)}\n </div>\n )}\n </div>\n }\n </WrappedPopover>\n </div>\n {!!searchHistory.length && (\n <div className=\"three-level-menu-search-history-container\">\n <div className=\"three-level-menu-search-history-title\">\n {t(K.SEARCH_HISTORY)}\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"delete\"\n className=\"three-level-menu-search-history-icon\"\n />\n </div>\n <div>\n {searchHistory.map((h) => (\n <span key={h} className=\"three-level-menu-search-history-text\">\n {h}\n </span>\n ))}\n </div>\n </div>\n )}\n <div\n className={\"three-level-menu-item-container\"}\n style={{\n gridTemplateColumns: `repeat(${\n items.length > 4 ? 4 : items.length\n },1fr)`,\n }}\n >\n {items.map((item: SidebarMenuGroup, index: number) => (\n <div key={index}>\n <div className=\"three-level-menu-item-title-container\">\n <span className=\"three-level-menu-item-title-icon\"></span>\n <span className=\"three-level-menu-item-title\">{item.title}</span>\n </div>\n {item.items?.map((i) => (\n <span\n key={i.key}\n className={classnames({\n active: i.key ? selectedKey.includes(i.key) : false,\n })}\n >\n {renderLinkCom(i as SidebarMenuSimpleItem, { width: \"100%\" })}\n </span>\n ))}\n </div>\n ))}\n </div>\n </div>\n );\n}\n","export enum K {\n SEARCH_BY_MENU_NAME = \"SEARCH_BY_MENU_NAME\",\n SEARCH_HISTORY = \"SEARCH_HISTORY\",\n NO_DATA = \"NO_DATA\",\n QUICK_ACCESS = \"QUICK_ACCESS\",\n REMOVE_ITEM_FROM_QUICK_ACCESS = \"REMOVE_ITEM_FROM_QUICK_ACCESS\",\n ADD_ITEM_TO_QUICK_ACCESS = \"ADD_ITEM_TO_QUICK_ACCESS\",\n NO_DATA_TIPS_IN_QUICK_ACCESS = \"NO_DATA_TIPS_IN_QUICK_ACCESS\",\n SITE_MAP_SEARCH_RECOMMEND = \"SITE_MAP_SEARCH_RECOMMEND\",\n MAX_COLLECT_COUNT_TIPS = \"MAX_COLLECT_COUNT_TIPS\",\n NO_DATA_SEARCH_INFO = \"NO_DATA_SEARCH_INFO\",\n SEARCH_ITEM_PLACEHOLDER = \"SEARCH_ITEM_PLACEHOLDER\",\n}\n\nconst en: Locale = {\n SEARCH_BY_MENU_NAME: \"Search by menu name\",\n SEARCH_HISTORY: \"Search history\",\n NO_DATA: \"No data\",\n QUICK_ACCESS: \"Quick Access\",\n REMOVE_ITEM_FROM_QUICK_ACCESS: \"Remove from Quick Access\",\n ADD_ITEM_TO_QUICK_ACCESS: \"Add to Quick Access\",\n NO_DATA_TIPS_IN_QUICK_ACCESS:\n \"No quick access resources have been added yet. Please add from the list below or after searching\",\n SITE_MAP_SEARCH_RECOMMEND: \"Search recommend\",\n MAX_COLLECT_COUNT_TIPS: \"Need to delete some favorites in order to add\",\n NO_DATA_SEARCH_INFO: \"The search result is empty, please enter again\",\n SEARCH_ITEM_PLACEHOLDER: \"Please enter keywords to search\",\n};\n\nconst zh: Locale = {\n SEARCH_BY_MENU_NAME: \"通过菜单名称搜索\",\n SEARCH_HISTORY: \"历史搜索\",\n NO_DATA: \"暂无数据\",\n QUICK_ACCESS: \"快捷访问\",\n REMOVE_ITEM_FROM_QUICK_ACCESS: \"从快捷访问移除\",\n ADD_ITEM_TO_QUICK_ACCESS: \"添加至快捷访问\",\n NO_DATA_TIPS_IN_QUICK_ACCESS: \"暂未添加快捷访问资源,从下方列表或搜索后添加\",\n SITE_MAP_SEARCH_RECOMMEND: \"搜索推荐\",\n MAX_COLLECT_COUNT_TIPS: \"需删除部分收藏,才能添加\",\n NO_DATA_SEARCH_INFO: \"搜索结果为空,请重新输入\",\n SEARCH_ITEM_PLACEHOLDER: \"请输入关键词搜索\",\n};\n\nexport const NS = \"bricks/nav/nav-menu\";\n\nexport const locales = { en, zh };\n\ntype Locale = { [key in K]: string };\n","import React from \"react\";\n\nexport enum DRAG_DIRECTION {\n Left = \"left\",\n Right = \"right\",\n}\n\nexport interface ContextOfDragProps {\n groupId: string;\n direction?: DRAG_DIRECTION;\n overElement?: HTMLElement;\n allowDrag?: boolean;\n onAllowDrag?: (enable: boolean) => void;\n onDragStart?: (e: React.DragEvent) => void;\n onDragOver?: (e: React.DragEvent) => void;\n onDragEnd?: (e: React.DragEvent) => void;\n onFavoriteUpdate?: (list: any[]) => void;\n}\n\nexport const collectModule = \"sidebarMenuCollect\";\n\nexport const DragContext = React.createContext<ContextOfDragProps>(\n {} as ContextOfDragProps\n);\n","import type { SidebarMenuSimpleItem } from \"@next-shared/general/types\";\nimport {\n MyCollectionApi_listMyCollection,\n MyCollectionApi_ListMyCollectionResponseBody,\n MyCollectionApi_upsertMyCollection,\n} from \"@next-api-sdk/user-service-sdk\";\nimport { DRAG_DIRECTION, collectModule } from \"./constants.js\";\nimport { cloneDeep } from \"lodash\";\nimport { handleHttpError } from \"@next-core/runtime\";\n\nexport class CollectService {\n private maxCollectLength: number;\n private collectMap: Map<string, SidebarMenuSimpleItem[]> = new Map();\n private collectPromise: Map<string, Promise<SidebarMenuSimpleItem[]>> =\n new Map();\n\n constructor(maxCollectLength?: number) {\n this.maxCollectLength = maxCollectLength ?? 10;\n }\n\n public getFavoritesById(id: string): SidebarMenuSimpleItem[] {\n return cloneDeep(this.collectMap.get(id)) ?? [];\n }\n\n public async fetchFavorites(id: string): Promise<SidebarMenuSimpleItem[]> {\n const cachedPromise = this.collectPromise.get(id);\n if (cachedPromise) {\n const collectList = this.collectMap.get(id);\n\n return collectList ? collectList : cachedPromise;\n }\n\n const favoritesPromise = MyCollectionApi_listMyCollection({\n module: collectModule,\n collectionName: id,\n }).then((result) => {\n const list = result.payloads\n ?.map((item) => item.extInfo)\n .filter(Boolean) as SidebarMenuSimpleItem[];\n this.collectMap.set(id, list);\n\n return list;\n }) as Promise<SidebarMenuSimpleItem[]>;\n\n this.collectPromise.set(id, favoritesPromise);\n\n return favoritesPromise;\n }\n\n public setItemAsFavorite(id: string, item: SidebarMenuSimpleItem): void {\n const list = this.getFavoritesById(id);\n\n if (list.length >= this.maxCollectLength) {\n list.pop();\n }\n\n list.unshift(item);\n this.updateFavoriteItems(id, list);\n }\n\n public updateFavoriteItems(id: string, list: SidebarMenuSimpleItem[]): void {\n try {\n this.collectMap.set(id, list);\n MyCollectionApi_upsertMyCollection({\n module: collectModule,\n collectionName: id,\n payloads: list?.map((item) => ({\n name: item.text,\n url: item.to,\n extInfo: item,\n })) as MyCollectionApi_ListMyCollectionResponseBody[\"payloads\"],\n });\n } catch (error) {\n // istanbul ignore next\n handleHttpError(error);\n }\n }\n\n private equalItem(\n prevItem: SidebarMenuSimpleItem,\n item: SidebarMenuSimpleItem\n ): boolean {\n return prevItem.text === item.text && prevItem.to === item.to;\n }\n\n public removeItemFromFavorite(id: string, item: SidebarMenuSimpleItem): void {\n const list = this.getFavoritesById(id);\n const index = list.findIndex((row) => this.equalItem(row, item));\n // istanbul ignore else\n if (index !== -1) {\n list.splice(index, 1);\n this.updateFavoriteItems(id, list);\n }\n }\n\n public isCollected(id: string, item: SidebarMenuSimpleItem): boolean {\n const list = this.getFavoritesById(id);\n return list.some((row) => this.equalItem(row, item));\n }\n\n public toggleFavorite(id: string, item: SidebarMenuSimpleItem): void {\n if (this.isCollected(id, item)) {\n this.removeItemFromFavorite(id, item);\n } else {\n if (this.checkMaxCapacity(id)) return;\n this.setItemAsFavorite(id, item);\n }\n }\n\n public moveFavoriteTo(\n id: string,\n option: {\n from: SidebarMenuSimpleItem;\n to: SidebarMenuSimpleItem;\n direction: DRAG_DIRECTION;\n }\n ): SidebarMenuSimpleItem[] {\n const { from, to, direction } = option;\n\n const list = this.getFavoritesById(id);\n if (this.equalItem(from, to)) return list;\n\n const fromIndex = list.findIndex((row) => this.equalItem(row, from));\n\n // istanbul ignore else\n if (fromIndex !== -1) {\n list.splice(fromIndex, 1);\n\n const toIndex = list.findIndex((row) => this.equalItem(row, to));\n\n // istanbul ignore else\n if (toIndex !== -1) {\n if (direction === DRAG_DIRECTION.Left) {\n list.splice(toIndex, 0, from);\n } else {\n list.splice(toIndex + 1, 0, from);\n }\n\n this.updateFavoriteItems(id, list);\n }\n }\n\n return list;\n }\n\n checkMaxCapacity(groupId: string): boolean {\n return this.getFavoritesById(groupId).length >= this.maxCollectLength;\n }\n}\n\nexport const collectService = new CollectService();\n","import React, {\n useMemo,\n useCallback,\n useRef,\n useState,\n useEffect,\n useContext,\n DragEvent,\n} from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport { Link, LinkProps } from \"@next-bricks/basic/link\";\n\nimport { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport classNames from \"classnames\";\nimport { SidebarMenuSimpleItem } from \"@next-shared/general/types\";\nimport { K, NS, locales } from \"../i18n.js\";\nimport { collectService } from \"./CollectService.js\";\nimport { useTranslation, initializeReactI18n } from \"@next-core/i18n/react\";\nimport { DRAG_DIRECTION, DragContext } from \"./constants.js\";\n\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\ninitializeReactI18n(NS, locales);\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst WrappedTooltip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\n\ninterface CellItemProps {\n data: SidebarMenuSimpleItem;\n suffix?: React.ReactNode;\n className?: string;\n}\n\nexport type OnFavoriteCallback = (collectList: SidebarMenuSimpleItem[]) => void;\n\ninterface PlaceholderCompProps {\n data: SidebarMenuSimpleItem;\n direction: DRAG_DIRECTION;\n onDragOver?: (e: DragEvent) => void;\n}\nexport function PlaceholderDropComp({\n data,\n onDragOver,\n direction,\n}: PlaceholderCompProps) {\n const { groupId, onFavoriteUpdate } = useContext(DragContext);\n const handleDrop = (e: DragEvent) => {\n const formData = JSON.parse(e.dataTransfer.getData(\"application/json\"));\n\n const newDataList = collectService.moveFavoriteTo(groupId, {\n from: formData,\n to: data,\n direction,\n });\n\n onFavoriteUpdate?.(newDataList);\n };\n\n return (\n <div\n className=\"indicate-wrapper\"\n data-direction={direction}\n data-to={data.to}\n onDragEnter={(e) =>\n ((e.target as HTMLElement).style.background = \"var(--palette-blue-1)\")\n }\n onDragLeave={(e) =>\n ((e.target as HTMLElement).style.background = \"transparent\")\n }\n data-text={data.text}\n onDragOver={onDragOver}\n onDrop={handleDrop}\n />\n );\n}\n\nexport function ItemTag(props: CellItemProps): React.ReactElement {\n const { data, suffix, className } = props;\n\n const {\n allowDrag,\n onDragStart,\n overElement,\n direction,\n onDragEnd,\n onDragOver,\n } = useContext(DragContext);\n const containerRef = useRef<any>(null);\n\n const [isDragIng, setIsDragIng] = useState(false);\n\n const isActive = useMemo(\n () =>\n overElement &&\n overElement.dataset.to == data.to &&\n overElement.dataset.text === overElement.dataset.text,\n [overElement, data]\n );\n\n const handleDragStart = (e: React.DragEvent) => {\n if (!allowDrag) {\n e.preventDefault();\n } else {\n setIsDragIng(true);\n e.dataTransfer?.setData(\"application/json\", JSON.stringify(data));\n onDragStart?.(e);\n }\n };\n\n const handleDragEnd = (e: React.DragEvent) => {\n setIsDragIng(false);\n onDragEnd?.(e);\n };\n\n const handleOver = (e: React.DragEvent) => {\n e.dataTransfer.dropEffect = \"none\";\n onDragOver?.(e);\n };\n\n return (\n <>\n {isActive && direction === DRAG_DIRECTION.Left && (\n <PlaceholderDropComp\n data={data}\n onDragOver={onDragOver}\n direction={DRAG_DIRECTION.Left}\n />\n )}\n <WrappedLink\n data-to={data.to}\n data-text={data.text}\n ref={containerRef}\n draggable\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n onDragOver={handleOver}\n className={classNames(\"tag-container\", className, {\n \"is-drag\": isDragIng,\n })}\n url={data.to as string}\n href={data.href}\n target={data.target as LinkProps[\"target\"]}\n >\n <span className=\"tag-text ellipsis\" title={data.text}>\n {data.text}\n </span>\n <span className=\"tag-suffix\" onClick={(e) => e.preventDefault()}>\n {suffix}\n </span>\n </WrappedLink>\n\n {isActive && direction === DRAG_DIRECTION.Right && (\n <PlaceholderDropComp\n data={data}\n onDragOver={onDragOver}\n direction={DRAG_DIRECTION.Right}\n />\n )}\n </>\n );\n}\n\ninterface QuickVisitTagProps extends CellItemProps {\n groupId: string;\n onFavorite?: OnFavoriteCallback;\n}\n\nexport function QuickVisitItem(props: QuickVisitTagProps): React.ReactElement {\n const { t } = useTranslation(NS);\n const { onAllowDrag } = useContext(DragContext);\n const { data, onFavorite, groupId } = props;\n const suffixRef = useRef<any>();\n const iconRef = useRef<any>();\n\n const handleRemove = useCallback(() => {\n collectService.removeItemFromFavorite(groupId, data);\n onFavorite?.(collectService.getFavoritesById(groupId));\n }, [groupId, data, onFavorite]);\n\n const handleMouseDown = () => {\n onAllowDrag?.(true);\n };\n\n useEffect(() => {\n const icon = iconRef.current;\n icon.addEventListener(\"click\", handleRemove);\n\n return () => {\n icon.removeEventListener(\"click\", handleRemove);\n };\n }, [handleRemove]);\n\n useEffect(() => {\n const suffix = suffixRef.current;\n const handleClick = (e: MouseEvent) => {\n e.preventDefault();\n };\n suffix.addEventListener(\"click\", handleClick);\n\n return () => {\n suffix.removeEventListener(\"click\", handleClick);\n };\n }, []);\n\n const suffixGroups = useMemo(\n () => (\n <div className=\"operation\" ref={suffixRef}>\n <WrappedTooltip\n content={t(K.REMOVE_ITEM_FROM_QUICK_ACCESS)!}\n hoist\n placement=\"bottom\"\n className=\"close\"\n >\n <WrappedIcon lib=\"antd\" icon=\"close\" ref={iconRef} />\n </WrappedTooltip>\n <span className=\"drag-wrapper\" onMouseDown={handleMouseDown}>\n :::\n </span>\n </div>\n ),\n [t, handleRemove]\n );\n\n return (\n <ItemTag className=\"visit-container\" suffix={suffixGroups} data={data} />\n );\n}\n\ninterface StarIconProps {\n onFavorite?: OnFavoriteCallback;\n className?: string;\n groupId: string;\n data: SidebarMenuSimpleItem;\n active?: boolean;\n}\n\nexport function StarIcon({\n onFavorite,\n className,\n groupId,\n data,\n active,\n}: StarIconProps): React.ReactElement {\n const { t } = useTranslation(NS);\n const iconRef = useRef<any>();\n\n const handleClick = (e: React.MouseEvent) => {\n e.preventDefault();\n collectService.toggleFavorite(groupId, data);\n onFavorite?.(collectService.getFavoritesById(groupId));\n };\n\n useEffect(() => {\n // workaround for prevent Link jump when click.\n const icon = iconRef.current;\n icon.addEventListener(\"click\", handleClick);\n\n return () => {\n icon.removeEventListener(\"click\", handleClick);\n };\n }, []);\n\n return (\n <WrappedTooltip\n content={\n active\n ? t(K.REMOVE_ITEM_FROM_QUICK_ACCESS)!\n : collectService.checkMaxCapacity(groupId)\n ? t(K.MAX_COLLECT_COUNT_TIPS)!\n : t(K.ADD_ITEM_TO_QUICK_ACCESS)!\n }\n className={classNames(\"star-icon\", className)}\n >\n <WrappedIcon\n ref={iconRef}\n className={classNames({ active })}\n lib=\"antd\"\n icon=\"star\"\n {...(active ? { theme: \"filled\" } : {})}\n />\n </WrappedTooltip>\n );\n}\n\ninterface RecommendItemProps extends CellItemProps {\n active?: boolean;\n groupId: string;\n onFavorite?: OnFavoriteCallback;\n}\n\nexport function RecommendItem(props: RecommendItemProps): React.ReactElement {\n const { data, className, groupId, onFavorite, active } = props;\n\n const suffixGroups = useMemo(\n () => (\n <StarIcon\n groupId={groupId}\n active={active}\n className=\"star\"\n data={data}\n onFavorite={onFavorite}\n />\n ),\n [data, groupId, onFavorite, active]\n );\n\n return (\n <ItemTag\n className={classNames(\"recommend-container\", className)}\n suffix={suffixGroups}\n data={data}\n />\n );\n}\n","import {\n SidebarMenuItem,\n SidebarMenuGroup,\n SidebarMenuSimpleItem,\n} from \"@next-shared/general/types\";\n\nfunction walkMenuItem(item: SidebarMenuItem, list: SidebarMenuSimpleItem[]) {\n if (\n (item as SidebarMenuGroup).type === \"group\" &&\n Array.isArray((item as SidebarMenuGroup).items)\n ) {\n walkMenuItems((item as SidebarMenuGroup).items, list);\n } else {\n list.push(item as SidebarMenuSimpleItem);\n }\n}\n\nfunction walkMenuItems(\n items: SidebarMenuItem[],\n list: SidebarMenuSimpleItem[]\n): void {\n for (const item of items) {\n walkMenuItem(item, list);\n }\n}\n\nexport function flatMenuItems(item: SidebarMenuItem): SidebarMenuSimpleItem[] {\n const list: SidebarMenuSimpleItem[] = [];\n\n walkMenuItem(item, list);\n\n return list;\n}\n\nexport function processGroupItems(groups: SidebarMenuGroup[]): Array<{\n groupFrom: string;\n groups: SidebarMenuGroup[];\n}> {\n const groupCategoryMap = new Map<string, SidebarMenuGroup[]>();\n const categoryOrder = new Set<string>();\n\n groups?.forEach((item) => {\n const from = item.groupFrom ?? \"default\";\n categoryOrder.add(from);\n\n const value = groupCategoryMap.get(from);\n\n if (!value) {\n groupCategoryMap.set(from, [item]);\n } else {\n value!.push(item);\n }\n });\n\n return Array.from(categoryOrder).map((key) => ({\n groupFrom: key,\n groups: groupCategoryMap!.get(key)!,\n }));\n}\n","import React, { useEffect, useState } from \"react\";\nimport type {\n SidebarMenuSimpleItem,\n SidebarMenuGroup,\n} from \"@next-shared/general/types\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport { StarIcon, OnFavoriteCallback } from \"./ItemTag.js\";\nimport { Link, LinkProps } from \"@next-bricks/basic/link\";\nimport { collectService } from \"./CollectService.js\";\nimport { processGroupItems } from \"./processor.js\";\nimport classNames from \"classnames\";\n\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\ninterface GroupViewProps {\n groups: SidebarMenuGroup[];\n groupId: string;\n selectedKey?: string[];\n onFavorite: OnFavoriteCallback;\n}\n\nexport const itemColumnWidth = 240;\n\nexport function GroupView(props: GroupViewProps): React.ReactElement {\n const { groupId, selectedKey, onFavorite } = props;\n const groupMenus = processGroupItems(props.groups);\n\n return (\n <div className=\"group-view\">\n {groupMenus.map((item, index) => {\n return (\n <div key={index}>\n {index !== 0 && <div className=\"divider\" />}\n {item.groupFrom === \"default\" ? (\n <DefaultGroup\n groupId={groupId}\n selectedKey={selectedKey}\n groups={item.groups}\n onFavorite={onFavorite}\n />\n ) : (\n <CustomGroup\n groupId={groupId}\n selectedKey={selectedKey}\n groups={item.groups}\n onFavorite={onFavorite}\n />\n )}\n </div>\n );\n })}\n </div>\n );\n}\n\ninterface BaseGroupProps {\n groupId: string;\n selectedKey?: string[];\n onFavorite: OnFavoriteCallback;\n groups: SidebarMenuGroup[];\n}\nexport function DefaultGroup(props: BaseGroupProps): React.ReactElement {\n const { groupId, onFavorite, selectedKey, groups } = props;\n\n const groupRef = React.useRef<HTMLDivElement>(null);\n const [columnCount, setColumnCount] = useState<number>();\n\n useEffect(() => {\n // istanbul ignore next\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (entry.target === groupRef.current) {\n const width = entry.contentRect.width;\n\n if (width) {\n setColumnCount(Math.floor(width / itemColumnWidth));\n }\n }\n }\n });\n\n resizeObserver.observe(groupRef.current as HTMLDivElement);\n\n return () => resizeObserver.disconnect();\n }, []);\n\n return (\n <div\n className=\"group\"\n ref={groupRef}\n style={\n (columnCount as number) < groups?.length\n ? { columnCount, columnWidth: itemColumnWidth }\n : {\n display: \"grid\",\n gridTemplateColumns: `repeat(auto-fit, ${itemColumnWidth}px)`,\n }\n }\n >\n {groups.map((group) => (\n <div key={group.key} className=\"group-item\">\n <div className=\"title\">{group.title}</div>\n <div className=\"content\">\n {group.items.map((item) => (\n <GroupItem\n key={item.key}\n groupId={groupId}\n selectedKey={selectedKey}\n data={item as SidebarMenuSimpleItem}\n onFavorite={onFavorite}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nexport function CustomGroup(props: BaseGroupProps): React.ReactElement {\n const { groupId, onFavorite, selectedKey, groups } = props;\n\n return (\n <div className=\"custom-group\">\n {groups.map((group) => (\n <div key={group.key}>\n <div className=\"title\">{group.title}</div>\n <div\n className=\"custom-content\"\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(auto-fit, ${itemColumnWidth}px)`,\n }}\n >\n {group.items.map((item) => (\n <GroupItem\n key={item.key}\n selectedKey={selectedKey}\n groupId={groupId}\n data={item as SidebarMenuSimpleItem}\n onFavorite={onFavorite}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n );\n}\n\ninterface GroupItemProps {\n data: SidebarMenuSimpleItem;\n selectedKey?: string[];\n groupId: string;\n onFavorite: OnFavoriteCallback;\n}\nexport function GroupItem(props: GroupItemProps): React.ReactElement {\n const { data, groupId, onFavorite, selectedKey } = props;\n\n return (\n <WrappedLink\n key={data.key}\n icon={data.icon}\n url={data.to as string}\n href={data.href}\n target={data.target as LinkProps[\"target\"]}\n className={classNames(\"item-link\", {\n active: selectedKey?.includes(data.key as string),\n })}\n >\n <span className=\"ellipsis\" title={data.text}>\n {data.text}\n </span>\n <span className=\"icon-wrapper\">\n <StarIcon\n active={collectService.isCollected(groupId, data)}\n groupId={groupId}\n data={data}\n onFavorite={onFavorite}\n />\n </span>\n </WrappedLink>\n );\n}\n","import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type {\n SidebarMenuGroup,\n SidebarMenuSimpleItem,\n} from \"@next-shared/general/types\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport { QuickVisitItem, RecommendItem } from \"./ItemTag.js\";\nimport { GroupView } from \"./GroupItem.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { K, NS } from \"../i18n.js\";\nimport { DragContext } from \"./constants.js\";\nimport { useTranslation } from \"@next-core/i18n/react\";\nimport { collectService } from \"./CollectService.js\";\nimport { flatMenuItems } from \"./processor.js\";\nimport { DRAG_DIRECTION } from \"./constants.js\";\nimport classNames from \"classnames\";\nimport { throttle, debounce } from \"lodash\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport interface InputEvents {\n change: CustomEvent<string>;\n}\n\nexport interface InputEventsMap {\n onValueChange: \"change\";\n}\n\nconst WrappedInput = wrapBrick<any, any, InputEvents, InputEventsMap>(\n \"eo-input\",\n {\n onValueChange: \"change\",\n }\n);\n\ninterface SiteMapItemProps {\n menuGroup: SidebarMenuGroup;\n selectedKey?: string[];\n visible?: boolean;\n}\n\nexport function findDropElement(element: HTMLElement): HTMLElement | undefined {\n let node = element;\n\n while (node) {\n if (node.draggable || node.className === \"indicate-wrapper\") {\n return node;\n }\n\n node = node.parentElement as HTMLElement;\n }\n}\n\nexport function isValidDragAction(\n dragElement: HTMLElement,\n dropElement: HTMLElement\n): boolean {\n return (\n dragElement &&\n dropElement &&\n !(\n dragElement.dataset.to === dropElement.dataset.to &&\n dragElement.dataset.text === dropElement.dataset.text\n )\n );\n}\n\nexport function SiteMapItem(props: SiteMapItemProps) {\n const { t } = useTranslation(NS);\n const { menuGroup, selectedKey, visible } = props;\n const groupId = menuGroup.groupId as string;\n\n const [favoriteList, setFavoriteList] = useState<SidebarMenuSimpleItem[]>([]);\n const flatItems = useMemo(() => flatMenuItems(menuGroup), [menuGroup]);\n const [q, setQ] = useState<string>();\n const [filter, setFilters] = useState<SidebarMenuSimpleItem[]>([]);\n const [dragElement, setDragElement] = useState<HTMLElement>();\n const [overElement, setOverElement] = useState<HTMLElement>();\n const [allowDrag, setAllowDrag] = useState<boolean>();\n const [direction, setDirection] = useState<DRAG_DIRECTION>();\n const [initialized, setInitialized] = useState(false);\n\n useEffect(() => {\n if (visible && !initialized) {\n setInitialized(true);\n }\n }, [visible, initialized]);\n\n const handleFavorite = (collectList: SidebarMenuSimpleItem[]) => {\n setFavoriteList(collectList);\n };\n\n const handleSearch = useCallback(\n (e: CustomEvent<string>): void => {\n const v = e.detail;\n setQ(e.detail);\n\n setFilters(\n !v\n ? flatItems\n : flatItems.filter((item) =>\n item.text.toLowerCase().includes(e.detail.toLowerCase())\n )\n );\n },\n [flatItems]\n );\n\n const debouncedHandleSearch = useMemo(\n () => debounce(handleSearch, 200),\n [handleSearch]\n );\n\n const handleDragStart = (e: React.DragEvent): void => {\n setDragElement(e.target as HTMLElement);\n };\n\n const handleDragOver = useMemo(\n () =>\n throttle((e: React.DragEvent): void => {\n e.preventDefault();\n\n const dropElement = findDropElement(e.target as HTMLElement);\n setOverElement(dropElement);\n\n if (\n dropElement &&\n isValidDragAction(dropElement, dragElement as HTMLElement)\n ) {\n if (dropElement.className === \"indicate-wrapper\") {\n setDirection(dropElement.dataset.direction as DRAG_DIRECTION);\n } else {\n const { width, left } = dropElement.getBoundingClientRect();\n\n const right = e.clientX > left + width / 2;\n setDirection(right ? DRAG_DIRECTION.Right : DRAG_DIRECTION.Left);\n }\n } else {\n setDirection(undefined);\n }\n }),\n [dragElement]\n );\n\n const handleDragEnd = (): void => {\n setDragElement(undefined);\n setDirection(undefined);\n setAllowDrag(false);\n };\n\n const handleAllowDrag = (enable: boolean): void => {\n setAllowDrag(enable);\n };\n\n useEffect(() => {\n (async () => {\n if (visible) {\n const list = await collectService.fetchFavorites(groupId);\n setFavoriteList(list);\n }\n })();\n }, [groupId, visible]);\n\n return (\n initialized && (\n <div className=\"site-map\">\n <div className=\"search-wrapper\">\n <WrappedInput\n className=\"search-input\"\n style={{ width: \"100%\" }}\n onValueChange={debouncedHandleSearch}\n placeholder={t(K.SEARCH_ITEM_PLACEHOLDER)}\n >\n <WrappedIcon slot=\"prefix\" lib=\"antd\" icon=\"search\" />\n </WrappedInput>\n </div>\n\n {!q && (\n <div>\n {favoriteList.length !== 0 && (\n <div\n className={classNames(\"visit-access\", {\n hasData: favoriteList.length,\n })}\n >\n <span className=\"title\">{t(K.QUICK_ACCESS)}</span>\n <DragContext.Provider\n value={{\n groupId,\n overElement,\n direction,\n allowDrag,\n onDragStart: handleDragStart,\n onDragOver: handleDragOver,\n onDragEnd: handleDragEnd,\n onAllowDrag: handleAllowDrag,\n onFavoriteUpdate: handleFavorite,\n }}\n >\n <div className=\"tag-wrapper\">\n {favoriteList.map((item) => (\n <QuickVisitItem\n onFavorite={handleFavorite}\n groupId={groupId}\n key={item.key}\n data={item}\n />\n ))}\n </div>\n </DragContext.Provider>\n </div>\n )}\n\n <GroupView\n groupId={groupId}\n selectedKey={selectedKey}\n groups={menuGroup.items as SidebarMenuGroup[]}\n onFavorite={handleFavorite}\n />\n </div>\n )}\n\n {q && (\n <div className=\"search-panel\">\n <span className=\"title\">{t(K.SITE_MAP_SEARCH_RECOMMEND)}</span>\n {filter.length ? (\n <div className=\"recommend-wrapper\">\n {filter.map((item) => (\n <RecommendItem\n key={item.key}\n groupId={groupId}\n data={item}\n onFavorite={handleFavorite}\n active={collectService.isCollected(groupId, item)}\n />\n ))}\n </div>\n ) : (\n <div className=\"no-data-tips\">{t(K.NO_DATA_SEARCH_INFO)}</div>\n )}\n </div>\n )}\n </div>\n )\n );\n}\n","import React from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n SidebarMenuGroup,\n SidebarMenuItem,\n SidebarMenuSimpleItem,\n} from \"@next-shared/general/types\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nconst WrappedLinkItem = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport function isGroup(item: SidebarMenuItem): item is SidebarMenuGroup {\n return item.type === \"group\";\n}\n\nexport function isSubMenu(\n item: SidebarMenuGroup,\n groupAsSubMenu?: boolean\n): item is SidebarMenuGroup {\n return Boolean(\n item.type === \"subMenu\" || (groupAsSubMenu && item.type === \"group\")\n );\n}\n\nexport function isSimple(item: SidebarMenuItem): item is SidebarMenuSimpleItem {\n return item.type === \"default\" || !item.type;\n}\n\nexport const renderLinkCom = (\n item: SidebarMenuSimpleItem,\n linkStyle?: React.CSSProperties,\n labelStyle?: React.CSSProperties\n): React.ReactElement => {\n return (\n <WrappedLinkItem\n type=\"plain\"\n key={item.key}\n url={item.to as string}\n href={item.href}\n target={item.target as LinkProps[\"target\"]}\n style={linkStyle}\n >\n <span className=\"menu-item-label\" style={{ ...labelStyle }}>\n {item.text}\n </span>\n </WrappedLinkItem>\n );\n};\n\nexport const renderSpanCom = (\n item: SidebarMenuGroup,\n subMenu?: boolean,\n style?: React.CSSProperties\n): React.ReactElement => {\n return (\n <span key={item.key} className=\"menu-item-label\" style={{ ...style }}>\n {item.title}\n {subMenu && <WrappedIcon lib=\"fa\" icon=\"angle-right\" />}\n </span>\n );\n};\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--eo-three-level-menu-search-input-background:linear-gradient(90deg,#e8eef6 0%,rgba(233,234,243,0) 100%);--eo-three-level-menu-hover-color:#6bb3ff;--eo-three-level-menu-title-color:#0b5ad9;--eo-three-level-menu-active-color:#1a7aff;--eo-three-level-menu-search-tag-color:rgb(89,89,89);--eo-three-level-menu-search-tag-background:rgb(245,245,245)}html[data-theme=\"dark\"],\nhtml[data-theme=\"dark-v2\"]{--eo-three-level-menu-search-input-background:linear-gradient(124deg,rgba(255,255,255,0.36) 0%,rgba(255,255,255,0) 100%);--eo-three-level-menu-hover-color:rgba(54,95,175,0.85);--eo-three-level-menu-title-color:#6597e8;--eo-three-level-menu-active-color:#3f75dd;--eo-three-level-menu-search-tag-color:rgb(140,140,140);--eo-three-level-menu-search-tag-background:rgb(107,107,107)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:inline-block;background:none}:host::part(menu-item),\neo-link{display:block}eo-menu-item{margin:4px 0}.sub-menu-wrapper eo-menu-item:first-child,\n.group-wrapper eo-menu-item:first-child{margin-top:0}.sub-menu-wrapper eo-menu-item:last-child{margin-bottom:0}.nav-menu-wrapper{display:flex;align-items:center;gap:8px;white-space:nowrap}.popover .sub-menu-item-label{padding:2px 0px;color:var(--color-normal-text)}.popover.subprime{display:block;width:100%}.sub-menu-wrapper{min-width:160px;max-height:calc(100vh - 100px);background-color:var(--antd-dropdown-menu-bg);padding:12px 0;border-radius:6px;box-shadow:0px 4px 12px 0px rgba(17,37,64,0.08);overflow-x:hidden;overflow-y:auto}.overflow-menu-wrapper{display:flex;flex-direction:column}.sub-menu-wrapper > eo-menu-item{display:block;width:100%}.sub-menu-wrapper > eo-menu-item .menu-item-label,\n.sub-menu-wrapper > eo-popover .menu-item-label,\n.sub-menu-wrapper > .group-wrapper > eo-popover .menu-item-label,\n.sub-menu-wrapper > .group-wrapper > eo-menu-item .menu-item-label{display:block;width:100%;padding:7px 24px;box-sizing:border-box;line-height:22px;color:var(--color-normal-text)}.sub-menu-wrapper > eo-popover.subprime .menu-item-label,\n.sub-menu-wrapper > .group-wrapper > eo-popover.subprime .menu-item-label{display:flex;justify-content:space-between;align-items:center}.sub-menu-wrapper .menu-item-label{border-radius:0}.menu-item-label{display:inline-block;cursor:pointer;border-radius:4px;padding:1px 8px;line-height:22px;color:var(--nav-menu-item-label-color)}.menu-item-label:hover{background-color:var(--top-menu-item-hover-bg)}.group-label{padding-left:16px;font-size:12px;color:var(--palette-gray-7);padding:8px 16px;line-height:20px;margin-top:4px}.sub-menu-wrapper .group-label:first-child{margin-top:0px}.sub-menu-wrapper eo-menu-item[active] .menu-item-label{background:var(--top-menu-item-selected-bg);color:var(--color-brand);font-weight:500}.three-level-menu-container{max-width:980px;max-height:510px;overflow:auto;min-width:160px}.three-level-menu-item-container{display:grid;gap:20px;margin-top:13px;padding:5px 10px}.three-level-menu-item-title-container{display:flex;align-items:center}.three-level-menu-item-title-icon{width:4px;height:4px;background-color:var(--eo-three-level-menu-title-color);margin-right:4px;transform:rotate(45deg)}.three-level-menu-item-title{font-size:14px;font-family:PingFang-SC-Medium,PingFang-SC;font-weight:500;color:var(--eo-three-level-menu-title-color)}.three-level-menu-container .menu-item-label{margin-top:4px;margin-left:4px;padding:4px;width:100%}.three-level-menu-container .active .menu-item-label{color:var(--eo-three-level-menu-active-color)}.three-level-menu-search-result .menu-item-label{margin:0px}.three-level-menu-container .menu-item-label:hover{color:var(--eo-three-level-menu-hover-color)}.three-level-menu-popover .sub-menu-wrapper{padding-top:0px}.three-level-menu-search-container{background:var(--eo-three-level-menu-search-input-background);padding:5px 10px}.three-level-menu-search-result{min-width:187px;max-width:328px;max-height:324px;background-color:var(--antd-dropdown-menu-bg);box-shadow:0px 4px 12px 0px rgba(17,37,64,0.08);overflow:scroll}.three-level-menu-search-history-container{padding:5px 10px}.three-level-menu-search-history-text{background:var(--eo-three-level-menu-search-tag-background);border-radius:2px;font-size:7px;line-height:11px;display:inline-block;height:11px;padding:4px;color:var(--eo-three-level-menu-search-tag-color);margin-right:8px}.three-level-menu-search-history-title{color:#8c8c8c;margin:10px 0;display:flex;align-items:center}.three-level-menu-search-history-icon{margin-left:5px}.sub-menu-sit-map-wrapper{box-sizing:border-box;width:calc(100vw);padding:0 60px 24px;max-height:520px;background-color:var(--antd-dropdown-menu-bg);border-radius:6px;box-shadow:0px 4px 12px 0px rgba(17,37,64,0.08);overflow-x:hidden;overflow-y:auto}.overflow-menu-item{position:absolute;opacity:0;height:0;pointer-events:none}.in-group-site-map{width:auto;padding:0 20px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.group .item-link, .custom-group .item-link{font-weight:400}.group .item-link:hover, .custom-group .item-link:hover{background-color:var(--color-fill-bg-base-1)}.group .item-link:hover::part(link), .custom-group .item-link:hover::part(link){color:var(--color-brand-hover)}.group .item-link:hover::part(icon), .custom-group .item-link:hover::part(icon){color:var(--color-brand-hover)}.group .item-link.active::part(link),\n .custom-group .item-link.active::part(link),\n .group .item-link.active::part(icon),\n .custom-group .item-link.active::part(icon){color:var(--palette-blue-8)}.group .item-link::part(link), .custom-group .item-link::part(link){padding:8px 12px 8px 24px;display:flex;gap:4px;color:var(--color-header-text)}.group .item-link::part(icon), .custom-group .item-link::part(icon){color:var(--color-normal-text)}.group .title, .custom-group .title{padding:8px 16px 8px 24px;font-size:16px;font-weight:500;position:relative}.group .title::before, .custom-group .title::before{content:\"\";position:absolute;width:6px;height:6px;top:17px;left:9px;transform:rotate(45deg);background:var(--color-secondary-text)}.group .content .icon-wrapper, .custom-group .content .icon-wrapper, .group .custom-content .icon-wrapper, .custom-group .custom-content .icon-wrapper{color:var(--color-secondary-text);font-size:16px;display:none;margin-left:auto}.group .content .item-link:hover .icon-wrapper, .custom-group .content .item-link:hover .icon-wrapper, .group .custom-content .item-link:hover .icon-wrapper, .custom-group .custom-content .item-link:hover .icon-wrapper{display:block}.group .content .item-link:hover .icon-wrapper:hover, .custom-group .content .item-link:hover .icon-wrapper:hover, .group .custom-content .item-link:hover .icon-wrapper:hover, .custom-group .custom-content .item-link:hover .icon-wrapper:hover{color:var(--color-brand-hover)}.group .content, .custom-group .content{display:flex;flex-direction:column}.group .group-item, .custom-group .group-item{page-break-inside:avoid;break-inside:avoid}.group-view{min-height:300px}.group-view .divider{height:2px;background:var(--color-text-divider-line);margin:16px 0}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.tag-container::part(link){display:flex;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;-moz-user-select:none;justify-content:space-between;background-color:var(--color-fill-bg-base-1);border-radius:2px;padding:1px 6px}.tag-container .tag-text{color:var(--color-normal-text);font-weight:400}.tag-container:hover .tag-text{color:var(--color-brand-hover)}.tag-container .tag-suffix{display:inline-flex;font-size:12px;gap:4px;align-items:center;color:var(--color-secondary-text)}.tag-container.is-drag{opacity:0.4}.indicate-wrapper{border:1px dashed var(--color-brand-hover);border-radius:4px;height:20px;margin:2px 0}.close{display:inline-flex;margin-top:2px;padding:0 2px}.close:hover{color:var(--color-error)}.drag-wrapper{cursor:move}.drag-wrapper:hover{color:var(--color-brand-hover)}.star-icon{display:flex;alignitems:center;color:var(--color-secondary-text)}.star-icon:hover{color:var(--color-brand-hover)}.star-icon .active{color:var(--palette-yellow-6)}.recommend-container:hover .star{display:inline-flex}.recommend-container .star{font-size:13px;display:none}.visit-container:hover .operation{display:inline-flex;align-items:center}.visit-container .operation{display:none}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.site-map .search-wrapper{position:sticky;top:0;z-index:9999;padding-top:24px;padding-bottom:16px;background:var(--antd-dropdown-menu-bg)}.site-map .search-input::part(affix-wrapper){border:none;border-bottom:1px solid var(--antd-input-border-color);border-radius:0px;background:transparent}.site-map .visit-access .title, .site-map .search-panel .title{display:inline-block;padding:2px 16px 2px 24px;font-weight:500;line-height:24px;position:relative}.site-map .visit-access .title::before, .site-map .search-panel .title::before{content:\"\";position:absolute;width:6px;height:6px;top:10px;left:9px;border-radius:50%;background:var(--color-secondary-text)}.site-map .visit-access .no-data-tips, .site-map .search-panel .no-data-tips{display:flex;margin:16px 0 32px;align-items:center;justify-content:center;color:var(--color-secondary-text)}.site-map .visit-access{margin-bottom:8px}.site-map .visit-access.hasData{display:flex}.site-map .visit-access .tag-wrapper{flex:1;display:grid;grid-template-columns:repeat(auto-fit,200px);gap:8px}.site-map .ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.site-map .search-panel .recommend-wrapper{margin-top:16px;display:grid;grid-template-columns:repeat(auto-fit,200px);gap:8px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n export default content && content.locals ? content.locals : undefined;\n","import { Location, parsePath } from \"history\";\nimport { matchPath } from \"@next-core/runtime\";\nimport type {\n SidebarMenuSimpleItem,\n SidebarMenuItem,\n SidebarMenuGroup,\n} from \"./types.js\";\nimport { isObject } from \"lodash\";\n\nexport function isGroup(item: SidebarMenuItem): item is SidebarMenuGroup {\n return item.type === \"group\";\n}\n\nexport function isSubMenu(\n item: SidebarMenuItem,\n groupAsSubMenu?: boolean\n): item is SidebarMenuGroup {\n return Boolean(\n item.type === \"subMenu\" || (groupAsSubMenu && item.type === \"group\")\n );\n}\n\nexport function initMenuItemAndMatchCurrentPathKeys(\n menuItems: SidebarMenuItem[],\n pathname: string,\n search: string,\n parentCursor: string\n): {\n selectedKeys: string[];\n openedKeys: string[];\n matchedKeys: string[];\n} {\n const selectedKeys: string[] = [];\n const openedKeys: string[] = [];\n const matchedKeys: string[] = [];\n\n let cursor = 0;\n menuItems &&\n menuItems.forEach((item) => {\n // key的格式最终为0,1,2,0.1,0.2,0.1.1,0.1.2\n item.key =\n parentCursor === \"\" ? `${cursor}` : `${parentCursor}.${cursor}`;\n if (isGroup(item) || isSubMenu(item)) {\n const tmp = initMenuItemAndMatchCurrentPathKeys(\n item.items,\n pathname,\n search,\n item.key\n );\n selectedKeys.push(...tmp.selectedKeys);\n if (tmp.selectedKeys.length || item.defaultExpanded) {\n openedKeys.push(item.key);\n }\n openedKeys.push(...tmp.openedKeys);\n matchedKeys.push(...tmp.matchedKeys);\n } else {\n if (matchMenuItem(item, pathname, search)) {\n selectedKeys.push(String(item.key));\n\n const keyPath = item.key.split(\".\");\n\n for (let i = 0; i < keyPath.length; i++) {\n matchedKeys.push(keyPath.slice(0, i + 1).join(\".\"));\n }\n }\n }\n cursor += 1;\n });\n if (selectedKeys.length && parentCursor !== \"\") {\n openedKeys.push(parentCursor);\n }\n return {\n selectedKeys: selectedKeys,\n openedKeys: openedKeys,\n matchedKeys: matchedKeys,\n };\n}\n\nfunction getMatchOfSearch(\n currentSearch: string,\n toSearch: string | undefined\n): boolean {\n const current = new URLSearchParams(currentSearch);\n const to = new URLSearchParams(toSearch);\n for (const [key, value] of to.entries()) {\n // Allow `?k=` to match `?` (when `k` doesn't exist)\n if ((current.get(key) ?? \"\") !== value) {\n return false;\n }\n }\n return true;\n}\n\nexport function matchMenuItem(\n item: SidebarMenuSimpleItem,\n pathname: string,\n search: string\n): boolean {\n if (!item.to) return false;\n const to = typeof item.to === \"object\" ? item.to : parsePath(item.to);\n\n // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n const escapedPath = to.pathname!.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n\n let match = !!matchPath(pathname, {\n path: escapedPath,\n exact: item.exact,\n });\n\n if (match && item.activeMatchSearch) {\n match = getMatchOfSearch(search, to.search);\n }\n\n if (!match && Array.isArray(item.activeIncludes)) {\n for (const include of item.activeIncludes) {\n let paths: string[];\n let exact: boolean | undefined = true;\n\n if (isObject(include)) {\n paths = Array.isArray(include.path) ? include.path : [include.path];\n exact = include.exact;\n } else {\n paths = [include];\n }\n\n for (const path of paths) {\n let parsedPath: Location | undefined;\n const hasSearch = path.includes(\"?\");\n\n if (hasSearch) {\n parsedPath = parsePath(path);\n }\n match = !!matchPath(pathname, {\n path: hasSearch ? parsedPath!.pathname : path,\n exact,\n });\n\n if (match && parsedPath?.search) {\n match = getMatchOfSearch(search, parsedPath.search);\n }\n\n if (match) {\n break;\n }\n }\n\n if (match) {\n break;\n }\n }\n }\n\n if (match && Array.isArray(item.activeExcludes)) {\n for (const include of item.activeExcludes) {\n let paths: string[];\n let exact: boolean | undefined = true;\n\n if (isObject(include)) {\n paths = Array.isArray(include.path) ? include.path : [include.path];\n exact = include.exact;\n } else {\n paths = [include];\n }\n\n for (const path of paths) {\n match = !matchPath(pathname, {\n path,\n exact,\n });\n\n if (!match) {\n break;\n }\n }\n\n if (!match) {\n break;\n }\n }\n }\n\n return match;\n}\n"],"names":["initializeReactI18n","NS","locales","WrappedPopover","wrapBrick","WrappedSearch","onChange","onSearch","WrappedIcon","LOCAL_STORAGE_PREFIX","maxVisitorLength","ThreeLevelMenuPopoverContent","props","useTranslation","menuItem","selectedKey","items","searchResult","setSearchResult","useState","searchKey","setSearchKey","triggerRef","useRef","nameSpace","title","storage","useMemo","JsonStorage","localStorage","searchHistory","getItem","popoverTriggerClick","_triggerRef$current","current","click","React","className","onClick","e","stopPropagation","placeholder","t","K","SEARCH_BY_MENU_NAME","detail","list","uniq","length","pop","setItem","flatMap","i","filter","text","toLowerCase","includes","trim","onFocus","onBlur","trigger","placement","anchorDisplay","distance","slot","ref","map","renderLinkCom","width","style","height","textAlign","lineHeight","NO_DATA","SEARCH_HISTORY","lib","theme","icon","h","key","gridTemplateColumns","item","index","_item$items","classnames","active","en","QUICK_ACCESS","REMOVE_ITEM_FROM_QUICK_ACCESS","ADD_ITEM_TO_QUICK_ACCESS","NO_DATA_TIPS_IN_QUICK_ACCESS","SITE_MAP_SEARCH_RECOMMEND","MAX_COLLECT_COUNT_TIPS","NO_DATA_SEARCH_INFO","SEARCH_ITEM_PLACEHOLDER","zh","DRAG_DIRECTION","collectModule","DragContext","collectService","constructor","maxCollectLength","_defineProperty","Map","this","getFavoritesById","id","cloneDeep","collectMap","get","fetchFavorites","cachedPromise","collectPromise","favoritesPromise","MyCollectionApi_listMyCollection","module","collectionName","then","result","_result$payloads","payloads","extInfo","Boolean","set","setItemAsFavorite","unshift","updateFavoriteItems","MyCollectionApi_upsertMyCollection","name","url","to","error","handleHttpError","equalItem","prevItem","removeItemFromFavorite","findIndex","row","splice","isCollected","some","toggleFavorite","checkMaxCapacity","moveFavoriteTo","option","from","direction","fromIndex","toIndex","Left","groupId","WrappedLink","WrappedTooltip","PlaceholderDropComp","_ref","data","onDragOver","onFavoriteUpdate","useContext","onDragEnter","target","background","onDragLeave","onDrop","formData","JSON","parse","dataTransfer","getData","newDataList","ItemTag","suffix","allowDrag","onDragStart","overElement","onDragEnd","containerRef","isDragIng","setIsDragIng","isActive","dataset","draggable","_e$dataTransfer","setData","stringify","preventDefault","dropEffect","classNames","href","Right","QuickVisitItem","onAllowDrag","onFavorite","suffixRef","iconRef","handleRemove","useCallback","handleMouseDown","useEffect","addEventListener","removeEventListener","handleClick","suffixGroups","content","hoist","onMouseDown","StarIcon","_ref2","_extends","RecommendItem","walkMenuItem","type","Array","isArray","walkMenuItems","push","itemColumnWidth","GroupView","groupMenus","groups","groupCategoryMap","categoryOrder","Set","forEach","groupFrom","add","value","processGroupItems","DefaultGroup","CustomGroup","groupRef","columnCount","setColumnCount","resizeObserver","ResizeObserver","entries","entry","contentRect","Math","floor","observe","disconnect","columnWidth","display","group","GroupItem","WrappedInput","onValueChange","SiteMapItem","menuGroup","visible","favoriteList","setFavoriteList","flatItems","flatMenuItems","q","setQ","setFilters","dragElement","setDragElement","setOverElement","setAllowDrag","setDirection","initialized","setInitialized","handleFavorite","collectList","handleSearch","v","debouncedHandleSearch","debounce","handleDragOver","throttle","dropElement","element","node","parentElement","findDropElement","isValidDragAction","left","getBoundingClientRect","right","clientX","undefined","hasData","Provider","handleDragEnd","enable","WrappedLinkItem","isGroup","isSubMenu","groupAsSubMenu","linkStyle","labelStyle","renderSpanCom","subMenu","___CSS_LOADER_EXPORT___","toString","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","initMenuItemAndMatchCurrentPathKeys","menuItems","pathname","search","parentCursor","selectedKeys","openedKeys","matchedKeys","cursor","tmp","defaultExpanded","parsePath","escapedPath","replace","match","matchPath","path","exact","activeMatchSearch","getMatchOfSearch","activeIncludes","include","paths","isObject","_parsedPath","parsedPath","hasSearch","activeExcludes","matchMenuItem","String","keyPath","split","slice","join","currentSearch","toSearch","URLSearchParams"],"sourceRoot":""}
|