hermes-web-ui 0.4.2 → 0.4.3
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/bin/hermes-web-ui.mjs +76 -9
- package/dist/client/assets/Add-DiTv65Se.js +1 -0
- package/dist/client/assets/{Button-pgPN7RfC.js → Button-vKfgky-Y.js} +3 -3
- package/dist/client/assets/{ChannelsView-qFMvJ9rS.js → ChannelsView-CHWtzAkF.js} +1 -1
- package/dist/client/assets/ChatView--lvFbW3I.js +127 -0
- package/dist/client/assets/ChatView-b0_L3ucp.css +1 -0
- package/dist/client/assets/{Close-CXC76d7R.js → Close-Brba3ay5.js} +2 -2
- package/dist/client/assets/{FormItem-DIcSMjKz.js → FormItem-kXuCeSKq.js} +3 -3
- package/dist/client/assets/GatewaysView-DUPP1UyD.js +1 -0
- package/dist/client/assets/Input-BS71ZaoJ.js +234 -0
- package/dist/client/assets/{InputNumber-Btyn8bQo.js → InputNumber-BXy4reTI.js} +2 -2
- package/dist/client/assets/JobsView-CXa1h0NF.js +2 -0
- package/dist/client/assets/LoginView-Cpod3SAL.js +1 -0
- package/dist/client/assets/LoginView-DfWYTzX1.css +1 -0
- package/dist/client/assets/LogsView-CgxeVMn-.js +1 -0
- package/dist/client/assets/{MarkdownRenderer-G4nly1xR.js → MarkdownRenderer-B7t0ZEw0.js} +9 -9
- package/dist/client/assets/MemoryView-BQjYVDJc.js +7 -0
- package/dist/client/assets/{Modal-rKb1tfQv.js → Modal-6Bv1v4kO.js} +4 -4
- package/dist/client/assets/ModelsView-CVghPzgk.js +1 -0
- package/dist/client/assets/Popconfirm-Bpz_dC1j.js +16 -0
- package/dist/client/assets/Popover-CXrjClQw.js +117 -0
- package/dist/client/assets/ProfilesView-Brpyzl-Q.js +440 -0
- package/dist/client/assets/{Select-CpNY3UGb.js → Select-Z20Mp4nQ.js} +5 -5
- package/dist/client/assets/SettingRow-Cz749k-e.js +1 -0
- package/dist/client/assets/SettingsView-C3HbKb4w.js +352 -0
- package/dist/client/assets/{SettingsView-CX312EGG.css → SettingsView-Cw4iOwXj.css} +1 -1
- package/dist/client/assets/SkillsView-qVZkbI37.js +1 -0
- package/dist/client/assets/Spin-DKwUVt1F.js +43 -0
- package/dist/client/assets/Suffix-C1Mw6UwH.js +90 -0
- package/dist/client/assets/{Switch-haCJAcVn.js → Switch-DG-3EwdR.js} +2 -2
- package/dist/client/assets/{Tag-CKzgX6hi.js → Tag-BWD1u63m.js} +2 -2
- package/dist/client/assets/{TerminalView-CmSON012.js → TerminalView-DTR8bNOy.js} +6 -6
- package/dist/client/assets/Tooltip-Dka1-DNs.js +1 -0
- package/dist/client/assets/UsageView-elTUQCED.js +1 -0
- package/dist/client/assets/{Warning-B2AD2ulw.js → Warning-CCZES7el.js} +1 -1
- package/dist/client/assets/{_plugin-vue_export-helper-DXZ6IauR.js → _plugin-vue_export-helper-Bl_Pm_OI.js} +2 -2
- package/dist/client/assets/app-BMD_VOYs.js +1 -0
- package/dist/client/assets/{app-Du5RZCLa.js → app-y8cD3FPg.js} +1 -1
- package/dist/client/assets/auth-BPBv1nNQ.js +1 -0
- package/dist/client/assets/browser-DlPqZ-4M.js +47 -0
- package/dist/client/assets/chat-3-o9JAHE.js +6 -0
- package/dist/client/assets/composables-CoSqDggz.js +1 -0
- package/dist/client/assets/{fade-in.cssr-CkQxIGt5.js → fade-in.cssr-D0suZaLL.js} +2 -2
- package/dist/client/assets/index-BRXOdlZt.css +1 -0
- package/dist/client/assets/index-CeFFa_Wg.js +284 -0
- package/dist/client/assets/{jobs-BnXwbdOs.js → jobs-DMiCP2Li.js} +1 -1
- package/dist/client/assets/light-BNuYwJcs.js +1 -0
- package/dist/client/assets/{light-BZfVIZ0W.js → light-DLz3o2il.js} +1 -1
- package/dist/client/assets/{light-Bdfae2y3.js → light-DbUQYfY2.js} +1 -1
- package/dist/client/assets/{light-Jn66LOmu.js → light-DcGe0-g1.js} +1 -1
- package/dist/client/assets/{light-Dgzhn0jz.js → light-cIgLWDVk.js} +1 -1
- package/dist/client/assets/{models-mCQyOPuV.js → models-EKNn3-zC.js} +1 -1
- package/dist/client/assets/{pinia-Jb4QOAzE.js → pinia-C8BDM-Fc.js} +1 -1
- package/dist/client/assets/profiles-1vZTTlBc.js +1 -0
- package/dist/client/assets/{router-qWVkGgap.js → router-kR4kqS2l.js} +2 -2
- package/dist/client/assets/{session-browser-prefs-Bh1and1f.js → session-browser-prefs-BI-rZu2N.js} +1 -1
- package/dist/client/assets/sessions-CJI89wYu.js +1 -0
- package/dist/client/assets/{skills-BIFy9nXD.js → skills-DjdZmDZP.js} +1 -1
- package/dist/client/assets/{use-message-Do_vF1fs.js → use-message-sSsrvqld.js} +1 -1
- package/dist/client/assets/{useTheme-BFm8wMmc.js → useTheme-DgQIobZP.js} +1 -1
- package/dist/client/index.html +29 -30
- package/dist/server/index.js +1067 -329
- package/dist/server/index.js.map +4 -4
- package/package.json +2 -2
- package/dist/client/assets/Add-COjp_zn3.js +0 -1
- package/dist/client/assets/ChatView-DVQv3z6i.js +0 -127
- package/dist/client/assets/ChatView-w9DKSiie.css +0 -1
- package/dist/client/assets/GatewaysView-BeaZvbdd.js +0 -1
- package/dist/client/assets/Input-CxMM68Q2.js +0 -234
- package/dist/client/assets/JobsView-DhosFF52.js +0 -2
- package/dist/client/assets/LoginView-DHPxG3eC.css +0 -1
- package/dist/client/assets/LoginView-DrjDX7xD.js +0 -1
- package/dist/client/assets/LogsView-BpW_vgEs.js +0 -1
- package/dist/client/assets/MemoryView-CP3K8mDG.js +0 -7
- package/dist/client/assets/ModelsView-DdQUiiu6.js +0 -1
- package/dist/client/assets/Popconfirm-DnYCLqNF.js +0 -16
- package/dist/client/assets/Popover-DAXLiB78.js +0 -117
- package/dist/client/assets/ProfilesView-Bkhqt3QB.js +0 -440
- package/dist/client/assets/SettingRow-B4_BuJSm.js +0 -1
- package/dist/client/assets/SettingsView-ZwzxJZVc.js +0 -352
- package/dist/client/assets/SkillsView-B3X9y2kZ.js +0 -1
- package/dist/client/assets/Spin-CAOjab_F.js +0 -43
- package/dist/client/assets/Suffix-DQWmhzzW.js +0 -90
- package/dist/client/assets/Tooltip-U6DmMv6W.js +0 -1
- package/dist/client/assets/UsageView-rmIKdR1u.js +0 -1
- package/dist/client/assets/app-lD2ZIoa4.js +0 -1
- package/dist/client/assets/browser-DcLLT85r.js +0 -47
- package/dist/client/assets/chat-DJP53-h1.js +0 -6
- package/dist/client/assets/composables-CjmuafMO.js +0 -1
- package/dist/client/assets/index-BfU2Be-n.css +0 -1
- package/dist/client/assets/index-BqaBjme9.js +0 -284
- package/dist/client/assets/light-ZuZhSzix.js +0 -1
- package/dist/client/assets/light-ba4gwt1q.js +0 -1
- package/dist/client/assets/omit-1BRB6K75.js +0 -1
- package/dist/client/assets/profiles-PisKQKsd.js +0 -1
- package/dist/client/assets/sessions-smjenK_5.js +0 -1
- /package/dist/client/assets/{_common-Yp55QE79.js → _common-D_mHAddk.js} +0 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import{$ as e,A as t,D as n,E as r,H as i,I as a,J as o,K as s,M as c,O as l,P as u,Q as d,T as f,W as p,Z as m,_ as h,_t as g,b as _,et as v,f as y,ft as b,g as x,gt as S,ht as C,j as w,lt as T,mt as E,pt as D,q as O,w as k,x as A,z as ee}from"./router-kR4kqS2l.js";import{r as j,t as M}from"./_plugin-vue_export-helper-Bl_Pm_OI.js";import{$ as N,B as P,J as te,Q as F,R as ne,W as re,X as I,Y as L,_t as R,a as ie,c as z,ct as B,d as ae,dt as V,et as oe,ft as se,n as ce,o as le,pt as ue,q as H,s as de,st as U,tt as fe,ut as W,z as pe}from"./browser-DlPqZ-4M.js";import{F as G,I as me,_ as he,b as ge,m as K,o as _e}from"./Popover-CXrjClQw.js";import{d as ve,f as ye,p as be,s as xe}from"./Suffix-C1Mw6UwH.js";import{i as Se,n as q,r as J,t as Ce}from"./fade-in.cssr-D0suZaLL.js";import{d as we,f as Te,p as Ee,t as De}from"./Modal-6Bv1v4kO.js";import{n as Oe,t as ke}from"./FormItem-kXuCeSKq.js";import{a as Ae,t as Y}from"./Button-vKfgky-Y.js";import{t as je}from"./Warning-CCZES7el.js";import{t as Me}from"./Add-DiTv65Se.js";import{i as Ne,t as Pe}from"./Input-BS71ZaoJ.js";import{t as Fe}from"./Tag-BWD1u63m.js";import{a as Ie,n as Le,r as Re}from"./light-DcGe0-g1.js";import{t as ze}from"./light-cIgLWDVk.js";import{t as Be}from"./Tooltip-Dka1-DNs.js";import{t as Ve}from"./composables-CoSqDggz.js";import{t as He}from"./use-message-sSsrvqld.js";import{t as Ue}from"./Spin-DKwUVt1F.js";import{t as We}from"./Switch-DG-3EwdR.js";import{t as X}from"./profiles-1vZTTlBc.js";function Ge(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 Ke(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 qe(e){return function(t){return e?.[t]}}var Je=qe({À:`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`}),Ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xe=RegExp(`[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]`,`g`);function Ze(e){return e=Se(e),e&&e.replace(Ye,Je).replace(Xe,``)}var Qe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function $e(e){return e.match(Qe)||[]}var et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tt(e){return et.test(e)}var nt=`\\ud800-\\udfff`,rt=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,it=`\\u2700-\\u27bf`,at=`a-z\\xdf-\\xf6\\xf8-\\xff`,ot=`\\xac\\xb1\\xd7\\xf7`,st=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,ct=`\\u2000-\\u206f`,lt=` \\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`,ut=`A-Z\\xc0-\\xd6\\xd8-\\xde`,dt=`\\ufe0e\\ufe0f`,ft=ot+st+ct+lt,pt=`['’]`,mt=`[`+ft+`]`,ht=`[`+rt+`]`,gt=`\\d+`,_t=`[`+it+`]`,vt=`[`+at+`]`,yt=`[^`+nt+ft+gt+it+at+ut+`]`,bt=`(?:`+ht+`|\\ud83c[\\udffb-\\udfff])`,xt=`[^`+nt+`]`,St=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Ct=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Z=`[`+ut+`]`,wt=`\\u200d`,Tt=`(?:`+vt+`|`+yt+`)`,Et=`(?:`+Z+`|`+yt+`)`,Dt=`(?:`+pt+`(?:d|ll|m|re|s|t|ve))?`,Ot=`(?:`+pt+`(?:D|LL|M|RE|S|T|VE))?`,kt=bt+`?`,At=`[`+dt+`]?`,jt=`(?:`+wt+`(?:`+[xt,St,Ct].join(`|`)+`)`+At+kt+`)*`,Mt=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,Nt=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,Pt=At+kt+jt,Ft=`(?:`+[_t,St,Ct].join(`|`)+`)`+Pt,It=RegExp([Z+`?`+vt+`+`+Dt+`(?=`+[mt,Z,`$`].join(`|`)+`)`,Et+`+`+Ot+`(?=`+[mt,Z+Tt,`$`].join(`|`)+`)`,Z+`?`+Tt+`+`+Dt,Z+`+`+Ot,Nt,Mt,gt,Ft].join(`|`),`g`);function Lt(e){return e.match(It)||[]}function Rt(e,t,n){return e=Se(e),t=n?void 0:t,t===void 0?tt(e)?Lt(e):$e(e):e.match(t)||[]}var zt=RegExp(`['’]`,`g`);function Bt(e){return function(t){return Ke(Rt(Ze(t).replace(zt,``)),e,``)}}var Vt=Bt(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),Ht=q(`attach`,()=>u(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},u(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},u(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},u(`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`}))))),Ut=q(`cancel`,()=>u(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},u(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},u(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},u(`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`}))))),Wt=q(`download`,()=>u(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},u(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},u(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},u(`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`}))))),Gt=c({name:`ResizeSmall`,render(){return u(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},u(`g`,{fill:`none`},u(`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`})))}}),Kt=q(`retry`,()=>u(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},u(`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;`}),u(`polyline`,{points:`256 58 336 138 256 218`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}))),qt=q(`rotateClockwise`,()=>u(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},u(`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`}),u(`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`}))),Jt=q(`rotateClockwise`,()=>u(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},u(`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`}),u(`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`}))),Yt=q(`trash`,()=>u(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},u(`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;`}),u(`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;`}),u(`line`,{x1:`312`,y1:`240`,x2:`200`,y2:`352`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}),u(`line`,{x1:`312`,y1:`352`,x2:`200`,y2:`240`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}))),Xt=q(`zoomIn`,()=>u(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},u(`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`}),u(`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`}))),Zt=q(`zoomOut`,()=>u(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},u(`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`}),u(`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`}))),Qt=F&&`loading`in document.createElement(`img`);function $t(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 en=new WeakMap,tn=new WeakMap,nn=new WeakMap,rn=(e,t,n)=>{if(!e)return()=>{};let r=$t(t),{root:i}=r.options,a,o=en.get(i);o?a=o:(a=new Map,en.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=tn.get(e.target),n=nn.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||(tn.delete(e),nn.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||en.delete(i))};return tn.set(e,u),nn.set(e,n),u};function an(){return{toolbarIconColor:`rgba(255, 255, 255, .9)`,toolbarColor:`rgba(0, 0, 0, .35)`,toolbarBoxShadow:`none`,toolbarBorderRadius:`24px`}}var on=de({name:`Image`,common:ce,peers:{Tooltip:ze},self:an});function sn(){return u(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},u(`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 cn(){return u(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},u(`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 ln(){return u(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},u(`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 un=Object.assign(Object.assign({},z.props),{onPreviewPrev:Function,onPreviewNext:Function,showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean,renderToolbar:Function}),dn=N(`n-image`),fn=U([U(`body >`,[B(`image-container`,`position: fixed;`)]),B(`image-preview-container`,`
|
|
2
|
+
position: fixed;
|
|
3
|
+
left: 0;
|
|
4
|
+
right: 0;
|
|
5
|
+
top: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
`),B(`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
|
+
`,[Ce()]),B(`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
|
+
`,[B(`base-icon`,`
|
|
32
|
+
padding: 0 8px;
|
|
33
|
+
font-size: 28px;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
`),Ce()]),B(`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
|
+
`,[_e()]),B(`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
|
+
`),B(`image`,`
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
max-height: 100%;
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
`,[se(`preview-disabled`,`
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
`),U(`img`,`
|
|
58
|
+
border-radius: inherit;
|
|
59
|
+
`)])]),pn=32,mn=c({name:`ImagePreview`,props:Object.assign(Object.assign({},un),{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}=D(e),{mergedClsPrefixRef:n}=P(e),r=z(`Image`,`-image`,fn,on,e,n),o=null,s=T(null),c=T(null),l=T(!1),{localeRef:d}=xe(`Image`),f=T(e.defaultShow),p=ve(b(e,`show`),f);function h(){let{value:e}=c;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 g(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(),de();break;case`ArrowDown`:t.preventDefault(),U();break;case`Escape`:G();break}}function _(t){let{onUpdateShow:n,"onUpdate:show":r}=e;n&&H(n,t),r&&H(r,t),f.value=t,l.value=!0}m(p,e=>{e?be(`keydown`,document,g):ye(`keydown`,document,g)}),i(()=>{ye(`keydown`,document,g)});let v=0,y=0,x=0,C=0,w=0,E=0,O=0,A=0,ee=!1;function j(e){let{clientX:t,clientY:n}=e;x=t-v,C=n-y,me(W)}function M(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 N(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,w-(a??0)):Math.max(-((n.width-window.innerWidth)/2),w-(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,E-(o??0)):Math.max(-((n.height-window.innerHeight)/2),E-(o??0)),{offsetX:c,offsetY:l}}function te(e){ye(`mousemove`,document,j),ye(`mouseup`,document,te);let{clientX:t,clientY:n}=e;ee=!1;let r=N(M({mouseUpClientX:t,mouseUpClientY:n,mouseDownClientX:O,mouseDownClientY:A}));x=r.offsetX,C=r.offsetY,W()}let F=a(dn,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;ee=!0,v=r-x,y=i-C,w=x,E=C,O=r,A=i,W(),be(`mousemove`,document,j),be(`mouseup`,document,te)}let re=1.5,I=0,L=1,R=0;function ie(e){var t,n;(n=(t=F?.previewedImgPropsRef.value)?.onDblclick)==null||n.call(t,e);let r=ue();L=L===r?1:r,W()}function B(){L=1,I=0}function ae(){var t;B(),R=0,(t=e.onPrev)==null||t.call(e)}function V(){var t;B(),R=0,(t=e.onNext)==null||t.call(e)}function se(){R-=90,W()}function ce(){R+=90,W()}function le(){let{value:e}=s;if(!e)return 1;let{innerWidth:t,innerHeight:n}=window,r=Math.max(1,e.naturalHeight/(n-pn)),i=Math.max(1,e.naturalWidth/(t-pn));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-pn),i=e.naturalWidth/(t-pn);return r<1&&i<1?1:Math.max(r,i)}function de(){let e=le();L<e&&(I+=1,L=Math.min(e,re**+I),W())}function U(){if(L>.5){let e=L;--I,L=Math.max(.5,re**+I);let t=e-L;W(!1);let n=N();L+=t,W(!1),L-=t,x=n.offsetX,C=n.offsetY,W()}}function fe(){let e=t.value;e&&Ge(e,void 0)}function W(e=!0){let{value:t}=s;if(!t)return;let{style:n}=t,r=S(F?.previewedImgPropsRef.value?.style),i=``;if(typeof r==`string`)i=`${r};`;else for(let e in r)i+=`${Vt(e)}: ${r[e]};`;let a=`transform-origin: center; transform: translateX(${x}px) translateY(${C}px) rotate(${R}deg) scale(${L});`;ee?n.cssText=`${i}cursor: grabbing; transition: none;${a}`:n.cssText=`${i}cursor: grab;${a}${e?``:`transition: none;`}`,e||t.offsetHeight}function G(){if(p.value){let{onClose:t}=e;t&&H(t),_(!1),f.value=!1}}function he(){L=ue(),I=Math.ceil(Math.log(L)/Math.log(re)),x=0,C=0,W()}let ge={setThumbnailEl:e=>{o=e}};function K(t,n){if(e.showToolbarTooltip){let{value:e}=r;return u(Be,{to:!1,theme:e.peers.Tooltip,themeOverrides:e.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>d.value[n],trigger:()=>t})}else return t}let _e=k(()=>{let{common:{cubicBezierEaseInOut:e},self:{toolbarIconColor:t,toolbarBorderRadius:n,toolbarBoxShadow:i,toolbarColor:a}}=r.value;return{"--n-bezier":e,"--n-toolbar-icon-color":t,"--n-toolbar-color":a,"--n-toolbar-border-radius":n,"--n-toolbar-box-shadow":i}}),{inlineThemeDisabled:Se}=P(),q=Se?pe(`image-preview`,void 0,_e,e):void 0;function J(e){e.preventDefault()}return Object.assign({clsPrefix:n,previewRef:s,previewWrapperRef:c,previewSrc:t,mergedShow:p,appear:oe(),displayed:l,previewedImgProps:F?.previewedImgPropsRef,handleWheel:J,handlePreviewMousedown:ne,handlePreviewDblclick:ie,syncTransformOrigin:h,handleAfterLeave:()=>{B(),R=0,l.value=!1},handleDragStart:e=>{var t,n;(n=(t=F?.previewedImgPropsRef.value)?.onDragstart)==null||n.call(t,e),e.preventDefault()},zoomIn:de,zoomOut:U,handleDownloadClick:fe,rotateCounterclockwise:se,rotateClockwise:ce,handleSwitchPrev:ae,handleSwitchNext:V,withTooltip:K,resizeToOrignalImageSize:he,cssVars:Se?void 0:_e,themeClass:q?.themeClass,onRender:q?.onRender,doUpdateShow:_,close:G},ge)},render(){var e;let{clsPrefix:t,renderToolbar:n,withTooltip:r}=this,i=r(u(J,{clsPrefix:t,onClick:this.handleSwitchPrev},{default:sn}),`tipPrevious`),a=r(u(J,{clsPrefix:t,onClick:this.handleSwitchNext},{default:cn}),`tipNext`),o=r(u(J,{clsPrefix:t,onClick:this.rotateCounterclockwise},{default:()=>u(Jt,null)}),`tipCounterclockwise`),s=r(u(J,{clsPrefix:t,onClick:this.rotateClockwise},{default:()=>u(qt,null)}),`tipClockwise`),c=r(u(J,{clsPrefix:t,onClick:this.resizeToOrignalImageSize},{default:()=>u(Gt,null)}),`tipOriginalSize`),l=r(u(J,{clsPrefix:t,onClick:this.zoomOut},{default:()=>u(Zt,null)}),`tipZoomOut`),d=r(u(J,{clsPrefix:t,onClick:this.handleDownloadClick},{default:()=>u(Wt,null)}),`tipDownload`),f=r(u(J,{clsPrefix:t,onClick:()=>this.close()},{default:ln}),`tipClose`),p=r(u(J,{clsPrefix:t,onClick:this.zoomIn},{default:()=>u(Xt,null)}),`tipZoomIn`);return u(_,null,(e=this.$slots).default?.call(e),u(he,{show:this.mergedShow},{default:()=>{var e;return this.mergedShow||this.displayed?((e=this.onRender)==null||e.call(this),v(u(`div`,{ref:`containerRef`,class:[`${t}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},u(y,{name:`fade-in-transition`,appear:this.appear},{default:()=>this.mergedShow?u(`div`,{class:`${t}-image-preview-overlay`,onClick:()=>this.close()}):null}),this.showToolbar?u(y,{name:`fade-in-transition`,appear:this.appear},{default:()=>this.mergedShow?u(`div`,{class:`${t}-image-preview-toolbar`},n?n({nodes:{prev:i,next:a,rotateCounterclockwise:o,rotateClockwise:s,resizeToOriginalSize:c,zoomOut:l,zoomIn:p,download:d,close:f}}):u(_,null,this.onPrev?u(_,null,i,a):null,o,s,c,l,p,d,f)):null}):null,u(y,{name:`fade-in-scale-up-transition`,onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{let{previewedImgProps:e={}}=this;return v(u(`div`,{class:`${t}-image-preview-wrapper`,ref:`previewWrapperRef`},u(`img`,Object.assign({},e,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${t}-image-preview`,e.class],key:this.previewSrc,src:this.previewSrc,ref:`previewRef`,onDragstart:this.handleDragStart}))),[[x,this.mergedShow]])}})),[[ge,{enabled:this.mergedShow}]])):null}}))}}),hn=N(`n-image-group`),gn=c({name:`ImageGroup`,props:Object.assign(Object.assign({},un),{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),n=`c${G()}`,r=T(null),i=T(e.defaultShow),a=ve(b(e,`show`),i),o=T(new Map),s=k(()=>{if(e.srcList){let t=new Map;return e.srcList.forEach((e,n)=>{t.set(`p${n}`,e)}),t}return o.value}),c=k(()=>Array.from(s.value.keys())),l=()=>c.value.length;function u(t,n){e.srcList&&L(`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 o.value.has(`r${r}`)||o.value.set(r,n),function(){o.value.has(r)||o.value.delete(r)}}let d=T(e.defaultCurrent),f=ve(b(e,`current`),d),p=t=>{if(t!==f.value){let{onUpdateCurrent:n,"onUpdate:current":r}=e;n&&H(n,t),r&&H(r,t),d.value=t}},m=k(()=>c.value[f.value]),h=e=>{let t=c.value.indexOf(e);t!==f.value&&p(t)},g=k(()=>s.value.get(m.value));function _(t){let{onUpdateShow:n,"onUpdate:show":r}=e;n&&H(n,t),r&&H(r,t),i.value=t}function v(){_(!1)}let y=k(()=>{let e=(e,t)=>{for(let n=e;n<=t;n++){let e=c.value[n];if(s.value.get(e))return n}},t=e(f.value+1,l()-1);return t===void 0?e(0,f.value-1):t}),x=k(()=>{let e=(e,t)=>{for(let n=e;n>=t;n--){let e=c.value[n];if(s.value.get(e))return n}},t=e(f.value-1,0);return t===void 0?e(l()-1,f.value+1):t});function S(t){var n,r;t===1?(x.value!==void 0&&p(y.value),(n=e.onPreviewNext)==null||n.call(e)):(y.value!==void 0&&p(x.value),(r=e.onPreviewPrev)==null||r.call(e))}return O(hn,{mergedClsPrefixRef:t,registerImageUrl:u,setThumbnailEl:e=>{var t;(t=r.value)==null||t.setThumbnailEl(e)},toggleShow:e=>{_(!0),h(e)},groupId:n,renderToolbarRef:b(e,`renderToolbar`)}),{mergedClsPrefix:t,previewInstRef:r,mergedShow:a,src:g,onClose:v,next:()=>{S(1)},prev:()=>{S(-1)}}},render(){return u(mn,{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)}}),_n=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},un),vn=0,yn=c({name:`Image`,props:_n,slots:Object,inheritAttrs:!1,setup(e){let t=T(null),n=T(!1),r=T(null),o=a(hn,null),{mergedClsPrefixRef:s}=o||P(e),c=k(()=>e.previewSrc||e.src),l=T(!1),u=vn++,f=()=>{if(e.previewDisabled||n.value)return;if(o){o.setThumbnailEl(t.value),o.toggleShow(`r${u}`);return}let{value:i}=r;i&&(i.setThumbnailEl(t.value),l.value=!0)},m={click:()=>{f()},showPreview:f},h=T(!e.lazy);p(()=>{var e;(e=t.value)==null||e.setAttribute(`data-group-id`,o?.groupId||``)}),p(()=>{if(e.lazy&&e.intersectionObserverOptions){let n,r=d(()=>{n?.(),n=void 0,n=rn(t.value,e.intersectionObserverOptions,h)});i(()=>{r(),n?.()})}}),d(()=>{var t;e.src||(t=e.imgProps)==null||t.src,n.value=!1}),d(e=>{let t=(o?.registerImageUrl)?.call(o,u,c.value||``);e(()=>{t?.()})});function g(t){var n,r;m.showPreview(),(r=(n=e.imgProps)?.onClick)==null||r.call(n,t)}function _(){l.value=!1}let v=T(!1);return O(dn,{previewedImgPropsRef:b(e,`previewedImgProps`)}),Object.assign({mergedClsPrefix:s,groupId:o?.groupId,previewInstRef:r,imageRef:t,mergedPreviewSrc:c,showError:n,shouldStartLoading:h,loaded:v,mergedOnClick:e=>{g(e)},onPreviewClose:_,mergedOnError:t=>{if(!h.value)return;n.value=!0;let{onError:r,imgProps:{onError:i}={}}=e;r?.(t),i?.(t)},mergedOnLoad:t=>{let{onLoad:n,imgProps:{onLoad:r}={}}=e;n?.(t),r?.(t),v.value=!0},previewShow:l},m)},render(){var e;let{mergedClsPrefix:t,imgProps:n={},loaded:r,$attrs:i,lazy:a}=this,o=re(this.$slots.error,()=>[]),s=(e=this.$slots).placeholder?.call(e),c=this.src||n.src,l=this.showError&&o.length?o:u(`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?c:void 0:c,alt:this.alt||n.alt,"aria-label":this.alt||n.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:Qt&&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 u(`div`,Object.assign({},i,{role:`none`,class:[i.class,`${t}-image`,(this.previewDisabled||this.showError)&&`${t}-image--preview-disabled`]}),this.groupId?l:u(mn,{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:()=>l}),!r&&s)}}),bn={success:u(we,null),error:u(Ee,null),warning:u(je,null),info:u(Te,null)},xn=c({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 n=k(()=>{let t=`gradient`,{fillColor:n}=e;return typeof n==`object`?`${t}-${R(JSON.stringify(n))}`:t});function r(t,r,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(#${n.value})`:i,strokeDasharray:`${Math.min(t,100)/100*(d-o)}px ${s*8}px`,strokeDashoffset:`-${o/2}px`,transformOrigin:r?`center`:void 0,transform:r?`rotate(${r}deg)`:void 0}}}let i=()=>{let t=typeof e.fillColor==`object`,r=t?e.fillColor.stops[0]:``,i=t?e.fillColor.stops[1]:``;return t&&u(`defs`,null,u(`linearGradient`,{id:n.value,x1:`0%`,y1:`100%`,x2:`100%`,y2:`0%`},u(`stop`,{offset:`0%`,"stop-color":r}),u(`stop`,{offset:`100%`,"stop-color":i})))};return()=>{let{fillColor:n,railColor:a,strokeWidth:o,offsetDegree:s,status:c,percentage:l,showIndicator:d,indicatorTextColor:f,unit:p,gapOffsetDegree:m,clsPrefix:h}=e,{pathString:g,pathStyle:_}=r(100,0,a,`rail`),{pathString:v,pathStyle:y}=r(l,s,n,`fill`),b=100+o;return u(`div`,{class:`${h}-progress-content`,role:`none`},u(`div`,{class:`${h}-progress-graph`,"aria-hidden":!0},u(`div`,{class:`${h}-progress-graph-circle`,style:{transform:m?`rotate(${m}deg)`:void 0}},u(`svg`,{viewBox:`0 0 ${b} ${b}`},i(),u(`g`,null,u(`path`,{class:`${h}-progress-graph-circle-rail`,d:g,"stroke-width":o,"stroke-linecap":`round`,fill:`none`,style:_})),u(`g`,null,u(`path`,{class:[`${h}-progress-graph-circle-fill`,l===0&&`${h}-progress-graph-circle-fill--empty`],d:v,"stroke-width":o,"stroke-linecap":`round`,fill:`none`,style:y}))))),d?u(`div`,null,t.default?u(`div`,{class:`${h}-progress-custom-content`,role:`none`},t.default()):c===`default`?u(`div`,{class:`${h}-progress-text`,style:{color:f},role:`none`},u(`span`,{class:`${h}-progress-text__percentage`},l),u(`span`,{class:`${h}-progress-text__unit`},p)):u(`div`,{class:`${h}-progress-icon`,"aria-hidden":!0},u(J,{clsPrefix:h},{default:()=>bn[c]}))):null)}}}),Sn={success:u(we,null),error:u(Ee,null),warning:u(je,null),info:u(Te,null)},Cn=c({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 n=k(()=>K(e.height)),r=k(()=>typeof e.fillColor==`object`?`linear-gradient(to right, ${e.fillColor?.stops[0]} , ${e.fillColor?.stops[1]})`:e.fillColor),i=k(()=>e.railBorderRadius===void 0?e.height===void 0?``:K(e.height,{c:.5}):K(e.railBorderRadius)),a=k(()=>e.fillBorderRadius===void 0?e.railBorderRadius===void 0?e.height===void 0?``:K(e.height,{c:.5}):K(e.railBorderRadius):K(e.fillBorderRadius));return()=>{let{indicatorPlacement:o,railColor:s,railStyle:c,percentage:l,unit:d,indicatorTextColor:f,status:p,showIndicator:m,processing:h,clsPrefix:g}=e;return u(`div`,{class:`${g}-progress-content`,role:`none`},u(`div`,{class:`${g}-progress-graph`,"aria-hidden":!0},u(`div`,{class:[`${g}-progress-graph-line`,{[`${g}-progress-graph-line--indicator-${o}`]:!0}]},u(`div`,{class:`${g}-progress-graph-line-rail`,style:[{backgroundColor:s,height:n.value,borderRadius:i.value},c]},u(`div`,{class:[`${g}-progress-graph-line-fill`,h&&`${g}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,background:r.value,height:n.value,lineHeight:n.value,borderRadius:a.value}},o===`inside`?u(`div`,{class:`${g}-progress-graph-line-indicator`,style:{color:f}},t.default?t.default():`${l}${d}`):null)))),m&&o===`outside`?u(`div`,null,t.default?u(`div`,{class:`${g}-progress-custom-content`,style:{color:f},role:`none`},t.default()):p===`default`?u(`div`,{role:`none`,class:`${g}-progress-icon ${g}-progress-icon--as-text`,style:{color:f}},l,d):u(`div`,{class:`${g}-progress-icon`,"aria-hidden":!0},u(J,{clsPrefix:g},{default:()=>Sn[p]}))):null)}}});function wn(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 Tn=c({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 n=k(()=>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}`)),r=(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`&&u(`linearGradient`,{id:`gradient-${n}`,x1:`100%`,y1:`0%`,x2:`0%`,y2:`100%`},u(`stop`,{offset:`0%`,"stop-color":i}),u(`stop`,{offset:`100%`,"stop-color":a}))};return()=>{let{viewBoxWidth:i,strokeWidth:a,circleGap:o,showIndicator:s,fillColor:c,railColor:l,railStyle:d,percentage:f,clsPrefix:p}=e;return u(`div`,{class:`${p}-progress-content`,role:`none`},u(`div`,{class:`${p}-progress-graph`,"aria-hidden":!0},u(`div`,{class:`${p}-progress-graph-circle`},u(`svg`,{viewBox:`0 0 ${i} ${i}`},u(`defs`,null,f.map((e,t)=>r(e,t))),f.map((e,t)=>u(`g`,{key:t},u(`path`,{class:`${p}-progress-graph-circle-rail`,d:wn(i/2-a/2*(1+2*t)-o*t,a,i),"stroke-width":a,"stroke-linecap":`round`,fill:`none`,style:[{strokeDashoffset:0,stroke:l[t]},d[t]]}),u(`path`,{class:[`${p}-progress-graph-circle-fill`,e===0&&`${p}-progress-graph-circle-fill--empty`],d:wn(i/2-a/2*(1+2*t)-o*t,a,i),"stroke-width":a,"stroke-linecap":`round`,fill:`none`,style:{strokeDasharray:n.value[t],strokeDashoffset:0,stroke:typeof c[t]==`object`?`url(#gradient-${t})`:c[t]}})))))),s&&t.default?u(`div`,null,u(`div`,{class:`${p}-progress-text`},t.default())):null)}}}),En=U([B(`progress`,{display:`inline-block`},[B(`progress-icon`,`
|
|
62
|
+
color: var(--n-icon-color);
|
|
63
|
+
transition: color .3s var(--n-bezier);
|
|
64
|
+
`),V(`line`,`
|
|
65
|
+
width: 100%;
|
|
66
|
+
display: block;
|
|
67
|
+
`,[B(`progress-content`,`
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
`,[B(`progress-graph`,{flex:1})]),B(`progress-custom-content`,{marginLeft:`14px`}),B(`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
|
+
`,[V(`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
|
+
`)])]),V(`circle, dashboard`,{width:`120px`},[B(`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
|
+
`),B(`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
|
+
`),B(`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
|
+
`)]),V(`multiple-circle`,`
|
|
114
|
+
width: 200px;
|
|
115
|
+
color: inherit;
|
|
116
|
+
`,[B(`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
|
+
`)]),B(`progress-content`,{position:`relative`}),B(`progress-graph`,{position:`relative`},[B(`progress-graph-circle`,[U(`svg`,{verticalAlign:`bottom`}),B(`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
|
+
`,[V(`empty`,{opacity:0})]),B(`progress-graph-circle-rail`,`
|
|
134
|
+
transition: stroke .3s var(--n-bezier);
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
stroke: var(--n-rail-color);
|
|
137
|
+
`)]),B(`progress-graph-line`,[V(`indicator-inside`,[B(`progress-graph-line-rail`,`
|
|
138
|
+
height: 16px;
|
|
139
|
+
line-height: 16px;
|
|
140
|
+
border-radius: 10px;
|
|
141
|
+
`,[B(`progress-graph-line-fill`,`
|
|
142
|
+
height: inherit;
|
|
143
|
+
border-radius: 10px;
|
|
144
|
+
`),B(`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
|
+
`)])]),V(`indicator-inside-label`,`
|
|
155
|
+
height: 16px;
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
`,[B(`progress-graph-line-rail`,`
|
|
159
|
+
flex: 1;
|
|
160
|
+
transition: background-color .3s var(--n-bezier);
|
|
161
|
+
`),B(`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
|
+
`)]),B(`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
|
+
`,[B(`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
|
+
`,[V(`processing`,[U(`&::after`,`
|
|
196
|
+
content: "";
|
|
197
|
+
background-image: var(--n-line-bg-processing);
|
|
198
|
+
animation: progress-processing-animation 2s var(--n-bezier) infinite;
|
|
199
|
+
`)])])])])])]),U(`@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
|
+
`)]),Dn=c({name:`Progress`,props:Object.assign(Object.assign({},z.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=k(()=>e.indicatorPlacement||e.indicatorPosition),n=k(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type===`dashboard`)return 75}),{mergedClsPrefixRef:r,inlineThemeDisabled:i}=P(e),a=z(`Progress`,`-progress`,En,Re,e,r),o=k(()=>{let{status:t}=e,{common:{cubicBezierEaseInOut:n},self:{fontSize:r,fontSizeCircle:i,railColor:o,railHeight:s,iconSizeCircle:c,iconSizeLine:l,textColorCircle:u,textColorLineInner:d,textColorLineOuter:f,lineBgProcessing:p,fontWeightCircle:m,[ue(`iconColor`,t)]:h,[ue(`fillColor`,t)]:g}}=a.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":o,"--n-rail-height":s,"--n-text-color-circle":u,"--n-text-color-line-inner":d,"--n-text-color-line-outer":f}}),s=i?pe(`progress`,k(()=>e.status[0]),o,e):void 0;return{mergedClsPrefix:r,mergedIndicatorPlacement:t,gapDeg:n,cssVars:i?void 0:o,themeClass:s?.themeClass,onRender:s?.onRender}},render(){let{type:e,cssVars:t,indicatorTextColor:n,showIndicator:r,status:i,railColor:a,railStyle:o,color:s,percentage:c,viewBoxWidth:l,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?.(),u(`div`,{class:[S,`${y}-progress`,`${y}-progress--${e}`,`${y}-progress--${i}`],style:t,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,role:e===`circle`||e===`line`||e===`dashboard`?`progressbar`:`none`},e===`circle`||e===`dashboard`?u(xn,{clsPrefix:y,status:i,showIndicator:r,indicatorTextColor:n,railColor:a,fillColor:s,railStyle:o,offsetDegree:this.offsetDegree,percentage:c,viewBoxWidth:l,strokeWidth:d,gapDegree:b===void 0?e===`dashboard`?75:0:b,gapOffsetDegree:x,unit:p},C):e===`line`?u(Cn,{clsPrefix:y,status:i,showIndicator:r,indicatorTextColor:n,railColor:a,fillColor:s,railStyle:o,percentage:c,processing:_,indicatorPlacement:f,unit:p,fillBorderRadius:h,railBorderRadius:m,height:g},C):e===`multiple-circle`?u(Tn,{clsPrefix:y,strokeWidth:d,railColor:a,fillColor:s,railStyle:o,viewBoxWidth:l,percentage:c,showIndicator:r,circleGap:v},C):null)}}),Q=N(`n-upload`),On=U([B(`upload`,`width: 100%;`,[V(`dragger-inside`,[B(`upload-trigger`,`
|
|
225
|
+
display: block;
|
|
226
|
+
`)]),V(`drag-over`,[B(`upload-dragger`,`
|
|
227
|
+
border: var(--n-dragger-border-hover);
|
|
228
|
+
`)])]),B(`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
|
+
`,[U(`&:hover`,`
|
|
243
|
+
border: var(--n-dragger-border-hover);
|
|
244
|
+
`),V(`disabled`,`
|
|
245
|
+
cursor: not-allowed;
|
|
246
|
+
`)]),B(`upload-trigger`,`
|
|
247
|
+
display: inline-block;
|
|
248
|
+
box-sizing: border-box;
|
|
249
|
+
opacity: 1;
|
|
250
|
+
transition: opacity .3s var(--n-bezier);
|
|
251
|
+
`,[U(`+`,[B(`upload-file-list`,`margin-top: 8px;`)]),V(`disabled`,`
|
|
252
|
+
opacity: var(--n-item-disabled-opacity);
|
|
253
|
+
cursor: not-allowed;
|
|
254
|
+
`),V(`image-card`,`
|
|
255
|
+
width: 96px;
|
|
256
|
+
height: 96px;
|
|
257
|
+
`,[B(`base-icon`,`
|
|
258
|
+
font-size: 24px;
|
|
259
|
+
`),B(`upload-dragger`,`
|
|
260
|
+
padding: 0;
|
|
261
|
+
height: 100%;
|
|
262
|
+
width: 100%;
|
|
263
|
+
display: flex;
|
|
264
|
+
align-items: center;
|
|
265
|
+
justify-content: center;
|
|
266
|
+
`)])]),B(`upload-file-list`,`
|
|
267
|
+
line-height: var(--n-line-height);
|
|
268
|
+
opacity: 1;
|
|
269
|
+
transition: opacity .3s var(--n-bezier);
|
|
270
|
+
`,[U(`a, img`,`outline: none;`),V(`disabled`,`
|
|
271
|
+
opacity: var(--n-item-disabled-opacity);
|
|
272
|
+
cursor: not-allowed;
|
|
273
|
+
`,[B(`upload-file`,`cursor: not-allowed;`)]),V(`grid`,`
|
|
274
|
+
display: grid;
|
|
275
|
+
grid-template-columns: repeat(auto-fill, 96px);
|
|
276
|
+
grid-gap: 8px;
|
|
277
|
+
margin-top: 0;
|
|
278
|
+
`),B(`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
|
+
`,[Ie(),B(`progress`,[Ie({foldPadding:!0})]),U(`&:hover`,`
|
|
286
|
+
background-color: var(--n-item-color-hover);
|
|
287
|
+
`,[B(`upload-file-info`,[W(`action`,`
|
|
288
|
+
opacity: 1;
|
|
289
|
+
`)])]),V(`image-type`,`
|
|
290
|
+
border-radius: var(--n-border-radius);
|
|
291
|
+
text-decoration: underline;
|
|
292
|
+
text-decoration-color: #0000;
|
|
293
|
+
`,[B(`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
|
+
`,[B(`progress`,`
|
|
303
|
+
padding: 2px 0;
|
|
304
|
+
margin-bottom: 0;
|
|
305
|
+
`),W(`name`,`
|
|
306
|
+
padding: 0 8px;
|
|
307
|
+
`),W(`thumbnail`,`
|
|
308
|
+
width: 32px;
|
|
309
|
+
height: 32px;
|
|
310
|
+
font-size: 28px;
|
|
311
|
+
display: flex;
|
|
312
|
+
justify-content: center;
|
|
313
|
+
align-items: center;
|
|
314
|
+
`,[U(`img`,`
|
|
315
|
+
width: 100%;
|
|
316
|
+
`)])])]),V(`text-type`,[B(`progress`,`
|
|
317
|
+
box-sizing: border-box;
|
|
318
|
+
padding-bottom: 6px;
|
|
319
|
+
margin-bottom: 6px;
|
|
320
|
+
`)]),V(`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
|
+
`,[B(`progress`,`
|
|
334
|
+
position: absolute;
|
|
335
|
+
left: 8px;
|
|
336
|
+
bottom: 8px;
|
|
337
|
+
right: 8px;
|
|
338
|
+
width: unset;
|
|
339
|
+
`),B(`upload-file-info`,`
|
|
340
|
+
padding: 0;
|
|
341
|
+
width: 100%;
|
|
342
|
+
height: 100%;
|
|
343
|
+
`,[W(`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
|
+
`,[U(`img`,`
|
|
352
|
+
width: 100%;
|
|
353
|
+
`)])]),U(`&::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
|
+
`),U(`&:hover`,[U(`&::before`,`opacity: 1;`),B(`upload-file-info`,[W(`thumbnail`,`opacity: .12;`)])])]),V(`error-status`,[U(`&:hover`,`
|
|
365
|
+
background-color: var(--n-item-color-hover-error);
|
|
366
|
+
`),B(`upload-file-info`,[W(`name`,`color: var(--n-item-text-color-error);`),W(`thumbnail`,`color: var(--n-item-text-color-error);`)]),V(`image-card-type`,`
|
|
367
|
+
border: var(--n-item-border-image-card-error);
|
|
368
|
+
`)]),V(`with-url`,`
|
|
369
|
+
cursor: pointer;
|
|
370
|
+
`,[B(`upload-file-info`,[W(`name`,`
|
|
371
|
+
color: var(--n-item-text-color-success);
|
|
372
|
+
text-decoration-color: var(--n-item-text-color-success);
|
|
373
|
+
`,[U(`a`,`
|
|
374
|
+
text-decoration: underline;
|
|
375
|
+
`)])])]),B(`upload-file-info`,`
|
|
376
|
+
position: relative;
|
|
377
|
+
padding-top: 6px;
|
|
378
|
+
padding-bottom: 6px;
|
|
379
|
+
display: flex;
|
|
380
|
+
flex-wrap: nowrap;
|
|
381
|
+
`,[W(`thumbnail`,`
|
|
382
|
+
font-size: 18px;
|
|
383
|
+
opacity: 1;
|
|
384
|
+
transition: opacity .2s var(--n-bezier);
|
|
385
|
+
color: var(--n-item-icon-color);
|
|
386
|
+
`,[B(`base-icon`,`
|
|
387
|
+
margin-right: 2px;
|
|
388
|
+
vertical-align: middle;
|
|
389
|
+
transition: color .3s var(--n-bezier);
|
|
390
|
+
`)]),W(`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
|
+
`,[B(`button`,[U(`&:not(:last-child)`,{marginRight:`4px`}),B(`base-icon`,[U(`svg`,[ie()])])]),V(`image-type`,`
|
|
404
|
+
position: relative;
|
|
405
|
+
max-width: 80px;
|
|
406
|
+
width: auto;
|
|
407
|
+
`),V(`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
|
+
`)]),W(`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
|
+
`,[U(`a`,`
|
|
433
|
+
color: inherit;
|
|
434
|
+
text-decoration: underline;
|
|
435
|
+
`)])])])]),B(`upload-file-input`,`
|
|
436
|
+
display: none;
|
|
437
|
+
width: 0;
|
|
438
|
+
height: 0;
|
|
439
|
+
opacity: 0;
|
|
440
|
+
`)]),kn=c({name:`UploadDragger`,__UPLOAD_DRAGGER__:!0,setup(e,{slots:t}){let n=a(Q,null);return n||L(`upload-dragger`,"`n-upload-dragger` must be placed inside `n-upload`."),()=>{let{mergedClsPrefixRef:{value:e},mergedDisabledRef:{value:r},maxReachedRef:{value:i}}=n;return u(`div`,{class:[`${e}-upload-dragger`,(r||i)&&`${e}-upload-dragger--disabled`]},t)}}});function An(){return u(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 28 28`},u(`g`,{fill:`none`},u(`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 jn(){return u(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 28 28`},u(`g`,{fill:`none`},u(`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 Mn=c({name:`UploadProgress`,props:{show:Boolean,percentage:{type:Number,required:!0},status:{type:String,required:!0}},setup(){return{mergedTheme:a(Q).mergedThemeRef}},render(){return u(Ae,null,{default:()=>this.show?u(Dn,{type:`line`,showIndicator:!1,percentage:this.percentage,status:this.status,height:2,theme:this.mergedTheme.peers.Progress,themeOverrides:this.mergedTheme.peerOverrides.Progress}):null})}}),Nn=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 Pn(e){return e.includes(`image/`)}function Fn(e=``){let t=e.split(`/`),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[``])[0]}var In=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,Ln=e=>{if(e.type)return Pn(e.type);let t=Fn(e.name||``);if(In.test(t))return!0;let n=e.thumbnailUrl||e.url||``,r=Fn(n);return!!(/^data:image\//.test(n)||In.test(r))};function Rn(e){return Nn(this,void 0,void 0,function*(){return yield new Promise(t=>{if(!e.type||!Pn(e.type)){t(``);return}t(window.URL.createObjectURL(e))})})}var zn=F&&window.FileReader&&window.File;function Bn(e){return e.isDirectory}function Vn(e){return e.isFile}function Hn(e,t){return Nn(this,void 0,void 0,function*(){let n=[];function r(e){return Nn(this,void 0,void 0,function*(){for(let i of e)if(i){if(t&&Bn(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(Vn(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 $(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 Un(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 Wn=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())})},Gn={paddingMedium:`0 3px`,heightMedium:`24px`,iconSizeMedium:`18px`},Kn=c({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(Q),n=T(null),r=T(``),i=k(()=>{let{file:t}=e;return t.status===`finished`?`success`:t.status===`error`?`error`:`info`}),o=k(()=>{let{file:t}=e;if(t.status===`error`)return`error`}),s=k(()=>{let{file:t}=e;return t.status===`uploading`}),c=k(()=>{if(!t.showCancelButtonRef.value)return!1;let{file:n}=e;return[`uploading`,`pending`,`error`].includes(n.status)}),l=k(()=>{if(!t.showRemoveButtonRef.value)return!1;let{file:n}=e;return[`finished`].includes(n.status)}),u=k(()=>{if(!t.showDownloadButtonRef.value)return!1;let{file:n}=e;return[`finished`].includes(n.status)}),f=k(()=>{if(!t.showRetryButtonRef.value)return!1;let{file:n}=e;return[`error`].includes(n.status)}),p=fe(()=>r.value||e.file.thumbnailUrl||e.file.url),m=k(()=>{if(!t.showPreviewButtonRef.value)return!1;let{file:{status:n},listType:r}=e;return[`finished`].includes(n)&&p.value&&r===`image-card`});function h(){return Wn(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 g(t){t.preventDefault();let{file:n}=e;[`finished`,`pending`,`error`].includes(n.status)?v(n):[`uploading`].includes(n.status)?b(n):I(`upload`,`The button clicked type is unknown.`)}function _(t){t.preventDefault(),y(e.file)}function v(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 y(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)):Ge(e.url,e.name))})}function b(e){let{xhrMap:n}=t;n.get(e.id)?.abort(),v(Object.assign({},e))}function x(r){let{onPreviewRef:{value:i}}=t;if(i)i(e.file,{event:r});else if(e.listType===`image-card`){let{value:e}=n;if(!e)return;e.showPreview()}}let S=()=>Wn(this,void 0,void 0,function*(){let{listType:n}=e;n!==`image`&&n!==`image-card`||t.shouldUseThumbnailUrlRef.value(e.file)&&(r.value=yield t.getFileThumbnailUrlResolver(e.file))});return d(()=>{S()}),{mergedTheme:t.mergedThemeRef,progressStatus:i,buttonType:o,showProgress:s,disabled:t.mergedDisabledRef,showCancelButton:c,showRemoveButton:l,showDownloadButton:u,showRetryButton:f,showPreviewButton:m,mergedThumbnailUrl:p,shouldUseThumbnailUrl:t.shouldUseThumbnailUrlRef,renderIcon:t.renderIconRef,imageRef:n,handleRemoveOrCancelClick:g,handleDownloadClick:_,handleRetryClick:h,handlePreviewClick:x}},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?u(`span`,{class:`${e}-upload-file-info__thumbnail`},i?i(r):Ln(r)?u(J,{clsPrefix:e},{default:An}):u(J,{clsPrefix:e},{default:jn})):u(`a`,{rel:`noopener noreferer`,target:`_blank`,href:r.url||void 0,class:`${e}-upload-file-info__thumbnail`,onClick:this.handlePreviewClick},n===`image-card`?u(yn,{src:this.mergedThumbnailUrl||void 0,previewSrc:r.url||void 0,alt:r.name,ref:`imageRef`}):u(`img`,{src:this.mergedThumbnailUrl||void 0,alt:r.name})):u(`span`,{class:`${e}-upload-file-info__thumbnail`},i?i(r):u(J,{clsPrefix:e},{default:()=>u(Ht,null)}));let s=u(Mn,{show:this.showProgress,percentage:r.percentage||0,status:this.progressStatus}),c=n===`text`||n===`image`;return u(`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`]},u(`div`,{class:`${e}-upload-file-info`},a,u(`div`,{class:`${e}-upload-file-info__name`},c&&(r.url&&r.status!==`error`?u(`a`,{rel:`noopener noreferer`,target:`_blank`,href:r.url||void 0,onClick:this.handlePreviewClick},r.name):u(`span`,{onClick:this.handlePreviewClick},r.name)),o&&s),u(`div`,{class:[`${e}-upload-file-info__action`,`${e}-upload-file-info__action--${n}-type`]},this.showPreviewButton?u(Y,{key:`preview`,quaternary:!0,type:this.buttonType,onClick:this.handlePreviewClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:Gn},{icon:()=>u(J,{clsPrefix:e},{default:()=>u(Ne,null)})}):null,(this.showRemoveButton||this.showCancelButton)&&!this.disabled&&u(Y,{key:`cancelOrTrash`,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,quaternary:!0,builtinThemeOverrides:Gn,type:this.buttonType,onClick:this.handleRemoveOrCancelClick},{icon:()=>u(le,null,{default:()=>this.showRemoveButton?u(J,{clsPrefix:e,key:`trash`},{default:()=>u(Yt,null)}):u(J,{clsPrefix:e,key:`cancel`},{default:()=>u(Ut,null)})})}),this.showRetryButton&&!this.disabled&&u(Y,{key:`retry`,quaternary:!0,type:this.buttonType,onClick:this.handleRetryClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:Gn},{icon:()=>u(J,{clsPrefix:e},{default:()=>u(Kt,null)})}),this.showDownloadButton?u(Y,{key:`download`,quaternary:!0,type:this.buttonType,onClick:this.handleDownloadClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:Gn},{icon:()=>u(J,{clsPrefix:e},{default:()=>u(Wt,null)})}):null)),!o&&s)}}),qn=c({name:`UploadTrigger`,props:{abstract:Boolean},slots:Object,setup(e,{slots:t}){let n=a(Q,null);n||L(`upload-trigger`,"`n-upload-trigger` must be placed inside `n-upload`.");let{mergedClsPrefixRef:r,mergedDisabledRef:i,maxReachedRef:o,listTypeRef:s,dragOverRef:c,openOpenFileDialog:l,draggerInsideRef:d,handleFileAddition:f,mergedDirectoryDndRef:p,triggerClassRef:m,triggerStyleRef:h}=n,g=k(()=>s.value===`image-card`);function _(){i.value||o.value||l()}function v(e){e.preventDefault(),c.value=!0}function y(e){e.preventDefault(),c.value=!0}function b(e){e.preventDefault(),c.value=!1}function x(e){if(e.preventDefault(),!d.value||i.value||o.value){c.value=!1;return}let t=e.dataTransfer?.items;t?.length?Hn(Array.from(t).map(e=>e.webkitGetAsEntry()),p.value).then(e=>{f(e)}).finally(()=>{c.value=!1}):c.value=!1}return()=>{let{value:n}=r;return e.abstract?t.default?.call(t,{handleClick:_,handleDrop:x,handleDragOver:v,handleDragEnter:y,handleDragLeave:b}):u(`div`,{class:[`${n}-upload-trigger`,(i.value||o.value)&&`${n}-upload-trigger--disabled`,g.value&&`${n}-upload-trigger--image-card`,m.value],style:h.value,onClick:_,onDrop:x,onDragover:v,onDragenter:y,onDragleave:b},g.value?u(kn,null,{default:()=>re(t.default,()=>[u(J,{clsPrefix:n},{default:()=>u(Me,null)})])}):t)}}}),Jn=c({name:`UploadFileList`,setup(e,{slots:t}){let n=a(Q,null);n||L(`upload-file-list`,"`n-upload-file-list` must be placed inside `n-upload`.");let{abstractRef:r,mergedClsPrefixRef:i,listTypeRef:o,mergedFileListRef:s,fileListClassRef:c,fileListStyleRef:l,cssVarsRef:d,themeClassRef:f,maxReachedRef:p,showTriggerRef:m,imageGroupPropsRef:h}=n,g=k(()=>o.value===`image-card`),_=()=>s.value.map((e,t)=>u(Kn,{clsPrefix:i.value,key:e.id,file:e,index:t,listType:o.value})),v=()=>g.value?u(gn,Object.assign({},h.value),{default:_}):u(Ae,{group:!0},{default:_});return()=>{let{value:e}=i,{value:n}=r;return u(`div`,{class:[`${e}-upload-file-list`,g.value&&`${e}-upload-file-list--grid`,n?f?.value:void 0,c.value],style:[n&&d?d.value:``,l.value]},v(),m.value&&!p.value&&g.value&&u(qn,null,t))}}}),Yn=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 Xn(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=$(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=$(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 Zn(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=$(t.onFinish?.call(t,{file:e})||e),c(e)},onError(){let e=Object.assign({},n,{status:`error`,percentage:l});e=$(t.onError?.call(t,{file:e})||e),c(e)}})}function Qn(e,t,n){let r=Xn(e,t,n);n.onabort=r.handleXHRAbort,n.onerror=r.handleXHRError,n.onload=r.handleXHRLoad,n.upload&&(n.upload.onprogress=r.handleXHRProgress)}function $n(e,t){return typeof e==`function`?e({file:t}):e||{}}function er(e,t,n){let r=$n(t,n);r&&Object.keys(r).forEach(t=>{e.setRequestHeader(t,r[t])})}function tr(e,t,n){let r=$n(t,n);r&&Object.keys(r).forEach(t=>{e.append(t,r[t])})}function nr(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(tr(u,c,n),n.file!==null&&u.append(t,n.file),Qn(e,n,l),i!==void 0){l.open(r.toUpperCase(),i),er(l,s,n),l.send(u);let t=Object.assign({},n,{status:`uploading`});e.doChange(t)}}var rr=c({name:`Upload`,props:Object.assign(Object.assign({},z.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=>zn?Ln(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`&&L(`upload`,`when the list-type is image-card, abstract is not supported.`);let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=P(e),i=z(`Upload`,`-upload`,On,Le,e,t),a=ae(`Upload`,r,t),o=ne(e),s=T(e.defaultFileList),c=b(e,`fileList`),l=T(null),u={value:!1},d=T(!1),f=new Map,p=ve(c,s),m=k(()=>p.value.map($)),h=k(()=>{let{max:t}=e;return t===void 0?!1:m.value.length>=t});function g(){var e;(e=l.value)==null||e.click()}function _(e){let t=e.target;S(t.files?Array.from(t.files).map(e=>({file:e,entry:null,source:`input`})):null,e),t.value=``}function v(t){let{"onUpdate:fileList":n,onUpdateFileList:r}=e;n&&H(n,t),r&&H(r,t),s.value=t}let y=k(()=>e.multiple||e.directory),x=(t,n,r={append:!1,remove:!1})=>{let{append:i,remove:a}=r,o=Array.from(m.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}),v(o)}};function S(t,n){if(!t||t.length===0)return;let{onBeforeUpload:r}=e;t=y.value?t:[t[0]];let{max:i,accept:a}=e;t=t.filter(({file:e,source:t})=>t===`dnd`&&a?.trim()?Un(e.name,e.type,a):!0),i&&(t=t.slice(0,i-m.value.length));let o=G();Promise.all(t.map(e=>Yn(this,[e],void 0,function*({file:e,entry:t}){let n={id:G(),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:m.value}))!==!1?n:null}))).then(e=>Yn(this,void 0,void 0,function*(){let t=Promise.resolve();e.forEach(e=>{t=t.then(ee).then(()=>{e&&x(e,n,{append:!0})})}),yield t})).then(()=>{e.defaultUpload&&C()})}function C({fileId:t,retry:n=!1}={}){let{method:r,action:i,withCredentials:a,headers:o,data:s,name:c}=e,l=t===void 0?m.value:m.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?Zn({inst:{doChange:x,xhrMap:f,onFinish:e.onFinish,onError:e.onError},file:t,action:i,withCredentials:a,headers:o,data:s,customRequest:e.customRequest}):nr({doChange:x,xhrMap:f,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 w(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?Rn(t.file):``}let E=k(()=>{let{common:{cubicBezierEaseInOut:e},self:{draggerColor:t,draggerBorder:n,draggerBorderHover:r,itemColorHover:a,itemColorHoverError:o,itemTextColorError:s,itemTextColorSuccess:c,itemTextColor:l,itemIconColor:u,itemDisabledOpacity:d,lineHeight:f,borderRadius:p,fontSize:m,itemBorderImageCardError:h,itemBorderImageCard:g}}=i.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":a,"--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}}),D=n?pe(`upload`,void 0,E,e):void 0;O(Q,{mergedClsPrefixRef:t,mergedThemeRef:i,showCancelButtonRef:b(e,`showCancelButton`),showDownloadButtonRef:b(e,`showDownloadButton`),showRemoveButtonRef:b(e,`showRemoveButton`),showRetryButtonRef:b(e,`showRetryButton`),onRemoveRef:b(e,`onRemove`),onDownloadRef:b(e,`onDownload`),customDownloadRef:b(e,`customDownload`),mergedFileListRef:m,triggerClassRef:b(e,`triggerClass`),triggerStyleRef:b(e,`triggerStyle`),shouldUseThumbnailUrlRef:b(e,`shouldUseThumbnailUrl`),renderIconRef:b(e,`renderIcon`),xhrMap:f,submit:C,doChange:x,showPreviewButtonRef:b(e,`showPreviewButton`),onPreviewRef:b(e,`onPreview`),getFileThumbnailUrlResolver:w,listTypeRef:b(e,`listType`),dragOverRef:d,openOpenFileDialog:g,draggerInsideRef:u,handleFileAddition:S,mergedDisabledRef:o.mergedDisabledRef,maxReachedRef:h,fileListClassRef:b(e,`fileListClass`),fileListStyleRef:b(e,`fileListStyle`),abstractRef:b(e,`abstract`),acceptRef:b(e,`accept`),cssVarsRef:n?void 0:E,themeClassRef:D?.themeClass,onRender:D?.onRender,showTriggerRef:b(e,`showTrigger`),imageGroupPropsRef:b(e,`imageGroupProps`),mergedDirectoryDndRef:k(()=>e.directoryDnd??e.directory),onRetryRef:b(e,`onRetry`)});let A={clear:()=>{s.value=[]},submit:C,openOpenFileDialog:g};return Object.assign({mergedClsPrefix:t,draggerInsideRef:u,rtlEnabled:a,inputElRef:l,mergedTheme:i,dragOver:d,mergedMultiple:y,cssVars:n?void 0:E,themeClass:D?.themeClass,onRender:D?.onRender,handleFileInputChange:_},A)},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=u(`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?u(_,null,n.default?.call(n),u(A,{to:`body`},a)):(i?.(),u(`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`&&u(qn,null,n),this.showFileList&&u(Jn,null,n)))}}),ir={class:`card-header`},ar={class:`profile-name`},or={class:`card-body`},sr={class:`info-row`},cr={class:`info-label`},lr={class:`info-value mono`},ur={class:`info-row`},dr={class:`info-label`},fr={class:`info-value mono`},pr={class:`toggle-text`},mr={key:0,class:`card-detail`},hr={class:`info-row`},gr={class:`info-label`},_r={class:`info-value`},vr={class:`info-row`},yr={class:`info-label`},br={class:`info-value mono detail-path`},xr={class:`info-row`},Sr={class:`info-label`},Cr={class:`info-value`},wr={class:`info-row`},Tr={class:`info-label`},Er={class:`info-value`},Dr={class:`info-row`},Or={class:`info-label`},kr={class:`info-value`},Ar={class:`card-actions`},jr=M(c({__name:`ProfileCard`,props:{profile:{}},setup(i,{emit:a}){let o=i,{t:c}=j(),u=X(),d=He(),p=Ve(),m=T(!1),h=T(!1),v=T(!1),y=T(!1),b=T(null),x=k(()=>o.profile.name===`default`);async function S(){if(m.value){m.value=!1;return}m.value=!0,h.value=!0;try{b.value=await u.fetchProfileDetail(o.profile.name)}finally{h.value=!1}}async function D(){y.value=!0;try{await u.switchProfile(o.profile.name)?window.location.reload():d.error(c(`profiles.switchFailed`))}finally{y.value=!1}}function O(){p.warning({title:c(`profiles.delete`),content:c(`profiles.deleteConfirm`,{name:o.profile.name}),positiveText:c(`common.delete`),negativeText:c(`common.cancel`),onPositiveClick:async()=>{await u.deleteProfile(o.profile.name)?d.success(c(`profiles.deleteSuccess`)):d.error(c(`profiles.deleteFailed`))}})}async function A(){v.value=!0;try{await u.exportProfile(o.profile.name)?d.success(c(`profiles.exportSuccess`)):d.error(c(`profiles.exportFailed`))}finally{v.value=!1}}return(a,o)=>(s(),l(`div`,{class:C([`profile-card`,{active:i.profile.active}])},[f(`div`,ir,[f(`h3`,ar,g(i.profile.name),1),i.profile.active?(s(),r(E(Fe),{key:0,size:`tiny`,type:`success`,bordered:!1},{default:e(()=>[t(g(E(c)(`profiles.active`)),1)]),_:1})):n(``,!0)]),f(`div`,or,[f(`div`,sr,[f(`span`,cr,g(E(c)(`profiles.model`)),1),f(`code`,lr,g(i.profile.model),1)]),f(`div`,ur,[f(`span`,dr,g(E(c)(`profiles.gateway`)),1),f(`code`,fr,g(i.profile.gateway),1)])]),f(`div`,{class:`card-detail-toggle`,onClick:S},[(s(),l(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:C([`toggle-icon`,{expanded:m.value}])},[...o[0]||=[f(`polyline`,{points:`6 9 12 15 18 9`},null,-1)]],2)),f(`span`,pr,g(m.value?E(c)(`common.collapse`):E(c)(`common.expand`)),1)]),m.value?(s(),l(`div`,mr,[w(E(Ue),{show:h.value,size:`small`},{default:e(()=>[b.value?(s(),l(_,{key:0},[f(`div`,hr,[f(`span`,gr,g(E(c)(`profiles.provider`)),1),f(`span`,_r,g(b.value.provider),1)]),f(`div`,vr,[f(`span`,yr,g(E(c)(`profiles.path`)),1),f(`code`,br,g(b.value.path),1)]),f(`div`,xr,[f(`span`,Sr,g(E(c)(`profiles.skills`)),1),f(`span`,Cr,g(b.value.skills),1)]),f(`div`,wr,[f(`span`,Tr,g(E(c)(`profiles.hasEnv`)),1),f(`span`,Er,g(b.value.hasEnv?`Yes`:`No`),1)]),f(`div`,Dr,[f(`span`,Or,g(E(c)(`profiles.hasSoulMd`)),1),f(`span`,kr,g(b.value.hasSoulMd?`Yes`:`No`),1)])],64)):n(``,!0)]),_:1},8,[`show`])])):n(``,!0),f(`div`,Ar,[i.profile.active?n(``,!0):(s(),r(E(Y),{key:0,size:`tiny`,loading:y.value,quaternary:``,type:`primary`,onClick:D},{default:e(()=>[t(g(E(c)(`profiles.switchTo`)),1)]),_:1},8,[`loading`])),w(E(Y),{size:`tiny`,quaternary:``,type:`error`,disabled:x.value||i.profile.active,onClick:O},{default:e(()=>[t(g(E(c)(`common.delete`)),1)]),_:1},8,[`disabled`]),w(E(Y),{size:`tiny`,quaternary:``,loading:v.value,onClick:A},{default:e(()=>[t(g(E(c)(`profiles.export`)),1)]),_:1},8,[`loading`])])],2))}}),[[`__scopeId`,`data-v-ee1f1fe2`]]),Mr={key:0,class:`empty-state`},Nr={key:1,class:`profiles-grid`},Pr=M(c({__name:`ProfilesPanel`,emits:[`rename`],setup(e){let{t}=j(),n=X();return(e,i)=>E(n).profiles.length===0?(s(),l(`div`,Mr,[i[1]||=f(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,class:`empty-icon`},[f(`path`,{d:`M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2`}),f(`circle`,{cx:`12`,cy:`7`,r:`4`})],-1),f(`p`,null,g(E(t)(`profiles.noProfiles`)),1)])):(s(),l(`div`,Nr,[(s(!0),l(_,null,o(E(n).profiles,t=>(s(),r(jr,{key:t.name,profile:t,onRename:i[0]||=t=>e.$emit(`rename`,t)},null,8,[`profile`]))),128))]))}}),[[`__scopeId`,`data-v-51e73d5a`]]),Fr={class:`modal-footer`},Ir=M(c({__name:`ProfileCreateModal`,emits:[`close`,`saved`],setup(n,{emit:i}){let a=i,{t:o}=j(),c=X(),l=He(),u=T(!0),d=T(!1),p=T(``),m=T(!1);async function _(){if(!p.value.trim()){l.warning(o(`profiles.namePlaceholder`));return}d.value=!0;try{await c.createProfile(p.value.trim(),m.value)?(l.success(o(`profiles.createSuccess`,{name:p.value.trim()})),a(`saved`)):l.error(o(`profiles.createFailed`))}finally{d.value=!1}}function v(){u.value=!1,setTimeout(()=>a(`close`),200)}return(n,i)=>(s(),r(E(De),{show:u.value,"onUpdate:show":i[2]||=e=>u.value=e,preset:`card`,title:E(o)(`profiles.create`),style:{width:`min(420px, calc(100vw - 32px))`},"mask-closable":!d.value,onAfterLeave:i[3]||=e=>a(`close`)},{footer:e(()=>[f(`div`,Fr,[w(E(Y),{onClick:v},{default:e(()=>[t(g(E(o)(`common.cancel`)),1)]),_:1}),w(E(Y),{type:`primary`,loading:d.value,onClick:_},{default:e(()=>[t(g(E(o)(`common.create`)),1)]),_:1},8,[`loading`])])]),default:e(()=>[w(E(Oe),{"label-placement":`top`},{default:e(()=>[w(E(ke),{label:E(o)(`profiles.name`),required:``},{default:e(()=>[w(E(Pe),{value:p.value,placeholder:E(o)(`profiles.namePlaceholder`),onInput:i[0]||=e=>p.value=e.replace(/[^a-zA-Z0-9_-]/g,``),onKeyup:h(_,[`enter`])},null,8,[`value`,`placeholder`])]),_:1},8,[`label`]),w(E(ke),{label:E(o)(`profiles.cloneFromCurrent`)},{default:e(()=>[w(E(We),{value:m.value,"onUpdate:value":i[1]||=e=>m.value=e},null,8,[`value`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`show`,`title`,`mask-closable`]))}}),[[`__scopeId`,`data-v-fb1271ea`]]),Lr={class:`modal-footer`},Rr=M(c({__name:`ProfileRenameModal`,props:{profileName:{}},emits:[`close`,`saved`],setup(n,{emit:i}){let a=n,o=i,{t:c}=j(),l=X(),u=He(),d=T(!0),p=T(!1),m=T(``);async function _(){if(!m.value.trim()){u.warning(c(`profiles.newNamePlaceholder`));return}p.value=!0;try{await l.renameProfile(a.profileName,m.value.trim())?(u.success(c(`profiles.renameSuccess`)),o(`saved`)):u.error(c(`profiles.renameFailed`))}finally{p.value=!1}}function v(){d.value=!1,setTimeout(()=>o(`close`),200)}return(n,i)=>(s(),r(E(De),{show:d.value,"onUpdate:show":i[1]||=e=>d.value=e,preset:`card`,title:E(c)(`profiles.rename`),style:{width:`min(420px, calc(100vw - 32px))`},"mask-closable":!p.value,onAfterLeave:i[2]||=e=>o(`close`)},{footer:e(()=>[f(`div`,Lr,[w(E(Y),{onClick:v},{default:e(()=>[t(g(E(c)(`common.cancel`)),1)]),_:1}),w(E(Y),{type:`primary`,loading:p.value,onClick:_},{default:e(()=>[t(g(E(c)(`common.confirm`)),1)]),_:1},8,[`loading`])])]),default:e(()=>[w(E(Oe),{"label-placement":`top`},{default:e(()=>[w(E(ke),{label:E(c)(`profiles.newName`),required:``},{default:e(()=>[w(E(Pe),{value:m.value,"onUpdate:value":i[0]||=e=>m.value=e,placeholder:E(c)(`profiles.newNamePlaceholder`),onKeyup:h(_,[`enter`])},null,8,[`value`,`placeholder`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`show`,`title`,`mask-closable`]))}}),[[`__scopeId`,`data-v-e31a23a9`]]),zr={class:`modal-footer`},Br=M(c({__name:`ProfileImportModal`,emits:[`close`,`saved`],setup(n,{emit:i}){let a=i,{t:o}=j(),c=X(),l=He(),u=T(!0),d=T(!1),p=T([]),m=[`.tar.gz`,`.tgz`,`.gz`,`.zip`];function h({file:e}){let t=e.name?.toLowerCase()||``;return m.some(e=>t.endsWith(e))?!0:(l.warning(o(`profiles.importInvalidFile`)),!1)}async function _(){if(!p.value.length){l.warning(o(`profiles.importSelectFile`));return}d.value=!0;try{let e=p.value[0].file;if(!e){l.error(o(`profiles.importFailed`));return}await c.importProfile(e)?(l.success(o(`profiles.importSuccess`)),a(`saved`)):l.error(o(`profiles.importFailed`))}finally{d.value=!1}}function v(){u.value=!1,setTimeout(()=>a(`close`),200)}return(n,i)=>(s(),r(E(De),{show:u.value,"onUpdate:show":i[1]||=e=>u.value=e,preset:`card`,title:E(o)(`profiles.import`),style:{width:`min(420px, calc(100vw - 32px))`},"mask-closable":!d.value,onAfterLeave:i[2]||=e=>a(`close`)},{footer:e(()=>[f(`div`,zr,[w(E(Y),{onClick:v},{default:e(()=>[t(g(E(o)(`common.cancel`)),1)]),_:1}),w(E(Y),{type:`primary`,loading:d.value,disabled:!p.value.length,onClick:_},{default:e(()=>[t(g(E(o)(`common.confirm`)),1)]),_:1},8,[`loading`,`disabled`])])]),default:e(()=>[w(E(rr),{"file-list":p.value,"onUpdate:fileList":i[0]||=e=>p.value=e,max:1,accept:m.join(`,`),disabled:d.value,onBeforeUpload:h},{default:e(()=>[w(E(Y),null,{default:e(()=>[t(g(E(o)(`profiles.importSelectFile`)),1)]),_:1})]),_:1},8,[`file-list`,`accept`,`disabled`])]),_:1},8,[`show`,`title`,`mask-closable`]))}}),[[`__scopeId`,`data-v-accddacf`]]),Vr={class:`profiles-view`},Hr={class:`page-header`},Ur={class:`header-title`},Wr={class:`header-actions`},Gr={class:`profiles-content`},Kr=M(c({__name:`ProfilesView`,setup(i){let{t:a}=j(),o=X(),c=T(!1),u=T(!1),d=T(null);p(()=>{o.fetchProfiles()});function m(){c.value=!1}function h(){d.value=null}function _(){u.value=!1}return(i,p)=>(s(),l(`div`,Vr,[f(`header`,Hr,[f(`h2`,Ur,g(E(a)(`profiles.title`)),1),f(`div`,Wr,[w(E(Y),{size:`small`,onClick:p[0]||=e=>u.value=!0},{icon:e(()=>[...p[6]||=[f(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[f(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),f(`polyline`,{points:`17 8 12 3 7 8`}),f(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})],-1)]]),default:e(()=>[t(` `+g(E(a)(`profiles.import`)),1)]),_:1}),w(E(Y),{type:`primary`,size:`small`,onClick:p[1]||=e=>c.value=!0},{icon:e(()=>[...p[7]||=[f(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[f(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),f(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1)]]),default:e(()=>[t(` `+g(E(a)(`profiles.create`)),1)]),_:1})])]),f(`div`,Gr,[w(E(Ue),{show:E(o).loading&&E(o).profiles.length===0},{default:e(()=>[w(Pr,{onRename:p[2]||=e=>d.value=e})]),_:1},8,[`show`])]),c.value?(s(),r(Ir,{key:0,onClose:p[3]||=e=>c.value=!1,onSaved:m})):n(``,!0),d.value?(s(),r(Rr,{key:1,"profile-name":d.value,onClose:p[4]||=e=>d.value=null,onSaved:h},null,8,[`profile-name`])):n(``,!0),u.value?(s(),r(Br,{key:2,onClose:p[5]||=e=>u.value=!1,onSaved:_})):n(``,!0)]))}}),[[`__scopeId`,`data-v-fcdc8d6b`]]);export{Kr as default};
|