Xin Zhang
commited on
Commit
·
b11033f
1
Parent(s):
9e942a1
[fix]: web bugfix.
Browse files
config/hotwords.json
CHANGED
|
@@ -20,6 +20,10 @@
|
|
| 20 |
"它跟face": "huggingface",
|
| 21 |
"拉么index": "LlamaIndex",
|
| 22 |
"lama index": "LlamaIndex",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
"rug": "RAG",
|
| 24 |
"defive": "Dify",
|
| 25 |
"define": "Dify",
|
|
@@ -29,6 +33,8 @@
|
|
| 29 |
"Open manners": "open manus",
|
| 30 |
"Deep wisdom":"DeepWisdom",
|
| 31 |
"meta GPT": "MetaGPT",
|
|
|
|
|
|
|
| 32 |
"RAG flow": "RAGFlow",
|
| 33 |
"RAG floor": "RAGFlow",
|
| 34 |
"rig floor": "RAGFlow",
|
|
|
|
| 20 |
"它跟face": "huggingface",
|
| 21 |
"拉么index": "LlamaIndex",
|
| 22 |
"lama index": "LlamaIndex",
|
| 23 |
+
"feature为": "futurewei",
|
| 24 |
+
"future为": "futurewei",
|
| 25 |
+
"future维": "futurewei",
|
| 26 |
+
"feature维": "futurewei",
|
| 27 |
"rug": "RAG",
|
| 28 |
"defive": "Dify",
|
| 29 |
"define": "Dify",
|
|
|
|
| 33 |
"Open manners": "open manus",
|
| 34 |
"Deep wisdom":"DeepWisdom",
|
| 35 |
"meta GPT": "MetaGPT",
|
| 36 |
+
"rag flu": "RAGFlow",
|
| 37 |
+
"rug flu": "RAGFlow",
|
| 38 |
"RAG flow": "RAGFlow",
|
| 39 |
"RAG floor": "RAGFlow",
|
| 40 |
"rig floor": "RAGFlow",
|
frontend/assets/{index-a2d5d83f.css → index-b1f15c01.css}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;height:auto;min-height:auto;color:#333;background:#fff}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}.card{border-bottom:solid 2px lightgray;align-items:center;justify-content:center;margin-top:40px;display:flex;max-width:1024px;width:100%}.seg-title{margin:24px 0;font-size:20px;font-weight:500}.seg-co{width:1022px;text-align:left;border-left:solid 6px midnightblue;padding-left:8px;margin-left:2px;margin-top:36px;line-height:24px}#app{margin:0 auto;padding:0;text-align:center;width:100%}.ant-btn{padding:4px 12px}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.ant-card{background:#f5f6fa}.ant-card .ant-card-actions{background-color:#e8e8f8cc!important}.ant-popover{max-width:800px!important}.ant-form-item{background:transparent;margin-bottom:40px!important}.ant-form-item .ant-form-item-explain-error{color:#ff4d4f;text-align:left!important}.ant-form-item-label label{font-size:18px!important;color:#1a1a1a!important;font-weight:500!important}.ant-tooltip{max-width:1022px!important}.ant-page-header-heading{width:1022px!important}.highlight{background:ghostwhite}.content[data-v-66032ad7]{background-color:#fff;max-width:1280px;min-height:720px;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:space-between}.not-found-wrapper[data-v-aef52a59]{height:calc(100vh - 104px)}.config-content[data-v-
|
|
|
|
| 1 |
+
html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;height:auto;min-height:auto;color:#333;background:#fff}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}.card{border-bottom:solid 2px lightgray;align-items:center;justify-content:center;margin-top:40px;display:flex;max-width:1024px;width:100%}.seg-title{margin:24px 0;font-size:20px;font-weight:500}.seg-co{width:1022px;text-align:left;border-left:solid 6px midnightblue;padding-left:8px;margin-left:2px;margin-top:36px;line-height:24px}#app{margin:0 auto;padding:0;text-align:center;width:100%}.ant-btn{padding:4px 12px}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.ant-card{background:#f5f6fa}.ant-card .ant-card-actions{background-color:#e8e8f8cc!important}.ant-popover{max-width:800px!important}.ant-form-item{background:transparent;margin-bottom:40px!important}.ant-form-item .ant-form-item-explain-error{color:#ff4d4f;text-align:left!important}.ant-form-item-label label{font-size:18px!important;color:#1a1a1a!important;font-weight:500!important}.ant-tooltip{max-width:1022px!important}.ant-page-header-heading{width:1022px!important}.highlight{background:ghostwhite}.content[data-v-66032ad7]{background-color:#fff;max-width:1280px;min-height:720px;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:space-between}.not-found-wrapper[data-v-aef52a59]{height:calc(100vh - 104px)}.config-content[data-v-3a741d94]{width:420px;margin:12px}.config-content .config-block[data-v-3a741d94]{margin:12px;padding-bottom:12px}.sessions[data-v-3a741d94]{width:100%;height:100%;min-height:50vh;max-height:80vh;overflow-y:scroll;margin-top:24px;display:flex;flex-direction:column;justify-content:flex-start}.sessions .session-node[data-v-3a741d94]{width:100%;height:100%;display:flex;justify-content:space-between;align-items:center;padding:12px;margin-bottom:12px;background-color:#f0f1f7;border-radius:4px}.sessions .session-node .content[data-v-3a741d94]{display:flex;flex-direction:column;justify-content:center;align-items:self-start}.sessions .session-node .content .content-title[data-v-3a741d94]{font-size:18px;font-weight:700;color:#2e2f33}.sessions .session-node .content .content-text[data-v-3a741d94]{font-size:18px;font-weight:500;color:#2e2f33}.sessions .session-node .content .content-outline[data-v-3a741d94]{width:100%}.sessions .session-node .content .content-outline .outline-line[data-v-3a741d94]{font-size:16px;font-weight:500;color:#909299;margin:8px 0 4px}.sessions .session-node .session-action[data-v-3a741d94]{width:96px;display:flex;justify-content:space-around;align-items:center}.sessions .session-node .session-action .ant-btn-primary[data-v-3a741d94]{background-color:#1890ff!important;border-color:#1890ff!important}.view-wrapper[data-v-3a741d94]{width:100%;height:100%;background-color:#fff}.view-wrapper .wrapper-width-fixed[data-v-3a741d94]{width:1280px}.view-wrapper .wrapper-width-auto[data-v-3a741d94]{width:100vw}.view-wrapper .content-wrapper[data-v-3a741d94]{text-align:left;max-width:100vw;min-width:320px;margin-bottom:64px;min-height:calc(100vh - 438px)}.view-wrapper .content-wrapper .chat-box[data-v-3a741d94]{width:100%;height:54vh;border-radius:4px;padding:12px;color:#2e2f33;font-size:18px}.view-wrapper .content-wrapper .chat-box-placeholder[data-v-3a741d94]{width:100%;height:58vh;border-radius:4px;padding:12px;font-size:18px;color:#a4a6ac}.view-wrapper .content-wrapper .actions-box[data-v-3a741d94]{display:flex;align-items:center;justify-content:space-between;margin:0 24px;height:48px}.view-wrapper .content-wrapper .actions-box .left-actions[data-v-3a741d94]{display:flex;align-items:center;justify-content:space-between;width:332px}.view-wrapper .content-wrapper .actions-box .right-actions[data-v-3a741d94]{display:flex;align-items:center;justify-content:space-between;width:108px}.view-wrapper .content-wrapper .trans-list[data-v-3a741d94]{overflow-y:auto;width:100%;height:58vh;scrollbar-width:none;-ms-overflow-style:none}.view-wrapper .content-wrapper .trans-list[data-v-3a741d94]::-webkit-scrollbar{display:none}.view-wrapper .content-wrapper .trans-list .node[data-v-3a741d94]{margin-bottom:36px;width:100%!important;transition:all .3s ease}.view-wrapper .content-wrapper .trans-list .node .trans-time[data-v-3a741d94]{font-size:14px;color:#c4c6cc}.view-wrapper .content-wrapper .trans-list .node .trans-font-size-16[data-v-3a741d94]{font-size:16px}.view-wrapper .content-wrapper .trans-list .node .trans-font-size-18[data-v-3a741d94]{font-size:18px}.view-wrapper .content-wrapper .trans-list .node .trans-font-size-20[data-v-3a741d94]{font-size:20px}.view-wrapper .content-wrapper .trans-list .node .trans-font-size-22[data-v-3a741d94]{font-size:22px}.view-wrapper .content-wrapper .trans-list .node .trans-font-size-24[data-v-3a741d94]{font-size:24px}.view-wrapper .content-wrapper .trans-list .node .trans-src-lang[data-v-3a741d94]{color:#909299;font-weight:500}.view-wrapper .content-wrapper .trans-list .node .trans-dst-lang[data-v-3a741d94]{color:#2e2f33;font-weight:600}.view-wrapper .content-wrapper .trans-list .current_node[data-v-3a741d94]{background-color:#f0f1f7;padding:4px 8px}@keyframes highlight-3a741d94{0%{background-color:transparent}50%{background-color:#fff1ce80}to{background-color:transparent}}@keyframes slideIn-3a741d94{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.content-wrapper[data-v-d41c9ce7]{text-align:left;max-width:800px;min-width:320px;margin-bottom:64px;min-height:calc(100vh - 438px)}.content-wrapper .content-box[data-v-d41c9ce7]{padding:24px;height:240px;background-color:#e8e8e8;border-radius:16px;width:50%;margin:48px auto;min-width:300px}.content-wrapper .video-box[data-v-d41c9ce7]{max-width:800px;min-width:320px;width:90vw;height:auto}
|
frontend/assets/{index-deba56bb.js → index-fc3a0f87.js}
RENAMED
|
@@ -494,9 +494,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
| 494 |
* @license MIT
|
| 495 |
*/const ql=typeof document<"u";function mye(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const Pt=Object.assign;function sv(e,t){const n={};for(const o in t){const r=t[o];n[o]=qo(r)?r.map(e):e(r)}return n}const Us=()=>{},qo=Array.isArray,w_=/#/g,bye=/&/g,yye=/\//g,Sye=/=/g,$ye=/\?/g,O_=/\+/g,Cye=/%5B/g,xye=/%5D/g,P_=/%5E/g,wye=/%60/g,I_=/%7B/g,Oye=/%7C/g,T_=/%7D/g,Pye=/%20/g;function DS(e){return encodeURI(""+e).replace(Oye,"|").replace(Cye,"[").replace(xye,"]")}function Iye(e){return DS(e).replace(I_,"{").replace(T_,"}").replace(P_,"^")}function l0(e){return DS(e).replace(O_,"%2B").replace(Pye,"+").replace(w_,"%23").replace(bye,"%26").replace(wye,"`").replace(I_,"{").replace(T_,"}").replace(P_,"^")}function Tye(e){return l0(e).replace(Sye,"%3D")}function Eye(e){return DS(e).replace(w_,"%23").replace($ye,"%3F")}function Mye(e){return e==null?"":Eye(e).replace(yye,"%2F")}function Tc(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const _ye=/\/$/,Aye=e=>e.replace(_ye,"");function cv(e,t,n="/"){let o,r={},i="",l="";const a=t.indexOf("#");let s=t.indexOf("?");return a<s&&a>=0&&(s=-1),s>-1&&(o=t.slice(0,s),i=t.slice(s+1,a>-1?a:t.length),r=e(i)),a>-1&&(o=o||t.slice(0,a),l=t.slice(a,t.length)),o=Bye(o??t,n),{fullPath:o+(i&&"?")+i+l,path:o,query:r,hash:Tc(l)}}function Rye(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function N3(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Dye(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&Na(t.matched[o],n.matched[r])&&E_(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Na(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function E_(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Nye(e[n],t[n]))return!1;return!0}function Nye(e,t){return qo(e)?B3(e,t):qo(t)?B3(t,e):e===t}function B3(e,t){return qo(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function Bye(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,l,a;for(l=0;l<o.length;l++)if(a=o[l],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(l).join("/")}const ri={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Ec;(function(e){e.pop="pop",e.push="push"})(Ec||(Ec={}));var Gs;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Gs||(Gs={}));function kye(e){if(!e)if(ql){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Aye(e)}const Fye=/^[^#]+#/;function Lye(e,t){return e.replace(Fye,"#")+t}function zye(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const xh=()=>({left:window.scrollX,top:window.scrollY});function Hye(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=zye(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function k3(e,t){return(history.state?history.state.position-t:-1)+e}const a0=new Map;function jye(e,t){a0.set(e,t)}function Wye(e){const t=a0.get(e);return a0.delete(e),t}let Vye=()=>location.protocol+"//"+location.host;function M_(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let a=r.includes(e.slice(i))?e.slice(i).length:1,s=r.slice(a);return s[0]!=="/"&&(s="/"+s),N3(s,"")}return N3(n,e)+o+r}function Kye(e,t,n,o){let r=[],i=[],l=null;const a=({state:f})=>{const h=M_(e,location),v=n.value,g=t.value;let b=0;if(f){if(n.value=h,t.value=f,l&&l===v){l=null;return}b=g?f.position-g.position:0}else o(h);r.forEach(y=>{y(n.value,v,{delta:b,type:Ec.pop,direction:b?b>0?Gs.forward:Gs.back:Gs.unknown})})};function s(){l=n.value}function c(f){r.push(f);const h=()=>{const v=r.indexOf(f);v>-1&&r.splice(v,1)};return i.push(h),h}function u(){const{history:f}=window;f.state&&f.replaceState(Pt({},f.state,{scroll:xh()}),"")}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:s,listen:c,destroy:d}}function F3(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?xh():null}}function Uye(e){const{history:t,location:n}=window,o={value:M_(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(s,c,u){const d=e.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+s:Vye()+e+s;try{t[u?"replaceState":"pushState"](c,"",f),r.value=c}catch(h){console.error(h),n[u?"replace":"assign"](f)}}function l(s,c){const u=Pt({},t.state,F3(r.value.back,s,r.value.forward,!0),c,{position:r.value.position});i(s,u,!0),o.value=s}function a(s,c){const u=Pt({},r.value,t.state,{forward:s,scroll:xh()});i(u.current,u,!0);const d=Pt({},F3(o.value,s,null),{position:u.position+1},c);i(s,d,!1),o.value=s}return{location:o,state:r,push:a,replace:l}}function Gye(e){e=kye(e);const t=Uye(e),n=Kye(e,t.state,t.location,t.replace);function o(i,l=!0){l||n.pauseListeners(),history.go(i)}const r=Pt({location:"",base:e,go:o,createHref:Lye.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Xye(e){return typeof e=="string"||e&&typeof e=="object"}function __(e){return typeof e=="string"||typeof e=="symbol"}const A_=Symbol("");var L3;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(L3||(L3={}));function Ba(e,t){return Pt(new Error,{type:e,[A_]:!0},t)}function Cr(e,t){return e instanceof Error&&A_ in e&&(t==null||!!(e.type&t))}const z3="[^/]+?",Yye={sensitive:!1,strict:!1,start:!0,end:!0},qye=/[.+*?^${}()[\]/\\]/g;function Zye(e,t){const n=Pt({},Yye,t),o=[];let r=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[90];n.strict&&!c.length&&(r+="/");for(let d=0;d<c.length;d++){const f=c[d];let h=40+(n.sensitive?.25:0);if(f.type===0)d||(r+="/"),r+=f.value.replace(qye,"\\$&"),h+=40;else if(f.type===1){const{value:v,repeatable:g,optional:b,regexp:y}=f;i.push({name:v,repeatable:g,optional:b});const S=y||z3;if(S!==z3){h+=10;try{new RegExp(`(${S})`)}catch(x){throw new Error(`Invalid custom RegExp for param "${v}" (${S}): `+x.message)}}let $=g?`((?:${S})(?:/(?:${S}))*)`:`(${S})`;d||($=b&&c.length<2?`(?:/${$})`:"/"+$),b&&($+="?"),r+=$,h+=20,b&&(h+=-8),g&&(h+=-20),S===".*"&&(h+=-50)}u.push(h)}o.push(u)}if(n.strict&&n.end){const c=o.length-1;o[c][o[c].length-1]+=.7000000000000001}n.strict||(r+="/?"),n.end?r+="$":n.strict&&(r+="(?:/|$)");const l=new RegExp(r,n.sensitive?"":"i");function a(c){const u=c.match(l),d={};if(!u)return null;for(let f=1;f<u.length;f++){const h=u[f]||"",v=i[f-1];d[v.name]=h&&v.repeatable?h.split("/"):h}return d}function s(c){let u="",d=!1;for(const f of e){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const h of f)if(h.type===0)u+=h.value;else if(h.type===1){const{value:v,repeatable:g,optional:b}=h,y=v in c?c[v]:"";if(qo(y)&&!g)throw new Error(`Provided param "${v}" is an array but it is not repeatable (* or + modifiers)`);const S=qo(y)?y.join("/"):y;if(!S)if(b)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${v}"`);u+=S}}return u||"/"}return{re:l,score:o,keys:i,parse:a,stringify:s}}function Qye(e,t){let n=0;for(;n<e.length&&n<t.length;){const o=t[n]-e[n];if(o)return o;n++}return e.length<t.length?e.length===1&&e[0]===40+40?-1:1:e.length>t.length?t.length===1&&t[0]===40+40?1:-1:0}function R_(e,t){let n=0;const o=e.score,r=t.score;for(;n<o.length&&n<r.length;){const i=Qye(o[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-o.length)===1){if(H3(o))return 1;if(H3(r))return-1}return r.length-o.length}function H3(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Jye={type:0,value:""},e1e=/[a-zA-Z0-9_]/;function t1e(e){if(!e)return[[]];if(e==="/")return[[Jye]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=0,o=n;const r=[];let i;function l(){i&&r.push(i),i=[]}let a=0,s,c="",u="";function d(){c&&(n===0?i.push({type:0,value:c}):n===1||n===2||n===3?(i.length>1&&(s==="*"||s==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:c,regexp:u,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=s}for(;a<e.length;){if(s=e[a++],s==="\\"&&n!==2){o=n,n=4;continue}switch(n){case 0:s==="/"?(c&&d(),l()):s===":"?(d(),n=1):f();break;case 4:f(),n=o;break;case 1:s==="("?n=2:e1e.test(s)?f():(d(),n=0,s!=="*"&&s!=="?"&&s!=="+"&&a--);break;case 2:s===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+s:n=3:u+=s;break;case 3:d(),n=0,s!=="*"&&s!=="?"&&s!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${c}"`),d(),l(),r}function n1e(e,t,n){const o=Zye(t1e(e.path),n),r=Pt(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function o1e(e,t){const n=[],o=new Map;t=V3({strict:!1,end:!0,sensitive:!1},t);function r(d){return o.get(d)}function i(d,f,h){const v=!h,g=r1e(d);g.aliasOf=h&&h.record;const b=V3(t,d),y=[g];if("alias"in d){const x=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of x)y.push(Pt({},g,{components:h?h.record.components:g.components,path:C,aliasOf:h?h.record:g}))}let S,$;for(const x of y){const{path:C}=x;if(f&&C[0]!=="/"){const O=f.record.path,w=O[O.length-1]==="/"?"":"/";x.path=f.record.path+(C&&w+C)}if(S=n1e(x,f,b),h?h.alias.push(S):($=$||S,$!==S&&$.alias.push(S),v&&d.name&&!W3(S)&&l(d.name)),D_(S)&&s(S),g.children){const O=g.children;for(let w=0;w<O.length;w++)i(O[w],S,h&&h.children[w])}h=h||S}return $?()=>{l($)}:Us}function l(d){if(__(d)){const f=o.get(d);f&&(o.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(l),f.alias.forEach(l))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&o.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function a(){return n}function s(d){const f=a1e(d,n);n.splice(f,0,d),d.record.name&&!W3(d)&&o.set(d.record.name,d)}function c(d,f){let h,v={},g,b;if("name"in d&&d.name){if(h=o.get(d.name),!h)throw Ba(1,{location:d});b=h.record.name,v=Pt(j3(f.params,h.keys.filter($=>!$.optional).concat(h.parent?h.parent.keys.filter($=>$.optional):[]).map($=>$.name)),d.params&&j3(d.params,h.keys.map($=>$.name))),g=h.stringify(v)}else if(d.path!=null)g=d.path,h=n.find($=>$.re.test(g)),h&&(v=h.parse(g),b=h.record.name);else{if(h=f.name?o.get(f.name):n.find($=>$.re.test(f.path)),!h)throw Ba(1,{location:d,currentLocation:f});b=h.record.name,v=Pt({},f.params,d.params),g=h.stringify(v)}const y=[];let S=h;for(;S;)y.unshift(S.record),S=S.parent;return{name:b,path:g,params:v,matched:y,meta:l1e(y)}}e.forEach(d=>i(d));function u(){n.length=0,o.clear()}return{addRoute:i,resolve:c,removeRoute:l,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function j3(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function r1e(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:i1e(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function i1e(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function W3(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function l1e(e){return e.reduce((t,n)=>Pt(t,n.meta),{})}function V3(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function a1e(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;R_(e,t[i])<0?o=i:n=i+1}const r=s1e(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function s1e(e){let t=e;for(;t=t.parent;)if(D_(t)&&R_(e,t)===0)return t}function D_({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function c1e(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<o.length;++r){const i=o[r].replace(O_," "),l=i.indexOf("="),a=Tc(l<0?i:i.slice(0,l)),s=l<0?null:Tc(i.slice(l+1));if(a in t){let c=t[a];qo(c)||(c=t[a]=[c]),c.push(s)}else t[a]=s}return t}function K3(e){let t="";for(let n in e){const o=e[n];if(n=Tye(n),o==null){o!==void 0&&(t+=(t.length?"&":"")+n);continue}(qo(o)?o.map(i=>i&&l0(i)):[o&&l0(o)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function u1e(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=qo(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const d1e=Symbol(""),U3=Symbol(""),NS=Symbol(""),N_=Symbol(""),s0=Symbol("");function ps(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ui(e,t,n,o,r,i=l=>l()){const l=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((a,s)=>{const c=f=>{f===!1?s(Ba(4,{from:n,to:t})):f instanceof Error?s(f):Xye(f)?s(Ba(2,{from:t,to:f})):(l&&o.enterCallbacks[r]===l&&typeof f=="function"&&l.push(f),a())},u=i(()=>e.call(o&&o.instances[r],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(f=>s(f))})}function uv(e,t,n,o,r=i=>i()){const i=[];for(const l of e)for(const a in l.components){let s=l.components[a];if(!(t!=="beforeRouteEnter"&&!l.instances[a]))if(f1e(s)){const u=(s.__vccOpts||s)[t];u&&i.push(ui(u,n,o,l,a,r))}else{let c=s();i.push(()=>c.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${l.path}"`));const d=mye(u)?u.default:u;l.components[a]=d;const h=(d.__vccOpts||d)[t];return h&&ui(h,n,o,l,a,r)()}))}}return i}function f1e(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function G3(e){const t=Ve(NS),n=Ve(N_),o=I(()=>{const s=It(e.to);return t.resolve(s)}),r=I(()=>{const{matched:s}=o.value,{length:c}=s,u=s[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(Na.bind(null,u));if(f>-1)return f;const h=X3(s[c-2]);return c>1&&X3(u)===h&&d[d.length-1].path!==h?d.findIndex(Na.bind(null,s[c-2])):f}),i=I(()=>r.value>-1&&v1e(n.params,o.value.params)),l=I(()=>r.value>-1&&r.value===n.matched.length-1&&E_(n.params,o.value.params));function a(s={}){return g1e(s)?t[It(e.replace)?"replace":"push"](It(e.to)).catch(Us):Promise.resolve()}return{route:o,href:I(()=>o.value.href),isActive:i,isExactActive:l,navigate:a}}const p1e=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"}},useLink:G3,setup(e,{slots:t}){const n=ct(G3(e)),{options:o}=Ve(NS),r=I(()=>({[Y3(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[Y3(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:$a("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),h1e=p1e;function g1e(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 v1e(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!qo(r)||r.length!==o.length||o.some((i,l)=>i!==r[l]))return!1}return!0}function X3(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Y3=(e,t,n)=>e??t??n,m1e=le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=Ve(s0),r=I(()=>e.route||o.value),i=Ve(U3,0),l=I(()=>{let c=It(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=I(()=>r.value.matched[l.value]);Ge(U3,I(()=>l.value+1)),Ge(d1e,a),Ge(s0,r);const s=ne();return be(()=>[s.value,a.value,e.name],([c,u,d],[f,h,v])=>{u&&(u.instances[d]=c,h&&h!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Na(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(g=>g(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,d=a.value,f=d&&d.components[u];if(!f)return q3(n.default,{Component:f,route:c});const h=d.props[u],v=h?h===!0?c.params:typeof h=="function"?h(c):h:null,b=$a(f,Pt({},v,t,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(d.instances[u]=null)},ref:s}));return q3(n.default,{Component:b,route:c})||b}}});function q3(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const b1e=m1e;function y1e(e){const t=o1e(e.routes,e),n=e.parseQuery||c1e,o=e.stringifyQuery||K3,r=e.history,i=ps(),l=ps(),a=ps(),s=oe(ri);let c=ri;ql&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=sv.bind(null,G=>""+G),d=sv.bind(null,Mye),f=sv.bind(null,Tc);function h(G,ee){let X,V;return __(G)?(X=t.getRecordMatcher(G),V=ee):V=G,t.addRoute(V,X)}function v(G){const ee=t.getRecordMatcher(G);ee&&t.removeRoute(ee)}function g(){return t.getRoutes().map(G=>G.record)}function b(G){return!!t.getRecordMatcher(G)}function y(G,ee){if(ee=Pt({},ee||s.value),typeof G=="string"){const Q=cv(n,G,ee.path),ae=t.resolve({path:Q.path},ee),ie=r.createHref(Q.fullPath);return Pt(Q,ae,{params:f(ae.params),hash:Tc(Q.hash),redirectedFrom:void 0,href:ie})}let X;if(G.path!=null)X=Pt({},G,{path:cv(n,G.path,ee.path).path});else{const Q=Pt({},G.params);for(const ae in Q)Q[ae]==null&&delete Q[ae];X=Pt({},G,{params:d(Q)}),ee.params=d(ee.params)}const V=t.resolve(X,ee),Y=G.hash||"";V.params=u(f(V.params));const W=Rye(o,Pt({},G,{hash:Iye(Y),path:V.path})),U=r.createHref(W);return Pt({fullPath:W,hash:Y,query:o===K3?u1e(G.query):G.query||{}},V,{redirectedFrom:void 0,href:U})}function S(G){return typeof G=="string"?cv(n,G,s.value.path):Pt({},G)}function $(G,ee){if(c!==G)return Ba(8,{from:ee,to:G})}function x(G){return w(G)}function C(G){return x(Pt(S(G),{replace:!0}))}function O(G){const ee=G.matched[G.matched.length-1];if(ee&&ee.redirect){const{redirect:X}=ee;let V=typeof X=="function"?X(G):X;return typeof V=="string"&&(V=V.includes("?")||V.includes("#")?V=S(V):{path:V},V.params={}),Pt({query:G.query,hash:G.hash,params:V.path!=null?{}:G.params},V)}}function w(G,ee){const X=c=y(G),V=s.value,Y=G.state,W=G.force,U=G.replace===!0,Q=O(X);if(Q)return w(Pt(S(Q),{state:typeof Q=="object"?Pt({},Y,Q.state):Y,force:W,replace:U}),ee||X);const ae=X;ae.redirectedFrom=ee;let ie;return!W&&Dye(o,V,X)&&(ie=Ba(16,{to:ae,from:V}),z(V,V,!0,!1)),(ie?Promise.resolve(ie):M(ae,V)).catch(de=>Cr(de)?Cr(de,2)?de:L(de):k(de,ae,V)).then(de=>{if(de){if(Cr(de,2))return w(Pt({replace:U},S(de.to),{state:typeof de.to=="object"?Pt({},Y,de.to.state):Y,force:W}),ee||ae)}else de=A(ae,V,!0,U,Y);return E(ae,V,de),de})}function P(G,ee){const X=$(G,ee);return X?Promise.reject(X):Promise.resolve()}function T(G){const ee=J.values().next().value;return ee&&typeof ee.runWithContext=="function"?ee.runWithContext(G):G()}function M(G,ee){let X;const[V,Y,W]=S1e(G,ee);X=uv(V.reverse(),"beforeRouteLeave",G,ee);for(const Q of V)Q.leaveGuards.forEach(ae=>{X.push(ui(ae,G,ee))});const U=P.bind(null,G,ee);return X.push(U),te(X).then(()=>{X=[];for(const Q of i.list())X.push(ui(Q,G,ee));return X.push(U),te(X)}).then(()=>{X=uv(Y,"beforeRouteUpdate",G,ee);for(const Q of Y)Q.updateGuards.forEach(ae=>{X.push(ui(ae,G,ee))});return X.push(U),te(X)}).then(()=>{X=[];for(const Q of W)if(Q.beforeEnter)if(qo(Q.beforeEnter))for(const ae of Q.beforeEnter)X.push(ui(ae,G,ee));else X.push(ui(Q.beforeEnter,G,ee));return X.push(U),te(X)}).then(()=>(G.matched.forEach(Q=>Q.enterCallbacks={}),X=uv(W,"beforeRouteEnter",G,ee,T),X.push(U),te(X))).then(()=>{X=[];for(const Q of l.list())X.push(ui(Q,G,ee));return X.push(U),te(X)}).catch(Q=>Cr(Q,8)?Q:Promise.reject(Q))}function E(G,ee,X){a.list().forEach(V=>T(()=>V(G,ee,X)))}function A(G,ee,X,V,Y){const W=$(G,ee);if(W)return W;const U=ee===ri,Q=ql?history.state:{};X&&(V||U?r.replace(G.fullPath,Pt({scroll:U&&Q&&Q.scroll},Y)):r.push(G.fullPath,Y)),s.value=G,z(G,ee,X,U),L()}let R;function H(){R||(R=r.listen((G,ee,X)=>{if(!q.listening)return;const V=y(G),Y=O(V);if(Y){w(Pt(Y,{replace:!0}),V).catch(Us);return}c=V;const W=s.value;ql&&jye(k3(W.fullPath,X.delta),xh()),M(V,W).catch(U=>Cr(U,12)?U:Cr(U,2)?(w(U.to,V).then(Q=>{Cr(Q,20)&&!X.delta&&X.type===Ec.pop&&r.go(-1,!1)}).catch(Us),Promise.reject()):(X.delta&&r.go(-X.delta,!1),k(U,V,W))).then(U=>{U=U||A(V,W,!1),U&&(X.delta&&!Cr(U,8)?r.go(-X.delta,!1):X.type===Ec.pop&&Cr(U,20)&&r.go(-1,!1)),E(V,W,U)}).catch(Us)}))}let _=ps(),N=ps(),B;function k(G,ee,X){L(G);const V=N.list();return V.length?V.forEach(Y=>Y(G,ee,X)):console.error(G),Promise.reject(G)}function F(){return B&&s.value!==ri?Promise.resolve():new Promise((G,ee)=>{_.add([G,ee])})}function L(G){return B||(B=!G,H(),_.list().forEach(([ee,X])=>G?X(G):ee()),_.reset()),G}function z(G,ee,X,V){const{scrollBehavior:Y}=e;if(!ql||!Y)return Promise.resolve();const W=!X&&Wye(k3(G.fullPath,0))||(V||!X)&&history.state&&history.state.scroll||null;return ot().then(()=>Y(G,ee,W)).then(U=>U&&Hye(U)).catch(U=>k(U,G,ee))}const j=G=>r.go(G);let Z;const J=new Set,q={currentRoute:s,listening:!0,addRoute:h,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:b,getRoutes:g,resolve:y,options:e,push:x,replace:C,go:j,back:()=>j(-1),forward:()=>j(1),beforeEach:i.add,beforeResolve:l.add,afterEach:a.add,onError:N.add,isReady:F,install(G){const ee=this;G.component("RouterLink",h1e),G.component("RouterView",b1e),G.config.globalProperties.$router=ee,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>It(s)}),ql&&!Z&&s.value===ri&&(Z=!0,x(r.location).catch(Y=>{}));const X={};for(const Y in ri)Object.defineProperty(X,Y,{get:()=>s.value[Y],enumerable:!0});G.provide(NS,ee),G.provide(N_,vO(X)),G.provide(s0,s);const V=G.unmount;J.add(G),G.unmount=function(){J.delete(G),J.size<1&&(c=ri,R&&R(),R=null,s.value=ri,Z=!1,B=!1),V()}}};function te(G){return G.reduce((ee,X)=>ee.then(()=>T(X)),Promise.resolve())}return q}function S1e(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;l<i;l++){const a=t.matched[l];a&&(e.matched.find(c=>Na(c,a))?o.push(a):n.push(a));const s=e.matched[l];s&&(t.matched.find(c=>Na(c,s))||r.push(s))}return[n,o,r]}const $1e={class:"not-found-wrapper"},C1e=le({__name:"index",setup(e){const t=()=>{kS.replace("/")};return(n,o)=>{const r=Oo("a-button"),i=Oo("a-result");return Dn(),io("div",$1e,[p(i,{status:"404",title:"404","sub-title":"Sorry, the page you visited does not exist."},{extra:cn(()=>[p(r,{onClick:t,type:"primary"},{default:cn(()=>[zt("Back Home")]),_:1})]),_:1})])}}}),x1e=Ch(C1e,[["__scopeId","data-v-aef52a59"]]),dv="rt_session_",w1e=x_("session",()=>{const e=ne([]),t=ne([]),n=ne(null),o=ne(!1),r=I(()=>[...e.value].sort((u,d)=>d.startTime-u.startTime));function i(){if(o.value){console.warn("尝试在已有活动会话时开始新会话。");return}n.value=Date.now(),t.value=[],o.value=!0,console.log(`新会话开始于: ${new Date(n.value).toLocaleString()}`)}function l(u){if(!o.value||!n.value){console.warn("没有活动的会话来添加节点。");return}t.value.push(u)}function a(){var b,y;if(!o.value||!n.value){console.log("没有活动的会话可以结束。"),o.value=!1,n.value=null,t.value=[];return}const u=n.value,d=[...t.value];if(o.value=!1,n.value=null,t.value=[],d.length===0){console.log("会话结束,但没有节点需要保存。");return}const f=((b=d[0])==null?void 0:b.text.substring(0,10))||"无标题会话",h=d[0],v=[`${h==null?void 0:h.text.substring(0,56)}...
|
| 496 |
`,`${(y=h==null?void 0:h.translatedText)==null?void 0:y.substring(0,56)}...
|
| 497 |
-
`],g={startTime:u,title:f,outline:v,nodeCount:d.length};try{const S=`${dv}${u}`;localStorage.setItem(S,JSON.stringify(d)),console.log(`完整会话 ${u} 已保存到 localStorage.`);const $=e.value.findIndex(x=>x.startTime===u);$===-1?e.value.push(g):(console.warn(`会话摘要 ${u} 已存在,将进行覆盖。`),e.value[$]=g),console.log(`会话 ${u} 结束并已处理。`)}catch(S){console.error("保存会话到 localStorage 时出错:",S)}}function s(u){try{const d=`${dv}${u}`,f=localStorage.getItem(d);if(f){const h=JSON.parse(f);return console.log(`从 localStorage 加载了会话 ${u} 的内容 (${h.length} 个节点)`),h}return console.warn(`在 localStorage 中未找到键为 ${d} 的会话数据。`),null}catch(d){return console.error(`从 localStorage 加载会话 ${u} 时出错:`,d),null}}function c(u){try{const d=e.value.findIndex(h=>h.startTime===u);d>-1?(e.value.splice(d,1),console.log(`会话摘要 ${u} 已从 Pinia store 中移除。`)):console.warn(`尝试删除一个不存在的会话摘要: ${u}`);const f=`${dv}${u}`;localStorage.removeItem(f),console.log(`会话 ${u} 的完整内容已从 localStorage 中移除。`)}catch(d){console.error(`删除会话 ${u} 时出错:`,d)}}return{sessionSummaries:e,currentSessionNodes:t,currentSessionStartTime:n,isSessionActive:o,sortedSessionSummaries:r,startSession:i,addNode:l,endSession:a,loadSessionContent:s,deleteSession:c}},{persist:{paths:["sessionSummaries"]}}),B_=x_({id:"settings",persist:!0,state:()=>({vad:.3,fs:"trans-font-size-18",width_max:!1,role_name:"assistant",file_type:"wav"}),actions:{}}),BS=e=>(Y7("data-v-
|
| 498 |
${"-".repeat(80)}
|
| 499 |
[dst]: ${de}
|
| 500 |
|
| 501 |
-
`}).join("");if(!Y.trim()){console.warn("Generated text content is empty."),alert("Generated content is empty, cannot download.");return}const W=new Blob([Y],{type:"text/plain;charset=utf-8;"}),U=URL.createObjectURL(W),Q=document.createElement("a");Q.href=U,Q.download=`${S(X)}.txt`,Q.style.display="none",document.body.appendChild(Q),console.log(`Attempting to click download link for ${X}.txt`),Q.click(),setTimeout(()=>{try{document.body.removeChild(Q),URL.revokeObjectURL(U),console.log(`Cleaned up resources for ${X}.txt`)}catch(ae){console.error("Error during download cleanup:",ae)}},100)}catch(Y){console.error("Error creating download file:",Y),alert("An error occurred while preparing the download.")}},_=ne(null),N=()=>{ot(()=>{_.value&&(_.value.scrollTop=_.value.scrollHeight+144)})};be(()=>[...P],()=>{N()},{deep:!0}),be(()=>M.value,()=>{N()});const B=ne(!1),k=()=>{B.value=!0},F=()=>{B.value=!1,L.value!=n.$state.vad&&(n.$state.vad=L.value,u.value
|
| 502 |
-
标题: ${X.title}`)&&(t.deleteSession(X.startTime),console.log(`已删除会话: ${X.startTime}`))},ee=I(()=>t.sortedSessionSummaries);return(X,V)=>{const Y=Oo("a-radio"),W=Oo("a-radio-group"),U=Oo("a-switch"),Q=Oo("a-button"),ae=Oo("a-popover"),ie=Oo("a-select"),de=Oo("a-modal"),ce=Oo("a-card");return Dn(),io("div",O1e,[Bt("div",{class:Tr(["content-wrapper",z.value?"wrapper-width-auto":"wrapper-width-fixed"])},[Bt("div",P1e,[p(ce,{bordered:!1,style:{width:"100%","min-width":"100%"}},{actions:cn(()=>[Bt("div",E1e,[Bt("div",M1e,[p(ae,{open:B.value,"onUpdate:open":V[4]||(V[4]=re=>B.value=re),placement:"topLeft",trigger:"click"},{content:cn(()=>[Bt("div",_1e,[h$("",!0),Bt("div",A1e,[R1e,p(U,{checked:z.value,"onUpdate:checked":V[1]||(V[1]=re=>z.value=re)},null,8,["checked"])]),Bt("div",D1e,[N1e,p(U,{checked:Z.value,"onUpdate:checked":V[2]||(V[2]=re=>Z.value=re)},null,8,["checked"])]),Bt("div",B1e,[k1e,p(W,{value:j.value,"onUpdate:value":V[3]||(V[3]=re=>j.value=re),onChange:J},{default:cn(()=>[p(Y,{value:"trans-font-size-16"},{default:cn(()=>[zt("Small")]),_:1}),p(Y,{value:"trans-font-size-18"},{default:cn(()=>[zt("Default")]),_:1}),p(Y,{value:"trans-font-size-20"},{default:cn(()=>[zt("Normal")]),_:1}),p(Y,{value:"trans-font-size-22"},{default:cn(()=>[zt("Medium")]),_:1}),p(Y,{value:"trans-font-size-24"},{default:cn(()=>[zt("Large")]),_:1})]),_:1},8,["value"])])]),Bt("div",F1e,[p(Q,{type:"primary",onClick:F},{default:cn(()=>[zt("Done")]),_:1})])]),default:cn(()=>[p(Q,{type:"dashed",shape:"circle",size:"middle",onClick:k},{icon:cn(()=>[p(It(dme))]),_:1})]),_:1},8,["open"]),p(ie,{value:O.value,"onUpdate:value":V[5]||(V[5]=re=>O.value=re),style:{width:"240px"},placeholder:"Select Language",options:w,onChange:x},null,8,["value"]),p(Q,{type:"dashed",shape:"circle",size:"middle",onClick:V[6]||(V[6]=re=>q.value=!0)},{icon:cn(()=>[p(It(g1))]),_:1}),p(de,{open:q.value,"onUpdate:open":V[7]||(V[7]=re=>q.value=re),width:"960px",title:"Session History",centered:"",closable:!0,"ok-text":"OK",onOk:V[8]||(V[8]=re=>q.value=!1),footer:null},{default:cn(()=>[Bt("div",L1e,[ee.value.length>0?(Dn(),io("div",z1e,[(Dn(!0),io(We,null,Dh(ee.value,re=>(Dn(),io("div",{key:re.startTime,class:"session-node"},[Bt("div",H1e,[Bt("div",j1e," Start at: "+Jr(new Date(re.startTime).toLocaleString())+" ("+Jr(re.nodeCount)+" items) ",1),Bt("div",W1e,[re.outline.length>0?(Dn(),io("div",V1e,[(Dn(!0),io(We,null,Dh(re.outline,(pe,he)=>(Dn(),io("div",{class:"outline-line",key:he},Jr(pe),1))),128))])):(Dn(),io("i",K1e,"(No outline available)"))])]),Bt("div",U1e,[p(Q,{danger:"",type:"dashed",shape:"circle",size:"middle",onClick:pe=>G(re),style:{"margin-left":"8px"}},{icon:cn(()=>[p(It(aS))]),_:2},1032,["onClick"]),p(Q,{type:"dashed",shape:"circle",size:"middle",onClick:pe=>te(re)},{icon:cn(()=>[p(It(EM))]),_:2},1032,["onClick"])])]))),128))])):h$("",!0)])]),_:1},8,["open"])]),p(U,{key:"switcher",size:"large",type:"danger","checked-children":"ON","un-checked-children":"OFF",checked:v.value,"onUpdate:checked":V[9]||(V[9]=re=>v.value=re),onChange:C},null,8,["checked"])])]),default:cn(()=>[pn(Bt("div",I1e,Jr(G1e),512),[[mn,!(P.length||T.value)]]),pn(Bt("div",{class:"trans-list",ref_key:"transListRef",ref:_},[(Dn(!0),io(We,null,Dh(P,re=>(Dn(),io("div",{key:re.id,class:Tr(["node"]),"data-seg-id":re.id},[Bt("div",{class:Tr(["trans-src-lang",j.value])},Jr(re.text),3),Bt("div",{class:Tr(["trans-dst-lang",j.value])},Jr(re.translatedText),3)],8,T1e))),128)),pn((Dn(),io("div",{class:"node current_node",key:E.value},[Bt("div",{class:Tr(["trans-src-lang",j.value])},Jr(T.value),3),Bt("div",{class:Tr(["trans-dst-lang",j.value])},Jr(M.value),3)])),[[mn,Z.value]])],512),[[mn,P.length||T.value]])]),_:1})])],2)])}}}),Y1e=Ch(X1e,[["__scopeId","data-v-
|
|
|
|
| 494 |
* @license MIT
|
| 495 |
*/const ql=typeof document<"u";function mye(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const Pt=Object.assign;function sv(e,t){const n={};for(const o in t){const r=t[o];n[o]=qo(r)?r.map(e):e(r)}return n}const Us=()=>{},qo=Array.isArray,w_=/#/g,bye=/&/g,yye=/\//g,Sye=/=/g,$ye=/\?/g,O_=/\+/g,Cye=/%5B/g,xye=/%5D/g,P_=/%5E/g,wye=/%60/g,I_=/%7B/g,Oye=/%7C/g,T_=/%7D/g,Pye=/%20/g;function DS(e){return encodeURI(""+e).replace(Oye,"|").replace(Cye,"[").replace(xye,"]")}function Iye(e){return DS(e).replace(I_,"{").replace(T_,"}").replace(P_,"^")}function l0(e){return DS(e).replace(O_,"%2B").replace(Pye,"+").replace(w_,"%23").replace(bye,"%26").replace(wye,"`").replace(I_,"{").replace(T_,"}").replace(P_,"^")}function Tye(e){return l0(e).replace(Sye,"%3D")}function Eye(e){return DS(e).replace(w_,"%23").replace($ye,"%3F")}function Mye(e){return e==null?"":Eye(e).replace(yye,"%2F")}function Tc(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const _ye=/\/$/,Aye=e=>e.replace(_ye,"");function cv(e,t,n="/"){let o,r={},i="",l="";const a=t.indexOf("#");let s=t.indexOf("?");return a<s&&a>=0&&(s=-1),s>-1&&(o=t.slice(0,s),i=t.slice(s+1,a>-1?a:t.length),r=e(i)),a>-1&&(o=o||t.slice(0,a),l=t.slice(a,t.length)),o=Bye(o??t,n),{fullPath:o+(i&&"?")+i+l,path:o,query:r,hash:Tc(l)}}function Rye(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function N3(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Dye(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&Na(t.matched[o],n.matched[r])&&E_(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Na(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function E_(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Nye(e[n],t[n]))return!1;return!0}function Nye(e,t){return qo(e)?B3(e,t):qo(t)?B3(t,e):e===t}function B3(e,t){return qo(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function Bye(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,l,a;for(l=0;l<o.length;l++)if(a=o[l],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(l).join("/")}const ri={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Ec;(function(e){e.pop="pop",e.push="push"})(Ec||(Ec={}));var Gs;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Gs||(Gs={}));function kye(e){if(!e)if(ql){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Aye(e)}const Fye=/^[^#]+#/;function Lye(e,t){return e.replace(Fye,"#")+t}function zye(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const xh=()=>({left:window.scrollX,top:window.scrollY});function Hye(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=zye(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function k3(e,t){return(history.state?history.state.position-t:-1)+e}const a0=new Map;function jye(e,t){a0.set(e,t)}function Wye(e){const t=a0.get(e);return a0.delete(e),t}let Vye=()=>location.protocol+"//"+location.host;function M_(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let a=r.includes(e.slice(i))?e.slice(i).length:1,s=r.slice(a);return s[0]!=="/"&&(s="/"+s),N3(s,"")}return N3(n,e)+o+r}function Kye(e,t,n,o){let r=[],i=[],l=null;const a=({state:f})=>{const h=M_(e,location),v=n.value,g=t.value;let b=0;if(f){if(n.value=h,t.value=f,l&&l===v){l=null;return}b=g?f.position-g.position:0}else o(h);r.forEach(y=>{y(n.value,v,{delta:b,type:Ec.pop,direction:b?b>0?Gs.forward:Gs.back:Gs.unknown})})};function s(){l=n.value}function c(f){r.push(f);const h=()=>{const v=r.indexOf(f);v>-1&&r.splice(v,1)};return i.push(h),h}function u(){const{history:f}=window;f.state&&f.replaceState(Pt({},f.state,{scroll:xh()}),"")}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:s,listen:c,destroy:d}}function F3(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?xh():null}}function Uye(e){const{history:t,location:n}=window,o={value:M_(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(s,c,u){const d=e.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+s:Vye()+e+s;try{t[u?"replaceState":"pushState"](c,"",f),r.value=c}catch(h){console.error(h),n[u?"replace":"assign"](f)}}function l(s,c){const u=Pt({},t.state,F3(r.value.back,s,r.value.forward,!0),c,{position:r.value.position});i(s,u,!0),o.value=s}function a(s,c){const u=Pt({},r.value,t.state,{forward:s,scroll:xh()});i(u.current,u,!0);const d=Pt({},F3(o.value,s,null),{position:u.position+1},c);i(s,d,!1),o.value=s}return{location:o,state:r,push:a,replace:l}}function Gye(e){e=kye(e);const t=Uye(e),n=Kye(e,t.state,t.location,t.replace);function o(i,l=!0){l||n.pauseListeners(),history.go(i)}const r=Pt({location:"",base:e,go:o,createHref:Lye.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Xye(e){return typeof e=="string"||e&&typeof e=="object"}function __(e){return typeof e=="string"||typeof e=="symbol"}const A_=Symbol("");var L3;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(L3||(L3={}));function Ba(e,t){return Pt(new Error,{type:e,[A_]:!0},t)}function Cr(e,t){return e instanceof Error&&A_ in e&&(t==null||!!(e.type&t))}const z3="[^/]+?",Yye={sensitive:!1,strict:!1,start:!0,end:!0},qye=/[.+*?^${}()[\]/\\]/g;function Zye(e,t){const n=Pt({},Yye,t),o=[];let r=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[90];n.strict&&!c.length&&(r+="/");for(let d=0;d<c.length;d++){const f=c[d];let h=40+(n.sensitive?.25:0);if(f.type===0)d||(r+="/"),r+=f.value.replace(qye,"\\$&"),h+=40;else if(f.type===1){const{value:v,repeatable:g,optional:b,regexp:y}=f;i.push({name:v,repeatable:g,optional:b});const S=y||z3;if(S!==z3){h+=10;try{new RegExp(`(${S})`)}catch(x){throw new Error(`Invalid custom RegExp for param "${v}" (${S}): `+x.message)}}let $=g?`((?:${S})(?:/(?:${S}))*)`:`(${S})`;d||($=b&&c.length<2?`(?:/${$})`:"/"+$),b&&($+="?"),r+=$,h+=20,b&&(h+=-8),g&&(h+=-20),S===".*"&&(h+=-50)}u.push(h)}o.push(u)}if(n.strict&&n.end){const c=o.length-1;o[c][o[c].length-1]+=.7000000000000001}n.strict||(r+="/?"),n.end?r+="$":n.strict&&(r+="(?:/|$)");const l=new RegExp(r,n.sensitive?"":"i");function a(c){const u=c.match(l),d={};if(!u)return null;for(let f=1;f<u.length;f++){const h=u[f]||"",v=i[f-1];d[v.name]=h&&v.repeatable?h.split("/"):h}return d}function s(c){let u="",d=!1;for(const f of e){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const h of f)if(h.type===0)u+=h.value;else if(h.type===1){const{value:v,repeatable:g,optional:b}=h,y=v in c?c[v]:"";if(qo(y)&&!g)throw new Error(`Provided param "${v}" is an array but it is not repeatable (* or + modifiers)`);const S=qo(y)?y.join("/"):y;if(!S)if(b)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${v}"`);u+=S}}return u||"/"}return{re:l,score:o,keys:i,parse:a,stringify:s}}function Qye(e,t){let n=0;for(;n<e.length&&n<t.length;){const o=t[n]-e[n];if(o)return o;n++}return e.length<t.length?e.length===1&&e[0]===40+40?-1:1:e.length>t.length?t.length===1&&t[0]===40+40?1:-1:0}function R_(e,t){let n=0;const o=e.score,r=t.score;for(;n<o.length&&n<r.length;){const i=Qye(o[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-o.length)===1){if(H3(o))return 1;if(H3(r))return-1}return r.length-o.length}function H3(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Jye={type:0,value:""},e1e=/[a-zA-Z0-9_]/;function t1e(e){if(!e)return[[]];if(e==="/")return[[Jye]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=0,o=n;const r=[];let i;function l(){i&&r.push(i),i=[]}let a=0,s,c="",u="";function d(){c&&(n===0?i.push({type:0,value:c}):n===1||n===2||n===3?(i.length>1&&(s==="*"||s==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:c,regexp:u,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=s}for(;a<e.length;){if(s=e[a++],s==="\\"&&n!==2){o=n,n=4;continue}switch(n){case 0:s==="/"?(c&&d(),l()):s===":"?(d(),n=1):f();break;case 4:f(),n=o;break;case 1:s==="("?n=2:e1e.test(s)?f():(d(),n=0,s!=="*"&&s!=="?"&&s!=="+"&&a--);break;case 2:s===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+s:n=3:u+=s;break;case 3:d(),n=0,s!=="*"&&s!=="?"&&s!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${c}"`),d(),l(),r}function n1e(e,t,n){const o=Zye(t1e(e.path),n),r=Pt(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function o1e(e,t){const n=[],o=new Map;t=V3({strict:!1,end:!0,sensitive:!1},t);function r(d){return o.get(d)}function i(d,f,h){const v=!h,g=r1e(d);g.aliasOf=h&&h.record;const b=V3(t,d),y=[g];if("alias"in d){const x=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of x)y.push(Pt({},g,{components:h?h.record.components:g.components,path:C,aliasOf:h?h.record:g}))}let S,$;for(const x of y){const{path:C}=x;if(f&&C[0]!=="/"){const O=f.record.path,w=O[O.length-1]==="/"?"":"/";x.path=f.record.path+(C&&w+C)}if(S=n1e(x,f,b),h?h.alias.push(S):($=$||S,$!==S&&$.alias.push(S),v&&d.name&&!W3(S)&&l(d.name)),D_(S)&&s(S),g.children){const O=g.children;for(let w=0;w<O.length;w++)i(O[w],S,h&&h.children[w])}h=h||S}return $?()=>{l($)}:Us}function l(d){if(__(d)){const f=o.get(d);f&&(o.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(l),f.alias.forEach(l))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&o.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function a(){return n}function s(d){const f=a1e(d,n);n.splice(f,0,d),d.record.name&&!W3(d)&&o.set(d.record.name,d)}function c(d,f){let h,v={},g,b;if("name"in d&&d.name){if(h=o.get(d.name),!h)throw Ba(1,{location:d});b=h.record.name,v=Pt(j3(f.params,h.keys.filter($=>!$.optional).concat(h.parent?h.parent.keys.filter($=>$.optional):[]).map($=>$.name)),d.params&&j3(d.params,h.keys.map($=>$.name))),g=h.stringify(v)}else if(d.path!=null)g=d.path,h=n.find($=>$.re.test(g)),h&&(v=h.parse(g),b=h.record.name);else{if(h=f.name?o.get(f.name):n.find($=>$.re.test(f.path)),!h)throw Ba(1,{location:d,currentLocation:f});b=h.record.name,v=Pt({},f.params,d.params),g=h.stringify(v)}const y=[];let S=h;for(;S;)y.unshift(S.record),S=S.parent;return{name:b,path:g,params:v,matched:y,meta:l1e(y)}}e.forEach(d=>i(d));function u(){n.length=0,o.clear()}return{addRoute:i,resolve:c,removeRoute:l,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function j3(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function r1e(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:i1e(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function i1e(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function W3(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function l1e(e){return e.reduce((t,n)=>Pt(t,n.meta),{})}function V3(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function a1e(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;R_(e,t[i])<0?o=i:n=i+1}const r=s1e(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function s1e(e){let t=e;for(;t=t.parent;)if(D_(t)&&R_(e,t)===0)return t}function D_({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function c1e(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<o.length;++r){const i=o[r].replace(O_," "),l=i.indexOf("="),a=Tc(l<0?i:i.slice(0,l)),s=l<0?null:Tc(i.slice(l+1));if(a in t){let c=t[a];qo(c)||(c=t[a]=[c]),c.push(s)}else t[a]=s}return t}function K3(e){let t="";for(let n in e){const o=e[n];if(n=Tye(n),o==null){o!==void 0&&(t+=(t.length?"&":"")+n);continue}(qo(o)?o.map(i=>i&&l0(i)):[o&&l0(o)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function u1e(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=qo(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const d1e=Symbol(""),U3=Symbol(""),NS=Symbol(""),N_=Symbol(""),s0=Symbol("");function ps(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ui(e,t,n,o,r,i=l=>l()){const l=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((a,s)=>{const c=f=>{f===!1?s(Ba(4,{from:n,to:t})):f instanceof Error?s(f):Xye(f)?s(Ba(2,{from:t,to:f})):(l&&o.enterCallbacks[r]===l&&typeof f=="function"&&l.push(f),a())},u=i(()=>e.call(o&&o.instances[r],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(f=>s(f))})}function uv(e,t,n,o,r=i=>i()){const i=[];for(const l of e)for(const a in l.components){let s=l.components[a];if(!(t!=="beforeRouteEnter"&&!l.instances[a]))if(f1e(s)){const u=(s.__vccOpts||s)[t];u&&i.push(ui(u,n,o,l,a,r))}else{let c=s();i.push(()=>c.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${l.path}"`));const d=mye(u)?u.default:u;l.components[a]=d;const h=(d.__vccOpts||d)[t];return h&&ui(h,n,o,l,a,r)()}))}}return i}function f1e(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function G3(e){const t=Ve(NS),n=Ve(N_),o=I(()=>{const s=It(e.to);return t.resolve(s)}),r=I(()=>{const{matched:s}=o.value,{length:c}=s,u=s[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(Na.bind(null,u));if(f>-1)return f;const h=X3(s[c-2]);return c>1&&X3(u)===h&&d[d.length-1].path!==h?d.findIndex(Na.bind(null,s[c-2])):f}),i=I(()=>r.value>-1&&v1e(n.params,o.value.params)),l=I(()=>r.value>-1&&r.value===n.matched.length-1&&E_(n.params,o.value.params));function a(s={}){return g1e(s)?t[It(e.replace)?"replace":"push"](It(e.to)).catch(Us):Promise.resolve()}return{route:o,href:I(()=>o.value.href),isActive:i,isExactActive:l,navigate:a}}const p1e=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"}},useLink:G3,setup(e,{slots:t}){const n=ct(G3(e)),{options:o}=Ve(NS),r=I(()=>({[Y3(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[Y3(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:$a("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),h1e=p1e;function g1e(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 v1e(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!qo(r)||r.length!==o.length||o.some((i,l)=>i!==r[l]))return!1}return!0}function X3(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Y3=(e,t,n)=>e??t??n,m1e=le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=Ve(s0),r=I(()=>e.route||o.value),i=Ve(U3,0),l=I(()=>{let c=It(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=I(()=>r.value.matched[l.value]);Ge(U3,I(()=>l.value+1)),Ge(d1e,a),Ge(s0,r);const s=ne();return be(()=>[s.value,a.value,e.name],([c,u,d],[f,h,v])=>{u&&(u.instances[d]=c,h&&h!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Na(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(g=>g(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,d=a.value,f=d&&d.components[u];if(!f)return q3(n.default,{Component:f,route:c});const h=d.props[u],v=h?h===!0?c.params:typeof h=="function"?h(c):h:null,b=$a(f,Pt({},v,t,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(d.instances[u]=null)},ref:s}));return q3(n.default,{Component:b,route:c})||b}}});function q3(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const b1e=m1e;function y1e(e){const t=o1e(e.routes,e),n=e.parseQuery||c1e,o=e.stringifyQuery||K3,r=e.history,i=ps(),l=ps(),a=ps(),s=oe(ri);let c=ri;ql&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=sv.bind(null,G=>""+G),d=sv.bind(null,Mye),f=sv.bind(null,Tc);function h(G,ee){let X,V;return __(G)?(X=t.getRecordMatcher(G),V=ee):V=G,t.addRoute(V,X)}function v(G){const ee=t.getRecordMatcher(G);ee&&t.removeRoute(ee)}function g(){return t.getRoutes().map(G=>G.record)}function b(G){return!!t.getRecordMatcher(G)}function y(G,ee){if(ee=Pt({},ee||s.value),typeof G=="string"){const Q=cv(n,G,ee.path),ae=t.resolve({path:Q.path},ee),ie=r.createHref(Q.fullPath);return Pt(Q,ae,{params:f(ae.params),hash:Tc(Q.hash),redirectedFrom:void 0,href:ie})}let X;if(G.path!=null)X=Pt({},G,{path:cv(n,G.path,ee.path).path});else{const Q=Pt({},G.params);for(const ae in Q)Q[ae]==null&&delete Q[ae];X=Pt({},G,{params:d(Q)}),ee.params=d(ee.params)}const V=t.resolve(X,ee),Y=G.hash||"";V.params=u(f(V.params));const W=Rye(o,Pt({},G,{hash:Iye(Y),path:V.path})),U=r.createHref(W);return Pt({fullPath:W,hash:Y,query:o===K3?u1e(G.query):G.query||{}},V,{redirectedFrom:void 0,href:U})}function S(G){return typeof G=="string"?cv(n,G,s.value.path):Pt({},G)}function $(G,ee){if(c!==G)return Ba(8,{from:ee,to:G})}function x(G){return w(G)}function C(G){return x(Pt(S(G),{replace:!0}))}function O(G){const ee=G.matched[G.matched.length-1];if(ee&&ee.redirect){const{redirect:X}=ee;let V=typeof X=="function"?X(G):X;return typeof V=="string"&&(V=V.includes("?")||V.includes("#")?V=S(V):{path:V},V.params={}),Pt({query:G.query,hash:G.hash,params:V.path!=null?{}:G.params},V)}}function w(G,ee){const X=c=y(G),V=s.value,Y=G.state,W=G.force,U=G.replace===!0,Q=O(X);if(Q)return w(Pt(S(Q),{state:typeof Q=="object"?Pt({},Y,Q.state):Y,force:W,replace:U}),ee||X);const ae=X;ae.redirectedFrom=ee;let ie;return!W&&Dye(o,V,X)&&(ie=Ba(16,{to:ae,from:V}),z(V,V,!0,!1)),(ie?Promise.resolve(ie):M(ae,V)).catch(de=>Cr(de)?Cr(de,2)?de:L(de):k(de,ae,V)).then(de=>{if(de){if(Cr(de,2))return w(Pt({replace:U},S(de.to),{state:typeof de.to=="object"?Pt({},Y,de.to.state):Y,force:W}),ee||ae)}else de=A(ae,V,!0,U,Y);return E(ae,V,de),de})}function P(G,ee){const X=$(G,ee);return X?Promise.reject(X):Promise.resolve()}function T(G){const ee=J.values().next().value;return ee&&typeof ee.runWithContext=="function"?ee.runWithContext(G):G()}function M(G,ee){let X;const[V,Y,W]=S1e(G,ee);X=uv(V.reverse(),"beforeRouteLeave",G,ee);for(const Q of V)Q.leaveGuards.forEach(ae=>{X.push(ui(ae,G,ee))});const U=P.bind(null,G,ee);return X.push(U),te(X).then(()=>{X=[];for(const Q of i.list())X.push(ui(Q,G,ee));return X.push(U),te(X)}).then(()=>{X=uv(Y,"beforeRouteUpdate",G,ee);for(const Q of Y)Q.updateGuards.forEach(ae=>{X.push(ui(ae,G,ee))});return X.push(U),te(X)}).then(()=>{X=[];for(const Q of W)if(Q.beforeEnter)if(qo(Q.beforeEnter))for(const ae of Q.beforeEnter)X.push(ui(ae,G,ee));else X.push(ui(Q.beforeEnter,G,ee));return X.push(U),te(X)}).then(()=>(G.matched.forEach(Q=>Q.enterCallbacks={}),X=uv(W,"beforeRouteEnter",G,ee,T),X.push(U),te(X))).then(()=>{X=[];for(const Q of l.list())X.push(ui(Q,G,ee));return X.push(U),te(X)}).catch(Q=>Cr(Q,8)?Q:Promise.reject(Q))}function E(G,ee,X){a.list().forEach(V=>T(()=>V(G,ee,X)))}function A(G,ee,X,V,Y){const W=$(G,ee);if(W)return W;const U=ee===ri,Q=ql?history.state:{};X&&(V||U?r.replace(G.fullPath,Pt({scroll:U&&Q&&Q.scroll},Y)):r.push(G.fullPath,Y)),s.value=G,z(G,ee,X,U),L()}let R;function H(){R||(R=r.listen((G,ee,X)=>{if(!q.listening)return;const V=y(G),Y=O(V);if(Y){w(Pt(Y,{replace:!0}),V).catch(Us);return}c=V;const W=s.value;ql&&jye(k3(W.fullPath,X.delta),xh()),M(V,W).catch(U=>Cr(U,12)?U:Cr(U,2)?(w(U.to,V).then(Q=>{Cr(Q,20)&&!X.delta&&X.type===Ec.pop&&r.go(-1,!1)}).catch(Us),Promise.reject()):(X.delta&&r.go(-X.delta,!1),k(U,V,W))).then(U=>{U=U||A(V,W,!1),U&&(X.delta&&!Cr(U,8)?r.go(-X.delta,!1):X.type===Ec.pop&&Cr(U,20)&&r.go(-1,!1)),E(V,W,U)}).catch(Us)}))}let _=ps(),N=ps(),B;function k(G,ee,X){L(G);const V=N.list();return V.length?V.forEach(Y=>Y(G,ee,X)):console.error(G),Promise.reject(G)}function F(){return B&&s.value!==ri?Promise.resolve():new Promise((G,ee)=>{_.add([G,ee])})}function L(G){return B||(B=!G,H(),_.list().forEach(([ee,X])=>G?X(G):ee()),_.reset()),G}function z(G,ee,X,V){const{scrollBehavior:Y}=e;if(!ql||!Y)return Promise.resolve();const W=!X&&Wye(k3(G.fullPath,0))||(V||!X)&&history.state&&history.state.scroll||null;return ot().then(()=>Y(G,ee,W)).then(U=>U&&Hye(U)).catch(U=>k(U,G,ee))}const j=G=>r.go(G);let Z;const J=new Set,q={currentRoute:s,listening:!0,addRoute:h,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:b,getRoutes:g,resolve:y,options:e,push:x,replace:C,go:j,back:()=>j(-1),forward:()=>j(1),beforeEach:i.add,beforeResolve:l.add,afterEach:a.add,onError:N.add,isReady:F,install(G){const ee=this;G.component("RouterLink",h1e),G.component("RouterView",b1e),G.config.globalProperties.$router=ee,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>It(s)}),ql&&!Z&&s.value===ri&&(Z=!0,x(r.location).catch(Y=>{}));const X={};for(const Y in ri)Object.defineProperty(X,Y,{get:()=>s.value[Y],enumerable:!0});G.provide(NS,ee),G.provide(N_,vO(X)),G.provide(s0,s);const V=G.unmount;J.add(G),G.unmount=function(){J.delete(G),J.size<1&&(c=ri,R&&R(),R=null,s.value=ri,Z=!1,B=!1),V()}}};function te(G){return G.reduce((ee,X)=>ee.then(()=>T(X)),Promise.resolve())}return q}function S1e(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;l<i;l++){const a=t.matched[l];a&&(e.matched.find(c=>Na(c,a))?o.push(a):n.push(a));const s=e.matched[l];s&&(t.matched.find(c=>Na(c,s))||r.push(s))}return[n,o,r]}const $1e={class:"not-found-wrapper"},C1e=le({__name:"index",setup(e){const t=()=>{kS.replace("/")};return(n,o)=>{const r=Oo("a-button"),i=Oo("a-result");return Dn(),io("div",$1e,[p(i,{status:"404",title:"404","sub-title":"Sorry, the page you visited does not exist."},{extra:cn(()=>[p(r,{onClick:t,type:"primary"},{default:cn(()=>[zt("Back Home")]),_:1})]),_:1})])}}}),x1e=Ch(C1e,[["__scopeId","data-v-aef52a59"]]),dv="rt_session_",w1e=x_("session",()=>{const e=ne([]),t=ne([]),n=ne(null),o=ne(!1),r=I(()=>[...e.value].sort((u,d)=>d.startTime-u.startTime));function i(){if(o.value){console.warn("尝试在已有活动会话时开始新会话。");return}n.value=Date.now(),t.value=[],o.value=!0,console.log(`新会话开始于: ${new Date(n.value).toLocaleString()}`)}function l(u){if(!o.value||!n.value){console.warn("没有活动的会话来添加节点。");return}t.value.push(u)}function a(){var b,y;if(!o.value||!n.value){console.log("没有活动的会话可以结束。"),o.value=!1,n.value=null,t.value=[];return}const u=n.value,d=[...t.value];if(o.value=!1,n.value=null,t.value=[],d.length===0){console.log("会话结束,但没有节点需要保存。");return}const f=((b=d[0])==null?void 0:b.text.substring(0,10))||"无标题会话",h=d[0],v=[`${h==null?void 0:h.text.substring(0,56)}...
|
| 496 |
`,`${(y=h==null?void 0:h.translatedText)==null?void 0:y.substring(0,56)}...
|
| 497 |
+
`],g={startTime:u,title:f,outline:v,nodeCount:d.length};try{const S=`${dv}${u}`;localStorage.setItem(S,JSON.stringify(d)),console.log(`完整会话 ${u} 已保存到 localStorage.`);const $=e.value.findIndex(x=>x.startTime===u);$===-1?e.value.push(g):(console.warn(`会话摘要 ${u} 已存在,将进行覆盖。`),e.value[$]=g),console.log(`会话 ${u} 结束并已处理。`)}catch(S){console.error("保存会话到 localStorage 时出错:",S)}}function s(u){try{const d=`${dv}${u}`,f=localStorage.getItem(d);if(f){const h=JSON.parse(f);return console.log(`从 localStorage 加载了会话 ${u} 的内容 (${h.length} 个节点)`),h}return console.warn(`在 localStorage 中未找到键为 ${d} 的会话数据。`),null}catch(d){return console.error(`从 localStorage 加载会话 ${u} 时出错:`,d),null}}function c(u){try{const d=e.value.findIndex(h=>h.startTime===u);d>-1?(e.value.splice(d,1),console.log(`会话摘要 ${u} 已从 Pinia store 中移除。`)):console.warn(`尝试删除一个不存在的会话摘要: ${u}`);const f=`${dv}${u}`;localStorage.removeItem(f),console.log(`会话 ${u} 的完整内容已从 localStorage 中移除。`)}catch(d){console.error(`删除会话 ${u} 时出错:`,d)}}return{sessionSummaries:e,currentSessionNodes:t,currentSessionStartTime:n,isSessionActive:o,sortedSessionSummaries:r,startSession:i,addNode:l,endSession:a,loadSessionContent:s,deleteSession:c}},{persist:{paths:["sessionSummaries"]}}),B_=x_({id:"settings",persist:!0,state:()=>({vad:.3,fs:"trans-font-size-18",width_max:!1,role_name:"assistant",file_type:"wav"}),actions:{}}),BS=e=>(Y7("data-v-3a741d94"),e=e(),q7(),e),O1e={class:"view-wrapper"},P1e={style:{"margin-top":"10vh",padding:"32px"}},I1e={class:"chat-box-placeholder"},T1e=["data-seg-id"],E1e={class:"actions-box"},M1e={class:"left-actions"},_1e={class:"config-content"},A1e={class:"config-block"},R1e=BS(()=>Bt("h4",{style:{"font-weight":"500"}},"Page Max Width:",-1)),D1e={class:"config-block"},N1e=BS(()=>Bt("h4",{style:{"font-weight":"500"}},"Show Realtime Buffer:",-1)),B1e={class:"config-block"},k1e=BS(()=>Bt("h4",{style:{"font-weight":"500"}},"Text Font Size:",-1)),F1e={style:{display:"flex","justify-content":"end"}},L1e={class:"sessions"},z1e={key:0},H1e={class:"content"},j1e={class:"content-text"},W1e={class:"content-outline"},V1e={key:0},K1e={key:1},U1e={class:"session-action"},G1e="Please check if the microphone is available before the experience, specify the audio language and translation language, click the switch button to start recording, and you can get the recognized and translated text in real time.",X1e=le({__name:"index",setup(e){const t=w1e(),n=B_(),o=window.location.host;let r="ws";o.startsWith("127.0.0.1")||o.startsWith("localhost")?r="ws":r="wss";const i=`${r}://`+o+"/ws?";console.warn("ws_url: ",i);const l=ne(null),a=async X=>{console.warn("start websocket ..."),l.value&&l.value.readyState!==WebSocket.CLOSED&&l.value.close();const V=`${i}${X}`;l.value=new WebSocket(V),l.value.binaryType="arraybuffer",console.warn("created web socket ..."),l.value.addEventListener("open",()=>{console.log("WebSocket 连接成功"),g(),v.value=!0}),l.value.addEventListener("close",()=>{console.log("WebSocket 连接已关闭")}),l.value.onclose=Y=>{console.log("code:",Y.code,"reason:",Y.reason,"wasClean:",Y.wasClean),console.log("WebSocket 连接已关闭:",Y)},l.value.addEventListener("error",Y=>{console.error("WebSocket 连接错误:",Y)}),l.value.addEventListener("message",Y=>{try{const W=JSON.parse(Y.data);console.log("WebSocket 收到消息:",W),W&&W.result&&A(W.result)}catch(W){console.error("解析 WebSocket 消息失败:",W,"原始数据:",Y.data)}})},s=async()=>{l.value&&(console.log("主动关闭 WebSocket 连接"),l.value.close(1e3,"User closed connection"),l.value=null)},c=ne(null),u=ne(null),d=ne(null),f=ne(null),h=ne(null),v=ne(!1),g=async()=>{try{if(!window.AudioContext&&!window.webkitAudioContext)throw alert("浏览器不支持 Web Audio API"),new Error("浏览器不支持 Web Audio API");const X=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:16e3,channelCount:1}});c.value=X;const V=new AudioContext({sampleRate:16e3});d.value=V;const Y=V.createMediaStreamSource(X);f.value=Y;const W=V.createScriptProcessor(4096,1,1);h.value=W,Y.connect(W),W.connect(V.destination),W.onaudioprocess=U=>{if(!v.value||!l.value||l.value.readyState!==WebSocket.OPEN)return;const Q=U.inputBuffer.getChannelData(0),ae=new Int16Array(Q.length);for(let ie=0;ie<Q.length;ie++)ae[ie]=Math.max(-1,Math.min(1,Q[ie]))*32767;b(ae)},v.value=!0,console.log("音频捕获已启动")}catch(X){console.error("音频捕获失败:",X)}},b=X=>{l.value&&l.value.readyState===WebSocket.OPEN?l.value.send(X):console.error("WebSocket 未连接或未打开,无法发送音频")},y=async()=>{console.log("requirePermissionAction");try{if(!l.value||l.value.readyState!==WebSocket.OPEN){console.log("current lang_str : ",O.value);const X=O.value;R(),await a(X)}else c.value||await g()}catch(X){v.value=!1,console.log("Error accessing microphone: ",X)}},S=X=>{const V=new Date(X),Y=V.getFullYear(),W=String(V.getMonth()+1).padStart(2,"0"),U=String(V.getDate()).padStart(2,"0"),Q=String(V.getHours()).padStart(2,"0"),ae=String(V.getMinutes()).padStart(2,"0"),ie=String(V.getSeconds()).padStart(2,"0");return`${Y}-${W}-${U}-${Q}:${ae}:${ie}`};je(()=>{console.log("[translator]: mounted"),j.value=n.$state.fs,z.value=n.$state.width_max,L.value=n.$state.vad,t.isSessionActive&&(console.warn("检测到上次会话未正常结束,重置状态。"),t.$reset())}),xn(()=>{console.log("[HomePage]: unmounted"),l.value&&l.value.close(),u.value&&($(),t.endSession())});const $=()=>{v.value=!1,s(),console.log("音频捕获已停止"),h.value&&(h.value.disconnect(),h.value=null),f.value&&(f.value.disconnect(),f.value=null),c.value&&(c.value.getTracks().forEach(X=>X.stop()),c.value=null),d.value&&(d.value.close(),d.value=null),T.value="",M.value="",E.value="",console.log("录音已停止")},x=async X=>{console.log(`selected ${X}`),v.value=!1,await $(),t.endSession(),console.log("new lang_str: ",X),console.log("trans_lang : ",O.value)},C=X=>{v.value=X,X?(v.value=!0,y(),t.startSession()):(v.value=!1,$(),t.endSession())},O=ne("from=en&to=zh"),w=[{value:"from=en&to=zh",label:"English -> Chinese"},{value:"from=zh&to=en",label:"Chinese -> English"}],P=ct([]),T=ne(""),M=ne(""),E=ne(""),A=X=>{if(console.log("updateViewData: ",X),X){const{context:V,from:Y,to:W,seg_id:U,partial:Q,tranContent:ae}=X;if(Q==!0){T.value=V,M.value=ae,E.value=U;return}else{const ie={id:U||crypto.randomUUID(),text:V,translatedText:ae,timestamp:Date.now()};t.addNode(ie),P.length>100&&P.splice(0,40),P.push(ie),T.value="",M.value="",E.value=""}}N()},R=()=>{P.splice(0,P.length),T.value="",M.value="",E.value=""},H=(X,V)=>{try{if(!V||V.length===0){console.warn("No nodes provided for download."),alert("No content available to download for this session.");return}const Y=V.map(ae=>{const ie=ae.text||"(No original text)",de=ae.translatedText||"(No translation)";return`[src]: ${ie}
|
| 498 |
${"-".repeat(80)}
|
| 499 |
[dst]: ${de}
|
| 500 |
|
| 501 |
+
`}).join("");if(!Y.trim()){console.warn("Generated text content is empty."),alert("Generated content is empty, cannot download.");return}const W=new Blob([Y],{type:"text/plain;charset=utf-8;"}),U=URL.createObjectURL(W),Q=document.createElement("a");Q.href=U,Q.download=`${S(X)}.txt`,Q.style.display="none",document.body.appendChild(Q),console.log(`Attempting to click download link for ${X}.txt`),Q.click(),setTimeout(()=>{try{document.body.removeChild(Q),URL.revokeObjectURL(U),console.log(`Cleaned up resources for ${X}.txt`)}catch(ae){console.error("Error during download cleanup:",ae)}},100)}catch(Y){console.error("Error creating download file:",Y),alert("An error occurred while preparing the download.")}},_=ne(null),N=()=>{ot(()=>{_.value&&(_.value.scrollTop=_.value.scrollHeight+144)})};be(()=>[...P],()=>{N()},{deep:!0}),be(()=>M.value,()=>{N()});const B=ne(!1),k=()=>{B.value=!0},F=()=>{B.value=!1,L.value!=n.$state.vad&&(n.$state.vad=L.value,u.value&&($(),t.endSession()))},L=ne(.3),z=ne(!1),j=ne("trans-font-size-18"),Z=ne(!0),J=X=>{console.log("onFontSizeChange",X.target.value),j.value=X.target.value,n.$state.fs=X.target.value},q=ne(!1),te=X=>{console.log(`请求下载会话: ${X.startTime}`);const V=t.loadSessionContent(X.startTime);V?H(X.startTime,V):alert(`无法加载会话 ${X.startTime} 的内容进行下载。`)},G=X=>{confirm(`确定要删除开始于 ${new Date(X.startTime).toLocaleString()} 的会话吗?
|
| 502 |
+
标题: ${X.title}`)&&(t.deleteSession(X.startTime),console.log(`已删除会话: ${X.startTime}`))},ee=I(()=>t.sortedSessionSummaries);return(X,V)=>{const Y=Oo("a-radio"),W=Oo("a-radio-group"),U=Oo("a-switch"),Q=Oo("a-button"),ae=Oo("a-popover"),ie=Oo("a-select"),de=Oo("a-modal"),ce=Oo("a-card");return Dn(),io("div",O1e,[Bt("div",{class:Tr(["content-wrapper",z.value?"wrapper-width-auto":"wrapper-width-fixed"])},[Bt("div",P1e,[p(ce,{bordered:!1,style:{width:"100%","min-width":"100%"}},{actions:cn(()=>[Bt("div",E1e,[Bt("div",M1e,[p(ae,{open:B.value,"onUpdate:open":V[4]||(V[4]=re=>B.value=re),placement:"topLeft",trigger:"click"},{content:cn(()=>[Bt("div",_1e,[h$("",!0),Bt("div",A1e,[R1e,p(U,{checked:z.value,"onUpdate:checked":V[1]||(V[1]=re=>z.value=re)},null,8,["checked"])]),Bt("div",D1e,[N1e,p(U,{checked:Z.value,"onUpdate:checked":V[2]||(V[2]=re=>Z.value=re)},null,8,["checked"])]),Bt("div",B1e,[k1e,p(W,{value:j.value,"onUpdate:value":V[3]||(V[3]=re=>j.value=re),onChange:J},{default:cn(()=>[p(Y,{value:"trans-font-size-16"},{default:cn(()=>[zt("Small")]),_:1}),p(Y,{value:"trans-font-size-18"},{default:cn(()=>[zt("Default")]),_:1}),p(Y,{value:"trans-font-size-20"},{default:cn(()=>[zt("Normal")]),_:1}),p(Y,{value:"trans-font-size-22"},{default:cn(()=>[zt("Medium")]),_:1}),p(Y,{value:"trans-font-size-24"},{default:cn(()=>[zt("Large")]),_:1})]),_:1},8,["value"])])]),Bt("div",F1e,[p(Q,{type:"primary",onClick:F},{default:cn(()=>[zt("Done")]),_:1})])]),default:cn(()=>[p(Q,{type:"dashed",shape:"circle",size:"middle",onClick:k},{icon:cn(()=>[p(It(dme))]),_:1})]),_:1},8,["open"]),p(ie,{value:O.value,"onUpdate:value":V[5]||(V[5]=re=>O.value=re),style:{width:"240px"},placeholder:"Select Language",options:w,onChange:x},null,8,["value"]),p(Q,{type:"dashed",shape:"circle",size:"middle",onClick:V[6]||(V[6]=re=>q.value=!0)},{icon:cn(()=>[p(It(g1))]),_:1}),p(de,{open:q.value,"onUpdate:open":V[7]||(V[7]=re=>q.value=re),width:"960px",title:"Session History",centered:"",closable:!0,"ok-text":"OK",onOk:V[8]||(V[8]=re=>q.value=!1),footer:null},{default:cn(()=>[Bt("div",L1e,[ee.value.length>0?(Dn(),io("div",z1e,[(Dn(!0),io(We,null,Dh(ee.value,re=>(Dn(),io("div",{key:re.startTime,class:"session-node"},[Bt("div",H1e,[Bt("div",j1e," Start at: "+Jr(new Date(re.startTime).toLocaleString())+" ("+Jr(re.nodeCount)+" items) ",1),Bt("div",W1e,[re.outline.length>0?(Dn(),io("div",V1e,[(Dn(!0),io(We,null,Dh(re.outline,(pe,he)=>(Dn(),io("div",{class:"outline-line",key:he},Jr(pe),1))),128))])):(Dn(),io("i",K1e,"(No outline available)"))])]),Bt("div",U1e,[p(Q,{danger:"",type:"dashed",shape:"circle",size:"middle",onClick:pe=>G(re),style:{"margin-left":"8px"}},{icon:cn(()=>[p(It(aS))]),_:2},1032,["onClick"]),p(Q,{type:"dashed",shape:"circle",size:"middle",onClick:pe=>te(re)},{icon:cn(()=>[p(It(EM))]),_:2},1032,["onClick"])])]))),128))])):h$("",!0)])]),_:1},8,["open"])]),p(U,{key:"switcher",size:"large",type:"danger","checked-children":"ON","un-checked-children":"OFF",checked:v.value,"onUpdate:checked":V[9]||(V[9]=re=>v.value=re),onChange:C},null,8,["checked"])])]),default:cn(()=>[pn(Bt("div",I1e,Jr(G1e),512),[[mn,!(P.length||T.value)]]),pn(Bt("div",{class:"trans-list",ref_key:"transListRef",ref:_},[(Dn(!0),io(We,null,Dh(P,re=>(Dn(),io("div",{key:re.id,class:Tr(["node"]),"data-seg-id":re.id},[Bt("div",{class:Tr(["trans-src-lang",j.value])},Jr(re.text),3),Bt("div",{class:Tr(["trans-dst-lang",j.value])},Jr(re.translatedText),3)],8,T1e))),128)),pn((Dn(),io("div",{class:"node current_node",key:E.value},[Bt("div",{class:Tr(["trans-src-lang",j.value])},Jr(T.value),3),Bt("div",{class:Tr(["trans-dst-lang",j.value])},Jr(M.value),3)])),[[mn,Z.value]])],512),[[mn,P.length||T.value]])]),_:1})])],2)])}}}),Y1e=Ch(X1e,[["__scopeId","data-v-3a741d94"]]),q1e={class:"content-wrapper"},Z1e=le({__name:"index",setup(e){const t=B_();return je(()=>{console.log("config",t.$state)}),(n,o)=>{const r=Oo("a-result");return Dn(),io("div",q1e,[p(r,{style:{width:"100%"},title:"Settings"})])}}}),Q1e=Ch(Z1e,[["__scopeId","data-v-d41c9ce7"]]),J1e=[{name:"home",path:"/",component:Y1e,meta:{requiresAgreement:!1}},{name:"settings",path:"/settings",component:Q1e},{name:"404",path:"/404",component:x1e}],kS=y1e({history:Gye("/app/"),routes:J1e});kS.beforeEach((e,t,n)=>{console.log("=============== router to : ",e),e.matched.length===0?n({name:"404"}):n()});const k_=nye();k_.use(hye);iP(vye).use(k_).use(kS).use(y0e).mount("#app")});export default eSe();
|
frontend/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="./favicon.ico" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Translator</title>
|
| 8 |
-
<script type="module" crossorigin src="./assets/index-
|
| 9 |
-
<link rel="stylesheet" href="./assets/index-
|
| 10 |
</head>
|
| 11 |
<body>
|
| 12 |
<div id="app"></div>
|
|
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="./favicon.ico" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Translator</title>
|
| 8 |
+
<script type="module" crossorigin src="./assets/index-fc3a0f87.js"></script>
|
| 9 |
+
<link rel="stylesheet" href="./assets/index-b1f15c01.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
| 12 |
<div id="app"></div>
|