"use strict";(self["webpackChunkwordhelper"]=self["webpackChunkwordhelper"]||[]).push([[387],{9845:function(e,t,r){r.d(t,{A:function(){return v}});var n=r(56768),o=r(84279),i=(0,n.pM)({name:"Empty",render(){return(0,n.h)("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),(0,n.h)("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),a=r(79882),l=r(88733),s=r(82813),d=r(25216),c=r(34350),u=r(52945),p=(0,c.cB)("empty","\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: var(--n-font-size);\n",[(0,c.cE)("icon","\n width: var(--n-icon-size);\n height: var(--n-icon-size);\n font-size: var(--n-icon-size);\n line-height: var(--n-icon-size);\n color: var(--n-icon-color);\n transition:\n color .3s var(--n-bezier);\n ",[(0,c.c)("+",[(0,c.cE)("description","\n margin-top: 8px;\n ")])]),(0,c.cE)("description","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n "),(0,c.cE)("extra","\n text-align: center;\n transition: color .3s var(--n-bezier);\n margin-top: 12px;\n color: var(--n-extra-text-color);\n ")]);const m=Object.assign(Object.assign({},a.A.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function});var v=(0,n.pM)({name:"Empty",props:m,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedComponentPropsRef:o}=(0,l.Ay)(e),m=(0,a.A)("Empty","-empty",p,u.A,e,t),{localeRef:v}=(0,s.A)("Empty"),h=(0,n.EW)(()=>{var t,r,n;return null!==(t=e.description)&&void 0!==t?t:null===(n=null===(r=null===o||void 0===o?void 0:o.value)||void 0===r?void 0:r.Empty)||void 0===n?void 0:n.description}),g=(0,n.EW)(()=>{var e,t;return(null===(t=null===(e=null===o||void 0===o?void 0:o.value)||void 0===e?void 0:e.Empty)||void 0===t?void 0:t.renderIcon)||(()=>(0,n.h)(i,null))}),x=(0,n.EW)(()=>{const{size:t}=e,{common:{cubicBezierEaseInOut:r},self:{[(0,c.cF)("iconSize",t)]:n,[(0,c.cF)("fontSize",t)]:o,textColor:i,iconColor:a,extraTextColor:l}}=m.value;return{"--n-icon-size":n,"--n-font-size":o,"--n-bezier":r,"--n-text-color":i,"--n-icon-color":a,"--n-extra-text-color":l}}),y=r?(0,d.R)("empty",(0,n.EW)(()=>{let t="";const{size:r}=e;return t+=r[0],t}),x,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:g,localizedDescription:(0,n.EW)(()=>h.value||v.value.description),cssVars:r?void 0:x,themeClass:null===y||void 0===y?void 0:y.themeClass,onRender:null===y||void 0===y?void 0:y.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:r}=this;return null===r||void 0===r||r(),(0,n.h)("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?(0,n.h)("div",{class:`${t}-empty__icon`},e.icon?e.icon():(0,n.h)(o.A,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?(0,n.h)("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?(0,n.h)("div",{class:`${t}-empty__extra`},e.extra()):null)}})},71387:function(e,t,r){r.r(t),r.d(t,{default:function(){return Q}});r(44114);var n=r(56768),o=r(90144),i=r(24232),a=r(98728),l=r(97387),s=r(93812),d=r(45525); /** * @license lucide-vue-next v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const c=(0,d.A)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]);var u=r(42517),p=(r(18111),r(61701),r(55472)),m=r(65049),v=r(79882),h=r(88733),g=r(87996),x=r(34350),y=r(64075);function b(e){const{heightSmall:t,heightMedium:r,heightLarge:n,borderRadius:o}=e;return{color:"#eee",colorEnd:"#ddd",borderRadius:o,heightSmall:t,heightMedium:r,heightLarge:n}}const f={name:"Skeleton",common:y.A,self:b};var w=(0,x.c)([(0,x.cB)("skeleton","\n height: 1em;\n width: 100%;\n transition:\n --n-color-start .3s var(--n-bezier),\n --n-color-end .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1);\n background-color: var(--n-color-start);\n "),(0,x.c)("@keyframes skeleton-loading","\n 0% {\n background: var(--n-color-start);\n }\n 40% {\n background: var(--n-color-end);\n }\n 80% {\n background: var(--n-color-start);\n }\n 100% {\n background: var(--n-color-start);\n }\n ")]);const C=Object.assign(Object.assign({},v.A.props),{text:Boolean,round:Boolean,circle:Boolean,height:[String,Number],width:[String,Number],size:String,repeat:{type:Number,default:1},animated:{type:Boolean,default:!0},sharp:{type:Boolean,default:!0}});var k=(0,n.pM)({name:"Skeleton",inheritAttrs:!1,props:C,setup(e){(0,g.w)();const{mergedClsPrefixRef:t}=(0,h.Ay)(e),r=(0,v.A)("Skeleton","-skeleton",w,f,e,t);return{mergedClsPrefix:t,style:(0,n.EW)(()=>{var t,n;const o=r.value,{common:{cubicBezierEaseInOut:i}}=o,a=o.self,{color:l,colorEnd:s,borderRadius:d}=a;let c;const{circle:u,sharp:m,round:v,width:h,height:g,size:y,text:b,animated:f}=e;void 0!==y&&(c=a[(0,x.cF)("height",y)]);const w=u?null!==(t=null!==h&&void 0!==h?h:g)&&void 0!==t?t:c:h,C=null!==(n=u&&null!==h&&void 0!==h?h:g)&&void 0!==n?n:c;return{display:b?"inline-block":"",verticalAlign:b?"-0.125em":"",borderRadius:u?"50%":v?"4096px":m?"":d,width:"number"===typeof w?(0,p.Cw)(w):w,height:"number"===typeof C?(0,p.Cw)(C):C,animation:f?"":"none","--n-bezier":i,"--n-color-start":l,"--n-color-end":s}})}},render(){const{repeat:e,style:t,mergedClsPrefix:r,$attrs:o}=this,i=(0,n.h)("div",(0,n.v6)({class:`${r}-skeleton`,style:t},o));return e>1?(0,n.h)(n.FK,null,(0,m.ux)(e,null).map(e=>[i,"\n"])):i}}),_=r(92720),z=r(78205),E=r(9845),S=r(35720);const R={class:"dict-view max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},L={class:"flex items-center gap-2 mb-8"},A={key:0,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},D={key:1,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},F=["enter"],B={class:"flex justify-between items-start mb-4"},M={class:"text-xl font-bold text-gray-900 dark:text-white mb-1"},H={key:0,class:"flex flex-wrap gap-2"},V={class:"p-2 bg-primary/10 rounded-full"},W={class:"text-gray-500 dark:text-gray-400 text-sm mb-6 line-clamp-2 min-h-[2.5rem]"},I={class:"mt-auto"},P={class:"flex justify-between items-end mb-2 text-sm"},X={class:"text-gray-600 dark:text-gray-300 font-medium"},$={class:"text-gray-400 text-xs"},j={key:0,class:"mt-2 text-xs text-gray-400 text-right"};var O={__name:"DictView",setup(e){const t=(0,a.rd)(),r=(0,l.J)(),{isDark:d}=(0,n.WQ)("themeContext"),p=(0,o.KR)(!1),m=(0,o.KR)([]),v=async()=>{p.value=!0;try{const e=await S.A.get("https://newfront.xn--xhq44jb2fzpc.com/word_helper/dict/list");0===e.data.code?m.value=e.data.data:r.error(e.data.msg||"获取词书列表失败")}catch(e){console.error("Fetch dicts failed:",e),r.error("获取词书列表失败")}finally{p.value=!1}},h=e=>{if(!e.total_words||0===e.total_words)return 0;const t=e.last_dict_order||0,r=t/e.total_words*100;return Math.min(Math.round(r),100)},g=e=>e.last_dict_order?e.last_dict_order>=e.total_words&&e.total_words>0?"已学完":`已学 ${e.last_dict_order} 词`:"未学习",x=e=>{if(!e)return"";const t=new Date(e),r=new Date;if(t.toDateString()===r.toDateString())return`今天 ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`;const n=new Date(r);return n.setDate(n.getDate()-1),t.toDateString()===n.toDateString()?"昨天":t.toLocaleDateString()},y=e=>{const n=e.last_word_id||e.first_word_id;n?t.push({path:"/word",query:{word_id:n,learn:"true",dict_id:e.id}}):r.warning("该词书暂无单词")};return(0,n.sV)(()=>{v(),document.title="词书 - Word Helper"}),(e,t)=>{const r=(0,n.gN)("motion-slide-visible-once-left"),a=(0,n.gN)("motion");return(0,n.uX)(),(0,n.CE)("div",R,[(0,n.bo)(((0,n.uX)(),(0,n.CE)("div",L,[(0,n.bF)((0,o.R1)(s.A),{class:"w-8 h-8 text-primary"}),t[0]||(t[0]=(0,n.Lk)("h1",{class:"text-3xl font-bold text-gray-900 dark:text-white"},"选择词书",-1))])),[[r]]),p.value?((0,n.uX)(),(0,n.CE)("div",A,[((0,n.uX)(),(0,n.CE)(n.FK,null,(0,n.pI)(3,e=>(0,n.bF)((0,o.R1)(u.Ay),{key:e,class:"rounded-xl shadow-sm",bordered:!1},{default:(0,n.k6)(()=>[(0,n.bF)((0,o.R1)(k),{text:"",style:{width:"60%"},class:"mb-2"}),(0,n.bF)((0,o.R1)(k),{text:"",repeat:2})]),_:1})),64))])):((0,n.uX)(),(0,n.CE)("div",D,[((0,n.uX)(!0),(0,n.CE)(n.FK,null,(0,n.pI)(m.value,(e,r)=>(0,n.bo)(((0,n.uX)(),(0,n.CE)("div",{key:e.id,initial:{opacity:0,y:20},enter:{opacity:1,y:0,transition:{delay:100*r}}},[(0,n.bF)((0,o.R1)(u.Ay),{class:"h-full rounded-xl shadow-sm hover:shadow-md transition-shadow cursor-pointer dark:bg-gray-800",bordered:!1,onClick:t=>y(e)},{default:(0,n.k6)(()=>[(0,n.Lk)("div",B,[(0,n.Lk)("div",null,[(0,n.Lk)("h3",M,(0,i.v_)(e.name),1),e.tag?((0,n.uX)(),(0,n.CE)("div",H,[(0,n.bF)((0,o.R1)(_.Ay),{type:"info",size:"small",round:"",bordered:!1,class:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-300"},{default:(0,n.k6)(()=>[(0,n.eW)((0,i.v_)(e.tag),1)]),_:2},1024),e.owner_id?((0,n.uX)(),(0,n.Wv)((0,o.R1)(_.Ay),{key:0,type:"warning",size:"small",round:"",bordered:!1,class:"bg-amber-50 text-amber-600 dark:bg-amber-900/30 dark:text-amber-300"},{default:(0,n.k6)(()=>[...t[1]||(t[1]=[(0,n.eW)(" 自定义 ",-1)])]),_:1})):(0,n.Q3)("",!0)])):(0,n.Q3)("",!0)]),(0,n.Lk)("div",V,[(0,n.bF)((0,o.R1)(c),{class:"w-6 h-6 text-primary"})])]),(0,n.Lk)("p",W,(0,i.v_)(e.description||"暂无简介"),1),(0,n.Lk)("div",I,[(0,n.Lk)("div",P,[(0,n.Lk)("span",X,(0,i.v_)(g(e)),1),(0,n.Lk)("span",$," 总计 "+(0,i.v_)(e.total_words)+" 词 ",1)]),(0,n.bF)((0,o.R1)(z.A),{type:"line",percentage:h(e),color:h(e)>=100?"#10B981":"#3B82F6","rail-color":(0,o.R1)(d)?"#374151":"#E5E7EB",height:8,"border-radius":"4px","show-indicator":!1},null,8,["percentage","color","rail-color"]),e.last_learn_time?((0,n.uX)(),(0,n.CE)("div",j," 上次学习: "+(0,i.v_)(x(e.last_learn_time)),1)):(0,n.Q3)("",!0)])]),_:2},1032,["onClick"])],8,F)),[[a]])),128))])),p.value||0!==m.value.length?(0,n.Q3)("",!0):((0,n.uX)(),(0,n.Wv)((0,o.R1)(E.A),{key:2,description:"暂无可用词书",class:"mt-20"}))])}}},K=r(71241);const N=(0,K.A)(O,[["__scopeId","data-v-482a2809"]]);var Q=N},87996:function(e,t,r){r.d(t,{w:function(){return i}});var n=r(62889);let o=!1;function i(){if(n.B&&window.CSS&&!o&&(o=!0,"registerProperty"in(null===window||void 0===window?void 0:window.CSS)))try{CSS.registerProperty({name:"--n-color-start",syntax:"",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"",inherits:!1,initialValue:"#0000"})}catch(e){}}}}]); //# sourceMappingURL=387.dd6c4a86.js.map