@koishi-ce/plugin-explorer 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{$ as e,A as t,At as n,E as r,Et as i,Ft as a,G as o,It as s,J as c,K as l,L as u,Lt as d,Mt as f,Nt as p,O as m,Ot as h,P as g,Pt as _,Q as ee,S as te,St as v,T as y,W as b,X as ne,Y as re,Z as ie,_t as ae,at as oe,bt as x,c as se,dt as ce,et as le,f as ue,ft as de,g as fe,gt as pe,ht as me,it as he,j as ge,jt as _e,kt as ve,l as ye,lt as be,mt as S,n as xe,nt as Se,ot as Ce,q as we,rt as Te,st as Ee,t as De,ut as Oe,v as ke,vt as C,w as Ae,wt as je,x as Me,xt as Ne,yt as Pe}from"./dist-BaW5Uidk.js";import{i as Fe,n as Ie,o as Le,r as Re}from"./dist-cmk6kaIn.js";import{Binary as ze,SchemaBase as Be,extendLocales as Ve,icons as w,isNullable as He,scrollActiveTree as Ue,send as T,store as We,useColorMode as Ge,useContext as Ke,useI18n as qe,useMenu as Je}from"@koishi-ce/client";import{Fragment as E,computed as D,createBlock as O,createCommentVNode as k,createElementBlock as A,createElementVNode as j,createTextVNode as M,createVNode as N,defineComponent as Ye,markRaw as P,onActivated as Xe,openBlock as F,reactive as Ze,ref as I,renderList as Qe,renderSlot as $e,resolveComponent as L,shallowRef as et,toDisplayString as R,unref as z,vModelText as tt,watch as nt,withCtx as B,withDirectives as rt,withKeys as it,withModifiers as at}from"vue";import{useRoute as ot,useRouter as st}from"vue-router";import{useEventListener as ct}from"@vueuse/core";var lt={explorer:{title:`Explorer`,menu:{save:`Speichern`,refresh:`Aktualisieren`,createFile:`Neue Datei`,createDirectory:`Neuer Ordner`,upload:`Datei hochladen`,download:`Datei herunterladen`,rename:`Umbenennen`,remove:`Löschen`},upload:{hint:`Ziehen Sie Dateien zum Hochladen in das Fenster.`},picker:{from:`Von {0}: {1}`,upload:`Datei hochladen`,createFolder:`Ordner erstellen`,cancel:`Abbrechen`,selectDirectory:`Aktuelles Verzeichnis auswählen`,chooseFile:`eine Datei auswählen`,chooseEither:`ein Verzeichnis oder eine Datei auswählen`,chooseDirectory:`ein Verzeichnis auswählen`,root:`Stammverzeichnis`,file:`Datei: {0}`,directory:`Verzeichnis: {0}`},view:{empty:`Wählen Sie eine Datei in der Seitenleiste aus, um sie anzuzeigen`,loading:`Wird geladen...`,unsupported:`Nicht unterstütztes Dateiformat: {0}`,removeFile:`Möchten Sie die Datei {0} wirklich löschen?`,removeDirectory:`Möchten Sie den Ordner {0} wirklich löschen?`,cancel:`Abbrechen`,confirm:`Bestätigen`}}},ut={explorer:{title:`Explorer`,menu:{save:`Save`,refresh:`Refresh`,createFile:`New File`,createDirectory:`New Folder`,upload:`Upload File`,download:`Download File`,rename:`Rename`,remove:`Delete`},upload:{hint:`Drag and drop files into the window to upload.`},picker:{from:`From {0}: {1}`,upload:`Upload File`,createFolder:`New Folder`,cancel:`Cancel`,selectDirectory:`Select Current Directory`,chooseFile:`choose a file`,chooseEither:`choose a directory or file`,chooseDirectory:`choose a directory`,root:`Root directory`,file:`File: {0}`,directory:`Directory: {0}`},view:{empty:`Select a file in the sidebar to view it`,loading:`Loading...`,unsupported:`Unsupported file format: {0}`,removeFile:`Are you sure you want to delete the file {0}?`,removeDirectory:`Are you sure you want to delete the folder {0}?`,cancel:`Cancel`,confirm:`Confirm`}}},dt={explorer:{title:`Explorateur`,menu:{save:`Enregistrer`,refresh:`Actualiser`,createFile:`Nouveau fichier`,createDirectory:`Nouveau dossier`,upload:`Téléverser un fichier`,download:`Télécharger un fichier`,rename:`Renommer`,remove:`Supprimer`},upload:{hint:`Glissez-déposez des fichiers dans la fenêtre pour les téléverser.`},picker:{from:`Depuis {0} : {1}`,upload:`Téléverser un fichier`,createFolder:`Créer un dossier`,cancel:`Annuler`,selectDirectory:`Sélectionner le répertoire actuel`,chooseFile:`choisir un fichier`,chooseEither:`choisir un répertoire ou un fichier`,chooseDirectory:`choisir un répertoire`,root:`Répertoire racine`,file:`Fichier : {0}`,directory:`Répertoire : {0}`},view:{empty:`Sélectionnez un fichier dans le panneau latéral pour l'afficher`,loading:`Chargement...`,unsupported:`Format de fichier non pris en charge : {0}`,removeFile:`Voulez-vous vraiment supprimer le fichier {0} ?`,removeDirectory:`Voulez-vous vraiment supprimer le dossier {0} ?`,cancel:`Annuler`,confirm:`Confirmer`}}},ft={explorer:{title:`エクスプローラー`,menu:{save:`保存`,refresh:`更新`,createFile:`新規ファイル`,createDirectory:`新規フォルダー`,upload:`ファイルをアップロード`,download:`ファイルをダウンロード`,rename:`名前の変更`,remove:`削除`},upload:{hint:`ファイルをウィンドウにドラッグ&ドロップしてアップロードしてください。`},picker:{from:`{0} から{1}`,upload:`ファイルをアップロード`,createFolder:`フォルダーを作成`,cancel:`キャンセル`,selectDirectory:`現在のディレクトリを選択`,chooseFile:`ファイルを選択`,chooseEither:`ディレクトリまたはファイルを選択`,chooseDirectory:`ディレクトリを選択`,root:`ルートディレクトリ`,file:`ファイル:{0}`,directory:`ディレクトリ:{0}`},view:{empty:`左側のサイドバーで表示するファイルを選択してください`,loading:`読み込み中……`,unsupported:`サポートされていないファイル形式:{0}`,removeFile:`本当にファイル {0} を削除しますか?`,removeDirectory:`本当にフォルダー {0} を削除しますか?`,cancel:`キャンセル`,confirm:`確認`}}},pt={explorer:{title:`Проводник`,menu:{save:`Сохранить`,refresh:`Обновить`,createFile:`Новый файл`,createDirectory:`Новая папка`,upload:`Загрузить файл`,download:`Скачать файл`,rename:`Переименовать`,remove:`Удалить`},upload:{hint:`Перетащите файлы в окно, чтобы загрузить их.`},picker:{from:`Из {0}: {1}`,upload:`Загрузить файл`,createFolder:`Создать папку`,cancel:`Отмена`,selectDirectory:`Выбрать текущий каталог`,chooseFile:`выбрать файл`,chooseEither:`выбрать каталог или файл`,chooseDirectory:`выбрать каталог`,root:`Корневой каталог`,file:`Файл: {0}`,directory:`Каталог: {0}`},view:{empty:`Выберите файл в боковой панели, чтобы просмотреть его`,loading:`Загрузка...`,unsupported:`Неподдерживаемый формат файла: {0}`,removeFile:`Вы действительно хотите удалить файл {0}?`,removeDirectory:`Вы действительно хотите удалить папку {0}?`,cancel:`Отмена`,confirm:`Подтвердить`}}},mt={explorer:{title:`资源管理器`,menu:{save:`保存`,refresh:`刷新`,createFile:`新建文件`,createDirectory:`新建文件夹`,upload:`上传文件`,download:`下载文件`,rename:`重命名`,remove:`删除`},upload:{hint:`请将文件拖动到窗口内以上传。`},picker:{from:`从 {0} {1}`,upload:`上传文件`,createFolder:`创建文件夹`,cancel:`取消`,selectDirectory:`选定当前目录`,chooseFile:`选择文件`,chooseEither:`选择目录或文件`,chooseDirectory:`选择目录`,root:`根目录`,file:`文件:{0}`,directory:`目录:{0}`},view:{empty:`在左侧栏选择要查看的文件`,loading:`正在加载……`,unsupported:`不支持的文件格式:{0}`,removeFile:`你真的要删除文件 {0} 吗?`,removeDirectory:`你真的要删除文件夹 {0} 吗?`,cancel:`取消`,confirm:`确认`}}},ht={explorer:{title:`檔案總管`,menu:{save:`儲存`,refresh:`重新整理`,createFile:`新增檔案`,createDirectory:`新增資料夾`,upload:`上傳檔案`,download:`下載檔案`,rename:`重新命名`,remove:`刪除`},upload:{hint:`請將檔案拖曳到視窗內以上傳。`},picker:{from:`從 {0} {1}`,upload:`上傳檔案`,createFolder:`建立資料夾`,cancel:`取消`,selectDirectory:`選定目前目錄`,chooseFile:`選擇檔案`,chooseEither:`選擇目錄或檔案`,chooseDirectory:`選擇目錄`,root:`根目錄`,file:`檔案:{0}`,directory:`目錄:{0}`},view:{empty:`在左側欄選擇要查看的檔案`,loading:`正在載入……`,unsupported:`不支援的檔案格式:{0}`,removeFile:`你真的要刪除檔案 {0} 嗎?`,removeDirectory:`你真的要刪除資料夾 {0} 嗎?`,cancel:`取消`,confirm:`確認`}}},V=Ze({});nt(()=>We.explorer,()=>{let e={...V};function t(n,r=`/`){if(n)for(let i of n)i.filename=r+i.name,V[i.filename]=i,delete e[i.filename],t(i.children,`${i.filename}/`)}t(We.explorer);for(let t in e)delete V[t]},{immediate:!0});var gt={mounted:e=>e.focus()},H=I(null),_t=[`onClick`],vt=[`onUpdate:modelValue`],yt={class:`left`},bt={class:`right`},xt=Ye({__name:`file-picker`,props:{schema:{},modelValue:{},disabled:{},prefix:{},initial:{}},emits:[`update:modelValue`],setup(e){let{t}=qe(),n=e,r=Be.useModel(),i=D(()=>({filters:[`file`],...n.schema?.meta.extra})),a=D(()=>(i.value.filters??[]).includes(`directory`)),o=D(()=>(i.value.filters??[]).some(e=>e!==`directory`)),s=D(()=>a.value?o.value?t(`explorer.picker.chooseEither`):t(`explorer.picker.chooseDirectory`):t(`explorer.picker.chooseFile`)),c=I(!1),l=I(`/`),u=D(()=>{let e=V[l.value.slice(0,-1)]?.children||We?.explorer||[],{filters:t=[]}=i.value;return e.filter(e=>{if(e.type===`directory`)return!0;if(e.type===`file`||e.type===`symlink`){let n=e.name.lastIndexOf(`.`),r=n===-1?``:e.name.slice(n);return t.some(e=>e===`directory`?!1:e===`file`?!0:typeof e==`string`?e===r:e.extensions.includes(r))}return!1})});function d(e){e.filename!==l.value&&(e.type===`directory`?l.value=`${l.value+e.name}/`:(r.value=l.value.slice(1)+e.name,c.value=!1))}function f(){let e={type:`directory`,name:``,filename:l.value,oldValue:``,newValue:``};V[l.value]=e,(V[l.value.slice(0,-1)]?.children||We?.explorer||[]).push(e)}function p(){let e=V[l.value];if(!e)return;let t=l.value+e.name;t in V||!e.name?m():(V[t]=e,delete V[l.value],T(`explorer/mkdir`,t),e.filename=t)}function m(){let e=V[l.value];if(!e)return;delete V[l.value];let t=V[l.value.slice(0,-1)]?.children||We?.explorer||[];t.splice(t.indexOf(e),1)}let h=D(()=>{if(He(r.value))return;if(!r.value)return t(`explorer.picker.root`);let e=V[`/${r.value}`];return e?e.type===`file`?t(`explorer.picker.file`,[e.name]):t(`explorer.picker.directory`,[e.name]):r.value});function g(){let e=l.value.slice(0,-1).lastIndexOf(`/`);l.value=l.value.slice(0,e+1)}function _(){c.value=!1,a.value&&(r.value=l.value.slice(1,-1))}return(e,n)=>{let r=L(`el-button`),ee=L(`k-icon`),te=L(`el-scrollbar`),v=L(`el-dialog`);return F(),O(z(Be),null,{title:B(()=>[$e(e.$slots,`title`)]),desc:B(()=>[$e(e.$slots,`desc`)]),menu:B(()=>[$e(e.$slots,`menu`)]),prefix:B(()=>[$e(e.$slots,`prefix`)]),suffix:B(()=>[$e(e.$slots,`suffix`)]),control:B(()=>[N(r,{onClick:n[0]||=e=>c.value=!0},{default:B(()=>[M(R(h.value??s.value),1)]),_:1}),N(v,{class:`file-picker`,"destroy-on-close":``,modelValue:c.value,"onUpdate:modelValue":n[8]||=e=>c.value=e},{header:B(()=>[N(r,{class:`back-button`,disabled:l.value===`/`,onClick:n[1]||=e=>g()},{default:B(()=>[N(ee,{name:`chevron-left`})]),_:1},8,[`disabled`]),M(` `+R(z(t)(`explorer.picker.from`,[l.value,s.value])),1)]),footer:B(()=>[j(`div`,yt,[i.value.allowCreate?(F(),A(E,{key:0},[o.value?(F(),O(r,{key:0,onClick:n[4]||=e=>H.value=l.value+`/`},{default:B(()=>[M(R(z(t)(`explorer.picker.upload`)),1)]),_:1})):k(`v-if`,!0),a.value?(F(),O(r,{key:1,onClick:n[5]||=e=>f()},{default:B(()=>[M(R(z(t)(`explorer.picker.createFolder`)),1)]),_:1})):k(`v-if`,!0)],64)):k(`v-if`,!0)]),j(`div`,bt,[N(r,{onClick:n[6]||=e=>c.value=!1},{default:B(()=>[M(R(z(t)(`explorer.picker.cancel`)),1)]),_:1}),a.value?(F(),O(r,{key:0,type:`primary`,onClick:n[7]||=e=>_()},{default:B(()=>[M(R(z(t)(`explorer.picker.selectDirectory`)),1)]),_:1})):k(`v-if`,!0)])]),default:B(()=>[N(te,null,{default:B(()=>[(F(!0),A(E,null,Qe(u.value,e=>(F(),A(`div`,{class:`entry`,key:e.name,onClick:t=>d(e)},[N(ee,{class:`entry-icon`,name:e.type},null,8,[`name`]),e.filename===l.value?rt((F(),A(`input`,{key:0,"onUpdate:modelValue":t=>e.name=t,onKeypress:n[2]||=it(at(e=>p(),[`prevent`]),[`enter`]),onKeydown:n[3]||=it(at(e=>m(),[`prevent`]),[`escape`])},null,40,vt)),[[z(gt)],[tt,e.name]]):(F(),A(E,{key:1},[M(R(e.name),1)],64))],8,_t))),128))]),_:1})]),_:1},8,[`modelValue`])]),_:3})}}}),St=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Dt(e.state,n.from);return r.line?wt(e):r.block?Et(e):!1};function Ct(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var wt=Ct(Mt,0),Tt=Ct(jt,0),Et=Ct((e,t)=>jt(e,t,At(t)),0);function Dt(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var Ot=50;function kt(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-Ot,r),o=e.sliceDoc(i,i+Ot),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+Ot),d=e.sliceDoc(i-Ot,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function At(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function jt(e,t,n=t.selection.ranges){let r=n.map(e=>Dt(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>kt(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function Mt(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=Dt(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var Nt=me.define(),Pt=me.define(),Ft=v.define(),It=v.define({combine(e){return _(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Lt=ve.define({create(){return en.empty},update(e,t){let n=t.state.facet(It),r=t.annotation(Nt);if(r){let i=U.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?Wt(o,o.length,n.minDepth,i):Yt(o,t.startState.selection),new en(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(Pt);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(_e.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=U.fromTransaction(t),o=t.annotation(_e.time),s=t.annotation(_e.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new en(e.done.map(U.fromJSON),e.undone.map(U.fromJSON))}});function Rt(e={}){return[Lt,It.of(e),l.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?Bt:e.inputType==`historyRedo`?Vt:null;return n?(e.preventDefault(),n(t)):!1}})]}function zt(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(Lt,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var Bt=zt(0,!1),Vt=zt(1,!1),Ht=zt(0,!0),Ut=zt(1,!0),U=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&ae.fromJSON(t.changes),[],t.mapped&&pe.fromJSON(t.mapped),t.startSelection&&x.fromJSON(t.startSelection),t.selectionsAfter.map(x.fromJSON))}static fromTransaction(t,n){let r=W;for(let e of t.startState.facet(Ft)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,W)}static selection(t){return new e(void 0,W,void 0,void 0,t)}};function Wt(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function Gt(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Kt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function qt(e,t){return e.length?t.length?e.concat(t):e:t}var W=[],Jt=200;function Yt(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Jt));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Wt(e,e.length-1,1e9,n.setSelAfter(r)))}return[U.selection([t])]}function Xt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Zt(e,t){if(!e.length)return e;let n=e.length,r=W;for(;n;){let i=Qt(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[U.selection(r)]:W}function Qt(e,t,n){let r=qt(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):W,n);if(!e.changes)return U.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new U(i,h.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var $t=/^(input\.type|delete)($|\.)/,en=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||$t.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,Gt(s.changes,t.changes))||r==`input.type.compose`)?Wt(o,o.length-1,i.minDepth,new U(t.changes.compose(s.changes),qt(h.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,W)):Wt(o,o.length,i.minDepth,t),new e(o,W,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:W;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Kt(a[a.length-1],t)?this:new e(Yt(this.done,t),this.undone,n,r)}addMapping(t){return new e(Zt(this.done,t),Zt(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Nt.of({side:e,rest:Xt(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?W:r.slice(0,r.length-1);return i.mapped&&(n=Zt(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Nt.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};en.empty=new en(W,W);var tn=[{key:`Mod-z`,run:Bt,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:Vt,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:Vt,preventDefault:!0},{key:`Mod-u`,run:Ht,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:Ut,preventDefault:!0}];function nn(e,t){return x.create(e.ranges.map(t),e.mainIndex)}function G(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function K({state:e,dispatch:t},n){let r=nn(e.selection,n);return!r.eq(e.selection,!0)&&(t(G(e,r)),!0)}function rn(e,t){return x.cursor(t?e.to:e.from)}function an(e,t){return K(e,n=>n.empty?e.moveByChar(n,t):rn(n,t))}function q(e){return e.textDirectionAt(e.state.selection.main.head)==o.LTR}var on=e=>an(e,!q(e)),sn=e=>an(e,q(e));function cn(e,t){return K(e,n=>n.empty?e.moveByGroup(n,t):rn(n,t))}var ln=e=>cn(e,!q(e)),un=e=>cn(e,q(e));typeof Intl<`u`&&Intl.Segmenter;function dn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function fn(e,t,n){let r=ge(e).resolveInner(t.head),i=n?u.closedBy:u.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;dn(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?m(e,r.from,1):m(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,x.cursor(s,n?-1:1)}var pn=e=>K(e,t=>fn(e.state,t,!q(e))),mn=e=>K(e,t=>fn(e.state,t,q(e)));function hn(e,t){return K(e,n=>{if(!n.empty)return rn(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var gn=e=>hn(e,!1),_n=e=>hn(e,!0);function vn(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(l.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function yn(e,t){let n=vn(e),{state:r}=e,i=nn(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):rn(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=l.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(G(r,i),{effects:a}),!0}var bn=e=>yn(e,!1),xn=e=>yn(e,!0);function J(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=x.cursor(r.from+n))}return i}var Sn=e=>K(e,t=>J(e,t,!0)),Cn=e=>K(e,t=>J(e,t,!1)),wn=e=>K(e,t=>J(e,t,!q(e))),Tn=e=>K(e,t=>J(e,t,q(e))),En=e=>K(e,t=>e.moveToLineBoundary(t,!1,!1)),Dn=e=>K(e,t=>e.moveToLineBoundary(t,!0,!1));function On(e,t,n){let r=!1,i=nn(e.selection,t=>{let i=m(e,t.head,-1)||m(e,t.head,1)||t.head>0&&m(e,t.head-1,1)||t.head<e.doc.length&&m(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?x.range(t.anchor,a):x.cursor(a)});return r?(t(G(e,i)),!0):!1}var kn=({state:e,dispatch:t})=>On(e,t,!1);function Y(e,t,n){let r=nn(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=x.range(e.head,e.anchor));let r=n(e);return x.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(G(e.state,r)),!0)}function An(e,t){return Y(e,t,n=>e.moveByChar(n,t))}var jn=e=>An(e,!q(e)),Mn=e=>An(e,q(e));function Nn(e,t){return Y(e,t,n=>e.moveByGroup(n,t))}var Pn=e=>Nn(e,!q(e)),Fn=e=>Nn(e,q(e)),In=e=>{let t=!q(e);return Y(e,t,n=>fn(e.state,n,t))},Ln=e=>{let t=q(e);return Y(e,t,n=>fn(e.state,n,t))};function Rn(e,t){return Y(e,t,n=>e.moveVertically(n,t))}var zn=e=>Rn(e,!1),Bn=e=>Rn(e,!0);function Vn(e,t){return Y(e,t,n=>e.moveVertically(n,t,vn(e).height))}var Hn=e=>Vn(e,!1),Un=e=>Vn(e,!0),Wn=e=>Y(e,!0,t=>J(e,t,!0)),Gn=e=>Y(e,!1,t=>J(e,t,!1)),Kn=e=>{let t=!q(e);return Y(e,t,n=>J(e,n,t))},qn=e=>{let t=q(e);return Y(e,t,n=>J(e,n,t))},Jn=e=>Y(e,!1,t=>x.cursor(e.lineBlockAt(t.head).from)),Yn=e=>Y(e,!0,t=>x.cursor(e.lineBlockAt(t.head).to)),Xn=({state:e,dispatch:t})=>(t(G(e,{anchor:0})),!0),Zn=({state:e,dispatch:t})=>(t(G(e,{anchor:e.doc.length})),!0),Qn=({state:e,dispatch:t})=>(t(G(e,{anchor:e.selection.main.anchor,head:0})),!0),$n=({state:e,dispatch:t})=>(t(G(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),er=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),tr=({state:e,dispatch:t})=>{let n=br(e).map(({from:t,to:n})=>x.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:x.create(n),userEvent:`select`})),!0},nr=({state:e,dispatch:t})=>{let n=nn(e.selection,t=>{let n=ge(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return x.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(G(e,n)),!0)};function rr(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(G(n,x.create(i,i.length-1))),!0)}var ir=e=>rr(e,!1),ar=e=>rr(e,!0),or=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=x.create([n.main]):n.main.empty||(r=x.create([x.cursor(n.main.head)])),r?(t(G(e,r)),!0):!1};function sr(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=cr(e,o,!1)):o>i&&(n=`delete.forward`,o=cr(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=cr(e,i,!1),a=cr(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:x.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?l.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function cr(e,t,n){if(e instanceof l)for(let r of e.state.facet(l.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var lr=(e,t,n)=>sr(e,r=>{let i=r.from,{state:o}=e,c=o.doc.lineAt(i),l,u;if(n&&!t&&i>c.from&&i<c.from+200&&!/[^ \t]/.test(l=c.text.slice(0,i-c.from))){if(l[l.length-1]==` `)return i-1;let e=a(l,o.tabSize)%Me(o)||Me(o);for(let t=0;t<e&&l[l.length-1-t]==` `;t++)i--;u=i}else u=s(c.text,i-c.from,t,t)+c.from,u==i&&c.number!=(t?o.doc.lines:1)?u+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(c.text.slice(u-c.from,i-c.from))&&(u=s(c.text,u-c.from,!1,!1)+c.from);return u}),ur=e=>lr(e,!1,!0),dr=e=>lr(e,!0,!1),fr=(e,t)=>sr(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let c=s(a.text,r-a.from,t)+a.from,l=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),u=o(l);if(e!=null&&u!=e)break;(l!=` `||r!=n.head)&&(e=u),r=c}return r}),pr=e=>fr(e,!1),mr=e=>fr(e,!0),hr=e=>sr(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),gr=e=>sr(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),_r=e=>sr(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),vr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:n.of([``,``])},range:x.cursor(e.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:`input`})),!0},yr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:s(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:s(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:x.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function br(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function xr(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of br(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(x.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(x.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:x.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var Sr=({state:e,dispatch:t})=>xr(e,t,!1),Cr=({state:e,dispatch:t})=>xr(e,t,!0);function wr(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of br(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Tr=({state:e,dispatch:t})=>wr(e,t,!1),Er=({state:e,dispatch:t})=>wr(e,t,!0),Dr=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(br(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=nn(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Or(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ge(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(u.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var kr=jr(!1),Ar=jr(!0);function jr(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:i,to:o}=r,s=t.doc.lineAt(i),c=!e&&i==o&&Or(t,i);e&&(i=o=(o<=s.to?s:t.doc.lineAt(o)).to);let l=new xe(t,{simulateBreak:i,simulateDoubleBreak:!!c}),u=te(l,i);for(u??=a(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize);o<s.to&&/\s/.test(s.text[o-s.from]);)o++;c?{from:i,to:o}=c:i>s.from&&i<s.from+100&&!/\S/.test(s.text.slice(0,i))&&(i=s.from);let d=[``,y(t,u)];return c&&d.push(y(t,l.lineIndent(s.from,-1))),{changes:{from:i,to:o,insert:n.of(d)},range:x.cursor(i+1+d[1].length)}});return r(t.update(i,{scrollIntoView:!0,userEvent:`input`})),!0}}function Mr(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:x.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Nr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new xe(e,{overrideIndentation:e=>n[e]??-1}),i=Mr(e,(t,i,a)=>{let o=te(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=y(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},Pr=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Mr(e,(t,n)=>{n.push({from:t.from,insert:e.facet(r)})}),{userEvent:`input.indent`})),!0),Fr=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Mr(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=a(r,e.tabSize),o=0,s=y(e,Math.max(0,i-Me(e)));for(;o<r.length&&o<s.length&&r.charCodeAt(o)==s.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:s.slice(o)})}),{userEvent:`delete.dedent`})),!0),Ir=e=>(e.setTabFocusMode(),!0),Lr=[{key:`Ctrl-b`,run:on,shift:jn,preventDefault:!0},{key:`Ctrl-f`,run:sn,shift:Mn},{key:`Ctrl-p`,run:gn,shift:zn},{key:`Ctrl-n`,run:_n,shift:Bn},{key:`Ctrl-a`,run:En,shift:Jn},{key:`Ctrl-e`,run:Dn,shift:Yn},{key:`Ctrl-d`,run:dr},{key:`Ctrl-h`,run:ur},{key:`Ctrl-k`,run:hr},{key:`Ctrl-Alt-h`,run:pr},{key:`Ctrl-o`,run:vr},{key:`Ctrl-t`,run:yr},{key:`Ctrl-v`,run:xn}],Rr=[{key:`ArrowLeft`,run:on,shift:jn,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:ln,shift:Pn,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:wn,shift:Kn,preventDefault:!0},{key:`ArrowRight`,run:sn,shift:Mn,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:un,shift:Fn,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Tn,shift:qn,preventDefault:!0},{key:`ArrowUp`,run:gn,shift:zn,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:Xn,shift:Qn},{mac:`Ctrl-ArrowUp`,run:bn,shift:Hn},{key:`ArrowDown`,run:_n,shift:Bn,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:Zn,shift:$n},{mac:`Ctrl-ArrowDown`,run:xn,shift:Un},{key:`PageUp`,run:bn,shift:Hn},{key:`PageDown`,run:xn,shift:Un},{key:`Home`,run:Cn,shift:Gn,preventDefault:!0},{key:`Mod-Home`,run:Xn,shift:Qn},{key:`End`,run:Sn,shift:Wn,preventDefault:!0},{key:`Mod-End`,run:Zn,shift:$n},{key:`Enter`,run:kr,shift:kr},{key:`Mod-a`,run:er},{key:`Backspace`,run:ur,shift:ur,preventDefault:!0},{key:`Delete`,run:dr,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:pr,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:mr,preventDefault:!0},{mac:`Mod-Backspace`,run:gr,preventDefault:!0},{mac:`Mod-Delete`,run:_r,preventDefault:!0}].concat(Lr.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),zr=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:pn,shift:In},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:mn,shift:Ln},{key:`Alt-ArrowUp`,run:Sr},{key:`Shift-Alt-ArrowUp`,run:Tr},{key:`Alt-ArrowDown`,run:Cr},{key:`Shift-Alt-ArrowDown`,run:Er},{key:`Mod-Alt-ArrowUp`,run:ir},{key:`Mod-Alt-ArrowDown`,run:ar},{key:`Escape`,run:or},{key:`Mod-Enter`,run:Ar},{key:`Alt-l`,mac:`Ctrl-l`,run:tr},{key:`Mod-i`,run:nr,preventDefault:!0},{key:`Mod-[`,run:Fr},{key:`Mod-]`,run:Pr},{key:`Mod-Alt-\\`,run:Nr},{key:`Shift-Mod-k`,run:Dr},{key:`Shift-Mod-\\`,run:kn},{key:`Mod-/`,run:St},{key:`Alt-A`,mac:`Ctrl-A`,run:Tt},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:Ir}].concat(Rr),Br={key:`Tab`,run:Pr,shift:Fr},Vr=`#e5c07b`,Hr=`#e06c75`,Ur=`#56b6c2`,Wr=`#ffffff`,Gr=`#abb2bf`,Kr=`#7d8799`,qr=`#61afef`,Jr=`#98c379`,Yr=`#d19a66`,Xr=De.define([{tag:g.keyword,color:`#c678dd`},{tag:[g.name,g.deleted,g.character,g.propertyName,g.macroName],color:Hr},{tag:[g.function(g.variableName),g.labelName],color:qr},{tag:[g.color,g.constant(g.name),g.standard(g.name)],color:Yr},{tag:[g.definition(g.name),g.separator],color:Gr},{tag:[g.typeName,g.className,g.number,g.changed,g.annotation,g.modifier,g.self,g.namespace],color:Vr},{tag:[g.operator,g.operatorKeyword,g.url,g.escape,g.regexp,g.link,g.special(g.string)],color:Ur},{tag:[g.meta,g.comment],color:Kr},{tag:g.strong,fontWeight:`bold`},{tag:g.emphasis,fontStyle:`italic`},{tag:g.strikethrough,textDecoration:`line-through`},{tag:g.link,color:Kr,textDecoration:`underline`},{tag:g.heading,fontWeight:`bold`,color:Hr},{tag:[g.atom,g.bool,g.special(g.variableName)],color:Yr},{tag:[g.processingInstruction,g.string,g.inserted],color:Jr},{tag:g.invalid,color:Wr}]),Zr=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,Qr=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(Zr(e)):Zr,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return f(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=d(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=p(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(Qr.prototype[Symbol.iterator]=function(){return this});var $r={from:-1,to:-1,match:/.*/.exec(``),precise:!0},ei=`gm`+(/x/.unicode==null?``:`u`),ti=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=$r,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new ii(e,t,n,r,i);this.re=new RegExp(t,ei+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=oi(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=oi(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},ni=new WeakMap,ri=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=ni.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return ni.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),ni.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},ii=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=$r,this.matchPos=oi(e,r),this.re=new RegExp(t,ei+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=ri.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=oi(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ri.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(ti.prototype[Symbol.iterator]=ii.prototype[Symbol.iterator]=function(){return this});function ai(e){try{return new RegExp(e,ei),!0}catch{return!1}}function oi(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var si=t=>{let n=e(t,`cm-goto-line`);if(n){let e=n.dom.querySelector(`input[type=text]`);return e&&e.select(),!0}let{state:r}=t,i=String(r.doc.lineAt(t.state.selection.main.head).number),{close:a,result:o}=ce(t,{class:`cm-goto-line`,label:r.phrase(`Go to line`),input:{type:`text`,name:`line`,value:i},focus:!0,submitLabel:r.phrase(`go`)});return o.then(e=>{let n=e&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.elements.line.value);if(!n){t.dispatch({effects:a});return}let i=r.doc.lineAt(r.selection.main.head),[,o,s,c,u]=n,d=c?+c.slice(1):0,f=s?+s:i.number;if(s&&u){let e=f/100;o&&(e=e*(o==`-`?-1:1)+i.number/r.doc.lines),f=Math.round(r.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+i.number);let p=r.doc.line(Math.max(1,Math.min(r.doc.lines,f))),m=x.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[a,l.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},ci={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},li=v.define({combine(e){return _(e,ci,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function ui(e){let t=[gi,hi];return e&&t.push(li.of(e)),t}var di=b.mark({class:`cm-selectionMatch`}),fi=b.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function pi(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=C.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=C.Word)}function mi(e,t,n,r){return e(t.sliceDoc(n,n+1))==C.Word&&e(t.sliceDoc(r-1,r))==C.Word}var hi=we.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(li),{state:n}=e,r=n.selection;if(r.ranges.length>1)return b.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return b.none;let e=n.wordAt(i.head);if(!e)return b.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return b.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(pi(o,n,i.from,i.to)&&mi(o,n,i.from,i.to)))return b.none}else if(a=n.sliceDoc(i.from,i.to),!a)return b.none}let s=[];for(let r of e.visibleRanges){let e=new Qr(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||pi(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(fi.range(r,a)):(r>=i.to||a<=i.from)&&s.push(di.range(r,a)),s.length>t.maxMatches))return b.none}}return b.set(s)}},{decorations:e=>e.decorations}),gi=l.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),_i=({state:e,dispatch:t})=>{let{selection:n}=e,r=x.create(n.ranges.map(t=>e.wordAt(t.head)||x.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function vi(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new Qr(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new Qr(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var yi=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return _i({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=vi(e,r);return i?(t(e.update({selection:e.selection.addRange(x.range(i.from,i.to),!1),effects:l.scrollIntoView(i.to)})),!0):!1},bi=v.define({combine(e){return _(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new $i(e),scrollToMatch:e=>l.scrollIntoView(e)})}}),xi=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||ai(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
2
|
-
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Mi(this):new Ei(this)}getCursor(e,t=0,n){let r=e.doc?e:Ne.create({doc:e});return n??=r.doc.length,this.regexp?Oi(this,r,t,n):wi(this,r,t,n)}},Si=class{constructor(e){this.spec=e}};function Ci(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function wi(e,t,n,r){let i;return e.wholeWord&&(i=Ti(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=Ci(e.test,t,i)),new Qr(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Ti(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(ki(i,n-a))!=C.Word||t(Ai(i,n-a))!=C.Word)&&(t(Ai(i,r-a))!=C.Word||t(ki(i,r-a))!=C.Word))}var Ei=class extends Si{constructor(e){super(e)}nextMatch(e,t,n){let r=wi(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=wi(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=wi(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=wi(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=wi(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function Di(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function Oi(e,t,n,r){let i;return e.wholeWord&&(i=ji(t.charCategorizer(t.selection.main.head))),e.test&&(i=Di(e.test,t,i)),new ti(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function ki(e,t){return e.slice(s(e,t,!1),t)}function Ai(e,t){return e.slice(t,s(e,t))}function ji(e){return(t,n,r)=>!r[0].length||(e(ki(r.input,r.index))!=C.Word||e(Ai(r.input,r.index))!=C.Word)&&(e(Ai(r.input,r.index+r[0].length))!=C.Word||e(ki(r.input,r.index+r[0].length))!=C.Word)}var Mi=class extends Si{nextMatch(e,t,n){let r=Oi(this.spec,e,n,e.doc.length).next();return r.done&&(r=Oi(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=Oi(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=Oi(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Oi(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},Ni=h.define(),Pi=h.define(),X=ve.define({create(e){return new Fi(qi(e).create(),null)},update(e,t){for(let n of t.effects)n.is(Ni)?e=new Fi(n.value.create(),e.panel):n.is(Pi)&&(e=new Fi(e.query,n.value?Ki:null));return e},provide:e=>de.from(e,e=>e.panel)}),Fi=class{constructor(e,t){this.query=e,this.panel=t}},Ii=b.mark({class:`cm-searchMatch`}),Li=b.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Ri=we.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(X))}update(e){let t=e.state.field(X);(t!=e.startState.field(X)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return b.none;let{view:n}=this,r=new i;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Li:Ii)})}return r.finish()}},{decorations:e=>e.decorations});function zi(e){return t=>{let n=t.state.field(X,!1);return n&&n.query.spec.valid?e(t,n):Xi(t)}}var Bi=zi((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=x.single(r.from,r.to),a=e.state.facet(bi);return e.dispatch({selection:i,effects:[na(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),Yi(e),!0}),Vi=zi((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=x.single(i.from,i.to),o=e.state.facet(bi);return e.dispatch({selection:a,effects:[na(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),Yi(e),!0}),Hi=zi((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:x.create(n.map(e=>x.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),Ui=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new Qr(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(x.range(t.value.from,t.value.to))}return t(e.update({selection:x.create(a,o),userEvent:`select.search.matches`})),!0},Wi=zi((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,u,d=[];o.precise?o.from==r&&o.to==i&&(u=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(l.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(s);return o&&(c=x.single(o.from,o.to).map(f),d.push(na(e,o)),d.push(n.facet(bi).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:`input.replace`}),!0}),Gi=zi((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:l.announce.of(r),userEvent:`input.replace.all`}),!0});function Ki(e){return e.state.facet(bi).createPanel(e)}function qi(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(bi);return new xi({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function Ji(e){let t=le(e,Ki);return t&&t.dom.querySelector(`[main-field]`)}function Yi(e){let t=Ji(e);t&&t==e.root.activeElement&&t.select()}var Xi=e=>{let t=e.state.field(X,!1);if(t&&t.panel){let n=Ji(e);if(n&&n!=e.root.activeElement){let r=qi(e.state,t.query.spec);r.valid&&e.dispatch({effects:Ni.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Pi.of(!0),t?Ni.of(qi(e.state,t.query.spec)):h.appendConfig.of(ia)]});return!0},Zi=e=>{let t=e.state.field(X,!1);if(!t||!t.panel)return!1;let n=le(e,Ki);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Pi.of(!1)}),!0},Qi=[{key:`Mod-f`,run:Xi,scope:`editor search-panel`},{key:`F3`,run:Bi,shift:Vi,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:Bi,shift:Vi,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:Zi,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:Ui},{key:`Mod-Alt-g`,run:si},{key:`Mod-d`,run:yi,preventDefault:!0}],$i=class{constructor(e){this.view=e;let t=this.query=e.state.field(X).query.spec;this.commit=this.commit.bind(this),this.searchField=S(`input`,{value:t.search,placeholder:Z(e,`Find`),"aria-label":Z(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=S(`input`,{value:t.replace,placeholder:Z(e,`Replace`),"aria-label":Z(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=S(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=S(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=S(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return S(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=S(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>Bi(e),[Z(e,`next`)]),n(`prev`,()=>Vi(e),[Z(e,`previous`)]),n(`select`,()=>Hi(e),[Z(e,`all`)]),S(`label`,null,[this.caseField,Z(e,`match case`)]),S(`label`,null,[this.reField,Z(e,`regexp`)]),S(`label`,null,[this.wordField,Z(e,`by word`)]),...e.state.readOnly?[]:[S(`br`),this.replaceField,n(`replace`,()=>Wi(e),[Z(e,`replace`)]),n(`replaceAll`,()=>Gi(e),[Z(e,`replace all`)])],S(`button`,{name:`close`,onclick:()=>Zi(e),"aria-label":Z(e,`close`),type:`button`},[`×`])])}commit(){let e=new xi({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Ni.of(e)}))}keydown(e){Oe(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Vi:Bi)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Wi(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Ni)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(bi).top}};function Z(e,t){return e.state.phrase(t)}var ea=30,ta=/[\s\.,:;?!]/;function na(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-ea),o=Math.min(i,n+ea),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<ea;e++)if(!ta.test(s[e+1])&&ta.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-ea;e--)if(!ta.test(s[e-1])&&ta.test(s[e])){s=s.slice(0,e);break}}return l.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var ra=l.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),ia=[X,je.low(Ri),ra],aa=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},oa=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let a=r.facet(va).markerFilter;a&&(t=a(t,r));let o=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),s=new i,c=[],l=0,u=r.doc.iter(),d=0,f=r.doc.length;for(let e=0;;){let t=e==o.length?null:o[e];if(!t&&!c.length)break;let n,r;if(c.length)n=l,r=c.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>f)break;r=t.to,c.push(t),e++}for(;e<o.length;){let t=o[e];if(t.from==n&&(t.to>t.from||t.to==n))c.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,f);let i=!1;if(c.some(e=>e.from==n&&(e.to==r||r==f))&&(i=n==r,!i&&r-n<10)){let e=n-(d+u.value.length);e>0&&(u.next(e),d=n);for(let e=n;;){if(e>=r){i=!0;break}if(!u.lineBreak&&d+u.value.length>e)break;e=d+u.value.length,d+=u.value.length,u.next()}}let a=ka(c);if(i)s.add(n,n,b.widget({widget:new Sa(a),diagnostics:c.slice()}));else{let e=c.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);s.add(n,r,b.mark({class:`cm-lintRange cm-lintRange-`+a+e,diagnostics:c.slice(),inclusiveEnd:c.some(e=>e.to>r)}))}if(l=r,l==f)break;for(let e=0;e<c.length;e++)c[e].to<=l&&c.splice(e--,1)}let p=s.finish();return new e(p,n,Q(p))}};function Q(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new aa(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new aa(r.from,n,r.diagnostic)}}),r}function sa(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(va).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(la))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function ca(e,t){return e.field($,!1)?t:t.concat(h.appendConfig.of(ja))}var la=h.define(),ua=h.define(),da=h.define(),$=ve.define({create(){return new oa(b.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=Q(n,e.selected.diagnostic,i)||Q(n,null,i)}!n.size&&i&&t.state.facet(va).autoPanel&&(i=null),e=new oa(n,i,r)}for(let n of t.effects)if(n.is(la)){let r=t.state.facet(va).autoPanel?n.value.length?wa.open:null:e.panel;e=oa.init(n.value,r,t.state)}else n.is(ua)?e=new oa(e.diagnostics,n.value?wa.open:null,e.selected):n.is(da)&&(e=new oa(e.diagnostics,e.panel,n.value));return e},provide:e=>[de.from(e,e=>e.panel),l.decorations.from(e,e=>e.diagnostics)]}),fa=b.mark({class:`cm-lintRange cm-lintRange-active`});function pa(e,t,n){let{diagnostics:r}=e.state.field($),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(va).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:ma(e,i)}}}:null}function ma(e,t){return S(`ul`,{class:`cm-tooltip-lint`},t.map(t=>xa(e,t,!1)))}var ha=e=>{let t=e.state.field($,!1);(!t||!t.panel)&&e.dispatch({effects:ca(e.state,[ua.of(!0)])});let n=le(e,wa.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},ga=e=>{let t=e.state.field($,!1);return!t||!t.panel?!1:(e.dispatch({effects:ua.of(!1)}),!0)},_a=[{key:`Mod-Shift-m`,run:ha,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field($,!1);if(!t)return!1;let n=e.state.selection.main,r=Q(t.diagnostics,null,n.to+1);return!r&&(r=Q(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),re(e,r.from,1,{tooltip:Aa,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],va=v.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),..._(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:ya,tooltipFilter:ya,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function ya(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function ba(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function xa(e,t,n){let r=n?ba(t.actions):[];return S(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},S(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=Q(e.state.field($).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),S(`u`,s.slice(c,c+1)),s.slice(c+1)],u=n.markClass?` `+n.markClass:``;return S(`button`,{type:`button`,class:`cm-diagnosticAction`+u,onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&S(`div`,{class:`cm-diagnosticSource`},t.source))}var Sa=class extends c{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return S(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},Ca=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=xa(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},wa=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)ga(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=ba(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=Q(this.view.state.field($).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=S(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=S(`div`,{class:`cm-panel-lint`},this.list,S(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>ga(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field($).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field($),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new Ca(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Ca(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Q(this.view.state.field($).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:da.of(t)})}static open(t){return new e(t)}};function Ta(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Ea(e){return Ta(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var Da=l.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:Ea(`#f11`)},".cm-lintRange-warning":{backgroundImage:Ea(`orange`)},".cm-lintRange-info":{backgroundImage:Ea(`#999`)},".cm-lintRange-hint":{backgroundImage:Ea(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function Oa(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function ka(e){let t=`hint`,n=1;for(let r of e){let e=Oa(r.severity);e>n&&(n=e,t=r.severity)}return t}var Aa=oe(pa,{hideOn:sa}),ja=[$,l.decorations.compute([$],e=>{let{selected:t,panel:n}=e.field($);return!t||!n||t.from==t.to?b.none:b.set([fa.range(t.from,t.to)])}),Aa,Da],Ma=[Ee(),Te(),he(),Rt(),fe(),ie(),ee(),Ne.allowMultipleSelections.of(!0),Ae(),t(ue,{fallback:!0}),ye(),Re(),Ie(),be(),ne(),Se(),ui(),Ce.of([...Fe,...zr,...Qi,...tn,...ke,...Le,..._a])],Na=e=>async()=>se.define(await e()),Pa=[{label:`JavaScript`,extensions:[`js`,`mjs`,`cjs`],load:async()=>(await import(`./dist-DvhGkdfA.js`).then(e=>e.t)).javascript()},{label:`JSX`,extensions:[`jsx`],load:async()=>(await import(`./dist-DvhGkdfA.js`).then(e=>e.t)).javascript({jsx:!0})},{label:`TypeScript`,extensions:[`ts`,`mts`,`cts`],load:async()=>(await import(`./dist-DvhGkdfA.js`).then(e=>e.t)).javascript({typescript:!0})},{label:`TSX`,extensions:[`tsx`],load:async()=>(await import(`./dist-DvhGkdfA.js`).then(e=>e.t)).javascript({typescript:!0,jsx:!0})},{label:`JSON`,extensions:[`json`,`jsonc`],load:async()=>(await import(`./dist-khbkxa42.js`)).json()},{label:`HTML`,extensions:[`html`,`htm`],load:async()=>(await import(`./dist-DQBzzRg5.js`)).html()},{label:`XML`,extensions:[`xml`,`xsl`,`xsd`,`svg`],load:async()=>(await import(`./dist-CVvw8g9I.js`)).xml()},{label:`CSS`,extensions:[`css`],load:async()=>(await import(`./dist-BLlmyRVk.js`).then(e=>e.i)).css()},{label:`SCSS`,extensions:[`scss`],load:async()=>(await import(`./dist-BRHu8uof.js`)).sass({indented:!1})},{label:`Sass`,extensions:[`sass`],load:async()=>(await import(`./dist-BRHu8uof.js`)).sass({indented:!0})},{label:`Less`,extensions:[`less`],load:async()=>(await import(`./dist-DmPaCAWx.js`)).less()},{label:`Markdown`,extensions:[`md`,`markdown`],load:async()=>(await import(`./dist-C8Y3JG3t.js`)).markdown()},{label:`YAML`,extensions:[`yml`,`yaml`],load:async()=>(await import(`./dist-Bblq3-7E.js`)).yaml()},{label:`SQL`,extensions:[`sql`],load:async()=>(await import(`./dist-CXrT-QaX.js`)).sql()},{label:`Vue`,extensions:[`vue`],load:async()=>(await import(`./dist-DPw8Mxu7.js`)).vue()},{label:`Shell`,extensions:[`sh`,`bash`,`zsh`],load:Na(async()=>(await import(`./shell-BPOk74rq.js`)).shell)},{label:`PowerShell`,extensions:[`ps1`,`psm1`,`psd1`],load:Na(async()=>(await import(`./powershell-Bs8C1TzT.js`)).powerShell)},{label:`TOML`,extensions:[`toml`],load:Na(async()=>(await import(`./toml-CENNTAu3.js`)).toml)},{label:`Dockerfile`,extensions:[`dockerfile`],filenames:[`dockerfile`],load:Na(async()=>(await import(`./dockerfile-DwPgr3ck.js`)).dockerFile)},{label:`INI`,extensions:[`ini`,`properties`,`cfg`,`conf`,`env`],load:Na(async()=>(await import(`./properties-D8pUqSuZ.js`)).properties)},{label:`Diff`,extensions:[`diff`,`patch`],load:Na(async()=>(await import(`./diff-DtwSiaDg.js`)).diff)}],Fa=`Plain Text`;function Ia(e){let t=e.slice(Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`))+1).toLowerCase(),n=t.lastIndexOf(`.`),r=n===-1?``:t.slice(n+1);for(let e of Pa)if(r&&e.extensions?.includes(r)||e.filenames?.includes(t))return e}var La=et(Fa),Ra=l.theme({"&":{height:`100%`,fontSize:`14px`,backgroundColor:`var(--cm-bg)`,color:`var(--cm-fg)`},"&.cm-focused":{outline:`none`},".cm-scroller":{fontFamily:`var(--font-family-code)`,lineHeight:`1.6`},".cm-content":{caretColor:`var(--cm-caret)`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--cm-caret)`},".cm-selectionBackground, &.cm-focused .cm-selectionBackground":{backgroundColor:`var(--cm-selection-bg)`},".cm-selectionMatch":{backgroundColor:`var(--cm-match-bg)`},".cm-activeLine":{backgroundColor:`var(--cm-active-line-bg)`},".cm-activeLineGutter":{backgroundColor:`var(--cm-active-line-bg)`},".cm-gutters":{backgroundColor:`var(--cm-gutter-bg)`,color:`var(--cm-gutter-fg)`,border:`none`},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`var(--cm-gutter-fg)`},".cm-tooltip":{backgroundColor:`var(--cm-tooltip-bg)`,border:`1px solid var(--k-color-border)`,color:`var(--cm-fg)`},".cm-tooltip-autocomplete ul li[aria-selected]":{backgroundColor:`var(--k-color-primary-fade)`,color:`var(--cm-fg)`},".cm-panels":{backgroundColor:`var(--cm-gutter-bg)`,color:`var(--cm-fg)`},".cm-searchMatch":{backgroundColor:`var(--cm-match-bg)`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`var(--cm-selection-bg)`}});function za(e){let n=e.dark,i=[],a=``,o=!1,s=new Pe,c=new Pe,u=()=>n?t(Xr):[],d=()=>[Ma,Ce.of([Br]),r.of(` `),Ne.tabSize.of(2),Ra,s.of(u()),c.of(i),l.updateListener.of(t=>{t.docChanged&&e.onChange(t.state.doc.toString())})],f=new l({parent:e.parent,state:Ne.create({extensions:d()})});return{setContent(e){f.setState(Ne.create({doc:e,extensions:d()}))},async setLanguage(e){let t=Ia(e);if(La.value=t?.label??`Plain Text`,a=e,!t){i=[],o||f.dispatch({effects:c.reconfigure([])});return}let n=await t.load();o||a!==e||(i=n,f.dispatch({effects:c.reconfigure(n)}))},setTheme(e){n=e,f.dispatch({effects:s.reconfigure(u())})},destroy(){o=!0,a=``,f.destroy()}}}function Ba(e){let t=I(null);function n(t,n,r){if(n)t.name=n;else{let n=t.filename??``;delete V[n];let i=V[r.slice(0,-1).join(`/`)]?.children||e.data.value;i.splice(i.indexOf(t),1)}}function r(e,n){a();let r=`${e.filename}/`;t.value=r;let i={type:n,name:``,filename:r,oldValue:``,newValue:``};V[r]=i,e.expanded=!0,e.children?.push(i)}function i(r){let i=r.filename??``,a=i.split(/\//g),o=a.pop();a.push(r.name);let s=a.join(`/`);s in V||!r.name?n(r,o,a):i!==s&&(V[s]=r,delete V[i],o?(T(`explorer/rename`,i,s),e.active.value=s):r.type===`file`?(T(`explorer/write`,s,``),e.active.value=s):T(`explorer/mkdir`,s),r.filename=s),t.value=null}function a(){if(!t.value)return;let e=V[t.value];if(!e)return;let r=(e.filename??``).split(/\//g),i=r.pop();r.push(e.name),n(e,i,r),t.value=null}return{renaming:t,createEntry:r,confirmRename:i,cancelRename:a}}var Va={class:`search`},Ha={class:`item`},Ua=[`title`],Wa=[`onUpdate:modelValue`,`onKeypress`],Ga={class:`right`},Ka={key:1},qa={class:`el-loading-spinner`},Ja={class:`el-loading-text`},Ya=[`src`],Xa=[`src`],Za={key:3},Qa={class:`dialog-footer`},$a=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})(Ye({__name:`index`,setup(e){let{t}=qe(),n=Ke(),r=ot(),i=st(),a=I(``),o=I(null),s=I(null),c=I(null),l=I([]),u=I(null),d=Je(`explorer.tree`);function f(e,t){d(e,t)}let p=D({get(){let e=r.path.slice(6);return e in V?e:``},set(e){e in V||(e=``),i.replace(`/files${e}`)}}),{renaming:m,createEntry:h,confirmRename:g,cancelRename:_}=Ba({data:l,active:p});n.action(`explorer.save`,{shortcut:`ctrl+s`,disabled:()=>V[p.value]?.newValue===V[p.value]?.oldValue||![`files`].includes(i.currentRoute.value?.meta?.activity?.id??``),action:async()=>{let e=V[p.value];if(!e||typeof e.newValue!=`string`)return;let t=e.newValue;await T(`explorer/write`,p.value,t),e.oldValue=t}}),n.action(`explorer.refresh`,{shortcut:`ctrl+r`,disabled:()=>![`files`].includes(i.currentRoute.value?.meta?.activity?.id??``),action:()=>T(`explorer/refresh`)}),n.action(`explorer.tree.create-file`,{disabled:({explorer:e})=>e.tree.type!==`directory`,action:({explorer:e})=>h(e.tree,`file`)}),n.action(`explorer.tree.create-directory`,{disabled:({explorer:e})=>e.tree.type!==`directory`,action:({explorer:e})=>h(e.tree,`directory`)}),n.action(`explorer.tree.upload`,{disabled:({explorer:e})=>e.tree.type!==`directory`,action:({explorer:e})=>H.value=`${e.tree.filename}/`}),n.action(`explorer.tree.download`,{disabled:({explorer:e})=>e.tree.type===`directory`,action:({explorer:e})=>{e.tree.filename&&pe(e.tree.filename)}}),n.action(`explorer.tree.remove`,{disabled:({explorer:e})=>!e.tree.filename,action:({explorer:e})=>fe(e.tree)}),n.action(`explorer.tree.rename`,{disabled:({explorer:e})=>!e.tree.filename,action:({explorer:e})=>{_(),m.value=e.tree.filename??null}});let ee=D({get:()=>!!u.value,set:e=>u.value=null});function*te(e){for(let t of e)t.expanded&&t.filename!==void 0&&(yield t.filename),t.children&&(yield*te(t.children))}let v=D(()=>[...te(l.value)]);function y(e,t){return t?.map(t=>{let n=e?.find(e=>e.type===t.type&&e.name===t.name);if(n){let e=y(n.children,t.children);return e?{...n,...t,children:e}:{...n,...t}}return t})}nt(()=>We.explorer,e=>{l.value=y(l.value,e)||[]},{immediate:!0});let b=null;function ne(){let e=V[p.value];b&&e&&e.type!==`directory`&&e.filename!==void 0&&(b.setContent(e.newValue??``),b.setLanguage(e.filename))}nt(a,e=>{o.value?.filter(e)});let re=Ge();nt(c,()=>{let e=c.value;e?(b=za({parent:e,dark:re.value===`dark`,onChange:e=>{let t=V[p.value];t&&(t.newValue=e)}}),ne()):(b?.destroy(),b=null)}),nt(re,()=>{b?.setTheme(re.value===`dark`)});function ie(e){let t=[];return e.name===p.value&&t.push(`is-active`),t.join(` `)}function ae(e,t){return String(t.name??``).toLowerCase().includes(a.value.toLowerCase())}function oe(e){return!1}function x(e,t,n){return!1}nt(()=>V[p.value],async e=>{if(e&&e.type!==`directory`&&e.filename!==void 0){if(typeof e.oldValue!=`string`){e.loading=T(`explorer/read`,e.filename);let{base64:t,mime:n}=await e.loading;delete e.loading,n?(e.mime=n,e.oldValue=e.newValue=`data:${n};base64,${t}`):e.oldValue=e.newValue=new TextDecoder().decode(ze.fromBase64(t))}ne()}},{immediate:!0});async function se(e){e.type!==`directory`&&(p.value=e.filename??``)}let ce=D(()=>({name:``,filename:``,type:`directory`,children:l.value}));function le(e){e.expanded=!0}function ue(e){e.expanded=!1}function de(e,t,n,r){}function fe(e){_(),u.value=e.filename+(e.type===`directory`?`/`:``)}Xe(()=>Ue(s));async function pe(e){let{base64:t}=await T(`explorer/read`,e),n=new Blob([ze.fromBase64(t)]),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}return(e,n)=>{let r=L(`k-icon`),i=L(`el-input`),h=L(`el-tree`),te=L(`el-scrollbar`),y=L(`k-empty`),b=L(`k-image-viewer`),ne=L(`k-layout`),re=L(`el-button`),fe=L(`el-dialog`);return F(),A(E,null,[N(ne,{menu:`explorer`},{header:B(()=>[M(R(z(t)(`explorer.title`))+R(p.value?` - `+p.value:``),1)]),left:B(()=>[N(te,{ref_key:`root`,ref:s,onContextmenu:n[2]||=at(e=>z(d)(e,ce.value),[`stop`])},{default:B(()=>[j(`div`,Va,[N(i,{modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e},{suffix:B(()=>[N(r,{name:`search`})]),_:1},8,[`modelValue`])]),N(h,{ref_key:`tree`,ref:o,"node-key":`filename`,draggable:!0,data:l.value,props:{label:`name`,class:ie},"filter-node-method":ae,"allow-drag":oe,"allow-drop":x,"default-expanded-keys":v.value,onNodeClick:se,onNodeContextmenu:f,onNodeExpand:le,onNodeCollapse:ue,onNodeDrop:de},{default:B(({node:e})=>[j(`div`,Ha,[j(`div`,{class:`label`,title:e.data.name},[e.data.filename===z(m)?rt((F(),A(`input`,{key:0,"onUpdate:modelValue":t=>e.data.name=t,onKeypress:it(at(t=>z(g)(e.data),[`prevent`]),[`enter`]),onKeydown:n[1]||=it(at(e=>z(_)(),[`prevent`]),[`escape`])},null,40,Wa)),[[z(gt)],[tt,e.data.name]]):(F(),A(E,{key:1},[M(R(e.data.name),1)],64))],8,Ua),j(`div`,Ga,[e.data.oldValue===e.data.newValue?k(`v-if`,!0):(F(),A(E,{key:0},[M(`M`)],64))])])]),_:1},8,[`data`,`props`,`default-expanded-keys`])]),_:1},512)]),default:B(()=>[!z(V)[p.value]||z(V)[p.value]?.type===`directory`?(F(),O(y,{key:0},{default:B(()=>[M(R(z(t)(`explorer.view.empty`)),1)]),_:1})):z(V)[p.value]?.loading?(F(),A(`div`,Ka,[j(`div`,qa,[n[6]||=j(`svg`,{class:`circular`,viewBox:`25 25 50 50`},[j(`circle`,{class:`path`,cx:`50`,cy:`50`,r:`20`,fill:`none`})],-1),j(`p`,Ja,R(z(t)(`explorer.view.loading`)),1)])])):z(V)[p.value]?.mime?(F(),A(E,{key:2},[z(V)[p.value]?.mime?.startsWith(`image/`)?(F(),O(b,{key:0,src:z(V)[p.value]?.newValue},null,8,[`src`])):z(V)[p.value]?.mime?.startsWith(`audio/`)?(F(),A(`audio`,{key:1,src:z(V)[p.value]?.newValue,controls:``},null,8,Ya)):z(V)[p.value]?.mime?.startsWith(`video/`)?(F(),A(`video`,{key:2,src:z(V)[p.value]?.newValue,controls:``},null,8,Xa)):(F(),A(`div`,Za,R(z(t)(`explorer.view.unsupported`,[z(V)[p.value]?.mime])),1))],64)):(F(),A(`div`,{key:3,ref_key:`editor`,ref:c,class:`editor`},null,512))]),_:1}),N(fe,{modelValue:ee.value,"onUpdate:modelValue":n[5]||=e=>ee.value=e,"destroy-on-close":``},{footer:B(()=>[j(`span`,Qa,[N(re,{onClick:n[3]||=e=>u.value=null},{default:B(()=>[M(R(z(t)(`explorer.view.cancel`)),1)]),_:1}),N(re,{type:`primary`,onClick:n[4]||=e=>(z(T)(`explorer/remove`,u.value??``),u.value=null)},{default:B(()=>[M(R(z(t)(`explorer.view.confirm`)),1)]),_:1})])]),default:B(()=>[M(R(z(t)(u.value?.endsWith(`/`)?`explorer.view.removeDirectory`:`explorer.view.removeFile`,[u.value]))+` `,1)]),_:1},8,[`modelValue`])],64)}}}),[[`__scopeId`,`data-v-f542c06e`]]),eo=Ye({__name:`status`,setup(e){let t=ot();return(e,n)=>{let r=L(`k-status`);return z(t).path.startsWith(`/files`)?(F(),O(r,{key:0},{default:B(()=>[M(R(z(La)),1)]),_:1})):k(`v-if`,!0)}}}),to={class:`dialog-footer`},no=Ye({__name:`upload`,setup(e){let{t}=qe(),n=D({get:()=>!!H.value,set:e=>H.value=null});function r(e,t){let n=H.value;for(let r of Array.from(t.items)){if(r.kind!==`file`)continue;e.preventDefault();let t=r.getAsFile();if(!t)continue;let i=new FileReader;i.addEventListener(`load`,()=>{T(`explorer/write`,n+t.name,ze.toBase64(i.result),!0)},!1),i.readAsArrayBuffer(t)}H.value=null}return ct(`drop`,e=>{H.value&&e.dataTransfer&&r(e,e.dataTransfer)}),ct(`paste`,e=>{H.value&&e.clipboardData&&r(e,e.clipboardData)}),ct(`dragover`,e=>{H.value&&e.preventDefault()}),(e,r)=>{let i=L(`el-button`),a=L(`el-dialog`);return F(),O(a,{modelValue:n.value,"onUpdate:modelValue":r[1]||=e=>n.value=e,"destroy-on-close":``},{footer:B(()=>[j(`span`,to,[N(i,{onClick:r[0]||=e=>H.value=null},{default:B(()=>[M(R(z(t)(`explorer.picker.cancel`)),1)]),_:1})])]),default:B(()=>[M(R(z(t)(`explorer.upload.hint`))+` `,1)]),_:1},8,[`modelValue`])}}}),ro={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function io(e,t){return F(),A(`svg`,ro,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M336 480H96c-35.35 0-64-28.65-64-64V112C32 103.2 24.84 96 16 96S0 103.2 0 112V416c0 53.02 42.98 96 96 96h240c8.836 0 16-7.164 16-16S344.8 480 336 480zM429.3 113.3l-94.51-94.51C322.7 6.742 306.5 0 289.5 0H160C124.7 0 96 28.65 96 64l.0098 288c0 35.35 28.65 64 64 64h224C419.4 416 448 387.3 448 352V158.5C448 141.5 441.3 125.3 429.3 113.3zM320 49.25L398.8 128H336C327.2 128 320 120.8 320 112V49.25zM416 352c0 17.64-14.36 32-32 32H160c-17.64 0-32-14.36-32-32V64c0-17.64 14.36-32 32-32h128v80C288 138.5 309.5 160 336 160H416V352z`},null,-1)]])}var ao=P({name:`k-activity-explorer`,render:io}),oo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function so(e,t){return F(),A(`svg`,oo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M447.1 96h-172.1L226.7 50.75C214.7 38.74 198.5 32 181.5 32H63.1c-35.35 0-64 28.66-64 64v320c0 35.34 28.65 64 64 64h384c35.35 0 64-28.66 64-64V160C511.1 124.7 483.3 96 447.1 96zM463.1 416c0 8.824-7.178 16-16 16h-384c-8.822 0-16-7.176-16-16V96c0-8.824 7.178-16 16-16h117.5c4.273 0 8.293 1.664 11.31 4.688L255.1 144h192c8.822 0 16 7.176 16 16V416z`},null,-1)]])}var co=P({name:`k-directory`,render:so}),lo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function uo(e,t){return F(),A(`svg`,lo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M448 96h-172.1L226.7 50.75C214.7 38.74 198.5 32 181.5 32H64C28.66 32 0 60.66 0 96v320c0 35.34 28.66 64 64 64h384c35.34 0 64-28.66 64-64V160C512 124.7 483.3 96 448 96zM464 416c0 8.824-7.18 16-16 16H64c-8.82 0-16-7.176-16-16V96c0-8.824 7.18-16 16-16h117.5c4.273 0 8.289 1.664 11.31 4.688L256 144h192c8.82 0 16 7.176 16 16V416zM336 264h-56V207.1C279.1 194.7 269.3 184 256 184S232 194.7 232 207.1V264H175.1C162.7 264 152 274.7 152 288c0 13.26 10.73 23.1 23.1 23.1h56v56C232 381.3 242.7 392 256 392c13.26 0 23.1-10.74 23.1-23.1V311.1h56C349.3 311.1 360 301.3 360 288S349.3 264 336 264z`},null,-1)]])}var fo=P({name:`k-directory-create`,render:uo}),po={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function mo(e,t){return F(),A(`svg`,po,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M448 304h-53.5l-48 48H448c8.822 0 16 7.178 16 16V448c0 8.822-7.178 16-16 16H64c-8.822 0-16-7.178-16-16v-80C48 359.2 55.18 352 64 352h101.5l-48-48H64c-35.35 0-64 28.65-64 64V448c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64v-80C512 332.7 483.3 304 448 304zM432 408c0-13.26-10.75-24-24-24S384 394.7 384 408c0 13.25 10.75 24 24 24S432 421.3 432 408zM239 368.1C243.7 373.7 249.8 376 256 376s12.28-2.344 16.97-7.031l136-136c9.375-9.375 9.375-24.56 0-33.94s-24.56-9.375-33.94 0L280 294.1V24C280 10.75 269.3 0 256 0S232 10.75 232 24v270.1L136.1 199c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94L239 368.1z`},null,-1)]])}var ho=P({name:`k-download`,render:mo}),go={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 384 512`};function _o(e,t){return F(),A(`svg`,go,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M0 64C0 28.65 28.65 0 64 0H229.5C246.5 0 262.7 6.743 274.7 18.75L365.3 109.3C377.3 121.3 384 137.5 384 154.5V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V64zM336 448V160H256C238.3 160 224 145.7 224 128V48H64C55.16 48 48 55.16 48 64V448C48 456.8 55.16 464 64 464H320C328.8 464 336 456.8 336 448z`},null,-1)]])}var vo=P({name:`k-file`,render:_o}),yo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 384 512`};function bo(e,t){return F(),A(`svg`,yo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M365.3 93.38l-74.63-74.64C278.6 6.742 262.3 0 245.4 0H64C28.66 0 0 28.65 0 64l.0065 384c0 35.34 28.65 64 64 64H320c35.2 0 64-28.8 64-64V138.6C384 121.7 377.3 105.4 365.3 93.38zM336 448c0 8.836-7.164 16-16 16H64.02c-8.836 0-16-7.164-16-16L48 64.13c0-8.836 7.164-16 16-16h160L224 128c0 17.67 14.33 32 32 32H336V448zM216 223.1C216 210.7 205.3 200 192 200S168 210.7 168 223.1V280H112c-13.26 0-24 10.74-24 23.1c0 13.26 10.73 23.1 24 23.1h56v56C168 397.3 178.7 408 192 408c13.26 0 24-10.74 24-23.1V327.1h56c13.26 0 24-10.74 24-23.1s-10.74-23.1-24-23.1h-56V223.1z`},null,-1)]])}var xo=P({name:`k-file-create`,render:bo}),So={class:`k-icon refresh`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function Co(e,t){return F(),A(`svg`,So,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M496 40v160C496 213.3 485.3 224 472 224h-160C298.8 224 288 213.3 288 200s10.75-24 24-24h100.5C382.8 118.3 322.5 80 256 80C158.1 80 80 158.1 80 256s78.97 176 176 176c41.09 0 81.09-14.47 112.6-40.75c10.16-8.5 25.31-7.156 33.81 3.062c8.5 10.19 7.125 25.31-3.062 33.81c-40.16 33.44-91.17 51.77-143.5 51.77C132.4 479.9 32 379.5 32 256s100.4-223.9 223.9-223.9c79.85 0 152.4 43.46 192.1 109.1V40c0-13.25 10.75-24 24-24S496 26.75 496 40z`},null,-1)]])}var wo=P({name:`k-refresh`,render:Co}),To={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function Eo(e,t){return F(),A(`svg`,To,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z`},null,-1)]])}var Do=P({name:`k-save`,render:Eo}),Oo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function ko(e,t){return F(),A(`svg`,Oo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M280 80C266.7 80 256 69.25 256 56C256 42.75 266.7 32 280 32H424C437.3 32 448 42.75 448 56V200C448 213.3 437.3 224 424 224C410.7 224 400 213.3 400 200V113.9L200.1 312.1C191.6 322.3 176.4 322.3 167 312.1C157.7 303.6 157.7 288.4 167 279L366.1 80H280zM0 120C0 89.07 25.07 64 56 64H168C181.3 64 192 74.75 192 88C192 101.3 181.3 112 168 112H56C51.58 112 48 115.6 48 120V424C48 428.4 51.58 432 56 432H360C364.4 432 368 428.4 368 424V312C368 298.7 378.7 288 392 288C405.3 288 416 298.7 416 312V424C416 454.9 390.9 480 360 480H56C25.07 480 0 454.9 0 424V120z`},null,-1)]])}var Ao=P({name:`k-symlink`,render:ko}),jo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function Mo(e,t){return F(),A(`svg`,jo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M448 304h-128V352h128c8.822 0 16 7.178 16 16V448c0 8.822-7.178 16-16 16H64c-8.822 0-16-7.178-16-16v-80C48 359.2 55.18 352 64 352h128V304H64c-35.35 0-64 28.65-64 64V448c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64v-80C512 332.7 483.3 304 448 304zM136.1 176.1L232 81.94V352c0 13.25 10.75 24 24 24s24-10.75 24-24V81.94l95.03 95.03C379.7 181.7 385.8 184 392 184s12.28-2.344 16.97-7.031c9.375-9.375 9.375-24.56 0-33.94l-136-136c-9.375-9.375-24.56-9.375-33.94 0l-136 136c-9.375 9.375-9.375 24.56 0 33.94S127.6 186.3 136.1 176.1zM432 408c0-13.26-10.75-24-24-24S384 394.7 384 408c0 13.25 10.75 24 24 24S432 421.3 432 408z`},null,-1)]])}var No=P({name:`k-upload`,render:Mo});w.register(`activity:explorer`,ao),w.register(`directory`,co),w.register(`directory-create`,fo),w.register(`download`,ho),w.register(`file`,vo),w.register(`file-create`,xo),w.register(`refresh`,wo),w.register(`save`,Do),w.register(`symlink`,Ao),w.register(`upload`,No);var Po=Object.assign({"./locales/de-DE.yml":lt,"./locales/en-US.yml":ut,"./locales/fr-FR.yml":dt,"./locales/ja-JP.yml":ft,"./locales/ru-RU.yml":pt,"./locales/zh-CN.yml":mt,"./locales/zh-TW.yml":ht}),Fo=e=>{Ve(e,Po),e.schema({type:`string`,role:`path`,component:xt,validate:e=>typeof e==`string`}),e.slot({type:`global`,component:no}),e.page({id:`files`,path:`/files/:name*`,name:()=>e.$i18n.t(`explorer.title`),icon:`activity:explorer`,order:600,fields:[`explorer`],component:$a}),e.slot({type:`status-right`,component:eo}),e.menu(`explorer`,[{id:`explorer.save`,icon:`save`,label:()=>e.$i18n.t(`explorer.menu.save`)},{id:`explorer.refresh`,icon:`refresh`,label:()=>e.$i18n.t(`explorer.menu.refresh`)}]),e.menu(`explorer.tree`,[{id:`.create-file`,icon:`file-create`,label:()=>e.$i18n.t(`explorer.menu.createFile`)},{id:`.create-directory`,icon:`directory-create`,label:()=>e.$i18n.t(`explorer.menu.createDirectory`)},{id:`.upload`,icon:`upload`,label:()=>e.$i18n.t(`explorer.menu.upload`)},{id:`.download`,icon:`download`,label:()=>e.$i18n.t(`explorer.menu.download`)},{id:`@separator`},{id:`.rename`,icon:`edit`,label:()=>e.$i18n.t(`explorer.menu.rename`)},{id:`.remove`,icon:`delete`,type:`danger`,label:()=>e.$i18n.t(`explorer.menu.remove`)}])};export{Fo as default};
|
|
2
|
+
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Mi(this):new Ei(this)}getCursor(e,t=0,n){let r=e.doc?e:Ne.create({doc:e});return n??=r.doc.length,this.regexp?Oi(this,r,t,n):wi(this,r,t,n)}},Si=class{constructor(e){this.spec=e}};function Ci(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function wi(e,t,n,r){let i;return e.wholeWord&&(i=Ti(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=Ci(e.test,t,i)),new Qr(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Ti(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(ki(i,n-a))!=C.Word||t(Ai(i,n-a))!=C.Word)&&(t(Ai(i,r-a))!=C.Word||t(ki(i,r-a))!=C.Word))}var Ei=class extends Si{constructor(e){super(e)}nextMatch(e,t,n){let r=wi(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=wi(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=wi(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=wi(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=wi(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function Di(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function Oi(e,t,n,r){let i;return e.wholeWord&&(i=ji(t.charCategorizer(t.selection.main.head))),e.test&&(i=Di(e.test,t,i)),new ti(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function ki(e,t){return e.slice(s(e,t,!1),t)}function Ai(e,t){return e.slice(t,s(e,t))}function ji(e){return(t,n,r)=>!r[0].length||(e(ki(r.input,r.index))!=C.Word||e(Ai(r.input,r.index))!=C.Word)&&(e(Ai(r.input,r.index+r[0].length))!=C.Word||e(ki(r.input,r.index+r[0].length))!=C.Word)}var Mi=class extends Si{nextMatch(e,t,n){let r=Oi(this.spec,e,n,e.doc.length).next();return r.done&&(r=Oi(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=Oi(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=Oi(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Oi(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},Ni=h.define(),Pi=h.define(),X=ve.define({create(e){return new Fi(qi(e).create(),null)},update(e,t){for(let n of t.effects)n.is(Ni)?e=new Fi(n.value.create(),e.panel):n.is(Pi)&&(e=new Fi(e.query,n.value?Ki:null));return e},provide:e=>de.from(e,e=>e.panel)}),Fi=class{constructor(e,t){this.query=e,this.panel=t}},Ii=b.mark({class:`cm-searchMatch`}),Li=b.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Ri=we.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(X))}update(e){let t=e.state.field(X);(t!=e.startState.field(X)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return b.none;let{view:n}=this,r=new i;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Li:Ii)})}return r.finish()}},{decorations:e=>e.decorations});function zi(e){return t=>{let n=t.state.field(X,!1);return n&&n.query.spec.valid?e(t,n):Xi(t)}}var Bi=zi((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=x.single(r.from,r.to),a=e.state.facet(bi);return e.dispatch({selection:i,effects:[na(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),Yi(e),!0}),Vi=zi((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=x.single(i.from,i.to),o=e.state.facet(bi);return e.dispatch({selection:a,effects:[na(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),Yi(e),!0}),Hi=zi((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:x.create(n.map(e=>x.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),Ui=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new Qr(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(x.range(t.value.from,t.value.to))}return t(e.update({selection:x.create(a,o),userEvent:`select.search.matches`})),!0},Wi=zi((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,u,d=[];o.precise?o.from==r&&o.to==i&&(u=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(l.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(s);return o&&(c=x.single(o.from,o.to).map(f),d.push(na(e,o)),d.push(n.facet(bi).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:`input.replace`}),!0}),Gi=zi((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:l.announce.of(r),userEvent:`input.replace.all`}),!0});function Ki(e){return e.state.facet(bi).createPanel(e)}function qi(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(bi);return new xi({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function Ji(e){let t=le(e,Ki);return t&&t.dom.querySelector(`[main-field]`)}function Yi(e){let t=Ji(e);t&&t==e.root.activeElement&&t.select()}var Xi=e=>{let t=e.state.field(X,!1);if(t&&t.panel){let n=Ji(e);if(n&&n!=e.root.activeElement){let r=qi(e.state,t.query.spec);r.valid&&e.dispatch({effects:Ni.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Pi.of(!0),t?Ni.of(qi(e.state,t.query.spec)):h.appendConfig.of(ia)]});return!0},Zi=e=>{let t=e.state.field(X,!1);if(!t||!t.panel)return!1;let n=le(e,Ki);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Pi.of(!1)}),!0},Qi=[{key:`Mod-f`,run:Xi,scope:`editor search-panel`},{key:`F3`,run:Bi,shift:Vi,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:Bi,shift:Vi,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:Zi,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:Ui},{key:`Mod-Alt-g`,run:si},{key:`Mod-d`,run:yi,preventDefault:!0}],$i=class{constructor(e){this.view=e;let t=this.query=e.state.field(X).query.spec;this.commit=this.commit.bind(this),this.searchField=S(`input`,{value:t.search,placeholder:Z(e,`Find`),"aria-label":Z(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=S(`input`,{value:t.replace,placeholder:Z(e,`Replace`),"aria-label":Z(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=S(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=S(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=S(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return S(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=S(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>Bi(e),[Z(e,`next`)]),n(`prev`,()=>Vi(e),[Z(e,`previous`)]),n(`select`,()=>Hi(e),[Z(e,`all`)]),S(`label`,null,[this.caseField,Z(e,`match case`)]),S(`label`,null,[this.reField,Z(e,`regexp`)]),S(`label`,null,[this.wordField,Z(e,`by word`)]),...e.state.readOnly?[]:[S(`br`),this.replaceField,n(`replace`,()=>Wi(e),[Z(e,`replace`)]),n(`replaceAll`,()=>Gi(e),[Z(e,`replace all`)])],S(`button`,{name:`close`,onclick:()=>Zi(e),"aria-label":Z(e,`close`),type:`button`},[`×`])])}commit(){let e=new xi({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Ni.of(e)}))}keydown(e){Oe(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Vi:Bi)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Wi(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Ni)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(bi).top}};function Z(e,t){return e.state.phrase(t)}var ea=30,ta=/[\s\.,:;?!]/;function na(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-ea),o=Math.min(i,n+ea),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<ea;e++)if(!ta.test(s[e+1])&&ta.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-ea;e--)if(!ta.test(s[e-1])&&ta.test(s[e])){s=s.slice(0,e);break}}return l.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var ra=l.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),ia=[X,je.low(Ri),ra],aa=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},oa=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let a=r.facet(va).markerFilter;a&&(t=a(t,r));let o=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),s=new i,c=[],l=0,u=r.doc.iter(),d=0,f=r.doc.length;for(let e=0;;){let t=e==o.length?null:o[e];if(!t&&!c.length)break;let n,r;if(c.length)n=l,r=c.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>f)break;r=t.to,c.push(t),e++}for(;e<o.length;){let t=o[e];if(t.from==n&&(t.to>t.from||t.to==n))c.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,f);let i=!1;if(c.some(e=>e.from==n&&(e.to==r||r==f))&&(i=n==r,!i&&r-n<10)){let e=n-(d+u.value.length);e>0&&(u.next(e),d=n);for(let e=n;;){if(e>=r){i=!0;break}if(!u.lineBreak&&d+u.value.length>e)break;e=d+u.value.length,d+=u.value.length,u.next()}}let a=ka(c);if(i)s.add(n,n,b.widget({widget:new Sa(a),diagnostics:c.slice()}));else{let e=c.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);s.add(n,r,b.mark({class:`cm-lintRange cm-lintRange-`+a+e,diagnostics:c.slice(),inclusiveEnd:c.some(e=>e.to>r)}))}if(l=r,l==f)break;for(let e=0;e<c.length;e++)c[e].to<=l&&c.splice(e--,1)}let p=s.finish();return new e(p,n,Q(p))}};function Q(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new aa(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new aa(r.from,n,r.diagnostic)}}),r}function sa(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(va).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(la))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function ca(e,t){return e.field($,!1)?t:t.concat(h.appendConfig.of(ja))}var la=h.define(),ua=h.define(),da=h.define(),$=ve.define({create(){return new oa(b.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=Q(n,e.selected.diagnostic,i)||Q(n,null,i)}!n.size&&i&&t.state.facet(va).autoPanel&&(i=null),e=new oa(n,i,r)}for(let n of t.effects)if(n.is(la)){let r=t.state.facet(va).autoPanel?n.value.length?wa.open:null:e.panel;e=oa.init(n.value,r,t.state)}else n.is(ua)?e=new oa(e.diagnostics,n.value?wa.open:null,e.selected):n.is(da)&&(e=new oa(e.diagnostics,e.panel,n.value));return e},provide:e=>[de.from(e,e=>e.panel),l.decorations.from(e,e=>e.diagnostics)]}),fa=b.mark({class:`cm-lintRange cm-lintRange-active`});function pa(e,t,n){let{diagnostics:r}=e.state.field($),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(va).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:ma(e,i)}}}:null}function ma(e,t){return S(`ul`,{class:`cm-tooltip-lint`},t.map(t=>xa(e,t,!1)))}var ha=e=>{let t=e.state.field($,!1);(!t||!t.panel)&&e.dispatch({effects:ca(e.state,[ua.of(!0)])});let n=le(e,wa.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},ga=e=>{let t=e.state.field($,!1);return!t||!t.panel?!1:(e.dispatch({effects:ua.of(!1)}),!0)},_a=[{key:`Mod-Shift-m`,run:ha,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field($,!1);if(!t)return!1;let n=e.state.selection.main,r=Q(t.diagnostics,null,n.to+1);return!r&&(r=Q(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),re(e,r.from,1,{tooltip:Aa,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],va=v.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),..._(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:ya,tooltipFilter:ya,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function ya(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function ba(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function xa(e,t,n){let r=n?ba(t.actions):[];return S(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},S(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=Q(e.state.field($).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),S(`u`,s.slice(c,c+1)),s.slice(c+1)],u=n.markClass?` `+n.markClass:``;return S(`button`,{type:`button`,class:`cm-diagnosticAction`+u,onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&S(`div`,{class:`cm-diagnosticSource`},t.source))}var Sa=class extends c{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return S(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},Ca=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=xa(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},wa=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)ga(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=ba(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=Q(this.view.state.field($).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=S(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=S(`div`,{class:`cm-panel-lint`},this.list,S(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>ga(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field($).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field($),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new Ca(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Ca(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Q(this.view.state.field($).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:da.of(t)})}static open(t){return new e(t)}};function Ta(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Ea(e){return Ta(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var Da=l.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:Ea(`#f11`)},".cm-lintRange-warning":{backgroundImage:Ea(`orange`)},".cm-lintRange-info":{backgroundImage:Ea(`#999`)},".cm-lintRange-hint":{backgroundImage:Ea(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function Oa(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function ka(e){let t=`hint`,n=1;for(let r of e){let e=Oa(r.severity);e>n&&(n=e,t=r.severity)}return t}var Aa=oe(pa,{hideOn:sa}),ja=[$,l.decorations.compute([$],e=>{let{selected:t,panel:n}=e.field($);return!t||!n||t.from==t.to?b.none:b.set([fa.range(t.from,t.to)])}),Aa,Da],Ma=[Ee(),Te(),he(),Rt(),fe(),ie(),ee(),Ne.allowMultipleSelections.of(!0),Ae(),t(ue,{fallback:!0}),ye(),Re(),Ie(),be(),ne(),Se(),ui(),Ce.of([...Fe,...zr,...Qi,...tn,...ke,...Le,..._a])],Na=e=>async()=>se.define(await e()),Pa=[{label:`JavaScript`,extensions:[`js`,`mjs`,`cjs`],load:async()=>(await import(`./dist-DvhGkdfA.js`).then(e=>e.t)).javascript()},{label:`JSX`,extensions:[`jsx`],load:async()=>(await import(`./dist-DvhGkdfA.js`).then(e=>e.t)).javascript({jsx:!0})},{label:`TypeScript`,extensions:[`ts`,`mts`,`cts`],load:async()=>(await import(`./dist-DvhGkdfA.js`).then(e=>e.t)).javascript({typescript:!0})},{label:`TSX`,extensions:[`tsx`],load:async()=>(await import(`./dist-DvhGkdfA.js`).then(e=>e.t)).javascript({typescript:!0,jsx:!0})},{label:`JSON`,extensions:[`json`,`jsonc`],load:async()=>(await import(`./dist-khbkxa42.js`)).json()},{label:`HTML`,extensions:[`html`,`htm`],load:async()=>(await import(`./dist-DQBzzRg5.js`)).html()},{label:`XML`,extensions:[`xml`,`xsl`,`xsd`,`svg`],load:async()=>(await import(`./dist-CVvw8g9I.js`)).xml()},{label:`CSS`,extensions:[`css`],load:async()=>(await import(`./dist-BLlmyRVk.js`).then(e=>e.i)).css()},{label:`SCSS`,extensions:[`scss`],load:async()=>(await import(`./dist-BRHu8uof.js`)).sass({indented:!1})},{label:`Sass`,extensions:[`sass`],load:async()=>(await import(`./dist-BRHu8uof.js`)).sass({indented:!0})},{label:`Less`,extensions:[`less`],load:async()=>(await import(`./dist-DmPaCAWx.js`)).less()},{label:`Markdown`,extensions:[`md`,`markdown`],load:async()=>(await import(`./dist-C8Y3JG3t.js`)).markdown()},{label:`YAML`,extensions:[`yml`,`yaml`],load:async()=>(await import(`./dist-Bblq3-7E.js`)).yaml()},{label:`SQL`,extensions:[`sql`],load:async()=>(await import(`./dist-CXrT-QaX.js`)).sql()},{label:`Vue`,extensions:[`vue`],load:async()=>(await import(`./dist-DPw8Mxu7.js`)).vue()},{label:`Shell`,extensions:[`sh`,`bash`,`zsh`],load:Na(async()=>(await import(`./shell-BPOk74rq.js`)).shell)},{label:`PowerShell`,extensions:[`ps1`,`psm1`,`psd1`],load:Na(async()=>(await import(`./powershell-Bs8C1TzT.js`)).powerShell)},{label:`TOML`,extensions:[`toml`],load:Na(async()=>(await import(`./toml-CENNTAu3.js`)).toml)},{label:`Dockerfile`,extensions:[`dockerfile`],filenames:[`dockerfile`],load:Na(async()=>(await import(`./dockerfile-DwPgr3ck.js`)).dockerFile)},{label:`INI`,extensions:[`ini`,`properties`,`cfg`,`conf`,`env`],load:Na(async()=>(await import(`./properties-D8pUqSuZ.js`)).properties)},{label:`Diff`,extensions:[`diff`,`patch`],load:Na(async()=>(await import(`./diff-DtwSiaDg.js`)).diff)}],Fa=`Plain Text`;function Ia(e){let t=e.slice(Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`))+1).toLowerCase(),n=t.lastIndexOf(`.`),r=n===-1?``:t.slice(n+1);for(let e of Pa)if(r&&e.extensions?.includes(r)||e.filenames?.includes(t))return e}var La=et(Fa),Ra=l.theme({"&":{height:`100%`,fontSize:`14px`,backgroundColor:`var(--cm-bg)`,color:`var(--cm-fg)`},"&.cm-focused":{outline:`none`},".cm-scroller":{fontFamily:`var(--font-family-code)`,lineHeight:`1.6`},".cm-content":{caretColor:`var(--cm-caret)`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--cm-caret)`},".cm-selectionBackground, &.cm-focused .cm-selectionBackground":{backgroundColor:`var(--cm-selection-bg)`},".cm-selectionMatch":{backgroundColor:`var(--cm-match-bg)`},".cm-activeLine":{backgroundColor:`var(--cm-active-line-bg)`},".cm-activeLineGutter":{backgroundColor:`var(--cm-active-line-bg)`},".cm-gutters":{backgroundColor:`var(--cm-gutter-bg)`,color:`var(--cm-gutter-fg)`,border:`none`},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`var(--cm-gutter-fg)`},".cm-tooltip":{backgroundColor:`var(--cm-tooltip-bg)`,border:`1px solid var(--k-color-border)`,color:`var(--cm-fg)`},".cm-tooltip-autocomplete ul li[aria-selected]":{backgroundColor:`var(--k-color-primary-fade)`,color:`var(--cm-fg)`},".cm-panels":{backgroundColor:`var(--cm-gutter-bg)`,color:`var(--cm-fg)`},".cm-searchMatch":{backgroundColor:`var(--cm-match-bg)`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`var(--cm-selection-bg)`}});function za(e){let n=e.dark,i=[],a=``,o=!1,s=new Pe,c=new Pe,u=()=>n?t(Xr):[],d=()=>[Ma,Ce.of([Br]),r.of(` `),Ne.tabSize.of(2),Ra,s.of(u()),c.of(i),l.updateListener.of(t=>{t.docChanged&&e.onChange(t.state.doc.toString())})],f=new l({parent:e.parent,state:Ne.create({extensions:d()})});return{setContent(e){f.setState(Ne.create({doc:e,extensions:d()}))},async setLanguage(e){let t=Ia(e);if(La.value=t?.label??`Plain Text`,a=e,!t){i=[],o||f.dispatch({effects:c.reconfigure([])});return}let n=await t.load();o||a!==e||(i=n,f.dispatch({effects:c.reconfigure(n)}))},setTheme(e){n=e,f.dispatch({effects:s.reconfigure(u())})},destroy(){o=!0,a=``,f.destroy()}}}function Ba(e){let t=I(null);function n(t,n,r){if(n)t.name=n;else{let n=t.filename??``;delete V[n];let i=V[r.slice(0,-1).join(`/`)]?.children||e.data.value;i.splice(i.indexOf(t),1)}}function r(e,n){a();let r=`${e.filename}/`;t.value=r;let i={type:n,name:``,filename:r,oldValue:``,newValue:``};V[r]=i,e.expanded=!0,e.children?.push(i)}function i(r){let i=r.filename??``,a=i.split(/\//g),o=a.pop();a.push(r.name);let s=a.join(`/`);s in V||!r.name?n(r,o,a):i!==s&&(V[s]=r,delete V[i],o?(T(`explorer/rename`,i,s),e.active.value=s):r.type===`file`?(T(`explorer/write`,s,``),e.active.value=s):T(`explorer/mkdir`,s),r.filename=s),t.value=null}function a(){if(!t.value)return;let e=V[t.value];if(!e)return;let r=(e.filename??``).split(/\//g),i=r.pop();r.push(e.name),n(e,i,r),t.value=null}return{renaming:t,createEntry:r,confirmRename:i,cancelRename:a}}var Va={class:`search`},Ha={class:`item`},Ua=[`title`],Wa=[`onUpdate:modelValue`,`onKeypress`],Ga={class:`right`},Ka={key:1},qa={class:`el-loading-spinner`},Ja={class:`el-loading-text`},Ya=[`src`],Xa=[`src`],Za={key:3},Qa={class:`dialog-footer`},$a=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})(Ye({__name:`index`,setup(e){let{t}=qe(),n=Ke(),r=ot(),i=st(),a=I(``),o=I(null),s=I(null),c=I(null),l=I([]),u=I(null),d=Je(`explorer.tree`);function f(e,t){d(e,t)}let p=D({get(){let e=r.path.slice(6);return e in V?e:``},set(e){e in V||(e=``),i.replace(`/files${e}`)}}),{renaming:m,createEntry:h,confirmRename:g,cancelRename:_}=Ba({data:l,active:p});n.action(`explorer.save`,{shortcut:`ctrl+s`,disabled:()=>V[p.value]?.newValue===V[p.value]?.oldValue||![`files`].includes(i.currentRoute.value?.meta?.activity?.id??``),action:async()=>{let e=V[p.value];if(!e||typeof e.newValue!=`string`)return;let t=e.newValue;await T(`explorer/write`,p.value,t),e.oldValue=t}}),n.action(`explorer.refresh`,{shortcut:`ctrl+r`,disabled:()=>![`files`].includes(i.currentRoute.value?.meta?.activity?.id??``),action:()=>T(`explorer/refresh`)}),n.action(`explorer.tree.create-file`,{disabled:({explorer:e})=>e.tree.type!==`directory`,action:({explorer:e})=>h(e.tree,`file`)}),n.action(`explorer.tree.create-directory`,{disabled:({explorer:e})=>e.tree.type!==`directory`,action:({explorer:e})=>h(e.tree,`directory`)}),n.action(`explorer.tree.upload`,{disabled:({explorer:e})=>e.tree.type!==`directory`,action:({explorer:e})=>H.value=`${e.tree.filename}/`}),n.action(`explorer.tree.download`,{disabled:({explorer:e})=>e.tree.type===`directory`,action:({explorer:e})=>{e.tree.filename&&pe(e.tree.filename)}}),n.action(`explorer.tree.remove`,{disabled:({explorer:e})=>!e.tree.filename,action:({explorer:e})=>fe(e.tree)}),n.action(`explorer.tree.rename`,{disabled:({explorer:e})=>!e.tree.filename,action:({explorer:e})=>{_(),m.value=e.tree.filename??null}});let ee=D({get:()=>!!u.value,set:e=>u.value=null});function*te(e){for(let t of e)t.expanded&&t.filename!==void 0&&(yield t.filename),t.children&&(yield*te(t.children))}let v=D(()=>[...te(l.value)]);function y(e,t){return t?.map(t=>{let n=e?.find(e=>e.type===t.type&&e.name===t.name);if(n){let e=y(n.children,t.children);return e?{...n,...t,children:e}:{...n,...t}}return t})}nt(()=>We.explorer,e=>{l.value=y(l.value,e)||[]},{immediate:!0});let b=null;function ne(){let e=V[p.value];b&&e&&e.type!==`directory`&&e.filename!==void 0&&(b.setContent(e.newValue??``),b.setLanguage(e.filename))}nt(a,e=>{o.value?.filter(e)});let re=Ge();nt(c,()=>{let e=c.value;e?(b=za({parent:e,dark:re.value===`dark`,onChange:e=>{let t=V[p.value];t&&(t.newValue=e)}}),ne()):(b?.destroy(),b=null)}),nt(re,()=>{b?.setTheme(re.value===`dark`)});function ie(e){let t=[];return e.name===p.value&&t.push(`is-active`),t.join(` `)}function ae(e,t){return String(t.name??``).toLowerCase().includes(a.value.toLowerCase())}function oe(e){return!1}function x(e,t,n){return!1}nt(()=>V[p.value],async e=>{if(e&&e.type!==`directory`&&e.filename!==void 0){if(typeof e.oldValue!=`string`){e.loading=T(`explorer/read`,e.filename);let{base64:t,mime:n}=await e.loading;delete e.loading,n?(e.mime=n,e.oldValue=e.newValue=`data:${n};base64,${t}`):e.oldValue=e.newValue=new TextDecoder().decode(ze.fromBase64(t))}ne()}},{immediate:!0});async function se(e){e.type!==`directory`&&(p.value=e.filename??``)}let ce=D(()=>({name:``,filename:``,type:`directory`,children:l.value}));function le(e){e.expanded=!0}function ue(e){e.expanded=!1}function de(e,t,n,r){}function fe(e){_(),u.value=e.filename+(e.type===`directory`?`/`:``)}Xe(()=>Ue(s));async function pe(e){let{base64:t}=await T(`explorer/read`,e),n=new Blob([ze.fromBase64(t)]),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}return(e,n)=>{let r=L(`k-icon`),i=L(`el-input`),h=L(`el-tree`),te=L(`el-scrollbar`),y=L(`k-empty`),b=L(`k-image-viewer`),ne=L(`k-layout`),re=L(`el-button`),fe=L(`el-dialog`);return F(),A(E,null,[N(ne,{menu:`explorer`},{header:B(()=>[M(R(z(t)(`explorer.title`))+R(p.value?` - `+p.value:``),1)]),left:B(()=>[N(te,{ref_key:`root`,ref:s,onContextmenu:n[2]||=at(e=>z(d)(e,ce.value),[`stop`])},{default:B(()=>[j(`div`,Va,[N(i,{modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e},{suffix:B(()=>[N(r,{name:`search`})]),_:1},8,[`modelValue`])]),N(h,{ref_key:`tree`,ref:o,"node-key":`filename`,draggable:!0,data:l.value,props:{label:`name`,class:ie},"filter-node-method":ae,"allow-drag":oe,"allow-drop":x,"default-expanded-keys":v.value,onNodeClick:se,onNodeContextmenu:f,onNodeExpand:le,onNodeCollapse:ue,onNodeDrop:de},{default:B(({node:e})=>[j(`div`,Ha,[j(`div`,{class:`label`,title:e.data.name},[e.data.filename===z(m)?rt((F(),A(`input`,{key:0,"onUpdate:modelValue":t=>e.data.name=t,onKeypress:it(at(t=>z(g)(e.data),[`prevent`]),[`enter`]),onKeydown:n[1]||=it(at(e=>z(_)(),[`prevent`]),[`escape`])},null,40,Wa)),[[z(gt)],[tt,e.data.name]]):(F(),A(E,{key:1},[M(R(e.data.name),1)],64))],8,Ua),j(`div`,Ga,[e.data.oldValue===e.data.newValue?k(`v-if`,!0):(F(),A(E,{key:0},[M(`M`)],64))])])]),_:1},8,[`data`,`props`,`default-expanded-keys`])]),_:1},512)]),default:B(()=>[!z(V)[p.value]||z(V)[p.value]?.type===`directory`?(F(),O(y,{key:0},{default:B(()=>[M(R(z(t)(`explorer.view.empty`)),1)]),_:1})):z(V)[p.value]?.loading?(F(),A(`div`,Ka,[j(`div`,qa,[n[6]||=j(`svg`,{class:`circular`,viewBox:`25 25 50 50`},[j(`circle`,{class:`path`,cx:`50`,cy:`50`,r:`20`,fill:`none`})],-1),j(`p`,Ja,R(z(t)(`explorer.view.loading`)),1)])])):z(V)[p.value]?.mime?(F(),A(E,{key:2},[z(V)[p.value]?.mime?.startsWith(`image/`)?(F(),O(b,{key:0,src:z(V)[p.value]?.newValue??``},null,8,[`src`])):z(V)[p.value]?.mime?.startsWith(`audio/`)?(F(),A(`audio`,{key:1,src:z(V)[p.value]?.newValue??``,controls:``},null,8,Ya)):z(V)[p.value]?.mime?.startsWith(`video/`)?(F(),A(`video`,{key:2,src:z(V)[p.value]?.newValue??``,controls:``},null,8,Xa)):(F(),A(`div`,Za,R(z(t)(`explorer.view.unsupported`,[z(V)[p.value]?.mime])),1))],64)):(F(),A(`div`,{key:3,ref_key:`editor`,ref:c,class:`editor`},null,512))]),_:1}),N(fe,{modelValue:ee.value,"onUpdate:modelValue":n[5]||=e=>ee.value=e,"destroy-on-close":``},{footer:B(()=>[j(`span`,Qa,[N(re,{onClick:n[3]||=e=>u.value=null},{default:B(()=>[M(R(z(t)(`explorer.view.cancel`)),1)]),_:1}),N(re,{type:`primary`,onClick:n[4]||=e=>(z(T)(`explorer/remove`,u.value??``),u.value=null)},{default:B(()=>[M(R(z(t)(`explorer.view.confirm`)),1)]),_:1})])]),default:B(()=>[M(R(z(t)(u.value?.endsWith(`/`)?`explorer.view.removeDirectory`:`explorer.view.removeFile`,[u.value]))+` `,1)]),_:1},8,[`modelValue`])],64)}}}),[[`__scopeId`,`data-v-c644a12d`]]),eo=Ye({__name:`status`,setup(e){let t=ot();return(e,n)=>{let r=L(`k-status`);return z(t).path.startsWith(`/files`)?(F(),O(r,{key:0},{default:B(()=>[M(R(z(La)),1)]),_:1})):k(`v-if`,!0)}}}),to={class:`dialog-footer`},no=Ye({__name:`upload`,setup(e){let{t}=qe(),n=D({get:()=>!!H.value,set:e=>H.value=null});function r(e,t){let n=H.value;for(let r of Array.from(t.items)){if(r.kind!==`file`)continue;e.preventDefault();let t=r.getAsFile();if(!t)continue;let i=new FileReader;i.addEventListener(`load`,()=>{T(`explorer/write`,n+t.name,ze.toBase64(i.result),!0)},!1),i.readAsArrayBuffer(t)}H.value=null}return ct(`drop`,e=>{H.value&&e.dataTransfer&&r(e,e.dataTransfer)}),ct(`paste`,e=>{H.value&&e.clipboardData&&r(e,e.clipboardData)}),ct(`dragover`,e=>{H.value&&e.preventDefault()}),(e,r)=>{let i=L(`el-button`),a=L(`el-dialog`);return F(),O(a,{modelValue:n.value,"onUpdate:modelValue":r[1]||=e=>n.value=e,"destroy-on-close":``},{footer:B(()=>[j(`span`,to,[N(i,{onClick:r[0]||=e=>H.value=null},{default:B(()=>[M(R(z(t)(`explorer.picker.cancel`)),1)]),_:1})])]),default:B(()=>[M(R(z(t)(`explorer.upload.hint`))+` `,1)]),_:1},8,[`modelValue`])}}}),ro={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function io(e,t){return F(),A(`svg`,ro,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M336 480H96c-35.35 0-64-28.65-64-64V112C32 103.2 24.84 96 16 96S0 103.2 0 112V416c0 53.02 42.98 96 96 96h240c8.836 0 16-7.164 16-16S344.8 480 336 480zM429.3 113.3l-94.51-94.51C322.7 6.742 306.5 0 289.5 0H160C124.7 0 96 28.65 96 64l.0098 288c0 35.35 28.65 64 64 64h224C419.4 416 448 387.3 448 352V158.5C448 141.5 441.3 125.3 429.3 113.3zM320 49.25L398.8 128H336C327.2 128 320 120.8 320 112V49.25zM416 352c0 17.64-14.36 32-32 32H160c-17.64 0-32-14.36-32-32V64c0-17.64 14.36-32 32-32h128v80C288 138.5 309.5 160 336 160H416V352z`},null,-1)]])}var ao=P({name:`k-activity-explorer`,render:io}),oo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function so(e,t){return F(),A(`svg`,oo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M447.1 96h-172.1L226.7 50.75C214.7 38.74 198.5 32 181.5 32H63.1c-35.35 0-64 28.66-64 64v320c0 35.34 28.65 64 64 64h384c35.35 0 64-28.66 64-64V160C511.1 124.7 483.3 96 447.1 96zM463.1 416c0 8.824-7.178 16-16 16h-384c-8.822 0-16-7.176-16-16V96c0-8.824 7.178-16 16-16h117.5c4.273 0 8.293 1.664 11.31 4.688L255.1 144h192c8.822 0 16 7.176 16 16V416z`},null,-1)]])}var co=P({name:`k-directory`,render:so}),lo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function uo(e,t){return F(),A(`svg`,lo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M448 96h-172.1L226.7 50.75C214.7 38.74 198.5 32 181.5 32H64C28.66 32 0 60.66 0 96v320c0 35.34 28.66 64 64 64h384c35.34 0 64-28.66 64-64V160C512 124.7 483.3 96 448 96zM464 416c0 8.824-7.18 16-16 16H64c-8.82 0-16-7.176-16-16V96c0-8.824 7.18-16 16-16h117.5c4.273 0 8.289 1.664 11.31 4.688L256 144h192c8.82 0 16 7.176 16 16V416zM336 264h-56V207.1C279.1 194.7 269.3 184 256 184S232 194.7 232 207.1V264H175.1C162.7 264 152 274.7 152 288c0 13.26 10.73 23.1 23.1 23.1h56v56C232 381.3 242.7 392 256 392c13.26 0 23.1-10.74 23.1-23.1V311.1h56C349.3 311.1 360 301.3 360 288S349.3 264 336 264z`},null,-1)]])}var fo=P({name:`k-directory-create`,render:uo}),po={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function mo(e,t){return F(),A(`svg`,po,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M448 304h-53.5l-48 48H448c8.822 0 16 7.178 16 16V448c0 8.822-7.178 16-16 16H64c-8.822 0-16-7.178-16-16v-80C48 359.2 55.18 352 64 352h101.5l-48-48H64c-35.35 0-64 28.65-64 64V448c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64v-80C512 332.7 483.3 304 448 304zM432 408c0-13.26-10.75-24-24-24S384 394.7 384 408c0 13.25 10.75 24 24 24S432 421.3 432 408zM239 368.1C243.7 373.7 249.8 376 256 376s12.28-2.344 16.97-7.031l136-136c9.375-9.375 9.375-24.56 0-33.94s-24.56-9.375-33.94 0L280 294.1V24C280 10.75 269.3 0 256 0S232 10.75 232 24v270.1L136.1 199c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94L239 368.1z`},null,-1)]])}var ho=P({name:`k-download`,render:mo}),go={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 384 512`};function _o(e,t){return F(),A(`svg`,go,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M0 64C0 28.65 28.65 0 64 0H229.5C246.5 0 262.7 6.743 274.7 18.75L365.3 109.3C377.3 121.3 384 137.5 384 154.5V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V64zM336 448V160H256C238.3 160 224 145.7 224 128V48H64C55.16 48 48 55.16 48 64V448C48 456.8 55.16 464 64 464H320C328.8 464 336 456.8 336 448z`},null,-1)]])}var vo=P({name:`k-file`,render:_o}),yo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 384 512`};function bo(e,t){return F(),A(`svg`,yo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M365.3 93.38l-74.63-74.64C278.6 6.742 262.3 0 245.4 0H64C28.66 0 0 28.65 0 64l.0065 384c0 35.34 28.65 64 64 64H320c35.2 0 64-28.8 64-64V138.6C384 121.7 377.3 105.4 365.3 93.38zM336 448c0 8.836-7.164 16-16 16H64.02c-8.836 0-16-7.164-16-16L48 64.13c0-8.836 7.164-16 16-16h160L224 128c0 17.67 14.33 32 32 32H336V448zM216 223.1C216 210.7 205.3 200 192 200S168 210.7 168 223.1V280H112c-13.26 0-24 10.74-24 23.1c0 13.26 10.73 23.1 24 23.1h56v56C168 397.3 178.7 408 192 408c13.26 0 24-10.74 24-23.1V327.1h56c13.26 0 24-10.74 24-23.1s-10.74-23.1-24-23.1h-56V223.1z`},null,-1)]])}var xo=P({name:`k-file-create`,render:bo}),So={class:`k-icon refresh`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function Co(e,t){return F(),A(`svg`,So,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M496 40v160C496 213.3 485.3 224 472 224h-160C298.8 224 288 213.3 288 200s10.75-24 24-24h100.5C382.8 118.3 322.5 80 256 80C158.1 80 80 158.1 80 256s78.97 176 176 176c41.09 0 81.09-14.47 112.6-40.75c10.16-8.5 25.31-7.156 33.81 3.062c8.5 10.19 7.125 25.31-3.062 33.81c-40.16 33.44-91.17 51.77-143.5 51.77C132.4 479.9 32 379.5 32 256s100.4-223.9 223.9-223.9c79.85 0 152.4 43.46 192.1 109.1V40c0-13.25 10.75-24 24-24S496 26.75 496 40z`},null,-1)]])}var wo=P({name:`k-refresh`,render:Co}),To={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function Eo(e,t){return F(),A(`svg`,To,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z`},null,-1)]])}var Do=P({name:`k-save`,render:Eo}),Oo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function ko(e,t){return F(),A(`svg`,Oo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M280 80C266.7 80 256 69.25 256 56C256 42.75 266.7 32 280 32H424C437.3 32 448 42.75 448 56V200C448 213.3 437.3 224 424 224C410.7 224 400 213.3 400 200V113.9L200.1 312.1C191.6 322.3 176.4 322.3 167 312.1C157.7 303.6 157.7 288.4 167 279L366.1 80H280zM0 120C0 89.07 25.07 64 56 64H168C181.3 64 192 74.75 192 88C192 101.3 181.3 112 168 112H56C51.58 112 48 115.6 48 120V424C48 428.4 51.58 432 56 432H360C364.4 432 368 428.4 368 424V312C368 298.7 378.7 288 392 288C405.3 288 416 298.7 416 312V424C416 454.9 390.9 480 360 480H56C25.07 480 0 454.9 0 424V120z`},null,-1)]])}var Ao=P({name:`k-symlink`,render:ko}),jo={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function Mo(e,t){return F(),A(`svg`,jo,[...t[0]||=[j(`path`,{fill:`currentColor`,d:`M448 304h-128V352h128c8.822 0 16 7.178 16 16V448c0 8.822-7.178 16-16 16H64c-8.822 0-16-7.178-16-16v-80C48 359.2 55.18 352 64 352h128V304H64c-35.35 0-64 28.65-64 64V448c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64v-80C512 332.7 483.3 304 448 304zM136.1 176.1L232 81.94V352c0 13.25 10.75 24 24 24s24-10.75 24-24V81.94l95.03 95.03C379.7 181.7 385.8 184 392 184s12.28-2.344 16.97-7.031c9.375-9.375 9.375-24.56 0-33.94l-136-136c-9.375-9.375-24.56-9.375-33.94 0l-136 136c-9.375 9.375-9.375 24.56 0 33.94S127.6 186.3 136.1 176.1zM432 408c0-13.26-10.75-24-24-24S384 394.7 384 408c0 13.25 10.75 24 24 24S432 421.3 432 408z`},null,-1)]])}var No=P({name:`k-upload`,render:Mo});w.register(`activity:explorer`,ao),w.register(`directory`,co),w.register(`directory-create`,fo),w.register(`download`,ho),w.register(`file`,vo),w.register(`file-create`,xo),w.register(`refresh`,wo),w.register(`save`,Do),w.register(`symlink`,Ao),w.register(`upload`,No);var Po=Object.assign({"./locales/de-DE.yml":lt,"./locales/en-US.yml":ut,"./locales/fr-FR.yml":dt,"./locales/ja-JP.yml":ft,"./locales/ru-RU.yml":pt,"./locales/zh-CN.yml":mt,"./locales/zh-TW.yml":ht}),Fo=e=>{Ve(e,Po),e.schema({type:`string`,role:`path`,component:xt,validate:e=>typeof e==`string`}),e.slot({type:`global`,component:no}),e.page({id:`files`,path:`/files/:name*`,name:()=>e.$i18n.t(`explorer.title`),icon:`activity:explorer`,order:600,fields:[`explorer`],component:$a}),e.slot({type:`status-right`,component:eo}),e.menu(`explorer`,[{id:`explorer.save`,icon:`save`,label:()=>e.$i18n.t(`explorer.menu.save`)},{id:`explorer.refresh`,icon:`refresh`,label:()=>e.$i18n.t(`explorer.menu.refresh`)}]),e.menu(`explorer.tree`,[{id:`.create-file`,icon:`file-create`,label:()=>e.$i18n.t(`explorer.menu.createFile`)},{id:`.create-directory`,icon:`directory-create`,label:()=>e.$i18n.t(`explorer.menu.createDirectory`)},{id:`.upload`,icon:`upload`,label:()=>e.$i18n.t(`explorer.menu.upload`)},{id:`.download`,icon:`download`,label:()=>e.$i18n.t(`explorer.menu.download`)},{id:`@separator`},{id:`.rename`,icon:`edit`,label:()=>e.$i18n.t(`explorer.menu.rename`)},{id:`.remove`,icon:`delete`,type:`danger`,label:()=>e.$i18n.t(`explorer.menu.remove`)}])};export{Fo as default};
|
package/dist/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.file-picker{flex-direction:column;height:50vh;display:flex}.file-picker header{align-items:center;display:flex}.file-picker .back-button{width:2rem;height:2rem;margin-right:.75rem}.file-picker .el-dialog__body{flex:auto;padding:20px;overflow:auto}.file-picker .entry{cursor:pointer;border-radius:4px;align-items:center;padding:.25rem .5rem;font-size:14px;display:flex}.file-picker .entry:hover{background-color:var(--k-hover-bg)}.file-picker .entry .entry-icon{width:1.25rem;height:1rem;margin-right:.5rem}.file-picker .el-dialog__footer{justify-content:space-between;display:flex}.file-picker .el-dialog__footer .el-button+.el-button{margin-left:1rem}.editor[data-v-
|
|
1
|
+
.file-picker{flex-direction:column;height:50vh;display:flex}.file-picker header{align-items:center;display:flex}.file-picker .back-button{width:2rem;height:2rem;margin-right:.75rem}.file-picker .el-dialog__body{flex:auto;padding:20px;overflow:auto}.file-picker .entry{cursor:pointer;border-radius:4px;align-items:center;padding:.25rem .5rem;font-size:14px;display:flex}.file-picker .entry:hover{background-color:var(--k-hover-bg)}.file-picker .entry .entry-icon{width:1.25rem;height:1rem;margin-right:.5rem}.file-picker .el-dialog__footer{justify-content:space-between;display:flex}.file-picker .el-dialog__footer .el-button+.el-button{margin-left:1rem}.editor[data-v-c644a12d]{width:100%;height:100%;position:absolute}.search[data-v-c644a12d]{margin-top:1rem;padding:0 1.5rem}.el-tree[data-v-c644a12d]{margin-bottom:1rem}.item[data-v-c644a12d]{flex:1;justify-content:space-between;align-items:center;height:100%;display:flex;overflow:hidden}.label[data-v-c644a12d]{text-overflow:ellipsis;transition:var(--color-transition);flex:auto;overflow:hidden}.right[data-v-c644a12d]{height:100%;margin:0 .75rem}.absolute{position:absolute}.hidden{display:none}.flex{display:flex}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.layout-main .cm-editor{--cm-bg:var(--k-main-bg);--cm-fg:var(--k-text-dark);--cm-caret:var(--k-text-dark);--cm-selection-bg:var(--k-color-primary-fade);--cm-match-bg:color-mix(in srgb, var(--k-color-primary) 35%, transparent);--cm-active-line-bg:color-mix(in srgb, var(--k-text-light) 12%, transparent);--cm-gutter-bg:var(--k-main-bg);--cm-gutter-fg:var(--k-text-light);--cm-tooltip-bg:var(--k-card-bg)}
|
|
2
2
|
/*$vite$:1*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koishi-ce/plugin-explorer",
|
|
3
3
|
"description": "File explorer and editor for Koishi",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build:client": "bun ../../../packages/web/builder/src/bin.ts build ."
|
|
@@ -83,20 +83,20 @@
|
|
|
83
83
|
"@codemirror/state": "^6.7.5",
|
|
84
84
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
85
85
|
"@codemirror/view": "^6.43.14",
|
|
86
|
-
"@koishi-ce/client": "^1.4.
|
|
86
|
+
"@koishi-ce/client": "^1.4.4",
|
|
87
87
|
"@koishi-ce/plugin-console": "^1.4.4",
|
|
88
88
|
"@koishi-ce/koishi": "^1.0.20",
|
|
89
89
|
"@types/picomatch": "^4.0.3",
|
|
90
90
|
"@vueuse/core": "^15.0.0",
|
|
91
91
|
"codemirror": "^6.0.2",
|
|
92
92
|
"element-plus": "^2.14.5",
|
|
93
|
-
"vue": "^3.5.
|
|
93
|
+
"vue": "^3.5.44",
|
|
94
94
|
"vue-router": "^5.4.0"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@koishi-ce/console": "^1.1.1",
|
|
98
98
|
"chardet": "^2.2.0",
|
|
99
|
-
"file-type": "^22.0
|
|
99
|
+
"file-type": "^22.2.0",
|
|
100
100
|
"picomatch": "^4.0.7"
|
|
101
101
|
}
|
|
102
102
|
}
|