dudu-converter-cli 1.0.16 → 1.0.17
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.
|
@@ -27,6 +27,6 @@ var Sl=Object.defineProperty;var xl=(e,t,s)=>t in e?Sl(e,t,{enumerable:!0,config
|
|
|
27
27
|
* vue-router v4.6.4
|
|
28
28
|
* (c) 2025 Eduardo San Martin Morote
|
|
29
29
|
* @license MIT
|
|
30
|
-
*/let Vu=()=>location.protocol+"//"+location.host;function gl(e,t){const{pathname:s,search:n,hash:o}=t,i=e.indexOf("#");if(i>-1){let r=o.includes(e.slice(i))?e.slice(i).length:1,l=o.slice(r);return l[0]!=="/"&&(l="/"+l),_i(l,"")}return _i(s,e)+n+o}function Lu(e,t,s,n){let o=[],i=[],r=null;const l=({state:m})=>{const S=gl(e,location),F=s.value,M=t.value;let W=0;if(m){if(s.value=S,t.value=m,r&&r===F){r=null;return}W=M?m.position-M.position:0}else n(S);o.forEach(N=>{N(s.value,F,{delta:W,type:lo.pop,direction:W?W>0?zn.forward:zn.back:zn.unknown})})};function a(){r=s.value}function d(m){o.push(m);const S=()=>{const F=o.indexOf(m);F>-1&&o.splice(F,1)};return i.push(S),S}function u(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(ue({},m.state,{scroll:Cn()}),"")}}function p(){for(const m of i)m();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:a,listen:d,destroy:p}}function ki(e,t,s,n=!1,o=!1){return{back:e,current:t,forward:s,replaced:n,position:window.history.length,scroll:o?Cn():null}}function Hu(e){const{history:t,location:s}=window,n={value:gl(e,s)},o={value:t.state};o.value||i(n.value,{back:null,current:n.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(a,d,u){const p=e.indexOf("#"),m=p>-1?(s.host&&document.querySelector("base")?e:e.slice(p))+a:Vu()+e+a;try{t[u?"replaceState":"pushState"](d,"",m),o.value=d}catch(S){console.error(S),s[u?"replace":"assign"](m)}}function r(a,d){i(a,ue({},t.state,ki(o.value.back,a,o.value.forward,!0),d,{position:o.value.position}),!0),n.value=a}function l(a,d){const u=ue({},o.value,t.state,{forward:a,scroll:Cn()});i(u.current,u,!0),i(a,ue({},ki(n.value,a,null),{position:u.position+1},d),!1),n.value=a}return{location:n,state:o,push:l,replace:r}}function ju(e){e=ku(e);const t=Hu(e),s=Lu(e,t.state,t.location,t.replace);function n(i,r=!0){r||s.pauseListeners(),history.go(i)}const o=ue({location:"",base:e,go:n,createHref:Eu.bind(null,e)},t,s);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function Uu(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),ju(e)}let Zt=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Te=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Te||{});const Bu={type:Zt.Static,value:""},zu=/[a-zA-Z0-9_]/;function Ku(e){if(!e)return[[]];if(e==="/")return[[Bu]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(S){throw new Error(`ERR (${s})/"${d}": ${S}`)}let s=Te.Static,n=s;const o=[];let i;function r(){i&&o.push(i),i=[]}let l=0,a,d="",u="";function p(){d&&(s===Te.Static?i.push({type:Zt.Static,value:d}):s===Te.Param||s===Te.ParamRegExp||s===Te.ParamRegExpEnd?(i.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Zt.Param,value:d,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),d="")}function m(){d+=a}for(;l<e.length;){if(a=e[l++],a==="\\"&&s!==Te.ParamRegExp){n=s,s=Te.EscapeNext;continue}switch(s){case Te.Static:a==="/"?(d&&p(),r()):a===":"?(p(),s=Te.Param):m();break;case Te.EscapeNext:m(),s=n;break;case Te.Param:a==="("?s=Te.ParamRegExp:zu.test(a)?m():(p(),s=Te.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case Te.ParamRegExp:a===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+a:s=Te.ParamRegExpEnd:u+=a;break;case Te.ParamRegExpEnd:p(),s=Te.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--,u="";break;default:t("Unknown state");break}}return s===Te.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),p(),r(),o}const Ci="[^/]+?",Wu={sensitive:!1,strict:!1,start:!0,end:!0};var De=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(De||{});const Gu=/[.+*?^${}()[\]/\\]/g;function qu(e,t){const s=ue({},Wu,t),n=[];let o=s.start?"^":"";const i=[];for(const d of e){const u=d.length?[]:[De.Root];s.strict&&!d.length&&(o+="/");for(let p=0;p<d.length;p++){const m=d[p];let S=De.Segment+(s.sensitive?De.BonusCaseSensitive:0);if(m.type===Zt.Static)p||(o+="/"),o+=m.value.replace(Gu,"\\$&"),S+=De.Static;else if(m.type===Zt.Param){const{value:F,repeatable:M,optional:W,regexp:N}=m;i.push({name:F,repeatable:M,optional:W});const P=N||Ci;if(P!==Ci){S+=De.BonusCustomRegExp;try{`${P}`}catch(V){throw new Error(`Invalid custom RegExp for param "${F}" (${P}): `+V.message)}}let D=M?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;p||(D=W&&d.length<2?`(?:/${D})`:"/"+D),W&&(D+="?"),o+=D,S+=De.Dynamic,W&&(S+=De.BonusOptional),M&&(S+=De.BonusRepeatable),P===".*"&&(S+=De.BonusWildcard)}u.push(S)}n.push(u)}if(s.strict&&s.end){const d=n.length-1;n[d][n[d].length-1]+=De.BonusStrict}s.strict||(o+="/?"),s.end?o+="$":s.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const r=new RegExp(o,s.sensitive?"":"i");function l(d){const u=d.match(r),p={};if(!u)return null;for(let m=1;m<u.length;m++){const S=u[m]||"",F=i[m-1];p[F.name]=S&&F.repeatable?S.split("/"):S}return p}function a(d){let u="",p=!1;for(const m of e){(!p||!u.endsWith("/"))&&(u+="/"),p=!1;for(const S of m)if(S.type===Zt.Static)u+=S.value;else if(S.type===Zt.Param){const{value:F,repeatable:M,optional:W}=S,N=F in d?d[F]:"";if(ft(N)&&!M)throw new Error(`Provided param "${F}" is an array but it is not repeatable (* or + modifiers)`);const P=ft(N)?N.join("/"):N;if(!P)if(W)m.length<2&&(u.endsWith("/")?u=u.slice(0,-1):p=!0);else throw new Error(`Missing required param "${F}"`);u+=P}}return u||"/"}return{re:r,score:n,keys:i,parse:l,stringify:a}}function Ju(e,t){let s=0;for(;s<e.length&&s<t.length;){const n=t[s]-e[s];if(n)return n;s++}return e.length<t.length?e.length===1&&e[0]===De.Static+De.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===De.Static+De.Segment?1:-1:0}function ml(e,t){let s=0;const n=e.score,o=t.score;for(;s<n.length&&s<o.length;){const i=Ju(n[s],o[s]);if(i)return i;s++}if(Math.abs(o.length-n.length)===1){if(Ei(n))return 1;if(Ei(o))return-1}return o.length-n.length}function Ei(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Yu={strict:!1,end:!0,sensitive:!1};function Qu(e,t,s){const n=qu(Ku(e.path),s),o=ue(n,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function Xu(e,t){const s=[],n=new Map;t=yi(Yu,t);function o(p){return n.get(p)}function i(p,m,S){const F=!S,M=Ri(p);M.aliasOf=S&&S.record;const W=yi(t,p),N=[M];if("alias"in p){const V=typeof p.alias=="string"?[p.alias]:p.alias;for(const K of V)N.push(Ri(ue({},M,{components:S?S.record.components:M.components,path:K,aliasOf:S?S.record:M})))}let P,D;for(const V of N){const{path:K}=V;if(m&&K[0]!=="/"){const q=m.record.path,H=q[q.length-1]==="/"?"":"/";V.path=m.record.path+(K&&H+K)}if(P=Qu(V,m,W),S?S.alias.push(P):(D=D||P,D!==P&&D.alias.push(P),F&&p.name&&!Ti(P)&&r(p.name)),vl(P)&&a(P),M.children){const q=M.children;for(let H=0;H<q.length;H++)i(q[H],P,S&&S.children[H])}S=S||P}return D?()=>{r(D)}:Rs}function r(p){if(dl(p)){const m=n.get(p);m&&(n.delete(p),s.splice(s.indexOf(m),1),m.children.forEach(r),m.alias.forEach(r))}else{const m=s.indexOf(p);m>-1&&(s.splice(m,1),p.record.name&&n.delete(p.record.name),p.children.forEach(r),p.alias.forEach(r))}}function l(){return s}function a(p){const m=tf(p,s);s.splice(m,0,p),p.record.name&&!Ti(p)&&n.set(p.record.name,p)}function d(p,m){let S,F={},M,W;if("name"in p&&p.name){if(S=n.get(p.name),!S)throw hs(we.MATCHER_NOT_FOUND,{location:p});W=S.record.name,F=ue(Ai(m.params,S.keys.filter(D=>!D.optional).concat(S.parent?S.parent.keys.filter(D=>D.optional):[]).map(D=>D.name)),p.params&&Ai(p.params,S.keys.map(D=>D.name))),M=S.stringify(F)}else if(p.path!=null)M=p.path,S=s.find(D=>D.re.test(M)),S&&(F=S.parse(M),W=S.record.name);else{if(S=m.name?n.get(m.name):s.find(D=>D.re.test(m.path)),!S)throw hs(we.MATCHER_NOT_FOUND,{location:p,currentLocation:m});W=S.record.name,F=ue({},m.params,p.params),M=S.stringify(F)}const N=[];let P=S;for(;P;)N.unshift(P.record),P=P.parent;return{name:W,path:M,params:F,matched:N,meta:ef(N)}}e.forEach(p=>i(p));function u(){s.length=0,n.clear()}return{addRoute:i,resolve:d,removeRoute:r,clearRoutes:u,getRoutes:l,getRecordMatcher:o}}function Ai(e,t){const s={};for(const n of t)n in e&&(s[n]=e[n]);return s}function Ri(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Zu(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Zu(e){const t={},s=e.props||!1;if("component"in e)t.default=s;else for(const n in e.components)t[n]=typeof s=="object"?s[n]:s;return t}function Ti(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function ef(e){return e.reduce((t,s)=>ue(t,s.meta),{})}function tf(e,t){let s=0,n=t.length;for(;s!==n;){const i=s+n>>1;ml(e,t[i])<0?n=i:s=i+1}const o=sf(e);return o&&(n=t.lastIndexOf(o,n-1)),n}function sf(e){let t=e;for(;t=t.parent;)if(vl(t)&&ml(e,t)===0)return t}function vl({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Oi(e){const t=rt(En),s=rt(pl),n=re(()=>{const a=y(e.to);return t.resolve(a)}),o=re(()=>{const{matched:a}=n.value,{length:d}=a,u=a[d-1],p=s.matched;if(!u||!p.length)return-1;const m=p.findIndex(ds.bind(null,u));if(m>-1)return m;const S=Pi(a[d-2]);return d>1&&Pi(u)===S&&p[p.length-1].path!==S?p.findIndex(ds.bind(null,a[d-2])):m}),i=re(()=>o.value>-1&&lf(s.params,n.value.params)),r=re(()=>o.value>-1&&o.value===s.matched.length-1&&fl(s.params,n.value.params));function l(a={}){if(rf(a)){const d=t[y(e.replace)?"replace":"push"](y(e.to)).catch(Rs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:n,href:re(()=>n.value.href),isActive:i,isExactActive:r,navigate:l}}function nf(e){return e.length===1?e[0]:e}const of=Le({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Oi,setup(e,{slots:t}){const s=ns(Oi(e)),{options:n}=rt(En),o=re(()=>({[Ii(e.activeClass,n.linkActiveClass,"router-link-active")]:s.isActive,[Ii(e.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:s.isExactActive}));return()=>{const i=t.default&&nf(t.default(s));return e.custom?i:Xr("a",{"aria-current":s.isExactActive?e.ariaCurrentValue:null,href:s.href,onClick:s.navigate,class:o.value},i)}}}),Qt=of;function rf(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function lf(e,t){for(const s in t){const n=t[s],o=e[s];if(typeof n=="string"){if(n!==o)return!1}else if(!ft(o)||o.length!==n.length||n.some((i,r)=>i.valueOf()!==o[r].valueOf()))return!1}return!0}function Pi(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ii=(e,t,s)=>e??t??s,af=Le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:s}){const n=rt(co),o=re(()=>e.route||n.value),i=rt(xi,0),r=re(()=>{let d=y(i);const{matched:u}=o.value;let p;for(;(p=u[d])&&!p.components;)d++;return d}),l=re(()=>o.value.matched[r.value]);Js(xi,re(()=>r.value+1)),Js(Du,l),Js(co,o);const a=ne();return $t(()=>[a.value,l.value,e.name],([d,u,p],[m,S,F])=>{u&&(u.instances[p]=d,S&&S!==u&&d&&d===m&&(u.leaveGuards.size||(u.leaveGuards=S.leaveGuards),u.updateGuards.size||(u.updateGuards=S.updateGuards))),d&&u&&(!S||!ds(u,S)||!m)&&(u.enterCallbacks[p]||[]).forEach(M=>M(d))},{flush:"post"}),()=>{const d=o.value,u=e.name,p=l.value,m=p&&p.components[u];if(!m)return $i(s.default,{Component:m,route:d});const S=p.props[u],F=S?S===!0?d.params:typeof S=="function"?S(d):S:null,W=Xr(m,ue({},F,t,{onVnodeUnmounted:N=>{N.component.isUnmounted&&(p.instances[u]=null)},ref:a}));return $i(s.default,{Component:W,route:d})||W}}});function $i(e,t){if(!e)return null;const s=e(t);return s.length===1?s[0]:s}const yl=af;function cf(e){const t=Xu(e.routes,e),s=e.parseQuery||Mu,n=e.stringifyQuery||Si,o=e.history,i=ys(),r=ys(),l=ys(),a=ea(Ft);let d=Ft;cs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Un.bind(null,A=>""+A),p=Un.bind(null,vu),m=Un.bind(null,Ds);function S(A,U){let L,Y;return dl(A)?(L=t.getRecordMatcher(A),Y=U):Y=A,t.addRoute(Y,L)}function F(A){const U=t.getRecordMatcher(A);U&&t.removeRoute(U)}function M(){return t.getRoutes().map(A=>A.record)}function W(A){return!!t.getRecordMatcher(A)}function N(A,U){if(U=ue({},U||a.value),typeof A=="string"){const k=Bn(s,A,U.path),C=t.resolve({path:k.path},U),T=o.createHref(k.fullPath);return ue(k,C,{params:m(C.params),hash:Ds(k.hash),redirectedFrom:void 0,href:T})}let L;if(A.path!=null)L=ue({},A,{path:Bn(s,A.path,U.path).path});else{const k=ue({},A.params);for(const C in k)k[C]==null&&delete k[C];L=ue({},A,{params:p(k)}),U.params=p(U.params)}const Y=t.resolve(L,U),f=A.hash||"";Y.params=u(m(Y.params));const g=bu(n,ue({},A,{hash:pu(f),path:Y.path})),b=o.createHref(g);return ue({fullPath:g,hash:f,query:n===Si?Nu(A.query):A.query||{}},Y,{redirectedFrom:void 0,href:b})}function P(A){return typeof A=="string"?Bn(s,A,a.value.path):ue({},A)}function D(A,U){if(d!==A)return hs(we.NAVIGATION_CANCELLED,{from:U,to:A})}function V(A){return H(A)}function K(A){return V(ue(P(A),{replace:!0}))}function q(A,U){const L=A.matched[A.matched.length-1];if(L&&L.redirect){const{redirect:Y}=L;let f=typeof Y=="function"?Y(A,U):Y;return typeof f=="string"&&(f=f.includes("?")||f.includes("#")?f=P(f):{path:f},f.params={}),ue({query:A.query,hash:A.hash,params:f.path!=null?{}:A.params},f)}}function H(A,U){const L=d=N(A),Y=a.value,f=A.state,g=A.force,b=A.replace===!0,k=q(L,Y);if(k)return H(ue(P(k),{state:typeof k=="object"?ue({},f,k.state):f,force:g,replace:b}),U||L);const C=L;C.redirectedFrom=U;let T;return!g&&wu(n,Y,L)&&(T=hs(we.NAVIGATION_DUPLICATED,{to:C,from:Y}),Ye(Y,Y,!0,!1)),(T?Promise.resolve(T):de(C,Y)).catch($=>Et($)?Et($,we.NAVIGATION_GUARD_REDIRECT)?$:tt($):le($,C,Y)).then($=>{if($){if(Et($,we.NAVIGATION_GUARD_REDIRECT))return H(ue({replace:b},P($.to),{state:typeof $.to=="object"?ue({},f,$.to.state):f,force:g}),U||C)}else $=me(C,Y,!0,b,f);return be(C,Y,$),$})}function Z(A,U){const L=D(A,U);return L?Promise.reject(L):Promise.resolve()}function J(A){const U=Ue.values().next().value;return U&&typeof U.runWithContext=="function"?U.runWithContext(A):A()}function de(A,U){let L;const[Y,f,g]=Fu(A,U);L=Kn(Y.reverse(),"beforeRouteLeave",A,U);for(const k of Y)k.leaveGuards.forEach(C=>{L.push(Ht(C,A,U))});const b=Z.bind(null,A,U);return L.push(b),He(L).then(()=>{L=[];for(const k of i.list())L.push(Ht(k,A,U));return L.push(b),He(L)}).then(()=>{L=Kn(f,"beforeRouteUpdate",A,U);for(const k of f)k.updateGuards.forEach(C=>{L.push(Ht(C,A,U))});return L.push(b),He(L)}).then(()=>{L=[];for(const k of g)if(k.beforeEnter)if(ft(k.beforeEnter))for(const C of k.beforeEnter)L.push(Ht(C,A,U));else L.push(Ht(k.beforeEnter,A,U));return L.push(b),He(L)}).then(()=>(A.matched.forEach(k=>k.enterCallbacks={}),L=Kn(g,"beforeRouteEnter",A,U,J),L.push(b),He(L))).then(()=>{L=[];for(const k of r.list())L.push(Ht(k,A,U));return L.push(b),He(L)}).catch(k=>Et(k,we.NAVIGATION_CANCELLED)?k:Promise.reject(k))}function be(A,U,L){l.list().forEach(Y=>J(()=>Y(A,U,L)))}function me(A,U,L,Y,f){const g=D(A,U);if(g)return g;const b=U===Ft,k=cs?history.state:{};L&&(Y||b?o.replace(A.fullPath,ue({scroll:b&&k&&k.scroll},f)):o.push(A.fullPath,f)),a.value=A,Ye(A,U,L,b),tt()}let Ae;function Ge(){Ae||(Ae=o.listen((A,U,L)=>{if(!st.listening)return;const Y=N(A),f=q(Y,st.currentRoute.value);if(f){H(ue(f,{replace:!0,force:!0}),Y).catch(Rs);return}d=Y;const g=a.value;cs&&Tu(wi(g.fullPath,L.delta),Cn()),de(Y,g).catch(b=>Et(b,we.NAVIGATION_ABORTED|we.NAVIGATION_CANCELLED)?b:Et(b,we.NAVIGATION_GUARD_REDIRECT)?(H(ue(P(b.to),{force:!0}),Y).then(k=>{Et(k,we.NAVIGATION_ABORTED|we.NAVIGATION_DUPLICATED)&&!L.delta&&L.type===lo.pop&&o.go(-1,!1)}).catch(Rs),Promise.reject()):(L.delta&&o.go(-L.delta,!1),le(b,Y,g))).then(b=>{b=b||me(Y,g,!1),b&&(L.delta&&!Et(b,we.NAVIGATION_CANCELLED)?o.go(-L.delta,!1):L.type===lo.pop&&Et(b,we.NAVIGATION_ABORTED|we.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),be(Y,g,b)}).catch(Rs)}))}let qe=ys(),ve=ys(),te;function le(A,U,L){tt(A);const Y=ve.list();return Y.length?Y.forEach(f=>f(A,U,L)):console.error(A),Promise.reject(A)}function Je(){return te&&a.value!==Ft?Promise.resolve():new Promise((A,U)=>{qe.add([A,U])})}function tt(A){return te||(te=!A,Ge(),qe.list().forEach(([U,L])=>A?L(A):U()),qe.reset()),A}function Ye(A,U,L,Y){const{scrollBehavior:f}=e;if(!cs||!f)return Promise.resolve();const g=!L&&Ou(wi(A.fullPath,0))||(Y||!L)&&history.state&&history.state.scroll||null;return ps().then(()=>f(A,U,g)).then(b=>b&&Ru(b)).catch(b=>le(b,A,U))}const Pe=A=>o.go(A);let Dt;const Ue=new Set,st={currentRoute:a,listening:!0,addRoute:S,removeRoute:F,clearRoutes:t.clearRoutes,hasRoute:W,getRoutes:M,resolve:N,options:e,push:V,replace:K,go:Pe,back:()=>Pe(-1),forward:()=>Pe(1),beforeEach:i.add,beforeResolve:r.add,afterEach:l.add,onError:ve.add,isReady:Je,install(A){A.component("RouterLink",Qt),A.component("RouterView",yl),A.config.globalProperties.$router=st,Object.defineProperty(A.config.globalProperties,"$route",{enumerable:!0,get:()=>y(a)}),cs&&!Dt&&a.value===Ft&&(Dt=!0,V(o.location).catch(Y=>{}));const U={};for(const Y in Ft)Object.defineProperty(U,Y,{get:()=>a.value[Y],enumerable:!0});A.provide(En,st),A.provide(pl,hr(U)),A.provide(co,a);const L=A.unmount;Ue.add(A),A.unmount=function(){Ue.delete(A),Ue.size<1&&(d=Ft,Ae&&Ae(),Ae=null,a.value=Ft,Dt=!1,te=!1),L()}}};function He(A){return A.reduce((U,L)=>U.then(()=>J(L)),Promise.resolve())}return st}function uf(){return rt(En)}class ff{constructor(t=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`){Wt(this,"socket");Wt(this,"attempts",0);Wt(this,"timer");Wt(this,"handlers",new Set);Wt(this,"stateHandlers",new Set);Wt(this,"reconnectAfterResync");this.url=t}onMessage(t){return this.handlers.add(t),()=>this.handlers.delete(t)}onConnectionChange(t){return this.stateHandlers.add(t),()=>this.stateHandlers.delete(t)}onResync(t){this.reconnectAfterResync=()=>void t()}connect(){var s;clearTimeout(this.timer),(s=this.socket)==null||s.close();const t=new WebSocket(this.url);this.socket=t,t.onopen=()=>{var n;this.attempts=0,this.stateHandlers.forEach(o=>o(!0)),(n=this.reconnectAfterResync)==null||n.call(this)},t.onmessage=n=>{try{const o=JSON.parse(n.data);this.handlers.forEach(i=>i(o))}catch{}},t.onclose=()=>{this.stateHandlers.forEach(o=>o(!1)),this.attempts+=1;const n=Math.min(15e3,1e3*2**(this.attempts-1));this.timer=window.setTimeout(()=>this.connect(),n)},t.onerror=()=>t.close()}}let Mi;function Ro(){return Mi??(Mi=new ff),Mi}class To extends Error{constructor(t,s,n,o){super(n),this.status=t,this.code=s,this.details=o,this.name="ApiError"}}async function Re(e,t){const s=await fetch(e,{...t,headers:{"content-type":"application/json",...(t==null?void 0:t.headers)??{}}}),n=await s.json().catch(()=>({code:"INVALID_RESPONSE",message:"响应不是合法 JSON"}));if(!s.ok){const o=n;throw new To(s.status,o.code??"UNKNOWN_ERROR",o.message??"请求失败",o.details)}return n}async function Ni(e){const t=new URLSearchParams({filename:e.name}),s=await fetch(`/api/uploads?${t}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:e}),n=await s.json().catch(()=>({code:"INVALID_RESPONSE",message:"上传响应不是合法 JSON"}));if(!s.ok){const o=n;throw new To(s.status,o.code??"UNKNOWN_ERROR",o.message??"文件上传失败",o.details)}return n}const Se={doctor:()=>Re("/api/doctor"),recheckDoctor:()=>Re("/api/doctor/recheck",{method:"POST"}),install:e=>Re(`/api/doctor/install/${e}`,{method:"POST"}),uninstall:e=>Re(`/api/doctor/uninstall/${e}`,{method:"POST"}),features:()=>Re("/api/features"),tasks:()=>Re("/api/tasks"),revealTask:e=>Re(`/api/tasks/${e}/reveal`,{method:"POST"}),revealPath:e=>Re("/api/reveal",{method:"POST",body:JSON.stringify({path:e})}),wxStatus:()=>Re("/api/wx/status"),version:()=>Re("/api/version"),wxActivate:e=>Re("/api/wx/activate",{method:"POST",body:JSON.stringify({token:e})}),deleteHistory:e=>Re(`/api/history/${e}`,{method:"DELETE"}),clearHistory:()=>Re("/api/history/clear",{method:"POST"}),serviceStop:()=>Re("/api/service/stop",{method:"POST"}),settings:()=>Re("/api/settings"),selectOutputDir:()=>Re("/api/settings/select-output-dir",{method:"POST"}),openPrivacySettings:()=>Re("/api/settings/open-privacy-settings",{method:"POST"}),saveSettings:e=>Re("/api/settings",{method:"POST",body:JSON.stringify(e)}),convert:e=>Re("/api/convert",{method:"POST",body:JSON.stringify(e)})},Oo=Hs("doctor",{state:()=>({statuses:[],loading:!1,connected:!0,error:"",installSession:{state:"idle",logs:[]}}),getters:{readyCount:e=>e.statuses.filter(t=>t.installed&&t.versionOk).length,usableFeatures:e=>e.statuses.reduce((t,s)=>t+s.features.length,0)},actions:{async load(){this.loading=!0;try{this.statuses=await Se.doctor(),this.error=""}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.loading=!1}},async recheck(){this.loading=!0;try{this.statuses=await Se.recheckDoctor(),this.error=""}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.loading=!1}},startInstall(e,t){this.startOperation(e,t,"install")},startUninstall(e,t){this.startOperation(e,t,"uninstall")},startOperation(e,t,s){if(this.installSession.state==="progress")throw new To(409,"OPERATION_IN_PROGRESS","已有依赖操作进行中");this.installSession={depId:e,state:"progress",logs:[t]},(s==="install"?Se.install(e):Se.uninstall(e)).catch(n=>{this.installSession={depId:e,state:"failed",logs:[t,`操作未启动:${n.message}`],error:{depId:e,exitCode:1,stderrTail:n.message}}})},applyProgress(e){this.installSession.depId===e.depId&&("line"in e&&this.installSession.logs.push(e.line),this.installSession.logs.length>1e3&&this.installSession.logs.shift())},applyDone(e){this.statuses=e,this.installSession.state="done"},applyFailure(e){if(this.installSession.depId&&this.installSession.depId!==e.depId)return;const t=e.stderrTail.split(/\r?\n/).filter(s=>s.trim());this.installSession={depId:e.depId,state:"failed",logs:[`操作失败(退出码 ${e.exitCode})`,...t],error:e}}}}),Po=Hs("features",{state:()=>({features:[],loading:!1,error:""}),getters:{available:e=>e.features.filter(t=>t.available),byKey:e=>new Map(e.features.map(t=>[t.key,t]))},actions:{async load(){this.loading=!0;try{this.features=await Se.features(),this.error=""}finally{this.loading=!1}}}}),Io=Hs("tasks",{state:()=>({tasks:[],loading:!1,error:""}),getters:{active:e=>e.tasks.filter(t=>t.status==="queued"||t.status==="running"),history:e=>e.tasks.filter(t=>t.status==="success"||t.status==="failed").slice(0,200)},actions:{async load(){this.loading=!0;try{this.tasks=await Se.tasks(),this.error=""}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.loading=!1}},upsert(e){const t=this.tasks.findIndex(s=>s.taskId===e.taskId);t<0?this.tasks.unshift(e):this.tasks[t]=e}}}),_l=Hs("settings",{state:()=>({settings:{autostart:!1,outputDir:"",concurrency:2,language:"zh-CN"},form:{autostart:!1,outputDir:"",concurrency:2,language:"zh-CN"},loading:!1,saving:!1,error:""}),actions:{async load(){this.loading=!0;try{this.settings=await Se.settings(),this.form={...this.settings},this.error=""}finally{this.loading=!1}},async save(){const e={...this.form};this.saving=!0;try{this.settings=await Se.saveSettings(this.form),this.form={...this.settings},this.error=""}catch(t){throw this.form=e,this.error=t instanceof Error?t.message:String(t),t}finally{this.saving=!1}}}}),df=3456,uo=`http://127.0.0.1:${df}`,hf="https://duduer.com";function js(){return location.hostname==="127.0.0.1"||location.hostname==="localhost"}function An(){return/Windows|Win32|Win64/i.test(navigator.userAgent)?"windows":"macos"}async function pf(e=1500){const t=new AbortController,s=setTimeout(()=>t.abort(),e);try{return await fetch(`${uo}/api/doctor`,{mode:"no-cors",cache:"no-store",signal:t.signal}),!0}catch{return!1}finally{clearTimeout(s)}}function gf(){return js()?hf:location.origin}function $o(e){const t=gf();return e==="macos"?`curl -fsSL ${t}/install.sh | sh`:`$w=New-Object Net.WebClient;$w.Encoding=[Text.Encoding]::UTF8;iex $w.DownloadString('${t}/install.ps1')`}function mf(){const e=Oo(),t=Po(),s=Io(),n=_l(),o=Ro();async function i(){await Promise.all([e.load(),t.load(),s.load()])}async function r(){await t.load()}function l(a){a.type==="doctor:status"?(e.statuses=a.data,r()):a.type==="task:update"?s.upsert(a.data):a.type==="install:start"||a.type==="install:progress"||a.type==="uninstall:start"||a.type==="uninstall:progress"?e.applyProgress(a.data):a.type==="install:done"||a.type==="uninstall:done"?(e.applyDone(a.data.status),r()):(a.type==="install:fail"||a.type==="uninstall:fail")&&e.applyFailure(a.data)}os(async()=>{js()&&(o.onMessage(l),o.onConnectionChange(a=>{e.connected=a}),o.onResync(i),o.connect(),await Promise.all([i(),n.load()]))}),bn(()=>{})}const x={appName:"嘟嘟转换器",nav:{home:"首页",workbench:"功能页",history:"转换历史",settings:"设置"},connection:{connected:"已连接本地服务",disconnected:"连接已断开,正在自动重连"},doctor:{title:"依赖与环境",recheck:"重新检测",install:"一键安装",uninstall:"一键卸载",copy:"复制命令",manual:"手动下载",logs:"操作日志",ready:"可用",outdated:"版本过旧",missingRequired:"必需缺失",missingOptional:"可选缺失",portableInstall:"内置直装(国内镜像下载,无需包管理器)",portableUninstall:"删除本地便携版组件",sessionRunning:"执行中,请耐心等待…",sessionRunningFull:"正在安装,请耐心等待完成(可能需要几分钟)——期间请不要关闭或刷新此页面;日志长时间无输出属正常现象(正在后台下载)",sessionDone:"✅ 操作完成",sessionFailed:"❌ 操作失败,详情见下方日志"},workbench:{title:"转换工作台",subtitle:"按类型分栏管理,文件入表后逐个或批量转换",dropTitle:"把{tab}文件拖到这里",dropHint:"支持 {exts} 等格式",dropCompact:"继续添加{tab}文件",pastePlaceholder:"粘贴文件绝对路径,回车添加",wrongTab:"{name} 不属于{tab},请切换到对应标签页添加",fileDuplicate:"已在列表中,无需重复添加",addFile:"选择文件",addPath:"添加",convertTo:"批量转换为",noCommonTargets:"当前文件没有共同的转换目标,请清理后分批转换",noTools:"该类别依赖的工具尚未安装,转换前需要先完成安装",gotoSettings:"去设置页安装依赖",tableFile:"文件名",tablePath:"路径",tableSize:"大小",tableStatus:"状态",tableActions:"操作",statusPending:"待转换",statusRunning:"转换中",statusSuccess:"转换成功",statusFailed:"转换失败",convert:"转换",retry:"重试",openFolder:"打开目录",download:"下载",remove:"移除",clearDone:"清除已完成",batchConvert:"开始批量转换",batchConvertN:"开始批量转换({n} 个)",batchDone:"本次批量转换已完成",paramsTitle:"高级参数",advanced:"高级设置",chooseFile:"选择文件"},history:{title:"转换历史",subtitle:"所有转换任务按时间倒序排列,可随时下载或打开产物",filterAll:"全部",statTotal:"累计任务",statSuccess:"成功",statFailed:"失败",searchPlaceholder:"搜索文件名…",empty:"还没有转换记录,去工作台开始第一次转换吧",today:"今天",yesterday:"昨天",openFolder:"打开目录",download:"下载",remove:"删除",clear:"清空历史"},landing:{heroBadge:"本地转换 · 零上传 · 不限文件大小",heroTitle:"你的文件,",heroAccent:"不必上传",heroTagline:"嘟嘟本地万能转换器:视频、音频、图片、文档在本机一步完成 —— 没有大小限制,没有隐私顾虑,没有漫长等待。",cta:"立即开始转换",ctaInstall:"查看安装指南",localRunning:"转换器已在本机运行,可直接进入功能页",stats:[{value:"23",label:"转换能力"},{value:"40+",label:"支持格式"},{value:"0",label:"文件上传"},{value:"100%",label:"本机运行"}],painTitle:"你是不是也有这些顾虑?",painSub:"嘟嘟把这些通通变成过去。",pains:[{icon:"shield",title:"文件传上去,心里不踏实",text:"合同、证件、家庭影像……一旦上传到陌生服务器,隐私就不再由你掌控。"},{icon:"globe",title:"在线工具处处受限",text:"大小限制、格式缺失、会员付费、广告弹窗,简单转个文件总要妥协。"},{icon:"clock",title:"传上去再下载,来回折腾",text:"大文件先上传一小时,转换完再下载一小时,网速决定了心情。"}],valueTitle:"换一种方式转换文件",valueSub:"本机运行带来的三个直接好处",values:[{icon:"shield-check",title:"文件不出你的电脑",text:"所有解析与转换都在本机完成,不经任何服务器,隐私天然无忧。"},{icon:"package-plus",title:"缺什么,一键装什么",text:"首次使用自动体检环境,FFmpeg 等引擎在页面里点一下即可安装。"},{icon:"zap",title:"装完即用,秒级开始",text:"一条命令安装,浏览器自动打开操作界面,拖入文件立刻出结果。"}],scenesTitle:"这些瞬间,嘟嘟都帮得上忙",scenesSub:"来自日常使用的高频场景",scenes:[{icon:"video",title:"网课录屏瘦身",text:"几个 G 的课程录像压成几百 MB,备份分享都不再犯难"},{icon:"image",title:"聊天图片压缩",text:"手机原图一张 8MB,压完不到 1MB,清晰度几乎不变"},{icon:"pdf",title:"发票合并归档",text:"几十张发票 PDF 按顺序合并成一个文件,报销不再手忙脚乱"},{icon:"sparkles",title:"表情包制作",text:"精彩片段一键做成 GIF 动图,斗图弹药永远充足"},{icon:"markdown",title:"简历笔记定稿",text:"Markdown 写完一键转 Word / PDF,排版不乱直接发"},{icon:"shield",title:"证件照脱敏外发",text:"身份证扫描件加水印或加密,发给陌生方也更安心"}],featuresTitle:"覆盖你日常的每一类文件",featuresSub:"22 类能力 · 40+ 种格式,全部本机完成",compareTitle:"和在线转换工具比一比",compareSub:"同样的转换,不同的体验",compare:[{item:"文件隐私",online:"上传到陌生服务器",local:"全程留在你的电脑里"},{item:"文件大小",online:"免费版普遍限制 100MB",local:"无任何限制"},{item:"转换速度",online:"上传 + 下载双倍耗时",local:"直接读写本地磁盘"},{item:"批量处理",online:"多数按次收费",local:"免费,支持批量队列"},{item:"网络依赖",online:"必须联网上传",local:"断网也能正常转换"}],faqTitle:"常见问题",faqSub:"关于嘟嘟的几个高频疑问",faq:[{q:"我的文件会被上传吗?",a:"不会。嘟嘟完全运行在你自己的电脑上,转换过程不经过任何服务器,即使断网也能正常转换。"},{q:"需要付费吗?",a:"免费使用:无功能限制、无水印、无次数限制,也不需要注册账号。"},{q:"转换用的引擎需要自己装吗?",a:"不用自己找教程。首次使用某类能力时,应用会自动检测缺失的引擎,在「设置 → 依赖与环境」里点一下即可安装,全程图形化操作。"},{q:"支持 Windows 吗?",a:"支持。macOS 12+ 与 Windows 10/11 均可使用,安装命令在首页首屏即可一键复制。"},{q:"大文件会很慢或卡住吗?",a:"转换在本地队列并发执行(1–4 个可调),大文件只是耗时更长,不会占用云端额度,也不影响电脑其他操作。"}],footer:"嘟嘟转换器 · 本地优先的文件转换工具 · 文件永不上传"},install:{title:"安装转换器",step1:"打开终端",step2:"粘贴以下命令并回车",step3:"等待安装完成,浏览器会自动打开转换器",macos:"macOS",windows:"Windows",copy:"复制",copied:"已复制",macosTerminal:"按 ⌘+空格 打开聚焦搜索,输入「终端」或「Terminal」,回车打开",windowsTerminal:"点击开始菜单,输入「PowerShell」,回车打开",alreadyInstalled:"已经安装过?再次执行此命令会自动升级到新版本",manualTitle:"自动安装失败?手动安装",manualSteps:[{title:"安装 Node.js",text:"打开 nodejs.org 下载 Node.js 18 或更高版本,双击安装(保持默认选项)"},{title:"安装嘟嘟转换器",text:"打开终端(macOS:终端;Windows:PowerShell),执行 npm install -g dudu-converter-cli"},{title:"启动服务",text:"执行 converter start,浏览器访问 http://127.0.0.1:3456"}],startHint:"如果已经安装但未运行:在终端执行 converter start 启动后,回到此页重新检测"},gate:{checking:"正在检测本地转换器…",online:"已检测到本地转换器正在运行",open:"打开本地转换器",offline:"未检测到本地转换器",installedTitle:"转换器已安装,但服务未运行",manualTitle:"手动启动(一行命令)",manualHint:"复制命令 → 打开终端粘贴回车;若已开启开机自启,重启电脑也会自动运行",retry:"重新检测",notInstalledTitle:"尚未安装?查看安装步骤"},settings:{title:"设置",preferences:"应用设置",autostart:"开机自动启动",outputDir:"输出目录",chooseDir:"选择文件夹",concurrency:"并发数",language:"界面语言",save:"保存设置",saved:"设置已保存",service:"服务管理",serviceRunning:"转换服务运行中",stopService:"停止服务",stopConfirm:`确定停止转换服务吗?
|
|
30
|
+
*/let Vu=()=>location.protocol+"//"+location.host;function gl(e,t){const{pathname:s,search:n,hash:o}=t,i=e.indexOf("#");if(i>-1){let r=o.includes(e.slice(i))?e.slice(i).length:1,l=o.slice(r);return l[0]!=="/"&&(l="/"+l),_i(l,"")}return _i(s,e)+n+o}function Lu(e,t,s,n){let o=[],i=[],r=null;const l=({state:m})=>{const S=gl(e,location),F=s.value,M=t.value;let W=0;if(m){if(s.value=S,t.value=m,r&&r===F){r=null;return}W=M?m.position-M.position:0}else n(S);o.forEach(N=>{N(s.value,F,{delta:W,type:lo.pop,direction:W?W>0?zn.forward:zn.back:zn.unknown})})};function a(){r=s.value}function d(m){o.push(m);const S=()=>{const F=o.indexOf(m);F>-1&&o.splice(F,1)};return i.push(S),S}function u(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(ue({},m.state,{scroll:Cn()}),"")}}function p(){for(const m of i)m();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:a,listen:d,destroy:p}}function ki(e,t,s,n=!1,o=!1){return{back:e,current:t,forward:s,replaced:n,position:window.history.length,scroll:o?Cn():null}}function Hu(e){const{history:t,location:s}=window,n={value:gl(e,s)},o={value:t.state};o.value||i(n.value,{back:null,current:n.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(a,d,u){const p=e.indexOf("#"),m=p>-1?(s.host&&document.querySelector("base")?e:e.slice(p))+a:Vu()+e+a;try{t[u?"replaceState":"pushState"](d,"",m),o.value=d}catch(S){console.error(S),s[u?"replace":"assign"](m)}}function r(a,d){i(a,ue({},t.state,ki(o.value.back,a,o.value.forward,!0),d,{position:o.value.position}),!0),n.value=a}function l(a,d){const u=ue({},o.value,t.state,{forward:a,scroll:Cn()});i(u.current,u,!0),i(a,ue({},ki(n.value,a,null),{position:u.position+1},d),!1),n.value=a}return{location:n,state:o,push:l,replace:r}}function ju(e){e=ku(e);const t=Hu(e),s=Lu(e,t.state,t.location,t.replace);function n(i,r=!0){r||s.pauseListeners(),history.go(i)}const o=ue({location:"",base:e,go:n,createHref:Eu.bind(null,e)},t,s);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function Uu(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),ju(e)}let Zt=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Te=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Te||{});const Bu={type:Zt.Static,value:""},zu=/[a-zA-Z0-9_]/;function Ku(e){if(!e)return[[]];if(e==="/")return[[Bu]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(S){throw new Error(`ERR (${s})/"${d}": ${S}`)}let s=Te.Static,n=s;const o=[];let i;function r(){i&&o.push(i),i=[]}let l=0,a,d="",u="";function p(){d&&(s===Te.Static?i.push({type:Zt.Static,value:d}):s===Te.Param||s===Te.ParamRegExp||s===Te.ParamRegExpEnd?(i.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Zt.Param,value:d,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),d="")}function m(){d+=a}for(;l<e.length;){if(a=e[l++],a==="\\"&&s!==Te.ParamRegExp){n=s,s=Te.EscapeNext;continue}switch(s){case Te.Static:a==="/"?(d&&p(),r()):a===":"?(p(),s=Te.Param):m();break;case Te.EscapeNext:m(),s=n;break;case Te.Param:a==="("?s=Te.ParamRegExp:zu.test(a)?m():(p(),s=Te.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case Te.ParamRegExp:a===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+a:s=Te.ParamRegExpEnd:u+=a;break;case Te.ParamRegExpEnd:p(),s=Te.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--,u="";break;default:t("Unknown state");break}}return s===Te.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),p(),r(),o}const Ci="[^/]+?",Wu={sensitive:!1,strict:!1,start:!0,end:!0};var De=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(De||{});const Gu=/[.+*?^${}()[\]/\\]/g;function qu(e,t){const s=ue({},Wu,t),n=[];let o=s.start?"^":"";const i=[];for(const d of e){const u=d.length?[]:[De.Root];s.strict&&!d.length&&(o+="/");for(let p=0;p<d.length;p++){const m=d[p];let S=De.Segment+(s.sensitive?De.BonusCaseSensitive:0);if(m.type===Zt.Static)p||(o+="/"),o+=m.value.replace(Gu,"\\$&"),S+=De.Static;else if(m.type===Zt.Param){const{value:F,repeatable:M,optional:W,regexp:N}=m;i.push({name:F,repeatable:M,optional:W});const P=N||Ci;if(P!==Ci){S+=De.BonusCustomRegExp;try{`${P}`}catch(V){throw new Error(`Invalid custom RegExp for param "${F}" (${P}): `+V.message)}}let D=M?`((?:${P})(?:/(?:${P}))*)`:`(${P})`;p||(D=W&&d.length<2?`(?:/${D})`:"/"+D),W&&(D+="?"),o+=D,S+=De.Dynamic,W&&(S+=De.BonusOptional),M&&(S+=De.BonusRepeatable),P===".*"&&(S+=De.BonusWildcard)}u.push(S)}n.push(u)}if(s.strict&&s.end){const d=n.length-1;n[d][n[d].length-1]+=De.BonusStrict}s.strict||(o+="/?"),s.end?o+="$":s.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const r=new RegExp(o,s.sensitive?"":"i");function l(d){const u=d.match(r),p={};if(!u)return null;for(let m=1;m<u.length;m++){const S=u[m]||"",F=i[m-1];p[F.name]=S&&F.repeatable?S.split("/"):S}return p}function a(d){let u="",p=!1;for(const m of e){(!p||!u.endsWith("/"))&&(u+="/"),p=!1;for(const S of m)if(S.type===Zt.Static)u+=S.value;else if(S.type===Zt.Param){const{value:F,repeatable:M,optional:W}=S,N=F in d?d[F]:"";if(ft(N)&&!M)throw new Error(`Provided param "${F}" is an array but it is not repeatable (* or + modifiers)`);const P=ft(N)?N.join("/"):N;if(!P)if(W)m.length<2&&(u.endsWith("/")?u=u.slice(0,-1):p=!0);else throw new Error(`Missing required param "${F}"`);u+=P}}return u||"/"}return{re:r,score:n,keys:i,parse:l,stringify:a}}function Ju(e,t){let s=0;for(;s<e.length&&s<t.length;){const n=t[s]-e[s];if(n)return n;s++}return e.length<t.length?e.length===1&&e[0]===De.Static+De.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===De.Static+De.Segment?1:-1:0}function ml(e,t){let s=0;const n=e.score,o=t.score;for(;s<n.length&&s<o.length;){const i=Ju(n[s],o[s]);if(i)return i;s++}if(Math.abs(o.length-n.length)===1){if(Ei(n))return 1;if(Ei(o))return-1}return o.length-n.length}function Ei(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Yu={strict:!1,end:!0,sensitive:!1};function Qu(e,t,s){const n=qu(Ku(e.path),s),o=ue(n,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function Xu(e,t){const s=[],n=new Map;t=yi(Yu,t);function o(p){return n.get(p)}function i(p,m,S){const F=!S,M=Ri(p);M.aliasOf=S&&S.record;const W=yi(t,p),N=[M];if("alias"in p){const V=typeof p.alias=="string"?[p.alias]:p.alias;for(const K of V)N.push(Ri(ue({},M,{components:S?S.record.components:M.components,path:K,aliasOf:S?S.record:M})))}let P,D;for(const V of N){const{path:K}=V;if(m&&K[0]!=="/"){const q=m.record.path,H=q[q.length-1]==="/"?"":"/";V.path=m.record.path+(K&&H+K)}if(P=Qu(V,m,W),S?S.alias.push(P):(D=D||P,D!==P&&D.alias.push(P),F&&p.name&&!Ti(P)&&r(p.name)),vl(P)&&a(P),M.children){const q=M.children;for(let H=0;H<q.length;H++)i(q[H],P,S&&S.children[H])}S=S||P}return D?()=>{r(D)}:Rs}function r(p){if(dl(p)){const m=n.get(p);m&&(n.delete(p),s.splice(s.indexOf(m),1),m.children.forEach(r),m.alias.forEach(r))}else{const m=s.indexOf(p);m>-1&&(s.splice(m,1),p.record.name&&n.delete(p.record.name),p.children.forEach(r),p.alias.forEach(r))}}function l(){return s}function a(p){const m=tf(p,s);s.splice(m,0,p),p.record.name&&!Ti(p)&&n.set(p.record.name,p)}function d(p,m){let S,F={},M,W;if("name"in p&&p.name){if(S=n.get(p.name),!S)throw hs(we.MATCHER_NOT_FOUND,{location:p});W=S.record.name,F=ue(Ai(m.params,S.keys.filter(D=>!D.optional).concat(S.parent?S.parent.keys.filter(D=>D.optional):[]).map(D=>D.name)),p.params&&Ai(p.params,S.keys.map(D=>D.name))),M=S.stringify(F)}else if(p.path!=null)M=p.path,S=s.find(D=>D.re.test(M)),S&&(F=S.parse(M),W=S.record.name);else{if(S=m.name?n.get(m.name):s.find(D=>D.re.test(m.path)),!S)throw hs(we.MATCHER_NOT_FOUND,{location:p,currentLocation:m});W=S.record.name,F=ue({},m.params,p.params),M=S.stringify(F)}const N=[];let P=S;for(;P;)N.unshift(P.record),P=P.parent;return{name:W,path:M,params:F,matched:N,meta:ef(N)}}e.forEach(p=>i(p));function u(){s.length=0,n.clear()}return{addRoute:i,resolve:d,removeRoute:r,clearRoutes:u,getRoutes:l,getRecordMatcher:o}}function Ai(e,t){const s={};for(const n of t)n in e&&(s[n]=e[n]);return s}function Ri(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Zu(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Zu(e){const t={},s=e.props||!1;if("component"in e)t.default=s;else for(const n in e.components)t[n]=typeof s=="object"?s[n]:s;return t}function Ti(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function ef(e){return e.reduce((t,s)=>ue(t,s.meta),{})}function tf(e,t){let s=0,n=t.length;for(;s!==n;){const i=s+n>>1;ml(e,t[i])<0?n=i:s=i+1}const o=sf(e);return o&&(n=t.lastIndexOf(o,n-1)),n}function sf(e){let t=e;for(;t=t.parent;)if(vl(t)&&ml(e,t)===0)return t}function vl({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Oi(e){const t=rt(En),s=rt(pl),n=re(()=>{const a=y(e.to);return t.resolve(a)}),o=re(()=>{const{matched:a}=n.value,{length:d}=a,u=a[d-1],p=s.matched;if(!u||!p.length)return-1;const m=p.findIndex(ds.bind(null,u));if(m>-1)return m;const S=Pi(a[d-2]);return d>1&&Pi(u)===S&&p[p.length-1].path!==S?p.findIndex(ds.bind(null,a[d-2])):m}),i=re(()=>o.value>-1&&lf(s.params,n.value.params)),r=re(()=>o.value>-1&&o.value===s.matched.length-1&&fl(s.params,n.value.params));function l(a={}){if(rf(a)){const d=t[y(e.replace)?"replace":"push"](y(e.to)).catch(Rs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:n,href:re(()=>n.value.href),isActive:i,isExactActive:r,navigate:l}}function nf(e){return e.length===1?e[0]:e}const of=Le({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Oi,setup(e,{slots:t}){const s=ns(Oi(e)),{options:n}=rt(En),o=re(()=>({[Ii(e.activeClass,n.linkActiveClass,"router-link-active")]:s.isActive,[Ii(e.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:s.isExactActive}));return()=>{const i=t.default&&nf(t.default(s));return e.custom?i:Xr("a",{"aria-current":s.isExactActive?e.ariaCurrentValue:null,href:s.href,onClick:s.navigate,class:o.value},i)}}}),Qt=of;function rf(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function lf(e,t){for(const s in t){const n=t[s],o=e[s];if(typeof n=="string"){if(n!==o)return!1}else if(!ft(o)||o.length!==n.length||n.some((i,r)=>i.valueOf()!==o[r].valueOf()))return!1}return!0}function Pi(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ii=(e,t,s)=>e??t??s,af=Le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:s}){const n=rt(co),o=re(()=>e.route||n.value),i=rt(xi,0),r=re(()=>{let d=y(i);const{matched:u}=o.value;let p;for(;(p=u[d])&&!p.components;)d++;return d}),l=re(()=>o.value.matched[r.value]);Js(xi,re(()=>r.value+1)),Js(Du,l),Js(co,o);const a=ne();return $t(()=>[a.value,l.value,e.name],([d,u,p],[m,S,F])=>{u&&(u.instances[p]=d,S&&S!==u&&d&&d===m&&(u.leaveGuards.size||(u.leaveGuards=S.leaveGuards),u.updateGuards.size||(u.updateGuards=S.updateGuards))),d&&u&&(!S||!ds(u,S)||!m)&&(u.enterCallbacks[p]||[]).forEach(M=>M(d))},{flush:"post"}),()=>{const d=o.value,u=e.name,p=l.value,m=p&&p.components[u];if(!m)return $i(s.default,{Component:m,route:d});const S=p.props[u],F=S?S===!0?d.params:typeof S=="function"?S(d):S:null,W=Xr(m,ue({},F,t,{onVnodeUnmounted:N=>{N.component.isUnmounted&&(p.instances[u]=null)},ref:a}));return $i(s.default,{Component:W,route:d})||W}}});function $i(e,t){if(!e)return null;const s=e(t);return s.length===1?s[0]:s}const yl=af;function cf(e){const t=Xu(e.routes,e),s=e.parseQuery||Mu,n=e.stringifyQuery||Si,o=e.history,i=ys(),r=ys(),l=ys(),a=ea(Ft);let d=Ft;cs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Un.bind(null,A=>""+A),p=Un.bind(null,vu),m=Un.bind(null,Ds);function S(A,U){let L,Y;return dl(A)?(L=t.getRecordMatcher(A),Y=U):Y=A,t.addRoute(Y,L)}function F(A){const U=t.getRecordMatcher(A);U&&t.removeRoute(U)}function M(){return t.getRoutes().map(A=>A.record)}function W(A){return!!t.getRecordMatcher(A)}function N(A,U){if(U=ue({},U||a.value),typeof A=="string"){const k=Bn(s,A,U.path),C=t.resolve({path:k.path},U),T=o.createHref(k.fullPath);return ue(k,C,{params:m(C.params),hash:Ds(k.hash),redirectedFrom:void 0,href:T})}let L;if(A.path!=null)L=ue({},A,{path:Bn(s,A.path,U.path).path});else{const k=ue({},A.params);for(const C in k)k[C]==null&&delete k[C];L=ue({},A,{params:p(k)}),U.params=p(U.params)}const Y=t.resolve(L,U),f=A.hash||"";Y.params=u(m(Y.params));const g=bu(n,ue({},A,{hash:pu(f),path:Y.path})),b=o.createHref(g);return ue({fullPath:g,hash:f,query:n===Si?Nu(A.query):A.query||{}},Y,{redirectedFrom:void 0,href:b})}function P(A){return typeof A=="string"?Bn(s,A,a.value.path):ue({},A)}function D(A,U){if(d!==A)return hs(we.NAVIGATION_CANCELLED,{from:U,to:A})}function V(A){return H(A)}function K(A){return V(ue(P(A),{replace:!0}))}function q(A,U){const L=A.matched[A.matched.length-1];if(L&&L.redirect){const{redirect:Y}=L;let f=typeof Y=="function"?Y(A,U):Y;return typeof f=="string"&&(f=f.includes("?")||f.includes("#")?f=P(f):{path:f},f.params={}),ue({query:A.query,hash:A.hash,params:f.path!=null?{}:A.params},f)}}function H(A,U){const L=d=N(A),Y=a.value,f=A.state,g=A.force,b=A.replace===!0,k=q(L,Y);if(k)return H(ue(P(k),{state:typeof k=="object"?ue({},f,k.state):f,force:g,replace:b}),U||L);const C=L;C.redirectedFrom=U;let T;return!g&&wu(n,Y,L)&&(T=hs(we.NAVIGATION_DUPLICATED,{to:C,from:Y}),Ye(Y,Y,!0,!1)),(T?Promise.resolve(T):de(C,Y)).catch($=>Et($)?Et($,we.NAVIGATION_GUARD_REDIRECT)?$:tt($):le($,C,Y)).then($=>{if($){if(Et($,we.NAVIGATION_GUARD_REDIRECT))return H(ue({replace:b},P($.to),{state:typeof $.to=="object"?ue({},f,$.to.state):f,force:g}),U||C)}else $=me(C,Y,!0,b,f);return be(C,Y,$),$})}function Z(A,U){const L=D(A,U);return L?Promise.reject(L):Promise.resolve()}function J(A){const U=Ue.values().next().value;return U&&typeof U.runWithContext=="function"?U.runWithContext(A):A()}function de(A,U){let L;const[Y,f,g]=Fu(A,U);L=Kn(Y.reverse(),"beforeRouteLeave",A,U);for(const k of Y)k.leaveGuards.forEach(C=>{L.push(Ht(C,A,U))});const b=Z.bind(null,A,U);return L.push(b),He(L).then(()=>{L=[];for(const k of i.list())L.push(Ht(k,A,U));return L.push(b),He(L)}).then(()=>{L=Kn(f,"beforeRouteUpdate",A,U);for(const k of f)k.updateGuards.forEach(C=>{L.push(Ht(C,A,U))});return L.push(b),He(L)}).then(()=>{L=[];for(const k of g)if(k.beforeEnter)if(ft(k.beforeEnter))for(const C of k.beforeEnter)L.push(Ht(C,A,U));else L.push(Ht(k.beforeEnter,A,U));return L.push(b),He(L)}).then(()=>(A.matched.forEach(k=>k.enterCallbacks={}),L=Kn(g,"beforeRouteEnter",A,U,J),L.push(b),He(L))).then(()=>{L=[];for(const k of r.list())L.push(Ht(k,A,U));return L.push(b),He(L)}).catch(k=>Et(k,we.NAVIGATION_CANCELLED)?k:Promise.reject(k))}function be(A,U,L){l.list().forEach(Y=>J(()=>Y(A,U,L)))}function me(A,U,L,Y,f){const g=D(A,U);if(g)return g;const b=U===Ft,k=cs?history.state:{};L&&(Y||b?o.replace(A.fullPath,ue({scroll:b&&k&&k.scroll},f)):o.push(A.fullPath,f)),a.value=A,Ye(A,U,L,b),tt()}let Ae;function Ge(){Ae||(Ae=o.listen((A,U,L)=>{if(!st.listening)return;const Y=N(A),f=q(Y,st.currentRoute.value);if(f){H(ue(f,{replace:!0,force:!0}),Y).catch(Rs);return}d=Y;const g=a.value;cs&&Tu(wi(g.fullPath,L.delta),Cn()),de(Y,g).catch(b=>Et(b,we.NAVIGATION_ABORTED|we.NAVIGATION_CANCELLED)?b:Et(b,we.NAVIGATION_GUARD_REDIRECT)?(H(ue(P(b.to),{force:!0}),Y).then(k=>{Et(k,we.NAVIGATION_ABORTED|we.NAVIGATION_DUPLICATED)&&!L.delta&&L.type===lo.pop&&o.go(-1,!1)}).catch(Rs),Promise.reject()):(L.delta&&o.go(-L.delta,!1),le(b,Y,g))).then(b=>{b=b||me(Y,g,!1),b&&(L.delta&&!Et(b,we.NAVIGATION_CANCELLED)?o.go(-L.delta,!1):L.type===lo.pop&&Et(b,we.NAVIGATION_ABORTED|we.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),be(Y,g,b)}).catch(Rs)}))}let qe=ys(),ve=ys(),te;function le(A,U,L){tt(A);const Y=ve.list();return Y.length?Y.forEach(f=>f(A,U,L)):console.error(A),Promise.reject(A)}function Je(){return te&&a.value!==Ft?Promise.resolve():new Promise((A,U)=>{qe.add([A,U])})}function tt(A){return te||(te=!A,Ge(),qe.list().forEach(([U,L])=>A?L(A):U()),qe.reset()),A}function Ye(A,U,L,Y){const{scrollBehavior:f}=e;if(!cs||!f)return Promise.resolve();const g=!L&&Ou(wi(A.fullPath,0))||(Y||!L)&&history.state&&history.state.scroll||null;return ps().then(()=>f(A,U,g)).then(b=>b&&Ru(b)).catch(b=>le(b,A,U))}const Pe=A=>o.go(A);let Dt;const Ue=new Set,st={currentRoute:a,listening:!0,addRoute:S,removeRoute:F,clearRoutes:t.clearRoutes,hasRoute:W,getRoutes:M,resolve:N,options:e,push:V,replace:K,go:Pe,back:()=>Pe(-1),forward:()=>Pe(1),beforeEach:i.add,beforeResolve:r.add,afterEach:l.add,onError:ve.add,isReady:Je,install(A){A.component("RouterLink",Qt),A.component("RouterView",yl),A.config.globalProperties.$router=st,Object.defineProperty(A.config.globalProperties,"$route",{enumerable:!0,get:()=>y(a)}),cs&&!Dt&&a.value===Ft&&(Dt=!0,V(o.location).catch(Y=>{}));const U={};for(const Y in Ft)Object.defineProperty(U,Y,{get:()=>a.value[Y],enumerable:!0});A.provide(En,st),A.provide(pl,hr(U)),A.provide(co,a);const L=A.unmount;Ue.add(A),A.unmount=function(){Ue.delete(A),Ue.size<1&&(d=Ft,Ae&&Ae(),Ae=null,a.value=Ft,Dt=!1,te=!1),L()}}};function He(A){return A.reduce((U,L)=>U.then(()=>J(L)),Promise.resolve())}return st}function uf(){return rt(En)}class ff{constructor(t=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`){Wt(this,"socket");Wt(this,"attempts",0);Wt(this,"timer");Wt(this,"handlers",new Set);Wt(this,"stateHandlers",new Set);Wt(this,"reconnectAfterResync");this.url=t}onMessage(t){return this.handlers.add(t),()=>this.handlers.delete(t)}onConnectionChange(t){return this.stateHandlers.add(t),()=>this.stateHandlers.delete(t)}onResync(t){this.reconnectAfterResync=()=>void t()}connect(){var s;clearTimeout(this.timer),(s=this.socket)==null||s.close();const t=new WebSocket(this.url);this.socket=t,t.onopen=()=>{var n;this.attempts=0,this.stateHandlers.forEach(o=>o(!0)),(n=this.reconnectAfterResync)==null||n.call(this)},t.onmessage=n=>{try{const o=JSON.parse(n.data);this.handlers.forEach(i=>i(o))}catch{}},t.onclose=()=>{this.stateHandlers.forEach(o=>o(!1)),this.attempts+=1;const n=Math.min(15e3,1e3*2**(this.attempts-1));this.timer=window.setTimeout(()=>this.connect(),n)},t.onerror=()=>t.close()}}let Mi;function Ro(){return Mi??(Mi=new ff),Mi}class To extends Error{constructor(t,s,n,o){super(n),this.status=t,this.code=s,this.details=o,this.name="ApiError"}}async function Re(e,t){const s=await fetch(e,{...t,headers:{"content-type":"application/json",...(t==null?void 0:t.headers)??{}}}),n=await s.json().catch(()=>({code:"INVALID_RESPONSE",message:"响应不是合法 JSON"}));if(!s.ok){const o=n;throw new To(s.status,o.code??"UNKNOWN_ERROR",o.message??"请求失败",o.details)}return n}async function Ni(e){const t=new URLSearchParams({filename:e.name}),s=await fetch(`/api/uploads?${t}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:e}),n=await s.json().catch(()=>({code:"INVALID_RESPONSE",message:"上传响应不是合法 JSON"}));if(!s.ok){const o=n;throw new To(s.status,o.code??"UNKNOWN_ERROR",o.message??"文件上传失败",o.details)}return n}const Se={doctor:()=>Re("/api/doctor"),recheckDoctor:()=>Re("/api/doctor/recheck",{method:"POST"}),install:e=>Re(`/api/doctor/install/${e}`,{method:"POST"}),uninstall:e=>Re(`/api/doctor/uninstall/${e}`,{method:"POST"}),features:()=>Re("/api/features"),tasks:()=>Re("/api/tasks"),revealTask:e=>Re(`/api/tasks/${e}/reveal`,{method:"POST"}),revealPath:e=>Re("/api/reveal",{method:"POST",body:JSON.stringify({path:e})}),wxStatus:()=>Re("/api/wx/status"),version:()=>Re("/api/version"),wxActivate:e=>Re("/api/wx/activate",{method:"POST",body:JSON.stringify({token:e})}),deleteHistory:e=>Re(`/api/history/${e}`,{method:"DELETE"}),clearHistory:()=>Re("/api/history/clear",{method:"POST"}),serviceStop:()=>Re("/api/service/stop",{method:"POST"}),settings:()=>Re("/api/settings"),selectOutputDir:()=>Re("/api/settings/select-output-dir",{method:"POST"}),openPrivacySettings:()=>Re("/api/settings/open-privacy-settings",{method:"POST"}),saveSettings:e=>Re("/api/settings",{method:"POST",body:JSON.stringify(e)}),convert:e=>Re("/api/convert",{method:"POST",body:JSON.stringify(e)})},Oo=Hs("doctor",{state:()=>({statuses:[],loading:!1,connected:!0,error:"",installSession:{state:"idle",logs:[]}}),getters:{readyCount:e=>e.statuses.filter(t=>t.installed&&t.versionOk).length,usableFeatures:e=>e.statuses.reduce((t,s)=>t+s.features.length,0)},actions:{async load(){this.loading=!0;try{this.statuses=await Se.doctor(),this.error=""}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.loading=!1}},async recheck(){this.loading=!0;try{this.statuses=await Se.recheckDoctor(),this.error=""}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.loading=!1}},startInstall(e,t){this.startOperation(e,t,"install")},startUninstall(e,t){this.startOperation(e,t,"uninstall")},startOperation(e,t,s){if(this.installSession.state==="progress")throw new To(409,"OPERATION_IN_PROGRESS","已有依赖操作进行中");this.installSession={depId:e,state:"progress",logs:[t]},(s==="install"?Se.install(e):Se.uninstall(e)).catch(n=>{this.installSession={depId:e,state:"failed",logs:[t,`操作未启动:${n.message}`],error:{depId:e,exitCode:1,stderrTail:n.message}}})},applyProgress(e){this.installSession.depId===e.depId&&("line"in e&&this.installSession.logs.push(e.line),this.installSession.logs.length>1e3&&this.installSession.logs.shift())},applyDone(e){this.statuses=e,this.installSession.state="done"},applyFailure(e){if(this.installSession.depId&&this.installSession.depId!==e.depId)return;const t=e.stderrTail.split(/\r?\n/).filter(s=>s.trim());this.installSession={depId:e.depId,state:"failed",logs:[`操作失败(退出码 ${e.exitCode})`,...t],error:e}}}}),Po=Hs("features",{state:()=>({features:[],loading:!1,error:""}),getters:{available:e=>e.features.filter(t=>t.available),byKey:e=>new Map(e.features.map(t=>[t.key,t]))},actions:{async load(){this.loading=!0;try{this.features=await Se.features(),this.error=""}finally{this.loading=!1}}}}),Io=Hs("tasks",{state:()=>({tasks:[],loading:!1,error:""}),getters:{active:e=>e.tasks.filter(t=>t.status==="queued"||t.status==="running"),history:e=>e.tasks.filter(t=>t.status==="success"||t.status==="failed").slice(0,200)},actions:{async load(){this.loading=!0;try{this.tasks=await Se.tasks(),this.error=""}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.loading=!1}},upsert(e){const t=this.tasks.findIndex(s=>s.taskId===e.taskId);t<0?this.tasks.unshift(e):this.tasks[t]=e}}}),_l=Hs("settings",{state:()=>({settings:{autostart:!1,outputDir:"",concurrency:2,language:"zh-CN"},form:{autostart:!1,outputDir:"",concurrency:2,language:"zh-CN"},loading:!1,saving:!1,error:""}),actions:{async load(){this.loading=!0;try{this.settings=await Se.settings(),this.form={...this.settings},this.error=""}finally{this.loading=!1}},async save(){const e={...this.form};this.saving=!0;try{this.settings=await Se.saveSettings(this.form),this.form={...this.settings},this.error=""}catch(t){throw this.form=e,this.error=t instanceof Error?t.message:String(t),t}finally{this.saving=!1}}}}),df=3456,uo=`http://127.0.0.1:${df}`,hf="https://duduer.com";function js(){return location.hostname==="127.0.0.1"||location.hostname==="localhost"}function An(){return/Windows|Win32|Win64/i.test(navigator.userAgent)?"windows":"macos"}async function pf(e=1500){const t=new AbortController,s=setTimeout(()=>t.abort(),e);try{return await fetch(`${uo}/api/doctor`,{mode:"no-cors",cache:"no-store",signal:t.signal}),!0}catch{return!1}finally{clearTimeout(s)}}function gf(){return js()?hf:location.origin}function $o(e){const t=gf();return e==="macos"?`curl -fsSL ${t}/install.sh | sh`:`$w=New-Object Net.WebClient;$w.Encoding=[Text.Encoding]::UTF8;iex $w.DownloadString('${t}/install.ps1')`}function mf(){const e=Oo(),t=Po(),s=Io(),n=_l(),o=Ro();async function i(){await Promise.all([e.load(),t.load(),s.load()])}async function r(){await t.load()}function l(a){a.type==="doctor:status"?(e.statuses=a.data,r()):a.type==="task:update"?s.upsert(a.data):a.type==="install:start"||a.type==="install:progress"||a.type==="uninstall:start"||a.type==="uninstall:progress"?e.applyProgress(a.data):a.type==="install:done"||a.type==="uninstall:done"?(e.applyDone(a.data.status),r()):(a.type==="install:fail"||a.type==="uninstall:fail")&&e.applyFailure(a.data)}os(async()=>{js()&&(o.onMessage(l),o.onConnectionChange(a=>{e.connected=a}),o.onResync(i),o.connect(),await Promise.all([i(),n.load()]))}),bn(()=>{})}const x={appName:"嘟嘟转换器",nav:{home:"首页",workbench:"功能页",history:"转换历史",settings:"设置"},connection:{connected:"已连接本地服务",disconnected:"连接已断开,正在自动重连"},doctor:{title:"依赖与环境",recheck:"重新检测",install:"一键安装",uninstall:"一键卸载",copy:"复制命令",manual:"手动下载",logs:"操作日志",ready:"可用",outdated:"版本过旧",missingRequired:"必需缺失",missingOptional:"可选缺失",portableInstall:"内置直装(国内镜像下载,无需包管理器)",portableUninstall:"删除本地便携版组件",sessionRunning:"执行中,请耐心等待…",sessionRunningFull:"正在安装,请耐心等待完成(可能需要几分钟)——期间请不要关闭或刷新此页面;日志长时间无输出属正常现象(正在后台下载)",sessionDone:"✅ 操作完成",sessionFailed:"❌ 操作失败,详情见下方日志"},workbench:{title:"转换工作台",subtitle:"按类型分栏管理,文件入表后逐个或批量转换",dropTitle:"把{tab}文件拖到这里",dropHint:"支持 {exts} 等格式",dropCompact:"继续添加{tab}文件",pastePlaceholder:"粘贴文件绝对路径,回车添加",wrongTab:"{name} 不属于{tab},请切换到对应标签页添加",fileDuplicate:"已在列表中,无需重复添加",addFile:"选择文件",addPath:"添加",convertTo:"批量转换为",noCommonTargets:"当前文件没有共同的转换目标,请清理后分批转换",noTools:"该类别依赖的工具尚未安装,转换前需要先完成安装",gotoSettings:"去设置页安装依赖",tableFile:"文件名",tablePath:"路径",tableSize:"大小",tableStatus:"状态",tableActions:"操作",statusPending:"待转换",statusRunning:"转换中",statusSuccess:"转换成功",statusFailed:"转换失败",convert:"转换",retry:"重试",openFolder:"打开目录",download:"下载",remove:"移除",clearDone:"清除已完成",batchConvert:"开始批量转换",batchConvertN:"开始批量转换({n} 个)",batchDone:"本次批量转换已完成",paramsTitle:"高级参数",advanced:"高级设置",chooseFile:"选择文件"},history:{title:"转换历史",subtitle:"所有转换任务按时间倒序排列,可随时下载或打开产物",filterAll:"全部",statTotal:"累计任务",statSuccess:"成功",statFailed:"失败",searchPlaceholder:"搜索文件名…",empty:"还没有转换记录,去工作台开始第一次转换吧",today:"今天",yesterday:"昨天",openFolder:"打开目录",download:"下载",remove:"删除",clear:"清空历史"},landing:{heroBadge:"本地转换 · 零上传 · 不限文件大小",heroTitle:"你的文件,",heroAccent:"不必上传",heroTagline:"嘟嘟本地万能转换器:视频、音频、图片、文档在本机一步完成 —— 没有大小限制,没有隐私顾虑,没有漫长等待。",cta:"立即开始转换",ctaInstall:"查看安装指南",localRunning:"转换器已在本机运行,可直接进入功能页",stats:[{value:"23",label:"转换能力"},{value:"40+",label:"支持格式"},{value:"0",label:"文件上传"},{value:"100%",label:"本机运行"}],painTitle:"你是不是也有这些顾虑?",painSub:"嘟嘟把这些通通变成过去。",pains:[{icon:"shield",title:"文件传上去,心里不踏实",text:"合同、证件、家庭影像……一旦上传到陌生服务器,隐私就不再由你掌控。"},{icon:"globe",title:"在线工具处处受限",text:"大小限制、格式缺失、会员付费、广告弹窗,简单转个文件总要妥协。"},{icon:"clock",title:"传上去再下载,来回折腾",text:"大文件先上传一小时,转换完再下载一小时,网速决定了心情。"}],valueTitle:"换一种方式转换文件",valueSub:"本机运行带来的三个直接好处",values:[{icon:"shield-check",title:"文件不出你的电脑",text:"所有解析与转换都在本机完成,不经任何服务器,隐私天然无忧。"},{icon:"package-plus",title:"缺什么,一键装什么",text:"首次使用自动体检环境,FFmpeg 等引擎在页面里点一下即可安装。"},{icon:"zap",title:"装完即用,秒级开始",text:"一条命令安装,浏览器自动打开操作界面,拖入文件立刻出结果。"}],scenesTitle:"这些瞬间,嘟嘟都帮得上忙",scenesSub:"来自日常使用的高频场景",scenes:[{icon:"video",title:"网课录屏瘦身",text:"几个 G 的课程录像压成几百 MB,备份分享都不再犯难"},{icon:"image",title:"聊天图片压缩",text:"手机原图一张 8MB,压完不到 1MB,清晰度几乎不变"},{icon:"pdf",title:"发票合并归档",text:"几十张发票 PDF 按顺序合并成一个文件,报销不再手忙脚乱"},{icon:"sparkles",title:"表情包制作",text:"精彩片段一键做成 GIF 动图,斗图弹药永远充足"},{icon:"markdown",title:"简历笔记定稿",text:"Markdown 写完一键转 Word / PDF,排版不乱直接发"},{icon:"shield",title:"证件照脱敏外发",text:"身份证扫描件加水印或加密,发给陌生方也更安心"}],featuresTitle:"覆盖你日常的每一类文件",featuresSub:"23 类能力 · 40+ 种格式,全部本机完成",compareTitle:"和在线转换工具比一比",compareSub:"同样的转换,不同的体验",compare:[{item:"文件隐私",online:"上传到陌生服务器",local:"全程留在你的电脑里"},{item:"文件大小",online:"免费版普遍限制 100MB",local:"无任何限制"},{item:"转换速度",online:"上传 + 下载双倍耗时",local:"直接读写本地磁盘"},{item:"批量处理",online:"多数按次收费",local:"免费,支持批量队列"},{item:"网络依赖",online:"必须联网上传",local:"断网也能正常转换"}],faqTitle:"常见问题",faqSub:"关于嘟嘟的几个高频疑问",faq:[{q:"我的文件会被上传吗?",a:"不会。嘟嘟完全运行在你自己的电脑上,转换过程不经过任何服务器,即使断网也能正常转换。"},{q:"需要付费吗?",a:"免费使用:无功能限制、无水印、无次数限制,也不需要注册账号。"},{q:"转换用的引擎需要自己装吗?",a:"不用自己找教程。首次使用某类能力时,应用会自动检测缺失的引擎,在「设置 → 依赖与环境」里点一下即可安装,全程图形化操作。"},{q:"支持 Windows 吗?",a:"支持。macOS 12+ 与 Windows 10/11 均可使用,安装命令在首页首屏即可一键复制。"},{q:"大文件会很慢或卡住吗?",a:"转换在本地队列并发执行(1–4 个可调),大文件只是耗时更长,不会占用云端额度,也不影响电脑其他操作。"}],footer:"嘟嘟转换器 · 本地优先的文件转换工具 · 文件永不上传"},install:{title:"安装转换器",step1:"打开终端",step2:"粘贴以下命令并回车",step3:"等待安装完成,浏览器会自动打开转换器",macos:"macOS",windows:"Windows",copy:"复制",copied:"已复制",macosTerminal:"按 ⌘+空格 打开聚焦搜索,输入「终端」或「Terminal」,回车打开",windowsTerminal:"点击开始菜单,输入「PowerShell」,回车打开",alreadyInstalled:"已经安装过?再次执行此命令会自动升级到新版本",manualTitle:"自动安装失败?手动安装",manualSteps:[{title:"安装 Node.js",text:"打开 nodejs.org 下载 Node.js 18 或更高版本,双击安装(保持默认选项)"},{title:"安装嘟嘟转换器",text:"打开终端(macOS:终端;Windows:PowerShell),执行 npm install -g dudu-converter-cli"},{title:"启动服务",text:"执行 converter start,浏览器访问 http://127.0.0.1:3456"}],startHint:"如果已经安装但未运行:在终端执行 converter start 启动后,回到此页重新检测"},gate:{checking:"正在检测本地转换器…",online:"已检测到本地转换器正在运行",open:"打开本地转换器",offline:"未检测到本地转换器",installedTitle:"转换器已安装,但服务未运行",manualTitle:"手动启动(一行命令)",manualHint:"复制命令 → 打开终端粘贴回车;若已开启开机自启,重启电脑也会自动运行",retry:"重新检测",notInstalledTitle:"尚未安装?查看安装步骤"},settings:{title:"设置",preferences:"应用设置",autostart:"开机自动启动",outputDir:"输出目录",chooseDir:"选择文件夹",concurrency:"并发数",language:"界面语言",save:"保存设置",saved:"设置已保存",service:"服务管理",serviceRunning:"转换服务运行中",stopService:"停止服务",stopConfirm:`确定停止转换服务吗?
|
|
31
31
|
停止后转换功能不可用;已开启的开机自启会在下次重启电脑时自动运行服务。`,serviceStopped:"转换服务已停止",stoppedGuide:"重新启动:在终端执行下方命令;若已开启开机自启,重启电脑后服务也会自动运行。",startCommand:"converter start",outputAccessTitle:"输出目录无法访问",useSuggestedDir:"一键改用主目录输出(无需授权)",openPrivacy:"打开系统隐私设置"},update:{banner:"发现新版本 v{latest}(当前 v{current}),建议升级获得最新功能与修复",copy:"复制升级命令",copied:"已复制,打开终端粘贴即可",how:"如何升级",dismiss:"暂不提醒",steps:["点击「复制升级命令」,打开终端粘贴并回车(macOS 用终端,Windows 用 PowerShell)","安装命令会自动停止旧服务、完成升级并启动新版本,无需手动操作","刷新浏览器页面即可"]},common:{retry:"重试",close:"关闭",loading:"加载中…",save:"保存",cancel:"取消"}},vf={video:["M3 5.5A2.5 2.5 0 0 1 5.5 3h13A2.5 2.5 0 0 1 21 5.5v13a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 18.5z","M7 3v18","M17 3v18","M3 12h18"],music:["M9 18V5l12-2v13","M3 18a3 3 0 1 0 6 0 3 3 0 1 0-6 0","M15 16a3 3 0 1 0 6 0 3 3 0 1 0-6 0"],image:["M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z","M7 9a2 2 0 1 0 4 0 2 2 0 1 0-4 0","m21 15-4.6-4.6a2 2 0 0 0-2.8 0L4 20"],archive:["M3 3h18v5H3z","M5 8v11a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8","M10 12h4"],office:["M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z","M14 2v5h5","M9 13h6","M9 17h6","M9 9h1"],pdf:["M12 7v14","M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"],markdown:["M12 20h9","M16.4 3.6a1.4 1.4 0 0 1 2 2L7.5 16.5a2 2 0 0 1-.9.5l-2.8.8a.5.5 0 0 1-.6-.6l.8-2.8a2 2 0 0 1 .5-.9z"],shield:["M20 13c0 5-3.5 7.5-7.7 9a.6.6 0 0 1-.6 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.2-2.7a1.2 1.2 0 0 1 1.6 0C14.5 3.8 17 5 19 5a1 1 0 0 1 1 1z"],"shield-check":["M20 13c0 5-3.5 7.5-7.7 9a.6.6 0 0 1-.6 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.2-2.7a1.2 1.2 0 0 1 1.6 0C14.5 3.8 17 5 19 5a1 1 0 0 1 1 1z","m9 12 2 2 4-4"],"package-plus":["M21 16V8a2 2 0 0 0-1-1.7l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.7l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z","M3.3 7 12 12l8.7-5","M12 22V12","M19 13v6","M16 16h6"],zap:["M4 14a1 1 0 0 1-.8-1.6l9.9-10.2a.5.5 0 0 1 .9.5l-1.9 6a1 1 0 0 0 1 1.3h7a1 1 0 0 1 .7 1.6l-9.9 10.2a.5.5 0 0 1-.9-.5l1.9-6a1 1 0 0 0-.9-1.3z"],globe:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M2 12h20","M12 2a15 15 0 0 1 4 10 15 15 0 0 1-4 10 15 15 0 0 1-4-10 15 15 0 0 1 4-10z"],clock:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 6v6l4 2"],"check-circle":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","m9 12 2 2 4-4"],"x-circle":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","m15 9-6 6","m9 9 6 6"],"minus-circle":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M8 12h8"],"alert-circle":["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","M12 8v4","M12 16h.01"],copy:["M10 8h9a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-9a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2z","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"],"external-link":["M15 3h6v6","M10 14 21 3","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"],refresh:["M3 12a9 9 0 0 1 15.7-6","M21 3v5h-5","M21 12a9 9 0 0 1-15.7 6","M3 21v-5h5"],upload:["M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4","m7 8 5-5 5 5","M12 3v12"],download:["M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4","m7 10 5 5 5-5","M12 15V3"],plus:["M5 12h14","M12 5v14"],x:["M18 6 6 18","m6 6 12 12"],settings:["M4 6h6","M14 6h6","M4 12h10","M18 12h2","M4 18h4","M12 18h8","M10 4v4","M14 10v4","M8 16v4"],terminal:["m4 17 6-6-6-6","M12 19h8"],"arrow-right":["M5 12h14","m12 5 7 7-7 7"],"chevron-down":["m6 9 6 6 6-6"],file:["M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z","M14 2v5h5"],folder:["M11 4H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7l-2-2z"],sparkles:["M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9z","M19 17v4","M21 19h-4","M5 3v2","M4 4h2"],repeat:["m17 2 4 4-4 4","M3 11v-1a4 4 0 0 1 4-4h14","m7 22-4-4 4-4","M21 13v1a4 4 0 0 1-4 4H3"]},bl={video:"video",audio:"music",image:"image",archive:"archive",office:"office",pdf:"pdf",markdown:"markdown"},yf=["width","height"],_f=["d"],bf=Le({__name:"AppIcon",props:{name:{},size:{default:20}},setup(e){const t=e;return(s,n)=>(E(),O("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",class:"app-icon"},[(E(!0),O(ie,null,Ee(y(vf)[t.name],(o,i)=>(E(),O("path",{key:i,d:o},null,8,_f))),128))],8,yf))}}),et=(e,t)=>{const s=e.__vccOpts||e;for(const[n,o]of t)s[n]=o;return s},Q=et(bf,[["__scopeId","data-v-84fb32bd"]]),Mo=Hs("version",{state:()=>({status:{current:"",latest:"",updateAvailable:!1},dismissed:!1,loaded:!1}),getters:{visible:e=>e.status.updateAvailable&&!e.dismissed},actions:{async load(){try{this.status=await Se.version()}catch{}finally{this.loaded=!0}},listenWs(){Ro().onMessage(e=>{e.type==="update:available"&&(this.status=e.data,this.dismissed=!1)})},dismiss(){this.dismissed=!0}}}),wf={key:0,class:"update-banner","data-testid":"update-banner"},Sf={class:"banner-text"},xf=["title"],kf={key:0,class:"banner-detail"},Cf=Le({__name:"UpdateBanner",setup(e){const t=Mo(),s=ne(An()),n=ne(!1),o=ne(!1),i=ne($o(s.value));async function r(){try{await navigator.clipboard.writeText(i.value),n.value=!0,setTimeout(()=>{n.value=!1},2500)}catch{}}return(l,a)=>y(t).visible?(E(),O("div",wf,[z(Q,{name:"sparkles",size:15}),c("span",Sf,_(y(x).update.banner.replace("{latest}",y(t).status.latest).replace("{current}",y(t).status.current)),1),c("button",{class:_e(["copy",{ok:n.value}]),type:"button",onClick:r},[z(Q,{name:n.value?"check-circle":"copy",size:13},null,8,["name"]),j(" "+_(n.value?y(x).update.copied:y(x).update.copy),1)],2),c("button",{class:"how",type:"button",onClick:a[0]||(a[0]=d=>o.value=!o.value)},[j(_(y(x).update.how),1),z(Q,{name:"chevron-down",size:13,class:_e({open:o.value})},null,8,["class"])]),c("button",{class:"close",type:"button",title:y(x).update.dismiss,onClick:a[1]||(a[1]=d=>y(t).dismiss())},[z(Q,{name:"x",size:13})],8,xf),o.value?(E(),O("div",kf,[c("ol",null,[(E(!0),O(ie,null,Ee(y(x).update.steps,(d,u)=>(E(),O("li",{key:d},_(u+1)+". "+_(d),1))),128))])])):ee("",!0)])):ee("",!0)}}),Ef=et(Cf,[["__scopeId","data-v-69c975e5"]]),Af={class:"app-shell"},Rf={class:"app-header"},Tf=Le({__name:"App",setup(e){mf();const t=Oo(),s=js(),n=Mo();return s&&(n.listenWs(),n.load()),(o,i)=>(E(),O("div",Af,[c("header",Rf,[z(y(Qt),{to:"/",class:"brand"},{default:Yt(()=>[i[0]||(i[0]=c("span",{class:"logo"},"嘟",-1)),c("strong",null,_(y(x).appName),1)]),_:1}),c("nav",null,[z(y(Qt),{to:"/"},{default:Yt(()=>[j(_(y(x).nav.home),1)]),_:1}),z(y(Qt),{to:"/workbench"},{default:Yt(()=>[j(_(y(x).nav.workbench),1)]),_:1}),y(s)?(E(),lt(y(Qt),{key:0,to:"/history"},{default:Yt(()=>[j(_(y(x).nav.history),1)]),_:1})):ee("",!0),y(s)?(E(),lt(y(Qt),{key:1,to:"/settings"},{default:Yt(()=>[j(_(y(x).nav.settings),1)]),_:1})):ee("",!0)]),y(s)?(E(),O("span",{key:0,class:_e(["connection",{offline:!y(t).connected}])},[i[1]||(i[1]=c("i",{class:"dot"},null,-1)),j(_(y(t).connected?y(x).connection.connected:y(x).connection.disconnected),1)],2)):ee("",!0)]),c("main",null,[y(s)?(E(),lt(Ef,{key:0})):ee("",!0),z(y(yl))])]))}}),Of=et(Tf,[["__scopeId","data-v-e736b31c"]]),Pf={class:"history","data-testid":"history"},If={class:"page-title"},$f={class:"page-subtitle"},Mf={class:"toolbar"},Nf={class:"filters"},Df=["onClick"],Ff={class:"toolbar-right"},Vf={class:"search"},Lf=["placeholder"],Hf={key:0,class:"hint-alert"},jf={key:1,class:"panel empty"},Uf={class:"day-head"},Bf={class:"panel day-list"},zf={class:"item-main"},Kf={class:"item-title"},Wf=["title"],Gf={class:"arrow"},qf={class:"target"},Jf={class:"item-meta"},Yf={class:"error-text"},Qf={key:0,class:"spinner tiny"},Xf={class:"item-actions"},Zf=["onClick"],ed=["title","onClick"],td=Le({__name:"HistoryView",setup(e){const t=Io(),s=Po(),n=ne("all"),o=ne("");os(()=>{t.load(),s.load()});const i=re(()=>({total:t.tasks.length,success:t.tasks.filter(N=>N.status==="success").length,failed:t.tasks.filter(N=>N.status==="failed").length})),r=re(()=>t.tasks.filter(N=>!(n.value!=="all"&&N.status!==n.value||o.value.trim()&&!N.input.toLowerCase().includes(o.value.trim().toLowerCase()))).sort((N,P)=>P.startedAt.localeCompare(N.startedAt))),l=ne("");async function a(N){l.value="";try{await Se.revealTask(N.taskId)}catch(P){l.value=P instanceof Error?P.message:"打开目录失败"}}async function d(N){l.value="";try{await Se.deleteHistory(N),await t.load()}catch(P){t.error=P instanceof Error?P.message:"删除失败"}}async function u(){if(window.confirm("确定清空全部转换历史吗?此操作不可恢复。"))try{await Se.clearHistory(),await t.load()}catch(N){t.error=N instanceof Error?N.message:"清空失败"}}function p(N){const P=new Date(N);if(Number.isNaN(P.getTime()))return"";const D=new Date,V=H=>new Date(H.getFullYear(),H.getMonth(),H.getDate()).getTime(),K=Math.round((V(D)-V(P))/864e5);return K<=0?x.history.today:K===1?x.history.yesterday:P.getFullYear()===D.getFullYear()?`${P.getMonth()+1} 月 ${P.getDate()} 日`:`${P.getFullYear()} 年 ${P.getMonth()+1} 月 ${P.getDate()} 日`}const m=re(()=>{const N=new Map;for(const P of r.value){const D=p(P.startedAt),V=N.get(D);V?V.push(P):N.set(D,[P])}return[...N.entries()]});function S(N){const P=new Date(N);return Number.isNaN(P.getTime())?"":`${String(P.getHours()).padStart(2,"0")}:${String(P.getMinutes()).padStart(2,"0")}`}function F(N){return N.split(/[\\/]/).pop()??N}function M(N){var D;const P=(D=s.byKey.get(N.conversionKey))==null?void 0:D.category;return bl[P??"file"]??"file"}function W(N){var P;return((P=s.byKey.get(N.conversionKey))==null?void 0:P.label)??N.conversionKey}return(N,P)=>(E(),O("section",Pf,[c("h1",If,_(y(x).history.title),1),c("p",$f,_(y(x).history.subtitle),1),c("div",Mf,[c("div",Nf,[(E(!0),O(ie,null,Ee([{key:"all",label:y(x).history.filterAll,count:i.value.total},{key:"success",label:y(x).history.statSuccess,count:i.value.success},{key:"failed",label:y(x).history.statFailed,count:i.value.failed}],D=>(E(),O("button",{key:D.key,type:"button",class:_e(["filter-chip",{active:n.value===D.key}]),onClick:V=>n.value=D.key},[j(_(D.label)+" ",1),c("em",null,_(D.count),1)],10,Df))),128))]),c("div",Ff,[c("div",Vf,[z(Q,{name:"file",size:14}),Pt(c("input",{"onUpdate:modelValue":P[0]||(P[0]=D=>o.value=D),type:"text",placeholder:y(x).history.searchPlaceholder},null,8,Lf),[[Ut,o.value]])]),y(t).tasks.length?(E(),O("button",{key:0,class:"ghost danger",type:"button",onClick:u},[z(Q,{name:"x",size:13}),j(_(y(x).history.clear),1)])):ee("",!0)])]),l.value?(E(),O("p",Hf,[z(Q,{name:"alert-circle",size:15}),j(_(l.value),1)])):ee("",!0),r.value.length?ee("",!0):(E(),O("div",jf,[z(Q,{name:"folder",size:36}),c("span",null,_(y(x).history.empty),1)])),(E(!0),O(ie,null,Ee(m.value,([D,V])=>(E(),O("div",{key:D,class:"day-group"},[c("div",Uf,[j(_(D),1),c("em",null,_(V.length)+" 条",1)]),c("div",Bf,[(E(!0),O(ie,null,Ee(V,K=>(E(),O("article",{key:K.taskId,class:"history-item"},[c("span",{class:_e(["item-icon",K.status])},[z(Q,{name:M(K),size:18},null,8,["name"])],2),c("div",zf,[c("div",Kf,[c("strong",{title:K.input},_(F(K.input)),9,Wf),c("span",Gf,[z(Q,{name:"arrow-right",size:13})]),c("span",qf,_(K.targetFormat.toUpperCase()),1)]),c("div",Jf,[j(_(W(K))+" · "+_(S(K.startedAt))+_(K.durationMs?` · ${K.durationMs} ms`:"")+" ",1),K.error?(E(),O(ie,{key:0},[P[1]||(P[1]=j(" · ",-1)),c("span",Yf,_(K.error.message),1)],64)):ee("",!0)])]),c("span",{class:_e(["badge row-badge",K.status])},[K.status==="running"?(E(),O("span",Qf)):ee("",!0),j(" "+_(K.status==="success"?y(x).workbench.statusSuccess:K.status==="failed"?y(x).workbench.statusFailed:K.status==="running"?y(x).workbench.statusRunning:y(x).workbench.statusPending),1)],2),c("div",Xf,[K.status==="success"?(E(),O("button",{key:0,class:"ghost tiny",type:"button",onClick:q=>a(K)},[z(Q,{name:"folder",size:13}),j(_(y(x).history.openFolder),1)],8,Zf)):ee("",!0),c("button",{class:"icon-btn",type:"button",title:y(x).history.remove,onClick:q=>d(K.taskId)},[z(Q,{name:"x",size:14})],8,ed)])]))),128))])]))),128))]))}}),sd=et(td,[["__scopeId","data-v-b299457c"]]),nd={class:"landing","data-testid":"landing"},od={class:"hero"},id={class:"hero-grid"},rd={class:"hero-copy"},ld={class:"hero-badge"},ad={class:"tagline"},cd={class:"cta-row"},ud={key:0,class:"local-badge"},fd={class:"terminal-card","data-testid":"install-guide"},dd={class:"term-head"},hd={class:"term-pills"},pd={class:"term-body"},gd={class:"command-row"},md={"data-testid":"install-command"},vd={class:"stats"},yd={class:"section"},_d={class:"section-sub"},bd={class:"pain-grid"},wd={class:"icon pain"},Sd={class:"section"},xd={class:"section-sub"},kd={class:"value-grid"},Cd={class:"icon value"},Ed={class:"section"},Ad={class:"section-sub"},Rd={class:"scene-grid"},Td={class:"icon scene"},Od={id:"features",class:"section"},Pd={class:"section-sub"},Id={class:"category-grid"},$d={class:"icon cat"},Md={class:"cat-body"},Nd={class:"section"},Dd={class:"section-sub"},Fd={class:"table-wrap"},Vd={class:"compare-table"},Ld={class:"c-item"},Hd={class:"c-online"},jd={class:"c-local"},Ud={class:"section"},Bd={class:"section-sub"},zd={class:"faq"},Kd={class:"landing-footer muted"},Wd=Le({__name:"LandingView",setup(e){const t=js(),s=ne(An()),n=re(()=>$o(s.value)),o=ne(!1);async function i(){try{await navigator.clipboard.writeText(n.value),o.value=!0,setTimeout(()=>{o.value=!1},2e3)}catch{}}function r(){var a;(a=document.getElementById("features"))==null||a.scrollIntoView({behavior:"smooth",block:"start"})}const l=[{icon:"video",title:"视频",lines:["格式转换 · 压缩 · 延迟摄影","MP4 · AVI · MKV · MOV · WebM"]},{icon:"music",title:"音频",lines:["格式转换 · 提取 · 压缩","MP3 · AAC · WAV · FLAC"]},{icon:"image",title:"图片",lines:["格式 · 缩放 · 压缩 · 水印","JPG · PNG · WebP · HEIC · AVIF"]},{icon:"archive",title:"压缩包",lines:["文件压缩 · 解压","7z · Zip"]},{icon:"office",title:"Office 文档",lines:["转 PDF / HTML · 家族互转","Word · Excel · PowerPoint"]},{icon:"pdf",title:"PDF",lines:["转图片文本 · 合并拆分 · 规则拆分","全套 PDF 处理"]},{icon:"markdown",title:"Markdown",lines:["互转 Word / HTML / PDF","写作发布一步到位"]}];return(a,d)=>(E(),O("section",nd,[c("div",od,[c("div",id,[c("div",rd,[c("span",ld,[z(Q,{name:"sparkles",size:14}),j(_(y(x).landing.heroBadge),1)]),c("h1",null,[j(_(y(x).landing.heroTitle),1),c("em",null,_(y(x).landing.heroAccent),1)]),c("p",ad,_(y(x).landing.heroTagline),1),c("div",cd,[z(y(Qt),{class:"btn primary cta",to:"/workbench","data-testid":"landing-cta"},{default:Yt(()=>[j(_(y(x).landing.cta),1),z(Q,{name:"arrow-right",size:16})]),_:1}),c("button",{class:"btn ghost",type:"button",onClick:r},[d[2]||(d[2]=j("了解功能",-1)),z(Q,{name:"chevron-down",size:15})])]),y(t)?(E(),O("p",ud,[z(Q,{name:"check-circle",size:14}),j(_(y(x).landing.localRunning),1)])):ee("",!0)]),c("div",fd,[c("div",dd,[d[3]||(d[3]=c("span",{class:"dots","aria-hidden":"true"},[c("i"),c("i"),c("i")],-1)),d[4]||(d[4]=c("strong",null,"一键安装嘟嘟转换器 · 全程约 1 分钟",-1)),c("div",hd,[c("button",{type:"button",class:_e({active:s.value==="macos"}),onClick:d[0]||(d[0]=u=>s.value="macos")},"macOS",2),c("button",{type:"button",class:_e({active:s.value==="windows"}),onClick:d[1]||(d[1]=u=>s.value="windows")},"Windows",2)])]),c("div",pd,[c("div",gd,[c("code",md,[d[5]||(d[5]=c("span",{class:"prompt"},"$",-1)),j(_(n.value),1)])]),c("button",{class:_e(["one-click",{ok:o.value}]),type:"button","data-testid":"install-copy",onClick:i},[z(Q,{name:o.value?"check-circle":"copy",size:15},null,8,["name"]),j(" "+_(o.value?"已复制!打开终端粘贴回车即可":"一键复制安装命令"),1)],2),d[6]||(d[6]=c("ol",{class:"term-steps"},[c("li",null,[c("span",null,"1"),j("点击上方按钮复制安装命令")]),c("li",null,[c("span",null,"2"),j("打开终端粘贴并回车(macOS:⌘+空格 搜「终端」;Windows:开始菜单搜 PowerShell)")]),c("li",null,[c("span",null,"3"),j("安装全自动完成,浏览器自动打开转换器")])],-1))])])]),c("div",vd,[(E(!0),O(ie,null,Ee(y(x).landing.stats,u=>(E(),O("div",{key:u.label,class:"stat"},[c("strong",null,_(u.value),1),c("span",null,_(u.label),1)]))),128))])]),c("div",yd,[c("h2",null,_(y(x).landing.painTitle),1),c("p",_d,_(y(x).landing.painSub),1),c("div",bd,[(E(!0),O(ie,null,Ee(y(x).landing.pains,u=>(E(),O("article",{key:u.title,class:"pain-card"},[c("span",wd,[z(Q,{name:u.icon,size:21},null,8,["name"])]),c("div",null,[c("strong",null,_(u.title),1),c("p",null,_(u.text),1)])]))),128))])]),c("div",Sd,[c("h2",null,_(y(x).landing.valueTitle),1),c("p",xd,_(y(x).landing.valueSub),1),c("div",kd,[(E(!0),O(ie,null,Ee(y(x).landing.values,u=>(E(),O("article",{key:u.title,class:"value-card"},[c("span",Cd,[z(Q,{name:u.icon,size:23},null,8,["name"])]),c("strong",null,_(u.title),1),c("p",null,_(u.text),1)]))),128))])]),c("div",Ed,[c("h2",null,_(y(x).landing.scenesTitle),1),c("p",Ad,_(y(x).landing.scenesSub),1),c("div",Rd,[(E(!0),O(ie,null,Ee(y(x).landing.scenes,u=>(E(),O("article",{key:u.title,class:"scene-card"},[c("span",Td,[z(Q,{name:u.icon,size:20},null,8,["name"])]),c("div",null,[c("strong",null,_(u.title),1),c("p",null,_(u.text),1)])]))),128))])]),c("div",Od,[c("h2",null,_(y(x).landing.featuresTitle),1),c("p",Pd,_(y(x).landing.featuresSub),1),c("div",Id,[(E(),O(ie,null,Ee(l,u=>c("article",{key:u.title,class:"category-card"},[c("span",$d,[z(Q,{name:u.icon,size:21},null,8,["name"])]),c("div",Md,[c("strong",null,_(u.title),1),c("p",null,_(u.lines[0]),1),c("small",null,_(u.lines[1]),1)])])),64))])]),c("div",Nd,[c("h2",null,_(y(x).landing.compareTitle),1),c("p",Dd,_(y(x).landing.compareSub),1),c("div",Fd,[c("table",Vd,[d[7]||(d[7]=c("thead",null,[c("tr",null,[c("th",null,"对比项"),c("th",null,"在线转换工具"),c("th",null,"嘟嘟转换器")])],-1)),c("tbody",null,[(E(!0),O(ie,null,Ee(y(x).landing.compare,u=>(E(),O("tr",{key:u.item},[c("td",Ld,_(u.item),1),c("td",Hd,_(u.online),1),c("td",jd,[z(Q,{name:"check-circle",size:14}),j(_(u.local),1)])]))),128))])])])]),c("div",Ud,[c("h2",null,_(y(x).landing.faqTitle),1),c("p",Bd,_(y(x).landing.faqSub),1),c("div",zd,[(E(!0),O(ie,null,Ee(y(x).landing.faq,u=>(E(),O("details",{key:u.q,class:"faq-item"},[c("summary",null,[j(_(u.q),1),z(Q,{name:"chevron-down",size:15})]),c("p",null,_(u.a),1)]))),128))])]),c("footer",Kd,_(y(x).landing.footer),1)]))}}),Gd=et(Wd,[["__scopeId","data-v-63ba655a"]]),qd=Le({__name:"StatusBadge",props:{state:{}},setup(e){const t=e,s=re(()=>x.doctor[t.state==="ready"?"ready":t.state==="outdated"?"outdated":t.state==="missing-required"?"missingRequired":"missingOptional"]);return(n,o)=>(E(),O("span",{class:_e(["badge",e.state])},_(s.value),3))}}),Jd={class:"tool-info"},Yd={class:"title"},Qd={key:0,class:"chip version"},Xd={class:"muted"},Zd={class:"actions"},eh=["disabled"],th=["disabled"],sh=Le({__name:"DependencyRow",props:{status:{},installing:{type:Boolean}},emits:["install","uninstall"],setup(e,{emit:t}){const s=e,n=t;let o;const i=ne(!1);async function r(){s.status.installCommand&&(await navigator.clipboard.writeText(s.status.installCommand),i.value=!0,clearTimeout(o),o=window.setTimeout(()=>{i.value=!1},2e3))}return(l,a)=>(E(),O("article",{class:_e(["dependency-row",`is-${e.status.state}`])},[c("div",Jd,[c("div",Yd,[c("strong",null,_(e.status.name),1),z(qd,{state:e.status.state},null,8,["state"]),e.status.version?(E(),O("span",Qd,_(e.status.version),1)):ee("",!0)]),c("p",Xd,_(e.status.description),1)]),c("div",Zd,[(e.status.installCommand||e.status.installMethod==="portable")&&(!e.status.installed||e.status.state==="outdated")?(E(),O("button",{key:0,class:"primary",disabled:e.installing,onClick:a[0]||(a[0]=d=>n("install",e.status))},_(y(x).doctor.install),9,eh)):ee("",!0),e.status.installCommand?(E(),O("button",{key:1,class:"ghost",onClick:r},_(i.value?y(x).install.copied:y(x).doctor.copy),1)):ee("",!0),e.status.installed&&(e.status.uninstallCommand||e.status.installMethod==="portable")?(E(),O("button",{key:2,class:"ghost danger",disabled:e.installing,onClick:a[1]||(a[1]=d=>n("uninstall",e.status))},_(y(x).doctor.uninstall),9,th)):ee("",!0)])],2))}}),nh=et(sh,[["__scopeId","data-v-d296fa22"]]),oh=Le({__name:"LogStream",props:{logs:{}},setup(e){const t=e,s=ne(),n=ne(!0);$t(()=>[...t.logs],async()=>{n.value&&(await ps(),s.value&&(s.value.scrollTop=s.value.scrollHeight))});function o(){const i=s.value;i&&(n.value=i.scrollHeight-i.scrollTop-i.clientHeight<24)}return(i,r)=>(E(),O("div",{ref_key:"container",ref:s,class:"log-stream",onScroll:o},[(E(!0),O(ie,null,Ee(e.logs,(l,a)=>(E(),O("p",{key:`${a}-${l}`},_(l),1))),128))],544))}}),ih=et(oh,[["__scopeId","data-v-a4d9e36c"]]),rh={class:"settings","data-testid":"settings"},lh={class:"page-title"},ah={class:"panel"},ch={class:"section-head"},uh={key:0,class:"chip version-chip"},fh={key:0,class:"chip running-chip"},dh={key:0,class:"stop-row"},hh=["disabled"],ph={key:0,class:"spinner",style:{width:"13px",height:"13px","border-color":"#ffffff88","border-top-color":"#fff"}},gh={key:1,class:"stopped-card"},mh={class:"muted"},vh={class:"command-row"},yh={class:"panel"},_h={class:"section-head"},bh=["disabled"],wh={key:1,class:"spinner",style:{width:"14px",height:"14px"}},Sh={class:"summary-card"},xh={class:"summary-text"},kh={class:"summary-bar bar"},Ch={key:0,class:"alert"},Eh={class:"dep-list"},Ah={key:0,class:"spinner",style:{width:"13px",height:"13px"}},Rh={class:"section-head"},Th={class:"field"},Oh={class:"directory-editor"},Ph=["disabled"],Ih={key:1,class:"spinner",style:{width:"13px",height:"13px"}},$h={key:0,class:"output-access-warning","data-testid":"output-access-warning"},Mh={class:"warning-title"},Nh={class:"muted warning-detail"},Dh={class:"warning-actions"},Fh=["disabled"],Vh={key:0,class:"spinner",style:{width:"12px",height:"12px","border-color":"#ffffff88","border-top-color":"#fff"}},Lh={class:"field"},Hh={class:"concurrency"},jh={class:"field"},Uh={key:0,class:"error"},Bh={key:1,class:"saved"},zh={class:"actions"},Kh=["disabled"],Wh={key:0,class:"spinner",style:{"border-color":"#ffffff88","border-top-color":"#fff"}},Gh=Le({__name:"SettingsView",setup(e){const t=Oo(),s=_l(),n=Mo();os(()=>{n.loaded||n.load()});const o=ne(!1),i=ne(!1),r=ne(!1),l=ne(!1),a=ne(!1);async function d(){try{await navigator.clipboard.writeText(x.settings.startCommand),a.value=!0,setTimeout(()=>{a.value=!1},2e3)}catch{}}async function u(){if(window.confirm(x.settings.stopConfirm)){l.value=!0;try{await Se.serviceStop(),r.value=!0,t.connected=!1}catch(q){s.error=q instanceof Error?q.message:"停止服务失败"}finally{l.value=!1}}}const p=re(()=>t.installSession.state==="progress"),m=ne();$t(()=>t.installSession.state,q=>{q==="progress"&&ps(()=>{var H,Z;(Z=(H=m.value)==null?void 0:H.scrollIntoView)==null||Z.call(H,{behavior:"smooth",block:"center"})})});const S=re(()=>t.statuses.length?Math.round(t.readyCount/t.statuses.length*100):0);function F(q){p.value||!q.installCommand&&q.installMethod!=="portable"||q.state==="outdated"&&!window.confirm(`${q.name} 已安装但版本过低,确认重新安装?`)||t.startInstall(q.id,q.installCommand||x.doctor.portableInstall)}function M(q){if(p.value||!q.uninstallCommand&&q.installMethod!=="portable")return;const H=`确定要卸载 ${q.name} 吗?
|
|
32
32
|
卸载后相关转换功能将不可用。`;window.confirm(H)&&t.startUninstall(q.id,q.uninstallCommand||x.doctor.portableUninstall)}async function W(){o.value=!0;try{const q=await Se.selectOutputDir();q.selected&&q.path&&(s.form.outputDir=q.path)}catch(q){s.error=q instanceof Error?q.message:"无法打开目录选择器"}finally{o.value=!1}}const N=re(()=>s.settings.outputDirAccess!==void 0&&!s.settings.outputDirAccess.ok),P=ne(!1);async function D(){if(!(!s.settings.suggestedOutputDir||P.value)){P.value=!0;try{s.form.outputDir=s.settings.suggestedOutputDir,await s.save()}catch{}finally{P.value=!1}}}async function V(){try{await Se.openPrivacySettings()}catch(q){s.error=q instanceof Error?q.message:"打开系统设置失败"}}async function K(){try{await s.save(),i.value=!0,setTimeout(()=>{i.value=!1},2e3)}catch{}}return(q,H)=>{var Z;return E(),O("section",rh,[c("h1",lh,_(y(x).settings.title),1),H[12]||(H[12]=c("p",{class:"page-subtitle"},"转换引擎与应用偏好集中在这里管理",-1)),c("div",ah,[c("div",ch,[c("div",null,[c("h2",null,[j(_(y(x).settings.service)+" ",1),y(n).status.current?(E(),O("span",uh,"v"+_(y(n).status.current),1)):ee("",!0)]),H[4]||(H[4]=c("p",{class:"muted section-sub"},"转换服务的运行控制",-1))]),r.value?ee("",!0):(E(),O("span",fh,[H[5]||(H[5]=c("span",{class:"dot"},null,-1)),j(_(y(x).settings.serviceRunning),1)]))]),r.value?(E(),O("div",gh,[c("p",null,[z(Q,{name:"check-circle",size:15}),c("strong",null,_(y(x).settings.serviceStopped),1)]),c("p",mh,_(y(x).settings.stoppedGuide),1),c("div",vh,[c("code",null,[H[7]||(H[7]=c("span",{class:"prompt"},"$",-1)),j(_(y(x).settings.startCommand),1)]),c("button",{class:"ghost",type:"button",onClick:d},_(a.value?"已复制":"复制"),1)])])):(E(),O("div",dh,[H[6]||(H[6]=c("p",{class:"muted stop-desc"},[j("停止后转换功能不可用。已开启的开机自启会在下次重启电脑时自动运行服务;重新启动请在终端执行 "),c("code",null,"converter start"),j("。")],-1)),c("button",{class:"ghost danger stop-btn",type:"button","data-testid":"stop-service",disabled:l.value,onClick:u},[l.value?(E(),O("span",ph)):ee("",!0),j(" "+_(l.value?"停止中…":y(x).settings.stopService),1)],8,hh)]))]),c("div",yh,[c("div",_h,[c("div",null,[c("h2",null,_(y(x).doctor.title),1),H[8]||(H[8]=c("p",{class:"muted section-sub"},"缺什么就一键补齐",-1))]),c("button",{class:"ghost recheck",disabled:y(t).loading,onClick:H[0]||(H[0]=J=>y(t).recheck())},[y(t).loading?(E(),O("span",wh)):(E(),lt(Q,{key:0,name:"refresh",size:15})),j(" "+_(y(x).doctor.recheck),1)],8,bh)]),c("div",Sh,[c("div",xh,[c("strong",null,_(y(t).readyCount)+" / "+_(y(t).statuses.length),1),H[9]||(H[9]=c("span",null,"个引擎可用",-1))]),c("div",kh,[c("i",{style:pn({width:`${S.value}%`})},null,4)])]),y(t).error?(E(),O("p",Ch,_(y(t).error),1)):ee("",!0),c("div",Eh,[(E(!0),O(ie,null,Ee(y(t).statuses,J=>(E(),lt(nh,{key:J.id,status:J,installing:p.value,onInstall:F,onUninstall:M},null,8,["status","installing"]))),128))]),y(t).installSession.state!=="idle"?(E(),O("div",{key:1,ref_key:"installSessionRef",ref:m,class:"install-session"},[c("h3",null,_(y(x).doctor.logs),1),c("p",{class:_e(["session-state",y(t).installSession.state])},[y(t).installSession.state==="progress"?(E(),O("span",Ah)):ee("",!0),j(" "+_(y(t).installSession.state==="progress"?y(x).doctor.sessionRunningFull:y(t).installSession.state==="done"?y(x).doctor.sessionDone:y(x).doctor.sessionFailed),1)],2),z(ih,{logs:y(t).installSession.logs},null,8,["logs"])],512)):ee("",!0)]),c("form",{class:"panel",onSubmit:no(K,["prevent"])},[c("div",Rh,[c("h2",null,_(y(x).settings.preferences),1)]),c("label",Th,[c("span",null,_(y(x).settings.outputDir),1),c("div",Oh,[Pt(c("input",{"onUpdate:modelValue":H[1]||(H[1]=J=>y(s).form.outputDir=J),type:"text",placeholder:"转换结果保存目录"},null,512),[[Ut,y(s).form.outputDir]]),c("button",{class:"ghost",type:"button",disabled:o.value,onClick:W},[o.value?(E(),O("span",Ih)):(E(),lt(Q,{key:0,name:"folder",size:14})),j(" "+_(o.value?"打开中…":y(x).settings.chooseDir),1)],8,Ph)]),N.value?(E(),O("div",$h,[c("p",Mh,[z(Q,{name:"alert-circle",size:15}),j(" "+_(y(x).settings.outputAccessTitle),1)]),c("p",Nh,_((Z=y(s).settings.outputDirAccess)==null?void 0:Z.message),1),c("div",Dh,[c("button",{class:"primary",type:"button",disabled:P.value,onClick:D},[P.value?(E(),O("span",Vh)):ee("",!0),j(" "+_(y(x).settings.useSuggestedDir),1)],8,Fh),y(An)()==="macos"?(E(),O("button",{key:0,class:"ghost",type:"button",onClick:V},[z(Q,{name:"external-link",size:13}),j(" "+_(y(x).settings.openPrivacy),1)])):ee("",!0)])])):ee("",!0)]),c("label",Lh,[c("span",null,_(y(x).settings.concurrency),1),c("div",Hh,[Pt(c("input",{"onUpdate:modelValue":H[2]||(H[2]=J=>y(s).form.concurrency=J),type:"number",min:"1",max:"4"},null,512),[[Ut,y(s).form.concurrency,void 0,{number:!0}]]),H[10]||(H[10]=c("small",{class:"muted"},"同时进行的转换任务数(1–4)",-1))])]),c("label",jh,[c("span",null,_(y(x).settings.language),1),Pt(c("select",{"onUpdate:modelValue":H[3]||(H[3]=J=>y(s).form.language=J),disabled:""},[...H[11]||(H[11]=[c("option",{value:"zh-CN"},"简体中文",-1)])],512),[[Eo,y(s).form.language]])]),y(s).error?(E(),O("p",Uh,_(y(s).error),1)):i.value?(E(),O("p",Bh,[z(Q,{name:"check-circle",size:14}),j(_(y(x).settings.saved),1)])):ee("",!0),c("div",zh,[c("button",{class:"primary",disabled:y(s).saving,type:"submit"},[y(s).saving?(E(),O("span",Wh)):ee("",!0),j(" "+_(y(s).saving?"保存中…":y(x).settings.save),1)],8,Kh)])],32)])}}}),qh=et(Gh,[["__scopeId","data-v-4ed1ac55"]]),ls=[{key:"image",label:"图片",icon:"image",categories:["image"]},{key:"video",label:"视频",icon:"video",categories:["video"]},{key:"audio",label:"音频",icon:"music",categories:["audio"]},{key:"office",label:"文档",icon:"office",categories:["office","markdown"]},{key:"pdf",label:"PDF",icon:"pdf",categories:["pdf"]},{key:"archive",label:"压缩包",icon:"archive",categories:["archive"]}];function wl(e,t){return e.filter(s=>t.categories.includes(s.category))}function Di(e,t){const s=new Set;for(const n of wl(e,t))for(const o of n.fromFormats)s.add(o);return s}const Jh={"image-resize":"缩放","image-compress":"压缩","image-watermark":"加水印","images-to-gif":"合成 GIF","video-compress":"压缩","video-timelapse":"延迟摄影","media-compress":"压缩","pdf-merge":"合并","pdf-split":"拆分","pdf-protect":"加密/解密","archive-extract":"解压"};function Yh(e){return Jh[e]}const Fi={jpg:"jpg",jpeg:"jpg"};function Qh(e,t){return(Fi[e]??e)===(Fi[t]??t)}function Xh(e){const t=e.split(/[\\/]/).pop()??"",s=t.lastIndexOf(".");return s>0?t.slice(s+1).toLowerCase():""}function Zh(e,t){if(!t.length)return[];const s=[...new Set(t.map(i=>i.toLowerCase()))],n=[],o=new Set;for(const i of e){if(!i.available||!s.every(l=>i.fromFormats.includes(l)))continue;const r=Yh(i.key);if(r){const l=`op:${i.key}`;if(o.has(l))continue;o.add(l),n.push({conversionKey:i.key,format:"",label:r,capability:i.label,category:i.category,kind:"operate"});continue}for(const l of i.toFormats){if(s.every(d=>Qh(d,l)))continue;const a=`${i.key}:${l}`;o.has(a)||(o.add(a),n.push({conversionKey:i.key,format:l,label:l==="folder"?"解压为文件夹":l.toUpperCase(),capability:i.label,category:i.category,kind:"convert"}))}}return n}function ep(e,t){return t?[...e].sort((s,n)=>+(n.category===t)-+(s.category===t)):[...e]}function Vi(e,t){var n;const s=t.toLowerCase();return(n=e.find(o=>o.fromFormats.includes(s)))==null?void 0:n.category}function Li(e,t){return e.some(n=>n!==t&&n.label===t.label)?`${t.label} · ${t.capability}`:t.label}function tp(e){return e===void 0?"":e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(0)} KB`:e<1024**3?`${(e/1024**2).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}const sp={class:"install-guide","data-testid":"install-guide"},np={class:"platform-switch",role:"tablist"},op=["aria-selected"],ip=["aria-selected"],rp={class:"steps"},lp={class:"muted"},ap={class:"command-block"},cp={class:"command-row"},up={"data-testid":"install-command"},fp={class:"muted hint"},dp={class:"manual-block"},hp={key:0,class:"manual-steps"},pp={class:"step-no"},gp=Le({__name:"InstallGuide",setup(e){const t=ne(An()),s=ne(!1),n=re(()=>$o(t.value)),o=ne(!1);async function i(){try{await navigator.clipboard.writeText(n.value),o.value=!0,setTimeout(()=>{o.value=!1},2e3)}catch{}}return(r,l)=>(E(),O("div",sp,[c("div",np,[c("button",{type:"button",class:_e({active:t.value==="macos"}),role:"tab","aria-selected":t.value==="macos",onClick:l[0]||(l[0]=a=>t.value="macos")},_(y(x).install.macos),11,op),c("button",{type:"button",class:_e({active:t.value==="windows"}),role:"tab","aria-selected":t.value==="windows",onClick:l[1]||(l[1]=a=>t.value="windows")},_(y(x).install.windows),11,ip)]),c("ol",rp,[c("li",null,[l[3]||(l[3]=c("span",{class:"step-no"},"1",-1)),c("div",null,[c("strong",null,_(y(x).install.step1),1),c("p",lp,_(t.value==="macos"?y(x).install.macosTerminal:y(x).install.windowsTerminal),1)])]),c("li",null,[l[5]||(l[5]=c("span",{class:"step-no"},"2",-1)),c("div",ap,[c("strong",null,_(y(x).install.step2),1),c("div",cp,[c("code",up,[l[4]||(l[4]=c("span",{class:"prompt"},"$",-1)),j(_(n.value),1)]),c("button",{class:"ghost copy",type:"button",onClick:i},[z(Q,{name:o.value?"check-circle":"copy",size:14},null,8,["name"]),j(" "+_(o.value?y(x).install.copied:y(x).install.copy),1)])])])]),c("li",null,[l[6]||(l[6]=c("span",{class:"step-no"},"3",-1)),c("div",null,[c("strong",null,_(y(x).install.step3),1),c("p",fp,_(y(x).install.alreadyInstalled),1)])])]),c("div",dp,[c("button",{class:"manual-toggle",type:"button",onClick:l[2]||(l[2]=a=>s.value=!s.value)},[j(_(y(x).install.manualTitle),1),z(Q,{name:"chevron-down",size:14,class:_e({open:s.value})},null,8,["class"])]),s.value?(E(),O("ol",hp,[(E(!0),O(ie,null,Ee(y(x).install.manualSteps,(a,d)=>(E(),O("li",{key:a.title},[c("span",pp,_(d+1),1),c("div",null,[c("strong",null,_(a.title),1),c("p",null,_(a.text),1)])]))),128))])):ee("",!0)])]))}}),mp=et(gp,[["__scopeId","data-v-56162934"]]),vp={class:"daemon-gate","data-testid":"daemon-gate"},yp={key:0,class:"gate-state checking"},_p={key:1,class:"gate-state online","data-testid":"gate-online"},bp={class:"gate-icon ok"},wp={class:"actions"},Sp=["href"],xp={key:2,class:"gate-state offline","data-testid":"gate-offline"},kp={class:"gate-icon off"},Cp={class:"start-block"},Ep={class:"manual"},Ap={class:"manual-label"},Rp={class:"manual-row"},Tp={class:"manual-hint"},Op={class:"actions"},Pp=["href"],Ip={class:"install-collapsed"},$p=Le({__name:"DaemonGate",setup(e){const t=ne("checking"),s=ne(!1),n=ne(!1);async function o(){try{await navigator.clipboard.writeText("converter start"),n.value=!0,setTimeout(()=>{n.value=!1},2e3)}catch{}}async function i(){t.value="checking",t.value=await pf()?"online":"offline"}return os(()=>{i()}),(r,l)=>(E(),O("div",vp,[t.value==="checking"?(E(),O("div",yp,[l[1]||(l[1]=c("span",{class:"spinner big","aria-hidden":"true"},null,-1)),c("p",null,_(y(x).gate.checking),1)])):t.value==="online"?(E(),O("div",_p,[c("div",bp,[z(Q,{name:"check-circle",size:26})]),c("p",null,_(y(x).gate.online),1),l[2]||(l[2]=c("p",{class:"hint muted"},"转换在本机完成,点击进入操作界面",-1)),c("div",wp,[c("a",{class:"btn primary",href:y(uo),target:"_blank",rel:"noopener"},[j(_(y(x).gate.open),1),z(Q,{name:"arrow-right",size:15})],8,Sp),c("button",{class:"ghost",type:"button",onClick:i},[z(Q,{name:"refresh",size:14}),j(_(y(x).gate.retry),1)])])])):(E(),O("div",xp,[c("div",kp,[z(Q,{name:"alert-circle",size:26})]),c("p",null,_(y(x).gate.offline),1),c("div",Cp,[c("div",Ep,[c("span",Ap,_(y(x).gate.manualTitle),1),c("div",Rp,[l[3]||(l[3]=c("code",null,[c("span",{class:"prompt"},"$"),j("converter start")],-1)),c("button",{class:"copy",type:"button",onClick:o},[z(Q,{name:n.value?"check-circle":"copy",size:13},null,8,["name"]),j(_(n.value?"已复制":"复制"),1)])]),c("p",Tp,_(y(x).gate.manualHint),1)]),c("div",Op,[c("button",{class:"ghost",type:"button",onClick:i},[z(Q,{name:"refresh",size:14}),j(_(y(x).gate.retry),1)]),c("a",{class:"ghost direct-link",href:y(uo),target:"_blank",rel:"noopener"},_(y(x).gate.open),9,Pp)])]),c("div",Ip,[c("button",{class:"install-toggle",type:"button",onClick:l[0]||(l[0]=a=>s.value=!s.value)},[j(_(y(x).gate.notInstalledTitle),1),z(Q,{name:"chevron-down",size:14,class:_e({open:s.value})},null,8,["class"])]),s.value?(E(),lt(mp,{key:0})):ee("",!0)])]))]))}}),Mp=et($p,[["__scopeId","data-v-0f39bf4c"]]),Np="/gh-qrcode.png",Dp={class:"follow-gate","data-testid":"follow-gate"},Fp={class:"gate-right"},Vp={class:"code-row"},Lp={"data-testid":"pair-code"},Hp={key:0,class:"gate-error"},jp=Le({__name:"FollowGate",props:{pairCode:{}},emits:["activated"],setup(e,{emit:t}){const s=e,n=t,o=re(()=>s.pairCode??""),i=ne(!1),r=ne("");let l;async function a(){try{await navigator.clipboard.writeText(o.value),i.value=!0,setTimeout(()=>{i.value=!1},2e3)}catch{}}async function d(){const m=s.pairCode;if(m)try{const S=await fetch(`https://duduer.com/api/wx/activate/${encodeURIComponent(m)}`);if(!S.ok)return;const F=await S.json();F.status==="active"&&F.token?(p(),await Se.wxActivate(F.token),n("activated",F.token)):F.subscribed===!1?r.value="检测到关注已取消,重新关注即可恢复使用":r.value=""}catch{}}function u(){l=window.setInterval(()=>{d()},5e3)}function p(){l!==void 0&&(clearInterval(l),l=void 0)}return os(()=>{u()}),bn(()=>{p()}),(m,S)=>(E(),O("div",Dp,[S[5]||(S[5]=c("div",{class:"gate-left"},[c("img",{class:"gh-qrcode",src:Np,alt:"公众号二维码"}),c("p",{class:"qr-hint"},"微信扫码,关注公众号")],-1)),c("div",Fp,[S[1]||(S[1]=c("h2",null,"免费解锁全部功能",-1)),S[2]||(S[2]=c("p",{class:"gate-desc"},[j("关注公众号并回复你的绑定码,即可"),c("strong",null,"永久免费"),j("使用全部转换功能")],-1)),c("div",Vp,[S[0]||(S[0]=c("span",{class:"code-label"},"你的绑定码",-1)),c("code",Lp,_(o.value),1),c("button",{class:"copy",type:"button",onClick:a},[z(Q,{name:i.value?"check-circle":"copy",size:13},null,8,["name"]),j(_(i.value?"已复制":"复制"),1)])]),S[3]||(S[3]=c("ol",{class:"gate-steps"},[c("li",null,[c("span",null,"1"),j("微信扫描左侧二维码,关注公众号")]),c("li",null,[c("span",null,"2"),j("在公众号里发送你的绑定码(点击上方「复制」;手机手动输入请切换英文键盘,用半角字符)")]),c("li",null,[c("span",null,"3"),j("收到「绑定成功」回复后,本页自动解锁")])],-1)),r.value?(E(),O("p",Hp,[z(Q,{name:"alert-circle",size:14}),j(_(r.value),1)])):ee("",!0),S[4]||(S[4]=c("p",{class:"waiting"},[c("span",{class:"spinner tiny"}),j("正在等待绑定完成,每 5 秒自动检测…")],-1))])]))}}),Up=et(jp,[["__scopeId","data-v-8a413519"]]),Bp={class:"workbench","data-testid":"workbench"},zp={class:"page-title"},Kp={class:"page-subtitle"},Wp={key:2,class:"tabbed"},Gp={class:"tab-rail"},qp=["data-testid","onClick"],Jp={class:"tab-label"},Yp={key:0,class:"tab-count"},Qp={class:"tab-panel panel"},Xp={class:"drop-icon"},Zp={class:"drop-title"},eg={class:"muted drop-hint"},tg={class:"drop-compact-text"},sg={class:"drop-actions"},ng=["placeholder"],og=["disabled"],ig=["disabled"],rg={key:1,class:"spinner",style:{width:"13px",height:"13px","border-color":"#ffffff88","border-top-color":"#fff"}},lg=["accept"],ag={key:0,class:"hint-alert"},cg={class:"target-bar"},ug={class:"section-title"},fg={key:0,class:"target-chips"},dg=["onClick"],hg={key:1,class:"hint-alert"},pg={key:2,class:"hint-alert tools-missing"},gg={class:"hint-text"},mg={class:"table-wrap"},vg={class:"file-table","data-testid":"file-table"},yg={class:"cell-file"},_g={class:"cell-path"},bg={class:"cell-size"},wg={class:"cell-status"},Sg={class:"cell-actions"},xg={class:"cell-file"},kg={class:"file-icon"},Cg=["title"],Eg={class:"chip ext"},Ag={class:"cell-path"},Rg=["title","onClick"],Tg={class:"cell-size muted"},Og={class:"cell-status"},Pg=["title"],Ig={key:0,class:"spinner tiny"},$g={key:1},Mg={key:2,class:"row-error"},Ng={class:"cell-actions"},Dg=["onClick"],Fg=["onClick"],Vg=["onClick"],Lg=["title","onClick"],Hg={key:0,class:"params"},jg={class:"section-title"},Ug={class:"params-grid"},Bg={class:"param-label"},zg={key:1,class:"required"},Kg=["onUpdate:modelValue","data-testid"],Wg=["value"],Gg=["onUpdate:modelValue","min","max","data-testid"],qg={key:2,class:"watermark-editor"},Jg=["onUpdate:modelValue","data-testid"],Yg=["disabled"],Qg=["onUpdate:modelValue","type","data-testid"],Xg={key:4,class:"param-description"},Zg={class:"summary"},em={class:"batch-actions"},tm=["disabled"],sm={key:0,class:"spinner",style:{"border-color":"#ffffff88","border-top-color":"#fff"}},nm=Le({__name:"WorkbenchView",setup(e){const t=js(),s=uf(),n=Po(),o=ns({checking:t,activated:!0}),i=Io(),r=ne(ls[0].key),l=ns(Object.fromEntries(ls.map(v=>[v.key,{rows:[],selected:null,paramValues:{}}]))),a=ne("");function d(){s.push("/settings")}const u=v=>{Se.wxActivate(v).then(()=>{o.activated=!0}).catch(()=>{})},p=re(()=>ls.find(v=>v.key===r.value)),m=re(()=>l[r.value]),S=re(()=>wl(n.features,p.value)),F=re(()=>Di(n.features,p.value)),M=re(()=>{const v=Zh(S.value,m.value.rows.map(h=>h.ext)),w=m.value.rows[0]?Vi(n.features,m.value.rows[0].ext):void 0;return ep(v,w)}),W=re(()=>{var v;return m.value.selected?((v=n.byKey.get(m.value.selected.conversionKey))==null?void 0:v.params)??[]:[]}),N=re(()=>W.value.filter(v=>v.required&&String(m.value.paramValues[v.key]??"").trim()==="")),P=new Set(["pdf-merge","images-to-gif"]),D=re(()=>{var v;return P.has(((v=m.value.selected)==null?void 0:v.conversionKey)??"")});$t(()=>[r.value,M.value.map(v=>`${v.conversionKey}:${v.format}`).join("|")],()=>{const v=m.value.selected,w=v!==null&&M.value.some(h=>h.conversionKey===v.conversionKey&&h.format===v.format);m.value.selected=w?v:M.value[0]??null,V()});function V(){var w;const v={};for(const h of W.value)h.defaultValue!==void 0?v[h.key]=h.defaultValue:h.control==="preset"&&((w=h.presets)!=null&&w.length)&&(v[h.key]=h.presets[0].value);m.value.paramValues=v}function K(v){const w=m.value.selected;return(w==null?void 0:w.conversionKey)===v.conversionKey&&(w==null?void 0:w.format)===v.format}function q(v){m.value.selected=v,V()}function H(){const v={};for(const w of W.value){const h=m.value.paramValues[w.key];w.control==="preset"||w.control==="number"?typeof h=="number"&&Number.isFinite(h)&&(v[w.key]=h):typeof h=="string"&&h.trim()&&(v[w.key]=h.trim())}return v}function Z(v,w){var R;if(v.kind!=="operate")return v.format;const h=((R=n.byKey.get(v.conversionKey))==null?void 0:R.toFormats)??[];return h.includes(w.ext)?w.ext:h[0]??w.ext}const J=ne(""),de=ne(!1),be=ne(!1),me=ne(""),Ae=ne(),Ge=ne();function qe(v){return v.split(/[\\/]/).pop()??v}function ve(v){return bl[Vi(n.features,v)??"file"]??"file"}function te(v){const w=ls.find(h=>Di(n.features,h).has(v));return(w==null?void 0:w.label)??"其他"}function le(v,w,h){const R=v.trim();if(!R)return;const I=Xh(R);if(!F.value.has(I)){me.value=x.workbench.wrongTab.replace("{name}",qe(R)).replace("{tab}",`「${p.value.label}」`).replace("对应标签页",`「${te(I)}」标签页`);return}const B=h??qe(R);if(m.value.rows.some(oe=>oe.path===R||w!==void 0&&oe.name===B&&oe.size===w)){me.value=`${B} ${x.workbench.fileDuplicate}`;return}me.value="",m.value.rows.push({path:R,ext:I,name:B,status:"pending",...w!==void 0?{size:w}:{}})}function Je(){le(J.value),J.value=""}async function tt(v){if(v.length){be.value=!0,me.value="";try{for(const w of v){const h=w.path;if(h){le(h,w.size,w.name);continue}if(m.value.rows.some(I=>I.name===w.name&&I.size===w.size)){me.value=`${w.name} ${x.workbench.fileDuplicate}`;continue}const R=await Ni(w);le(R.inputPath,R.size,R.originalName)}}catch(w){me.value=w instanceof Error?w.message:"文件导入失败"}finally{be.value=!1,Ae.value&&(Ae.value.value="")}}}function Ye(v){tt(Array.from(v.target.files??[]))}function Pe(v){var w;de.value=!1,tt(Array.from(((w=v.dataTransfer)==null?void 0:w.files)??[]))}async function Dt(v){const w=Array.from(v.target.files??[])[0],h=W.value.find(R=>R.control==="file");if(!(!w||!h)){be.value=!0;try{const R=w.path;if(R)m.value.paramValues[h.key]=R;else{const I=await Ni(w);m.value.paramValues[h.key]=I.inputPath}}catch(R){me.value=R instanceof Error?R.message:"水印图片选择失败"}finally{be.value=!1,Ge.value&&(Ge.value.value="")}}}const Ue=ne(!1),st=re(()=>m.value.rows.filter(v=>v.status==="pending").length),He=re(()=>m.value.rows.some(v=>v.status==="success"||v.status==="failed")),A=re(()=>st.value>0&&m.value.selected!==null&&N.value.length===0&&!Ue.value);async function U(v){const w=m.value.selected;if(!(!w||D.value)){v.status="converting",v.targetFormat=Z(w,v),v.progress=0,v.error=void 0,v.output=void 0;try{const h=await Se.convert({inputPath:v.path,targetFormat:v.targetFormat,conversionKey:w.conversionKey,options:H()});v.taskId=h.taskId}catch(h){v.status="failed",v.error=h instanceof Error?h.message:"提交失败"}}}async function L(){const v=m.value.selected,w=m.value.rows.filter(h=>h.status==="pending");if(!(!v||!w.length||N.value.length)){if(Ue.value=!0,D.value){const h=w.map(R=>R.path);for(const R of w)R.status="converting",R.targetFormat=Z(v,R),R.error=void 0;try{const R=await Se.convert({inputPath:h[0],targetFormat:Z(v,w[0]),conversionKey:v.conversionKey,options:{...H(),inputs:h}});for(const I of w)I.taskId=R.taskId}catch(R){const I=R instanceof Error?R.message:"提交失败";for(const B of w)B.status="failed",B.error=I}}else for(const h of w)await U(h);Ue.value=!1}}$t(()=>i.tasks,v=>{var h;const w=new Map(v.map(R=>[R.taskId,R]));for(const R of ls)for(const I of l[R.key].rows){if(!I.taskId)continue;const B=w.get(I.taskId);B&&(B.status==="success"?(I.status="success",I.output=B.output,I.progress=100):B.status==="failed"?(I.status="failed",I.error=((h=B.error)==null?void 0:h.message)??"转换失败"):(I.status="converting",I.progress=B.progress??I.progress))}},{deep:!0});function Y(v){m.value.rows.splice(v,1)}function f(){m.value.rows=m.value.rows.filter(v=>v.status==="pending"||v.status==="converting")}async function g(v){try{await Se.revealPath(v.path)}catch(w){me.value=w instanceof Error?w.message:"打开目录失败"}}async function b(v){if(v.taskId)try{await Se.revealTask(v.taskId)}catch(w){me.value=w instanceof Error?w.message:"打开目录失败"}}function k(v){return v==="pending"?x.workbench.statusPending:v==="converting"?x.workbench.statusRunning:v==="success"?x.workbench.statusSuccess:x.workbench.statusFailed}const C=re(()=>[...F.value].slice(0,10).map(v=>v.toUpperCase()).join(" / ")),T=re(()=>[...F.value].map(v=>`.${v}`).join(","));let $;return os(()=>{t&&($=Ro().onMessage(v=>{v.type==="activation:revoked"&&(o.activated=!1,o.checking=!1)}),Se.wxStatus().then(v=>{o.activated=v.activated,a.value=v.pairCode,o.checking=!1}).catch(()=>{o.checking=!1}))}),bn(()=>{$==null||$()}),(v,w)=>(E(),O("section",Bp,[c("h1",zp,_(y(x).workbench.title),1),c("p",Kp,_(y(x).workbench.subtitle),1),y(t)?o.activated?(E(),O("div",Wp,[c("aside",Gp,[(E(!0),O(ie,null,Ee(y(ls),h=>(E(),O("button",{key:h.key,type:"button",class:_e(["tab-btn",{active:r.value===h.key}]),"data-testid":`tab-${h.key}`,onClick:R=>{r.value=h.key,me.value=""}},[z(Q,{name:h.icon,size:17},null,8,["name"]),c("span",Jp,_(h.label),1),l[h.key].rows.length?(E(),O("span",Yp,_(l[h.key].rows.length),1)):ee("",!0)],10,qp))),128))]),c("div",Qp,[c("div",{class:_e(["dropzone",{dragging:de.value,compact:m.value.rows.length>0}]),"data-testid":"dropzone",onDragover:w[2]||(w[2]=no(h=>de.value=!0,["prevent"])),onDragleave:w[3]||(w[3]=h=>de.value=!1),onDrop:no(Pe,["prevent"])},[m.value.rows.length?(E(),O(ie,{key:1},[z(Q,{name:"upload",size:15}),c("span",tg,_(y(x).workbench.dropCompact.replace("{tab}",p.value.label)),1)],64)):(E(),O(ie,{key:0},[c("span",Xp,[z(Q,{name:p.value.icon,size:30},null,8,["name"])]),c("strong",Zp,_(y(x).workbench.dropTitle.replace("{tab}",p.value.label)),1),c("p",eg,_(y(x).workbench.dropHint.replace("{exts}",C.value)),1)],64)),c("div",sg,[Pt(c("input",{"onUpdate:modelValue":w[0]||(w[0]=h=>J.value=h),type:"text",placeholder:y(x).workbench.pastePlaceholder,onKeydown:Wc(Je,["enter"])},null,40,ng),[[Ut,J.value]]),c("button",{class:"ghost",type:"button",disabled:!J.value.trim(),onClick:Je},[z(Q,{name:"plus",size:14}),j(_(y(x).workbench.addPath),1)],8,og),c("button",{class:"primary",type:"button",disabled:be.value,onClick:w[1]||(w[1]=h=>{var R;return(R=Ae.value)==null?void 0:R.click()})},[be.value?(E(),O("span",rg)):(E(),lt(Q,{key:0,name:"file",size:14})),j(" "+_(be.value?"导入中…":y(x).workbench.addFile),1)],8,ig)]),c("input",{ref_key:"fileInput",ref:Ae,type:"file",multiple:"",hidden:"",accept:T.value,onChange:Ye},null,40,lg)],34),me.value?(E(),O("p",ag,[z(Q,{name:"alert-circle",size:15}),j(_(me.value),1)])):ee("",!0),m.value.rows.length?(E(),O(ie,{key:1},[c("div",cg,[c("span",ug,_(y(x).workbench.convertTo),1),M.value.length?(E(),O("div",fg,[(E(!0),O(ie,null,Ee(M.value,h=>(E(),O("button",{key:`${h.conversionKey}:${h.format}`,type:"button",class:_e(["target-chip",{active:K(h)}]),"data-testid":"target-chip",onClick:R=>q(h)},_(y(Li)(M.value,h)),11,dg))),128))])):S.value.some(h=>h.available)?(E(),O("p",hg,[z(Q,{name:"alert-circle",size:15}),j(_(y(x).workbench.noCommonTargets),1)])):(E(),O("div",pg,[z(Q,{name:"alert-circle",size:15}),c("span",gg,_(y(x).workbench.noTools),1),c("button",{class:"btn primary goto-settings",type:"button","data-testid":"goto-settings",onClick:d},_(y(x).workbench.gotoSettings),1)]))]),c("div",mg,[c("table",vg,[c("thead",null,[c("tr",null,[c("th",yg,_(y(x).workbench.tableFile),1),c("th",_g,_(y(x).workbench.tablePath),1),c("th",bg,_(y(x).workbench.tableSize),1),c("th",wg,_(y(x).workbench.tableStatus),1),c("th",Sg,_(y(x).workbench.tableActions),1)])]),c("tbody",null,[(E(!0),O(ie,null,Ee(m.value.rows,(h,R)=>(E(),O("tr",{key:h.path,"data-testid":"file-row"},[c("td",xg,[c("span",kg,[z(Q,{name:ve(h.ext),size:16},null,8,["name"])]),c("span",{class:"file-name",title:h.path},_(h.name??qe(h.path)),9,Cg),c("span",Eg,_(h.ext?h.ext.toUpperCase():"?"),1)]),c("td",Ag,[c("button",{class:"path-link",type:"button","data-testid":"row-path",title:h.path,onClick:I=>g(h)},_(h.path),9,Rg)]),c("td",Tg,_(h.size!==void 0?y(tp)(h.size):"—"),1),c("td",Og,[c("span",{class:_e(["row-status",h.status]),title:h.error??""},[h.status==="converting"?(E(),O("span",Ig)):ee("",!0),j(" "+_(k(h.status))+" ",1),h.status==="converting"&&h.progress!==void 0?(E(),O("em",$g,_(h.progress)+"%",1)):ee("",!0),h.status==="failed"&&h.error?(E(),O("em",Mg,_(h.error),1)):ee("",!0)],10,Pg)]),c("td",Ng,[h.status==="pending"&&!D.value?(E(),O("button",{key:0,class:"ghost tiny",type:"button",onClick:I=>U(h)},_(y(x).workbench.convert),9,Dg)):ee("",!0),h.status==="failed"&&!D.value?(E(),O("button",{key:1,class:"ghost tiny",type:"button",onClick:I=>U(h)},_(y(x).workbench.retry),9,Fg)):ee("",!0),h.status==="success"?(E(),O("button",{key:2,class:"ghost tiny",type:"button",onClick:I=>b(h)},_(y(x).workbench.openFolder),9,Vg)):ee("",!0),c("button",{class:"icon-btn",type:"button",title:y(x).workbench.remove,onClick:I=>Y(R)},[z(Q,{name:"x",size:14})],8,Lg)])]))),128))])])]),W.value.length?(E(),O("div",Hg,[c("div",jg,_(y(x).workbench.paramsTitle),1),c("div",Ug,[(E(!0),O(ie,null,Ee(W.value,h=>(E(),O("label",{key:h.key,class:_e(["param-field",{wide:h.control==="file"}])},[c("span",Bg,[j(_(h.label),1),h.unit?(E(),O(ie,{key:0},[j("("+_(h.unit)+")",1)],64)):ee("",!0),h.required?(E(),O("i",zg,"*")):ee("",!0)]),h.control==="preset"?Pt((E(),O("select",{key:0,"onUpdate:modelValue":R=>m.value.paramValues[h.key]=R,"data-testid":`param-${h.key}`},[(E(!0),O(ie,null,Ee(h.presets??[],R=>(E(),O("option",{key:R.value,value:R.value},_(R.label),9,Wg))),128))],8,Kg)),[[Eo,m.value.paramValues[h.key]]]):h.control==="number"?Pt((E(),O("input",{key:1,"onUpdate:modelValue":R=>m.value.paramValues[h.key]=R,type:"number",min:h.min,max:h.max,placeholder:"不调整","data-testid":`param-${h.key}`},null,8,Gg)),[[Ut,m.value.paramValues[h.key],void 0,{number:!0}]]):h.control==="file"?(E(),O("div",qg,[Pt(c("input",{"onUpdate:modelValue":R=>m.value.paramValues[h.key]=R,type:"text",placeholder:"选择或粘贴水印图片路径","data-testid":`param-${h.key}`},null,8,Jg),[[Ut,m.value.paramValues[h.key],void 0,{trim:!0}]]),c("button",{class:"ghost",type:"button",disabled:be.value,onClick:w[4]||(w[4]=R=>{var I;return(I=Ge.value)==null?void 0:I.click()})},_(y(x).workbench.chooseFile),9,Yg),c("input",{ref_for:!0,ref_key:"watermarkInput",ref:Ge,type:"file",hidden:"",accept:"image/*",onChange:Dt},null,544)])):Pt((E(),O("input",{key:3,"onUpdate:modelValue":R=>m.value.paramValues[h.key]=R,type:h.control==="password"?"password":"text","data-testid":`param-${h.key}`},null,8,Qg)),[[jc,m.value.paramValues[h.key],void 0,{trim:!0}]]),h.description?(E(),O("small",Xg,_(h.description),1)):ee("",!0)],2))),128))])])):ee("",!0),c("div",{class:_e(["batch-bar",{disabled:!A.value}])},[c("span",Zg,[w[5]||(w[5]=j(" 待转换 ",-1)),c("strong",null,_(st.value),1),j(" 个 → "+_(m.value.selected?y(Li)(M.value,m.value.selected):"—"),1)]),c("div",em,[He.value?(E(),O("button",{key:0,class:"ghost",type:"button",onClick:f},"清除已完成")):ee("",!0),c("button",{class:"primary batch",type:"button","data-testid":"batch-convert",disabled:!A.value,onClick:L},[Ue.value?(E(),O("span",sm)):ee("",!0),j(" "+_(Ue.value?"转换中…":y(x).workbench.batchConvertN.replace("{n}",String(st.value))),1)],8,tm)])],2)],64)):ee("",!0)])])):(E(),lt(Up,{key:1,"pair-code":a.value,"data-testid":"follow-gate",onActivated:u},null,8,["pair-code"])):(E(),lt(Mp,{key:0}))]))}}),om=et(nm,[["__scopeId","data-v-0ef3c707"]]),im=cf({history:Uu(),routes:[{path:"/",name:"landing",component:Gd},{path:"/workbench",name:"workbench",component:om},{path:"/history",name:"history",component:sd},{path:"/settings",name:"settings",component:qh},{path:"/:pathMatch(.*)*",redirect:"/"}]});Jc(Of).use(Xc()).use(im).mount("#app");
|
package/web/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>嘟嘟转换器 · 本地万能文件转换</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-BksKydDU.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-CN6wW0-Y.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|