hermes-web-ui 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/hermes-web-ui.mjs +50 -13
- package/dist/client/assets/Add-XpaL69a7.js +1 -0
- package/dist/client/assets/{Button-zECKCotA.js → Button-DZWlvt3_.js} +14 -14
- package/dist/client/assets/{ChannelsView-xCdAEZam.css → ChannelsView-D168bwSq.css} +1 -1
- package/dist/client/assets/ChannelsView-DsFZWVNp.js +1 -0
- package/dist/client/assets/ChatView-DoqDlZLC.js +127 -0
- package/dist/client/assets/{Close-DjLWDodG.js → Close-CynFIaWE.js} +10 -10
- package/dist/client/assets/FormItem-9JbgiHgw.js +110 -0
- package/dist/client/assets/Input-BUMpvosL.js +234 -0
- package/dist/client/assets/InputNumber-BOptkZXt.js +13 -0
- package/dist/client/assets/{JobsView-DsfGyjnT.js → JobsView-C-nRY00Q.js} +2 -2
- package/dist/client/assets/{LoginView-BiWaCYS0.js → LoginView-CLrTbJPK.js} +1 -1
- package/dist/client/assets/{LogsView-DuORyFFY.js → LogsView-BjeUz4w_.js} +1 -1
- package/dist/client/assets/{MarkdownRenderer-BA3oPVqT.js → MarkdownRenderer-pJXYVaJf.js} +1 -1
- package/dist/client/assets/MemoryView-B_b0Bw4s.js +7 -0
- package/dist/client/assets/MemoryView-hIfyUkwz.css +1 -0
- package/dist/client/assets/{Modal-WQKdvHJY.js → Modal-Gb5CDHOn.js} +56 -56
- package/dist/client/assets/ModelsView-BHO6JeeK.js +1 -0
- package/dist/client/assets/{Popconfirm-02A7vL_z.js → Popconfirm-f3hviugz.js} +4 -4
- package/dist/client/assets/Popover-BtQeULHo.js +117 -0
- package/dist/client/assets/ProfilesView-C4GoKpgi.js +440 -0
- package/dist/client/assets/ProfilesView-jqeO8Zv3.css +1 -0
- package/dist/client/assets/{Scrollbar-Bg2FeTtI.js → Scrollbar-Bui9E0cT.js} +17 -17
- package/dist/client/assets/Select-By6oALhZ.js +340 -0
- package/dist/client/assets/{SettingRow-CLLFxWP3.js → SettingRow-CWqG1TP7.js} +1 -1
- package/dist/client/assets/SettingsView-CzgT0dAx.js +352 -0
- package/dist/client/assets/{SkillsView-D6CegW4w.js → SkillsView-2xeOBpxm.js} +1 -1
- package/dist/client/assets/{Spin-lybeIDeX.js → Spin-DD5RgTEV.js} +4 -4
- package/dist/client/assets/{Suffix-Dv1UElLH.js → Suffix-CkTuXehC.js} +5 -5
- package/dist/client/assets/{Switch-mgeu-lpD.js → Switch-BqpUglHp.js} +15 -15
- package/dist/client/assets/{Tag-DWc4lbAm.js → Tag-BdqJCtwA.js} +15 -15
- package/dist/client/assets/{TerminalView-DmnXOHFu.js → TerminalView-DOvaJfhr.js} +1 -1
- package/dist/client/assets/{Tooltip-DrDTmrj3.js → Tooltip-2f394xdV.js} +1 -1
- package/dist/client/assets/{UsageView-C3O6-vbW.js → UsageView-Cd7Gui1x.js} +1 -1
- package/dist/client/assets/{Warning-t1i_4T5i.js → Warning-21tMOc2L.js} +1 -1
- package/dist/client/assets/{_plugin-vue_export-helper-BkT4A29V.js → _plugin-vue_export-helper-C39Y8Snr.js} +1 -1
- package/dist/client/assets/app-Dc1GzlQi.js +1 -0
- package/dist/client/assets/app-DjAPGKg7.js +1 -0
- package/dist/client/assets/{browser-DzAOCZtm.js → browser-DMdqvQBg.js} +9 -9
- package/dist/client/assets/{chat-CX1Hza8X.js → chat-1kL3Ps59.js} +2 -2
- package/dist/client/assets/composables-BxlGNoT-.js +1 -0
- package/dist/client/assets/create-5zWq3BEB.js +1 -0
- package/dist/client/assets/fade-in-scale-up.cssr-HXBs3oL0.js +1 -0
- package/dist/client/assets/index-BT19Bivl.css +1 -0
- package/dist/client/assets/index-CFIEnaxD.js +284 -0
- package/dist/client/assets/{jobs-B9NHIxuL.js → jobs-YFhNrsBu.js} +1 -1
- package/dist/client/assets/{pinia-bPUFQqFK.js → pinia-BPgWlB7x.js} +1 -1
- package/dist/client/assets/profiles-H8Bd9mDO.js +23 -0
- package/dist/client/assets/{router-COwpqexM.js → router-cAIqC_mO.js} +2 -2
- package/dist/client/assets/{sessions-B1SPfe-R.js → sessions-fFwnFvo3.js} +1 -1
- package/dist/client/assets/{skills-CRtljpt6.js → skills-DZWMwFIf.js} +1 -1
- package/dist/client/assets/use-compitable-esQP7BHf.js +1 -0
- package/dist/client/assets/use-message-CnDHqZf8.js +1 -0
- package/dist/client/index.html +24 -22
- package/dist/server/data/.token +1 -0
- package/dist/server/index.js +70 -4
- package/dist/server/routes/hermes/config.js +11 -11
- package/dist/server/routes/hermes/filesystem.js +154 -29
- package/dist/server/routes/hermes/profiles.js +136 -14
- package/dist/server/routes/hermes/terminal.js +12 -34
- package/dist/server/routes/hermes/weixin.js +6 -6
- package/dist/server/services/hermes-cli.d.ts +4 -0
- package/dist/server/services/hermes-cli.js +17 -0
- package/dist/server/services/hermes-profile.d.ts +22 -0
- package/dist/server/services/hermes-profile.js +60 -0
- package/dist/server/shared/providers.js +8 -14
- package/package.json +1 -1
- package/dist/client/assets/ChannelsView-Bvh3tnio.js +0 -1
- package/dist/client/assets/ChatView-CJZahJ1V.js +0 -127
- package/dist/client/assets/FormItem-CZ9auYA2.js +0 -110
- package/dist/client/assets/Input-DxJk6pT-.js +0 -234
- package/dist/client/assets/InputNumber-BTqp81h0.js +0 -13
- package/dist/client/assets/MemoryView-CU3JHweh.css +0 -1
- package/dist/client/assets/MemoryView-VgQFNMsP.js +0 -5
- package/dist/client/assets/ModelsView-QDRloKd5.js +0 -1
- package/dist/client/assets/Popover-2C1zuptC.js +0 -117
- package/dist/client/assets/Select-C_hKaXgI.js +0 -340
- package/dist/client/assets/SettingsView-CeScqhwO.js +0 -352
- package/dist/client/assets/app-BUjbfMSg.js +0 -1
- package/dist/client/assets/app-p59ZckFN.js +0 -1
- package/dist/client/assets/context-BM8ZQCOz.js +0 -1
- package/dist/client/assets/fade-in-scale-up.cssr-DQl-Z54c.js +0 -1
- package/dist/client/assets/index-95z-iQoj.js +0 -306
- package/dist/client/assets/index-C33O1KZm.css +0 -1
- package/dist/client/assets/use-compitable-BnlNjEug.js +0 -1
- package/dist/client/assets/use-message-g8F4Z57w.js +0 -1
- /package/dist/client/assets/{omit-C4dR5R2G.js → omit-1BRB6K75.js} +0 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import{$ as e,A as t,C as n,D as r,E as i,F as a,G as o,K as s,N as c,Q as l,R as u,T as d,U as f,V as p,X as m,Z as h,b as g,ct as _,d as v,dt as y,ft as b,g as x,gt as S,h as C,ht as w,j as T,k as E,mt as D,pt as O,q as k,w as A,y as j}from"./router-cAIqC_mO.js";import{r as M,t as N}from"./_plugin-vue_export-helper-C39Y8Snr.js";import{$ as ee,B as P,J as te,Q as F,R as ne,W as I,X as L,Y as R,a as z,c as B,d as re,dt as ie,et as ae,ft as oe,gt as se,lt as V,n as ce,nt as le,o as ue,ot as H,q as U,s as de,st as W,tt as G,ut as K,z as fe}from"./browser-DMdqvQBg.js";import{A as pe,f as me,h as he,j as ge,l as q}from"./Popover-BtQeULHo.js";import{a as J,c as _e,g as ve,h as ye,i as be,m as xe,o as Y,s as Se}from"./Scrollbar-Bui9E0cT.js";import{c as Ce,l as we,t as Te,u as Ee}from"./Modal-Gb5CDHOn.js";import{n as De,t as Oe}from"./FormItem-9JbgiHgw.js";import{i as ke,r as Ae,t as X}from"./Button-DZWlvt3_.js";import{t as je}from"./fade-in-scale-up.cssr-HXBs3oL0.js";import{t as Me}from"./Warning-21tMOc2L.js";import{t as Ne}from"./Add-XpaL69a7.js";import{r as Pe,t as Fe}from"./Input-BUMpvosL.js";import{t as Ie}from"./Tag-BdqJCtwA.js";import{n as Le,t as Z}from"./profiles-H8Bd9mDO.js";import{n as Re,t as ze}from"./Tooltip-2f394xdV.js";import{t as Be}from"./composables-BxlGNoT-.js";import{t as Ve}from"./use-message-CnDHqZf8.js";import{t as He}from"./Spin-DD5RgTEV.js";import{t as Ue}from"./Switch-BqpUglHp.js";function We(e,t){if(!e)return;let n=document.createElement(`a`);n.href=e,t!==void 0&&(n.download=t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function Ge(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Ke(e){return function(t){return e?.[t]}}var qe=Ke({À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`}),Je=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ye=RegExp(`[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]`,`g`);function Xe(e){return e=_e(e),e&&e.replace(Je,qe).replace(Ye,``)}var Ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Qe(e){return e.match(Ze)||[]}var $e=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function et(e){return $e.test(e)}var tt=`\\ud800-\\udfff`,nt=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,rt=`\\u2700-\\u27bf`,it=`a-z\\xdf-\\xf6\\xf8-\\xff`,at=`\\xac\\xb1\\xd7\\xf7`,ot=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,st=`\\u2000-\\u206f`,ct=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,lt=`A-Z\\xc0-\\xd6\\xd8-\\xde`,ut=`\\ufe0e\\ufe0f`,dt=at+ot+st+ct,ft=`['’]`,pt=`[`+dt+`]`,mt=`[`+nt+`]`,ht=`\\d+`,gt=`[`+rt+`]`,_t=`[`+it+`]`,vt=`[^`+tt+dt+ht+rt+it+lt+`]`,yt=`(?:`+mt+`|\\ud83c[\\udffb-\\udfff])`,bt=`[^`+tt+`]`,xt=`(?:\\ud83c[\\udde6-\\uddff]){2}`,St=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Q=`[`+lt+`]`,Ct=`\\u200d`,wt=`(?:`+_t+`|`+vt+`)`,Tt=`(?:`+Q+`|`+vt+`)`,Et=`(?:`+ft+`(?:d|ll|m|re|s|t|ve))?`,Dt=`(?:`+ft+`(?:D|LL|M|RE|S|T|VE))?`,Ot=yt+`?`,kt=`[`+ut+`]?`,At=`(?:`+Ct+`(?:`+[bt,xt,St].join(`|`)+`)`+kt+Ot+`)*`,jt=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,Mt=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,Nt=kt+Ot+At,Pt=`(?:`+[gt,xt,St].join(`|`)+`)`+Nt,Ft=RegExp([Q+`?`+_t+`+`+Et+`(?=`+[pt,Q,`$`].join(`|`)+`)`,Tt+`+`+Dt+`(?=`+[pt,Q+wt,`$`].join(`|`)+`)`,Q+`?`+wt+`+`+Et,Q+`+`+Dt,Mt,jt,ht,Pt].join(`|`),`g`);function It(e){return e.match(Ft)||[]}function Lt(e,t,n){return e=_e(e),t=n?void 0:t,t===void 0?et(e)?It(e):Qe(e):e.match(t)||[]}var Rt=RegExp(`['’]`,`g`);function zt(e){return function(t){return Ge(Lt(Xe(t).replace(Rt,``)),e,``)}}var Bt=zt(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),Vt=J(`attach`,()=>c(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},c(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},c(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},c(`path`,{d:`M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z`}))))),Ht=J(`cancel`,()=>c(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},c(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},c(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},c(`path`,{d:`M2.58859116,2.7156945 L2.64644661,2.64644661 C2.82001296,2.47288026 3.08943736,2.45359511 3.2843055,2.58859116 L3.35355339,2.64644661 L8,7.293 L12.6464466,2.64644661 C12.8417088,2.45118446 13.1582912,2.45118446 13.3535534,2.64644661 C13.5488155,2.84170876 13.5488155,3.15829124 13.3535534,3.35355339 L8.707,8 L13.3535534,12.6464466 C13.5271197,12.820013 13.5464049,13.0894374 13.4114088,13.2843055 L13.3535534,13.3535534 C13.179987,13.5271197 12.9105626,13.5464049 12.7156945,13.4114088 L12.6464466,13.3535534 L8,8.707 L3.35355339,13.3535534 C3.15829124,13.5488155 2.84170876,13.5488155 2.64644661,13.3535534 C2.45118446,13.1582912 2.45118446,12.8417088 2.64644661,12.6464466 L7.293,8 L2.64644661,3.35355339 C2.47288026,3.17998704 2.45359511,2.91056264 2.58859116,2.7156945 L2.64644661,2.64644661 L2.58859116,2.7156945 Z`}))))),Ut=J(`download`,()=>c(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},c(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},c(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},c(`path`,{d:`M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z`}))))),Wt=T({name:`ResizeSmall`,render(){return c(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},c(`g`,{fill:`none`},c(`path`,{d:`M5.5 4A1.5 1.5 0 0 0 4 5.5v1a.5.5 0 0 1-1 0v-1A2.5 2.5 0 0 1 5.5 3h1a.5.5 0 0 1 0 1h-1zM16 5.5A1.5 1.5 0 0 0 14.5 4h-1a.5.5 0 0 1 0-1h1A2.5 2.5 0 0 1 17 5.5v1a.5.5 0 0 1-1 0v-1zm0 9a1.5 1.5 0 0 1-1.5 1.5h-1a.5.5 0 0 0 0 1h1a2.5 2.5 0 0 0 2.5-2.5v-1a.5.5 0 0 0-1 0v1zm-12 0A1.5 1.5 0 0 0 5.5 16h1.25a.5.5 0 0 1 0 1H5.5A2.5 2.5 0 0 1 3 14.5v-1.25a.5.5 0 0 1 1 0v1.25zM8.5 7A1.5 1.5 0 0 0 7 8.5v3A1.5 1.5 0 0 0 8.5 13h3a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 11.5 7h-3zM8 8.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3z`,fill:`currentColor`})))}}),Gt=J(`retry`,()=>c(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},c(`path`,{d:`M320,146s24.36-12-64-12A160,160,0,1,0,416,294`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-miterlimit: 10; stroke-width: 32px;`}),c(`polyline`,{points:`256 58 336 138 256 218`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}))),Kt=J(`rotateClockwise`,()=>c(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},c(`path`,{d:`M3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 12.7916 15.3658 15.2026 13 16.3265V14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5V17.5C12 17.7761 12.2239 18 12.5 18H15.5C15.7761 18 16 17.7761 16 17.5C16 17.2239 15.7761 17 15.5 17H13.8758C16.3346 15.6357 18 13.0128 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 10.2761 2.22386 10.5 2.5 10.5C2.77614 10.5 3 10.2761 3 10Z`,fill:`currentColor`}),c(`path`,{d:`M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12ZM10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10C11 10.5523 10.5523 11 10 11Z`,fill:`currentColor`}))),qt=J(`rotateClockwise`,()=>c(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},c(`path`,{d:`M17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 12.7916 4.63419 15.2026 7 16.3265V14.5C7 14.2239 7.22386 14 7.5 14C7.77614 14 8 14.2239 8 14.5V17.5C8 17.7761 7.77614 18 7.5 18H4.5C4.22386 18 4 17.7761 4 17.5C4 17.2239 4.22386 17 4.5 17H6.12422C3.66539 15.6357 2 13.0128 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 10.2761 17.7761 10.5 17.5 10.5C17.2239 10.5 17 10.2761 17 10Z`,fill:`currentColor`}),c(`path`,{d:`M10 12C8.89543 12 8 11.1046 8 10C8 8.89543 8.89543 8 10 8C11.1046 8 12 8.89543 12 10C12 11.1046 11.1046 12 10 12ZM10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z`,fill:`currentColor`}))),Jt=J(`trash`,()=>c(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},c(`path`,{d:`M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}),c(`rect`,{x:`32`,y:`64`,width:`448`,height:`80`,rx:`16`,ry:`16`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}),c(`line`,{x1:`312`,y1:`240`,x2:`200`,y2:`352`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}),c(`line`,{x1:`312`,y1:`352`,x2:`200`,y2:`240`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}))),Yt=J(`zoomIn`,()=>c(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},c(`path`,{d:`M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5Z`,fill:`currentColor`}),c(`path`,{d:`M8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z`,fill:`currentColor`}))),Xt=J(`zoomOut`,()=>c(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},c(`path`,{d:`M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11Z`,fill:`currentColor`}),c(`path`,{d:`M14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z`,fill:`currentColor`}))),Zt=F&&`loading`in document.createElement(`img`);function Qt(e={}){let{root:t=null}=e;return{hash:`${e.rootMargin||`0px 0px 0px 0px`}-${Array.isArray(e.threshold)?e.threshold.join(`,`):e.threshold??`0`}`,options:Object.assign(Object.assign({},e),{root:(typeof t==`string`?document.querySelector(t):t)||document.documentElement})}}var $t=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=(e,t,n)=>{if(!e)return()=>{};let r=Qt(t),{root:i}=r.options,a,o=$t.get(i);o?a=o:(a=new Map,$t.set(i,a));let s,c;a.has(r.hash)?(c=a.get(r.hash),c[1].has(e)||(s=c[0],c[1].add(e),s.observe(e))):(s=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){let t=en.get(e.target),n=tn.get(e.target);t&&t(),n&&(n.value=!0)}})},r.options),s.observe(e),c=[s,new Set([e])],a.set(r.hash,c));let l=!1,u=()=>{l||(en.delete(e),tn.delete(e),l=!0,c[1].has(e)&&(c[0].unobserve(e),c[1].delete(e)),c[1].size<=0&&a.delete(r.hash),a.size||$t.delete(i))};return en.set(e,u),tn.set(e,n),u};function rn(e){let{infoColor:t,successColor:n,warningColor:r,errorColor:i,textColor2:a,progressRailColor:o,fontSize:s,fontWeight:c}=e;return{fontSize:s,fontSizeCircle:`28px`,fontWeightCircle:c,railColor:o,railHeight:`8px`,iconSizeCircle:`36px`,iconSizeLine:`18px`,iconColor:t,iconColorInfo:t,iconColorSuccess:n,iconColorWarning:r,iconColorError:i,textColorCircle:a,textColorLineInner:`rgb(255, 255, 255)`,textColorLineOuter:a,fillColor:t,fillColorInfo:t,fillColorSuccess:n,fillColorWarning:r,fillColorError:i,lineBgProcessing:`linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)`}}var an={name:`Progress`,common:ce,self:rn};function on(e){let{iconColor:t,primaryColor:n,errorColor:r,textColor2:i,successColor:a,opacityDisabled:o,actionColor:s,borderColor:c,hoverColor:l,lineHeight:u,borderRadius:d,fontSize:f}=e;return{fontSize:f,lineHeight:u,borderRadius:d,draggerColor:s,draggerBorder:`1px dashed ${c}`,draggerBorderHover:`1px dashed ${n}`,itemColorHover:l,itemColorHoverError:le(r,{alpha:.06}),itemTextColor:i,itemTextColorError:r,itemTextColorSuccess:a,itemIconColor:t,itemDisabledOpacity:o,itemBorderImageCardError:`1px solid ${r}`,itemBorderImageCard:`1px solid ${c}`}}var sn=de({name:`Upload`,common:ce,peers:{Button:Ae,Progress:an},self:on});function cn(){return{toolbarIconColor:`rgba(255, 255, 255, .9)`,toolbarColor:`rgba(0, 0, 0, .35)`,toolbarBoxShadow:`none`,toolbarBorderRadius:`24px`}}var ln=de({name:`Image`,common:ce,peers:{Tooltip:Re},self:cn});function un(){return c(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},c(`path`,{d:`M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z`,fill:`currentColor`}))}function dn(){return c(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},c(`path`,{d:`M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z`,fill:`currentColor`}))}function fn(){return c(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},c(`path`,{d:`M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z`,fill:`currentColor`}))}var pn=Object.assign(Object.assign({},B.props),{onPreviewPrev:Function,onPreviewNext:Function,showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean,renderToolbar:Function}),mn=ee(`n-image`),hn=H([H(`body >`,[W(`image-container`,`position: fixed;`)]),W(`image-preview-container`,`
|
|
2
|
+
position: fixed;
|
|
3
|
+
left: 0;
|
|
4
|
+
right: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
`),W(`image-preview-overlay`,`
|
|
9
|
+
z-index: -1;
|
|
10
|
+
position: absolute;
|
|
11
|
+
left: 0;
|
|
12
|
+
right: 0;
|
|
13
|
+
top: 0;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
background: rgba(0, 0, 0, .3);
|
|
16
|
+
`,[be()]),W(`image-preview-toolbar`,`
|
|
17
|
+
z-index: 1;
|
|
18
|
+
position: absolute;
|
|
19
|
+
left: 50%;
|
|
20
|
+
transform: translateX(-50%);
|
|
21
|
+
border-radius: var(--n-toolbar-border-radius);
|
|
22
|
+
height: 48px;
|
|
23
|
+
bottom: 40px;
|
|
24
|
+
padding: 0 12px;
|
|
25
|
+
background: var(--n-toolbar-color);
|
|
26
|
+
box-shadow: var(--n-toolbar-box-shadow);
|
|
27
|
+
color: var(--n-toolbar-icon-color);
|
|
28
|
+
transition: color .3s var(--n-bezier);
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
`,[W(`base-icon`,`
|
|
32
|
+
padding: 0 8px;
|
|
33
|
+
font-size: 28px;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
`),be()]),W(`image-preview-wrapper`,`
|
|
36
|
+
position: absolute;
|
|
37
|
+
left: 0;
|
|
38
|
+
right: 0;
|
|
39
|
+
top: 0;
|
|
40
|
+
bottom: 0;
|
|
41
|
+
display: flex;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
`,[je()]),W(`image-preview`,`
|
|
44
|
+
user-select: none;
|
|
45
|
+
-webkit-user-select: none;
|
|
46
|
+
pointer-events: all;
|
|
47
|
+
margin: auto;
|
|
48
|
+
max-height: calc(100vh - 32px);
|
|
49
|
+
max-width: calc(100vw - 32px);
|
|
50
|
+
transition: transform .3s var(--n-bezier);
|
|
51
|
+
`),W(`image`,`
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
max-height: 100%;
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
`,[ie(`preview-disabled`,`
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
`),H(`img`,`
|
|
58
|
+
border-radius: inherit;
|
|
59
|
+
`)])]),gn=32,_n=T({name:`ImagePreview`,props:Object.assign(Object.assign({},pn),{src:String,show:{type:Boolean,default:void 0},defaultShow:Boolean,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onNext:Function,onPrev:Function,onClose:[Function,Array]}),setup(e){let{src:t}=b(e),{mergedClsPrefixRef:r}=P(e),i=B(`Image`,`-image`,hn,ln,e,r),o=null,s=_(null),l=_(null),u=_(!1),{localeRef:d}=Se(`Image`),f=_(e.defaultShow),h=xe(y(e,`show`),f);function g(){let{value:e}=l;if(!o||!e)return;let{style:t}=e,n=o.getBoundingClientRect();t.transformOrigin=`${n.left+n.width/2}px ${n.top+n.height/2}px`}function v(t){var n,r;switch(t.key){case` `:t.preventDefault();break;case`ArrowLeft`:(n=e.onPrev)==null||n.call(e);break;case`ArrowRight`:(r=e.onNext)==null||r.call(e);break;case`ArrowUp`:t.preventDefault(),H();break;case`ArrowDown`:t.preventDefault(),de();break;case`Escape`:K();break}}function x(t){let{onUpdateShow:n,"onUpdate:show":r}=e;n&&U(n,t),r&&U(r,t),f.value=t,u.value=!0}m(h,e=>{e?ve(`keydown`,document,v):ye(`keydown`,document,v)}),p(()=>{ye(`keydown`,document,v)});let S=0,C=0,T=0,E=0,D=0,O=0,k=0,A=0,j=!1;function M(e){let{clientX:t,clientY:n}=e;T=t-S,E=n-C,ge(G)}function N(e){let{mouseUpClientX:t,mouseUpClientY:n,mouseDownClientX:r,mouseDownClientY:i}=e,a=r-t,o=i-n;return{moveVerticalDirection:`vertical${o>0?`Top`:`Bottom`}`,moveHorizontalDirection:`horizontal${a>0?`Left`:`Right`}`,deltaHorizontal:a,deltaVertical:o}}function ee(e){let{value:t}=s;if(!t)return{offsetX:0,offsetY:0};let n=t.getBoundingClientRect(),{moveVerticalDirection:r,moveHorizontalDirection:i,deltaHorizontal:a,deltaVertical:o}=e||{},c=0,l=0;return c=n.width<=window.innerWidth?0:n.left>0?(n.width-window.innerWidth)/2:n.right<window.innerWidth?-(n.width-window.innerWidth)/2:i===`horizontalRight`?Math.min((n.width-window.innerWidth)/2,D-(a??0)):Math.max(-((n.width-window.innerWidth)/2),D-(a??0)),l=n.height<=window.innerHeight?0:n.top>0?(n.height-window.innerHeight)/2:n.bottom<window.innerHeight?-(n.height-window.innerHeight)/2:r===`verticalBottom`?Math.min((n.height-window.innerHeight)/2,O-(o??0)):Math.max(-((n.height-window.innerHeight)/2),O-(o??0)),{offsetX:c,offsetY:l}}function te(e){ye(`mousemove`,document,M),ye(`mouseup`,document,te);let{clientX:t,clientY:n}=e;j=!1;let r=ee(N({mouseUpClientX:t,mouseUpClientY:n,mouseDownClientX:k,mouseDownClientY:A}));T=r.offsetX,E=r.offsetY,G()}let F=a(mn,null);function ne(e){var t,n;if((n=(t=F?.previewedImgPropsRef.value)?.onMousedown)==null||n.call(t,e),e.button!==0)return;let{clientX:r,clientY:i}=e;j=!0,S=r-T,C=i-E,D=T,O=E,k=r,A=i,G(),ve(`mousemove`,document,M),ve(`mouseup`,document,te)}let I=1.5,L=0,R=1,z=0;function re(e){var t,n;(n=(t=F?.previewedImgPropsRef.value)?.onDblclick)==null||n.call(t,e);let r=ue();R=R===r?1:r,G()}function ie(){R=1,L=0}function oe(){var t;ie(),z=0,(t=e.onPrev)==null||t.call(e)}function se(){var t;ie(),z=0,(t=e.onNext)==null||t.call(e)}function V(){z-=90,G()}function ce(){z+=90,G()}function le(){let{value:e}=s;if(!e)return 1;let{innerWidth:t,innerHeight:n}=window,r=Math.max(1,e.naturalHeight/(n-gn)),i=Math.max(1,e.naturalWidth/(t-gn));return Math.max(3,r*2,i*2)}function ue(){let{value:e}=s;if(!e)return 1;let{innerWidth:t,innerHeight:n}=window,r=e.naturalHeight/(n-gn),i=e.naturalWidth/(t-gn);return r<1&&i<1?1:Math.max(r,i)}function H(){let e=le();R<e&&(L+=1,R=Math.min(e,I**+L),G())}function de(){if(R>.5){let e=R;--L,R=Math.max(.5,I**+L);let t=e-R;G(!1);let n=ee();R+=t,G(!1),R-=t,T=n.offsetX,E=n.offsetY,G()}}function W(){let e=t.value;e&&We(e,void 0)}function G(e=!0){let{value:t}=s;if(!t)return;let{style:n}=t,r=w(F?.previewedImgPropsRef.value?.style),i=``;if(typeof r==`string`)i=`${r};`;else for(let e in r)i+=`${Bt(e)}: ${r[e]};`;let a=`transform-origin: center; transform: translateX(${T}px) translateY(${E}px) rotate(${z}deg) scale(${R});`;j?n.cssText=`${i}cursor: grabbing; transition: none;${a}`:n.cssText=`${i}cursor: grab;${a}${e?``:`transition: none;`}`,e||t.offsetHeight}function K(){if(h.value){let{onClose:t}=e;t&&U(t),x(!1),f.value=!1}}function pe(){R=ue(),L=Math.ceil(Math.log(R)/Math.log(I)),T=0,E=0,G()}let me={setThumbnailEl:e=>{o=e}};function he(t,n){if(e.showToolbarTooltip){let{value:e}=i;return c(ze,{to:!1,theme:e.peers.Tooltip,themeOverrides:e.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>d.value[n],trigger:()=>t})}else return t}let q=n(()=>{let{common:{cubicBezierEaseInOut:e},self:{toolbarIconColor:t,toolbarBorderRadius:n,toolbarBoxShadow:r,toolbarColor:a}}=i.value;return{"--n-bezier":e,"--n-toolbar-icon-color":t,"--n-toolbar-color":a,"--n-toolbar-border-radius":n,"--n-toolbar-box-shadow":r}}),{inlineThemeDisabled:J}=P(),_e=J?fe(`image-preview`,void 0,q,e):void 0;function be(e){e.preventDefault()}return Object.assign({clsPrefix:r,previewRef:s,previewWrapperRef:l,previewSrc:t,mergedShow:h,appear:ae(),displayed:u,previewedImgProps:F?.previewedImgPropsRef,handleWheel:be,handlePreviewMousedown:ne,handlePreviewDblclick:re,syncTransformOrigin:g,handleAfterLeave:()=>{ie(),z=0,u.value=!1},handleDragStart:e=>{var t,n;(n=(t=F?.previewedImgPropsRef.value)?.onDragstart)==null||n.call(t,e),e.preventDefault()},zoomIn:H,zoomOut:de,handleDownloadClick:W,rotateCounterclockwise:V,rotateClockwise:ce,handleSwitchPrev:oe,handleSwitchNext:se,withTooltip:he,resizeToOrignalImageSize:pe,cssVars:J?void 0:q,themeClass:_e?.themeClass,onRender:_e?.onRender,doUpdateShow:x,close:K},me)},render(){var t;let{clsPrefix:n,renderToolbar:r,withTooltip:i}=this,a=i(c(Y,{clsPrefix:n,onClick:this.handleSwitchPrev},{default:un}),`tipPrevious`),o=i(c(Y,{clsPrefix:n,onClick:this.handleSwitchNext},{default:dn}),`tipNext`),s=i(c(Y,{clsPrefix:n,onClick:this.rotateCounterclockwise},{default:()=>c(qt,null)}),`tipCounterclockwise`),l=i(c(Y,{clsPrefix:n,onClick:this.rotateClockwise},{default:()=>c(Kt,null)}),`tipClockwise`),u=i(c(Y,{clsPrefix:n,onClick:this.resizeToOrignalImageSize},{default:()=>c(Wt,null)}),`tipOriginalSize`),d=i(c(Y,{clsPrefix:n,onClick:this.zoomOut},{default:()=>c(Xt,null)}),`tipZoomOut`),f=i(c(Y,{clsPrefix:n,onClick:this.handleDownloadClick},{default:()=>c(Ut,null)}),`tipDownload`),p=i(c(Y,{clsPrefix:n,onClick:()=>this.close()},{default:fn}),`tipClose`),m=i(c(Y,{clsPrefix:n,onClick:this.zoomIn},{default:()=>c(Yt,null)}),`tipZoomIn`);return c(j,null,(t=this.$slots).default?.call(t),c(me,{show:this.mergedShow},{default:()=>{var t;return this.mergedShow||this.displayed?((t=this.onRender)==null||t.call(this),e(c(`div`,{ref:`containerRef`,class:[`${n}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},c(v,{name:`fade-in-transition`,appear:this.appear},{default:()=>this.mergedShow?c(`div`,{class:`${n}-image-preview-overlay`,onClick:()=>this.close()}):null}),this.showToolbar?c(v,{name:`fade-in-transition`,appear:this.appear},{default:()=>this.mergedShow?c(`div`,{class:`${n}-image-preview-toolbar`},r?r({nodes:{prev:a,next:o,rotateCounterclockwise:s,rotateClockwise:l,resizeToOriginalSize:u,zoomOut:d,zoomIn:m,download:f,close:p}}):c(j,null,this.onPrev?c(j,null,a,o):null,s,l,u,d,m,f,p)):null}):null,c(v,{name:`fade-in-scale-up-transition`,onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{let{previewedImgProps:t={}}=this;return e(c(`div`,{class:`${n}-image-preview-wrapper`,ref:`previewWrapperRef`},c(`img`,Object.assign({},t,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${n}-image-preview`,t.class],key:this.previewSrc,src:this.previewSrc,ref:`previewRef`,onDragstart:this.handleDragStart}))),[[C,this.mergedShow]])}})),[[he,{enabled:this.mergedShow}]])):null}}))}}),vn=ee(`n-image-group`),yn=T({name:`ImageGroup`,props:Object.assign(Object.assign({},pn),{srcList:Array,current:Number,defaultCurrent:{type:Number,default:0},show:{type:Boolean,default:void 0},defaultShow:Boolean,onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],onUpdateCurrent:[Function,Array],"onUpdate:current":[Function,Array]}),setup(e){let{mergedClsPrefixRef:t}=P(e),r=`c${pe()}`,i=_(null),a=_(e.defaultShow),o=xe(y(e,`show`),a),c=_(new Map),l=n(()=>{if(e.srcList){let t=new Map;return e.srcList.forEach((e,n)=>{t.set(`p${n}`,e)}),t}return c.value}),u=n(()=>Array.from(l.value.keys())),d=()=>u.value.length;function f(t,n){e.srcList&&R(`image-group`,"`n-image` can't be placed inside `n-image-group` when image group's `src-list` prop is set.");let r=`r${t}`;return c.value.has(`r${r}`)||c.value.set(r,n),function(){c.value.has(r)||c.value.delete(r)}}let p=_(e.defaultCurrent),m=xe(y(e,`current`),p),h=t=>{if(t!==m.value){let{onUpdateCurrent:n,"onUpdate:current":r}=e;n&&U(n,t),r&&U(r,t),p.value=t}},g=n(()=>u.value[m.value]),v=e=>{let t=u.value.indexOf(e);t!==m.value&&h(t)},b=n(()=>l.value.get(g.value));function x(t){let{onUpdateShow:n,"onUpdate:show":r}=e;n&&U(n,t),r&&U(r,t),a.value=t}function S(){x(!1)}let C=n(()=>{let e=(e,t)=>{for(let n=e;n<=t;n++){let e=u.value[n];if(l.value.get(e))return n}},t=e(m.value+1,d()-1);return t===void 0?e(0,m.value-1):t}),w=n(()=>{let e=(e,t)=>{for(let n=e;n>=t;n--){let e=u.value[n];if(l.value.get(e))return n}},t=e(m.value-1,0);return t===void 0?e(d()-1,m.value+1):t});function T(t){var n,r;t===1?(w.value!==void 0&&h(C.value),(n=e.onPreviewNext)==null||n.call(e)):(C.value!==void 0&&h(w.value),(r=e.onPreviewPrev)==null||r.call(e))}return s(vn,{mergedClsPrefixRef:t,registerImageUrl:f,setThumbnailEl:e=>{var t;(t=i.value)==null||t.setThumbnailEl(e)},toggleShow:e=>{x(!0),v(e)},groupId:r,renderToolbarRef:y(e,`renderToolbar`)}),{mergedClsPrefix:t,previewInstRef:i,mergedShow:o,src:b,onClose:S,next:()=>{T(1)},prev:()=>{T(-1)}}},render(){return c(_n,{theme:this.theme,themeOverrides:this.themeOverrides,ref:`previewInstRef`,onPrev:this.prev,onNext:this.next,src:this.src,show:this.mergedShow,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar,onClose:this.onClose},this.$slots)}}),bn=Object.assign({alt:String,height:[String,Number],imgProps:Object,previewedImgProps:Object,lazy:Boolean,intersectionObserverOptions:Object,objectFit:{type:String,default:`fill`},previewSrc:String,fallbackSrc:String,width:[String,Number],src:String,previewDisabled:Boolean,loadDescription:String,onError:Function,onLoad:Function},pn),xn=0,Sn=T({name:`Image`,props:bn,slots:Object,inheritAttrs:!1,setup(e){let t=_(null),r=_(!1),i=_(null),o=a(vn,null),{mergedClsPrefixRef:c}=o||P(e),l=n(()=>e.previewSrc||e.src),u=_(!1),d=xn++,m=()=>{if(e.previewDisabled||r.value)return;if(o){o.setThumbnailEl(t.value),o.toggleShow(`r${d}`);return}let{value:n}=i;n&&(n.setThumbnailEl(t.value),u.value=!0)},g={click:()=>{m()},showPreview:m},v=_(!e.lazy);f(()=>{var e;(e=t.value)==null||e.setAttribute(`data-group-id`,o?.groupId||``)}),f(()=>{if(e.lazy&&e.intersectionObserverOptions){let n,r=h(()=>{n?.(),n=void 0,n=nn(t.value,e.intersectionObserverOptions,v)});p(()=>{r(),n?.()})}}),h(()=>{var t;e.src||(t=e.imgProps)==null||t.src,r.value=!1}),h(e=>{let t=(o?.registerImageUrl)?.call(o,d,l.value||``);e(()=>{t?.()})});function b(t){var n,r;g.showPreview(),(r=(n=e.imgProps)?.onClick)==null||r.call(n,t)}function x(){u.value=!1}let S=_(!1);return s(mn,{previewedImgPropsRef:y(e,`previewedImgProps`)}),Object.assign({mergedClsPrefix:c,groupId:o?.groupId,previewInstRef:i,imageRef:t,mergedPreviewSrc:l,showError:r,shouldStartLoading:v,loaded:S,mergedOnClick:e=>{b(e)},onPreviewClose:x,mergedOnError:t=>{if(!v.value)return;r.value=!0;let{onError:n,imgProps:{onError:i}={}}=e;n?.(t),i?.(t)},mergedOnLoad:t=>{let{onLoad:n,imgProps:{onLoad:r}={}}=e;n?.(t),r?.(t),S.value=!0},previewShow:u},g)},render(){var e;let{mergedClsPrefix:t,imgProps:n={},loaded:r,$attrs:i,lazy:a}=this,o=I(this.$slots.error,()=>[]),s=(e=this.$slots).placeholder?.call(e),l=this.src||n.src,u=this.showError&&o.length?o:c(`img`,Object.assign(Object.assign({},n),{ref:`imageRef`,width:this.width||n.width,height:this.height||n.height,src:this.showError?this.fallbackSrc:a&&this.intersectionObserverOptions?this.shouldStartLoading?l:void 0:l,alt:this.alt||n.alt,"aria-label":this.alt||n.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:Zt&&a&&!this.intersectionObserverOptions?`lazy`:`eager`,style:[n.style||``,s&&!r?{height:`0`,width:`0`,visibility:`hidden`}:``,{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return c(`div`,Object.assign({},i,{role:`none`,class:[i.class,`${t}-image`,(this.previewDisabled||this.showError)&&`${t}-image--preview-disabled`]}),this.groupId?u:c(_n,{theme:this.theme,themeOverrides:this.themeOverrides,ref:`previewInstRef`,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar,src:this.mergedPreviewSrc,show:!this.previewDisabled&&this.previewShow,onClose:this.onPreviewClose},{default:()=>u}),!r&&s)}}),Cn={success:c(Ce,null),error:c(Ee,null),warning:c(Me,null),info:c(we,null)},wn=T({name:`ProgressCircle`,props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:[String,Object],railColor:String,railStyle:[String,Object],percentage:{type:Number,default:0},offsetDegree:{type:Number,default:0},showIndicator:{type:Boolean,required:!0},indicatorTextColor:String,unit:String,viewBoxWidth:{type:Number,required:!0},gapDegree:{type:Number,required:!0},gapOffsetDegree:{type:Number,default:0}},setup(e,{slots:t}){let r=n(()=>{let t=`gradient`,{fillColor:n}=e;return typeof n==`object`?`${t}-${se(JSON.stringify(n))}`:t});function i(t,n,i,a){let{gapDegree:o,viewBoxWidth:s,strokeWidth:c}=e,l=50+c/2,u=`M ${l},${l} m 0,50
|
|
60
|
+
a 50,50 0 1 1 0,-100
|
|
61
|
+
a 50,50 0 1 1 0,100`,d=Math.PI*2*50;return{pathString:u,pathStyle:{stroke:a===`rail`?i:typeof e.fillColor==`object`?`url(#${r.value})`:i,strokeDasharray:`${Math.min(t,100)/100*(d-o)}px ${s*8}px`,strokeDashoffset:`-${o/2}px`,transformOrigin:n?`center`:void 0,transform:n?`rotate(${n}deg)`:void 0}}}let a=()=>{let t=typeof e.fillColor==`object`,n=t?e.fillColor.stops[0]:``,i=t?e.fillColor.stops[1]:``;return t&&c(`defs`,null,c(`linearGradient`,{id:r.value,x1:`0%`,y1:`100%`,x2:`100%`,y2:`0%`},c(`stop`,{offset:`0%`,"stop-color":n}),c(`stop`,{offset:`100%`,"stop-color":i})))};return()=>{let{fillColor:n,railColor:r,strokeWidth:o,offsetDegree:s,status:l,percentage:u,showIndicator:d,indicatorTextColor:f,unit:p,gapOffsetDegree:m,clsPrefix:h}=e,{pathString:g,pathStyle:_}=i(100,0,r,`rail`),{pathString:v,pathStyle:y}=i(u,s,n,`fill`),b=100+o;return c(`div`,{class:`${h}-progress-content`,role:`none`},c(`div`,{class:`${h}-progress-graph`,"aria-hidden":!0},c(`div`,{class:`${h}-progress-graph-circle`,style:{transform:m?`rotate(${m}deg)`:void 0}},c(`svg`,{viewBox:`0 0 ${b} ${b}`},a(),c(`g`,null,c(`path`,{class:`${h}-progress-graph-circle-rail`,d:g,"stroke-width":o,"stroke-linecap":`round`,fill:`none`,style:_})),c(`g`,null,c(`path`,{class:[`${h}-progress-graph-circle-fill`,u===0&&`${h}-progress-graph-circle-fill--empty`],d:v,"stroke-width":o,"stroke-linecap":`round`,fill:`none`,style:y}))))),d?c(`div`,null,t.default?c(`div`,{class:`${h}-progress-custom-content`,role:`none`},t.default()):l===`default`?c(`div`,{class:`${h}-progress-text`,style:{color:f},role:`none`},c(`span`,{class:`${h}-progress-text__percentage`},u),c(`span`,{class:`${h}-progress-text__unit`},p)):c(`div`,{class:`${h}-progress-icon`,"aria-hidden":!0},c(Y,{clsPrefix:h},{default:()=>Cn[l]}))):null)}}}),Tn={success:c(Ce,null),error:c(Ee,null),warning:c(Me,null),info:c(we,null)},En=T({name:`ProgressLine`,props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:[String,Object],status:{type:String,required:!0},indicatorPlacement:{type:String,required:!0},indicatorTextColor:String,unit:{type:String,default:`%`},processing:{type:Boolean,required:!0},showIndicator:{type:Boolean,required:!0},height:[String,Number],railBorderRadius:[String,Number],fillBorderRadius:[String,Number]},setup(e,{slots:t}){let r=n(()=>q(e.height)),i=n(()=>typeof e.fillColor==`object`?`linear-gradient(to right, ${e.fillColor?.stops[0]} , ${e.fillColor?.stops[1]})`:e.fillColor),a=n(()=>e.railBorderRadius===void 0?e.height===void 0?``:q(e.height,{c:.5}):q(e.railBorderRadius)),o=n(()=>e.fillBorderRadius===void 0?e.railBorderRadius===void 0?e.height===void 0?``:q(e.height,{c:.5}):q(e.railBorderRadius):q(e.fillBorderRadius));return()=>{let{indicatorPlacement:n,railColor:s,railStyle:l,percentage:u,unit:d,indicatorTextColor:f,status:p,showIndicator:m,processing:h,clsPrefix:g}=e;return c(`div`,{class:`${g}-progress-content`,role:`none`},c(`div`,{class:`${g}-progress-graph`,"aria-hidden":!0},c(`div`,{class:[`${g}-progress-graph-line`,{[`${g}-progress-graph-line--indicator-${n}`]:!0}]},c(`div`,{class:`${g}-progress-graph-line-rail`,style:[{backgroundColor:s,height:r.value,borderRadius:a.value},l]},c(`div`,{class:[`${g}-progress-graph-line-fill`,h&&`${g}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,background:i.value,height:r.value,lineHeight:r.value,borderRadius:o.value}},n===`inside`?c(`div`,{class:`${g}-progress-graph-line-indicator`,style:{color:f}},t.default?t.default():`${u}${d}`):null)))),m&&n===`outside`?c(`div`,null,t.default?c(`div`,{class:`${g}-progress-custom-content`,style:{color:f},role:`none`},t.default()):p===`default`?c(`div`,{role:`none`,class:`${g}-progress-icon ${g}-progress-icon--as-text`,style:{color:f}},u,d):c(`div`,{class:`${g}-progress-icon`,"aria-hidden":!0},c(Y,{clsPrefix:g},{default:()=>Tn[p]}))):null)}}});function Dn(e,t,n=100){return`m ${n/2} ${n/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}var On=T({name:`ProgressMultipleCircle`,props:{clsPrefix:{type:String,required:!0},viewBoxWidth:{type:Number,required:!0},percentage:{type:Array,default:[0]},strokeWidth:{type:Number,required:!0},circleGap:{type:Number,required:!0},showIndicator:{type:Boolean,required:!0},fillColor:{type:Array,default:()=>[]},railColor:{type:Array,default:()=>[]},railStyle:{type:Array,default:()=>[]}},setup(e,{slots:t}){let r=n(()=>e.percentage.map((t,n)=>`${Math.PI*t/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*n)-e.circleGap*n)*2}, ${e.viewBoxWidth*8}`)),i=(t,n)=>{let r=e.fillColor[n],i=typeof r==`object`?r.stops[0]:``,a=typeof r==`object`?r.stops[1]:``;return typeof e.fillColor[n]==`object`&&c(`linearGradient`,{id:`gradient-${n}`,x1:`100%`,y1:`0%`,x2:`0%`,y2:`100%`},c(`stop`,{offset:`0%`,"stop-color":i}),c(`stop`,{offset:`100%`,"stop-color":a}))};return()=>{let{viewBoxWidth:n,strokeWidth:a,circleGap:o,showIndicator:s,fillColor:l,railColor:u,railStyle:d,percentage:f,clsPrefix:p}=e;return c(`div`,{class:`${p}-progress-content`,role:`none`},c(`div`,{class:`${p}-progress-graph`,"aria-hidden":!0},c(`div`,{class:`${p}-progress-graph-circle`},c(`svg`,{viewBox:`0 0 ${n} ${n}`},c(`defs`,null,f.map((e,t)=>i(e,t))),f.map((e,t)=>c(`g`,{key:t},c(`path`,{class:`${p}-progress-graph-circle-rail`,d:Dn(n/2-a/2*(1+2*t)-o*t,a,n),"stroke-width":a,"stroke-linecap":`round`,fill:`none`,style:[{strokeDashoffset:0,stroke:u[t]},d[t]]}),c(`path`,{class:[`${p}-progress-graph-circle-fill`,e===0&&`${p}-progress-graph-circle-fill--empty`],d:Dn(n/2-a/2*(1+2*t)-o*t,a,n),"stroke-width":a,"stroke-linecap":`round`,fill:`none`,style:{strokeDasharray:r.value[t],strokeDashoffset:0,stroke:typeof l[t]==`object`?`url(#gradient-${t})`:l[t]}})))))),s&&t.default?c(`div`,null,c(`div`,{class:`${p}-progress-text`},t.default())):null)}}}),kn=H([W(`progress`,{display:`inline-block`},[W(`progress-icon`,`
|
|
62
|
+
color: var(--n-icon-color);
|
|
63
|
+
transition: color .3s var(--n-bezier);
|
|
64
|
+
`),K(`line`,`
|
|
65
|
+
width: 100%;
|
|
66
|
+
display: block;
|
|
67
|
+
`,[W(`progress-content`,`
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
`,[W(`progress-graph`,{flex:1})]),W(`progress-custom-content`,{marginLeft:`14px`}),W(`progress-icon`,`
|
|
71
|
+
width: 30px;
|
|
72
|
+
padding-left: 14px;
|
|
73
|
+
height: var(--n-icon-size-line);
|
|
74
|
+
line-height: var(--n-icon-size-line);
|
|
75
|
+
font-size: var(--n-icon-size-line);
|
|
76
|
+
`,[K(`as-text`,`
|
|
77
|
+
color: var(--n-text-color-line-outer);
|
|
78
|
+
text-align: center;
|
|
79
|
+
width: 40px;
|
|
80
|
+
font-size: var(--n-font-size);
|
|
81
|
+
padding-left: 4px;
|
|
82
|
+
transition: color .3s var(--n-bezier);
|
|
83
|
+
`)])]),K(`circle, dashboard`,{width:`120px`},[W(`progress-custom-content`,`
|
|
84
|
+
position: absolute;
|
|
85
|
+
left: 50%;
|
|
86
|
+
top: 50%;
|
|
87
|
+
transform: translateX(-50%) translateY(-50%);
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
`),W(`progress-text`,`
|
|
92
|
+
position: absolute;
|
|
93
|
+
left: 50%;
|
|
94
|
+
top: 50%;
|
|
95
|
+
transform: translateX(-50%) translateY(-50%);
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
color: inherit;
|
|
99
|
+
font-size: var(--n-font-size-circle);
|
|
100
|
+
color: var(--n-text-color-circle);
|
|
101
|
+
font-weight: var(--n-font-weight-circle);
|
|
102
|
+
transition: color .3s var(--n-bezier);
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
`),W(`progress-icon`,`
|
|
105
|
+
position: absolute;
|
|
106
|
+
left: 50%;
|
|
107
|
+
top: 50%;
|
|
108
|
+
transform: translateX(-50%) translateY(-50%);
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
color: var(--n-icon-color);
|
|
112
|
+
font-size: var(--n-icon-size-circle);
|
|
113
|
+
`)]),K(`multiple-circle`,`
|
|
114
|
+
width: 200px;
|
|
115
|
+
color: inherit;
|
|
116
|
+
`,[W(`progress-text`,`
|
|
117
|
+
font-weight: var(--n-font-weight-circle);
|
|
118
|
+
color: var(--n-text-color-circle);
|
|
119
|
+
position: absolute;
|
|
120
|
+
left: 50%;
|
|
121
|
+
top: 50%;
|
|
122
|
+
transform: translateX(-50%) translateY(-50%);
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
transition: color .3s var(--n-bezier);
|
|
127
|
+
`)]),W(`progress-content`,{position:`relative`}),W(`progress-graph`,{position:`relative`},[W(`progress-graph-circle`,[H(`svg`,{verticalAlign:`bottom`}),W(`progress-graph-circle-fill`,`
|
|
128
|
+
stroke: var(--n-fill-color);
|
|
129
|
+
transition:
|
|
130
|
+
opacity .3s var(--n-bezier),
|
|
131
|
+
stroke .3s var(--n-bezier),
|
|
132
|
+
stroke-dasharray .3s var(--n-bezier);
|
|
133
|
+
`,[K(`empty`,{opacity:0})]),W(`progress-graph-circle-rail`,`
|
|
134
|
+
transition: stroke .3s var(--n-bezier);
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
stroke: var(--n-rail-color);
|
|
137
|
+
`)]),W(`progress-graph-line`,[K(`indicator-inside`,[W(`progress-graph-line-rail`,`
|
|
138
|
+
height: 16px;
|
|
139
|
+
line-height: 16px;
|
|
140
|
+
border-radius: 10px;
|
|
141
|
+
`,[W(`progress-graph-line-fill`,`
|
|
142
|
+
height: inherit;
|
|
143
|
+
border-radius: 10px;
|
|
144
|
+
`),W(`progress-graph-line-indicator`,`
|
|
145
|
+
background: #0000;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
text-align: right;
|
|
148
|
+
margin-left: 14px;
|
|
149
|
+
margin-right: 14px;
|
|
150
|
+
height: inherit;
|
|
151
|
+
font-size: 12px;
|
|
152
|
+
color: var(--n-text-color-line-inner);
|
|
153
|
+
transition: color .3s var(--n-bezier);
|
|
154
|
+
`)])]),K(`indicator-inside-label`,`
|
|
155
|
+
height: 16px;
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
`,[W(`progress-graph-line-rail`,`
|
|
159
|
+
flex: 1;
|
|
160
|
+
transition: background-color .3s var(--n-bezier);
|
|
161
|
+
`),W(`progress-graph-line-indicator`,`
|
|
162
|
+
background: var(--n-fill-color);
|
|
163
|
+
font-size: 12px;
|
|
164
|
+
transform: translateZ(0);
|
|
165
|
+
display: flex;
|
|
166
|
+
vertical-align: middle;
|
|
167
|
+
height: 16px;
|
|
168
|
+
line-height: 16px;
|
|
169
|
+
padding: 0 10px;
|
|
170
|
+
border-radius: 10px;
|
|
171
|
+
position: absolute;
|
|
172
|
+
white-space: nowrap;
|
|
173
|
+
color: var(--n-text-color-line-inner);
|
|
174
|
+
transition:
|
|
175
|
+
right .2s var(--n-bezier),
|
|
176
|
+
color .3s var(--n-bezier),
|
|
177
|
+
background-color .3s var(--n-bezier);
|
|
178
|
+
`)]),W(`progress-graph-line-rail`,`
|
|
179
|
+
position: relative;
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
height: var(--n-rail-height);
|
|
182
|
+
border-radius: 5px;
|
|
183
|
+
background-color: var(--n-rail-color);
|
|
184
|
+
transition: background-color .3s var(--n-bezier);
|
|
185
|
+
`,[W(`progress-graph-line-fill`,`
|
|
186
|
+
background: var(--n-fill-color);
|
|
187
|
+
position: relative;
|
|
188
|
+
border-radius: 5px;
|
|
189
|
+
height: inherit;
|
|
190
|
+
width: 100%;
|
|
191
|
+
max-width: 0%;
|
|
192
|
+
transition:
|
|
193
|
+
background-color .3s var(--n-bezier),
|
|
194
|
+
max-width .2s var(--n-bezier);
|
|
195
|
+
`,[K(`processing`,[H(`&::after`,`
|
|
196
|
+
content: "";
|
|
197
|
+
background-image: var(--n-line-bg-processing);
|
|
198
|
+
animation: progress-processing-animation 2s var(--n-bezier) infinite;
|
|
199
|
+
`)])])])])])]),H(`@keyframes progress-processing-animation`,`
|
|
200
|
+
0% {
|
|
201
|
+
position: absolute;
|
|
202
|
+
left: 0;
|
|
203
|
+
top: 0;
|
|
204
|
+
bottom: 0;
|
|
205
|
+
right: 100%;
|
|
206
|
+
opacity: 1;
|
|
207
|
+
}
|
|
208
|
+
66% {
|
|
209
|
+
position: absolute;
|
|
210
|
+
left: 0;
|
|
211
|
+
top: 0;
|
|
212
|
+
bottom: 0;
|
|
213
|
+
right: 0;
|
|
214
|
+
opacity: 0;
|
|
215
|
+
}
|
|
216
|
+
100% {
|
|
217
|
+
position: absolute;
|
|
218
|
+
left: 0;
|
|
219
|
+
top: 0;
|
|
220
|
+
bottom: 0;
|
|
221
|
+
right: 0;
|
|
222
|
+
opacity: 0;
|
|
223
|
+
}
|
|
224
|
+
`)]),An=T({name:`Progress`,props:Object.assign(Object.assign({},B.props),{processing:Boolean,type:{type:String,default:`line`},gapDegree:Number,gapOffsetDegree:Number,status:{type:String,default:`default`},railColor:[String,Array],railStyle:[String,Array],color:[String,Array,Object],viewBoxWidth:{type:Number,default:100},strokeWidth:{type:Number,default:7},percentage:[Number,Array],unit:{type:String,default:`%`},showIndicator:{type:Boolean,default:!0},indicatorPosition:{type:String,default:`outside`},indicatorPlacement:{type:String,default:`outside`},indicatorTextColor:String,circleGap:{type:Number,default:1},height:Number,borderRadius:[String,Number],fillBorderRadius:[String,Number],offsetDegree:Number}),setup(e){let t=n(()=>e.indicatorPlacement||e.indicatorPosition),r=n(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type===`dashboard`)return 75}),{mergedClsPrefixRef:i,inlineThemeDisabled:a}=P(e),o=B(`Progress`,`-progress`,kn,an,e,i),s=n(()=>{let{status:t}=e,{common:{cubicBezierEaseInOut:n},self:{fontSize:r,fontSizeCircle:i,railColor:a,railHeight:s,iconSizeCircle:c,iconSizeLine:l,textColorCircle:u,textColorLineInner:d,textColorLineOuter:f,lineBgProcessing:p,fontWeightCircle:m,[oe(`iconColor`,t)]:h,[oe(`fillColor`,t)]:g}}=o.value;return{"--n-bezier":n,"--n-fill-color":g,"--n-font-size":r,"--n-font-size-circle":i,"--n-font-weight-circle":m,"--n-icon-color":h,"--n-icon-size-circle":c,"--n-icon-size-line":l,"--n-line-bg-processing":p,"--n-rail-color":a,"--n-rail-height":s,"--n-text-color-circle":u,"--n-text-color-line-inner":d,"--n-text-color-line-outer":f}}),c=a?fe(`progress`,n(()=>e.status[0]),s,e):void 0;return{mergedClsPrefix:i,mergedIndicatorPlacement:t,gapDeg:r,cssVars:a?void 0:s,themeClass:c?.themeClass,onRender:c?.onRender}},render(){let{type:e,cssVars:t,indicatorTextColor:n,showIndicator:r,status:i,railColor:a,railStyle:o,color:s,percentage:l,viewBoxWidth:u,strokeWidth:d,mergedIndicatorPlacement:f,unit:p,borderRadius:m,fillBorderRadius:h,height:g,processing:_,circleGap:v,mergedClsPrefix:y,gapDeg:b,gapOffsetDegree:x,themeClass:S,$slots:C,onRender:w}=this;return w?.(),c(`div`,{class:[S,`${y}-progress`,`${y}-progress--${e}`,`${y}-progress--${i}`],style:t,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":l,role:e===`circle`||e===`line`||e===`dashboard`?`progressbar`:`none`},e===`circle`||e===`dashboard`?c(wn,{clsPrefix:y,status:i,showIndicator:r,indicatorTextColor:n,railColor:a,fillColor:s,railStyle:o,offsetDegree:this.offsetDegree,percentage:l,viewBoxWidth:u,strokeWidth:d,gapDegree:b===void 0?e===`dashboard`?75:0:b,gapOffsetDegree:x,unit:p},C):e===`line`?c(En,{clsPrefix:y,status:i,showIndicator:r,indicatorTextColor:n,railColor:a,fillColor:s,railStyle:o,percentage:l,processing:_,indicatorPlacement:f,unit:p,fillBorderRadius:h,railBorderRadius:m,height:g},C):e===`multiple-circle`?c(On,{clsPrefix:y,strokeWidth:d,railColor:a,fillColor:s,railStyle:o,viewBoxWidth:u,percentage:l,showIndicator:r,circleGap:v},C):null)}}),$=ee(`n-upload`),jn=H([W(`upload`,`width: 100%;`,[K(`dragger-inside`,[W(`upload-trigger`,`
|
|
225
|
+
display: block;
|
|
226
|
+
`)]),K(`drag-over`,[W(`upload-dragger`,`
|
|
227
|
+
border: var(--n-dragger-border-hover);
|
|
228
|
+
`)])]),W(`upload-dragger`,`
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
box-sizing: border-box;
|
|
231
|
+
width: 100%;
|
|
232
|
+
text-align: center;
|
|
233
|
+
border-radius: var(--n-border-radius);
|
|
234
|
+
padding: 24px;
|
|
235
|
+
opacity: 1;
|
|
236
|
+
transition:
|
|
237
|
+
opacity .3s var(--n-bezier),
|
|
238
|
+
border-color .3s var(--n-bezier),
|
|
239
|
+
background-color .3s var(--n-bezier);
|
|
240
|
+
background-color: var(--n-dragger-color);
|
|
241
|
+
border: var(--n-dragger-border);
|
|
242
|
+
`,[H(`&:hover`,`
|
|
243
|
+
border: var(--n-dragger-border-hover);
|
|
244
|
+
`),K(`disabled`,`
|
|
245
|
+
cursor: not-allowed;
|
|
246
|
+
`)]),W(`upload-trigger`,`
|
|
247
|
+
display: inline-block;
|
|
248
|
+
box-sizing: border-box;
|
|
249
|
+
opacity: 1;
|
|
250
|
+
transition: opacity .3s var(--n-bezier);
|
|
251
|
+
`,[H(`+`,[W(`upload-file-list`,`margin-top: 8px;`)]),K(`disabled`,`
|
|
252
|
+
opacity: var(--n-item-disabled-opacity);
|
|
253
|
+
cursor: not-allowed;
|
|
254
|
+
`),K(`image-card`,`
|
|
255
|
+
width: 96px;
|
|
256
|
+
height: 96px;
|
|
257
|
+
`,[W(`base-icon`,`
|
|
258
|
+
font-size: 24px;
|
|
259
|
+
`),W(`upload-dragger`,`
|
|
260
|
+
padding: 0;
|
|
261
|
+
height: 100%;
|
|
262
|
+
width: 100%;
|
|
263
|
+
display: flex;
|
|
264
|
+
align-items: center;
|
|
265
|
+
justify-content: center;
|
|
266
|
+
`)])]),W(`upload-file-list`,`
|
|
267
|
+
line-height: var(--n-line-height);
|
|
268
|
+
opacity: 1;
|
|
269
|
+
transition: opacity .3s var(--n-bezier);
|
|
270
|
+
`,[H(`a, img`,`outline: none;`),K(`disabled`,`
|
|
271
|
+
opacity: var(--n-item-disabled-opacity);
|
|
272
|
+
cursor: not-allowed;
|
|
273
|
+
`,[W(`upload-file`,`cursor: not-allowed;`)]),K(`grid`,`
|
|
274
|
+
display: grid;
|
|
275
|
+
grid-template-columns: repeat(auto-fill, 96px);
|
|
276
|
+
grid-gap: 8px;
|
|
277
|
+
margin-top: 0;
|
|
278
|
+
`),W(`upload-file`,`
|
|
279
|
+
display: block;
|
|
280
|
+
box-sizing: border-box;
|
|
281
|
+
cursor: default;
|
|
282
|
+
padding: 0px 12px 0 6px;
|
|
283
|
+
transition: background-color .3s var(--n-bezier);
|
|
284
|
+
border-radius: var(--n-border-radius);
|
|
285
|
+
`,[Le(),W(`progress`,[Le({foldPadding:!0})]),H(`&:hover`,`
|
|
286
|
+
background-color: var(--n-item-color-hover);
|
|
287
|
+
`,[W(`upload-file-info`,[V(`action`,`
|
|
288
|
+
opacity: 1;
|
|
289
|
+
`)])]),K(`image-type`,`
|
|
290
|
+
border-radius: var(--n-border-radius);
|
|
291
|
+
text-decoration: underline;
|
|
292
|
+
text-decoration-color: #0000;
|
|
293
|
+
`,[W(`upload-file-info`,`
|
|
294
|
+
padding-top: 0px;
|
|
295
|
+
padding-bottom: 0px;
|
|
296
|
+
width: 100%;
|
|
297
|
+
height: 100%;
|
|
298
|
+
display: flex;
|
|
299
|
+
justify-content: space-between;
|
|
300
|
+
align-items: center;
|
|
301
|
+
padding: 6px 0;
|
|
302
|
+
`,[W(`progress`,`
|
|
303
|
+
padding: 2px 0;
|
|
304
|
+
margin-bottom: 0;
|
|
305
|
+
`),V(`name`,`
|
|
306
|
+
padding: 0 8px;
|
|
307
|
+
`),V(`thumbnail`,`
|
|
308
|
+
width: 32px;
|
|
309
|
+
height: 32px;
|
|
310
|
+
font-size: 28px;
|
|
311
|
+
display: flex;
|
|
312
|
+
justify-content: center;
|
|
313
|
+
align-items: center;
|
|
314
|
+
`,[H(`img`,`
|
|
315
|
+
width: 100%;
|
|
316
|
+
`)])])]),K(`text-type`,[W(`progress`,`
|
|
317
|
+
box-sizing: border-box;
|
|
318
|
+
padding-bottom: 6px;
|
|
319
|
+
margin-bottom: 6px;
|
|
320
|
+
`)]),K(`image-card-type`,`
|
|
321
|
+
position: relative;
|
|
322
|
+
width: 96px;
|
|
323
|
+
height: 96px;
|
|
324
|
+
border: var(--n-item-border-image-card);
|
|
325
|
+
border-radius: var(--n-border-radius);
|
|
326
|
+
padding: 0;
|
|
327
|
+
display: flex;
|
|
328
|
+
align-items: center;
|
|
329
|
+
justify-content: center;
|
|
330
|
+
transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier);
|
|
331
|
+
border-radius: var(--n-border-radius);
|
|
332
|
+
overflow: hidden;
|
|
333
|
+
`,[W(`progress`,`
|
|
334
|
+
position: absolute;
|
|
335
|
+
left: 8px;
|
|
336
|
+
bottom: 8px;
|
|
337
|
+
right: 8px;
|
|
338
|
+
width: unset;
|
|
339
|
+
`),W(`upload-file-info`,`
|
|
340
|
+
padding: 0;
|
|
341
|
+
width: 100%;
|
|
342
|
+
height: 100%;
|
|
343
|
+
`,[V(`thumbnail`,`
|
|
344
|
+
width: 100%;
|
|
345
|
+
height: 100%;
|
|
346
|
+
display: flex;
|
|
347
|
+
flex-direction: column;
|
|
348
|
+
align-items: center;
|
|
349
|
+
justify-content: center;
|
|
350
|
+
font-size: 36px;
|
|
351
|
+
`,[H(`img`,`
|
|
352
|
+
width: 100%;
|
|
353
|
+
`)])]),H(`&::before`,`
|
|
354
|
+
position: absolute;
|
|
355
|
+
z-index: 1;
|
|
356
|
+
left: 0;
|
|
357
|
+
right: 0;
|
|
358
|
+
top: 0;
|
|
359
|
+
bottom: 0;
|
|
360
|
+
border-radius: inherit;
|
|
361
|
+
opacity: 0;
|
|
362
|
+
transition: opacity .2s var(--n-bezier);
|
|
363
|
+
content: "";
|
|
364
|
+
`),H(`&:hover`,[H(`&::before`,`opacity: 1;`),W(`upload-file-info`,[V(`thumbnail`,`opacity: .12;`)])])]),K(`error-status`,[H(`&:hover`,`
|
|
365
|
+
background-color: var(--n-item-color-hover-error);
|
|
366
|
+
`),W(`upload-file-info`,[V(`name`,`color: var(--n-item-text-color-error);`),V(`thumbnail`,`color: var(--n-item-text-color-error);`)]),K(`image-card-type`,`
|
|
367
|
+
border: var(--n-item-border-image-card-error);
|
|
368
|
+
`)]),K(`with-url`,`
|
|
369
|
+
cursor: pointer;
|
|
370
|
+
`,[W(`upload-file-info`,[V(`name`,`
|
|
371
|
+
color: var(--n-item-text-color-success);
|
|
372
|
+
text-decoration-color: var(--n-item-text-color-success);
|
|
373
|
+
`,[H(`a`,`
|
|
374
|
+
text-decoration: underline;
|
|
375
|
+
`)])])]),W(`upload-file-info`,`
|
|
376
|
+
position: relative;
|
|
377
|
+
padding-top: 6px;
|
|
378
|
+
padding-bottom: 6px;
|
|
379
|
+
display: flex;
|
|
380
|
+
flex-wrap: nowrap;
|
|
381
|
+
`,[V(`thumbnail`,`
|
|
382
|
+
font-size: 18px;
|
|
383
|
+
opacity: 1;
|
|
384
|
+
transition: opacity .2s var(--n-bezier);
|
|
385
|
+
color: var(--n-item-icon-color);
|
|
386
|
+
`,[W(`base-icon`,`
|
|
387
|
+
margin-right: 2px;
|
|
388
|
+
vertical-align: middle;
|
|
389
|
+
transition: color .3s var(--n-bezier);
|
|
390
|
+
`)]),V(`action`,`
|
|
391
|
+
padding-top: inherit;
|
|
392
|
+
padding-bottom: inherit;
|
|
393
|
+
position: absolute;
|
|
394
|
+
right: 0;
|
|
395
|
+
top: 0;
|
|
396
|
+
bottom: 0;
|
|
397
|
+
width: 80px;
|
|
398
|
+
display: flex;
|
|
399
|
+
align-items: center;
|
|
400
|
+
transition: opacity .2s var(--n-bezier);
|
|
401
|
+
justify-content: flex-end;
|
|
402
|
+
opacity: 0;
|
|
403
|
+
`,[W(`button`,[H(`&:not(:last-child)`,{marginRight:`4px`}),W(`base-icon`,[H(`svg`,[z()])])]),K(`image-type`,`
|
|
404
|
+
position: relative;
|
|
405
|
+
max-width: 80px;
|
|
406
|
+
width: auto;
|
|
407
|
+
`),K(`image-card-type`,`
|
|
408
|
+
z-index: 2;
|
|
409
|
+
position: absolute;
|
|
410
|
+
width: 100%;
|
|
411
|
+
height: 100%;
|
|
412
|
+
left: 0;
|
|
413
|
+
right: 0;
|
|
414
|
+
bottom: 0;
|
|
415
|
+
top: 0;
|
|
416
|
+
display: flex;
|
|
417
|
+
justify-content: center;
|
|
418
|
+
align-items: center;
|
|
419
|
+
`)]),V(`name`,`
|
|
420
|
+
color: var(--n-item-text-color);
|
|
421
|
+
flex: 1;
|
|
422
|
+
display: flex;
|
|
423
|
+
justify-content: center;
|
|
424
|
+
text-overflow: ellipsis;
|
|
425
|
+
overflow: hidden;
|
|
426
|
+
flex-direction: column;
|
|
427
|
+
text-decoration-color: #0000;
|
|
428
|
+
font-size: var(--n-font-size);
|
|
429
|
+
transition:
|
|
430
|
+
color .3s var(--n-bezier),
|
|
431
|
+
text-decoration-color .3s var(--n-bezier);
|
|
432
|
+
`,[H(`a`,`
|
|
433
|
+
color: inherit;
|
|
434
|
+
text-decoration: underline;
|
|
435
|
+
`)])])])]),W(`upload-file-input`,`
|
|
436
|
+
display: none;
|
|
437
|
+
width: 0;
|
|
438
|
+
height: 0;
|
|
439
|
+
opacity: 0;
|
|
440
|
+
`)]),Mn=T({name:`UploadDragger`,__UPLOAD_DRAGGER__:!0,setup(e,{slots:t}){let n=a($,null);return n||R(`upload-dragger`,"`n-upload-dragger` must be placed inside `n-upload`."),()=>{let{mergedClsPrefixRef:{value:e},mergedDisabledRef:{value:r},maxReachedRef:{value:i}}=n;return c(`div`,{class:[`${e}-upload-dragger`,(r||i)&&`${e}-upload-dragger--disabled`]},t)}}});function Nn(){return c(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 28 28`},c(`g`,{fill:`none`},c(`path`,{d:`M21.75 3A3.25 3.25 0 0 1 25 6.25v15.5A3.25 3.25 0 0 1 21.75 25H6.25A3.25 3.25 0 0 1 3 21.75V6.25A3.25 3.25 0 0 1 6.25 3h15.5zm.583 20.4l-7.807-7.68a.75.75 0 0 0-.968-.07l-.084.07l-7.808 7.68c.183.065.38.1.584.1h15.5c.204 0 .4-.035.583-.1l-7.807-7.68l7.807 7.68zM21.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v15.5c0 .208.036.408.103.593l7.82-7.692a2.25 2.25 0 0 1 3.026-.117l.129.117l7.82 7.692c.066-.185.102-.385.102-.593V6.25a1.75 1.75 0 0 0-1.75-1.75zm-3.25 3a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5zm0 1.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2z`,fill:`currentColor`})))}function Pn(){return c(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 28 28`},c(`g`,{fill:`none`},c(`path`,{d:`M6.4 2A2.4 2.4 0 0 0 4 4.4v19.2A2.4 2.4 0 0 0 6.4 26h15.2a2.4 2.4 0 0 0 2.4-2.4V11.578c0-.729-.29-1.428-.805-1.944l-6.931-6.931A2.4 2.4 0 0 0 14.567 2H6.4zm-.9 2.4a.9.9 0 0 1 .9-.9H14V10a2 2 0 0 0 2 2h6.5v11.6a.9.9 0 0 1-.9.9H6.4a.9.9 0 0 1-.9-.9V4.4zm16.44 6.1H16a.5.5 0 0 1-.5-.5V4.06l6.44 6.44z`,fill:`currentColor`})))}var Fn=T({name:`UploadProgress`,props:{show:Boolean,percentage:{type:Number,required:!0},status:{type:String,required:!0}},setup(){return{mergedTheme:a($).mergedThemeRef}},render(){return c(ke,null,{default:()=>this.show?c(An,{type:`line`,showIndicator:!1,percentage:this.percentage,status:this.status,height:2,theme:this.mergedTheme.peers.Progress,themeOverrides:this.mergedTheme.peerOverrides.Progress}):null})}}),In=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function Ln(e){return e.includes(`image/`)}function Rn(e=``){let t=e.split(`/`),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[``])[0]}var zn=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,Bn=e=>{if(e.type)return Ln(e.type);let t=Rn(e.name||``);if(zn.test(t))return!0;let n=e.thumbnailUrl||e.url||``,r=Rn(n);return!!(/^data:image\//.test(n)||zn.test(r))};function Vn(e){return In(this,void 0,void 0,function*(){return yield new Promise(t=>{if(!e.type||!Ln(e.type)){t(``);return}t(window.URL.createObjectURL(e))})})}var Hn=F&&window.FileReader&&window.File;function Un(e){return e.isDirectory}function Wn(e){return e.isFile}function Gn(e,t){return In(this,void 0,void 0,function*(){let n=[];function r(e){return In(this,void 0,void 0,function*(){for(let i of e)if(i){if(t&&Un(i)){let e=i.createReader(),t=[],n;try{do n=yield new Promise((t,n)=>{e.readEntries(t,n)}),t=t.concat(n);while(n.length>0)}catch(e){te(`upload`,`error happens when handling directory upload`,e)}yield r(t)}else if(Wn(i))try{let e=yield new Promise((e,t)=>{i.file(e,t)});n.push({file:e,entry:i,source:`dnd`})}catch(e){te(`upload`,`error happens when handling file upload`,e)}}})}return yield r(e),n})}function Kn(e){let{id:t,name:n,percentage:r,status:i,url:a,file:o,thumbnailUrl:s,type:c,fullPath:l,batchId:u}=e;return{id:t,name:n,percentage:r??null,status:i,url:a??null,file:o??null,thumbnailUrl:s??null,type:c??null,fullPath:l??null,batchId:u??null}}function qn(e,t,n){return e=e.toLowerCase(),t=t.toLocaleLowerCase(),n=n.toLocaleLowerCase(),n.split(`,`).map(e=>e.trim()).filter(Boolean).some(n=>{if(n.startsWith(`.`)){if(e.endsWith(n))return!0}else if(n.includes(`/`)){let[e,r]=t.split(`/`),[i,a]=n.split(`/`);if((i===`*`||e&&i&&i===e)&&(a===`*`||r&&a&&a===r))return!0}else return!0;return!1})}var Jn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Yn={paddingMedium:`0 3px`,heightMedium:`24px`,iconSizeMedium:`18px`},Xn=T({name:`UploadFile`,props:{clsPrefix:{type:String,required:!0},file:{type:Object,required:!0},listType:{type:String,required:!0},index:{type:Number,required:!0}},setup(e){let t=a($),r=_(null),i=_(``),o=n(()=>{let{file:t}=e;return t.status===`finished`?`success`:t.status===`error`?`error`:`info`}),s=n(()=>{let{file:t}=e;if(t.status===`error`)return`error`}),c=n(()=>{let{file:t}=e;return t.status===`uploading`}),l=n(()=>{if(!t.showCancelButtonRef.value)return!1;let{file:n}=e;return[`uploading`,`pending`,`error`].includes(n.status)}),u=n(()=>{if(!t.showRemoveButtonRef.value)return!1;let{file:n}=e;return[`finished`].includes(n.status)}),d=n(()=>{if(!t.showDownloadButtonRef.value)return!1;let{file:n}=e;return[`finished`].includes(n.status)}),f=n(()=>{if(!t.showRetryButtonRef.value)return!1;let{file:n}=e;return[`error`].includes(n.status)}),p=G(()=>i.value||e.file.thumbnailUrl||e.file.url),m=n(()=>{if(!t.showPreviewButtonRef.value)return!1;let{file:{status:n},listType:r}=e;return[`finished`].includes(n)&&p.value&&r===`image-card`});function g(){return Jn(this,void 0,void 0,function*(){let n=t.onRetryRef.value;n&&(yield n({file:e.file}))===!1||t.submit({fileId:e.file.id})})}function v(t){t.preventDefault();let{file:n}=e;[`finished`,`pending`,`error`].includes(n.status)?b(n):[`uploading`].includes(n.status)?S(n):L(`upload`,`The button clicked type is unknown.`)}function y(t){t.preventDefault(),x(e.file)}function b(n){let{xhrMap:r,doChange:i,onRemoveRef:{value:a},mergedFileListRef:{value:o}}=t;Promise.resolve(a?a({file:Object.assign({},n),fileList:o,index:e.index}):!0).then(e=>{if(e===!1)return;let t=Object.assign({},n,{status:`removed`});r.delete(n.id),i(t,void 0,{remove:!0})})}function x(e){let{onDownloadRef:{value:n},customDownloadRef:{value:r}}=t;Promise.resolve(n?n(Object.assign({},e)):!0).then(t=>{t!==!1&&(r?r(Object.assign({},e)):We(e.url,e.name))})}function S(e){let{xhrMap:n}=t;n.get(e.id)?.abort(),b(Object.assign({},e))}function C(n){let{onPreviewRef:{value:i}}=t;if(i)i(e.file,{event:n});else if(e.listType===`image-card`){let{value:e}=r;if(!e)return;e.showPreview()}}let w=()=>Jn(this,void 0,void 0,function*(){let{listType:n}=e;n!==`image`&&n!==`image-card`||t.shouldUseThumbnailUrlRef.value(e.file)&&(i.value=yield t.getFileThumbnailUrlResolver(e.file))});return h(()=>{w()}),{mergedTheme:t.mergedThemeRef,progressStatus:o,buttonType:s,showProgress:c,disabled:t.mergedDisabledRef,showCancelButton:l,showRemoveButton:u,showDownloadButton:d,showRetryButton:f,showPreviewButton:m,mergedThumbnailUrl:p,shouldUseThumbnailUrl:t.shouldUseThumbnailUrlRef,renderIcon:t.renderIconRef,imageRef:r,handleRemoveOrCancelClick:v,handleDownloadClick:y,handleRetryClick:g,handlePreviewClick:C}},render(){let{clsPrefix:e,mergedTheme:t,listType:n,file:r,renderIcon:i}=this,a,o=n===`image`;a=o||n===`image-card`?!this.shouldUseThumbnailUrl(r)||!this.mergedThumbnailUrl?c(`span`,{class:`${e}-upload-file-info__thumbnail`},i?i(r):Bn(r)?c(Y,{clsPrefix:e},{default:Nn}):c(Y,{clsPrefix:e},{default:Pn})):c(`a`,{rel:`noopener noreferer`,target:`_blank`,href:r.url||void 0,class:`${e}-upload-file-info__thumbnail`,onClick:this.handlePreviewClick},n===`image-card`?c(Sn,{src:this.mergedThumbnailUrl||void 0,previewSrc:r.url||void 0,alt:r.name,ref:`imageRef`}):c(`img`,{src:this.mergedThumbnailUrl||void 0,alt:r.name})):c(`span`,{class:`${e}-upload-file-info__thumbnail`},i?i(r):c(Y,{clsPrefix:e},{default:()=>c(Vt,null)}));let s=c(Fn,{show:this.showProgress,percentage:r.percentage||0,status:this.progressStatus}),l=n===`text`||n===`image`;return c(`div`,{class:[`${e}-upload-file`,`${e}-upload-file--${this.progressStatus}-status`,r.url&&r.status!==`error`&&n!==`image-card`&&`${e}-upload-file--with-url`,`${e}-upload-file--${n}-type`]},c(`div`,{class:`${e}-upload-file-info`},a,c(`div`,{class:`${e}-upload-file-info__name`},l&&(r.url&&r.status!==`error`?c(`a`,{rel:`noopener noreferer`,target:`_blank`,href:r.url||void 0,onClick:this.handlePreviewClick},r.name):c(`span`,{onClick:this.handlePreviewClick},r.name)),o&&s),c(`div`,{class:[`${e}-upload-file-info__action`,`${e}-upload-file-info__action--${n}-type`]},this.showPreviewButton?c(X,{key:`preview`,quaternary:!0,type:this.buttonType,onClick:this.handlePreviewClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:Yn},{icon:()=>c(Y,{clsPrefix:e},{default:()=>c(Pe,null)})}):null,(this.showRemoveButton||this.showCancelButton)&&!this.disabled&&c(X,{key:`cancelOrTrash`,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,quaternary:!0,builtinThemeOverrides:Yn,type:this.buttonType,onClick:this.handleRemoveOrCancelClick},{icon:()=>c(ue,null,{default:()=>this.showRemoveButton?c(Y,{clsPrefix:e,key:`trash`},{default:()=>c(Jt,null)}):c(Y,{clsPrefix:e,key:`cancel`},{default:()=>c(Ht,null)})})}),this.showRetryButton&&!this.disabled&&c(X,{key:`retry`,quaternary:!0,type:this.buttonType,onClick:this.handleRetryClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:Yn},{icon:()=>c(Y,{clsPrefix:e},{default:()=>c(Gt,null)})}),this.showDownloadButton?c(X,{key:`download`,quaternary:!0,type:this.buttonType,onClick:this.handleDownloadClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:Yn},{icon:()=>c(Y,{clsPrefix:e},{default:()=>c(Ut,null)})}):null)),!o&&s)}}),Zn=T({name:`UploadTrigger`,props:{abstract:Boolean},slots:Object,setup(e,{slots:t}){let r=a($,null);r||R(`upload-trigger`,"`n-upload-trigger` must be placed inside `n-upload`.");let{mergedClsPrefixRef:i,mergedDisabledRef:o,maxReachedRef:s,listTypeRef:l,dragOverRef:u,openOpenFileDialog:d,draggerInsideRef:f,handleFileAddition:p,mergedDirectoryDndRef:m,triggerClassRef:h,triggerStyleRef:g}=r,_=n(()=>l.value===`image-card`);function v(){o.value||s.value||d()}function y(e){e.preventDefault(),u.value=!0}function b(e){e.preventDefault(),u.value=!0}function x(e){e.preventDefault(),u.value=!1}function S(e){if(e.preventDefault(),!f.value||o.value||s.value){u.value=!1;return}let t=e.dataTransfer?.items;t?.length?Gn(Array.from(t).map(e=>e.webkitGetAsEntry()),m.value).then(e=>{p(e)}).finally(()=>{u.value=!1}):u.value=!1}return()=>{let{value:n}=i;return e.abstract?t.default?.call(t,{handleClick:v,handleDrop:S,handleDragOver:y,handleDragEnter:b,handleDragLeave:x}):c(`div`,{class:[`${n}-upload-trigger`,(o.value||s.value)&&`${n}-upload-trigger--disabled`,_.value&&`${n}-upload-trigger--image-card`,h.value],style:g.value,onClick:v,onDrop:S,onDragover:y,onDragenter:b,onDragleave:x},_.value?c(Mn,null,{default:()=>I(t.default,()=>[c(Y,{clsPrefix:n},{default:()=>c(Ne,null)})])}):t)}}}),Qn=T({name:`UploadFileList`,setup(e,{slots:t}){let r=a($,null);r||R(`upload-file-list`,"`n-upload-file-list` must be placed inside `n-upload`.");let{abstractRef:i,mergedClsPrefixRef:o,listTypeRef:s,mergedFileListRef:l,fileListClassRef:u,fileListStyleRef:d,cssVarsRef:f,themeClassRef:p,maxReachedRef:m,showTriggerRef:h,imageGroupPropsRef:g}=r,_=n(()=>s.value===`image-card`),v=()=>l.value.map((e,t)=>c(Xn,{clsPrefix:o.value,key:e.id,file:e,index:t,listType:s.value})),y=()=>_.value?c(yn,Object.assign({},g.value),{default:v}):c(ke,{group:!0},{default:v});return()=>{let{value:e}=o,{value:n}=i;return c(`div`,{class:[`${e}-upload-file-list`,_.value&&`${e}-upload-file-list--grid`,n?p?.value:void 0,u.value],style:[n&&f?f.value:``,d.value]},y(),h.value&&!m.value&&_.value&&c(Zn,null,t))}}}),$n=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function er(e,t,n){let{doChange:r,xhrMap:i}=e,a=0;function o(n){let o=Object.assign({},t,{status:`error`,percentage:a});i.delete(t.id),o=Kn(e.onError?.call(e,{file:o,event:n})||o),r(o,n)}function s(s){if(e.isErrorState){if(e.isErrorState(n)){o(s);return}}else if(n.status<200||n.status>=300){o(s);return}let c=Object.assign({},t,{status:`finished`,percentage:a});i.delete(t.id),c=Kn(e.onFinish?.call(e,{file:c,event:s})||c),r(c,s)}return{handleXHRLoad:s,handleXHRError:o,handleXHRAbort(e){let n=Object.assign({},t,{status:`removed`,file:null,percentage:a});i.delete(t.id),r(n,e)},handleXHRProgress(e){let n=Object.assign({},t,{status:`uploading`});if(e.lengthComputable){let t=Math.ceil(e.loaded/e.total*100);n.percentage=t,a=t}r(n,e)}}}function tr(e){let{inst:t,file:n,data:r,headers:i,withCredentials:a,action:o,customRequest:s}=e,{doChange:c}=e.inst,l=0;s({file:n,data:r,headers:i,withCredentials:a,action:o,onProgress(e){let t=Object.assign({},n,{status:`uploading`}),r=e.percent;t.percentage=r,l=r,c(t)},onFinish(){let e=Object.assign({},n,{status:`finished`,percentage:l});e=Kn(t.onFinish?.call(t,{file:e})||e),c(e)},onError(){let e=Object.assign({},n,{status:`error`,percentage:l});e=Kn(t.onError?.call(t,{file:e})||e),c(e)}})}function nr(e,t,n){let r=er(e,t,n);n.onabort=r.handleXHRAbort,n.onerror=r.handleXHRError,n.onload=r.handleXHRLoad,n.upload&&(n.upload.onprogress=r.handleXHRProgress)}function rr(e,t){return typeof e==`function`?e({file:t}):e||{}}function ir(e,t,n){let r=rr(t,n);r&&Object.keys(r).forEach(t=>{e.setRequestHeader(t,r[t])})}function ar(e,t,n){let r=rr(t,n);r&&Object.keys(r).forEach(t=>{e.append(t,r[t])})}function or(e,t,n,{method:r,action:i,withCredentials:a,responseType:o,headers:s,data:c}){let l=new XMLHttpRequest;l.responseType=o,e.xhrMap.set(n.id,l),l.withCredentials=a;let u=new FormData;if(ar(u,c,n),n.file!==null&&u.append(t,n.file),nr(e,n,l),i!==void 0){l.open(r.toUpperCase(),i),ir(l,s,n),l.send(u);let t=Object.assign({},n,{status:`uploading`});e.doChange(t)}}var sr=T({name:`Upload`,props:Object.assign(Object.assign({},B.props),{name:{type:String,default:`file`},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:`POST`},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:``},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onRetry:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,customDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListClass:String,fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:`text`},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>Hn?Bn(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerClass:String,triggerStyle:[String,Object],renderIcon:Function}),setup(e){e.abstract&&e.listType===`image-card`&&R(`upload`,`when the list-type is image-card, abstract is not supported.`);let{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:i}=P(e),a=B(`Upload`,`-upload`,jn,sn,e,t),o=re(`Upload`,i,t),c=ne(e),l=_(e.defaultFileList),d=y(e,`fileList`),f=_(null),p={value:!1},m=_(!1),h=new Map,g=xe(d,l),v=n(()=>g.value.map(Kn)),b=n(()=>{let{max:t}=e;return t===void 0?!1:v.value.length>=t});function x(){var e;(e=f.value)==null||e.click()}function S(e){let t=e.target;E(t.files?Array.from(t.files).map(e=>({file:e,entry:null,source:`input`})):null,e),t.value=``}function C(t){let{"onUpdate:fileList":n,onUpdateFileList:r}=e;n&&U(n,t),r&&U(r,t),l.value=t}let w=n(()=>e.multiple||e.directory),T=(t,n,r={append:!1,remove:!1})=>{let{append:i,remove:a}=r,o=Array.from(v.value),s=o.findIndex(e=>e.id===t.id);if(i||a||~s){i?o.push(t):a?o.splice(s,1):o.splice(s,1,t);let{onChange:r}=e;r&&r({file:t,fileList:o,event:n}),C(o)}};function E(t,n){if(!t||t.length===0)return;let{onBeforeUpload:r}=e;t=w.value?t:[t[0]];let{max:i,accept:a}=e;t=t.filter(({file:e,source:t})=>t===`dnd`&&a?.trim()?qn(e.name,e.type,a):!0),i&&(t=t.slice(0,i-v.value.length));let o=pe();Promise.all(t.map(e=>$n(this,[e],void 0,function*({file:e,entry:t}){let n={id:pe(),batchId:o,name:e.name,status:`pending`,percentage:0,file:e,url:null,type:e.type,thumbnailUrl:null,fullPath:t?.fullPath??`/${e.webkitRelativePath||e.name}`};return!r||(yield r({file:n,fileList:v.value}))!==!1?n:null}))).then(e=>$n(this,void 0,void 0,function*(){let t=Promise.resolve();e.forEach(e=>{t=t.then(u).then(()=>{e&&T(e,n,{append:!0})})}),yield t})).then(()=>{e.defaultUpload&&D()})}function D({fileId:t,retry:n=!1}={}){let{method:r,action:i,withCredentials:a,headers:o,data:s,name:c}=e,l=t===void 0?v.value:v.value.filter(e=>e.id===t),u=n||t!==void 0;l.forEach(t=>{let{status:n}=t;(n===`pending`||n===`error`&&u)&&(e.customRequest?tr({inst:{doChange:T,xhrMap:h,onFinish:e.onFinish,onError:e.onError},file:t,action:i,withCredentials:a,headers:o,data:s,customRequest:e.customRequest}):or({doChange:T,xhrMap:h,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},c,t,{method:r,action:i,withCredentials:a,responseType:e.responseType,headers:o,data:s}))})}function O(t){if(t.thumbnailUrl)return t.thumbnailUrl;let{createThumbnailUrl:n}=e;return n?n(t.file,t)??(t.url||``):t.url?t.url:t.file?Vn(t.file):``}let k=n(()=>{let{common:{cubicBezierEaseInOut:e},self:{draggerColor:t,draggerBorder:n,draggerBorderHover:r,itemColorHover:i,itemColorHoverError:o,itemTextColorError:s,itemTextColorSuccess:c,itemTextColor:l,itemIconColor:u,itemDisabledOpacity:d,lineHeight:f,borderRadius:p,fontSize:m,itemBorderImageCardError:h,itemBorderImageCard:g}}=a.value;return{"--n-bezier":e,"--n-border-radius":p,"--n-dragger-border":n,"--n-dragger-border-hover":r,"--n-dragger-color":t,"--n-font-size":m,"--n-item-color-hover":i,"--n-item-color-hover-error":o,"--n-item-disabled-opacity":d,"--n-item-icon-color":u,"--n-item-text-color":l,"--n-item-text-color-error":s,"--n-item-text-color-success":c,"--n-line-height":f,"--n-item-border-image-card-error":h,"--n-item-border-image-card":g}}),A=r?fe(`upload`,void 0,k,e):void 0;s($,{mergedClsPrefixRef:t,mergedThemeRef:a,showCancelButtonRef:y(e,`showCancelButton`),showDownloadButtonRef:y(e,`showDownloadButton`),showRemoveButtonRef:y(e,`showRemoveButton`),showRetryButtonRef:y(e,`showRetryButton`),onRemoveRef:y(e,`onRemove`),onDownloadRef:y(e,`onDownload`),customDownloadRef:y(e,`customDownload`),mergedFileListRef:v,triggerClassRef:y(e,`triggerClass`),triggerStyleRef:y(e,`triggerStyle`),shouldUseThumbnailUrlRef:y(e,`shouldUseThumbnailUrl`),renderIconRef:y(e,`renderIcon`),xhrMap:h,submit:D,doChange:T,showPreviewButtonRef:y(e,`showPreviewButton`),onPreviewRef:y(e,`onPreview`),getFileThumbnailUrlResolver:O,listTypeRef:y(e,`listType`),dragOverRef:m,openOpenFileDialog:x,draggerInsideRef:p,handleFileAddition:E,mergedDisabledRef:c.mergedDisabledRef,maxReachedRef:b,fileListClassRef:y(e,`fileListClass`),fileListStyleRef:y(e,`fileListStyle`),abstractRef:y(e,`abstract`),acceptRef:y(e,`accept`),cssVarsRef:r?void 0:k,themeClassRef:A?.themeClass,onRender:A?.onRender,showTriggerRef:y(e,`showTrigger`),imageGroupPropsRef:y(e,`imageGroupProps`),mergedDirectoryDndRef:n(()=>e.directoryDnd??e.directory),onRetryRef:y(e,`onRetry`)});let j={clear:()=>{l.value=[]},submit:D,openOpenFileDialog:x};return Object.assign({mergedClsPrefix:t,draggerInsideRef:p,rtlEnabled:o,inputElRef:f,mergedTheme:a,dragOver:m,mergedMultiple:w,cssVars:r?void 0:k,themeClass:A?.themeClass,onRender:A?.onRender,handleFileInputChange:S},j)},render(){let{draggerInsideRef:e,mergedClsPrefix:t,$slots:n,directory:r,onRender:i}=this;n.default&&!this.abstract&&n.default()[0]?.type?.__UPLOAD_DRAGGER__&&(e.value=!0);let a=c(`input`,Object.assign({},this.inputProps,{ref:`inputElRef`,type:`file`,class:`${t}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:r||void 0,directory:r||void 0}));return this.abstract?c(j,null,n.default?.call(n),c(g,{to:`body`},a)):(i?.(),c(`div`,{class:[`${t}-upload`,this.rtlEnabled&&`${t}-upload--rtl`,e.value&&`${t}-upload--dragger-inside`,this.dragOver&&`${t}-upload--drag-over`,this.themeClass],style:this.cssVars},a,this.showTrigger&&this.listType!==`image-card`&&c(Zn,null,n),this.showFileList&&c(Qn,null,n)))}}),cr={class:`card-header`},lr={class:`profile-name`},ur={class:`card-body`},dr={class:`info-row`},fr={class:`info-label`},pr={class:`info-value mono`},mr={class:`info-row`},hr={class:`info-label`},gr={class:`info-value mono`},_r={class:`toggle-text`},vr={key:0,class:`card-detail`},yr={class:`info-row`},br={class:`info-label`},xr={class:`info-value`},Sr={class:`info-row`},Cr={class:`info-label`},wr={class:`info-value mono detail-path`},Tr={class:`info-row`},Er={class:`info-label`},Dr={class:`info-value`},Or={class:`info-row`},kr={class:`info-label`},Ar={class:`info-value`},jr={class:`info-row`},Mr={class:`info-label`},Nr={class:`info-value`},Pr={class:`card-actions`},Fr=N(T({__name:`ProfileCard`,props:{profile:{}},setup(e,{emit:a}){let s=e,{t:c}=M(),u=Z(),f=Ve(),p=Be(),m=_(!1),h=_(!1),g=_(!1),v=_(null),y=n(()=>s.profile.name===`default`);async function b(){if(m.value){m.value=!1;return}m.value=!0,h.value=!0;try{v.value=await u.fetchProfileDetail(s.profile.name)}finally{h.value=!1}}function x(){p.warning({title:c(`profiles.switchTo`),content:c(`profiles.switchConfirm`,{name:s.profile.name}),positiveText:c(`common.confirm`),negativeText:c(`common.cancel`),onPositiveClick:async()=>{u.switchProfile(s.profile.name).then(e=>{e?window.location.reload():f.error(c(`profiles.switchFailed`))})}})}function C(){p.warning({title:c(`profiles.delete`),content:c(`profiles.deleteConfirm`,{name:s.profile.name}),positiveText:c(`common.delete`),negativeText:c(`common.cancel`),onPositiveClick:async()=>{await u.deleteProfile(s.profile.name)?f.success(c(`profiles.deleteSuccess`)):f.error(c(`profiles.deleteFailed`))}})}async function w(){g.value=!0;try{await u.exportProfile(s.profile.name)?f.success(c(`profiles.exportSuccess`)):f.error(c(`profiles.exportFailed`))}finally{g.value=!1}}return(n,a)=>(o(),r(`div`,{class:D([`profile-card`,{active:e.profile.active}])},[A(`div`,cr,[A(`h3`,lr,S(e.profile.name),1),e.profile.active?(o(),d(O(Ie),{key:0,size:`tiny`,type:`success`,bordered:!1},{default:l(()=>[E(S(O(c)(`profiles.active`)),1)]),_:1})):i(``,!0)]),A(`div`,ur,[A(`div`,dr,[A(`span`,fr,S(O(c)(`profiles.model`)),1),A(`code`,pr,S(e.profile.model),1)]),A(`div`,mr,[A(`span`,hr,S(O(c)(`profiles.gateway`)),1),A(`code`,gr,S(e.profile.gateway),1)])]),A(`div`,{class:`card-detail-toggle`,onClick:b},[(o(),r(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:D([`toggle-icon`,{expanded:m.value}])},[...a[0]||=[A(`polyline`,{points:`6 9 12 15 18 9`},null,-1)]],2)),A(`span`,_r,S(m.value?O(c)(`common.collapse`):O(c)(`common.expand`)),1)]),m.value?(o(),r(`div`,vr,[t(O(He),{show:h.value,size:`small`},{default:l(()=>[v.value?(o(),r(j,{key:0},[A(`div`,yr,[A(`span`,br,S(O(c)(`profiles.provider`)),1),A(`span`,xr,S(v.value.provider),1)]),A(`div`,Sr,[A(`span`,Cr,S(O(c)(`profiles.path`)),1),A(`code`,wr,S(v.value.path),1)]),A(`div`,Tr,[A(`span`,Er,S(O(c)(`profiles.skills`)),1),A(`span`,Dr,S(v.value.skills),1)]),A(`div`,Or,[A(`span`,kr,S(O(c)(`profiles.hasEnv`)),1),A(`span`,Ar,S(v.value.hasEnv?`Yes`:`No`),1)]),A(`div`,jr,[A(`span`,Mr,S(O(c)(`profiles.hasSoulMd`)),1),A(`span`,Nr,S(v.value.hasSoulMd?`Yes`:`No`),1)])],64)):i(``,!0)]),_:1},8,[`show`])])):i(``,!0),A(`div`,Pr,[e.profile.active?i(``,!0):(o(),d(O(X),{key:0,size:`tiny`,loading:O(u).switching,quaternary:``,type:`primary`,onClick:x},{default:l(()=>[E(S(O(c)(`profiles.switchTo`)),1)]),_:1},8,[`loading`])),t(O(X),{size:`tiny`,quaternary:``,type:`error`,disabled:y.value||e.profile.active,onClick:C},{default:l(()=>[E(S(O(c)(`common.delete`)),1)]),_:1},8,[`disabled`]),t(O(X),{size:`tiny`,quaternary:``,loading:g.value,onClick:w},{default:l(()=>[E(S(O(c)(`profiles.export`)),1)]),_:1},8,[`loading`])])],2))}}),[[`__scopeId`,`data-v-c081df64`]]),Ir={key:0,class:`empty-state`},Lr={key:1,class:`profiles-grid`},Rr=N(T({__name:`ProfilesPanel`,emits:[`rename`],setup(e){let{t}=M(),n=Z();return(e,i)=>O(n).profiles.length===0?(o(),r(`div`,Ir,[i[1]||=A(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,class:`empty-icon`},[A(`path`,{d:`M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2`}),A(`circle`,{cx:`12`,cy:`7`,r:`4`})],-1),A(`p`,null,S(O(t)(`profiles.noProfiles`)),1)])):(o(),r(`div`,Lr,[(o(!0),r(j,null,k(O(n).profiles,t=>(o(),d(Fr,{key:t.name,profile:t,onRename:i[0]||=t=>e.$emit(`rename`,t)},null,8,[`profile`]))),128))]))}}),[[`__scopeId`,`data-v-51e73d5a`]]),zr={class:`modal-footer`},Br=N(T({__name:`ProfileCreateModal`,emits:[`close`,`saved`],setup(e,{emit:n}){let r=n,{t:i}=M(),a=Z(),s=Ve(),c=_(!0),u=_(!1),f=_(``),p=_(!1);async function m(){if(!f.value.trim()){s.warning(i(`profiles.namePlaceholder`));return}u.value=!0;try{await a.createProfile(f.value.trim(),p.value)?(s.success(i(`profiles.createSuccess`,{name:f.value.trim()})),r(`saved`)):s.error(i(`profiles.createFailed`))}finally{u.value=!1}}function h(){c.value=!1,setTimeout(()=>r(`close`),200)}return(e,n)=>(o(),d(O(Te),{show:c.value,"onUpdate:show":n[2]||=e=>c.value=e,preset:`card`,title:O(i)(`profiles.create`),style:{width:`min(420px, calc(100vw - 32px))`},"mask-closable":!u.value,onAfterLeave:n[3]||=e=>r(`close`)},{footer:l(()=>[A(`div`,zr,[t(O(X),{onClick:h},{default:l(()=>[E(S(O(i)(`common.cancel`)),1)]),_:1}),t(O(X),{type:`primary`,loading:u.value,onClick:m},{default:l(()=>[E(S(O(i)(`common.create`)),1)]),_:1},8,[`loading`])])]),default:l(()=>[t(O(De),{"label-placement":`top`},{default:l(()=>[t(O(Oe),{label:O(i)(`profiles.name`),required:``},{default:l(()=>[t(O(Fe),{value:f.value,placeholder:O(i)(`profiles.namePlaceholder`),onInput:n[0]||=e=>f.value=e.replace(/[^a-zA-Z0-9_-]/g,``),onKeyup:x(m,[`enter`])},null,8,[`value`,`placeholder`])]),_:1},8,[`label`]),t(O(Oe),{label:O(i)(`profiles.cloneFromCurrent`)},{default:l(()=>[t(O(Ue),{value:p.value,"onUpdate:value":n[1]||=e=>p.value=e},null,8,[`value`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`show`,`title`,`mask-closable`]))}}),[[`__scopeId`,`data-v-fb1271ea`]]),Vr={class:`modal-footer`},Hr=N(T({__name:`ProfileRenameModal`,props:{profileName:{}},emits:[`close`,`saved`],setup(e,{emit:n}){let r=e,i=n,{t:a}=M(),s=Z(),c=Ve(),u=_(!0),f=_(!1),p=_(``);async function m(){if(!p.value.trim()){c.warning(a(`profiles.newNamePlaceholder`));return}f.value=!0;try{await s.renameProfile(r.profileName,p.value.trim())?(c.success(a(`profiles.renameSuccess`)),i(`saved`)):c.error(a(`profiles.renameFailed`))}finally{f.value=!1}}function h(){u.value=!1,setTimeout(()=>i(`close`),200)}return(e,n)=>(o(),d(O(Te),{show:u.value,"onUpdate:show":n[1]||=e=>u.value=e,preset:`card`,title:O(a)(`profiles.rename`),style:{width:`min(420px, calc(100vw - 32px))`},"mask-closable":!f.value,onAfterLeave:n[2]||=e=>i(`close`)},{footer:l(()=>[A(`div`,Vr,[t(O(X),{onClick:h},{default:l(()=>[E(S(O(a)(`common.cancel`)),1)]),_:1}),t(O(X),{type:`primary`,loading:f.value,onClick:m},{default:l(()=>[E(S(O(a)(`common.confirm`)),1)]),_:1},8,[`loading`])])]),default:l(()=>[t(O(De),{"label-placement":`top`},{default:l(()=>[t(O(Oe),{label:O(a)(`profiles.newName`),required:``},{default:l(()=>[t(O(Fe),{value:p.value,"onUpdate:value":n[0]||=e=>p.value=e,placeholder:O(a)(`profiles.newNamePlaceholder`),onKeyup:x(m,[`enter`])},null,8,[`value`,`placeholder`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`show`,`title`,`mask-closable`]))}}),[[`__scopeId`,`data-v-e31a23a9`]]),Ur={class:`modal-footer`},Wr=N(T({__name:`ProfileImportModal`,emits:[`close`,`saved`],setup(e,{emit:n}){let r=n,{t:i}=M(),a=Z(),s=Ve(),c=_(!0),u=_(!1),f=_([]),p=[`.tar.gz`,`.tgz`,`.gz`,`.zip`];function m({file:e}){let t=e.name?.toLowerCase()||``;return p.some(e=>t.endsWith(e))?!0:(s.warning(i(`profiles.importInvalidFile`)),!1)}async function h(){if(!f.value.length){s.warning(i(`profiles.importSelectFile`));return}u.value=!0;try{let e=f.value[0].file;if(!e){s.error(i(`profiles.importFailed`));return}await a.importProfile(e)?(s.success(i(`profiles.importSuccess`)),r(`saved`)):s.error(i(`profiles.importFailed`))}finally{u.value=!1}}function g(){c.value=!1,setTimeout(()=>r(`close`),200)}return(e,n)=>(o(),d(O(Te),{show:c.value,"onUpdate:show":n[1]||=e=>c.value=e,preset:`card`,title:O(i)(`profiles.import`),style:{width:`min(420px, calc(100vw - 32px))`},"mask-closable":!u.value,onAfterLeave:n[2]||=e=>r(`close`)},{footer:l(()=>[A(`div`,Ur,[t(O(X),{onClick:g},{default:l(()=>[E(S(O(i)(`common.cancel`)),1)]),_:1}),t(O(X),{type:`primary`,loading:u.value,disabled:!f.value.length,onClick:h},{default:l(()=>[E(S(O(i)(`common.confirm`)),1)]),_:1},8,[`loading`,`disabled`])])]),default:l(()=>[t(O(sr),{"file-list":f.value,"onUpdate:fileList":n[0]||=e=>f.value=e,max:1,accept:p.join(`,`),disabled:u.value,onBeforeUpload:m},{default:l(()=>[t(O(X),null,{default:l(()=>[E(S(O(i)(`profiles.importSelectFile`)),1)]),_:1})]),_:1},8,[`file-list`,`accept`,`disabled`])]),_:1},8,[`show`,`title`,`mask-closable`]))}}),[[`__scopeId`,`data-v-accddacf`]]),Gr={class:`profiles-view`},Kr={class:`page-header`},qr={class:`header-title`},Jr={class:`header-actions`},Yr={class:`profiles-content`},Xr=N(T({__name:`ProfilesView`,setup(e){let{t:n}=M(),a=Z(),s=_(!1),c=_(!1),u=_(null);f(()=>{a.fetchProfiles()});function p(){s.value=!1}function m(){u.value=null}function h(){c.value=!1}return(e,f)=>(o(),r(`div`,Gr,[A(`header`,Kr,[A(`h2`,qr,S(O(n)(`profiles.title`)),1),A(`div`,Jr,[t(O(X),{size:`small`,onClick:f[0]||=e=>c.value=!0},{icon:l(()=>[...f[6]||=[A(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[A(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),A(`polyline`,{points:`17 8 12 3 7 8`}),A(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})],-1)]]),default:l(()=>[E(` `+S(O(n)(`profiles.import`)),1)]),_:1}),t(O(X),{type:`primary`,size:`small`,onClick:f[1]||=e=>s.value=!0},{icon:l(()=>[...f[7]||=[A(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[A(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),A(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1)]]),default:l(()=>[E(` `+S(O(n)(`profiles.create`)),1)]),_:1})])]),A(`div`,Yr,[t(O(He),{show:O(a).loading&&O(a).profiles.length===0},{default:l(()=>[t(Rr,{onRename:f[2]||=e=>u.value=e})]),_:1},8,[`show`])]),s.value?(o(),d(Br,{key:0,onClose:f[3]||=e=>s.value=!1,onSaved:p})):i(``,!0),u.value?(o(),d(Hr,{key:1,"profile-name":u.value,onClose:f[4]||=e=>u.value=null,onSaved:m},null,8,[`profile-name`])):i(``,!0),c.value?(o(),d(Wr,{key:2,onClose:f[5]||=e=>c.value=!1,onSaved:h})):i(``,!0)]))}}),[[`__scopeId`,`data-v-fcdc8d6b`]]);export{Xr as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.profile-card[data-v-c081df64]{background-color:#fff;border:1px solid #e0e0e0;border-radius:10px;padding:16px;transition:border-color .15s}.profile-card[data-v-c081df64]:hover{border-color:#3333334d}.profile-card.active[data-v-c081df64]{border-color:#2e7d3266}.card-header[data-v-c081df64]{justify-content:space-between;align-items:center;margin-bottom:12px;display:flex}.profile-name[data-v-c081df64]{color:#1a1a1a;text-overflow:ellipsis;white-space:nowrap;max-width:70%;font-size:15px;font-weight:600;overflow:hidden}.card-body[data-v-c081df64]{flex-direction:column;gap:6px;margin-bottom:8px;display:flex}.card-detail-toggle[data-v-c081df64]{cursor:pointer;color:#999;-webkit-user-select:none;user-select:none;align-items:center;gap:4px;padding:6px 0;font-size:12px;display:flex}.card-detail-toggle[data-v-c081df64]:hover{color:#666}.toggle-icon[data-v-c081df64]{transition:transform .2s}.toggle-icon.expanded[data-v-c081df64]{transform:rotate(180deg)}.card-detail[data-v-c081df64]{border-top:1px solid #ebebeb;margin-bottom:8px;padding:8px 0}.info-row[data-v-c081df64]{justify-content:space-between;align-items:center;padding:2px 0;display:flex}.info-label[data-v-c081df64]{color:#999;flex-shrink:0;margin-right:12px;font-size:12px}.info-value[data-v-c081df64]{color:#666;text-align:right;text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.mono[data-v-c081df64]{font-family:JetBrains Mono,Fira Code,Consolas,monospace;font-size:12px}.detail-path[data-v-c081df64]{max-width:260px}.card-actions[data-v-c081df64]{border-top:1px solid #ebebeb;flex-wrap:wrap;gap:8px;padding-top:10px;display:flex}.empty-state[data-v-51e73d5a]{color:#999;flex-direction:column;justify-content:center;align-items:center;gap:12px;height:100%;display:flex}.empty-state .empty-icon[data-v-51e73d5a]{opacity:.3}.empty-state p[data-v-51e73d5a]{font-size:14px}.profiles-grid[data-v-51e73d5a]{grid-template-columns:repeat(auto-fill,minmax(min(100%,420px),1fr));gap:14px;display:grid}.modal-footer[data-v-fb1271ea],.modal-footer[data-v-e31a23a9],.modal-footer[data-v-accddacf]{justify-content:flex-end;gap:8px;display:flex}.profiles-view[data-v-fcdc8d6b]{height:calc(100 * var(--vh));flex-direction:column;display:flex}.page-header[data-v-fcdc8d6b]{border-bottom:1px solid #e0e0e0;justify-content:space-between;align-items:center;padding:16px 20px;display:flex}.header-title[data-v-fcdc8d6b]{color:#1a1a1a;font-size:16px;font-weight:600}.header-actions[data-v-fcdc8d6b]{gap:8px;display:flex}.profiles-content[data-v-fcdc8d6b]{flex:1;padding:20px;overflow-y:auto}
|