var za=Object.defineProperty,Ya=Object.defineProperties;var qa=Object.getOwnPropertyDescriptors;var Kn=Object.getOwnPropertySymbols;var Ka=Object.prototype.hasOwnProperty,Wa=Object.prototype.propertyIsEnumerable;var rn=(e,t,n)=>t in e?za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pe=(e,t)=>{for(var n in t||(t={}))Ka.call(t,n)&&rn(e,n,t[n]);if(Kn)for(var n of Kn(t))Wa.call(t,n)&&rn(e,n,t[n]);return e},Ue=(e,t)=>Ya(e,qa(t));var mt=(e,t,n)=>(rn(e,typeof t!="symbol"?t+"":t,n),n);import{r as b,o as g,c as j,u as h,a as U,w as k,b as A,t as B,d as _,e as kn,p as Ke,g as St,f as ht,h as Xa,i as Je,n as be,j as w,k as yt,v as $t,l as X,m as ze,q as Se,F as Z,s as he,x as Ee,y as _e,z as Ot,A as tt,B as me,C as le,T as ha,D as je,E as Ja,G as Qa,H as Za,I as se,J as es,K as fa,L as te,M as dt,N as ts,O as $e,P as Dn,Q as Mn,R as ns,S as as,V as ss}from"./vue.d1ea1415.js";import{a as is}from"./axios.23e7b955.js";import{l as Wn,e as Be,a as W,R as ot,W as os,b as rs,c as ls,m as cs,C as Xn,K as ut,d as gt,M as us,f as ps,g as ln,T as ds,t as _s}from"./vendor.08c4cc4b.js";const hs={setup(e){let t={};try{parent&&parent.MAGIC_EDITOR_CONFIG&&(t=pe({},parent.MAGIC_EDITOR_CONFIG))}catch{}window.MAGIC_EDITOR_CONFIG&&(t=pe(pe({},t),window.MAGIC_EDITOR_CONFIG)),t.baseURL="./",t.serverURL="./",t.inJar=!0;const n=i=>{var o=window.location.search.substr(1).match(new RegExp("(^|&)"+i+"=([^&]*)(&|$)","i"));return o&&unescape(o[2])},a=n("headerName"),s=n("headerValue");return a&&s&&(t.request=t.request||{},t.request.beforeSend=i=>(i.headers[a]=s,i)),(i,o)=>{const r=b("magic-editor");return g(),j(r,{config:h(t)},null,8,["config"])}}};const fs="magic-editor",ms="2.0.2",gs={dev:"vite",build:"vite build"},vs={axios:"^0.24.0","monaco-editor":"0.29.1",qs:"^6.10.1",vue:"^3.2.31"},Es={"@vitejs/plugin-vue":"^2.2.4",vite:"^2.8.6","vite-plugin-svg-icons":"^1.1.0"};var bs={name:fs,version:ms,scripts:gs,dependencies:vs,devDependencies:Es};const cn="magic-";class ys{constructor(){}set(t,n){(Array.isArray(n)||typeof n=="object")&&(n=JSON.stringify(n)),localStorage.setItem(`${cn}${t}`,n)}remove(t){localStorage.removeItem(`${cn}${t}`)}get(t){return localStorage.getItem(`${cn}${t}`)}}var Fe=new ys,Pn={name:"English",message:{run:"Run",save:"Save",search:"Search",upload:"Upload",export:"Export",push:"Push",skin:"Skin",reload:"reload all resources",copy:"Copy",searchText:"Enter keywords to search",required:"Required",defaultValue:"Default Value",description:"Description",parameterType:"Parameter Type",view:"View",addRow:"Add Row",removeRow:"Remove Row",all:"All",clear:"Clear",empty:"{0} is empty.",type:"Type",date:"Date",name:"Name",group:"{0} Group",i18n:"Language",tips:"Tips",ok:"OK",refresh:"Refresh",loading:"Loading...",nodata:"no data.",cancel:"Cancel",update:"Update",create:"Create",username:"Username",password:"Password",createDataSource:"Create {0}",chooseFile:"Please Choose File",expand:"Expand",collapse:"Collapse",selectAll:"Select All",deselectAll:"Deselect All",hide:"Hide",login:"Login",ignore:"Ignore",document:"Document",joinGroup:"Join QQ Group",untitled:"Untitled",log:"Log",enable:"Enable",variable:"Variable Info",switchLocale:"Switch Language To {0}, It work at after refreshing the page, Do you want to Refresh the page ?",loadClass:"Load Classes...",loadClassError:"Failed Load Classes",switchSkin:"Switch Skin To\u300C{0}\u300D",loadClassFinish:"Class Loaded",tryAutoLogin:"Try Auto Login",autoLoginSuccess:"Auto Login Success",getCurrentLoginUser:"Load Current Logined User",getResource:"Load {0} Resources",getResourceFinish:"{0} Resources Loaded",connectDebugServer:"Debug Server Connecting...",debugServerClose:"Debug Server Disconnected",connectDebugServerSuccess:"Connect Debug Server Success",reloadResourceSuccess:"Resource Reload Success",getDetail:"Load {0} Detail",getDetailSuccess:"Load {0} Detail Success",lockSuccess:"Lock {0} Success",lockFailed:"Failed to Lock {0}",unlockSuccess:"UnLock {0} Success",unlockFailed:"Failed to UnLock {0}",updateTips:"Update {0}",saveSuccess:"Save {0} Success",saveFailed:"Failed to Save {0}",newVersionRelease:"New Version {0} available",versionLastest:"Current Version is Lastese",versionUpdate:"New Version {0} available
Do you want Upgrade?",changelog:"CHANGELOG",versionConflict:"Version does not matched frontend: {0}, backend: {1}, Please Check!",versionCheck:"Version Check",loadConfigError:"Failed to load configuration",logout:"Logout",logoutSuccess:"Logout Success",logoutConfirm:"Are you sure Logout {0} ?",deleteConfirm:"Do you want Delete {0}",deleteSuccess:"Delete {0} Success",deleteFailed:"Failed to Delete {0}",deleteTips:"Delete {0}",remote:"Remote",secret:"Secret",exported:"The selected resource has been exported",exportNoneSelect:"Please select and then export",pushNoneSelect:"Please select and then push",responseBody:"Body",responseHeader:"Header",responseStructure:"Structure",root:"Root",pushWarning:"When the full mode is pushed, the local data shall prevail and the full coverage update will be carried out. Do you want to continue?",uploadWarning:"When uploading in full mode, the overwrite update operation is performed based on the uploaded data, and other interfaces may be deleted.
In the case of partial export, it is recommended to use incremental update. Do you want to continue?",noValidate:"No Validate",validatePattern:"Regex attern",validateExpression:"Expression"},plugin:{loading:"Load plugin \u300C{0}\u300D",loaded:"Plugin\u300C{0}\u300D Loaded",loadFailed:"Failed to load plugin\u300C{0}\u300D"},resource:{createGroup:"Create Group",updateGroup:"Update Group",copyGroup:"Copy Group",deleteGroupConfirm:"Do you want Delete {0} Group\u300C{1}\u300D?",deleteGroupSuccess:"Delete {0} Group\u300C{1}\u300DSuccess",deleteGroupFailed:"Failed to Delete {0} Group \u300C{1}\u300D",groupExport:"Group\u300C{0}\u300D's {1} Exported",moveGroup:"Move Group",moveRootGroupConfirm:"Do you want move Group \u300C{0}\u300Dinto root?",moveRootSuccess:"Move {0} Group \u300C{1}\u300Dinto root Success",moveRootFailed:"Failed to Move {0} Group\u300C{1}\u300D into root",moveGroupSuccess:"Move {0} Group \u300C{1}\u300D Success",moveGroupFailed:"Failed to Move {0} Group \u300C{1}\u300D",moveFileSuccess:"Move {0} Success",moveResourceFailed:"Failed to Move {0}",saveGroupSuccess:"Save {0} Group {1}\u300D Success",saveGroupFailed:"Failed to Save {0} Group \u300C{1}\u300D",copyPathSuccess:"Copy {0} Path {1}\u300D Success",copyPathFailed:"Failed to Copy {0} Path \u300C{1}\u300D",copyRelativePathSuccess:"Copy {0} Relative Path \u300C{1}\u300D Success",copyRelativePathFailed:"Failed to Copy {0} Relative Path \u300C{1}\u300D",contextmenu:{copy:"Copy {0}",copyWithPath:"Copy Absolute Path",copyRelativePath:"Copy Relative Path",lock:"Lock",unlock:"UnLock",delete:"Delete",newFile:"New {0}",deleteGroup:"Delete Group",exportGroup:"Export Group",moveToRoot:"Move To Root"},header:{expand:"Expand All",collapse:"Collapse All",asc:"Ascending",desc:"Descending",position:"Select Opened File"},form:{groupName:"Group Name",groupPath:"Group Path",placeholder:{name:"Please Enter {0} Group Name",path:"Please Enter {0} Group Path"}}},editor:{tab:{close:"Close",closeOther:"Close Other Tabs",closeLeft:"Close Tabs to the Left",closeRight:"Close Tabs to the Right",closeAll:"Close All Tabs"},tooltip:{complection:"Trigger Suggest",resume:"Resume Breakpoint",stepInto:"Step Into",format:"Reformat Code",recent:"Recent Opened Files"},triggerSuggest:"Trigger Suggest"},api:{title:"Api Info",name:"Api",form:{method:"Method",name:"Name",path:"Path",placeholder:{name:"Please Enter Api Name",path:"Please Enter Api Path"}},navbars:{parameter:"Parameters",header:"Headers",path:"PathVariables",body:"Body",option:"Options",description:"Descriptions",groupOption:"Group Options"},validateType:"Validate Type",expression:"Expression or Regex Pattern",validate:"Validate Description",field:"Field",test:{requestBodyError:"RequestBody Has Error, please check!",missPath:"Please enter PathVariable",requestError:"Failed to send Request\u300C{0}\u300D",success:"\u300C{0}\u300DRequest finish, Status:{1} Size:{2} Time\uFF1A{3} ms",begin:"Start Request For\u300C{0}\u300D"}},datasource:{title:"DataSource",name:"DataSource",copySuccess:"Copy {0} Success",copyFailed:"Failed to Copy {0}",test:"Test",connected:"Connected",connectFailed:`Failed to Connect, Reason:\r {0}`,primary:"Primary",form:{placeholder:{name:"DataSource Name, Only Display Use",key:"DataSource Key, Required",url:"Please Enter jdbcURL\uFF0Ceg: jdbc:mysql://localhost/dbname",username:"Please Enter Database username, Optional",password:"Please Enter Database password, Optional",driver:"DriverClass, Optional",type:"Pool Type, Optional",maxRows:"Max Return Rows"},driver:"Driver",type:"Type",other:"Others"}},fn:{title:"Function Info",name:"Function",number:"Nunmber",string:"String",collection:"Collection",returnValue:"Return Types",parameter:"Function Parameters",description:"Function Description",form:{name:"Name",path:"Path",placeholder:{name:"Please Enter Function Name",path:"Please Enter Function Path"}}},toolbars:{debug:"Debug",log:"Run Log",history:"History",event:"Event",global:"Global Parameters",response:"Response",viewHistory:"History:{0}"},event:{message:"Message"},history:{name:"History",operator:"Operators"},upload:{full:"Full Upload",increment:"Increment Upload",success:"{0} Success",failed:"Failed to {0}"},push:{full:"Full Push",increment:"Increment Push",success:"{0} Success",failed:"Failed to {0}"},backup:{full:"Full Backup",backupSuccess:"Full Backup Success",rollback:"Rollback",current:"Current",difference:"Difference",rollbackSuccess:"Rollback {0} Success",rollbackFailed:"Failed to Rollback {0}",rollbackConfirm:"this operation will overview current resources, Do you want to continue?"},online:{login:"User Login",loginTips:"User {0} Login, IP: {1}",logout:"User Logout",logoutTips:"User {0} Logout, IP: {1}",onlines:"Online: {0}"},log:{hide:"Click to hide multiline log",show:"{0} lines of log are hidden, Click to show",scrollEnd:"Scroll to End"},code:{error:"Error({0})",invalid:"Error,HttpStatus({0})",httpError:"Error","-2":"Current is Readonly, Cannot be Operated","-10":"Unauthorized Operation","1001":"Group Not Found","1002":"Not Support the Group Type","1003":"Remote Cannot be empty","1004":"secretKey Cannot be empty","1005":"The name will repeat after moving. Please modify the name and try again.","1006":"Source object and grouping cannot be consistent","1007":"Resoirce Not Found","1008":"The current resource has been locked. Please operate after unlocking","1009":"This path has been used. Please try another path","1010":"There are conflicts in resource [{0}], please check","1011":"The path will conflict after moving. Please try another path","1012":"Request Method Cannot be empty","1013":"Reqeust Path Cannot be empty","1014":"Function Path Cannot be empty","1015":"The configured file path does not exist, please check","1016":"The Api [{0} ({1})] conflicts with the application and cannot be registered","1017":"Script Cannot be empty","1018":"Name Cannot be empty","1019":"Path Cannot be empty","1020":"jdbcURL Cannot be empty","1021":"key Cannot be empty","1022":"The data source key has been used. Please replace it and try again","1023":"Please Choose Group","1024":"Cron Expression Cannot be empty","1025":"The name cannot contain special characters. Only Chinese, numbers, letters and +-.() and . cannot be start","1026":"The data source key cannot contain special characters, only Chinese, numbers, letters, _","1027":"Failed to save. The group name under the same group cannot be duplicate and cannot contain special characters.","1028":"Parameter validation failed","1029":"Header validation failed","1030":"PathVariable validation failed","1031":"RequestBody validation failed","1032":"Please Upload File","1033":"Failed to validate Signature. Please check whether the secret key is correct","1034":"Backup is not enabled and cannot be operated","1035":"Api Not Found"}},Ts=Object.freeze(Object.defineProperty({__proto__:null,default:Pn},Symbol.toStringTag,{value:"Module"})),Bt={name:"\u7B80\u4F53\u4E2D\u6587",message:{run:"\u8FD0\u884C",save:"\u4FDD\u5B58",search:"\u641C\u7D22",upload:"\u4E0A\u4F20",export:"\u5BFC\u51FA",push:"\u63A8\u9001",skin:"\u76AE\u80A4",reload:"\u91CD\u65B0\u52A0\u8F7D\u6240\u6709\u6570\u636E",copy:"\u590D\u5236",searchText:"\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22",required:"\u5FC5\u586B",defaultValue:"\u9ED8\u8BA4\u503C",description:"\u63CF\u8FF0",parameterType:"\u53C2\u6570\u7C7B\u578B",view:"\u89C6\u56FE",addRow:"\u589E\u52A0\u4E00\u884C",removeRow:"\u5220\u9664\u4E00\u884C",all:"\u5168\u90E8",clear:"\u6E05\u7A7A",empty:"\u6682\u65E0{0}",type:"\u7C7B\u578B",date:"\u65F6\u95F4",name:"\u540D\u79F0",group:"{0}\u5206\u7EC4",i18n:"\u8BED\u8A00",tips:"\u63D0\u793A",ok:"\u786E\u5B9A",refresh:"\u5237\u65B0",loading:"\u52A0\u8F7D\u4E2D",nodata:"\u65E0\u6570\u636E",cancel:"\u53D6\u6D88",update:"\u4FEE\u6539",create:"\u521B\u5EFA",username:"\u7528\u6237\u540D",password:"\u5BC6\u7801",createDataSource:"\u521B\u5EFA{0}",chooseFile:"\u8BF7\u9009\u62E9\u6587\u4EF6",expand:"\u5C55\u5F00",collapse:"\u6536\u7F29",selectAll:"\u5168\u9009",deselectAll:"\u53D6\u6D88\u5168\u9009",hide:"\u9690\u85CF",login:"\u767B\u5F55",ignore:"\u4E0D\u518D\u63D0\u9192",document:"\u5E2E\u52A9\u6587\u6863",joinGroup:"\u52A0\u5165QQ\u7FA4",untitled:"\u672A\u5B9A\u4E49\u540D\u79F0",log:"\u65E5\u5FD7",enable:"\u542F\u7528",variable:"\u53D8\u91CF\u4FE1\u606F",switchLocale:"\u5DF2\u5207\u6362\u81F3{0}\uFF0C\u5237\u65B0\u9875\u9762\u540E\u751F\u6548\uFF0C\u662F\u5426\u5237\u65B0\uFF1F",loadClass:"\u52A0\u8F7Dclasses\u4FE1\u606F...",loadClassError:"\u52A0\u8F7Dclasses\u4FE1\u606F\u5931\u8D25",switchSkin:"\u5207\u6362\u76AE\u80A4\u81F3\u300C{0}\u300D",loadClassFinish:"classes\u4FE1\u606F\u52A0\u8F7D\u5B8C\u6BD5",tryAutoLogin:"\u5C1D\u8BD5\u81EA\u52A8\u767B\u5F55",autoLoginSuccess:"\u81EA\u52A8\u767B\u5F55\u6210\u529F",getCurrentLoginUser:"\u83B7\u53D6\u5F53\u524D\u767B\u5F55\u7528\u6237\u4FE1\u606F",getResource:"\u83B7\u53D6{0}\u8D44\u6E90",getResourceFinish:"\u83B7\u53D6{0}\u8D44\u6E90\u5B8C\u6BD5",connectDebugServer:"\u8FDE\u63A5\u8C03\u8BD5\u670D\u52A1\u5668...",debugServerClose:"\u8C03\u8BD5\u670D\u52A1\u5668\u5DF2\u65AD\u5F00",connectDebugServerSuccess:"\u8FDE\u63A5\u8C03\u8BD5\u670D\u52A1\u5668\u6210\u529F",reloadResourceSuccess:"\u91CD\u65B0\u52A0\u8F7D\u8D44\u6E90\u6210\u529F",getDetail:"\u83B7\u53D6{0}",getDetailSuccess:"\u83B7\u53D6{0}\u8BE6\u60C5\u6210\u529F",lockSuccess:"\u6210\u529F\u9501\u5B9A{0}",lockFailed:"\u9501\u5B9A{0}\u5931\u8D25",unlockSuccess:"\u6210\u529F\u89E3\u9501{0}",unlockFailed:"\u89E3\u9501{0}\u5931\u8D25",updateTips:"\u4FEE\u6539{0}",saveSuccess:"\u4FDD\u5B58{0}\u6210\u529F",saveFailed:"\u4FDD\u5B58{0}\u5931\u8D25",newVersionRelease:"\u7248\u672C\u68C0\u6D4B\u5B8C\u6BD5\uFF0C\u6700\u65B0\u7248\u672C\u4E3A\uFF1A{0},\u5EFA\u8BAE\u66F4\u65B0\uFF01\uFF01",versionLastest:"\u7248\u672C\u68C0\u6D4B\u5B8C\u6BD5\uFF0C\u5F53\u524D\u5DF2\u662F\u6700\u65B0\u7248",versionUpdate:"\u68C0\u6D4B\u5230\u5DF2\u6709\u65B0\u7248\u672C{0}\uFF0C\u662F\u5426\u66F4\u65B0\uFF1F",changelog:"\u66F4\u65B0\u65E5\u5FD7",versionConflict:"\u68C0\u6D4B\u5230\u524D\u540E\u7AEF\u7248\u672C\u4E0D\u4E00\u81F4\uFF08\u524D\u7AEF\uFF1A{0} \u540E\u7AEF\uFF1A{1}\uFF09\uFF0C\u8BF7\u68C0\u67E5",versionCheck:"\u7248\u672C\u68C0\u6D4B",loadConfigError:"\u52A0\u8F7D\u914D\u7F6E\u5931\u8D25",logout:"\u6CE8\u9500\u767B\u5F55",logoutSuccess:"\u6CE8\u9500\u767B\u5F55\u6210\u529F",logoutConfirm:"\u662F\u5426\u8981\u6CE8\u9500\u767B\u5F55\u300C{0}\u300D",deleteConfirm:"\u662F\u5426\u8981\u5220\u9664{0}",deleteSuccess:"\u5220\u9664{0}\u6210\u529F",deleteFailed:"\u5220\u9664{0}\u5931\u8D25",deleteTips:"\u5220\u9664{0}",remote:"\u8FDC\u7A0B\u5730\u5740",secret:"\u79D8\u94A5",exported:"\u6570\u636E\u5DF2\u5BFC\u51FA\u5B8C\u6BD5",exportNoneSelect:"\u8BF7\u9009\u62E9\u4E4B\u518D\u5728\u8FDB\u884C\u5BFC\u51FA\uFF01",pushNoneSelect:"\u8BF7\u9009\u62E9\u4E4B\u540E\u518D\u8FDB\u884C\u63A8\u9001\uFF01",responseBody:"Body",responseHeader:"\u54CD\u5E94Header",responseStructure:"\u54CD\u5E94\u7ED3\u6784",root:"\u6839\u8282\u70B9",pushWarning:"\u5168\u91CF\u6A21\u5F0F\u63A8\u9001\u65F6\uFF0C\u4EE5\u672C\u5730\u6570\u636E\u4E3A\u51C6\u5168\u91CF\u8986\u76D6\u66F4\u65B0\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F",uploadWarning:"\u5168\u91CF\u6A21\u5F0F\u4E0A\u4F20\u65F6\uFF0C\u4EE5\u4E0A\u4F20\u7684\u6570\u636E\u4E3A\u51C6\u8FDB\u884C\u8986\u76D6\u66F4\u65B0\u64CD\u4F5C\uFF0C\u53EF\u80FD\u4F1A\u5220\u9664\u5176\u4ED6\u63A5\u53E3
\u5728\u975E\u5168\u91CF\u5BFC\u51FA\u65F6\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u589E\u91CF\u66F4\u65B0\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F",noValidate:"\u4E0D\u9A8C\u8BC1",validatePattern:"\u6B63\u5219\u9A8C\u8BC1",validateExpression:"\u8868\u8FBE\u5F0F\u9A8C\u8BC1"},plugin:{loading:"\u52A0\u8F7D\u63D2\u4EF6\u300C{0}\u300D",loaded:"\u5DF2\u52A0\u8F7D\u63D2\u4EF6\u300C{0}\u300D",loadFailed:"\u52A0\u8F7D\u63D2\u4EF6\u300C{0}\u300D\u5931\u8D25"},resource:{createGroup:"\u521B\u5EFA\u5206\u7EC4",updateGroup:"\u4FEE\u6539\u5206\u7EC4",copyGroup:"\u590D\u5236\u5206\u7EC4",deleteGroupConfirm:"\u662F\u5426\u8981\u5220\u9664{0}\u5206\u7EC4\u300C{1}\u300D\uFF1F",deleteGroupSuccess:"\u5220\u9664{0}\u5206\u7EC4\u300C{1}\u300D\u6210\u529F",deleteGroupFailed:"\u5220\u9664{0}\u5206\u7EC4\u300C{1}\u300D\u5931\u8D25",groupExport:"\u5206\u7EC4\u300C{0}\u300D\u76F8\u5173{1}\u5DF2\u5BFC\u51FA",moveGroup:"\u79FB\u52A8\u5206\u7EC4",moveRootGroupConfirm:"\u662F\u5426\u8981\u5C06\u5206\u7EC4\u300C{0}\u300D\u79FB\u52A8\u81F3\u6839\u8282\u70B9",moveRootSuccess:"\u79FB\u52A8{0}\u5206\u7EC4\u300C{1}\u300D\u81F3\u6839\u8282\u70B9\u6210\u529F",moveRootFailed:"\u79FB\u52A8{0}\u5206\u7EC4\u300C{1}\u300D\u81F3\u6839\u8282\u70B9\u5931\u8D25",moveGroupSuccess:"\u79FB\u52A8{0}\u5206\u7EC4\u300C{1}\u300D\u6210\u529F",moveGroupFailed:"\u79FB\u52A8{0}\u5206\u7EC4\u300C{1}\u300D\u5931\u8D25",moveFileSuccess:"\u79FB\u52A8\u8D44\u6E90\u300C{0}\u300D\u6210\u529F",moveResourceFailed:"\u79FB\u52A8\u8D44\u6E90\u300C{0}\u300D\u5931\u8D25",saveGroupSuccess:"\u4FDD\u5B58{0}\u5206\u7EC4\u300C{1}\u300D\u6210\u529F",saveGroupFailed:"\u4FDD\u5B58{0}\u5206\u7EC4\u300C{1}\u300D\u5931\u8D25",copyPathSuccess:"{0}\u8DEF\u5F84\u300C{1}\u300D\u590D\u5236\u6210\u529F",copyPathFailed:"{0}\u8DEF\u5F84\u300C{1}\u300D\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u590D\u5236",copyRelativePathSuccess:"{0}\u76F8\u5BF9\u8DEF\u5F84\u300C{1}\u300D\u590D\u5236\u6210\u529F",copyRelativePathFailed:"{0}\u76F8\u5BF9\u8DEF\u5F84\u300C{1}\u300D\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u590D\u5236",contextmenu:{copy:"\u590D\u5236{0}",copyWithPath:"\u590D\u5236\u8DEF\u5F84",copyRelativePath:"\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84",lock:"\u9501\u5B9A",unlock:"\u89E3\u9501",delete:"\u5220\u9664",newFile:"\u65B0\u5EFA{0}",deleteGroup:"\u5220\u9664\u5206\u7EC4",exportGroup:"\u5BFC\u51FA\u5206\u7EC4",moveToRoot:"\u79FB\u52A8\u81F3\u6839\u8282\u70B9"},header:{expand:"\u5168\u90E8\u5C55\u5F00",collapse:"\u5168\u90E8\u6298\u53E0",asc:"\u6309\u5B57\u6BCD\u5347\u5E8F",desc:"\u6309\u5B57\u6BCD\u964D\u5E8F",position:"\u5B9A\u4F4D\u5F53\u524D\u6587\u4EF6"},form:{groupName:"\u5206\u7EC4\u540D\u79F0",groupPath:"\u5206\u7EC4\u8DEF\u5F84",placeholder:{name:"\u8BF7\u8F93\u5165{0}\u5206\u7EC4\u540D\u79F0",path:"\u8BF7\u8F93\u5165{0}\u5206\u7EC4\u8DEF\u5F84"}}},editor:{tab:{close:"\u5173\u95ED",closeOther:"\u5173\u95ED\u5176\u5B83",closeLeft:"\u5173\u95ED\u5DE6\u4FA7",closeRight:"\u5173\u95ED\u53F3\u4FA7",closeAll:"\u5168\u90E8\u5173\u95ED"},tooltip:{complection:"\u4EE3\u7801\u63D0\u793A",resume:"\u6062\u590D\u65AD\u70B9",stepInto:"\u6B65\u8FDB",format:"\u4EE3\u7801\u683C\u5F0F\u5316",recent:"\u6700\u8FD1\u6253\u5F00"},triggerSuggest:"\u89E6\u53D1\u4EE3\u7801\u63D0\u793A"},api:{title:"\u63A5\u53E3\u4FE1\u606F",name:"\u63A5\u53E3",form:{method:"\u8BF7\u6C42\u65B9\u6CD5",name:"\u63A5\u53E3\u540D\u79F0",path:"\u63A5\u53E3\u8DEF\u5F84",placeholder:{name:"\u8BF7\u8F93\u5165\u63A5\u53E3\u540D\u79F0",path:"\u8BF7\u8F93\u5165\u63A5\u53E3\u8DEF\u5F84"}},navbars:{parameter:"\u8BF7\u6C42\u53C2\u6570",header:"\u8BF7\u6C42Header",path:"\u8DEF\u5F84\u53D8\u91CF",body:"\u8BF7\u6C42Body",option:"\u63A5\u53E3\u9009\u9879",description:"\u63A5\u53E3\u63CF\u8FF0",groupOption:"\u5206\u7EC4\u9009\u9879"},validateType:"\u9A8C\u8BC1\u65B9\u5F0F",expression:"\u8868\u8FBE\u5F0F\u6216\u6B63\u5219\u8868\u8FBE\u5F0F",validate:"\u9A8C\u8BC1\u8BF4\u660E",field:"\u5B57\u6BB5",test:{requestBodyError:"RequestBody \u53C2\u6570\u6709\u8BEF\uFF0C\u8BF7\u68C0\u67E5\uFF01",missPath:"\u8BF7\u586B\u5199\u8DEF\u5F84\u53D8\u91CF\u540E\u5728\u6D4B\u8BD5\uFF01",requestError:"\u8BF7\u6C42\u300C{0}\u300D\u51FA\u9519",success:"\u300C{0}\u300D\u6D4B\u8BD5\u5B8C\u6BD5\uFF0C\u72B6\u6001\uFF1A{1} \u5927\u5C0F\uFF1A{2} \u8017\u65F6\uFF1A{3} ms",begin:"\u5F00\u59CB\u6D4B\u8BD5\u300C{0}\u300D"}},datasource:{title:"DataSource",name:"\u6570\u636E\u6E90",copySuccess:"\u590D\u5236{0}\u6210\u529F",copyFailed:"\u590D\u5236{0}\u5931\u8D25",test:"\u6D4B\u8BD5\u8FDE\u63A5",connected:"\u8FDE\u63A5\u6210\u529F",connectFailed:`\u8FDE\u63A5\u5931\u8D25\uFF0C\u9519\u8BEF\u539F\u56E0\uFF1A\r {0}`,primary:"\u4E3B\u6570\u636E\u6E90",form:{placeholder:{name:"\u6570\u636E\u6E90\u540D\u79F0\uFF0C\u4EC5\u505A\u663E\u793A\u4F7F\u7528",key:"\u6570\u636E\u6E90Key\uFF0C\u540E\u7EED\u4EE3\u7801\u4E2D\u4F7F\u7528",url:"\u8BF7\u8F93\u5165jdbcURL\uFF0C\u5982\uFF1Ajdbc:mysql://localhost/dbname",username:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u7528\u6237\u540D",password:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u5BC6\u7801",driver:"\u9A71\u52A8\u7C7B\uFF0C\u53EF\u9009\uFF0C\u5185\u90E8\u81EA\u52A8\u8BC6\u522B\uFF0C\u4E5F\u53EF\u4EE5\u624B\u52A8\u8F93\u5165\u6307\u5B9A",type:"\u8FDE\u63A5\u6C60\u7C7B\u578B\uFF0C\u53EF\u9009\uFF0C\u4E5F\u53EF\u4EE5\u624B\u52A8\u8F93\u5165\u6307\u5B9A",maxRows:"\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C-1\u4E3A\u4E0D\u9650\u5236"},driver:"\u9A71\u52A8\u7C7B",type:"\u7C7B\u578B",other:"\u5176\u5B83\u914D\u7F6E"}},task:{title:"\u5B9A\u65F6\u4EFB\u52A1\u4FE1\u606F",name:"\u5B9A\u65F6\u4EFB\u52A1",form:{name:"\u4EFB\u52A1\u540D\u79F0",path:"\u4EFB\u52A1\u8DEF\u5F84",placeholder:{cron:"\u8BF7\u8F93\u5165Cron\u8868\u8FBE\u5F0F",name:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0",path:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u8DEF\u5F84",description:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u63CF\u8FF0"}}},fn:{title:"\u51FD\u6570\u4FE1\u606F",name:"\u51FD\u6570",number:"\u6570\u503C",string:"\u5B57\u7B26\u4E32",collection:"\u96C6\u5408",fnName:"\u51FD\u6570\u540D\u79F0",returnValue:"\u8FD4\u56DE\u503C",parameter:"\u51FD\u6570\u53C2\u6570",description:"\u51FD\u6570\u63CF\u8FF0",form:{name:"\u51FD\u6570\u540D\u79F0",path:"\u51FD\u6570\u8DEF\u5F84",placeholder:{name:"\u8BF7\u8F93\u5165\u51FD\u6570\u540D\u79F0",path:"\u8BF7\u8F93\u5165\u51FD\u6570\u8DEF\u5F84"}}},toolbars:{debug:"\u8C03\u8BD5\u4FE1\u606F",log:"\u8FD0\u884C\u65E5\u5FD7",history:"\u5386\u53F2\u8BB0\u5F55",event:"\u4E8B\u4EF6",global:"\u5168\u5C40\u53C2\u6570",response:"\u6267\u884C\u7ED3\u679C",viewHistory:"\u5386\u53F2\u8BB0\u5F55\uFF1A{0}"},event:{message:"\u4E8B\u4EF6\u5185\u5BB9"},history:{name:"\u5386\u53F2\u8BB0\u5F55",operator:"\u64CD\u4F5C\u4EBA"},upload:{full:"\u5168\u91CF\u4E0A\u4F20",increment:"\u589E\u91CF\u4E0A\u4F20",success:"{0}\u6210\u529F",failed:"{0}\u5931\u8D25"},push:{full:"\u5168\u91CF\u63A8\u9001",increment:"\u589E\u91CF\u63A8\u9001",success:"{0} Success",failed:"Failed to {0}"},backup:{full:"\u5168\u91CF\u5907\u4EFD",backupSuccess:"\u5168\u91CF\u5907\u4EFD\u5B8C\u6BD5",rollback:"\u8FD8\u539F",current:"\u5F53\u524D\u7248\u672C",difference:"\u5BF9\u6BD4\u4E0D\u540C",rollbackSuccess:"\u6062\u590D{0}\u6210\u529F",rollbackFailed:"\u6062\u590D{0}\u5931\u8D25",rollbackConfirm:"\u8BE5\u64CD\u4F5C\u4F1A\u8986\u76D6\u66F4\u65B0\u5F53\u524D\u8D44\u6E90\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F"},online:{login:"\u7528\u6237\u4E0A\u7EBF",loginTips:"\u7528\u6237\u300C{0}\u300D\u5DF2\u4E0A\u7EBF\uFF0CIP\uFF1A{1}",logout:"\u7528\u6237\u4E0B\u7EBF",logoutTips:"\u7528\u6237\u300C{0}\u300D\u5DF2\u4E0B\u7EBF\uFF0CIP\uFF1A{1}",onlines:"\u5F53\u524D\u5728\u7EBF\uFF1A{0}\u4EBA"},log:{hide:"\u70B9\u51FB\u9690\u85CF\u591A\u884C\u65E5\u5FD7",show:"\u6709 {0} \u884C\u65E5\u5FD7\u88AB\u9690\u85CF\uFF0C\u70B9\u51FB\u663E\u793A",scrollEnd:"\u6EDA\u52A8\u81F3\u7ED3\u5C3E"},code:{error:"\u8BF7\u6C42\u51FA\u9519\uFF0C\u5F02\u5E38\u4EE3\u7801({0})",invalid:"\u8BF7\u6C42\u51FA\u9519\uFF0CHttpStatus({0})",httpError:"\u8BF7\u6C42\u51FA\u9519","-2":"\u5F53\u524D\u4E3A\u53EA\u8BFB\u6A21\u5F0F\uFF0C\u65E0\u6CD5\u64CD\u4F5C","-10":"\u65E0\u6743\u9650\u64CD\u4F5C\u3002","1001":"\u627E\u4E0D\u5230\u5206\u7EC4\u4FE1\u606F","1002":"\u4E0D\u652F\u6301\u8BE5\u5206\u7EC4\u7C7B\u578B","1003":"\u76EE\u6807\u7F51\u5740\u4E0D\u80FD\u4E3A\u7A7A","1004":"secretKey\u4E0D\u80FD\u4E3A\u7A7A","1005":"\u79FB\u52A8\u540E\u540D\u79F0\u4F1A\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540D\u79F0\u540E\u5728\u8BD5\u3002","1006":"\u6E90\u5BF9\u8C61\u548C\u5206\u7EC4\u4E0D\u80FD\u4E00\u81F4","1007":"\u627E\u4E0D\u5230\u5BF9\u5E94\u6587\u4EF6\u6216\u5206\u7EC4","1008":"\u5F53\u524D\u8D44\u6E90\u5DF2\u88AB\u9501\u5B9A\uFF0C\u8BF7\u89E3\u9501\u540E\u5728\u64CD\u4F5C\u3002","1009":"\u8BE5\u8DEF\u5F84\u5DF2\u88AB\u4F7F\u7528,\u8BF7\u6362\u4E00\u4E2A\u8DEF\u5F84\u5728\u8BD5","1010":"\u8D44\u6E90\u4E2D[{0}]\u6709\u51B2\u7A81\uFF0C\u8BF7\u68C0\u67E5","1011":"\u79FB\u52A8\u540E\u8DEF\u5F84\u4F1A\u51B2\u7A81,\u8BF7\u6362\u4E00\u4E2A\u8DEF\u5F84\u5728\u8BD5","1012":"\u8BF7\u6C42\u65B9\u6CD5\u4E0D\u80FD\u4E3A\u7A7A","1013":"\u8BF7\u6C42\u8DEF\u5F84\u4E0D\u80FD\u4E3A\u7A7A","1014":"\u51FD\u6570\u8DEF\u5F84\u4E0D\u80FD\u4E3A\u7A7A","1015":"\u914D\u7F6E\u7684\u6587\u4EF6\u8DEF\u5F84\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5","1016":"\u63A5\u53E3[{0}({1})]\u4E0E\u5E94\u7528\u51B2\u7A81\uFF0C\u65E0\u6CD5\u6CE8\u518C","1017":"\u811A\u672C\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A","1018":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A","1019":"\u8DEF\u5F84\u4E0D\u80FD\u4E3A\u7A7A","1020":"jdbcURL\u4E0D\u80FD\u4E3A\u7A7A","1021":"key\u4E0D\u80FD\u4E3A\u7A7A","1022":"\u6570\u636E\u6E90key\u5DF2\u88AB\u4F7F\u7528\uFF0C\u8BF7\u66F4\u6362\u540E\u5728\u8BD5","1023":"\u8BF7\u9009\u62E9\u5206\u7EC4","1024":"cron\u8868\u8FBE\u5F0F\u4E0D\u80FD\u4E3A\u7A7A","1025":"\u540D\u79F0\u4E0D\u80FD\u5305\u542B\u7279\u6B8A\u5B57\u7B26\uFF0C\u53EA\u5141\u8BB8\u4E2D\u6587\u3001\u6570\u5B57\u3001\u5B57\u6BCD\u4EE5\u53CA+_-.()\u7684\u7EC4\u5408\u4E14\u4E0D\u80FD.\u5F00\u5934","1026":"\u6570\u636E\u6E90Key\u4E0D\u80FD\u5305\u542B\u7279\u6B8A\u5B57\u7B26\uFF0C\u53EA\u5141\u8BB8\u4E2D\u6587\u3001\u6570\u5B57\u3001\u5B57\u6BCD\u4EE5\u53CA_\u7EC4\u5408","1027":"\u4FDD\u5B58\u5931\u8D25,\u540C\u4E00\u7EC4\u4E0B\u5206\u7EC4\u540D\u79F0\u4E0D\u80FD\u91CD\u590D\u4E14\u4E0D\u80FD\u5305\u542B\u7279\u6B8A\u5B57\u7B26\u3002","1028":"\u53C2\u6570\u9A8C\u8BC1\u5931\u8D25","1029":"header\u9A8C\u8BC1\u5931\u8D25","1030":"\u8DEF\u5F84\u53D8\u91CF\u9A8C\u8BC1\u5931\u8D25","1031":"body\u9A8C\u8BC1\u5931\u8D25","1032":"\u8BF7\u4E0A\u4F20\u6587\u4EF6","1033":"\u7B7E\u540D\u9A8C\u8BC1\u5931\u8D25,\u8BF7\u68C0\u67E5\u79D8\u94A5\u662F\u5426\u6B63\u786E","1034":"\u672A\u542F\u7528\u5907\u4EFD\uFF0C\u65E0\u6CD5\u64CD\u4F5C","1035":"\u627E\u4E0D\u5230\u63A5\u53E3"}},Ss=Object.freeze(Object.defineProperty({__proto__:null,default:Bt},Symbol.toStringTag,{value:"Module"}));const Os=Fe.get("locale");let Qt=Bt;Os==="en"&&(Qt=Pn);function c(e,...t){try{const n=e.split(".").reduce((a,s)=>a[s],Qt);return n&&t.length>0?n.replace(/\{(\d+)\}/g,(a,s)=>t[s]):n||e}catch{return e}}function xs(e,t){let n=Bt;e==="en"&&(n=Pn);const a=(s,i)=>{Object.entries(i).forEach(([o,r])=>{typeof r=="string"?s[o]=r:(s[o]||(s[o]={}),a(s[o],r))})};a(n,t)}function Rs(e,t){if(Bt===Qt)return t;const n=Bt.code[`${e}`],a=Qt.code[`${e}`];if(n&&a){const s=n.replace(/([()\[\]\.])/g,"\\$1").replace(/{\d+}/g,"(.*?)");if(s){const i=[],o=new RegExp(s,"g");let r;for(;(r=o.exec(t))!=null;)i.push(r);return c(`code.${e}`,i.splice(0,1))}}return t}let ma=bs.version,As="V"+ma.replace(/\./g,"_");const M={BASE_URL:"",WEBSOCKET_SERVER:"",SERVER_URL:"",AUTO_SAVE:!0,user:null,DECORATION_TIMEOUT:1e4,CHECK_UPDATE:!0,BLOCK_CLOSE:!0,MAGIC_API_VERSION_TEXT:ma,MAGIC_API_VERSION:As,API_DEFAULT_METHOD:"GET",CLIENT_ID:"none",HEADER_REQUEST_CLIENT_ID:"Magic-Request-Client-Id",HEADER_REQUEST_SCRIPT_ID:"Magic-Request-Script-Id",HEADER_REQUEST_BREAKPOINTS:"Magic-Request-Breakpoints",HEADER_RESPONSE_MAGIC_CONTENT_TYPE:"ma-content-type",HEADER_APPLICATION_STREAM:"application/octet-stream",HEADER_CONTENT_DISPOSITION:"ma-content-disposition",HEADER_MAGIC_TOKEN:"magic-token",HEADER_MAGIC_TOKEN_VALUE:"unauthorization",IGNORE_VERSION:"ignore-version",RECENT_OPENED_TAB:"recent_opened_tab",RECENT_OPENED:"recent_opened",RESPONSE_CODE_DEBUG:1e3,RESPONSE_CODE_SCRIPT_ERROR:-1e3,RESPONSE_NO_PERMISSION:-10,DEFAULT_EXPAND:!0,LOGINED:!1,LOG_MAX_ROWS:1/0,LOCKED:"1",UNLOCK:"0",STORE:{theme:"theme",token:"token"},PLUGINS:[],GLOBAL:{parameters:[],headers:[]},THEME:"default",JDBC_DRIVERS:["com.mysql.jdbc.Driver","com.mysql.cj.jdbc.Driver","oracle.jdbc.driver.OracleDriver","org.postgresql.Driver","com.microsoft.sqlserver.jdbc.SQLServerDriver","com.ibm.db2.jcc.DB2Driver"],DATASOURCE_TYPES:["com.zaxxer.hikari.HikariDataSource","com.alibaba.druid.pool.DruidDataSource","org.apache.tomcat.jdbc.pool.DataSource","org.apache.commons.dbcp2.BasicDataSource"],OPTIONS:[],EDITOR_FONT_FAMILY:'JetBrainsMono, Consolas, "Courier New",monospace, \u5FAE\u8F6F\u96C5\u9ED1',EDITOR_FONT_SIZE:14,FONT_LIGATURES:!0,VALIDATE_TYPES:[{value:"pass",text:c("message.noValidate")},{value:"expression",text:c("message.validateExpression")},{value:"pattern",text:c("message.validatePattern")}],DEFAULT_VALIDATE_TYPE:"pass",REQUEST_PARAMETER_TYPES:[{value:"String",text:"String"},{value:"Boolean",text:"Boolean"},{value:"Integer",text:"Integer"},{value:"Date",text:"Date"},{value:"Double",text:"Double"},{value:"Long",text:"Long"},{value:"Short",text:"Short"},{value:"Float",text:"Float"},{value:"Byte",text:"Byte"},{value:"MultipartFile",text:"MultipartFile"},{value:"MultipartFiles",text:"MultipartFiles"}],GLOBAL_PARAMETER_TYPES:[{value:"String",text:"String"},{value:"Boolean",text:"Boolean"},{value:"Integer",text:"Integer"},{value:"Date",text:"Date"},{value:"Double",text:"Double"},{value:"Long",text:"Long"},{value:"Short",text:"Short"},{value:"Float",text:"Float"},{value:"Byte",text:"Byte"}],DEFAULT_REQUEST_PARAMETER_TYPE:"String",REQUEST_SIMPLE_TYPES:[{value:"String",text:"String"},{value:"Boolean",text:"Boolean"},{value:"Integer",text:"Integer"},{value:"Date",text:"Date"},{value:"Double",text:"Double"},{value:"Long",text:"Long"},{value:"Short",text:"Short"},{value:"Float",text:"Float"},{value:"Byte",text:"Byte"}],DEFAULT_REQUEST_SIMPLE_TYPE:"String",REQUEST_METHODS:[{value:"GET",text:"GET"},{value:"POST",text:"POST"},{value:"PUT",text:"PUT"},{value:"DELETE",text:"DELETE"},{value:"HEAD",text:"HEAD"},{value:"PATCH",text:"PATCH"}],DEFAULT_REQUEST_METHOD:"GET",FUNCTION_RETURN_TYPES:[{value:"java.lang.Number",text:c("fn.number")},{value:"java.lang.String",text:c("fn.string")},{value:"java.util.Collection",text:c("fn.collection")},{value:"java.util.Map",text:"Map"},{value:"java.lang.Object",text:"Object"}],BODY_DATA_TYPES:[{value:"String",text:"String"},{value:"Integer",text:"Integer"},{value:"Double",text:"Double"},{value:"Long",text:"Long"},{value:"Short",text:"Short"},{value:"Float",text:"Float"},{value:"Byte",text:"Byte"},{value:"Boolean",text:"Boolean"},{value:"Date",text:"Date"},{value:"Object",text:"Object"},{value:"Array",text:"Array"},{value:"Any",text:"Any"}],DEFAULT_FUNCTION_RETURN_TYPE:"java.lang.Object",config:{}},Is={style:{"white-space":"pre-wrap"}},ga={props:{title:{type:String,default:c("message.tips")},ok:{type:String,default:c("message.ok")},message:{type:String,required:!0},onClose:{type:Function,default:()=>{}}},setup(e){const t=U(!0);return(n,a)=>{const s=b("magic-button"),i=b("magic-button-group"),o=b("magic-dialog");return g(),j(o,{value:t.value,"onUpdate:value":a[1]||(a[1]=r=>t.value=r),title:e.title,ref:"dialog",onClose:a[2]||(a[2]=r=>e.onClose())},{default:k(()=>[A("pre",Is,B(e.message),1),_(i,{align:"center",style:{padding:"5px 0"}},{default:k(()=>[_(s,{value:e.ok,type:"active",onOnClick:a[0]||(a[0]=r=>n.$refs.dialog.close())},null,8,["value"])]),_:1})]),_:1},8,["value","title"])}}};var Cs=Object.freeze(Object.defineProperty({__proto__:null,default:ga},Symbol.toStringTag,{value:"Module"}));const Ls=["innerHTML"],va={props:{title:{type:String,default:c("message.tips")},ok:{type:String,default:c("message.ok")},cancel:{type:String,default:c("message.cancel")},message:{type:String,required:!0},success:{type:Function,default:()=>{}},onClose:{type:Function,default:()=>{}}},setup(e){const t=U(!0);return(n,a)=>{const s=b("magic-button"),i=b("magic-button-group"),o=b("magic-dialog");return g(),j(o,{value:t.value,"onUpdate:value":a[2]||(a[2]=r=>t.value=r),title:e.title,ref:"dialog",onClose:a[3]||(a[3]=r=>e.onClose())},{default:k(()=>[A("pre",{innerHTML:e.message,style:{"white-space":"pre-wrap"}},null,8,Ls),_(i,{align:"right",style:{padding:"5px 0"}},{default:k(()=>[_(s,{value:e.ok,type:"active",onOnClick:a[0]||(a[0]=()=>{e.success(),n.$refs.dialog.close()})},null,8,["value"]),_(s,{value:e.cancel,onOnClick:a[1]||(a[1]=r=>n.$refs.dialog.close())},null,8,["value"])]),_:1})]),_:1},8,["value","title"])}}};var Ns=Object.freeze(Object.defineProperty({__proto__:null,default:va},Symbol.toStringTag,{value:"Module"}));let Ea=null;const Jn=(e,t)=>{const n=document.createElement("div");document.querySelector(".magic-editor .magic-mounts").appendChild(n);const a=kn(e,Ue(pe({},t),{onClose:()=>n.remove()}));Ea(a),a.mount(n)},ve={alert:(e,t,n)=>Jn(ga,{message:e,title:t,ok:n}),confirm:(e,t,n)=>Jn(va,{title:e,message:t,success:n})},ba=(e,t)=>{Ea=t,Object.keys(ve).forEach(n=>e.config.globalProperties[`$${n}`]=ve[n])};var ws=Object.freeze(Object.defineProperty({__proto__:null,install:ba,default:ve},Symbol.toStringTag,{value:"Module"}));const It={baseURL:"",method:"post",timeout:0,withCredentials:!0,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},transformRequest:[function(e){return e instanceof FormData?e:Wn.stringify(e,{arrayFormat:"repeat",allowDots:!0})}],paramsSerializer(e){return Wn.stringify(e,{arrayFormat:"repeat",allowDots:!0})}};class ks{constructor(){mt(this,"successHandle",null);mt(this,"errorHandle",null);mt(this,"endHandle",null);mt(this,"exceptionHandle",(t,n)=>{ve.alert(Rs(t,n),c("code.error",t))})}success(t){return this.successHandle=t,this}exception(t){return this.exceptionHandle=t,this}error(t){return this.errorHandle=t,this}end(t){this.endHandle=t}}class Ds{constructor(){mt(this,"_axios",null);this._axios=is.create(It)}getAxios(){return this._axios}setBaseURL(t){It.baseURL=t}execute(t){let n=pe({baseURL:It.baseURL},t);return n.headers=n.headers||{},n.headers[M.HEADER_MAGIC_TOKEN]=M.HEADER_MAGIC_TOKEN_VALUE,this._axios.request(n)}processError(t){var n,a,s;t.response?ve.alert(JSON.stringify(((n=t.response)==null?void 0:n.data)||"")||c("code.invalid",(a=t.response)==null?void 0:a.status),c("code.invalid",(s=t.response)==null?void 0:s.status)):ve.alert(t.message,c("code.httpError")),console.error(t)}sendJson(t,n,a){return this.send(t,JSON.stringify(n),a||{method:"post",headers:{"Content-Type":"application/json"},transformRequest:[]})}sendGet(t,n,a){return a=a||{},a.method="get",this.send(t,n,a)}sendPost(t,n,a){return a=a||{},a.method="post",this.send(t,n,a)}send(t,n,a){let s=a||It||{};s.url=t,(s.method||"").toLowerCase()==="post"?s.data=n:s.params=n,s.baseURL=It.baseURL;let i=new ks,o=!1,r=(l,u)=>{l instanceof Blob?(o=!0,i.successHandle&&i.successHandle(l,u)):l.code===1?(o=!0,i.successHandle&&i.successHandle(l.data,u)):(l.code===401&&console.log("\u672A\u767B\u5F55"),i.exceptionHandle&&i.exceptionHandle(l.code,l.message,u))};return this.execute(s).then(l=>{let u=l.data,p=l.headers["content-type"]&&l.headers["content-type"].startsWith("application/json");if(u instanceof Blob&&p){let m=new FileReader;m.readAsText(u),m.onload=function(){try{u=JSON.parse(this.result),r(u,l)}catch(f){console.error(f),r(u,l)}};return}r(u,l)}).catch(l=>{var u;typeof i.errorHandle=="function"?i.errorHandle((u=l.response)==null?void 0:u.data,l.response,l):this.processError(l)}).finally(()=>{typeof i.endHandle=="function"&&i.endHandle(o)}),i}}var z=new Ds;const ce={Alt:512,Ctrl:1024,Shift:2048};new Array(26).fill(0).forEach((e,t)=>ce[String.fromCharCode(65+t)]=65+t);new Array(12).fill(0).forEach((e,t)=>ce[`F${t+1}`]=112+t);const Zt=[],ya=e=>{if(e.keyCode){let t=e.keyCode;t|=e.ctrlKey&&ce.Ctrl||0,t|=e.shiftKey&&ce.Shift||0,t|=e.altKey&&ce.Alt||0,t|=e.metaKey&&ce.Ctrl||0;for(let n=0,a=Zt.length;ndocument.addEventListener("keydown",ya);ce.bind=(e,t,n)=>{mn||(mn=!0,ce.init()),typeof n=="function"&&Zt.push({target:e,code:t,callback:n})};ce.unbind=()=>{Zt.length=0,document.removeEventListener("keydown",ya),mn=!1};var Ms={editor:{base:"vs",rules:[{background:"#ffffff"},{token:"keywords",foreground:"000080",fontStyle:"bold"},{token:"number",foreground:"0000FF"},{token:"keyword",foreground:"000080",fontStyle:"bold"},{token:"string.sql",foreground:"008000"},{token:"tag.sql",foreground:"0033B3"},{token:"attribute.name.sql",foreground:"174AD4"},{token:"attribute.value.sql",foreground:"067D17"},{token:"predefined",foreground:"000000",fontStyle:"italic"},{token:"operator.sql",foreground:"000080",fontStyle:"bold"},{token:"key",foreground:"660E7A"},{token:"string.key.json",foreground:"660E7A"},{token:"string.value.json",foreground:"008000"},{token:"keyword.json",foreground:"0000FF"},{token:"string",foreground:"008000",fontStyle:"bold"},{token:"string.invalid",foreground:"008000",background:"FFCCCC"},{token:"string.escape.invalid",foreground:"008000",background:"FFCCCC"},{token:"string.escape",foreground:"000080",fontStyle:"bold"},{token:"comment",foreground:"808080",fontStyle:"italic"},{token:"comment.doc",foreground:"808080",fontStyle:"italic"},{token:"comment.todo",foreground:"008DDE",fontStyle:"italic"},{token:"string.escape",foreground:"000080"}],colors:{"editor.foreground":"#000000","editor.background":"#ffffff","editorLineNumber.foreground":"#999999","editorGutter.background":"#f0f0f0","editor.lineHighlightBackground":"#FFFAE3","dropdown.background":"#F2F2F2","dropdown.foreground":"#000000","list.activeSelectionBackground":"#1A7DC4","list.activeSelectionForeground":"#ffffff"}}},Ps={editor:{base:"vs-dark",rules:[{foreground:"A9B7C6"},{token:"keywords",foreground:"CC7832",fontStyle:"bold"},{token:"keyword",foreground:"CC7832",fontStyle:"bold"},{token:"number",foreground:"6897BB"},{token:"string",foreground:"6A8759",fontStyle:"bold"},{token:"string.sql",foreground:"6A8759"},{token:"tag.sql",foreground:"E8BF6A"},{token:"attribute.name.sql",foreground:"BABABA"},{token:"attribute.value.sql",foreground:"6A8759"},{token:"predefined.sql",foreground:"A9B7C6",fontStyle:"italic"},{token:"predefined.magicscript",foreground:"A9B7C6",fontStyle:"italic"},{token:"key",foreground:"9876AA"},{token:"string.key.json",foreground:"9876AA"},{token:"string.value.json",foreground:"6A8759"},{token:"keyword.json",foreground:"6897BB"},{token:"operator.sql",foreground:"CC7832",fontStyle:"bold"},{token:"string.invalid",foreground:"008000",background:"FFCCCC"},{token:"string.escape.invalid",foreground:"008000",background:"FFCCCC"},{token:"string.escape",foreground:"000080",fontStyle:"bold"},{token:"comment",foreground:"808080",fontStyle:"italic"},{token:"comment.doc",foreground:"629755",fontStyle:"italic"},{token:"comment.todo",foreground:"A8C023",fontStyle:"italic"},{token:"string.escape",foreground:"CC7832"}],colors:{"editor.background":"#2B2B2B","editorLineNumber.foreground":"#999999","editorGutter.background":"#313335","editor.lineHighlightBackground":"#323232","dropdown.background":"#3C3F41","dropdown.foreground":"#BBBBBB","list.activeSelectionBackground":"#4B6EAF","list.activeSelectionForeground":"#FFFFFF","editorSuggestWidget.selectedBackground":"#113A5C"}},styles:{"main-background-color":"#3C3F41","main-border-color":"#323232","main-color":"#bbb","main-selected-background-color":"#323232","main-hover-background-color":"#353739","main-hover-icon-background-color":"#4C5052","main-selected-color":"#fff","main-icon-color":"#AFB1B3","header-title-color":"#bbb","header-version-color":"#999","header-default-color":"#AFB1B3","empty-background-color":"#282828","empty-key-color":"#489DF6","empty-color":"#A0A0A0","button-hover-background-color":"#365880","button-hover-border-color":"#43688C","button-background-color":"#4C5052","button-border-color":"#5E6060","button-disabled-color":"#5a5a5a","navbar-body-background-color":"#3C3F41","navbar-body-border-color":"#555555","resource-label-color":"#bbb","resource-span-color":"#787878","tree-hover-background-color":"#0d293e","tree-icon-color":"#aeb9c0","table-border-color":"#646464","input-border-color":"#646464","input-foucs-color":"#3D6185","input-background-color":"#45494A","select-background-color":"#3C3F41","select-hover-background-color":"#3C3F41","select-option-background-color":"#3C3F41","select-option-hover-background-color":"#4B6EAF","select-option-border-color":"#808080","data-type-default-color":"#a9b7c6","data-type-string-color":"#6a8759","data-type-integer-color":"#6897bb","data-type-byte-color":"#6897bb","data-type-long-color":"#6897bb","data-type-float-color":"#6897bb","data-type-double-color":"#6897bb","data-type-short-color":"#6897bb","data-type-number-color":"#6897bb","data-type-boolean-color":"#cc7832","data-type-class-color":"#9876aa","data-type-key-color":"#FF8E8E","run-log-background-color":"#2b2b2b","log-level-info":"#ABC023","log-level-error":"#CC666E","log-level-debug":"#299999","log-level-warn":"unset","log-level-trace":"#5394EC","log-color-cyan":"#009191","log-color-link":"#287BDE","todo-color":"#A8C023","debug-line-background-color":"#2D6099","breakpoints-background-color":"#C75450","breakpoint-line-background-color":"#3a2323","select-inputable-background-color":"#45494a","select-inputable-border":"transparent","tab-selected-background-color":"#4E5254","message-em-color":"#68dd9a","checkbox-background-color":"#43494A","checkbox-border-color":"#6B6B6B","checkbox-text-color":"#bbb","checkbox-selected-background-color":"#43494A","checkbox-selected-border-color":"#6B6B6B","toolbox-list-label-color":"#bbb","toolbox-list-span-color":"#787878","toolbox-border-color":"#323232","toolbox-list-hover-background":"#0D293E","toolbox-border-right-color":"#555555","footer-border-color":"#323232","tab-bar-border-color":"#323232","dialog-border-color":"#282828","dialog-shadow-color":"#151515","table-col-border-color":"#333638","table-row-border-color":"#333638","table-hover-background":"#4B6EAF","debug-line-background":"#2D6099","breakpoints-background":"#C75450","breakpoint-line-background":"#3a2323","table-even-background":"#414547","button-disabled-background":"#5A5A5A","toolbox-list-header-icon-color":"#AFB1B3","log-error-color":"#CC666E","text-string-color":"#6A8759","text-number-color":"#6897BB","text-boolean-color":"#CC7832","text-property-color":"#9876aa","text-key-color":"#9876aa","suggest-hover-background":"#113A5C","suggest-hover-color":"#fff","statusbar-em-color":"#68dd9a"}};const Kt={},un=(e,t)=>{t=t||{};let n=t.editor||{};n.base=n.base||"vs",n.inherit=n.inherit===void 0?!0:n.inherit,n.rules=n.rules||[],n.colors=n.colors||[],Be.defineTheme(e,n),Kt[e]=t.styles||{}};function Ae(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}Ae.prototype.clone_empty=function(){var e=new Ae(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e};Ae.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]};Ae.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1};Ae.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))};Ae.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)};Ae.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count};Ae.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,e.__items[0]===" "&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1};Ae.prototype.is_empty=function(){return this.__items.length===0};Ae.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]};Ae.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf(` `);t!==-1?this.__character_count=e.length-t:this.__character_count+=e.length};Ae.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e};Ae.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)};Ae.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)};Ae.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1};Ae.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e};function jt(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}jt.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t,n};jt.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t],n};jt.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()};jt.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(t=Math.floor(e/this.__indent_size),e-=t*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)};function Ie(e,t){this.__indent_cache=new jt(e,t),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new Ae(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}Ie.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)};Ie.prototype.get_line_number=function(){return this.__lines.length};Ie.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)};Ie.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)};Ie.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()};Ie.prototype.add_new_line=function(e){return this.is_empty()||!e&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)};Ie.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&(t[t.length-1]===` `&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(` `);return e===`\r `?n=n.replace(/([^\r])\n/g,`$1${e}`):e!==` `&&(n=n.replace(/[\n]/g,e)),n};Ie.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()};Ie.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)};Ie.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null};Ie.prototype.just_added_newline=function(){return this.current_line.is_empty()};Ie.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()};Ie.prototype.ensure_empty_line_above=function(e,t){for(var n=this.__lines.length-2;n>=0;){var a=this.__lines[n];if(a.is_empty())break;if(a.item(0).indexOf(e)!==0&&a.item(-1)!==t){this.__lines.splice(n+1,0,new Ae(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}};function Un(e,t,n,a){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}var Us="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",Ta="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",$n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",Sa="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",$s="(?:\\\\u[0-9a-fA-F]{4}|["+Us+$n+"])",Bs="(?:\\\\u[0-9a-fA-F]{4}|["+Ta+$n+Sa+"])*";const Oa=new RegExp($s+Bs,"g"),Fs=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+Ta+$n+Sa+"])+"),Vt=/[\n\r\u2028\u2029]/,Ft=new RegExp(`\r |`+Vt.source),Gt=new RegExp(Ft.source,"g");function nt(e,t){this.raw_options=Hs(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}nt.prototype._get_array=function(e,t){var n=this.raw_options[e],a=t||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(a=n.concat()):typeof n=="string"&&(a=n.split(/[^a-zA-Z0-9_/-]+/)),a};nt.prototype._get_boolean=function(e,t){var n=this.raw_options[e],a=n===void 0?!!t:!!n;return a};nt.prototype._get_characters=function(e,t){var n=this.raw_options[e],a=t||"";return typeof n=="string"&&(a=n.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),a};nt.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var a=parseInt(n,10);return isNaN(a)&&(a=t),a};nt.prototype._get_selection=function(e,t,n){var a=this._get_selection_list(e,t,n);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+e+`' can only be one of the following values: `+t+` You passed in: '`+this.raw_options[e]+"'");return a[0]};nt.prototype._get_selection_list=function(e,t,n){if(!t||t.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var a=this._get_array(e,n);if(!this._is_valid_selection(a,t))throw new Error("Invalid Option Value: The option '"+e+`' can contain only the following values: `+t+` You passed in: '`+this.raw_options[e]+"'");return a};nt.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some(function(n){return t.indexOf(n)===-1})};function Hs(e,t){var n={};e=js(e);var a;for(a in e)a!==t&&(n[a]=e[a]);if(t&&e[t])for(a in e[t])n[a]=e[t][a];return n}function js(e){var t={},n;for(n in e){var a=n.replace(/-/g,"_");t[a]=e[n]}return t}var Vs=["before-newline","after-newline","preserve-newline"];function xa(e){nt.call(this,e,"js");var t=this.raw_options.brace_style||null;t==="expand-strict"?this.raw_options.brace_style="expand":t==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a0&&(this.__position-=1)};Ce.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e};function Ze(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}Ze.prototype.restart=function(){this.__position=0};Ze.prototype.isEmpty=function(){return this.__tokens_length===0};Ze.prototype.hasNext=function(){return this.__position=0&&e/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}Ye.prototype=new De;Ye.prototype._create=function(){return new Ye(this._input,this)};Ye.prototype._update=function(){this.__set_templated_pattern()};Ye.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t};Ye.prototype.read_options=function(e){var t=this._create();for(var n in gn)t._disabled[n]=e.templating.indexOf(n)===-1;return t._update(),t};Ye.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t};Ye.prototype.read=function(){var e="";this._match_pattern?e=this._input.read(this._starting_pattern):e=this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e};Ye.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")};Ye.prototype._read_template=function(){var e="",t=this._input.peek();if(t==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(e=e||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(e=e||this.__patterns.erb.read())}else t==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(e=e||this.__patterns.handlebars_comment.read(),e=e||this.__patterns.handlebars_unescaped.read(),e=e||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=e||this.__patterns.django_comment.read(),e=e||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=e||this.__patterns.smarty_comment.read(),e=e||this.__patterns.smarty_literal.read(),e=e||this.__patterns.smarty.read()));return e};function pn(e,t){return t.indexOf(e)!==-1}const x={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:pt.START,RAW:pt.RAW,EOF:pt.EOF};var Qn=new Bn(/\/\*/,/\*\//),Gs=/0[xX][0123456789abcdefABCDEF_]*[mMdDlLfFsSbB]?|0[oO][01234567_]*[mMdDlLfFsSbB]?|0[bB][01_]*[mMdDlLfFsSbB]?|\d[\d_]*[mMdDlLfFsSbB]|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,zs=/[0-9]/,Ys=/[^\d.]/;const Lt=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" ");var _t=">>>= ... >>= <<= === >>> !== **= => -> ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_t=_t.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&");_t="\\?\\.(?!\\d) "+_t;_t=_t.replace(/ /g,"|");var qs=new RegExp(_t);const Tt="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var Ks=Tt.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),Ws=new RegExp("^(?:"+Ks.join("|")+")$"),Wt;const Le=function(e,t){qe.call(this,e,t),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new De(this._input),a=new Ye(this._input).read_options(this._options);this.__patterns={template:a,identifier:a.starting_with(Oa).matching(Fs),number:n.matching(Gs),punct:n.matching(qs),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(Ft),shebang:n.starting_with(/#!/).until_after(Ft),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:a.until(/['\\\n\r\u2028\u2029]/),double_quote:a.until(/["\\\n\r\u2028\u2029]/),template_text:a.until(/[`\\$]/),template_expression:a.until(/[`}\\]/)}};Le.prototype=new qe;Le.prototype._is_comment=function(e){return e.type===x.COMMENT||e.type===x.BLOCK_COMMENT||e.type===x.UNKNOWN};Le.prototype._is_opening=function(e){return e.type===x.START_BLOCK||e.type===x.START_EXPR};Le.prototype._is_closing=function(e,t){return(e.type===x.END_BLOCK||e.type===x.END_EXPR)&&t&&(e.text==="]"&&t.text==="["||e.text===")"&&t.text==="("||e.text==="}"&&t.text==="{")};Le.prototype._reset=function(){Wt=!1};Le.prototype._get_next_token=function(e){var t=null;this._readWhitespace();var n=this._input.peek();return n===null?this._create_token(x.EOF,""):(t=t||this._read_non_javascript(n),t=t||this._read_multi_string(n),t=t||this._read_string(n),t=t||this._read_word(e),t=t||this._read_singles(n),t=t||this._read_comment(n),t=t||this._read_regexp(n,e),t=t||this._read_xml(n,e),t=t||this._read_punctuation(),t=t||this._create_token(x.UNKNOWN,this._input.next()),t)};Le.prototype._read_word=function(e){var t;if(t=this.__patterns.identifier.read(),t!=="")return t=t.replace(Gt,` `),!(e.type===x.DOT||e.type===x.RESERVED&&(e.text==="set"||e.text==="get"))&&Ws.test(t)?t==="in"||t==="of"?this._create_token(x.OPERATOR,t):this._create_token(x.RESERVED,t):this._create_token(x.WORD,t);if(t=this.__patterns.number.read(),t!=="")return this._create_token(x.WORD,t)};Le.prototype._read_singles=function(e){var t=null;return e==="("||e==="["?t=this._create_token(x.START_EXPR,e):e===")"||e==="]"?t=this._create_token(x.END_EXPR,e):e==="{"?t=this._create_token(x.START_BLOCK,e):e==="}"?t=this._create_token(x.END_BLOCK,e):e===";"?t=this._create_token(x.SEMICOLON,e):e==="."&&Ys.test(this._input.peek(1))?t=this._create_token(x.DOT,e):e===","&&(t=this._create_token(x.COMMA,e)),t&&this._input.next(),t};Le.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(e!=="")return e==="="?this._create_token(x.EQUALS,e):e==="?."?this._create_token(x.DOT,e):this._create_token(x.OPERATOR,e)};Le.prototype._read_non_javascript=function(e){var t="";if(e==="#"){if(this._is_first_token()&&(t=this.__patterns.shebang.read(),t))return this._create_token(x.UNKNOWN,t.trim()+` `);if(t=this.__patterns.include.read(),t)return this._create_token(x.UNKNOWN,t.trim()+` `);e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(zs)){do e=this._input.next(),n+=e;while(this._input.hasNext()&&e!=="#"&&e!=="=");return e==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(n+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(n+="{}",this._input.next(),this._input.next())),this._create_token(x.WORD,n)}this._input.back()}else if(e==="<"&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read(),t){for(;this._input.hasNext()&&!this._input.testChar(Vt);)t+=this._input.next();return Wt=!0,this._create_token(x.COMMENT,t)}}else if(Wt&&e==="-"&&(t=this.__patterns.html_comment_end.read(),t))return Wt=!1,this._create_token(x.COMMENT,t);return null};Le.prototype._read_comment=function(e){var t=null;if(e==="/"){var n="";if(this._input.peek(1)==="*"){n=this.__patterns.block_comment.read();var a=Qn.get_directives(n);a&&a.ignore==="start"&&(n+=Qn.readIgnored(this._input)),n=n.replace(Gt,` `),t=this._create_token(x.BLOCK_COMMENT,n),t.directives=a}else this._input.peek(1)==="/"&&(n=this.__patterns.comment.read(),t=this._create_token(x.COMMENT,n))}return t};Le.prototype._read_multi_string=function(){if(this._input.match(/"""/g)){let e=this._input.readUntilAfter(/"""/g);return this._create_token(x.STRING,'"""'+e)}return null};Le.prototype._read_string=function(e){if(e==="`"||e==="'"||e==='"'){var t=this._input.next();return this.has_char_escapes=!1,e==="`"?t+=this._read_string_recursive("`",!0,"${"):t+=this._read_string_recursive(e),this.has_char_escapes&&this._options.unescape_strings&&(t=Xs(t)),this._input.peek()===e&&(t+=this._input.next()),t=t.replace(Gt,` `),this._create_token(x.STRING,t)}return null};Le.prototype._allow_regexp_or_xml=function(e){return e.type===x.RESERVED&&pn(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===x.END_EXPR&&e.text===")"&&e.opened.previous.type===x.RESERVED&&pn(e.opened.previous.text,["if","while","for"])||pn(e.type,[x.COMMENT,x.START_EXPR,x.START_BLOCK,x.START,x.END_BLOCK,x.OPERATOR,x.EQUALS,x.EOF,x.SEMICOLON,x.COMMA])};Le.prototype._read_regexp=function(e,t){if(e==="/"&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),a=!1,s=!1;this._input.hasNext()&&(a||s||this._input.peek()!==e)&&!this._input.testChar(Vt);)n+=this._input.peek(),a?a=!1:(a=this._input.peek()==="\\",this._input.peek()==="["?s=!0:this._input.peek()==="]"&&(s=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(Oa)),this._create_token(x.STRING,n)}return null};Le.prototype._read_xml=function(e,t){if(this._options.e4x&&e==="<"&&this._allow_regexp_or_xml(t)){var n="",a=this.__patterns.xml.read_match();if(a){for(var s=a[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),i=s.indexOf("{")===0,o=0;a;){var r=!!a[1],l=a[2],u=!!a[a.length-1]||l.slice(0,8)==="![CDATA[";if(!u&&(l===s||i&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(r?--o:++o),n+=a[0],o<=0)break;a=this.__patterns.xml.read_match()}return a||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(Gt,` `),this._create_token(x.STRING,n)}}return null};function Xs(e){for(var t="",n=0,a=new Ce(e),s=null;a.hasNext();)if(s=a.match(/([\s]|[^\\]|\\\\)+/g),s&&(t+=s[0]),a.peek()==="\\"){if(a.next(),a.peek()==="x")s=a.match(/x([0-9A-Fa-f]{2})/g);else if(a.peek()==="u")s=a.match(/u([0-9A-Fa-f]{4})/g);else{t+="\\",a.hasNext()&&(t+=a.next());continue}if(!s||(n=parseInt(s[1],16),n>126&&n<=255&&s[0].indexOf("x")===0))return e;if(n>=0&&n<32){t+="\\"+s[0];continue}else n===34||n===39||n===92?t+="\\"+String.fromCharCode(n):t+=String.fromCharCode(n)}return t}Le.prototype._read_string_recursive=function(e,t,n){var a,s;e==="'"?s=this.__patterns.single_quote:e==='"'?s=this.__patterns.double_quote:e==="`"?s=this.__patterns.template_text:e==="}"&&(s=this.__patterns.template_expression);for(var i=s.read(),o="";this._input.hasNext();){if(o=this._input.next(),o===e||!t&&Vt.test(o)){this._input.back();break}else o==="\\"&&this._input.hasNext()?(a=this._input.peek(),a==="x"||a==="u"?this.has_char_escapes=!0:a==="\r"&&this._input.peek(1)===` `&&this._input.next(),o+=this._input.next()):n&&(n==="${"&&o==="$"&&this._input.peek()==="{"&&(o+=this._input.next()),n===o&&(e==="`"?o+=this._read_string_recursive("}",t,"`"):o+=this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(o+=this._input.next())));o+=s.read(),i+=o}return i};function ae(e,t){return t.indexOf(e)!==-1}function Js(e){return e.replace(/^\s+/g,"")}function Qs(e){for(var t={},n=0;nn&&(n=e.line_indent_level));var a={mode:t,parent:e,last_token:e?e.last_token:new Un(x.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:n,alignment:0,line_indent_level:e?e.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0};return a};oe.prototype._reset=function(e){var t=e.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new Ie(this._options,t),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(K.BlockStatement);var n=new Le(e,this._options);return this._tokens=n.tokenize(),e};oe.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e,t=this._reset(this._source_text),n=this._options.eol;this._options.eol==="auto"&&(n=` `,t&&Ft.test(t||"")&&(n=t.match(Ft)[0]));for(var a=this._tokens.next();a;)this.handle_token(a),this._last_last_text=this._flags.last_token.text,this._flags.last_token=a,a=this._tokens.next();return e=this._output.get_code(n),e};oe.prototype.handle_token=function(e,t){e.type===x.START_EXPR?this.handle_start_expr(e):e.type===x.END_EXPR?this.handle_end_expr(e):e.type===x.START_BLOCK?this.handle_start_block(e):e.type===x.END_BLOCK?this.handle_end_block(e):e.type===x.WORD?this.handle_word(e):e.type===x.RESERVED?this.handle_word(e):e.type===x.SEMICOLON?this.handle_semicolon(e):e.type===x.STRING?this.handle_string(e):e.type===x.EQUALS?this.handle_equals(e):e.type===x.OPERATOR?this.handle_operator(e):e.type===x.COMMA?this.handle_comma(e):e.type===x.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===x.COMMENT?this.handle_comment(e,t):e.type===x.DOT?this.handle_dot(e):e.type===x.EOF?this.handle_eof(e):e.type===x.UNKNOWN?this.handle_unknown(e,t):this.handle_unknown(e,t)};oe.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,a=this._options.keep_array_indentation&<(this._flags.mode);if(e.comments_before)for(var s=e.comments_before.next();s;)this.handle_whitespace_and_comments(s,t),this.handle_token(s,t),s=e.comments_before.next();if(a)for(var i=0;i0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var o=1;o0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};oe.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)};oe.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===K.Statement&&Ia(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))};oe.prototype.start_of_object_property=function(){return this._flags.parent.mode===K.ObjectLiteral&&this._flags.mode===K.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||de(this._flags.last_token,["get","set"]))};oe.prototype.start_of_statement=function(e){var t=!1;return t=t||de(this._flags.last_token,["var","let","const"])&&e.type===x.WORD,t=t||Ve(this._flags.last_token,"do"),t=t||!(this._flags.parent.mode===K.ObjectLiteral&&this._flags.mode===K.Statement)&&de(this._flags.last_token,Fn)&&!e.newlines,t=t||Ve(this._flags.last_token,"else")&&!(Ve(e,"if")&&!e.comments_before),t=t||this._flags.last_token.type===x.END_EXPR&&(this._previous_flags.mode===K.ForInitializer||this._previous_flags.mode===K.Conditional),t=t||this._flags.last_token.type===x.WORD&&this._flags.mode===K.BlockStatement&&!this._flags.in_case&&!(e.text==="--"||e.text==="++")&&this._last_last_text!=="function"&&e.type!==x.WORD&&e.type!==x.RESERVED,t=t||this._flags.mode===K.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||de(this._flags.last_token,["get","set"])),t?(this.set_mode(K.Statement),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,de(e,["do","for","if","while"])),!0):!1};oe.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=K.Expression;if(e.text==="["){if(this._flags.last_token.type===x.WORD||this._flags.last_token.text===")"){de(this._flags.last_token,Tt)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}t=K.ArrayLiteral,lt(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),ae(this._flags.last_token.type,[x.START_EXPR,x.END_EXPR,x.WORD,x.OPERATOR,x.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===x.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,t=K.ForInitializer):ae(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=K.Conditional):ae(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&e.whitespace_before===""?this._output.space_before_token=!1:(ae(this._flags.last_token.text,Tt)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===x.EQUALS||this._flags.last_token.type===x.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===x.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var a=this._tokens.peek(-4);de(n,["async","function"])||n.text==="*"&&de(a,["async","function"])?this._output.space_before_token=!0:this._flags.mode===K.ObjectLiteral&&(n.text==="{"||n.text===","||n.text==="*"&&(a.text==="{"||a.text===","))&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===x.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(ae(this._last_last_text,["function","yield"])||this._flags.mode===K.ObjectLiteral&&ae(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===x.START_BLOCK?this.print_newline():(this._flags.last_token.type===x.END_EXPR||this._flags.last_token.type===x.START_EXPR||this._flags.last_token.type===x.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===x.COMMA)&&this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()};oe.prototype.handle_end_expr=function(e){for(;this._flags.mode===K.Statement;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,e.text==="]"&<(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===x.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(e),this.restore_mode(),Ia(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===K.Conditional&&(this._previous_flags.mode=K.Expression,this._flags.do_block=!1,this._flags.do_while=!1)};oe.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===x.END_EXPR?(this.set_mode(K.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(K.BlockStatement):n&&(ae(n.text,[":",","])&&ae(t.type,[x.STRING,x.WORD,x.RESERVED])||ae(t.text,["get","set","..."])&&ae(n.type,[x.WORD,x.RESERVED]))?ae(this._last_last_text,["class","interface"])?this.set_mode(K.BlockStatement):this.set_mode(K.ObjectLiteral):this._flags.last_token.type===x.OPERATOR&&(this._flags.last_token.text==="=>"||this._flags.last_token.text==="->")?this.set_mode(K.BlockStatement):ae(this._flags.last_token.type,[x.EQUALS,x.START_EXPR,x.COMMA,x.OPERATOR])||de(this._flags.last_token,["return","throw","import","default"])?this.set_mode(K.ObjectLiteral):this.set_mode(K.BlockStatement);var a=!t.comments_before&&t.text==="}",s=a&&this._flags.last_word==="function"&&this._flags.last_token.type===x.END_EXPR;if(this._options.brace_preserve_inline){var i=0,o=null;this._flags.inline_frame=!0;do if(i+=1,o=this._tokens.peek(i-1),o.newlines){this._flags.inline_frame=!1;break}while(o.type!==x.EOF&&!(o.type===x.END_BLOCK&&o.opened===e))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==x.OPERATOR&&(s||this._flags.last_token.type===x.EQUALS||de(this._flags.last_token,nn)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(lt(this._previous_flags.mode)&&(this._flags.last_token.type===x.START_EXPR||this._flags.last_token.type===x.COMMA)&&((this._flags.last_token.type===x.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===x.COMMA||this._flags.last_token.type===x.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==x.OPERATOR&&this._flags.last_token.type!==x.START_EXPR&&(this._flags.last_token.type===x.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(e),this.indent(),!a&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()};oe.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===K.Statement;)this.restore_mode();var t=this._flags.last_token.type===x.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:this._options.brace_style==="expand"?t||this.print_newline():t||(lt(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)};oe.prototype.handle_word=function(e){if(e.type===x.RESERVED){if(ae(e.text,["set","get"])&&this._flags.mode!==K.ObjectLiteral)e.type=x.WORD;else if(e.text==="import"&&this._tokens.peek().text==="(")e.type=x.WORD;else if(ae(e.text,["as","from"])&&!this._flags.import_block)e.type=x.WORD;else if(this._flags.mode===K.ObjectLiteral){var t=this._tokens.peek();t.text===":"&&(e.type=x.WORD)}}if(this.start_of_statement(e)?de(this._flags.last_token,["var","let","const"])&&e.type===x.WORD&&(this._flags.declaration_statement=!0):e.newlines&&!Pt(this._flags.mode)&&(this._flags.last_token.type!==x.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==x.EQUALS&&(this._options.preserve_newlines||!de(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(e),this.print_newline()):this.handle_whitespace_and_comments(e),this._flags.do_block&&!this._flags.do_while)if(Ve(e,"while")){this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&Ve(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===K.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&de(e,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(e),this._flags.in_case=!0;return}if((this._flags.last_token.type===x.COMMA||this._flags.last_token.type===x.START_EXPR||this._flags.last_token.type===x.EQUALS||this._flags.last_token.type===x.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e)),Ve(e,"function")){(ae(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(ae(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===x.OPERATOR))&&!this._output.just_added_blankline()&&!e.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===x.RESERVED||this._flags.last_token.type===x.WORD?de(this._flags.last_token,["get","set","new","export"])||de(this._flags.last_token,Fn)?this._output.space_before_token=!0:Ve(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===x.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(Pt(this._flags.mode)||lt(this._flags.mode))||this.print_newline(),this.print_token(e),this._flags.last_word=e.text;return}var n="NONE";if(this._flags.last_token.type===x.END_BLOCK?this._previous_flags.inline_frame?n="SPACE":de(e,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&e.newlines?n="NEWLINE":(n="SPACE",this._output.space_before_token=!0):n="NEWLINE":this._flags.last_token.type===x.SEMICOLON&&this._flags.mode===K.BlockStatement?n="NEWLINE":this._flags.last_token.type===x.SEMICOLON&&Pt(this._flags.mode)||this._flags.last_token.type===x.STRING||this._flags.last_token.type===x.RESERVED||this._flags.last_token.type===x.WORD||this._flags.last_token.text==="*"&&(ae(this._last_last_text,["function","yield"])||this._flags.mode===K.ObjectLiteral&&ae(this._last_last_text,["{",","]))?n="SPACE":this._flags.last_token.type===x.START_BLOCK?this._flags.inline_frame?n="SPACE":n="NEWLINE":this._flags.last_token.type===x.END_EXPR&&(this._output.space_before_token=!0,n="NEWLINE"),de(e,Tt)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?n="SPACE":n="NEWLINE"),de(e,["else","catch","finally"]))if((!(this._flags.last_token.type===x.END_BLOCK&&this._previous_flags.mode===K.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&e.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var a=this._output.current_line;a.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else n==="NEWLINE"?de(this._flags.last_token,nn)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&de(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==x.END_EXPR?(this._flags.last_token.type!==x.START_EXPR||!de(e,["var","let","const"]))&&this._flags.last_token.text!==":"&&(Ve(e,"if")&&Ve(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):de(e,Tt)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&<(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():n==="SPACE"&&(this._output.space_before_token=!0);e.previous&&(e.previous.type===x.WORD||e.previous.type===x.RESERVED)&&(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===x.RESERVED&&(e.text==="do"?this._flags.do_block=!0:e.text==="if"?this._flags.if_block=!0:e.text==="import"?this._flags.import_block=!0:this._flags.import_block&&Ve(e,"from")&&(this._flags.import_block=!1))};oe.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();this._flags.mode===K.Statement&&!(this._flags.if_block&&Ve(t,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)};oe.prototype.handle_string=function(e){e.text.startsWith("`")&&e.newlines===0&&e.whitespace_before===""&&(e.previous.text===")"||this._flags.last_token.type===x.WORD)||(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===x.RESERVED||this._flags.last_token.type===x.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===x.COMMA||this._flags.last_token.type===x.START_EXPR||this._flags.last_token.type===x.EQUALS||this._flags.last_token.type===x.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):e.text.startsWith("`")&&this._flags.last_token.type===x.END_EXPR&&(e.previous.text==="]"||e.previous.text===")")&&e.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(e)};oe.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0};oe.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(Pt(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===K.ObjectLiteral||this._flags.mode===K.Statement&&this._flags.parent.mode===K.ObjectLiteral?(this._flags.mode===K.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)};oe.prototype.handle_operator=function(e){var t=e.text==="*"&&(de(this._flags.last_token,["function","yield"])||ae(this._flags.last_token.type,[x.START_BLOCK,x.COMMA,x.END_BLOCK,x.SEMICOLON])),n=ae(e.text,["-","+"])&&(ae(this._flags.last_token.type,[x.START_BLOCK,x.START_EXPR,x.EQUALS,x.OPERATOR])||ae(this._flags.last_token.text,Tt)||this._flags.last_token.text===",");if(!this.start_of_statement(e)){var a=!t;this.handle_whitespace_and_comments(e,a)}if(de(this._flags.last_token,nn)){this._output.space_before_token=!0,this.print_token(e);return}if(e.text==="*"&&this._flags.last_token.type===x.DOT){this.print_token(e);return}if(e.text==="::"){this.print_token(e);return}if(this._flags.last_token.type===x.OPERATOR&&ae(this._options.operator_position,Aa)&&this.allow_wrap_or_preserved_newline(e),e.text===":"&&this._flags.in_case){this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==x.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var s=!0,i=!0,o=!1;if(e.text===":"?this._flags.ternary_depth===0?s=!1:(this._flags.ternary_depth-=1,o=!0):e.text==="?"&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&ae(e.text,Lt)){var r=e.text===":",l=r&&o,u=r&&!o;switch(this._options.operator_position){case Mt.before_newline:this._output.space_before_token=!u,this.print_token(e),(!r||l)&&this.allow_wrap_or_preserved_newline(e),this._output.space_before_token=!0;return;case Mt.after_newline:this._output.space_before_token=!0,!r||l?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),this._output.space_before_token=!0;return;case Mt.preserve_newline:u||this.allow_wrap_or_preserved_newline(e),s=!(this._output.just_added_newline()||u),this._output.space_before_token=s,this.print_token(e),this._output.space_before_token=!0;return}}if(t){this.allow_wrap_or_preserved_newline(e),s=!1;var p=this._tokens.peek();i=p&&ae(p.type,[x.WORD,x.RESERVED])}else e.text==="..."?(this.allow_wrap_or_preserved_newline(e),s=this._flags.last_token.type===x.START_BLOCK,i=!1):(ae(e.text,["--","++","!","~"])||n)&&((this._flags.last_token.type===x.COMMA||this._flags.last_token.type===x.START_EXPR)&&this.allow_wrap_or_preserved_newline(e),s=!1,i=!1,e.newlines&&(e.text==="--"||e.text==="++"||e.text==="~")&&this.print_newline(!1,!0),this._flags.last_token.text===";"&&Pt(this._flags.mode)&&(s=!0),this._flags.last_token.type===x.RESERVED?s=!0:this._flags.last_token.type===x.END_EXPR?s=!(this._flags.last_token.text==="]"&&(e.text==="--"||e.text==="++")):this._flags.last_token.type===x.OPERATOR&&(s=ae(e.text,["--","-","++","+"])&&ae(this._flags.last_token.text,["--","-","++","+"]),ae(e.text,["+","-"])&&ae(this._flags.last_token.text,["--","++"])&&(i=!0)),(this._flags.mode===K.BlockStatement&&!this._flags.inline_frame||this._flags.mode===K.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline());this._output.space_before_token=this._output.space_before_token||s,this.print_token(e),this._output.space_before_token=i};oe.prototype.handle_block_comment=function(e,t){if(this._output.raw){this._output.add_raw_token(e),e.directives&&e.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(e.directives){this.print_newline(!1,t),this.print_token(e),e.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!Vt.test(e.text)&&!e.newlines){this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0;return}else this.print_block_commment(e,t)};oe.prototype.print_block_commment=function(e,t){var n=ei(e.text),a,s=!1,i=!1,o=e.whitespace_before,r=o.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(n[0]),this.print_newline(!1,t),n.length>1){for(n=n.slice(1),s=ti(n,"*"),i=ni(n,o),s&&(this._flags.alignment=1),a=0;a0&&n){let s=function(r,l){return r[n].localeCompare(l[n],"zh-CN")},i=[],o=[];e.forEach(r=>{r.folder===!0?(a&&(r[a]=Nt(r[a],t,n,a)),i.push(r)):o.push(r)}),i.sort(s),o.sort(s),t===!1&&(i.reverse(),o.reverse()),e.splice(0,e.length,...i.concat(o))}return e}function ai(e){return Array(e).fill(0).map(()=>(Math.random()*16|0).toString(16)).join("")}function vt(e,t){return t=t||2,(Array(t).join(0)+e).slice(-t)}function We(e){if(typeof e=="number"&&(e.toString().length===13?e=new Date(e):e=new Date(e*1e3)),e instanceof Date){var t=e.getMonth()+1,n=e.getDate(),a=e.getHours(),s=e.getMinutes(),i=e.getSeconds();return e.getFullYear()+"-"+vt(t)+"-"+vt(n)+" "+vt(a)+":"+vt(s)+":"+vt(i)}return""}function it(e){return e.replace(/:?\/+/g,t=>t.indexOf(":")>-1?t:"/")}function si(e){const t=s=>{if(Array.isArray(s)){let i=s.length,o=100;if(i>o){let r=[];for(let l=0;la(""+(l+p),void 0,JSON.stringify(u),u))});return r}return s.map((r,l)=>a(""+l,void 0,JSON.stringify(r),r))}else return Object.keys(s).map(i=>{const o=s[i];return a(i,void 0,JSON.stringify(o),o)})},n=s=>{try{return JSON.parse(s)}catch{return s}},a=(s,i,o,r)=>{var y;let l=(i||"").startsWith("java.lang"),u,p,m;l?(u=((y=i==null?void 0:i.substring(10))==null?void 0:y.toLowerCase())||typeof r,["integer","double","float","byte","short","long"].indexOf(u)>-1&&(u="number"),u==="class"&&(o=o.substring(1,o.length-1))):(r=r||o&&n(o),!Array.isArray(r)&&typeof r!="object"?(l=!0,u=typeof r):(Array.isArray(r)?(m=`size = ${r.length}`,u="array"):(m=`members = ${r&&Object.keys(r).length}`,u="object"),i=i||(Array.isArray(r)?"Array":typeof r),p=r&&t(r)||[]));let f=r==null&&!l;return f&&(i="null",l=!0,o="null"),{name:s,value:o,data:r,dataType:u,type:i,size:m,isNull:f,folder:!l,opened:!1,children:p}};return e&&e.map(s=>a(s.name,s.type,s.value))||[]}function ii(e){const t=["B","KB","MB"];let n=0;for(;n=1024;)e=e/1024,n++;return e=e.toFixed(2),`${e} ${t[n]}`}function et(e,t){const n=a=>a.filter(s=>s.folder).forEach(s=>{n(s.children||[]),t(s)});n(e||[])}function Hn(e,t){let n=document.createElement("a"),a=window.URL.createObjectURL(e);n.href=a,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(a)}function Zn(e){try{var t=document.createElement("textarea");return t.style="position:absolute;left:-99999999px",document.body.appendChild(t),t.innerHTML=e,t.readOnly=!1,t.select(),document.execCommand("copy"),!0}catch{return!1}}function oi(e){let t=0;for(let n=0,a=0,s=e.length;n{const o={level:i,node:s,name:i===0?c("message.root"):s.name,folder:(s==null?void 0:s.dataType)==="Object"||(s==null?void 0:s.dataType)==="Array",display:!0};o.folder&&(o.expand=!0),t.push(o)},a=(s,i)=>{(s||[]).forEach(o=>{n(o,i),a(o.children,i+1)})};return n(e||{},0),a((e==null?void 0:e.children)||[],1),t}function ri(e){return new Promise((t,n)=>{const a=document.getElementsByTagName("head")[0],s=document.createElement("script");s.setAttribute("type","text/javascript"),s.src=e,a.appendChild(s),s.readyState?s.onreadystatechange=()=>{(s.readyState==="loaded"||s.readyState==="complete")&&(s.onreadystatechange=null,t())}:(s.onload=function(){t()},s.onerror=function(){n()})})}function ea(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function li(e,t){if(e){if(typeof e=="string")return new oe(e).beautify();if(e)return JSON.stringify(e,null,4)}return t||""}class ci{constructor(){this.listeners={},this.statusLog=U([])}$on(t,n){this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(n)}$event(t,n){this.$on(`ws_${t}`,n)}$emit(t){const n=this.listeners[t];if(n){const i=[];for(var a=1,s=arguments.length;ao.apply(this,i))}}loading(t){const n=ea(1,9),a=new Image;return a.src=`https://console.ssssssss.org.cn/images/loading.gif?t=${Math.floor(new Date().getTime()/1e3)*1e3+n*100+(t+n)+ea(0,5)*17}`,a}send(t,n){this.$emit("message",t,n)}status(t,n,...a){const s=new Date;t=c(t,...a)||t,n===!1&&(t=`${t}`),this.statusLog.value.push({content:t,timestamp:We(s)+"."+vt(s.getMilliseconds(),3)}),this.$emit("status",t)}clearStatusLog(){this.statusLog.value=[]}getStatusLog(){return this.statusLog}}var S=new ci;const vn={escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,builtinFunctions:[],digits:/[0-9_]+/,binarydigits:/[0-1_]+/,hexdigits:/[[0-9a-fA-F_]+/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/\s+/,"white"],[/```$/,{token:"string",next:"@codeblock"}],[/[a-zA-Z_$][\w$]*[\s]?/,{cases:{"@builtinFunctions":"predefined","~(new|var|if|else|for|in|return|import|break|continue|as|null|true|false|try|catch|finally|async|while|exit|asc|desc|ASC|DESC|assert|let|const|throw|instanceof)[\\s]?":{token:"keywords"},"~(select|from|left|join|on|and|or|order|by|where|group|having|limit|offset|SELECT|FROM|LEFT|JOIN|ON|AND|OR|ORDER|BY|WHERE|GROUP|HAVING|LIMIT|OFFSET)[\\s]{1}":{token:"keywords"},"@default":"identifier"}}],[/::[a-zA-Z]+/,"keywords"],[/[{}()[\]]/,"@brackets"],[/(@digits)\.(@digits)/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)[lLbBsSdDfFmM]?/,"number"],[/\/\*\**/,"comment","@comment"],[/\/\//,"comment","@commentTodo"],[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[;,.]/,"delimiter"],[/"""/,{token:"string",next:"@string_multi_embedded",nextEmbedded:"mybatis"}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],comment:[[/\*\//,"comment","@popall"],[/\S((TODO)|(todo)|(fixme)|(FIXME))\s+/,"comment"],[/((TODO)|(todo)|(fixme)|(FIXME))\s+[^(*/)]+/,"comment.todo"],[/\S/,"comment"]],commentTodo:[[/^/,"","@popall"],[/\S((TODO)|(todo)|(fixme)|(FIXME))\s+/,"comment"],[/((TODO)|(todo)|(fixme)|(FIXME))[ \t]+[^\n]+/,"comment.todo","@popall"],[/\S/,"comment"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],codeblock:[[/^```$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_multi_embedded:[[/[^"]+/,""],['"""',{token:"string",next:"@pop",nextEmbedded:"@pop"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"root"}]}};let Qe={},jn={},Ht=[],En=[],Xt,bn;const ui=e=>e==="int"||e==="java.lang.Integer"?"java.lang.Integer":e==="string"||e==="java.lang.String"?"java.lang.String":e==="double"||e==="java.lang.Double"?"java.lang.Double":e==="float"||e==="java.lang.Float"?"java.lang.Float":e==="byte"||e==="java.lang.Byte"?"java.lang.Byte":e==="short"||e==="java.lang.Short"?"java.lang.Short":e==="long"||e==="java.lang.Long"?"java.lang.Long":e.indexOf("[]")>-1?"[Ljava.lang.Object;":e||"java.lang.Object",yn=e=>{let t=e.lastIndexOf(".");return t>-1?e.substring(t+1):e},pi=(e,t,n)=>e.length>0&&e[e.length-1].varArgs?n?e.length-1<=t.length:e.length<=t.length:n?e.length-1===t.length:e.length===t.length,di=function(){return new Promise((e,t)=>{z.sendPost("/classes").success(n=>{Qe=n.classes||{},jn=n.extensions||{},En=n.functions||[],vn.builtinFunctions=En.map(a=>a.name),W.setMonarchTokensProvider("magicscript",vn),e()}).exception(n=>{t()}).error(n=>{t()})})},_i=()=>new Promise((e,t)=>{z.execute({url:"classes.txt",responseType:"text",method:"get"}).then(n=>{const a=[];n.data.split(` `).forEach(s=>{const i=s.split(":");i.length===1?a.push(i[0].trim()):a.push(...i[1].split(",").map(o=>i[0]+"."+o.trim()))}),Ht=a,e()}).catch(n=>{t()})}),ta=(e,t)=>Array(t>(e+"").length?t-(""+e).length-1:0).join(0)+e,Ca=e=>{let t=[];return e&&(t=e.enums||[],e.superClass&&(t=t.concat(Ca(e.superClass)))),t},La=(e,t,n)=>{if(e.insertText=e.name,e.parameters.length>t){let a=[],s=[];for(let i=t;i{wt[e]=t},Tn=e=>{let t=[];if(e){if(t=e.attributes||[],e.superClass&&(t=t.concat(Tn(e.superClass))),e.interfaces&&e.interfaces.length>0)for(let n=0,a=e.interfaces.length;n{t=t||0;let n=[],a=(s,i,o)=>{if(s&&s.methods)for(let r=0,l=s.methods.length;r0)for(let s=0,i=e.interfaces.length;sjn[e],mi=e=>{if(!e)throw new Error("className is required");let t=Qe[e];if(!t){let n=Ht.findIndex(a=>a===e);t=Ht[n]}return t};async function gi(e){let t=Qe[e];if(t)t=Qe[t.className]||t;else try{(await z.execute({url:"/class",data:{className:e}})).data.data.forEach(s=>{Qe[s.className]=s}),t=Qe[e]}catch{}return t}const vi=()=>En.map(e=>La(e,0,1)),Na=()=>{if(!Xt&&M.config){let e=M.config;e.autoImportModuleList&&(Xt={},e.autoImportModuleList.forEach(n=>{Xt[n]=n}));let t=["java.util.","java.lang."].concat((e.autoImportPackage||"").replace(/\\s/g,"").replace(/\*/g,"").split(","));bn={},Ht.forEach(n=>{t.forEach(a=>{n.indexOf(a)===0&&n.indexOf(".",a.length)===-1&&(bn[n.substring(n.lastIndexOf(".")+1)]=n)})})}},Ei=()=>(Na(),Xt||{}),bi=()=>(Na(),bn||{}),yi=()=>Ht;let On;const Ti=e=>{On=e},Si=e=>On&&On(e),Oi=()=>Object.keys(Qe).filter(e=>Qe[e].module);let wa;const xi=e=>{wa=e};let ka;const Ri=e=>{ka=e},Ai=()=>wa,Ii=()=>ka,ne={findEnums:Ca,findAttributes:Tn,findMethods:Sn,findFunction:vi,loadClass:gi,findClass:mi,initClasses:di,initImportClass:_i,getWrapperClass:ui,matchTypes:pi,getAutoImportModule:Ei,getAutoImportClass:bi,getExtension:fi,getImportClass:yi,getOnlineFunction:Si,setupOnlineFunction:Ti,setExtensionAttribute:hi,getSimpleClass:yn,getDefineModules:Oi,setApiFinder:xi,setFunctionFinder:Ri,getApiFinder:Ai,getFunctionFinder:Ii};class ge extends Error{constructor(t,n){super(t);this.name="ParseException",this.span=n}}class Ci{constructor(t,n,a,s,i,o,r){this.source=t,this.start=n,this.end=a,this.lineNumber=s,this.endLineNumber=i,this.startCol=o,this.endCol=r}}class J{constructor(t,n,a){t instanceof J&&n instanceof J?(this.source=t.source,this.start=t.start,this.end=n.end,this.cachedText=this.source.substring(this.start,this.end)):(this.source=t,this.start=n||0,this.end=a||t.length,this.cachedText=t.substring(this.start,this.end))}getText(){return this.cachedText}getSource(){return this.source}getStart(){return this.start}getEnd(){return this.end}toString(){return"Span [text="+this.getText()+", start="+this.start+", end="+this.end+"]"}inPosition(t){return this.start<=t&&this.end>=t}getLine(){if(this.line!=null)return this.line;let t=this.start;for(;tthis.source.length-1||this.source.charAt(n)===` `);)n++;let a=0,s=t;for(;s>0&&s",error:">"},LessEqual:{literal:"<=",error:"<="},GreaterEqual:{literal:">=",error:">="},Equal:{literal:"==",error:"=="},NotEqual:{literal:"!=",error:"!="},Assignment:{literal:"=",error:"="},PlusPlus:{literal:"++",error:"++"},MinusMinus:{literal:"--",error:"--"},PlusEqual:{literal:"+=",error:"+="},MinusEqual:{literal:"-=",error:"-="},AsteriskEqual:{literal:"*=",error:"*="},ForwardSlashEqual:{literal:"/=",error:"/="},PercentEqual:{literal:"%=",error:"%="},ColonColon:{literal:"::",error:"::"},EqualEqualEqual:{literal:"===",error:"==="},NotEqualEqual:{literal:"!==",error:"!=="},And:{literal:"&&",error:"&&"},Or:{literal:"||",error:"||"},Xor:{literal:"^",error:"^"},Not:{literal:"!",error:"!"},BitAnd:{literal:"&",error:"&"},BitOr:{literal:"|",error:"|"},BitNot:{literal:"~",error:"~"},LShift:{literal:"<<",error:"<<"},RShift:{literal:">>",error:">>"},RShift2:{literal:">>>",error:">>>"},XorEqual:{literal:"^=",error:"^=",modifiable:!0},BitAndEqual:{literal:"&=",error:"&=",modifiable:!0},BitOrEqual:{literal:"|=",error:"|=",modifiable:!0},LShiftEqual:{literal:"<<=",error:"<<=",modifiable:!0},RShiftEqual:{literal:">>=",error:">>=",modifiable:!0},RShift2Equal:{literal:">>>=",error:">>>=",modifiable:!0},SqlAnd:{literal:"and",error:"and"},SqlOr:{literal:"or",error:"or"},SqlNotEqual:{literal:"<>",error:"<>",inLinq:!0},InstanceOf:{literal:"instanceof",error:"instanceof"},Questionmark:{literal:"?",error:"?"},DoubleQuote:{literal:'"',error:'"'},TripleQuote:{literal:'"""',error:'"""'},SingleQuote:{literal:"'",error:"'"},Lambda:{error:"=> \u6216 ->"},BooleanLiteral:{error:"true \u6216 false"},DoubleLiteral:{error:"\u4E00\u4E2A double \u7C7B\u578B\u6570\u503C"},DecimalLiteral:{error:"\u4E00\u4E2A BigDecimal \u7C7B\u578B\u6570\u503C"},FloatLiteral:{error:"\u4E00\u4E2A float \u7C7B\u578B\u6570\u503C"},LongLiteral:{error:"\u4E00\u4E2A long \u7C7B\u578B\u6570\u503C"},IntegerLiteral:{error:"\u4E00\u4E2A int \u7C7B\u578B\u6570\u503C"},ShortLiteral:{error:"\u4E00\u4E2A short \u7C7B\u578B\u6570\u503C"},ByteLiteral:{error:"\u4E00\u4E2A byte \u7C7B\u578B\u6570\u636E"},CharacterLiteral:{error:"\u4E00\u4E2A char \u7C7B\u578B\u6570\u636E"},RegexpLiteral:{error:"\u4E00\u4E2A \u6B63\u5219\u8868\u8FBE\u5F0F"},StringLiteral:{error:"\u4E00\u4E2A \u5B57\u7B26\u4E32"},NullLiteral:{error:"null"},Language:{error:"language"},Identifier:{error:"\u6807\u8BC6\u7B26"},Unknown:{error:"unknown"}};let Li=Object.getOwnPropertyNames(d).map(e=>d[e]);d.getSortedValues=function(){return this.values?this.values:(this.values=Li.sort(function(e,t){return!e.literal&&!t.literal?0:!e.literal&&!!t.literal?1:!!e.literal&&!t.literal?-1:t.literal.length-e.literal.length}),this.values)};class Ge{constructor(t,n,a){this.type=t,this.span=n,a instanceof ft?this.tokenStream=a:a&&(this.value=a)}getTokenType(){return this.type}getTokenStream(){return this.tokenStream}getSpan(){return this.span}getText(){return this.span.getText()}}class Me extends Ge{constructor(t,n,a){super(t,n,a)}getJavaType(){return this.type===d.StringLiteral?"java.lang.String":this.type===d.DoubleLiteral?"java.lang.Double":this.type===d.ByteLiteral?"java.lang.Byte":this.type===d.FloatLiteral?"java.lang.Float":this.type===d.DecimalLiteral?"java.math.BigDecimal":this.type===d.IntegerLiteral?"java.lang.Integer":this.type===d.LongLiteral?"java.lang.Long":this.type===d.BooleanLiteral?"java.lang.Boolean":this.type===d.RegexpLiteral?"java.util.regex.Pattern":"java.lang.Object"}}class Ni{constructor(t,n,a){this.index=n===void 0?0:n,this.end=a===void 0?t.length:a,this.source=t,this.spanStart=0}hasMore(){return this.indexthis.end)return!1;for(let s=0,i=this.index;s=this.end||t.charAt(s)!==this.source.charAt(i))return!1;return n&&(this.index+=a),!0}matchAny(t,n){for(let a=0,s=t.length;a=this.end)return!1;let n=this.source.charAt(this.index);return n.match(/[a-zA-Z0-9_\u4e00-\u9fa5]/)||n==="$"||n==="_"||n==="@"?(t&&this.index++,!0):!1}matchIdentifierPart(t){if(this.index>=this.end)return!1;let n=this.source.charAt(this.index);return n.match(/[a-zA-Z0-9_\u4e00-\u9fa5]/)||n==="@"?(t&&this.index++,!0):!1}skipWhiteSpace(){for(;this.index0&&this.tokens[this.end-1]}hasMore(){return this.index=this.end)return!1;let s=!1;if(Array.isArray(t)){for(let i=0,o=t.length;in.push(this.textToString(a))),n.join(",")}else return t.error}expect(t,n){if(this.match(t,!0,n))return this.tokens[this.index-1];if(this.hasMore()){let a=this.tokens[this.index];throw t instanceof Ge&&(t=t.type.error),new ge("Expected '"+this.textToString(t)+"', but got '"+a.getText()+"'",a.getSpan())}else{let a=this.tokens[this.index-1].getSpan();return new Ge(d.Unknown,a)}}hasPrev(){return this.index>0}getSource(){return this.tokens.length===0?null:this.tokens[0].getSpan().getSource()}}const wi=(e,t)=>{if(t.length>0){let n=t[t.length-1];if(n instanceof Me)return!1;switch(n.getTokenType()){case d.Comma:case d.Semicolon:case d.Colon:case d.RightCurly:case d.LeftBracket:case d.LeftParantheses:case d.Assignment:case d.NotEqual:case d.EqualEqualEqual:case d.NotEqualEqual:case d.Equal:case d.And:case d.Or:case d.SqlAnd:case d.SqlOr:case d.SqlNotEqual:case d.Questionmark:case d.InstanceOf:case d.Lambda:case d.Not:break;default:return!1}}if(e.match("/",!1)){let n=e.getPosition();e.consume(),e.startSpan();let a=!1,s=0,i=0,o=0;for(;e.hasMore();){if(e.match("\\",!0)){e.consume();continue}if(e.match("[",!1))s++,i=e.getPosition();else if(s>0&&e.match("]",!1))s--;else if(e.match(d.ForwardSlash.literal,!0))if(s===0){e.match("g",!0),e.match("i",!0),e.match("m",!0),e.match("s",!0),e.match("u",!0),e.match("y",!0),a=!0;break}else o=e.getPosition();let l=e.consume();if(l==="\r"||l===` `)return e.reset(n),!1}if(s!==0)throw new ge("Missing ']'",e.getSpan(i,o-1));if(!a)return e.reset(n),!1;let r=e.endSpan();return r=e.getSpan(r.getStart()-1,r.getEnd()),t.push(new Me(d.RegexpLiteral,r)),!0}return!1},dn=(e,t,n)=>{if(e.match(t,!0)){e.startSpan();let a=!1;for(;e.hasMore();){if(e.match("\\",!0)){e.consume();continue}if(e.match(t.literal,!0)){a=!0;break}let i=e.consume();if(t!==d.TripleQuote&&(i==="\r"||i===` `))throw new ge(t.error+t.error+"\u5B9A\u4E49\u7684\u5B57\u7B26\u4E32\u4E0D\u80FD\u6362\u884C",e.endSpan())}if(!a)throw new ge("\u5B57\u7B26\u4E32\u6CA1\u6709\u7ED3\u675F\u7B26"+t.error,e.endSpan());let s=e.endSpan();return s=e.getSpan(s.getStart(),s.getEnd()-t.literal.length),n.push(new Me(d.StringLiteral,s)),!0}return!1},na=(e,t)=>{let n=Number.parseInt(e.getText().substring(2).replace(/\_/g,""),t);return n>2147483647||n<-2147483648?new Me(d.LongLiteral,e,n):n>127||n<-128?new Me(d.LongLiteral,e,n):new Me(d.ByteLiteral,e,n)},ki=(e,t)=>{if(e.match("0",!1)){let n=e.getPosition();if(e.startSpan(),e.consume(),e.matchAny(["x","X"],!0)){for(;e.matchDigit(!0)||e.matchAny(["A","B","C","D","E","F","a","b","c","d","e","f","_"],!0););if(e.matchAny(["L","l"],!0)){let a=e.endSpan(),s=a.getText();return t.push(new Me(d.LongLiteral,a,parseInt(s.substring(2,s.length-1).replace(/\_/g,""),16))),!0}return t.push(na(e.endSpan(),16)),!0}else if(e.matchAny(["b","B"],!0)){for(;e.matchAny(["0","1","_"],!0););if(e.matchAny(["L","l"],!0)){let a=e.endSpan(),s=a.getText();return t.push(new Me(d.LongLiteral,a,parseInt(s.substring(2,s.length-1).replace(/\_/g,""),2))),!0}return t.push(na(e.endSpan(),2)),!0}e.reset(n)}if(e.matchDigit(!1)){let n=d.IntegerLiteral;for(e.startSpan();e.matchDigit(!0)||e.match("_",!0););if(e.match(d.Period.literal,!0))if(e.hasMore())for(n=d.DoubleLiteral;e.matchDigit(!0)||e.match("_",!0););else e.reset(e.getPosition()-1);if(e.matchAny(["b","B"],!0)){if(n===d.DoubleLiteral)throw new ge("Byte literal can not have a decimal point.",e.endSpan());n=d.ByteLiteral}else if(e.matchAny(["s","S"],!0)){if(n===d.DoubleLiteral)throw new ge("Short literal can not have a decimal point.",e.endSpan());n=d.ShortLiteral}else if(e.matchAny(["l","L"],!0)){if(n===d.DoubleLiteral)throw new ge("Long literal can not have a decimal point.",e.endSpan());n=d.LongLiteral}else e.matchAny(["f","F"],!0)?n=d.FloatLiteral:e.matchAny(["d","D"],!0)?n=d.DoubleLiteral:e.matchAny(["m","M"],!0)&&(n=d.DecimalLiteral);return t.push(new Me(n,e.endSpan())),!0}return!1},Di=(e,t)=>{if(e.match("```",!0))if(e.startSpan(),e.matchIdentifierStart(!0)){for(;e.matchIdentifierPart(!0););let n=e.endSpan();if(t.push(new Ge(d.Language,n)),e.startSpan(),!e.skipUntil("```"))throw new ge("```\u9700\u8981\u4EE5```\u7ED3\u5C3E",e.endSpan());return t.push(new Ge(d.Language,e.endSpan(-3))),!0}else throw new ge("```\u540E\u9700\u8981\u6807\u8BC6\u8BED\u8A00\u7C7B\u578B",e.endSpan());return!1},Mi=(e,t)=>{if(e.matchIdentifierStart(!0)){for(e.startSpan();e.matchIdentifierPart(!0););let n=e.endSpan();return n=e.getSpan(n.getStart()-1,n.getEnd()),n.getText()==="true"||n.getText()==="false"?t.push(new Me(d.BooleanLiteral,n)):n.getText()==="null"?t.push(new Me(d.NullLiteral,n)):d.SqlAnd.literal.toUpperCase()===n.getText().toUpperCase()?t.push(new Ge(d.SqlAnd,n)):d.SqlOr.literal.toUpperCase()===n.getText().toUpperCase()?t.push(new Ge(d.SqlOr,n)):t.push(new Ge(d.Identifier,n)),!0}return!1},Pi=(e,t)=>{if(e.match("`",!0)){let n=e.getPosition(),a=n,s=[];for(;e.hasMore();){if(e.match("\\",!0)){e.consume();continue}if(e.match("`",!0))break;if(e.match("${",!0)){let r=e.getPosition();a0&&s.push(new Me(d.StringLiteral,e.endSpan(a,o))),i=e.getSpan(i.getStart()-1,i.getEnd()),t.push(new Me(d.StringLiteral,i,new ft(s))),!0}return!1},Da=(e,t,n)=>{let a=0,s=0;for(;e.hasMore();){if(e.skipWhiteSpace(),n&&e.match(n,!0))return t;if(e.match("//",!0)){e.skipLine();continue}if(e.match("/*",!0)){e.skipUntil("*/");continue}if(ki(e,t)||dn(e,d.SingleQuote,t)||dn(e,d.TripleQuote,t)||dn(e,d.DoubleQuote,t)||wi(e,t)||Di(e,t)||Pi(e,t)||Mi(e,t))continue;if(e.matchAny(["=>","->"],!0)){t.push(new Ge(d.Lambda,e.getSpan(e.getPosition()-2,e.getPosition())));continue}let i=!1,o=d.getSortedValues();for(let r=0,l=o.length;rDa(new Ni(e,0,e.length),[]);class fe{constructor(t){this.span=t}getSpan(){return this.span}async getJavaType(t){return await this.getExpressionsJavaType(t),"java.lang.Object"}async getExpressionsJavaType(t){for(const n of this.expressions().filter(a=>a))await n.getJavaType(t)}expressions(){return[]}toString(){return this.span.getText()}}class xt extends fe{constructor(t){super(t)}}class we extends xt{constructor(t,n,a){super(t);this.javaType=n,this.expressionList=a||[]}expressions(){return this.expressionList}async getJavaType(){return this.javaType}getValue(){return this.getSpan().getText().replace(/\\\\/g,"\\").replace(/\\n/g,` `).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\'/g,"'")}}class en extends fe{constructor(t,n,a){super(t);this.target=n,this.args=a}expressions(){return[this.target,...this.args]}getMethod(){return this.target}getArguments(){return this.args}async getJavaType(t){let n=this.target.member.getText(),a=await this.target.getJavaType(t),s=ne.findMethods(a);if(s)for(let i=0,o=s.length;ia.name===this.target.variable);if(n)return n.returnType}return await this.target.getJavaType(t)}}class st extends fe{constructor(t,n,a,s,i){super(t);this.target=n,this.optional=a,this.member=s,this.whole=i}isWhole(){return this.whole===!0}expressions(){return[this.target]}getTarget(){return this.target}async getJavaType(t){let n=await this.target.getJavaType(t),a=await ne.loadClass(n),s=a==null?void 0:a.attributes;const i=this.member.getText();if(s){const l=s.find(u=>u.name===i);if(l)return ne.getWrapperClass(l.type)}let o=a==null?void 0:a.enums;if(o){const l=o.find(u=>u.name===i);if(l)return ne.getWrapperClass(l.type)}let r=a==null?void 0:a.methods;if(r)for(let l=0,u=r.length;l=0&&!n;s--)n=ne.findClass(a[s]+this.variable)}return n||"java.lang.Object"}}class Jt extends fe{constructor(t,n,a){super(t);this.target=n,this.keyOrIndex=a}async getJavaType(t){return await this.target.getJavaType(t)==="db"?"db":super.getJavaType(t)}}class aa extends fe{constructor(t,n,a,s,i){super(t);this.condition=n,this.trueBlock=a||[],this.elseIfs=s||[],this.falseBlock=i||[]}expressions(){return[this.condition,...this.trueBlock,...this.elseIfs,...this.falseBlock]}}class sa extends we{constructor(t){super(t)}}class _n extends fe{constructor(t,n,a){super(t);this.parameters=n,this.childNodes=a}expressions(){return[...this.childNodes]}async getJavaType(t){if(Array.isArray(this.childNodes)&&this.childNodes.length>0){for(let n=0,a=this.childNodes.length;n=0&&!n;s--)n=ne.findClass(a[s]+this.identifier)}return n||"java.lang.Object"}}class ji extends fe{constructor(t,n){super(t);this.expression=n}expressions(){return[this.expression]}async getJavaType(t){return"java.util.concurrent.Future"}}class Rn extends fe{constructor(t,n,a){super(new J(t.getSpan(),n.getSpan()));this.operand=n,this.operator=t,this.atAfter=a}async getJavaType(t){return await this.operand.getJavaType(t)}}class Vi extends fe{constructor(t,n,a,s,i,o){super(t);this.exceptionVarNode=n,this.tryBlock=a,this.tryResources=s,this.catchBlock=i,this.finallyBlock=o}expressions(){return[...this.tryBlock,...this.tryResources,...this.catchBlock,...this.finallyBlock]}}class Gi extends fe{constructor(t,n,a,s,i){super(t);this.indexOrKey=n,this.value=a,this.mapOrArray=s,this.body=i}expressions(){return[this.mapOrArray,...this.body]}}class zi extends fe{constructor(t,n,a){super(t);this.condition=n,this.trueBlock=a}expressions(){return[this.condition,...this.trueBlock]}}class Yi extends fe{constructor(t,n,a,s){super(t);this.packageName=n,this.varName=a,this.module=s}async getJavaType(t){if(this.packageName.endsWith(".*"))t["@import"].push(this.packageName.substring(0,this.packageName.length-1));else if(this.module)t[this.packageName]=this.packageName;else if(this.varName)t[this.varName]=this.packageName;else{let n=this.packageName.lastIndexOf(".");n>-1&&(t[this.packageName.substring(n+1)]=this.packageName)}}}class tn extends fe{constructor(t,n,a,s){super(t);this.varName=n,this.expression=a,this.defineType=s!=="var"&&s!=="const"&&s!=="let"&&s}getVarName(){return this.varName}expressions(){return this.expression==null?[]:[this.expression]}async getJavaType(t){let n="java.lang.Object";return this.defineType?n=t[this.defineType]||n:this.expression&&(n=await this.expression.getJavaType(t)),t[this.varName]=n,n}}class qi extends tn{constructor(t,n,a,s,i){super(t,null,a,s);this.expression=a,this.tokens=n,this.defineType=s!=="var"&&s!=="const"&&s!=="let"&&s,this.isMapAccess=i}expressions(){return this.expression==null?[]:[this.expression]}async getJavaType(t){let n="java.lang.Object";if(this.defineType)n=t[this.defineType]||n;else if(!this.isMapAccess)return n;for(const a of this.tokens)t[a.getText()]=await new st(this.span,this.expression,!0,a,!1).getJavaType(t);return n}}class ia extends fe{constructor(t,n,a){super(new J(t.getSpan(),a.getSpan()));this.condition=t,this.trueExpression=n,this.falseExpression=a}expressions(){return[this.condition,this.trueExpression,this.falseExpression]}}class Ki extends fe{constructor(t,n){super(t);this.target=n}expressions(){return[this.target]}}class Et extends we{constructor(t,n,a){super(t,"java.util.LinkedHashMap");this.keys=n,this.values=a}expressions(){return this.values}}class bt extends we{constructor(t,n){super(t,"java.util.ArrayList");this.values=n}expressions(){return this.values}}class Wi extends fe{constructor(t){super(t)}async getJavaType(){return"java.util.function.Function"}expressions(){return[]}}class oa extends fe{constructor(t,n,a,s){super(new J(t.getSpan(),a.getSpan()));this.left=t,this.right=a,this.operator=n,this.linqLevel=s}getOperator(){return this.operator}setRightOperand(t){this.right=t}getRightOperand(){return this.right}expressions(){return[this.left,this.right]}async getJavaType(t){let n=await this.left.getJavaType(t),a=await this.right.getJavaType(t);return n=n.toLowerCase().substring(n.lastIndexOf(".")+1),a=a.toLowerCase().substring(a.lastIndexOf(".")+1),(this.operator.type===d.Plus||this.operator.type===d.PlusEqual)&&(n==="string"||a==="string")?"java.lang.String":this.operator.type===d.Equal||this.operator.type===d.Assignment&&this.linqLevel>0?"java.lang.Boolean":n==="bigdecimal"||a==="bigdecimal"?"java.math.BigDecimal":n==="double"||a==="double"?"java.lang.Double":n==="float"||a==="float"?"java.lang.Float":n==="long"||a==="long"?"java.lang.Long":n==="integer"||a==="integer"?"java.lang.Integer":n==="short"||a==="short"?"java.lang.Short":n==="byte"||a==="byte"?"java.lang.Byte":"java.lang.Object"}}class Ct extends xt{constructor(t,n,a){super(t);this.expression=n,this.alias=a}expressions(){return[this.expression]}}class Xi extends xt{constructor(t,n,a,s){super(t);this.leftJoin=n,this.target=a,this.condition=s}expressions(){return[this.target,this.condition]}}class Ji extends xt{constructor(t,n,a,s){super(t);this.expression=n,this.alias=a,this.order=s}expressions(){return[this.expression]}}class Ma extends xt{constructor(t,n,a,s){super(t);this.convert=n,this.target=a,this.args=s}expressions(){return[this.target,...this.args]}async getJavaType(){return this.convert=="double"?"java.lang.Double":this.convert=="float"?"java.lang.Float":this.convert=="long"?"java.lang.Long":this.convert=="int"?"java.lang.Integer":this.convert=="short"?"java.lang.Short":this.convert=="byte"?"java.lang.Byte":this.convert=="date"?"java.util.Date":"java.lang.Object"}}class Pa extends xt{constructor(t,n,a,s,i,o,r,l,u,p){super(t);this.fields=n,this.from=a,this.joins=s,this.where=i,this.groups=o,this.having=r,this.orders=l,this.limit=u,this.offset=p}expressions(){let t=[];return this.where&&t.push(this.where),this.having&&t.push(this.having),[...this.fields,this.from,...this.joins,...this.groups,...t,...this.orders,this.limit,this.offset]}async getJavaType(){return"java.util.List"}}const sn={environmentFunction:()=>{},setEnvironment:e=>sn.environmentFunction=e},ra=["import","as","var","let","const","return","break","continue","if","for","in","new","true","false","null","else","try","catch","finally","async","while","exit","and","or","throw"],la=["from","join","left","group","by","as","having","and","or","in","where","on","limit","offset"],Qi=[[d.Assignment],[d.RShift2Equal,d.RShiftEqual,d.LShiftEqual,d.XorEqual,d.BitOrEqual,d.BitAndEqual,d.PercentEqual,d.ForwardSlashEqual,d.AsteriskEqual,d.MinusEqual,d.PlusEqual],[d.Or,d.SqlOr],[d.And,d.SqlAnd],[d.BitOr],[d.Xor],[d.BitAnd],[d.EqualEqualEqual,d.Equal,d.NotEqualEqual,d.NotEqual,d.SqlNotEqual],[d.Less,d.LessEqual,d.Greater,d.GreaterEqual,d.InstanceOf],[d.Plus,d.Minus],[d.LShift,d.RShift,d.RShift2],[d.Asterisk,d.ForwardSlash,d.Percentage]],Zi=[[d.RShift2Equal,d.RShiftEqual,d.LShiftEqual,d.XorEqual,d.BitOrEqual,d.BitAndEqual,d.PercentEqual,d.ForwardSlashEqual,d.AsteriskEqual,d.MinusEqual,d.PlusEqual],[d.Or,d.SqlOr],[d.And,d.SqlAnd],[d.BitOr],[d.Xor],[d.BitAnd],[d.Assignment,d.EqualEqualEqual,d.Equal,d.NotEqualEqual,d.Equal,d.NotEqual,d.SqlNotEqual],[d.Less,d.LessEqual,d.Greater,d.GreaterEqual,d.InstanceOf],[d.Plus,d.Minus],[d.LShift,d.RShift,d.RShift2],[d.Asterisk,d.ForwardSlash,d.Percentage]],eo=[d.MinusMinus,d.PlusPlus,d.BitNot,d.Minus,d.Plus,d.Not];class Yt{constructor(t){this.stream=t,this.linqLevel=0}parse(t){let n=[];try{for(;this.stream.hasMore();){let a=this.parseStatement();a!=null&&(this.validateNode(a),n.push(a))}}catch(a){if(t!==!0)throw a}return n}async parseBest(t){let n=this.parse(),a=await this.processEnv(n);return{best:this.findBestMatch(n[n.length-1],t),env:a}}async processEnv(t){let n=t.length,a=Ue(pe(pe(pe({},sn.environmentFunction()),ne.getAutoImportClass()),ne.getAutoImportModule()),{"@import":[]});for(let s=0;s-1)throw new ge("\u53D8\u91CF\u540D\u4E0D\u80FD\u5B9A\u4E49\u4E3A\u5173\u952E\u5B57",t)}parseThrow(){let t=this.stream.consume().getSpan(),n=this.parseExpression();return new Fi(new J(t,this.stream.getPrev().getSpan()),n)}parseExit(){let t=this.stream.expect("exit").getSpan(),n=[];do n.push(this.parseExpression());while(this.stream.match(d.Comma,!0));return new Bi(new J(t,this.stream.getPrev().getSpan()),n)}parseAssert(){let t=this.stream.makeIndex();try{let n=this.stream.expect("assert").getSpan(),a=this.parseExpression();this.stream.expect(d.Colon);let s=[];do s.push(this.parseExpression());while(this.stream.match(d.Comma,!0));return new Hi(new J(n,this.stream.getPrev().getSpan()),a,s)}catch{return this.stream.resetIndex(t),this.parseExpression()}}parseImport(){let t=this.stream.expect("import").getSpan();if(this.stream.hasMore()){let n=this.stream.consume(),a=null,s=n.getTokenType()===d.StringLiteral;if(s)a=this.createStringLiteral(n).getValue();else if(n.type===d.Identifier){let o=n.getSpan(),r=null;for(a=o.getText();this.stream.match(d.Period,!0);){if(s=!0,this.stream.match(d.Asterisk,!1)){n=this.stream.consume();break}n=this.stream.expect(d.Identifier)}s&&(r=n.getSpan(),a=new J(o,r).getText())}else throw new ge("Expected identifier or string, but got stream is "+n.getTokenType().error,this.stream.getPrev().getSpan());let i=a;if(s)if(this.stream.match("as",!0))n=this.stream.expect(d.Identifier),this.checkKeyword(n.getSpan()),i=n.getSpan().getText();else{let o=a;if(o.startsWith("@"))throw new ge("Expected as",this.stream.getPrev().getSpan());{let r=o.lastIndexOf(".");r!=-1&&(o=o.substring(r+1))}i=o}return new Yi(new J(t,n.getSpan()),a,i,!s)}throw new ge("Expected identifier or string, but got stream is EOF",this.stream.getPrev().getSpan())}parseReturn(){let t=this.stream.expect("return").getSpan();if(this.stream.match([";","}"],!1))return new kt(t,null);let n=this.parseExpression();return new kt(new J(t,n.getSpan()),n)}parseAsync(){let t=this.stream.expect("async").getSpan(),n=this.parseExpression();return new ji(new J(t,this.stream.getPrev().getSpan()),n)}parseIfStatement(){let t=this.stream.expect("if").getSpan(),n=this.parseExpression(),a=this.parseFunctionBody(),s=[],i=[];for(;this.stream.hasMore()&&this.stream.match("else",!0);)if(this.stream.hasMore()&&this.stream.match("if",!1)){let r=this.stream.expect("if").getSpan(),l=this.parseExpression(),u=this.parseFunctionBody(),p=new J(r,u.length>0?u[u.length-1].getSpan():r);s.push(new aa(p,l,u,[]))}else{i=i.concat(this.parseFunctionBody());break}let o=this.stream.getPrev().getSpan();return new aa(new J(t,o),n,a,s,i)}parseNewExpression(t){let n=this.parseAccessOrCall(d.Identifier,!0),a=new J(t.getSource(),t.getStart(),this.stream.getPrev().getSpan().getEnd());return n instanceof en?this.parseAccessOrCall(new Ut(a,n.getMethod(),n.getArguments())):n instanceof xn?this.parseAccessOrCall(new Ut(a,n.getFunction(),n.getArguments())):this.parseAccessOrCall(new Ut(a,n,[]))}parseArguments(){this.stream.expect(d.LeftParantheses);let t=[];for(;this.stream.hasMore()&&!this.stream.match(d.RightParantheses,!1);)t.push(this.parseExpression()),this.stream.match(d.RightParantheses,!1)||this.stream.expect(d.Comma);return t}parseForStatement(){let t=this.stream.expect("for").getSpan();this.stream.expect("(");let n=null,a=this.stream.expect(d.Identifier).getSpan();this.checkKeyword(a),this.stream.match(d.Comma,!0)&&(n=a,a=this.stream.expect(d.Identifier).getSpan(),this.checkKeyword(a)),this.stream.expect("in");let s=this.parseExpression();this.stream.expect(")");let i=this.parseFunctionBody();return new Gi(new J(t,this.stream.getPrev().getSpan()),n&&n.getText(),a&&a.getText(),s,i)}parseVarDefine(){let t=this.stream.consume().getSpan(),n;if((n=this.stream.match(d.LeftCurly,!1))||this.stream.match(d.LeftBracket,!1)){this.stream.expect([d.LeftCurly,d.LeftBracket]);let i=[];do{let o=this.stream.expect(d.Identifier);i.push(o)}while(this.stream.match(d.Comma,!0));return n?this.stream.match(d.RightCurly,!0):this.stream.match(d.RightBracket,!0),this.stream.match(d.Assignment,!0),new qi(new J(t,this.stream.getPrev().getSpan()),i,this.parseExpression(),t.getText(),n)}let a=this.stream.expect(d.Identifier);this.checkKeyword(a.getSpan());let s;return this.stream.match(d.Assignment,!0)?s=new tn(new J(t,this.stream.getPrev().getSpan()),a.getText(),this.parseExpression(),t.getText()):s=new tn(new J(t,this.stream.getPrev().getSpan()),a.getText(),null,t.getText()),s}parseTryStatement(){let t=this.stream.expect("try"),n=[];if(this.stream.match("(",!0)){if(!this.stream.match(")",!1))for(;!this.stream.match(")",!1);){if(this.stream.match(";",!0))continue;let r=null;if(this.matchVarDefine())r=this.parseVarDefine();else{if(this.stream.matchAny(ra,!1))throw new ge("try \u62EC\u53F7\u4E2D\u53EA\u5141\u8BB8\u5199\u8D4B\u503C\u8BED\u53E5",this.stream.consume().getSpan());let l=this.stream.makeIndex();if(this.matchTypeDefine()&&(this.stream.resetIndex(l),r=this.parseVarDefine()),r==null)throw this.stream.resetIndex(l),new ge("try \u62EC\u53F7\u4E2D\u53EA\u5141\u8BB8\u5199\u8D4B\u503C\u8BED\u53E5",this.stream.consume().getSpan())}n.push(r)}this.stream.expect(")")}let a=this.parseFunctionBody(),s=[],i=[],o=null;return this.stream.match("catch",!0)&&(this.stream.match("(",!0)&&(o=this.stream.expect(d.Identifier).getText(),this.stream.expect(")")),s=s.concat(this.parseFunctionBody())),this.stream.match("finally",!0)&&(i=i.concat(this.parseFunctionBody())),new Vi(new J(t.getSpan(),this.stream.getPrev().getSpan()),o,a,n,s,i)}parseWhileStatement(){let t=this.stream.expect("while").getSpan(),n=this.parseExpression(),a=this.parseFunctionBody(),s=this.stream.getPrev().getSpan();return new zi(new J(t,s),n,a)}parseFunctionBody(){this.stream.expect("{");let t=[];for(;this.stream.hasMore()&&!this.stream.match("}",!1);){let n=this.parseStatement(!0);n!=null&&(this.validateNode(n),t.push(n))}return this.expectCloseing(),t}expectCloseing(){return this.stream.hasMore(),this.stream.expect("}").getSpan()}parseExpression(t){return this.parseTernaryOperator(t)}parseTernaryOperator(t){let n=this.parseBinaryOperator(0,t);if(this.stream.match(d.Questionmark,!0)){let a=this.parseTernaryOperator(t);this.stream.expect(d.Colon);let s=this.parseTernaryOperator(t);return n instanceof oa&&n.getOperator()===d.Assignment?(n.setRightOperand(new ia(n.getRightOperand(),a,s)),n):new ia(n,a,s)}else return n}parseBinaryOperator(t,n){let a=t+1,s=this.linqLevel>0?Zi:Qi,i=a===s.length?this.parseUnaryOperator(n):this.parseBinaryOperator(a,n),o=s[t];for(;this.stream.hasMore()&&this.stream.match(o,!1);){let r=this.stream.consume();if(r.type.inLinq&&this.linqLevel===0)throw new ge(r.getText()+" \u53EA\u80FD\u5728Linq\u4E2D\u4F7F\u7528",this.stream.hasMore()?this.stream.consume().getSpan():this.stream.getPrev().getSpan());let l=a===s.length?this.parseUnaryOperator(n):this.parseBinaryOperator(a,n);i=new oa(i,r,l,this.linqLevel)}return i}parseUnaryOperator(t){if(this.stream.match(eo,!1))return new Rn(this.stream.consume(),this.parseUnaryOperator(t));if(this.stream.match(d.LeftParantheses,!1)){let n=this.stream.expect(d.LeftParantheses).getSpan(),a=this.stream.makeIndex(),s=[];for(;this.stream.match(d.Identifier,!1);){let o=this.stream.expect(d.Identifier);if(s.push(o.getSpan().getText()),!this.stream.match(d.Comma,!0)&&this.stream.match(d.RightParantheses,!0)){if(this.stream.match(d.Lambda,!0))return this.parseLambdaBody(n,s);break}}if(this.stream.match(d.RightParantheses,!0)&&this.stream.match(d.Lambda,!0))return this.parseLambdaBody(n,s);this.stream.resetIndex(a);let i=this.parseExpression();return this.stream.expect(d.RightParantheses),this.parseAccessOrCall(i)}else{let n=this.parseAccessOrCallOrLiteral(t);return(n instanceof st||n instanceof Xe||n instanceof Jt)&&this.stream.match([d.PlusPlus,d.MinusMinus],!1)?new Rn(this.stream.consume(),n):n}}parseLambdaBody(t,n){let a=this.stream.makeIndex(),s=[];try{let i=this.parseExpression();return s.push(new kt(new J("return",0,6),i)),new _n(new J(t,i.getSpan()),n,s)}catch{if(this.stream.resetIndex(a),this.stream.match(d.LeftCurly,!0)){for(;this.stream.hasMore()&&!this.stream.match("}",!1);){let r=this.parseStatement(!0);this.validateNode(r),s.push(r)}let o=this.expectCloseing();return new _n(new J(t,o),n,s)}else{let o=this.parseStatement();return s.push(new kt(new J("return",0,6),o)),new _n(new J(t,o.getSpan()),n,s)}}}parseSpreadAccess(t){t||(t=this.stream.expect(d.Spread));let n=this.parseExpression();return new Ki(new J(t.getSpan(),n.getSpan()),n)}parseAccessOrCall(t,n){if(t===d.StringLiteral||t===d.Identifier){let a=this.stream.expect(t),s=a.getSpan();if(t===d.Identifier&&s.getText()==="new")return this.parseNewExpression(s);if(t===d.Identifier&&this.stream.match(d.Lambda,!0))return this.parseLambdaBody(s,[s.getText()]);let i=t===d.StringLiteral?this.createStringLiteral(a):new Xe(s,s.getText());return this.parseAccessOrCall(i,n)}else{for(;this.stream.hasMore()&&this.stream.match([d.LeftParantheses,d.LeftBracket,d.Period,d.QuestionPeriod,d.ColonColon],!1);)if(this.stream.match(d.ColonColon,!1)){let a=this.stream.consume().getSpan(),s=[],i=this.stream.expect(d.Identifier),o=i.getSpan();this.stream.match(d.LeftParantheses,!1)&&(s=this.parseArguments(),o=this.stream.expect(d.RightParantheses).getSpan()),t=new Ma(new J(a,o),i.getText(),t,s)}else if(this.stream.match(d.LeftParantheses,!1)){let a=this.parseArguments(),s=this.stream.expect(d.RightParantheses).getSpan();if(t instanceof Xe||t instanceof Jt)t=new xn(new J(t.getSpan(),s),t,a,this.linqLevel>0);else if(t instanceof st)t=new en(new J(t.getSpan(),s),t,a,this.linqLevel>0);else throw new ge("Expected a variable, field or method.",this.stream.hasMore()?this.stream.consume().getSpan():this.stream.getPrev().getSpan());if(n)break}else if(this.stream.match(d.LeftBracket,!0)){let a=this.parseExpression(),s=this.stream.expect(d.RightBracket).getSpan();t=new Jt(new J(t.getSpan(),s),t,a)}else if(this.stream.match([d.Period,d.QuestionPeriod],!1)){let a=this.stream.consume().getTokenType()===d.QuestionPeriod;if(this.linqLevel>0&&this.stream.match(d.Asterisk,!1))t=new st(t.getSpan(),a,this.stream.expect(d.Asterisk).getSpan(),!0);else{let s=this.stream.expect([d.Identifier,d.SqlAnd,d.SqlOr]).getSpan();t=new st(new J(t.getSpan(),s),t,a,s,!1)}}return t}}parseMapLiteral(){let t=this.stream.expect(d.LeftCurly).getSpan(),n=[],a=[];for(;this.stream.hasMore()&&!this.stream.match("}",!1);){let i;if(this.stream.hasPrev()){let o=this.stream.getPrev();if(this.stream.match(d.Spread,!1)&&(o.getTokenType()===d.LeftCurly||o.getTokenType()===d.Comma)){let r=this.stream.expect(d.Spread);n.push(r),a.push(this.parseSpreadAccess(r)),this.stream.match([d.Comma,d.RightCurly],!1)&&this.stream.match(d.Comma,!0);continue}}this.stream.match(d.StringLiteral,!1)?i=this.stream.expect(d.StringLiteral):this.stream.match(d.LeftBracket,!0)?(i=this.parseExpression(),this.stream.expect(d.RightBracket)):i=this.stream.expect(d.Identifier),n.push(i),this.stream.match([d.Comma,d.RightCurly],!1)?(this.stream.match(d.Comma,!0),i instanceof Xe?a.push(i):i.getTokenType()===d.Identifier?a.push(new Xe(i.getSpan(),i.getText())):a.push(new we(i.getSpan(),"java.lang.String"))):(this.stream.expect(":"),a.push(this.parseExpression()),this.stream.match("}",!1)||this.stream.expect(d.Comma))}let s=this.stream.expect("}").getSpan();return new Et(new J(t,s),n,a)}parseListLiteral(){let t=this.stream.expect(d.LeftBracket).getSpan(),n=[];for(;this.stream.hasMore()&&!this.stream.match(d.RightBracket,!1);)n.push(this.parseExpression()),this.stream.match(d.RightBracket,!1)||this.stream.expect(d.Comma);let a=this.stream.expect(d.RightBracket).getSpan();return new bt(new J(t,a),n)}parseSelect(){let t=this.stream.expect("select",!0).getSpan();this.linqLevel++;let n=this.parseLinqFields();this.stream.expect("from",!0);let a=this.parseLinqField(),s=this.parseLinqJoins(),i;this.stream.match("where",!0,!0)&&(i=this.parseExpression());let o=this.parseGroup(),r;this.stream.match("having",!0,!0)&&(r=this.parseExpression());let l=this.parseLinqOrders();this.linqLevel--;let u,p;this.stream.match("limit",!0,!0)&&(u=this.parseExpression(),this.stream.match("offset",!0,!0)&&(p=this.parseExpression()));let m=this.stream.getPrev().getSpan();return new Pa(new J(t,m),n,a,s,i,o,r,l,u,p)}parseGroup(){let t=[];if(this.stream.match("group",!0,!0)){this.stream.expect("by",!0);do{let n=this.parseExpression();t.push(new Ct(n.getSpan(),n,null))}while(this.stream.match(d.Comma,!0))}return t}parseLinqOrders(){let t=[];if(this.stream.match("order",!0,!0)){this.stream.expect("by",!0);do{let n=this.parseExpression(),a=1;this.stream.match(["desc","asc"],!1,!0)&&this.stream.consume().getText()==="desc"&&(a=-1),t.push(new Ji(new J(n.getSpan(),this.stream.getPrev().getSpan()),n,null,a))}while(this.stream.match(d.Comma,!0))}return t}parseLinqField(){let t=this.parseExpression();if(this.stream.match(d.Identifier,!1)&&!this.stream.match(la,!1,!0)){let n=this.stream.expect(d.Identifier).getSpan();return new Ct(new J(t.getSpan(),n),t,n.getText())}return new Ct(t.getSpan(),t,null)}parseLinqFields(){let t=[];do{let n=this.parseExpression();if(this.stream.match(d.Identifier,!1)&&!this.stream.match(la,!1,!0)){if(n instanceof sa)throw new ge("* \u540E\u8FB9\u4E0D\u80FD\u8DDF\u522B\u540D",this.stream.hasMore()?this.stream.consume().getSpan():this.stream.getPrev().getSpan());if(n instanceof st&&n.isWhole())throw new ge(n.getSpan().getText()+" \u540E\u8FB9\u4E0D\u80FD\u8DDF\u522B\u540D",this.stream.hasMore()?this.stream.consume().getSpan():this.stream.getPrev().getSpan());let a=this.stream.consume().getSpan();t.push(new Ct(new J(n.getSpan(),a),n,a.getText()))}else t.push(new Ct(n.getSpan(),n,null))}while(this.stream.match(d.Comma,!0));if(t.length===0)throw new ge("\u81F3\u5C11\u8981\u67E5\u8BE2\u4E00\u4E2A\u5B57\u6BB5",this.stream.hasMore()?this.stream.consume().getSpan():this.stream.getPrev().getSpan());return t}parseLinqJoins(){let t=[];do{let n=this.stream.match("left",!1),a=n?this.stream.consume().getSpan():null;if(this.stream.match("join",!0)){a=n?a:this.stream.getPrev().getSpan();let s=this.parseLinqField();this.stream.expect("on");let i=this.parseExpression();t.push(new Xi(new J(a,this.stream.getPrev().getSpan()),n,s,i))}}while(this.stream.match(["left","join"],!1));return t}parseAccessOrCallOrLiteral(t){let n;if(t&&this.stream.match("}",!1))return null;if(this.stream.match(d.Spread,!1))n=this.parseSpreadAccess();else if(this.stream.match(d.Identifier,!1))this.stream.match("async",!1)?n=this.parseAsync():this.stream.match("select",!1,!0)?n=this.parseSelect():n=this.parseAccessOrCall(d.Identifier);else if(this.stream.match(d.LeftCurly,!1))n=this.parseMapLiteral();else if(this.stream.match(d.LeftBracket,!1))n=this.parseListLiteral();else if(this.stream.match(d.StringLiteral,!1))n=this.createStringLiteral(this.stream.expect(d.StringLiteral));else if(this.stream.match(d.BooleanLiteral,!1))n=new we(this.stream.expect(d.BooleanLiteral).getSpan(),"java.lang.Boolean");else if(this.stream.match(d.DoubleLiteral,!1))n=new we(this.stream.expect(d.DoubleLiteral).getSpan(),"java.lang.Double");else if(this.stream.match(d.FloatLiteral,!1))n=new we(this.stream.expect(d.FloatLiteral).getSpan(),"java.lang.Float");else if(this.stream.match(d.ByteLiteral,!1))n=new we(this.stream.expect(d.ByteLiteral).getSpan(),"java.lang.Byte");else if(this.stream.match(d.ShortLiteral,!1))n=new we(this.stream.expect(d.ShortLiteral).getSpan(),"java.lang.Short");else if(this.stream.match(d.IntegerLiteral,!1))n=new we(this.stream.expect(d.IntegerLiteral).getSpan(),"java.lang.Integer");else if(this.stream.match(d.LongLiteral,!1))n=new we(this.stream.expect(d.LongLiteral).getSpan(),"java.lang.Long");else if(this.stream.match(d.DecimalLiteral,!1))n=new we(this.stream.expect(d.DecimalLiteral).getSpan(),"java.math.BigDecimal");else if(this.stream.match(d.RegexpLiteral,!1)){let a=this.stream.expect(d.RegexpLiteral);n=new we(a.getSpan(),"java.util.regex.Pattern")}else this.stream.match(d.NullLiteral,!1)?n=new we(this.stream.expect(d.NullLiteral).getSpan(),"null"):this.linqLevel>0&&this.stream.match(d.Asterisk,!1)?n=new sa(this.stream.expect(d.Asterisk).getSpan()):this.stream.match(d.Language,!1)&&(n=new Wi(this.stream.consume().getSpan(),this.stream.consume().getSpan()));if(n==null)throw new ge("Expected a variable, field, map, array, function or method call, or literal.",this.stream.hasMore()?this.stream.consume().getSpan():this.stream.getPrev().getSpan());return this.parseAccessOrCall(n)}createStringLiteral(t){if(t.getTokenStream()==null)return new we(t.getSpan(),"java.lang.String");let n=this.stream;this.stream=t.getTokenStream();let a=[];for(;this.stream.hasMore();)a.push(this.parseExpression());return this.stream=n,new we(t.getSpan(),"java.lang.String",a)}findBestMatch(t,n){let a=t.expressions().filter(s=>s);for(let s in a){let i=this.findBestMatch(a[s],n);if(i)return i}return t.getSpan().inPosition(n)?t:null}}const An=e=>{var n;const t={};return(n=e==null?void 0:e.children)==null||n.forEach(a=>t[a.name]=a),t};function In(e,t){var s;let n=[],a={name:"",value:"",dataType:"",required:!1,validateType:"",expression:"",error:"",description:"",defaultValue:null,children:[]};if(e instanceof Et)e.keys.forEach((i,o)=>{var p,m,f,y,E,C,I;const r=i.span.getText().replace(/['"]/g,"");let l=e.values[o],u=Ue(pe({},a),{description:((p=t[r])==null?void 0:p.description)||"",required:((m=t[r])==null?void 0:m.required)===!0,validateType:((f=t[r])==null?void 0:f.validateType)||"",expression:((y=t[r])==null?void 0:y.expression)||"",error:((E=t[r])==null?void 0:E.error)||"",name:r,defaultValue:(C=t[r])==null?void 0:C.defaultValue,value:ca(l)?l.span.getText().trim():"",dataType:((I=t[r])==null?void 0:I.dataType)||Cn(l)});(l instanceof Et||l instanceof bt)&&(u.children=In(l,An(t[r]))),n.push(u)});else if(e instanceof bt&&e.values[0]){let i=e.values[0],o=Ue(pe({},a),{value:ca(i)?i.span.getText().trim():"",dataType:((s=t[""])==null?void 0:s.dataType)||Cn(i)});(i instanceof Et||i instanceof bt)&&(o.children=In(i,An(t[""]))),n.push(o)}return n}function ca(e){return!(e instanceof Et||e instanceof bt)}function Cn(e){if(e instanceof Et)return"Object";if(e instanceof bt)return"Array";e instanceof Rn&&(e=e.operand);let t=e.javaType.substring(e.javaType.lastIndexOf(".")+1);return t==="Integer"&&Number(e.span.getText())>2147483647||Number(e.span.getText())<-2147483648?"Long":t==="null"?"Object":t}function Ua(e,t){t=t||{};try{JSON.parse(e);let a=new Yt(new ft(zt(e))).parseExpression();return{name:"",value:"",dataType:t.dataType||Cn(a),required:t.required,validateType:t.validateType||"",expression:t.expression||"",error:t.error||"",description:t.description||"",defaultValue:t.defaultValue,children:In(a,An(t))}}catch{}}const ua=(e,t,n,a)=>{let s=-1,i=ne.getImportClass();if(n!==0&&t&&(s=i.length)>0){t=t.toLowerCase(),ne.getDefineModules().filter(r=>r.toLowerCase().indexOf(t)>-1).forEach(r=>e.push({label:r,filterText:r,kind:W.CompletionItemKind.Module,detail:r,insertText:r,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet}));let o=new Set;for(let r=0;r-1){let p=l.substring(l.lastIndexOf(".")+1);if(u===0){let m=l.substring(t.length),f=m;if(m.startsWith("."))f=t+".",m=t.substring(t.lastIndexOf(".")+1)+".";else{if(m.indexOf(".")===-1){e.push({sortText:`2${p}`,label:p,kind:W.CompletionItemKind.Class,filterText:l,detail:l,insertText:p,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet});continue}let y=m.substring(0,m.indexOf(".")+1);f=t+y,m=t.substring(t.lastIndexOf(".")+1)+y}if(o.has(m))continue;o.add(m),e.push({sortText:`1${m}`,label:m,kind:W.CompletionItemKind.Folder,filterText:l,detail:f.replace(/\.$/,""),insertText:m,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet,command:{id:"editor.action.triggerSuggest"}})}else p.toLowerCase().indexOf(t)>-1&&e.push({sortText:`2${p}`,label:p,kind:W.CompletionItemKind.Class,filterText:p,detail:l,insertText:l,range:new ot(a.lineNumber,n+1,a.lineNumber,a.column)})}}}else ne.getDefineModules().forEach(o=>e.push({label:o,filterText:o,kind:W.CompletionItemKind.Module,detail:o,insertText:o,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet}))},to=(e,t,n,a)=>{let s=n.indexOf('"')+1;if(s===0&&(s=n.indexOf("'")+1),s===0){n=n.trim().replace("import","").trim(),ua(e,n,a+1,t);return}let i=n.substring(a).trim().replace(/['|"]/g,"");if(i.startsWith("@")){if(i.indexOf(" ")>-1)return;let o=ne.getApiFinder();(o&&o()||[]).forEach(r=>{let l="@"+r.method+":"+r.path;e.push({sortText:l,label:l,kind:W.CompletionItemKind.Reference,filterText:l,detail:r.name,insertText:l,range:new ot(t.lineNumber,s+1,t.lineNumber,t.column)})}),o=ne.getFunctionFinder(),(o&&o()||[]).forEach(r=>{let l="@"+r.path;e.push({sortText:l,label:l,kind:W.CompletionItemKind.Reference,filterText:l,detail:r.name,insertText:l,range:new ot(t.lineNumber,s+1,t.lineNumber,t.column)})});return}ua(e,i,s,t)},Dt=async(e,t,n,a,s)=>{if(n=n||{},a&&a instanceof Xe&&await a.getJavaType(n)==="java.lang.Object"){let u=ne.getImportClass();const p=a.variable;u.forEach(m=>{let f=m.substring(m.lastIndexOf(".")+1);f.indexOf(p)>-1&&e.push({sortText:`${f}`,label:f,kind:W.CompletionItemKind.Class,filterText:f,detail:m,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet,command:{id:"editor.action.appendHead",arguments:[`import ${m}\r `]},insertText:f+(s?"()":"")})})}ne.findFunction().forEach(u=>{e.push({sortText:u.sortText||u.fullName,label:u.fullName,filterText:u.name,kind:W.CompletionItemKind.Method,detail:u.comment,insertText:u.insertText,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet})});let i=e.map(u=>u.detail),o=t.match(/[a-zA-Z_$]+/ig)||[],r=o.length,l=Object.keys(n);l.forEach(u=>{e.push({label:u,filterText:u,kind:W.CompletionItemKind.Variable,detail:n[u],insertText:u,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet})}),r>2&&Array.from(new Set(o)).filter((u,p)=>p+2{e.push({label:u,filterText:u,kind:W.CompletionItemKind.Text,detail:u,insertText:u,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet})})},pa=async(e,t)=>{let n=await ne.loadClass(e),a=e.lastIndexOf("."),s=a>0?e.substring(a+1):e,i=ne.findEnums(n);if(i)for(let l=0;l({label:l[0],kind:W.CompletionItemKind.Struct,detail:l[2]||l[1],insertText:l[1],filterText:l[0],insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet,range:i}));return a.length>1&&a.trim().indexOf("import")===0?(to(r,t,a,a.indexOf("import")+6),o=!0):a.endsWith("::")?r=["int","long","date","string","short","byte","float","double","json","stringify","sql"].map(l=>({label:l,detail:`\u8F6C\u6362\u4E3A${l==="stringify"?"json\u5B57\u7B26\u4E32":l==="sql"?"sql\u53C2\u6570\u7C7B\u578B":l}`,insertText:l,kind:W.CompletionItemKind.TypeParameter,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet})):n.length>1?await no(r,n):await Dt(r,n,pe(pe(pe({},sn.environmentFunction()),ne.getAutoImportClass()),ne.getAutoImportModule())),{suggestions:r,incomplete:o}},triggerCharacters:[".",":"]};let $a=function(e,t){for(var n=0,a=0,s=e.length;a16777215||n>16777215)){var s=this._length;this._startIndexes[s]=t,this._endIndexes[s]=n,this._length++,a<1e3&&(this._indentOccurrences[a]=(this._indentOccurrences[a]||0)+1)}}toIndentRanges(t){var n=[];if(this._length<=this._foldingRangesLimit){new Uint32Array(this._length),new Uint32Array(this._length);for(var a=this._length-1,s=0;a>=0;a--,s++)n.push({start:this._startIndexes[a],end:this._endIndexes[a]})}else{for(var i=0,o=this._indentOccurrences.length,a=0;athis._foldingRangesLimit){o=a;break}i+=r}}var l=t.getOptions().tabSize;new Uint32Array(this._foldingRangesLimit),new Uint32Array(this._foldingRangesLimit);for(var a=this._length-1,s=0;a>=0;a--){var u=this._startIndexes[a],p=t.getLineContent(u),m=$a(p,l);(m{let n=e.getOptions().tabSize,a=new io(5e3),s=[],i=e.getLineCount()+1,o=-1,r=-1,l=[];s.push({indent:-1,endAbove:i,line:i});for(let p=e.getLineCount();p>0;p--){let m=e.getLineContent(p);m.startsWith("import")||m.trim().startsWith("import")?o==-1?o=p:r=p:(r>-1&&o>-1&&l.push({start:r,end:o,kind:W.FoldingRangeKind.Imports}),r=-1,o=-1);let f=$a(m,n),y=s[s.length-1];if(f!==-1){if(y.indent>f){do s.pop(),y=s[s.length-1];while(y.indent>f);var u=y.endAbove-1;u-p>=1&&a.insertFirst(p,u,f)}y.indent===f?y.endAbove=p:s.push({indent:f,endAbove:p,line:p})}}return r>-1&&o>-1&&l.push({start:r,end:o,kind:W.FoldingRangeKind.Imports}),l.concat(a.toIndentRanges(e))}},ro={signatureHelpRetriggerCharacters:["(",","],signatureHelpTriggerCharacters:["(",","],provideSignatureHelp:async(e,t,n,a)=>{if(a.activeSignatureHelp){let i=a.activeSignatureHelp;return i.activeSignature+=1,i.activeSignature===i.signatures.length&&(i.activeSignature=0),{dispose:function(){},value:i}}let s=e.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:t.lineNumber,endColumn:t.column});try{let i=zt(s),o=new Yt(new ft(i));const{best:r,env:l}=await o.parseBest(s.length-1);if(r&&r instanceof en){let u=r.target,p=await u.getTarget().getJavaType(l),m=u.member.getText(),f=ne.findMethods(await ne.loadClass(p)),y=[];if(f.filter(E=>E.name===m).forEach(E=>{let C=[];for(let I=E.extension?1:0;I0)return{dispose:function(){},value:{activeParameter:0,activeSignature:0,signatures:y}}}}catch{}}},Ln=(e,t,n)=>{n.push({value:`${e}${t.fullName}`}),t.comment&&n.push({value:`${t.comment}`}),t.parameters.forEach((a,s)=>{(s>0||!t.extension)&&n.push({value:`${a.name}\uFF1A${a.comment||a.type}`})}),n.push({value:`\u8FD4\u56DE\u7C7B\u578B\uFF1A\`${t.returnType}\``})},hn=(e,t,n,a)=>{let s=ne.findFunction().filter(i=>i.name===e);if(s.length>0)Ln("",s[0],n);else{let i=t[e];if(i&&i.indexOf("@")===0){let o=i.substring(1),r=ne.getOnlineFunction(o);if(r){let l=Array.isArray(r.parameter)?r.parameter:JSON.parse(r.parameter||"[]");l.forEach(u=>u.comment=u.description),Ln("",{fullName:e+" "+r.name,comment:r.description||"",parameters:l,returnType:r.returnType},n)}}else n.push({value:`${a?"\u521B\u5EFA\u5BF9\u8C61":"\u8BBF\u95EE\u53D8\u91CF"}\uFF1A${e}`}),n.push({value:`\u7C7B\u578B\uFF1A${i||"unknow"}`})}},lo={provideHover:async(e,t)=>{var u,p,m;let n=e.getValue(),a=zt(n),s=new ft(a),i=new Yt(s),o=i.parse(!0),l=e.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:t.lineNumber,endColumn:t.column}).length;for(let f=0,y=o.length;fD.name===R).forEach(D=>Ln(`${ne.getSimpleClass(v)}.`,D,I)),ne.findEnums(T).filter(D=>D===R).forEach(D=>{I.push({value:`\u8BBF\u95EE\u679A\u4E3E\uFF1A\`${v}.${R}\``})}),ne.findAttributes(T).filter(D=>D.name===R).forEach(D=>{I.push({value:`\u8BBF\u95EE\u5C5E\u6027\uFF1A\`${v}.${R}\``}),D.comment&&I.push({value:`${D.comment}`}),I.push({value:`\u5C5E\u6027\u7C7B\u578B\uFF1A\`${D.type}\``})}),O=E.member.getLine()}else if(E instanceof xn){let v=E.target;hn(v.variable,C,I)}else if(E instanceof Ut){let v=E.identifier;v instanceof Xe&&hn(v,C,I,!0)}else if(E instanceof Jt)I.push({value:"\u8BBF\u95EEMap\u6216\u6570\u7EC4"});else if(E instanceof Pa)I.push({value:"linq\u67E5\u8BE2"});else return;return{range:new ot(O.lineNumber,O.startCol,O.endLineNumber,O.endCol+1),contents:I}}}}},co=()=>{const e="mybatis";W.register({id:e}),W.setLanguageConfiguration(e,{comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]}),W.setMonarchTokensProvider(e,{defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ABORT_AFTER_WAIT","ABSENT","ABSOLUTE","ACCENT_SENSITIVITY","ACTION","ACTIVATION","ACTIVE","ADD","ADDRESS","ADMIN","AES","AES_128","AES_192","AES_256","AFFINITY","AFTER","AGGREGATE","ALGORITHM","ALL_CONSTRAINTS","ALL_ERRORMSGS","ALL_INDEXES","ALL_LEVELS","ALL_SPARSE_COLUMNS","ALLOW_CONNECTIONS","ALLOW_MULTIPLE_EVENT_LOSS","ALLOW_PAGE_LOCKS","ALLOW_ROW_LOCKS","ALLOW_SINGLE_EVENT_LOSS","ALLOW_SNAPSHOT_ISOLATION","ALLOWED","ALTER","ANONYMOUS","ANSI_DEFAULTS","ANSI_NULL_DEFAULT","ANSI_NULL_DFLT_OFF","ANSI_NULL_DFLT_ON","ANSI_NULLS","ANSI_PADDING","ANSI_WARNINGS","APPEND","APPLICATION","APPLICATION_LOG","ARITHABORT","ARITHIGNORE","AS","ASC","ASSEMBLY","ASYMMETRIC","ASYNCHRONOUS_COMMIT","AT","ATOMIC","ATTACH","ATTACH_REBUILD_LOG","AUDIT","AUDIT_GUID","AUTHENTICATION","AUTHORIZATION","AUTO","AUTO_CLEANUP","AUTO_CLOSE","AUTO_CREATE_STATISTICS","AUTO_SHRINK","AUTO_UPDATE_STATISTICS","AUTO_UPDATE_STATISTICS_ASYNC","AUTOMATED_BACKUP_PREFERENCE","AUTOMATIC","AVAILABILITY","AVAILABILITY_MODE","BACKUP","BACKUP_PRIORITY","BASE64","BATCHSIZE","BEGIN","BEGIN_DIALOG","BIGINT","BINARY","BINDING","BIT","BLOCKERS","BLOCKSIZE","BOUNDING_BOX","BREAK","BROKER","BROKER_INSTANCE","BROWSE","BUCKET_COUNT","BUFFER","BUFFERCOUNT","BULK","BULK_LOGGED","BY","CACHE","CALL","CALLED","CALLER","CAP_CPU_PERCENT","CASCADE","CASE","CATALOG","CATCH","CELLS_PER_OBJECT","CERTIFICATE","CHANGE_RETENTION","CHANGE_TRACKING","CHANGES","CHAR","CHARACTER","CHECK","CHECK_CONSTRAINTS","CHECK_EXPIRATION","CHECK_POLICY","CHECKALLOC","CHECKCATALOG","CHECKCONSTRAINTS","CHECKDB","CHECKFILEGROUP","CHECKIDENT","CHECKPOINT","CHECKTABLE","CLASSIFIER_FUNCTION","CLEANTABLE","CLEANUP","CLEAR","CLOSE","CLUSTER","CLUSTERED","CODEPAGE","COLLATE","COLLECTION","COLUMN","COLUMN_SET","COLUMNS","COLUMNSTORE","COLUMNSTORE_ARCHIVE","COMMIT","COMMITTED","COMPATIBILITY_LEVEL","COMPRESSION","COMPUTE","CONCAT","CONCAT_NULL_YIELDS_NULL","CONFIGURATION","CONNECT","CONSTRAINT","CONTAINMENT","CONTENT","CONTEXT","CONTINUE","CONTINUE_AFTER_ERROR","CONTRACT","CONTRACT_NAME","CONTROL","CONVERSATION","COOKIE","COPY_ONLY","COUNTER","CPU","CREATE","CREATE_NEW","CREATION_DISPOSITION","CREDENTIAL","CRYPTOGRAPHIC","CUBE","CURRENT","CURRENT_DATE","CURSOR","CURSOR_CLOSE_ON_COMMIT","CURSOR_DEFAULT","CYCLE","DATA","DATA_COMPRESSION","DATA_PURITY","DATABASE","DATABASE_DEFAULT","DATABASE_MIRRORING","DATABASE_SNAPSHOT","DATAFILETYPE","DATE","DATE_CORRELATION_OPTIMIZATION","DATEFIRST","DATEFORMAT","DATETIME","DATETIME2","DATETIMEOFFSET","DAY","DAYOFYEAR","DAYS","DB_CHAINING","DBCC","DBREINDEX","DDL_DATABASE_LEVEL_EVENTS","DEADLOCK_PRIORITY","DEALLOCATE","DEC","DECIMAL","DECLARE","DECRYPTION","DEFAULT","DEFAULT_DATABASE","DEFAULT_FULLTEXT_LANGUAGE","DEFAULT_LANGUAGE","DEFAULT_SCHEMA","DEFINITION","DELAY","DELAYED_DURABILITY","DELETE","DELETED","DENSITY_VECTOR","DENY","DEPENDENTS","DES","DESC","DESCRIPTION","DESX","DHCP","DIAGNOSTICS","DIALOG","DIFFERENTIAL","DIRECTORY_NAME","DISABLE","DISABLE_BROKER","DISABLED","DISK","DISTINCT","DISTRIBUTED","DOCUMENT","DOUBLE","DROP","DROP_EXISTING","DROPCLEANBUFFERS","DUMP","DURABILITY","DYNAMIC","EDITION","ELEMENTS","ELSE","EMERGENCY","EMPTY","EMPTYFILE","ENABLE","ENABLE_BROKER","ENABLED","ENCRYPTION","END","ENDPOINT","ENDPOINT_URL","ERRLVL","ERROR","ERROR_BROKER_CONVERSATIONS","ERRORFILE","ESCAPE","ESTIMATEONLY","EVENT","EVENT_RETENTION_MODE","EXEC","EXECUTABLE","EXECUTE","EXIT","EXPAND","EXPIREDATE","EXPIRY_DATE","EXPLICIT","EXTENDED_LOGICAL_CHECKS","EXTENSION","EXTERNAL","EXTERNAL_ACCESS","FAIL_OPERATION","FAILOVER","FAILOVER_MODE","FAILURE_CONDITION_LEVEL","FALSE","FAN_IN","FAST","FAST_FORWARD","FETCH","FIELDTERMINATOR","FILE","FILEGROUP","FILEGROWTH","FILELISTONLY","FILENAME","FILEPATH","FILESTREAM","FILESTREAM_ON","FILETABLE_COLLATE_FILENAME","FILETABLE_DIRECTORY","FILETABLE_FULLPATH_UNIQUE_CONSTRAINT_NAME","FILETABLE_NAMESPACE","FILETABLE_PRIMARY_KEY_CONSTRAINT_NAME","FILETABLE_STREAMID_UNIQUE_CONSTRAINT_NAME","FILLFACTOR","FILTERING","FIRE_TRIGGERS","FIRST","FIRSTROW","FLOAT","FMTONLY","FOLLOWING","FOR","FORCE","FORCE_FAILOVER_ALLOW_DATA_LOSS","FORCE_SERVICE_ALLOW_DATA_LOSS","FORCED","FORCEPLAN","FORCESCAN","FORCESEEK","FOREIGN","FORMATFILE","FORMSOF","FORWARD_ONLY","FREE","FREEPROCCACHE","FREESESSIONCACHE","FREESYSTEMCACHE","FROM","FULL","FULLSCAN","FULLTEXT","FUNCTION","GB","GEOGRAPHY_AUTO_GRID","GEOGRAPHY_GRID","GEOMETRY_AUTO_GRID","GEOMETRY_GRID","GET","GLOBAL","GO","GOTO","GOVERNOR","GRANT","GRIDS","GROUP","GROUP_MAX_REQUESTS","HADR","HASH","HASHED","HAVING","HEADERONLY","HEALTH_CHECK_TIMEOUT","HELP","HIERARCHYID","HIGH","HINT","HISTOGRAM","HOLDLOCK","HONOR_BROKER_PRIORITY","HOUR","HOURS","IDENTITY","IDENTITY_INSERT","IDENTITY_VALUE","IDENTITYCOL","IF","IGNORE_CONSTRAINTS","IGNORE_DUP_KEY","IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX","IGNORE_TRIGGERS","IMAGE","IMMEDIATE","IMPERSONATE","IMPLICIT_TRANSACTIONS","IMPORTANCE","INCLUDE","INCREMENT","INCREMENTAL","INDEX","INDEXDEFRAG","INFINITE","INFLECTIONAL","INIT","INITIATOR","INPUT","INPUTBUFFER","INSENSITIVE","INSERT","INSERTED","INSTEAD","INT","INTEGER","INTO","IO","IP","ISABOUT","ISOLATION","JOB","KB","KEEP","KEEP_CDC","KEEP_NULLS","KEEP_REPLICATION","KEEPDEFAULTS","KEEPFIXED","KEEPIDENTITY","KEEPNULLS","KERBEROS","KEY","KEY_SOURCE","KEYS","KEYSET","KILL","KILOBYTES_PER_BATCH","LABELONLY","LANGUAGE","LAST","LASTROW","LEVEL","LEVEL_1","LEVEL_2","LEVEL_3","LEVEL_4","LIFETIME","LIMIT","LINENO","LIST","LISTENER","LISTENER_IP","LISTENER_PORT","LOAD","LOADHISTORY","LOB_COMPACTION","LOCAL","LOCAL_SERVICE_NAME","LOCK_ESCALATION","LOCK_TIMEOUT","LOGIN","LOGSPACE","LOOP","LOW","MANUAL","MARK","MARK_IN_USE_FOR_REMOVAL","MASTER","MAX_CPU_PERCENT","MAX_DISPATCH_LATENCY","MAX_DOP","MAX_DURATION","MAX_EVENT_SIZE","MAX_FILES","MAX_IOPS_PER_VOLUME","MAX_MEMORY","MAX_MEMORY_PERCENT","MAX_QUEUE_READERS","MAX_ROLLOVER_FILES","MAX_SIZE","MAXDOP","MAXERRORS","MAXLENGTH","MAXRECURSION","MAXSIZE","MAXTRANSFERSIZE","MAXVALUE","MB","MEDIADESCRIPTION","MEDIANAME","MEDIAPASSWORD","MEDIUM","MEMBER","MEMORY_OPTIMIZED","MEMORY_OPTIMIZED_DATA","MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT","MEMORY_PARTITION_MODE","MERGE","MESSAGE","MESSAGE_FORWARD_SIZE","MESSAGE_FORWARDING","MICROSECOND","MILLISECOND","MIN_CPU_PERCENT","MIN_IOPS_PER_VOLUME","MIN_MEMORY_PERCENT","MINUTE","MINUTES","MINVALUE","MIRROR","MIRROR_ADDRESS","MODIFY","MONEY","MONTH","MOVE","MULTI_USER","MUST_CHANGE","NAME","NANOSECOND","NATIONAL","NATIVE_COMPILATION","NCHAR","NEGOTIATE","NESTED_TRIGGERS","NEW_ACCOUNT","NEW_BROKER","NEW_PASSWORD","NEWNAME","NEXT","NO","NO_BROWSETABLE","NO_CHECKSUM","NO_COMPRESSION","NO_EVENT_LOSS","NO_INFOMSGS","NO_TRUNCATE","NO_WAIT","NOCHECK","NOCOUNT","NOEXEC","NOEXPAND","NOFORMAT","NOINDEX","NOINIT","NOLOCK","NON","NON_TRANSACTED_ACCESS","NONCLUSTERED","NONE","NORECOMPUTE","NORECOVERY","NORESEED","NORESET","NOREWIND","NORMAL","NOSKIP","NOTIFICATION","NOTRUNCATE","NOUNLOAD","NOWAIT","NTEXT","NTLM","NUMANODE","NUMERIC","NUMERIC_ROUNDABORT","NVARCHAR","OBJECT","OF","OFF","OFFLINE","OFFSET","OFFSETS","OLD_ACCOUNT","OLD_PASSWORD","ON","ON_FAILURE","ONLINE","ONLY","OPEN","OPEN_EXISTING","OPENTRAN","OPTIMISTIC","OPTIMIZE","OPTION","ORDER","OUT","OUTPUT","OUTPUTBUFFER","OVER","OVERRIDE","OWNER","OWNERSHIP","PAD_INDEX","PAGE","PAGE_VERIFY","PAGECOUNT","PAGLOCK","PARAMETERIZATION","PARSEONLY","PARTIAL","PARTITION","PARTITIONS","PARTNER","PASSWORD","PATH","PER_CPU","PER_NODE","PERCENT","PERMISSION_SET","PERSISTED","PHYSICAL_ONLY","PLAN","POISON_MESSAGE_HANDLING","POOL","POPULATION","PORT","PRECEDING","PRECISION","PRIMARY","PRIMARY_ROLE","PRINT","PRIOR","PRIORITY","PRIORITY_LEVEL","PRIVATE","PRIVILEGES","PROC","PROCCACHE","PROCEDURE","PROCEDURE_NAME","PROCESS","PROFILE","PROPERTY","PROPERTY_DESCRIPTION","PROPERTY_INT_ID","PROPERTY_SET_GUID","PROVIDER","PROVIDER_KEY_NAME","PUBLIC","PUT","QUARTER","QUERY","QUERY_GOVERNOR_COST_LIMIT","QUEUE","QUEUE_DELAY","QUOTED_IDENTIFIER","RAISERROR","RANGE","RAW","RC2","RC4","RC4_128","READ","READ_COMMITTED_SNAPSHOT","READ_ONLY","READ_ONLY_ROUTING_LIST","READ_ONLY_ROUTING_URL","READ_WRITE","READ_WRITE_FILEGROUPS","READCOMMITTED","READCOMMITTEDLOCK","READONLY","READPAST","READTEXT","READUNCOMMITTED","READWRITE","REAL","REBUILD","RECEIVE","RECOMPILE","RECONFIGURE","RECOVERY","RECURSIVE","RECURSIVE_TRIGGERS","REFERENCES","REGENERATE","RELATED_CONVERSATION","RELATED_CONVERSATION_GROUP","RELATIVE","REMOTE","REMOTE_PROC_TRANSACTIONS","REMOTE_SERVICE_NAME","REMOVE","REORGANIZE","REPAIR_ALLOW_DATA_LOSS","REPAIR_FAST","REPAIR_REBUILD","REPEATABLE","REPEATABLEREAD","REPLICA","REPLICATION","REQUEST_MAX_CPU_TIME_SEC","REQUEST_MAX_MEMORY_GRANT_PERCENT","REQUEST_MEMORY_GRANT_TIMEOUT_SEC","REQUIRED","RESAMPLE","RESEED","RESERVE_DISK_SPACE","RESET","RESOURCE","RESTART","RESTORE","RESTRICT","RESTRICTED_USER","RESULT","RESUME","RETAINDAYS","RETENTION","RETURN","RETURNS","REVERT","REVOKE","REWIND","REWINDONLY","ROBUST","ROLE","ROLLBACK","ROLLUP","ROOT","ROUTE","ROW","ROWCOUNT","ROWGUIDCOL","ROWLOCK","ROWS","ROWS_PER_BATCH","ROWTERMINATOR","ROWVERSION","RSA_1024","RSA_2048","RSA_512","RULE","SAFE","SAFETY","SAMPLE","SAVE","SCHEDULER","SCHEMA","SCHEMA_AND_DATA","SCHEMA_ONLY","SCHEMABINDING","SCHEME","SCROLL","SCROLL_LOCKS","SEARCH","SECOND","SECONDARY","SECONDARY_ONLY","SECONDARY_ROLE","SECONDS","SECRET","SECURITY_LOG","SECURITYAUDIT","SELECT","SELECTIVE","SELF","SEND","SENT","SEQUENCE","SERIALIZABLE","SERVER","SERVICE","SERVICE_BROKER","SERVICE_NAME","SESSION","SESSION_TIMEOUT","SET","SETS","SETUSER","SHOW_STATISTICS","SHOWCONTIG","SHOWPLAN","SHOWPLAN_ALL","SHOWPLAN_TEXT","SHOWPLAN_XML","SHRINKDATABASE","SHRINKFILE","SHUTDOWN","SID","SIGNATURE","SIMPLE","SINGLE_BLOB","SINGLE_CLOB","SINGLE_NCLOB","SINGLE_USER","SINGLETON","SIZE","SKIP","SMALLDATETIME","SMALLINT","SMALLMONEY","SNAPSHOT","SORT_IN_TEMPDB","SOURCE","SPARSE","SPATIAL","SPATIAL_WINDOW_MAX_CELLS","SPECIFICATION","SPLIT","SQL","SQL_VARIANT","SQLPERF","STANDBY","START","START_DATE","STARTED","STARTUP_STATE","STAT_HEADER","STATE","STATEMENT","STATIC","STATISTICAL_SEMANTICS","STATISTICS","STATISTICS_INCREMENTAL","STATISTICS_NORECOMPUTE","STATS","STATS_STREAM","STATUS","STATUSONLY","STOP","STOP_ON_ERROR","STOPAT","STOPATMARK","STOPBEFOREMARK","STOPLIST","STOPPED","SUBJECT","SUBSCRIPTION","SUPPORTED","SUSPEND","SWITCH","SYMMETRIC","SYNCHRONOUS_COMMIT","SYNONYM","SYSNAME","SYSTEM","TABLE","TABLERESULTS","TABLESAMPLE","TABLOCK","TABLOCKX","TAKE","TAPE","TARGET","TARGET_RECOVERY_TIME","TB","TCP","TEXT","TEXTIMAGE_ON","TEXTSIZE","THEN","THESAURUS","THROW","TIES","TIME","TIMEOUT","TIMER","TIMESTAMP","TINYINT","TO","TOP","TORN_PAGE_DETECTION","TRACEOFF","TRACEON","TRACESTATUS","TRACK_CAUSALITY","TRACK_COLUMNS_UPDATED","TRAN","TRANSACTION","TRANSFER","TRANSFORM_NOISE_WORDS","TRIGGER","TRIPLE_DES","TRIPLE_DES_3KEY","TRUE","TRUNCATE","TRUNCATEONLY","TRUSTWORTHY","TRY","TSQL","TWO_DIGIT_YEAR_CUTOFF","TYPE","TYPE_WARNING","UNBOUNDED","UNCHECKED","UNCOMMITTED","UNDEFINED","UNIQUE","UNIQUEIDENTIFIER","UNKNOWN","UNLIMITED","UNLOAD","UNSAFE","UPDATE","UPDATETEXT","UPDATEUSAGE","UPDLOCK","URL","USE","USED","USER","USEROPTIONS","USING","VALID_XML","VALIDATION","VALUE","VALUES","VARBINARY","VARCHAR","VARYING","VERIFYONLY","VERSION","VIEW","VIEW_METADATA","VIEWS","VISIBILITY","WAIT_AT_LOW_PRIORITY","WAITFOR","WEEK","WEIGHT","WELL_FORMED_XML","WHEN","WHERE","WHILE","WINDOWS","WITH","WITHIN","WITHOUT","WITNESS","WORK","WORKLOAD","WRITETEXT","XACT_ABORT","XLOCK","XMAX","XMIN","XML","XMLDATA","XMLNAMESPACES","XMLSCHEMA","XQUERY","XSINIL","YEAR","YMAX","YMIN"],operators:["ALL","AND","ANY","BETWEEN","EXISTS","IN","LIKE","NOT","OR","SOME","EXCEPT","INTERSECT","UNION","APPLY","CROSS","FULL","INNER","JOIN","LEFT","OUTER","RIGHT","CONTAINS","FREETEXT","IS","NULL","PIVOT","UNPIVOT","MATCHED"],builtinFunctions:["AVG","CHECKSUM_AGG","COUNT","COUNT_BIG","GROUPING","GROUPING_ID","MAX","MIN","SUM","STDEV","STDEVP","VAR","VARP","CUME_DIST","FIRST_VALUE","LAG","LAST_VALUE","LEAD","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","COLLATE","COLLATIONPROPERTY","TERTIARY_WEIGHTS","FEDERATION_FILTERING_VALUE","CAST","CONVERT","PARSE","TRY_CAST","TRY_CONVERT","TRY_PARSE","ASYMKEY_ID","ASYMKEYPROPERTY","CERTPROPERTY","CERT_ID","CRYPT_GEN_RANDOM","DECRYPTBYASYMKEY","DECRYPTBYCERT","DECRYPTBYKEY","DECRYPTBYKEYAUTOASYMKEY","DECRYPTBYKEYAUTOCERT","DECRYPTBYPASSPHRASE","ENCRYPTBYASYMKEY","ENCRYPTBYCERT","ENCRYPTBYKEY","ENCRYPTBYPASSPHRASE","HASHBYTES","IS_OBJECTSIGNED","KEY_GUID","KEY_ID","KEY_NAME","SIGNBYASYMKEY","SIGNBYCERT","SYMKEYPROPERTY","VERIFYSIGNEDBYCERT","VERIFYSIGNEDBYASYMKEY","CURSOR_STATUS","DATALENGTH","IDENT_CURRENT","IDENT_INCR","IDENT_SEED","IDENTITY","SQL_VARIANT_PROPERTY","CURRENT_TIMESTAMP","DATEADD","DATEDIFF","DATEFROMPARTS","DATENAME","DATEPART","DATETIME2FROMPARTS","DATETIMEFROMPARTS","DATETIMEOFFSETFROMPARTS","DAY","EOMONTH","GETDATE","GETUTCDATE","ISDATE","MONTH","SMALLDATETIMEFROMPARTS","SWITCHOFFSET","SYSDATETIME","SYSDATETIMEOFFSET","SYSUTCDATETIME","TIMEFROMPARTS","TODATETIMEOFFSET","YEAR","CHOOSE","COALESCE","IIF","NULLIF","ABS","ACOS","ASIN","ATAN","ATN2","CEILING","COS","COT","DEGREES","EXP","FLOOR","LOG","LOG10","PI","POWER","RADIANS","RAND","ROUND","SIGN","SIN","SQRT","SQUARE","TAN","APP_NAME","APPLOCK_MODE","APPLOCK_TEST","ASSEMBLYPROPERTY","COL_LENGTH","COL_NAME","COLUMNPROPERTY","DATABASE_PRINCIPAL_ID","DATABASEPROPERTYEX","DB_ID","DB_NAME","FILE_ID","FILE_IDEX","FILE_NAME","FILEGROUP_ID","FILEGROUP_NAME","FILEGROUPPROPERTY","FILEPROPERTY","FULLTEXTCATALOGPROPERTY","FULLTEXTSERVICEPROPERTY","INDEX_COL","INDEXKEY_PROPERTY","INDEXPROPERTY","OBJECT_DEFINITION","OBJECT_ID","OBJECT_NAME","OBJECT_SCHEMA_NAME","OBJECTPROPERTY","OBJECTPROPERTYEX","ORIGINAL_DB_NAME","PARSENAME","SCHEMA_ID","SCHEMA_NAME","SCOPE_IDENTITY","SERVERPROPERTY","STATS_DATE","TYPE_ID","TYPE_NAME","TYPEPROPERTY","DENSE_RANK","NTILE","RANK","ROW_NUMBER","PUBLISHINGSERVERNAME","OPENDATASOURCE","OPENQUERY","OPENROWSET","OPENXML","CERTENCODED","CERTPRIVATEKEY","CURRENT_USER","HAS_DBACCESS","HAS_PERMS_BY_NAME","IS_MEMBER","IS_ROLEMEMBER","IS_SRVROLEMEMBER","LOGINPROPERTY","ORIGINAL_LOGIN","PERMISSIONS","PWDENCRYPT","PWDCOMPARE","SESSION_USER","SESSIONPROPERTY","SUSER_ID","SUSER_NAME","SUSER_SID","SUSER_SNAME","SYSTEM_USER","USER","USER_ID","USER_NAME","ASCII","CHAR","CHARINDEX","CONCAT","DIFFERENCE","FORMAT","LEFT","LEN","LOWER","LTRIM","NCHAR","PATINDEX","QUOTENAME","REPLACE","REPLICATE","REVERSE","RIGHT","RTRIM","SOUNDEX","SPACE","STR","STUFF","SUBSTRING","UNICODE","UPPER","BINARY_CHECKSUM","CHECKSUM","CONNECTIONPROPERTY","CONTEXT_INFO","CURRENT_REQUEST_ID","ERROR_LINE","ERROR_NUMBER","ERROR_MESSAGE","ERROR_PROCEDURE","ERROR_SEVERITY","ERROR_STATE","FORMATMESSAGE","GETANSINULL","GET_FILESTREAM_TRANSACTION_CONTEXT","HOST_ID","HOST_NAME","ISNULL","ISNUMERIC","MIN_ACTIVE_ROWVERSION","NEWID","NEWSEQUENTIALID","ROWCOUNT_BIG","XACT_STATE","TEXTPTR","TEXTVALID","COLUMNS_UPDATED","EVENTDATA","TRIGGER_NESTLEVEL","UPDATE","CHANGETABLE","CHANGE_TRACKING_CONTEXT","CHANGE_TRACKING_CURRENT_VERSION","CHANGE_TRACKING_IS_COLUMN_IN_MASK","CHANGE_TRACKING_MIN_VALID_VERSION","CONTAINSTABLE","FREETEXTTABLE","SEMANTICKEYPHRASETABLE","SEMANTICSIMILARITYDETAILSTABLE","SEMANTICSIMILARITYTABLE","FILETABLEROOTPATH","GETFILENAMESPACEPATH","GETPATHLOCATOR","PATHNAME","GET_TRANSMISSION_STATUS"],builtinVariables:["@@DATEFIRST","@@DBTS","@@LANGID","@@LANGUAGE","@@LOCK_TIMEOUT","@@MAX_CONNECTIONS","@@MAX_PRECISION","@@NESTLEVEL","@@OPTIONS","@@REMSERVER","@@SERVERNAME","@@SERVICENAME","@@SPID","@@TEXTSIZE","@@VERSION","@@CURSOR_ROWS","@@FETCH_STATUS","@@DATEFIRST","@@PROCID","@@ERROR","@@IDENTITY","@@ROWCOUNT","@@TRANCOUNT","@@CONNECTIONS","@@CPU_BUSY","@@IDLE","@@IO_BUSY","@@PACKET_ERRORS","@@PACK_RECEIVED","@@PACK_SENT","@@TIMETICKS","@@TOTAL_ERRORS","@@TOTAL_READ","@@TOTAL_WRITE"],pseudoColumns:["$ACTION","$IDENTITY","$ROWGUID","$PARTITION"],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/(<)(where|set|foreach|if|trim|elseif|else)/,["delimiter",{token:"tag",next:"@xml"}]],[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@keywords":"keyword","@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/\[/,{token:"identifier.quote",next:"@bracketedIdentifier"}],[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],bracketedIdentifier:[[/[^\]]+/,"identifier"],[/]]/,"identifier"],[/]/,{token:"identifier.quote",next:"@pop"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/BEGIN\s+(DISTRIBUTED\s+)?TRAN(SACTION)?\b/i,"keyword"],[/BEGIN\s+TRY\b/i,{token:"keyword.try"}],[/END\s+TRY\b/i,{token:"keyword.try"}],[/BEGIN\s+CATCH\b/i,{token:"keyword.catch"}],[/END\s+CATCH\b/i,{token:"keyword.catch"}],[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]],xml:[[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@xmlEmbedded",nextEmbedded:"mybatis"}],[/[ \t\r\n]+/],[/(<\/)(where|if|set|foreach|trim|elseif|else)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],xmlEmbedded:[[/<\/(where|if|set|foreach|trim|elseif|else)/,{token:"tag",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}})},uo=()=>{co();const e="magicscript";W.register({id:e}),W.setLanguageConfiguration(e,{wordPattern:/(-?\d*\.\d\w*)|([^`~!#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]+)/g,brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:W.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:W.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:W.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:W.IndentAction.None,removeText:1}}],comments:{lineComment:"//",blockComment:["/*","*/"]},operators:["<=",">=","==","!=","+","-","*","/","%","&","|","!","&&","||","?",":","++","--","+=","-=","*=","/="],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""',notIn:["string.multi"]},{open:"",close:""},{open:"'},{open:"'},{open:""},{open:"",close:""},{open:"",close:""},{open:"'},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]},{open:"/**",close:" */",notIn:["string"]}]}),W.setMonarchTokensProvider(e,vn),W.registerCompletionItemProvider(e,so),W.registerFoldingRangeProvider(e,oo),W.registerSignatureHelpProvider(e,ro),W.registerHoverProvider(e,lo),W.registerDocumentFormattingEditProvider(e,{provideDocumentFormattingEdits(t,n,a){return[{text:new oe(t.getValue()).beautify(),range:t.getFullModelRange()}]}}),W.registerCompletionItemProvider("html",{triggerCharacters:[">"],provideCompletionItems:(t,n)=>{var o;const s=(o=t.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}).match(/.*<(\w+)>$/))==null?void 0:o[1];if(!s)return;const i=t.getWordUntilPosition(n);return{suggestions:[{label:``,kind:W.CompletionItemKind.EnumMember,insertText:`$1`,insertTextRules:W.CompletionItemInsertTextRule.InsertAsSnippet,range:{startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn}}]}}})};function xe(e,t,n){var a={debug:!1,automaticOpen:!0,reconnectInterval:1e3,maxReconnectInterval:3e4,reconnectDecay:1.5,timeoutInterval:2e3,maxReconnectAttempts:null,binaryType:"blob"};n||(n={});for(var s in a)typeof n[s]!="undefined"?this[s]=n[s]:this[s]=a[s];this.url=e,this.reconnectAttempts=0,this.readyState=WebSocket.CONNECTING,this.protocol=null;var i=this,o,r=!1,l=!1,u=document.createElement("div");u.addEventListener("open",function(m){i.onopen(m)}),u.addEventListener("close",function(m){i.onclose(m)}),u.addEventListener("connecting",function(m){i.onconnecting(m)}),u.addEventListener("message",function(m){i.onmessage(m)}),u.addEventListener("error",function(m){i.onerror(m)}),this.addEventListener=u.addEventListener.bind(u),this.removeEventListener=u.removeEventListener.bind(u),this.dispatchEvent=u.dispatchEvent.bind(u);function p(m,f){var y=document.createEvent("CustomEvent");return y.initCustomEvent(m,!1,!1,f),y}this.open=function(m){if(o=new WebSocket(i.url,t||[]),o.binaryType=this.binaryType,m){if(this.maxReconnectAttempts&&this.reconnectAttempts>this.maxReconnectAttempts)return}else u.dispatchEvent(p("connecting")),this.reconnectAttempts=0;(i.debug||xe.debugAll)&&console.debug("ReconnectingWebSocket","attempt-connect",i.url);var f=o,y=setTimeout(function(){(i.debug||xe.debugAll)&&console.debug("ReconnectingWebSocket","connection-timeout",i.url),l=!0,f.close(),l=!1},i.timeoutInterval);o.onopen=function(E){clearTimeout(y),(i.debug||xe.debugAll)&&console.debug("ReconnectingWebSocket","onopen",i.url),i.protocol=o.protocol,i.readyState=WebSocket.OPEN,i.reconnectAttempts=0;var C=p("open");C.isReconnect=m,m=!1,u.dispatchEvent(C)},o.onclose=function(E){if(clearTimeout(I),o=null,r)i.readyState=WebSocket.CLOSED,u.dispatchEvent(p("close"));else{i.readyState=WebSocket.CONNECTING;var C=p("connecting");C.code=E.code,C.reason=E.reason,C.wasClean=E.wasClean,u.dispatchEvent(C),!m&&!l&&((i.debug||xe.debugAll)&&console.debug("ReconnectingWebSocket","onclose",i.url),u.dispatchEvent(p("close")));var I=i.reconnectInterval*Math.pow(i.reconnectDecay,i.reconnectAttempts);setTimeout(function(){i.reconnectAttempts++,i.open(!0)},I>i.maxReconnectInterval?i.maxReconnectInterval:I)}},o.onmessage=function(E){(i.debug||xe.debugAll)&&console.debug("ReconnectingWebSocket","onmessage",i.url,E.data);var C=p("message");C.data=E.data,u.dispatchEvent(C)},o.onerror=function(E){(i.debug||xe.debugAll)&&console.debug("ReconnectingWebSocket","onerror",i.url,E),u.dispatchEvent(p("error"))}},this.automaticOpen==!0&&this.open(!1),this.send=function(m){if(o)return(i.debug||xe.debugAll)&&console.debug("ReconnectingWebSocket","send",i.url,m),o.send(m);throw"INVALID_STATE_ERR : Pausing to reconnect websocket"},this.close=function(m,f){typeof m=="undefined"&&(m=1e3),r=!0,o&&o.close(m,f)},this.refresh=function(){o&&o.close()}}xe.prototype.onopen=function(e){};xe.prototype.onclose=function(e){};xe.prototype.onconnecting=function(e){};xe.prototype.onmessage=function(e){};xe.prototype.onerror=function(e){};xe.debugAll=!1;xe.CONNECTING=WebSocket.CONNECTING;xe.OPEN=WebSocket.OPEN;xe.CLOSING=WebSocket.CLOSING;xe.CLOSED=WebSocket.CLOSED;let fn={};function qt(e){if(fn[e])try{fn[e].close()}catch{}this.listeners={},this.future=new Promise(t=>{this.resolve=t,this.socket=new xe(e,null,{timeoutInterval:1e4}),fn[e]=this,this.socket.onmessage=this.messageReceived,this.socket.onconnecting=()=>{this.future=new Promise(n=>this.resolve=n),S.status("message.connectDebugServer")},this.socket.onopen=()=>{S.status("message.connectDebugServerSuccess"),S.$emit("ws_open"),this.resolve()},this.socket.onclose=()=>{S.status("message.debugServerClose"),S.$emit("ws_close")}})}qt.prototype.on=function(e,t){this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(t)};qt.prototype.messageReceived=function(e){let t=e.data,n=t.indexOf(","),a=n===-1?t:t.substring(0,n),s=[];for(;n>-1;){if(t=t.substring(n+1),t.startsWith("[")||t.startsWith("{")){s.push(JSON.parse(t));break}n=t.indexOf(","),s.push(n===-1?t:t.substring(0,n))}S.$emit("ws_"+a,s)};qt.prototype.send=function(e){this.future.then(()=>{this.socket.send(e)})};qt.prototype.close=function(){this.socket.close()};var Re={OPEN:"open",BREAKPOINT:"breakpoint",LOGIN:"login",RESUME_BREAKPOINT:"resume_breakpoint",LOGIN_RESPONSE:"login_response",LOG:"log",LOGS:"logs",EXCEPTION:"exception",USER_LOGIN:"user_login",USER_LOGOUT:"user_logout",ONLINE_USERS:"online_users",SET_FILE_ID:"set_file_id",INTO_FILE_ID:"into_file_id",PING:"ping",PONG:"pong"},F={DO_SAVE:"doSave",DO_TEST:"doTest",LOGINED:"logined",LOGOUT:"logout",DO_DOWNLOAD:"do-download",DO_UPLOAD:"do-upload",DO_PUSH:"do-push",DO_RECENT:"do-recent",OPEN:"open",SELECT_NAVBAR_BY_ITEM:"select-navbar-by-item",OPEN_WITH_ID:"open-with-id",OPEN_ITEM:"open-item",DELETE_FILE:"delete-file",DEBUG_CONTINUE:"debug-continue",DEBUG_SETPINTO:"debug-setpinto",SWITCH_THEME:"switch-theme",OPEN_GROUP:"open-group",SWITCH_TOOLBAR:"switch-toolbar",STATUS:"status",MESSAGE:"message",CLOSE:"close",OPEN_EMPTY:"open-empty",LOAD_RESOURCES:"load-resources",REFRESH_RESOURCE:"refresh-resource",DO_SEARCH:"doSearch",NOTIFY:"notify",RELOAD_RESOURCES:"reload-resources",RELOAD_RESOURCES_FINISH:"reload-resources-finish",LOAD_RESOURCES_FINISH:"load-resources-finish",ADD_FOOTER_TOOLBAR:"add-footer-toolbar"};const po=A("div",{class:"magic-mounts"},null,-1),_o={props:{config:{type:Object,required:!0}},setup(e){const t=e;uo(),Ke("bus",S),self.MonacoEnvironment={getWorker:function(N,$){return $==="json"?new os:$==="html"?new rs:new ls}},t.config.header=t.config.header||{};const n=U(!1),a=U(null),s=U(null),i=U(!1),o=U(null);Ke("ELEMENT_ROOT",s),Ke("activateUserFiles",U({}));let r=null;const l=t.config;M.BASE_URL=l.baseURL||"",M.SERVER_URL=l.serverURL||"";let u=`${location.protocol}//${location.host}${location.pathname}`.replace("/index.html","");M.BASE_URL.startsWith("http")?u=M.BASE_URL:M.BASE_URL.startsWith("/")?u=`${location.protocol}/${location.host}${M.BASE_URL}`:u=u+"/"+M.BASE_URL,l.blockClose!==!1&&(window.onbeforeunload=()=>"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002");const p=l.request||{beforeSend:N=>N,onError:N=>Promise.reject(N)};z.getAxios().interceptors.request.use(N=>p.beforeSend&&p.beforeSend(N)||N,N=>p.onError&&p.onError(N)||Promise.reject(N));const m=l.response||{onSuccess:N=>N,onError:N=>Promise.reject(N)};z.getAxios().interceptors.response.use(N=>m.onSuccess&&m.onSuccess(N)||N,N=>m.onError&&m.onError(N)||Promise.reject(N)),z.setBaseURL(M.BASE_URL),M.AUTO_SAVE=l.autoSave!==!1,S.status("message.loadClass"),Ke("i18n.format",c);const f=()=>new Promise(N=>{z.sendGet("/plugins").success($=>Promise.all(($||[]).filter(Y=>Y.javascriptFilename).map(Y=>new Promise(re=>{S.status("plugin.loading",!0,Y.name),ri(it(u+"/plugins/"+Y.javascriptFilename)).then(()=>{M.PLUGINS.push(window[Y.globalName]({i18n:{add:xs,format:c},request:z,constants:M,Message:F,bus:S,modal:ve,JavaClass:ne,monaco:cs})),S.status("plugin.loaded",!0,Y.name),re()}).catch(ie=>{S.status("plugin.loadFailed",!1,Y.name),re()})}))).then(()=>N())).error(()=>N())}),y=St().appContext.app;Promise.all([ne.initClasses(),ne.initImportClass(),f()]).then(()=>S.status("message.loadClassFinish")).catch(N=>{S.status("message.loadClassError")}).finally(()=>{M.PLUGINS.forEach(N=>{N.datasources&&N.datasources.filter($=>$.component).forEach($=>{y.component(`magic-datasource-${$.type}`,$.component)})}),i.value=!0});const E=t.config.options||[];Ke("options",E),z.sendGet("/options").success(N=>{N.forEach($=>E.push($))});const C=()=>{M.LOGINED=!0,r=new qt(it(u.replace(/^http/,"ws")+"/console")),be(()=>a.value.loadResources())};S.$on(F.LOGINED,C);const I=()=>{fetch("https://console.ssssssss.org.cn/latest?group=org.ssssssss&artifactId=magic-api&from="+M.MAGIC_API_VERSION_TEXT).then(N=>{t.config.checkUpdate!==!1&&N.status===200&&N.json().then($=>{$.version&&$.version!=="unknown"&&M.config.version!==$.version?(S.status("message.newVersionRelease",!0,$.version),$.version!==Fe.get(M.IGNORE_VERSION)&&S.$emit(F.NOTIFY,{title:c("message.tips"),icon:"warning",content:c("message.versionUpdate",$.version),buttons:[{title:c("message.changelog"),onClick:()=>{window.open("http://www.ssssssss.org/magic-api/changelog.html")}},{title:c("message.ignore"),onClick:()=>{Fe.set(M.IGNORE_VERSION,$.version)}}]})):S.status("message.versionLastest")})})},O=()=>l.getMagicTokenValue&&l.getMagicTokenValue()||Fe.get(M.STORE.token)||M.HEADER_MAGIC_TOKEN_VALUE,v=()=>new Promise(N=>{M.HEADER_MAGIC_TOKEN_VALUE=O(),S.status("message.tryAutoLogin"),z.sendPost("/login").success($=>{n.value=!$,$&&be(()=>{S.status("message.autoLoginSuccess"),S.$emit(F.LOGINED)})}).end(N)}),T=()=>{typeof hideMaLoading=="function"&&hideMaLoading()},R=()=>{z.execute({url:"/config.json",method:"get"}).then(N=>{if(M.config=N.data,t.config.inJar&&location.href.indexOf(N.data.web)>-1){let $=location.href.substring(0,location.href.indexOf(N.data.web));M.SERVER_URL=it($+"/"+(N.data.prefix||""))}M.config.version&&M.config.version!==M.MAGIC_API_VERSION_TEXT&&(S.status("message.versionConflict",!1,M.MAGIC_API_VERSION_TEXT,M.config.version),S.$emit(F.NOTIFY,{icon:"error",title:c("message.versionCheck"),content:c("message.versionConflict",M.MAGIC_API_VERSION_TEXT,M.config.version)})),v().then(()=>{T(),I()})}).catch(N=>{console.error(N),T(),o.value=c("message.loadConfigError")})},D=()=>{const N=document.body;ce.bind(N,ce.Ctrl|ce.S,()=>S.$emit(F.DO_SAVE,!0)),ce.bind(N,ce.Ctrl|ce.Q,()=>S.$emit(F.DO_TEST)),ce.bind(N,ce.Ctrl|ce.E,()=>S.$emit(F.DO_RECENT)),ce.bind(N,ce.F8,()=>S.$emit(F.DEBUG_CONTINUE)),ce.bind(N,ce.F6,()=>S.$emit(F.DEBUG_SETPINTO)),ce.bind(N,ce.Ctrl|ce.Shift|ce.F,()=>S.$emit(F.DO_SEARCH))};ht(()=>{D()}),Xa(()=>ce.unbind());const L=Je({});return un("default",Ms),un("dark",Ps),Object.keys(l.themes||{}).forEach(N=>{un(N,l.themes[N])}),M.THEME=l.theme||"default",M.DEFAULT_EXPAND=l.defaultExpand!==!1,M.JDBC_DRIVERS=l.jdbcDrivers||M.JDBC_DRIVERS,M.DATASOURCE_TYPES=l.datasourceTypes||M.DATASOURCE_TYPES,l.editorFontFamily!==void 0&&(M.EDITOR_FONT_FAMILY=l.editorFontFamily),l.editorFontSize!==void 0&&(M.EDITOR_FONT_SIZE=l.editorFontSize),M.FONT_LIGATURES=l.fontLigatures!==!1,l.logMaxRows!==void 0&&(M.LOG_MAX_ROWS=Math.max(l.logMaxRows,10)),l.decorationTimeout!==void 0&&(M.DECORATION_TIMEOUT=l.decorationTimeout),S.$on(F.MESSAGE,(N,$)=>{r&&($?r.send(`${N},${$}`):r.send(N))}),S.$event(Re.OPEN,()=>{M.CLIENT_ID=ai(16),be(()=>S.send(Re.LOGIN,[O(),M.CLIENT_ID].join(",")))}),S.$event(Re.LOGIN_RESPONSE,([N,$])=>{N==="1"&&(M.user=$)}),S.$on(F.LOGOUT,()=>{n.value=!0,r&&r.close(),r=null}),(N,$)=>{const Y=b("magic-login"),re=b("magic-header"),ie=b("magic-main"),Q=b("magic-status-bar"),ye=b("magic-notify");return g(),w("div",{class:"magic-editor",style:ze(h(L)),onContextmenu:$[2]||($[2]=Se(()=>{},["prevent"])),ref_key:"root",ref:s},[yt(_(Y,{value:n.value,"onUpdate:value":$[0]||($[0]=Te=>n.value=Te),error:o.value,"onUpdate:error":$[1]||($[1]=Te=>o.value=Te)},null,8,["value","error"]),[[$t,n.value]]),i.value?(g(),j(re,{key:0,themeStyle:h(L),header:h(l).header,title:h(l).title},null,8,["themeStyle","header","title"])):X("",!0),i.value?(g(),j(ie,{key:1,ref_key:"componentMain",ref:a,onOnLoad:R},null,512)):X("",!0),i.value?(g(),j(Q,{key:2,config:h(l)},null,8,["config"])):X("",!0),i.value?(g(),j(ye,{key:3})):X("",!0),po],36)}}};var ho=Object.freeze(Object.defineProperty({__proto__:null,default:_o},Symbol.toStringTag,{value:"Module"}));var q=(e,t)=>{const n=e.__vccOpts||e;for(const[a,s]of t)n[a]=s;return n};const fo={props:{menus:Array,onDestory:Function,position:Object},data(){return{style:{left:this.position.x+"px",top:this.position.y+"px",element:U(null)}}},mounted(){document.addEventListener("click",this.onMouseup);const e=document.querySelector(".magic-editor").getBoundingClientRect(),t=e.x+e.width,n=e.y+e.height,a=this.$el.getBoundingClientRect();a.x+a.width>t&&(this.style.left=`${t-a.width}px`),a.y+a.height>n&&(this.style.top=`${n-a.height}px`)},unmounted(){document.removeEventListener("click",this.onMouseup)},methods:{onMouseup(){this.onDestory&&this.onDestory()}}},mo=["onClick"],go={key:0,class:"magic-context-menu-icon"},vo={class:"magic-context-menu-icon right"},Eo={class:"magic-context-menu none-select"},bo=["onClick"],yo={key:0,class:"magic-context-menu-icon"};function To(e,t,n,a,s,i){const o=b("magic-icon");return g(),w("ul",{class:"magic-context-menu none-select",style:ze(s.style),ref:"element"},[(g(!0),w(Z,null,he(n.menus,(r,l)=>(g(),w("li",{key:l,class:Ee({divided:r.divided}),onClick:Se(()=>{i.onMouseup(),r.onClick&&r.onClick()},["stop"])},[n.menus.some(u=>u.icon)?(g(),w("span",go,[r.icon?(g(),j(o,{key:0,icon:r.icon,size:"12px"},null,8,["icon"])):X("",!0)])):X("",!0),A("label",null,B(r.label),1),r.children?(g(),w(Z,{key:1},[A("span",vo,[_(o,{icon:"right",size:"12px"})]),A("ul",Eo,[(g(!0),w(Z,null,he(r.children,(u,p)=>(g(),w("li",{key:p,class:Ee({divided:u.divided}),onClick:Se(()=>{i.onMouseup(),u.onClick&&u.onClick()},["stop"])},[r.children.some(m=>m.icon)?(g(),w("span",yo,[u.icon?(g(),j(o,{key:0,icon:u.icon,size:"12px"},null,8,["icon"])):X("",!0)])):X("",!0),A("label",null,B(u.label),1)],10,bo))),128))])],64)):X("",!0)],10,mo))),128))],4)}var Ba=q(fo,[["render",To],["__scopeId","data-v-50740138"]]),So=Object.freeze(Object.defineProperty({__proto__:null,default:Ba},Symbol.toStringTag,{value:"Module"}));const Oo={class:"magic-empty"},xo={props:{text:{type:String,default:c("message.nodata")}},setup(e){return(t,n)=>(g(),w("div",Oo,[A("p",null,B(e.text),1)]))}};var Ro=q(xo,[["__scopeId","data-v-70308d5a"]]),Ao=Object.freeze(Object.defineProperty({__proto__:null,default:Ro},Symbol.toStringTag,{value:"Module"}));const Io={class:"icon"},Co={props:{loading:Boolean,loadingText:{type:String,default:c("message.loading")},style:Object},setup(e){return(t,n)=>{const a=b("magic-icon");return e.loading?(g(),w("div",{key:0,class:"magic-loading",style:ze(e.style)},[A("p",null,[A("span",Io,[_(a,{icon:"refresh",size:"20px"})]),_e(" "+B(e.loadingText),1)])],4)):Ot(t.$slots,"default",{key:1},void 0,!0)}}};var Lo=q(Co,[["__scopeId","data-v-19c11c56"]]),No=Object.freeze(Object.defineProperty({__proto__:null,default:Lo},Symbol.toStringTag,{value:"Module"}));const wo={props:{language:{type:String,required:!0},editorConfig:{type:Object,default:{}},value:Array},setup(){return{instance:null,instancePromise:null}},mounted(){this.instance=Be.createDiffEditor(this.$refs.editor,Ue(pe({},this.editorConfig),{enableSplitViewResizing:!1,language:this.language,minimap:{enabled:!1},folding:!1,lineDecorationsWidth:20,wordWrap:"on",fixedOverflowWidgets:!1,fontFamily:M.EDITOR_FONT_FAMILY,fontSize:M.EDITOR_FONT_SIZE,fontLigatures:M.FONT_LIGATURES,renderWhitespace:"none",theme:M.THEME,readOnly:this.readonly===!0,value:this.value||"",automaticLayout:!0})),this.instance.setModel({original:Be.createModel(this.value[0],this.language),modified:Be.createModel(this.value[1],this.language)}),tt(()=>this.language,()=>{nextTick(()=>this.instance.setModel({original:Be.createModel(this.value[0],this.language),modified:Be.createModel(this.value[1],this.language)}))})},methods:{getEditorDom(){return this.$refs.editor},getInstance(){return this.instance}},watch:{value(e){this.instance.setModel({original:Be.createModel(e[0],this.language),modified:Be.createModel(e[1],this.language)})}}},ko={class:"magic-monaco-editor",ref:"editor"};function Do(e,t,n,a,s,i){return g(),w("div",ko,null,512)}var Mo=q(wo,[["render",Do],["__scopeId","data-v-59a04eab"]]),Po=Object.freeze(Object.defineProperty({__proto__:null,default:Mo},Symbol.toStringTag,{value:"Module"}));const Uo={props:{language:{type:String,required:!0},editorConfig:{type:Object,default:{}},value:String,decorations:Array,readonly:{type:Boolean,default:!1},supportBreakpoint:{type:Boolean,default:!1},matches:String},setup(){return{instance:null,instancePromise:null}},emits:["update:value","change","update:decorations"],mounted(){this.instance=Be.create(this.$refs.editor,Ue(pe({},this.editorConfig),{language:this.language,minimap:{enabled:!1},folding:!0,lineDecorationsWidth:this.supportBreakpoint?35:void 0,wordWrap:"on",fontFamily:M.EDITOR_FONT_FAMILY,fontSize:M.EDITOR_FONT_SIZE,fontLigatures:M.FONT_LIGATURES,renderWhitespace:"none",theme:M.THEME,readOnly:this.readonly===!0,value:this.value||"",automaticLayout:!0})),tt(()=>this.language,()=>{be(()=>this.instance.setModel(Be.createModel(this.instance.getModel().getValue(),this.language)))}),this.instance.onDidChangeModelContent(e=>{this.$emit("update:value",this.instance.getValue()),this.$emit("change",e),this.doValidate()}),this.instance.addAction({id:"editor.action.triggerSuggest.extension",label:c("editor.triggerSuggest"),precondition:"!suggestWidgetVisible && !markersNavigationVisible && !parameterHintsVisible && !findWidgetVisible",run:()=>{this.instance.trigger(null,"editor.action.triggerSuggest",{})}}),Xn.registerCommand("editor.action.appendHead",(e,t)=>{var n;((n=this.value)==null?void 0:n.indexOf(t))>-1||(this.instance.executeEdits("command",[{forceMoveMarkers:!0,text:t,range:new ot(1,0,1,0)}]),this.instance.setScrollTop(this.instance.getScrollTop()-22))}),this.instance.addCommand(ut.Alt|gt.US_SLASH,()=>{let e=this.instance.getAction("editor.action.triggerParameterHints"),t=this.instance.getAction("editor.action.triggerSuggest.extension");e.run().then(()=>{setTimeout(()=>{t.isSupported()&&t.run()},0)})},"!findWidgetVisible && !inreferenceSearchEditor && !editorHasSelection"),this.initKeys(),this.initDecorations()},methods:{doValidate(){if(this.instance&&Be.setModelMarkers(this.instance.getModel(),"validate",[{}]),this.language==="magicscript")try{new Yt(new ft(zt(this.instance.getValue()))).parse()}catch(e){if(e.span){let t=e.span.getLine();Be.setModelMarkers(this.instance.getModel(),"validate",[{startLineNumber:t.lineNumber,endLineNumber:t.endLineNumber,startColumn:t.startCol,endColumn:t.endCol,message:e.message,severity:us.Error}])}}},getEditorDom(){return this.$refs.editor},getScrollTop(){return this.instance&&this.instance.getScrollTop()},setScrollTop(e){this.instance&&this.instance.setScrollTop(e)},match(){this.matches&&be(()=>{let e=this.instance.getModel().findMatches(this.matches);e&&e.length>0&&this.instance.setSelections(e.map(({range:t})=>({positionColumn:t.endColumn,positionLineNumber:t.endLineNumber,selectionStartColumn:t.startColumn,selectionStartLineNumber:t.startLineNumber})))})},initKeys(){[["editor.action.triggerParameterHints",ut.Alt|gt.US_SLASH],["editor.action.triggerSuggest",ut.Alt|gt.US_SLASH],["toggleSuggestionDetails",ut.Alt|gt.US_SLASH,ps.deserialize("suggestWidgetVisible && textInputFocus")],["editor.action.formatDocument",ut.CtrlCmd|ut.Alt|gt.KEY_L],["editor.action.marker.nextInFiles",ut.CtrlCmd|gt.F8]].forEach(t=>{var i;let n=t[0];const{handler:a,when:s}=(i=Xn.getCommand(n))!=null?i:{};if(a){let o=ln._coreKeybindings.findIndex(r=>r.command===n);o>0&&ln._coreKeybindings.splice(o,1),this.instance._standaloneKeybindingService.addDynamicKeybinding(n,t[1],a,s||t[2])}}),ln._cachedMergedKeybindings=null},getInstance(){return this.instance},initDecorations(){this.instance.onMouseDown(e=>{if(!e.target.element.classList.contains("codicon")&&e.target.detail&&e.target.detail.offsetX&&e.target.detail.offsetX>=0&&e.target.detail.offsetX<=65){var t=e.target.position.lineNumber;if(this.instance.getModel().getLineContent(t).trim()==="")return;let a=this.instance.getLineDecorations(t).filter(s=>s.options.linesDecorationsClassName==="breakpoints");a&&a.length>0?this.instance.getModel().deltaDecorations([a[0].id],[]):this.instance.getModel().deltaDecorations([],[{range:new ot(t,1,t,1),options:{isWholeLine:!0,linesDecorationsClassName:"breakpoints",className:"breakpoint-line"}}]),this.updateDecoration()}})},appendDecoration(e){const t=this.instance.deltaDecorations([],e);return this.updateDecoration(),t},removedDecorations(e){this.instance.deltaDecorations(e,[]),this.updateDecoration()},updateDecoration(){this.$emit("update:decorations",this.instance.getModel().getAllDecorations())}},watch:{value(e){e!==this.instance.getValue()&&(this.instance.setValue(e||""),this.match())},matches(){this.match()}}},$o={class:"magic-monaco-editor",ref:"editor"};function Bo(e,t,n,a,s,i){return g(),w("div",$o,null,512)}var Fo=q(Uo,[["render",Bo],["__scopeId","data-v-9b3f02a8"]]),Ho=Object.freeze(Object.defineProperty({__proto__:null,default:Fo},Symbol.toStringTag,{value:"Module"}));const jo={props:{max:Number,min:Number,value:Number,direction:String,reverse:{type:Boolean,default:!1}},setup(e){return{style:U({[e.direction==="x"?"width":"height"]:(e.value||e.min)+"px"})}},mounted(){new ResizeObserver(this.updateCss).observe(this.$refs.resizer)},methods:{updateCss(){try{const e=this.$refs.resizer.parentElement;this.$refs.resizer.style.setProperty("--width",e.offsetWidth+"px"),this.$refs.resizer.style.setProperty("--height",e.offsetHeight+"px")}catch{}},mousedown(e){const t=this.direction==="x",n=t?e.clientX:e.clientY,a=e.target.parentElement.getBoundingClientRect();document.onmousemove=s=>{let i=t?a.width:a.height;t?this.reverse?i=n-s.clientX+a.width:i=s.clientX-n+a.width:this.reverse?i=s.clientY-n+a.height:i=n-s.clientY+a.height,i>=this.min&&i<=this.max&&(this.style[t?"width":"height"]=`${i}px`)},document.onmouseup=()=>{document.onmousemove=document.onmouseup=null},e.stopPropagation(),e.preventDefault()}}};function Vo(e,t,n,a,s,i){return g(),w("div",{class:Ee(`magic-resizer-${this.direction}`),style:ze(a.style)},[Ot(e.$slots,"default",{},void 0,!0),A("div",{class:Ee(["magic-resizer-event",{reverse:n.reverse}]),onMousedown:t[0]||(t[0]=(...o)=>i.mousedown&&i.mousedown(...o)),ref:"resizer"},null,34)],6)}var Go=q(jo,[["render",Vo],["__scopeId","data-v-032bc45e"]]),zo=Object.freeze(Object.defineProperty({__proto__:null,default:Go},Symbol.toStringTag,{value:"Module"}));const Yo={class:"magic-navbar-item"},qo={props:{title:String,style:Object,show:{type:Boolean,default:!0},to:HTMLElement},setup(e){return(t,n)=>(g(),w("div",Yo,[Ot(t.$slots,"default",{},void 0,!0)]))}};var Ko=q(qo,[["__scopeId","data-v-30388e35"]]),Wo=Object.freeze(Object.defineProperty({__proto__:null,default:Ko},Symbol.toStringTag,{value:"Module"})),Xo=`/* \u5BFC\u822A\u6761 */\r .magic-navbar {\r display: flex;\r background-color: var(--main-background-color);\r transition: 0.3s;\r }\r \r .magic-navbar .magic-navbar-body {\r background-color: var(--navbar-body-background-color);\r overflow: auto;\r }\r .magic-navbar .magic-navbar-header li:hover {\r background-color: var(--main-hover-background-color);\r }\r .magic-navbar .magic-navbar-header li.selected {\r background-color: var(--main-selected-background-color);\r color: var(--main-selected-color);\r }\r .magic-navbar .magic-navbar-header li.selected svg text{\r fill: var(--main-selected-color);\r }\r .magic-navbar .magic-navbar-header li svg text{\r letter-spacing: 0px;\r font-size: 10px;\r }\r /* \u5782\u76F4\u5BFC\u822A\u6761 */\r .magic-navbar__vertical.reverse {\r flex-direction: row-reverse;\r }\r .magic-navbar__vertical .magic-navbar-header li {\r display: flex;\r flex-direction: column;\r align-items: center;\r overflow: hidden;\r padding: 8px 3px;\r cursor: pointer;\r border-bottom: 1px solid var(--main-border-color);\r }\r .magic-navbar__vertical .magic-navbar-header {\r width: 22px;\r height: 100%;\r letter-spacing: 2px;\r text-align: center;\r padding: 0;\r border-right: 1px solid var(--main-border-color);\r }\r .magic-navbar__vertical.reverse .magic-navbar-header {\r border-left: 1px solid var(--main-border-color);\r border-right: none;\r }\r .magic-navbar__vertical.reverse .magic-navbar-header li {\r display: flex;\r flex-direction: column-reverse;\r }\r \r .magic-navbar__vertical .magic-navbar-header li {\r line-height: 14px;\r word-break: break-all;\r }\r \r .magic-navbar__vertical .magic-navbar-body {\r flex: 1;\r }\r .magic-navbar__vertical .magic-navbar-body {\r border-right: 1px solid var(--navbar-body-border-color);\r }\r .magic-navbar__vertical.reverse .magic-navbar-body {\r border-left: 1px solid var(--navbar-body-border-color);\r border-right: none;\r }\r \r /* \u6C34\u5E73\u5BFC\u822A\u6761 */\r .magic-navbar__horizontal > ul {\r width: 100%;\r }\r .magic-navbar__horizontal > ul li {\r display: inline-flex;\r flex-direction: row-reverse;\r padding: 0 8px;\r height: 24px;\r line-height: 24px;\r cursor: pointer;\r color: var(--main-color);\r }\r .magic-navbar__horizontal > ul li svg.magic-icon {\r height: 100%;\r margin-right: 4px;\r }\r .magic-navbar__horizontal > ul {\r border-top: 1px solid var(--main-border-color);\r }\r .magic-navbar.magic-navbar__vertical .magic-navbar-title{\r padding-bottom: 4px;\r }\r .magic-navbar.magic-navbar__vertical.reverse .magic-navbar-title{\r padding-top: 4px;\r padding-bottom: 0px;\r }\r `,Jo=Object.freeze(Object.defineProperty({__proto__:null,default:Xo},Symbol.toStringTag,{value:"Module"}));const Qo={"aria-hidden":"true",class:"magic-icon"},Zo=["xlink:href"],er={props:{prefix:{type:String,default:"magic-icon"},icon:String,size:String},setup(e){const t=e,n=me(()=>t.icon&&t.icon.startsWith("#")?t.icon:`#${t.prefix}-${t.icon}`),a=me(()=>t.icon&&t.icon.startsWith("#")?t.icon.substring(1):`${t.prefix}-${t.icon}`);return(s,i)=>(g(),w("svg",Qo,[A("use",{"xlink:href":h(n),class:Ee(h(a))},null,10,Zo)]))}};var Vn=q(er,[["__scopeId","data-v-15383e92"]]),tr=Object.freeze(Object.defineProperty({__proto__:null,default:Vn},Symbol.toStringTag,{value:"Module"}));var nr={props:{direction:{type:String,default:""},reverse:{type:Boolean,default:!1},defaultSelect:{type:Number,default:0},allowClose:{type:Boolean,default:!0},spliter:Boolean,value:Array,to:HTMLElement},setup(e,t){const n=U(e.defaultSelect);return{slots:me(()=>t.slots.default()[0].children),navbars:me(()=>t.slots.default()[0].children.flatMap(a=>a.props)),selectIndex:n}},methods:{select(e){this.selectIndex=e}},render(){const e=a=>{const s=parseInt(Math.random()*1e8),i=a.length*6;return le("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:22,height:i},[le("defs",le("path",{id:`path-text-${s}`,d:this.reverse?`M6,0 L6,${i}`:`M14,${i} L14,0`})),le("text",{fill:"var(--main-color)"},le("textPath",{"xlink:href":`#path-text-${s}`},a))])},t=a=>{if(this.spliter&&this.direction==="vertical"&&a.match(/\w/g)){const s=[];let i="",o=1,r;const l=a.split("");for(let u=0,p=l.length;u{const i=[le("div",{class:"magic-navbar-title"},[...t(a.title)])];a.icon&&i.push(le(Vn,{icon:a.icon}));const o=a.style||{};return a.show===!1&&(o.display="none"),le("li",{class:this.selectIndex===s?"selected":"",style:o,onClick:()=>{this.selectIndex===s&&this.allowClose?this.selectIndex=-1:this.selectIndex=s}},i)}))];return this.slots.forEach((a,s)=>{const i=s!==this.selectIndex||a.props.show===!1?{display:"none"}:{};this.to?n.push(le(ha,{to:this.to},le("div",{class:"magic-navbar-body",style:i},a))):n.push(le("div",{class:"magic-navbar-body",style:i},a))}),le("div",{class:`magic-navbar magic-navbar__${this.direction}`+(this.reverse?" reverse":"")},n)}},ar=Object.freeze(Object.defineProperty({__proto__:null,default:nr},Symbol.toStringTag,{value:"Module"})),sr=`.magic-tab {\r width: 100%;\r overflow: hidden;\r flex-wrap: nowrap;\r white-space: nowrap;\r transition: 0.3s;\r }\r .magic-tab ul {\r overflow-x: auto;\r }\r .magic-tab ul li {\r display: inline-block;\r cursor: pointer;\r padding: 0 10px;\r height: 24px;\r line-height: 24px;\r }\r .magic-tab ul li.selected,\r .magic-tab ul li:hover,\r .magic-tab.magic-script-tab ul li.selected:hover,\r .magic-tab ul li.draggable-target-item {\r background-color: var(--main-hover-background-color);\r }\r .magic-tab.magic-script-tab {\r border-bottom: 1px solid var(--main-border-color);\r height: 30px;\r position: absolute;\r }\r .magic-tab.magic-script-tab ul li {\r height: 30px;\r line-height: 30px;\r border-bottom: 3px solid transparent;\r }\r .magic-tab.magic-script-tab ul li.selected {\r border-bottom-color: #4083c9;\r background-color: var(--tab-selected-background-color);\r }\r `,ir=Object.freeze(Object.defineProperty({__proto__:null,default:sr},Symbol.toStringTag,{value:"Module"}));var or={props:{tabs:Array,className:String,value:Object,allowClose:{type:Boolean}},emits:["update:value","change","close","item-contextmenu","before-change"],setup(e){const t=U({}),n=U({});function a(o,r,l){switch(l){case"dragstart":t.value=o,r.stopPropagation();break;case"dragenter":n.value=o,r.stopPropagation();break;case"dragend":if(t.value!==n.value){const u=e.tabs.indexOf(t.value),p=e.tabs.indexOf(n.value);e.tabs.splice(u,1),e.tabs.splice(p,0,t.value)}n.value={},r.stopPropagation();break;case"dragover":t.value!==n.value&&r.preventDefault();break}}const s=U({});function i(o){let r=o.wheelDelta||o.detail;s.value.value.el.scrollLeft+=r>0?-100:100}return{selectIndex:U(0),draggableItem:t,draggableTargetItem:n,tabDraggable:a,scrollbar:s,scrollbarHandler:i,scrollId:"",scrollItem:U(null)}},mounted(){be(()=>{this.scrollbar.value.el.addEventListener("DOMMouseScroll",this.scrollbarHandler,!1),this.scrollbar.value.el.addEventListener("mousewheel",this.scrollbarHandler,!1)})},methods:{scrollIntoView(e){this.scrollId="s"+new Date().getTime()+parseInt(Math.random()*1e7),this.scrollItem=e,be(()=>{const t=document.querySelector("#"+this.scrollId);t&&t.scrollIntoView(!0)})}},destroyed(){be(()=>{this.scrollbar.value.el.removeEventListener("DOMMouseScroll",this.scrollbarHandler),this.scrollbar.value.el.removeEventListener("mousewheel",this.scrollbarHandler)})},render(){const e=this.tabs&&le("ul",this.tabs.map((t,n)=>{const a=[this.$slots.default({tab:t})];return this.allowClose&&a.push(le(Vn,{icon:"close",size:"12px",style:{marginLeft:"5px"},onClick:s=>{this.$emit("close",t),s.stopPropagation(),s.preventDefault()}})),le("li",{class:[this.value===t?"selected":"",t===this.draggableTargetItem?"draggable-target-item":""],id:this.scrollItem===t||this.scrollItem===t.id?this.scrollId:void 0,onClick:s=>{this.value!==t&&(this.$emit("before-change",this.value),this.$emit("update:value",t),this.$emit("change",t)),s.stopPropagation(),s.preventDefault()},onMousedown:s=>{s.which===2&&this.allowClose&&this.$emit("close",t)},onContextmenu:s=>{this.$emit("item-contextmenu",s,t,n),s.preventDefault()},draggable:!0,onDragenter:s=>this.tabDraggable(t,s,"dragenter"),onDragstart:s=>this.tabDraggable(t,s,"dragstart"),onDragend:s=>this.tabDraggable(t,s,"dragend"),onDragover:s=>this.tabDraggable(t,s,"dragover")},a)}));return this.scrollbar.value=e,le("div",{class:"magic-tab none-select"+(this.className?" "+this.className:"")},e)}},rr=Object.freeze(Object.defineProperty({__proto__:null,default:or},Symbol.toStringTag,{value:"Module"}));const lr={class:"magic-table-row"},Fa={props:{title:String,row:Object,flex:String,width:String,align:String},setup(e){return(t,n)=>(g(),w("div",lr,[Ot(t.$slots,"default",{row:e.row})]))}};var cr=Object.freeze(Object.defineProperty({__proto__:null,default:Fa},Symbol.toStringTag,{value:"Module"})),ur=`/* \u8868\u683C */\r .magic-table{\r display: flex;\r flex-direction: column;\r box-sizing: border-box;\r }\r .magic-table .magic-table-body{\r flex: 1;\r overflow: auto;\r }\r .magic-table .magic-table-header,\r .magic-table .magic-table-body .magic-table-row {\r display: flex;\r height: 24px;\r line-height: 24px;\r border-bottom: 1px solid var(--main-border-color);\r }\r .magic-table .magic-table-body .magic-table-row:hover{\r background-color: var(--main-hover-background-color);\r }\r .magic-table .magic-table-column {\r flex: 1;\r display: inline-flex;\r }\r \r .magic-table .magic-table-column span:last-child{\r flex: 1;\r overflow: hidden;\r text-overflow: ellipsis;\r width: 0px;\r white-space: pre;\r }\r \r .magic-table .magic-table-column .magic-select{\r width: 100%;\r }\r .magic-table__border .magic-table-body .magic-table-row{\r border-bottom: 1px solid var(--table-border-color);\r }\r .magic-table__border .magic-table-column:not(:last-child){\r border-right: 1px solid var(--table-border-color);\r }`,pr=Object.freeze(Object.defineProperty({__proto__:null,default:ur},Symbol.toStringTag,{value:"Module"}));var dr={props:{data:{type:Array,default:[]},width:String,border:{type:Boolean,default:!1},align:{type:String,default:"center"}},emits:["clickRow","contextmenu","loadNext"],render(){const e=this.$slots.default(),t=n=>{n=n||{};let a=[];if(n.width){let s=`width: ${n.width}`;!n.width.endsWith("%")&&!isNaN(n.width)&&(s+="px"),a.push(s),a.push("flex:none")}else n.flex&&a.push(`flex: ${n.flex}`);return(n.align||this.align)&&a.push(`justify-content: ${n.align||this.align};text-align: ${n.align||this.align}`),a.join(";")};return le("div",{class:"magic-table"+(this.border?" magic-table__border":"")},[le("div",{class:"magic-table-header none-select"},e.map(n=>le("div",{class:"magic-table-column",title:n.props.title,style:t(n.props)},le("span",n.props.title)))),le("div",{class:"magic-table-body",onScroll:n=>{n.target.scrollTop+n.target.offsetHeight+40>=n.target.scrollHeight&&this.$emit("loadNext")}},this.data.map((n,a)=>le(Fa,{row:n,onClick:()=>{this.$emit("clickRow",a)}},{default:()=>e.map(s=>le("div",{class:"magic-table-column",onContextmenu:i=>{this.$emit("contextmenu",i,n),i.stopPropagation(),i.preventDefault()},style:t(s.props)},s.children.default({row:n})))})))])}},_r=Object.freeze(Object.defineProperty({__proto__:null,default:dr},Symbol.toStringTag,{value:"Module"})),hr=`/* \u6811\u5F62\u83DC\u5355 */\r .magic-tree{\r position: relative;\r overflow: auto;\r }\r .magic-tree > ul {\r position: absolute;\r top: 0;\r left: 0;\r }\r .magic-tree .magic-tree-item {\r height: 20px;\r line-height: 20px;\r transition: 0.3s;\r word-break: break-all;\r white-space: nowrap;\r /* display: inline-flex;\r min-width: 100%; */\r }\r .magic-tree .magic-tree-item:hover,\r .magic-tree .magic-tree-item.selected,\r .magic-tree .magic-tree-item.draggable-target-item {\r background-color: var(--tree-hover-background-color);\r }\r .magic-tree .magic-tree-item .magic-icon {\r fill: var(--tree-icon-color);\r margin-right: 2px\r }\r .magic-tree ul {\r max-height: 99999px;\r min-width: 100%;\r }\r .magic-tree li{\r /* min-width: 100%; */\r white-space: nowrap;\r word-break: break-all;\r }\r .magic-tree .hide {\r opacity: 0;\r max-height: 0;\r position: relative;\r /* transition: 0.2s display ease1s; */\r }\r .magic-tree svg:not(.root) .magic-icon-datasource{\r fill: #089910;\r }\r `,fr=Object.freeze(Object.defineProperty({__proto__:null,default:hr},Symbol.toStringTag,{value:"Module"}));var mr={props:{data:Array,sort:Boolean,descending:Boolean,filter:String,filterText:Function,selected:Object,draggable:{type:Boolean,default:!1},onMove:{type:Function,defeault:()=>new Promise(e=>e(!0))}},emits:["drag","contextmenu","onMove","itemClick"],setup(e,t){const n=t.emit,a=Je({item:{},itemParent:{},target:{},targetParent:{}});function s(i,o,r,l){function u(){return!(a.item===a.target||a.itemParent===a.target||!a.target.folder&&a.itemParent===a.targetParent)}switch(l){case"dragstart":a.item=o,a.itemParent=i,r.stopPropagation();break;case"dragenter":a.target=o,a.targetParent=i,r.stopPropagation();break;case"dragover":u()&&r.preventDefault();break;case"dragend":if(!u())break;e.onMove(o,a.target||a.targetParent).then(p=>{if(p){const m=a.itemParent||{children:e.data};m.children.splice(m.children.indexOf(o),1),a.target.folder?(a.target.children=a.target.children||[],a.target.children.push(a.item)):(a.targetParent.children=a.targetParent.children||[],a.targetParent.children.push(a.item)),e.sort&&Nt(a.target.folder?a.target.children:a.targetParent.children,e.descending,"name"),a.target={},a.targetParent={}}}),r.stopPropagation();break}n("drag",l,a,r)}return e.sort&&(Nt(e.data,e.descending,"name","children"),tt(()=>e.data,i=>{Nt(e.data,e.descending,"name","children")}),tt(()=>e.descending,i=>{Nt(e.data,e.descending,"name","children")})),{draggableItem:a,itemDraggable:s}},data(){return{scrollId:"",scrollItem:U(null)}},methods:{scrollIntoView(e){this.scrollId="s"+new Date().getTime()+parseInt(Math.random()*1e7),this.scrollItem=e;const t=n=>{let a=!1;for(const s in n){const i=n[s];if(a=i===e){i.opened!==void 0&&(i.opened=!0);break}else if(i.children&&i.children.length>0&&(a=t(i.children))){i.opened=!0;break}}return a};t(this.data)&&be(()=>{const n=document.querySelector("#"+this.scrollId);n&&n.scrollIntoView(!0)})}},render(){const e=n=>this.filter?this.filterText(je(n)).indexOf(this.filter)>-1||n.children&&n.children.some(a=>e(a)):!0,t=(n,a,s)=>{const i=s>0?{paddingLeft:`${s*17}px`}:{};return e(a)&&le("li",{onDblclick:o=>{a.folder&&(a.opened=!a.opened),o.stopPropagation(),o.preventDefault()},onClick:o=>{this.$emit("itemClick",a),o.stopPropagation(),o.preventDefault()},onContextmenu:o=>{this.$emit("contextmenu",a,o),o.stopPropagation(),o.preventDefault()},draggable:this.draggable,onDragenter:o=>this.itemDraggable(n,a,o,"dragenter"),onDragstart:o=>this.itemDraggable(n,a,o,"dragstart"),onDragend:o=>this.itemDraggable(n,a,o,"dragend"),onDragover:o=>this.itemDraggable(n,a,o,"dragover")},[le("div",{class:["magic-tree-item",a===this.draggableItem.target?"draggable-target-item":"",a===this.selected?"selected":""],style:i,id:this.scrollItem===a||this.scrollItem===a.id?this.scrollId:void 0},a.folder?this.$slots.folder({item:a}):this.$slots.file({item:a})),a.folder&&a.opened&&le("ul",{class:a.opened&&"opened"||"hide"},a.children&&a.children.map(o=>t(a,o,s+1)))])};return le("div",{class:"magic-tree none-select"},le("ul",{},this.data&&this.data.map(n=>t(null,n,0))))}},gr=Object.freeze(Object.defineProperty({__proto__:null,default:mr},Symbol.toStringTag,{value:"Module"}));const vr=["onMousedown"],Er={props:{value:{type:Boolean,default:!0},className:String,showClose:{type:Boolean,default:!0},shade:{type:Boolean,default:!0},padding:{type:String,default:"5px 10px"},height:{type:String,default:"auto"},width:{type:String,default:"auto"},moveable:{type:Boolean,default:!0},overflow:{type:String,default:"auto"},top:String,maxHeight:String,maxWidth:String,contentHeight:String,title:String,content:String,onClose:Function},emits:["update:value","onClose"],setup(e,{expose:t,emit:n}){const a=e,s=U(a.top||"auto"),i=U("auto"),o=U("relative"),r=U(null);function l(){n("update:value",!1)}const u=()=>{n("close"),typeof a.onClose=="function"&&a.onClose(),l()};let p,m=!1,f,y;function E(R){a.moveable&&(p=R,f=R.target.parentNode.getBoundingClientRect(),y=document.getElementsByClassName("magic-editor")[0].getBoundingClientRect(),m=!0)}function C(R){if(a.moveable&&m){let D=Math.min(Math.max(f.top+(R.pageY-p.pageY),y.y),y.y+y.height-f.height),L=Math.min(Math.max(f.left+(R.pageX-p.pageX),y.x),y.x+y.width-f.width);s.value=D+"px",i.value=L+"px",o.value="absolute"}}let I=!1;const O=()=>{!I&&r.value&&(o.value="absolute",i.value=r.value.getBoundingClientRect().x+"px"),I=!0};a.top&&Ja(O);const v=R=>{a.showClose&&R.keyCode===27&&u()};function T(R){m=!1}return t({close:u}),(R,D)=>{const L=b("magic-icon");return e.value?(g(),j(ha,{key:0,to:".magic-editor"},[A("div",{class:Ee(["magic-dialog",(e.shade?"magic-dialog__shade":"")+(e.className?" "+e.className:"")]),tabindex:"1",onMousemove:C,onMouseup:T,onKeydown:v},[A("div",{class:"magic-dialog-main",style:ze({position:o.value,top:s.value,left:i.value,width:e.width,height:e.height,"max-width":e.maxWidth}),ref_key:"dialog",ref:r},[A("div",{class:Ee(["magic-dialog-header none-select",{moveable:e.moveable}]),onMousedown:E},[_e(B(e.title)+" ",1),e.showClose?(g(),w("span",{key:0,onMousedown:Se(u,["stop"])},[_(L,{icon:"close"})],40,vr)):X("",!0)],34),A("div",{class:"magic-dialog-body",style:ze({padding:e.padding,"max-height":e.maxHeight,height:e.contentHeight,overflow:e.overflow})},[e.content?(g(),w(Z,{key:0},[_e(B(e.content),1)],64)):Ot(R.$slots,"default",{key:1},void 0,!0)],4)],4)],34)])):X("",!0)}}};var br=q(Er,[["__scopeId","data-v-3e8f0d71"]]),yr=Object.freeze(Object.defineProperty({__proto__:null,default:br},Symbol.toStringTag,{value:"Module"}));const Tr={class:"magic-notify"},Sr=["onClick"],Or=["innerHTML"],xr=["innerHTML"],Rr={setup(e){const t={error:'',warning:'',info:''},n=Je([]),a=i=>{const o=n.findIndex(r=>i.id===r.id);return o>-1&&n.splice(o,1),!0},s=i=>{i.icon=t[i.icon]||t.info,i.id=parseInt(Math.random()*1e7),n.push(i),i.duration&&setTimeout(()=>a(i),parseInt(i.duration))};return S.$on(F.NOTIFY,s),(i,o)=>{const r=b("magic-icon"),l=b("magic-button"),u=b("magic-button-group");return g(),w("div",Tr,[(g(!0),w(Z,null,he(h(n),(p,m)=>(g(),w("div",{class:"magic-notify-item",key:m},[A("div",{class:"close",onClick:f=>a(p)},[_(r,{icon:"close"})],8,Sr),A("h3",null,[(g(),w("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",innerHTML:p.icon},null,8,Or)),_e(B(p.title),1)]),A("p",{innerHTML:p.content},null,8,xr),p.buttons?(g(),j(u,{key:0},{default:k(()=>[(g(!0),w(Z,null,he(p.buttons,(f,y)=>(g(),j(l,{key:y,value:f.title,type:"link",onClick:()=>a(p)&&f.onClick()},null,8,["value","onClick"]))),128))]),_:2},1024)):X("",!0)]))),128))])}}};var Ar=q(Rr,[["__scopeId","data-v-11ebc230"]]),Ir=Object.freeze(Object.defineProperty({__proto__:null,default:Ar},Symbol.toStringTag,{value:"Module"}));const Cr={props:{align:{type:String,default:"left"}},setup(e){return(t,n)=>(g(),w("div",{class:Ee(["magic-button-group",e.align])},[Ot(t.$slots,"default",{},void 0,!0)],2))}};var Lr=q(Cr,[["__scopeId","data-v-70c60ab6"]]),Nr=Object.freeze(Object.defineProperty({__proto__:null,default:Lr},Symbol.toStringTag,{value:"Module"}));const wr={props:{value:String,type:String},setup(e){return(t,n)=>(g(),w("button",{onClick:n[0]||(n[0]=Se(a=>t.$emit("onClick"),["stop"])),class:Ee(["magic-button",e.type]),type:"button"},B(e.value),3))}};var kr=q(wr,[["__scopeId","data-v-2e4c463a"]]),Dr=Object.freeze(Object.defineProperty({__proto__:null,default:kr},Symbol.toStringTag,{value:"Module"}));const Mr=["checked"],Pr={props:{value:{type:[Number,Boolean],default:()=>!1},checkedHalf:{type:Boolean,default:!1}},setup(e){const t=new Date().getTime()+""+Math.floor(Math.random()*1e3);return(n,a)=>(g(),w("div",{class:"magic-checkbox",onClick:a[1]||(a[1]=Se(s=>n.$emit("click",s),["stop"]))},[A("input",{id:t,ref:"checkbox",type:"checkbox",onChange:a[0]||(a[0]=()=>{n.$emit("update:value",n.$refs.checkbox.checked),n.$emit("change",n.$refs.checkbox.checked)}),checked:e.value},null,40,Mr),A("label",{for:t,class:Ee({checkedHalf:e.checkedHalf&&e.value})},null,2)]))}};var Ur=q(Pr,[["__scopeId","data-v-22b807f1"]]),$r=Object.freeze(Object.defineProperty({__proto__:null,default:Ur},Symbol.toStringTag,{value:"Module"}));const Br={class:"magic-file"},Fr=["accept","multiple"],Hr={props:{value:[Object,String],placeholder:{type:String,default:c("message.chooseFile")},accept:String,multiple:{type:Boolean,default:!1},border:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{emit:t}){const n=e,a=U(null),s=U(null),i=()=>{a.value.files[0]&&(s.value=Array.from(a.value.files).map(o=>o.name).join(",")),t("update:value",n.multiple?a.value.files:a.value.files[0])};return(o,r)=>{const l=b("magic-input"),u=b("magic-icon");return g(),w("div",Br,[A("input",{type:"file",style:{display:"none"},ref_key:"file",ref:a,onChange:i,accept:e.accept,multiple:e.multiple},null,40,Fr),_(l,{readonly:!0,style:{width:"100%"},placeholder:e.placeholder,onClick:()=>o.$refs.file.click(),value:s.value,border:e.border},null,8,["placeholder","onClick","value","border"]),_(u,{icon:"upload"})])}}};var jr=q(Hr,[["__scopeId","data-v-62524fc2"]]),Vr=Object.freeze(Object.defineProperty({__proto__:null,default:jr},Symbol.toStringTag,{value:"Module"}));const Gr=["value","placeholder","readonly","type","autocomplete"],zr={props:{value:[String,Number,Object],placeholder:String,defaultValue:[String,Number,Object],readonly:{type:Boolean,default:!1},type:{type:String,default:"text"},width:{type:String,default:"100%"},border:{type:Boolean,default:!0},onEnter:{type:Function,default:()=>{}}},emits:["update:value"],setup(e,{emit:t}){const n=e,a=Qa(()=>n.type==="password"?"new-password":null);!n.value&&n.defaultValue&&t("update:value",n.defaultValue);const s={width:n.width};return(i,o)=>(g(),w("input",{class:Ee(["magic-input",{"magic-input__border":e.border}]),value:e.value,placeholder:e.placeholder,readonly:e.readonly,style:s,type:e.type,onInput:o[0]||(o[0]=r=>i.$emit("update:value",r.target.value)),autocomplete:h(a),onKeypress:o[1]||(o[1]=Za(Se((...r)=>e.onEnter&&e.onEnter(...r),["stop"]),["enter"]))},null,42,Gr))}};var Yr=q(zr,[["__scopeId","data-v-f43ad66a"]]),qr=Object.freeze(Object.defineProperty({__proto__:null,default:Yr},Symbol.toStringTag,{value:"Module"}));const Kr={key:0},Wr=["placeholder"],Xr=["onClick"],Jr={props:{value:[Object,String,Number],options:Array,defaultSelect:[Object,String,Number],width:String,border:{type:Boolean,default:!0},placeholder:String,inputable:{type:Boolean,default:!1}},emits:["update:value","select"],setup(e,{emit:t}){const n=e;document.body.addEventListener("click",()=>s.value=!1);const a=U("-2px"),s=U(!1),i=U("auto"),o=U("0px"),r=me(()=>{const f=n.options.find(y=>y.value===n.value)||n.options.find(y=>y.value===n.defaultSelect);return f&&f.text||""}),l=f=>{t("update:value",f),t("select",f),s.value=!1},u=se("ELEMENT_ROOT"),p=(f,y)=>y+f.scrollTop>0?f.scrollTop:f.parentElement?p(f.parentElement,y+f.scrollTop):f.scrollTop,m=(f,y)=>{a.value=-p(f,0)-1+"px",s.value=!0,be(()=>{o.value=-(window.pageXOffset+1)+"px",i.value=f.clientWidth+"px";let E=y.offsetHeight;y.offsetTop+E+20>u.value.offsetTop+u.value.offsetHeight&&(a.value=-(E+f.offsetHeight)+"px")})};return(f,y)=>{const E=b("magic-icon");return g(),w("div",{class:Ee([{inputable:e.inputable,border:e.border},"magic-select not-select"]),style:ze({width:e.width}),onClick:y[2]||(y[2]=Se(C=>m(f.$refs.container,f.$refs.selectList),["stop"])),ref:"container"},[e.inputable?X("",!0):(g(),w("span",Kr,B(h(r)),1)),e.inputable?yt((g(),w("input",{key:1,ref:"input","onUpdate:modelValue":y[0]||(y[0]=C=>fa(value)?value.value=C:null),autocomplete:"off",type:"text",onInput:y[1]||(y[1]=C=>l(C.target.value)),placeholder:e.placeholder},null,40,Wr)),[[es,e.value]]):X("",!0),yt(A("ul",{style:ze({width:i.value,marginTop:a.value,marginLeft:o.value}),ref:"selectList"},[(g(!0),w(Z,null,he(e.options,C=>(g(),w("li",{key:C.value,onClick:Se(I=>l(C.value),["stop"])},B(C.text),9,Xr))),128))],4),[[$t,s.value]]),_(E,{icon:"arrow-bottom"})],6)}}};var Qr=q(Jr,[["__scopeId","data-v-249fb96c"]]),Zr=Object.freeze(Object.defineProperty({__proto__:null,default:Qr},Symbol.toStringTag,{value:"Module"}));const el=["placeholder","value"],tl={props:{value:String,placeholder:String},setup(e){return(t,n)=>(g(),w("textarea",{class:"magic-textarea",placeholder:e.placeholder,value:e.value,onInput:n[0]||(n[0]=a=>t.$emit("update:value",a.target.value))},null,40,el))}};var nl=q(tl,[["__scopeId","data-v-ca6693f6"]]),al=Object.freeze(Object.defineProperty({__proto__:null,default:nl},Symbol.toStringTag,{value:"Module"}));const sl={props:{users:Array,max:Number,size:{type:Number,default:22}},setup(e){const t=e,n=me(()=>({height:t.size+"px",lineHeight:t.size+"px"})),a=me(()=>t.users.slice(0,t.max||t.users.length));return(s,i)=>{const o=b("magic-avatar");return t.users&&t.users.length>0?(g(),w("div",{key:0,class:"magic-avatar-group",style:ze(h(n))},[(g(!0),w(Z,null,he(h(a),(r,l)=>(g(),j(o,{key:l,user:r,size:e.size},null,8,["user","size"]))),128)),t.users.length>h(a).length?(g(),j(o,{key:0,text:`${e.max}+`,size:e.size},null,8,["text","size"])):X("",!0)],4)):X("",!0)}}};var il=q(sl,[["__scopeId","data-v-511f7f80"]]),ol=Object.freeze(Object.defineProperty({__proto__:null,default:il},Symbol.toStringTag,{value:"Module"}));const rl=["title"],ll={props:{user:Object,text:String,size:{type:Number,default:22}},setup(e){const t=e,n=["#1abc9c","#2ecc71","#3498db","#9b59b6","#16a085","#27ae60","#2980b9","#8e44ad","#f1c40f","#e67e22","#e74c3c","#eca0f1","#95a5a6","#f39c12","#d35400","#c0392b","#bdc3c7","#7f8c8d"],a=me(()=>({width:t.size+"px",height:t.size+"px",lineHeight:t.size+"px",borderRadius:t.size/2+"px",backgroundColor:t.text&&"#bdc3c7"||n[oi(`${t.user.cid}`)%n.length]})),s=me(()=>t.text||t.user.username.substring(0,1)),i=me(()=>t.user?`${c("message.username")}\uFF1A${t.user.username} IP\uFF1A${t.user.ip||"unknown"}`:void 0);return(o,r)=>(g(),w("div",{class:"magic-avatar",style:ze(h(a)),title:h(i)},B(h(s)),13,rl))}};var cl=q(ll,[["__scopeId","data-v-73f02f44"]]),ul=Object.freeze(Object.defineProperty({__proto__:null,default:cl},Symbol.toStringTag,{value:"Module"}));const pl=["width"],dl=["x","fill"],_l={props:{icon:String|Array},setup(e){const t=e,n={GET:"#0cbb52",POST:"#FFB400",DELETE:["DEL","#EB2013"],PUT:"#097BED",function:["Fn","#9012FE"]},a=me(()=>{let s=t.icon,i=Array.isArray(s);i||(s=n[t.icon],i=s!==void 0&&Array.isArray(s));const o=i?s[0]:t.icon,r=o.length*9,l=i?s[1]:s||"var(--main-icon-color)";return{width:r,color:l,text:o}});return(s,i)=>(g(),w("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:h(a).width,height:"12","font-size":"10","font-weight":"bolder","font-family":"inherit"},[A("text",{x:h(a).width/2,y:"8",fill:h(a).color,style:{"dominant-baseline":"middle","text-anchor":"middle"}},B(h(a).text),9,dl)],8,pl))}};var hl=Object.freeze(Object.defineProperty({__proto__:null,default:_l},Symbol.toStringTag,{value:"Module"}));const fl={props:{opened:Object},setup(e){const t=[{title:"Json",icon:"json",component:te("magic-api-request-body")},{title:c("message.view"),icon:"structure",component:te("magic-api-request-structure")}];return(n,a)=>{const s=b("magic-navbar-item"),i=b("magic-navbar");return g(),j(i,{spliter:!0,direction:"vertical","allow-close":!1},{default:k(()=>[(g(),w(Z,null,he(t,(o,r)=>_(s,dt({key:r},o),{default:k(()=>[(g(),j(te(o.component)))]),_:2},1040)),64))]),_:1})}}};var ml=q(fl,[["__scopeId","data-v-41b9c04c"]]),gl=Object.freeze(Object.defineProperty({__proto__:null,default:ml},Symbol.toStringTag,{value:"Module"}));const vl={setup(e){const t=se("info");return(n,a)=>{const s=b("magic-textarea");return g(),j(s,{value:h(t).description,"onUpdate:value":a[0]||(a[0]=i=>h(t).description=i)},null,8,["value"])}}};var El=Object.freeze(Object.defineProperty({__proto__:null,default:vl},Symbol.toStringTag,{value:"Module"}));const bl={class:"magic-api-group"},yl={setup(e){const t=se("info"),n=[{title:c("api.navbars.path"),component:te("magic-api-path")},{title:c("api.navbars.groupOption"),component:te("magic-api-option")}],a=()=>{const s=t.value;z.sendJson("/resource/folder/save",{id:s.id,name:s.name,parentId:s.parentId,type:s.type,path:s.path,paths:s.paths,options:s.options})};return(s,i)=>{const o=b("magic-input"),r=b("magic-button"),l=b("magic-navbar-item"),u=b("magic-navbar");return g(),w(Z,null,[A("div",bl,[A("form",null,[A("label",null,B(h(c)("resource.form.groupName")),1),_(o,{value:h(t).name,"onUpdate:value":i[0]||(i[0]=p=>h(t).name=p),placeholder:h(c)("resource.form.placeholder.name",h(c)("api.name")),width:"250px"},null,8,["value","placeholder"]),A("label",null,B(h(c)("resource.form.groupPath")),1),_(o,{value:h(t).path,"onUpdate:value":i[1]||(i[1]=p=>h(t).path=p),placeholder:h(c)("resource.form.placeholder.path",h(c)("api.name")),width:"auto",style:{flex:"1"}},null,8,["value","placeholder"]),_(r,{value:h(c)("message.save"),onOnClick:a},null,8,["value"])])]),_(u,{direction:"horizontal",ref:"navbar",style:{flex:"1"},"allow-close":!1},{default:k(()=>[(g(),w(Z,null,he(n,(p,m)=>_(l,dt({key:m},p),{default:k(()=>[(g(),j(te(p.component)))]),_:2},1040)),64))]),_:1},512)],64)}}};var Tl=q(yl,[["__scopeId","data-v-07a9bc9f"]]),Sl=Object.freeze(Object.defineProperty({__proto__:null,default:Tl},Symbol.toStringTag,{value:"Module"}));const Ol={class:"magic-panel-api"},xl={setup(e){const t=se("info"),n=U(-1);return(a,s)=>{const i=b("magic-panel-common-toolbar"),o=b("magic-checkbox"),r=b("magic-table-column"),l=b("magic-input"),u=b("magic-select"),p=b("magic-table");return g(),w("div",Ol,[_(i,{index:n.value,"onUpdate:index":s[0]||(s[0]=m=>n.value=m),value:h(t).headers},null,8,["index","value"]),_(p,{data:h(t).headers,border:"",onClickRow:s[1]||(s[1]=m=>n.value=m),align:"center"},{default:k(()=>[_(r,{title:h(c)("message.required"),width:"65"},{default:k(({row:m})=>[_(o,{value:m.required,"onUpdate:value":f=>m.required=f},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:"Key"},{default:k(({row:m})=>[_(l,{value:m.name,"onUpdate:value":f=>m.name=f,border:!1},null,8,["value","onUpdate:value"])]),_:1}),_(r,{title:"Value"},{default:k(({row:m})=>[_(l,{value:m.value,"onUpdate:value":f=>m.value=f,border:!1},null,8,["value","onUpdate:value"])]),_:1}),_(r,{title:h(c)("message.parameterType"),width:"135"},{default:k(({row:m})=>[_(u,{options:a.$REQUEST_SIMPLE_TYPES,value:m.dataType,"onUpdate:value":f=>m.dataType=f,"default-select":a.$DEFAULT_REQUEST_SIMPLE_TYPE,border:!1},null,8,["options","value","onUpdate:value","default-select"])]),_:1},8,["title"]),_(r,{title:h(c)("message.defaultValue")},{default:k(({row:m})=>[_(l,{value:m.defaultValue,"onUpdate:value":f=>m.defaultValue=f,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("api.validateType"),width:"115"},{default:k(({row:m})=>[_(u,{options:a.$VALIDATE_TYPES,value:m.validateType,"onUpdate:value":f=>m.validateType=f,"default-select":a.$DEFAULT_VALIDATE_TYPE,border:!1},null,8,["options","value","onUpdate:value","default-select"])]),_:1},8,["title"]),_(r,{title:h(c)("api.expression"),width:"220"},{default:k(({row:m})=>[_(l,{value:m.expression,"onUpdate:value":f=>m.expression=f,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("api.validate"),width:"165"},{default:k(({row:m})=>[_(l,{value:m.error,"onUpdate:value":f=>m.error=f,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("message.description"),flex:"2"},{default:k(({row:m})=>[_(l,{value:m.description,"onUpdate:value":f=>m.description=f,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"])]),_:1},8,["data"])])}}};var Rl=Object.freeze(Object.defineProperty({__proto__:null,default:xl},Symbol.toStringTag,{value:"Module"}));const Al={class:"magic-api-info"},Il={setup(e){const t=se("info"),n=[{title:c("api.navbars.parameter"),component:te("magic-api-parameter")},{title:c("api.navbars.header"),component:te("magic-api-header")},{title:c("api.navbars.path"),component:te("magic-api-path")},{title:c("api.navbars.body"),component:te("magic-api-body")},{title:c("api.navbars.option"),component:te("magic-api-option")},{title:c("api.navbars.description"),component:te("magic-api-description")}];return(a,s)=>{const i=b("magic-select"),o=b("magic-input"),r=b("magic-navbar-item"),l=b("magic-navbar");return g(),w(Z,null,[A("div",Al,[A("form",null,[A("label",null,B(h(c)("api.form.method")),1),_(i,{width:"100px",options:a.$REQUEST_METHODS,"default-select":a.$DEFAULT_REQUEST_METHOD,value:h(t).method,"onUpdate:value":s[0]||(s[0]=u=>h(t).method=u)},null,8,["options","default-select","value"]),A("label",null,B(h(c)("api.form.name")),1),_(o,{value:h(t).name,"onUpdate:value":s[1]||(s[1]=u=>h(t).name=u),placeholder:h(c)("api.form.placeholder.name"),width:"200px"},null,8,["value","placeholder"]),A("label",null,B(h(c)("api.form.path")),1),_(o,{value:h(t).path,"onUpdate:value":s[2]||(s[2]=u=>h(t).path=u),placeholder:h(c)("api.form.placeholder.path"),width:"auto",style:{flex:"1"}},null,8,["value","placeholder"])])]),_(l,{direction:"horizontal",ref:"navbar",style:{flex:"1"},"allow-close":!1},{default:k(()=>[(g(),w(Z,null,he(n,(u,p)=>_(r,dt({key:p},u),{default:k(()=>[(g(),j(te(u.component)))]),_:2},1040)),64))]),_:1},512)],64)}}};var Cl=q(Il,[["__scopeId","data-v-8ed3340e"]]),Ll=Object.freeze(Object.defineProperty({__proto__:null,default:Cl},Symbol.toStringTag,{value:"Module"}));const Nl={class:"magic-panel-api"},wl={setup(e){const t=se("info"),n=se("options")||[],a=me(()=>n.map(o=>({text:o[0],value:o[0],description:o[1],defaultValue:o[2]}))),s=U(-1),i=(o,r)=>{const l=n.find(u=>u[0]===o);l&&(r.description=l[1]||"",r.value=l[2]||"")};return(o,r)=>{const l=b("magic-panel-common-toolbar"),u=b("magic-select"),p=b("magic-table-column"),m=b("magic-input"),f=b("magic-table");return g(),w("div",Nl,[_(l,{index:s.value,"onUpdate:index":r[0]||(r[0]=y=>s.value=y),value:h(t).options},null,8,["index","value"]),_(f,{data:h(t).options,border:"",onClickRow:r[1]||(r[1]=y=>s.value=y)},{default:k(()=>[_(p,{title:"Key",width:"20%"},{default:k(({row:y})=>[_(u,{options:h(a),value:y.name,"onUpdate:value":E=>y.name=E,"default-select":o.$DEFAULT_REQUEST_SIMPLE_TYPE,border:!1,inputable:"",onSelect:E=>i(E,y)},null,8,["options","value","onUpdate:value","default-select","onSelect"])]),_:1}),_(p,{title:"Value",width:"60%"},{default:k(({row:y})=>[_(m,{value:y.value,"onUpdate:value":E=>y.value=E,border:!1},null,8,["value","onUpdate:value"])]),_:1}),_(p,{title:h(c)("message.description"),width:"20%"},{default:k(({row:y})=>[_(m,{value:y.description,"onUpdate:value":E=>y.description=E,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"])]),_:1},8,["data"])])}}};var kl=Object.freeze(Object.defineProperty({__proto__:null,default:wl},Symbol.toStringTag,{value:"Module"}));const Dl={class:"magic-panel-api"},Ml={setup(e){const t=U(-1),n=se("info");return(a,s)=>{const i=b("magic-panel-common-toolbar"),o=b("magic-checkbox"),r=b("magic-table-column"),l=b("magic-input"),u=b("magic-file"),p=b("magic-select"),m=b("magic-table");return g(),w("div",Dl,[_(i,{index:t.value,"onUpdate:index":s[0]||(s[0]=f=>t.value=f),value:h(n).parameters},null,8,["index","value"]),_(m,{data:h(n).parameters,border:"",onClickRow:s[1]||(s[1]=f=>t.value=f),align:"center"},{default:k(()=>[_(r,{title:h(c)("message.required"),width:"65"},{default:k(({row:f})=>[_(o,{value:f.required,"onUpdate:value":y=>f.required=y},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:"Key"},{default:k(({row:f})=>[_(l,{value:f.name,"onUpdate:value":y=>f.name=y,border:!1},null,8,["value","onUpdate:value"])]),_:1}),_(r,{title:"Value"},{default:k(({row:f})=>[f.dataType==="MultipartFile"?(g(),j(u,{key:0,value:f.value,"onUpdate:value":y=>f.value=y,border:!1},null,8,["value","onUpdate:value"])):f.dataType==="MultipartFiles"?(g(),j(u,{key:1,value:f.value,"onUpdate:value":y=>f.value=y,border:!1,multiple:""},null,8,["value","onUpdate:value"])):(g(),j(l,{key:2,value:f.value,"onUpdate:value":y=>f.value=y,border:!1},null,8,["value","onUpdate:value"]))]),_:1}),_(r,{title:h(c)("message.parameterType"),width:"135"},{default:k(({row:f})=>[_(p,{options:a.$REQUEST_PARAMETER_TYPES,value:f.dataType,"onUpdate:value":y=>f.dataType=y,"default-select":a.$DEFAULT_REQUEST_PARAMETER_TYPE,border:!1},null,8,["options","value","onUpdate:value","default-select"])]),_:1},8,["title"]),_(r,{title:h(c)("message.defaultValue")},{default:k(({row:f})=>[_(l,{value:f.defaultValue,"onUpdate:value":y=>f.defaultValue=y,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("api.validateType"),width:"115"},{default:k(({row:f})=>[_(p,{options:a.$VALIDATE_TYPES,value:f.validateType,"onUpdate:value":y=>f.validateType=y,"default-select":a.$DEFAULT_VALIDATE_TYPE,border:!1},null,8,["options","value","onUpdate:value","default-select"])]),_:1},8,["title"]),_(r,{title:h(c)("api.expression"),width:"220"},{default:k(({row:f})=>[_(l,{value:f.expression,"onUpdate:value":y=>f.expression=y,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("api.validate"),width:"165"},{default:k(({row:f})=>[_(l,{value:f.error,"onUpdate:value":y=>f.error=y,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("message.description"),flex:"2"},{default:k(({row:f})=>[_(l,{value:f.description,"onUpdate:value":y=>f.description=y,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"])]),_:1},8,["data"])])}}};var Pl=Object.freeze(Object.defineProperty({__proto__:null,default:Ml},Symbol.toStringTag,{value:"Module"}));const Ul={class:"magic-panel-api"},$l={setup(e){const t=U(-1),n=se("info");return(a,s)=>{const i=b("magic-panel-common-toolbar"),o=b("magic-input"),r=b("magic-table-column"),l=b("magic-select"),u=b("magic-table");return g(),w("div",Ul,[_(i,{index:t.value,"onUpdate:index":s[0]||(s[0]=p=>t.value=p),value:h(n).paths},null,8,["index","value"]),_(u,{data:h(n).paths,border:"",onClickRow:s[1]||(s[1]=p=>t.value=p),align:"center"},{default:k(()=>[_(r,{title:"Key"},{default:k(({row:p})=>[_(o,{value:p.name,"onUpdate:value":m=>p.name=m,border:!1},null,8,["value","onUpdate:value"])]),_:1}),_(r,{title:"Value"},{default:k(({row:p})=>[_(o,{value:p.value,"onUpdate:value":m=>p.value=m,border:!1},null,8,["value","onUpdate:value"])]),_:1}),_(r,{title:h(c)("message.parameterType"),width:"135"},{default:k(({row:p})=>[_(l,{options:a.$REQUEST_SIMPLE_TYPES,value:p.dataType,"onUpdate:value":m=>p.dataType=m,"default-select":a.$DEFAULT_REQUEST_SIMPLE_TYPE,border:!1},null,8,["options","value","onUpdate:value","default-select"])]),_:1},8,["title"]),_(r,{title:h(c)("api.validateType"),width:"115"},{default:k(({row:p})=>[_(l,{options:a.$VALIDATE_TYPES,value:p.validateType,"onUpdate:value":m=>p.validateType=m,"default-select":a.$DEFAULT_VALIDATE_TYPE,border:!1},null,8,["options","value","onUpdate:value","default-select"])]),_:1},8,["title"]),_(r,{title:h(c)("api.expression"),width:"220"},{default:k(({row:p})=>[_(o,{value:p.expression,"onUpdate:value":m=>p.expression=m,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("api.validate"),width:"165"},{default:k(({row:p})=>[_(o,{value:p.error,"onUpdate:value":m=>p.error=m,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("message.description"),flex:"2"},{default:k(({row:p})=>[_(o,{value:p.description,"onUpdate:value":m=>p.description=m,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"])]),_:1},8,["data"])])}}};var Bl=Object.freeze(Object.defineProperty({__proto__:null,default:$l},Symbol.toStringTag,{value:"Module"}));const Fl={setup(e){const t=se("info"),n=se("opened"),a=s=>{if(s.isFlush)return;const i=Ua(t.value.requestBody,t.value.requestBodyDefinition);i&&(t.value.requestBodyDefinition=i,n.value.requestBodyTree=an(i))};return(s,i)=>{const o=b("magic-monaco-editor");return g(),j(o,{value:h(t).requestBody,"onUpdate:value":i[0]||(i[0]=r=>h(t).requestBody=r),language:"json",onChange:a},null,8,["value"])}}};var Hl=q(Fl,[["__scopeId","data-v-0fba1ea3"]]),jl=Object.freeze(Object.defineProperty({__proto__:null,default:Hl},Symbol.toStringTag,{value:"Module"}));const Vl=["onClick"],Gl=["title"],zl={key:0,align:"center",style:{flex:"1"}},Yl={key:1,align:"center",style:{flex:"1"}},ql={setup(e){const t=se("opened"),n=me(()=>{var s,i;return!t.value.requestBodyTree&&((i=(s=t.value)==null?void 0:s.item)==null?void 0:i.requestBodyDefinition)&&(t.value.requestBodyTree=an(t.value.item.requestBodyDefinition)),(t.value.requestBodyTree||[]).filter(o=>o.display)}),a=s=>{const i=t.value.requestBodyTree.findIndex(r=>r===s),o=s.level;s.expand=!s.expand;for(let r=i+1,l=t.value.requestBodyTree.length;ro)u.display=s.expand;else break}};return(s,i)=>{const o=b("magic-icon"),r=b("magic-table-column"),l=b("magic-checkbox"),u=b("magic-select"),p=b("magic-input"),m=b("magic-table");return g(),j(m,{data:h(n),border:""},{default:k(()=>[_(r,{title:h(c)("api.field")},{default:k(({row:f})=>[A("span",{style:ze({paddingLeft:`${(f.level+(f.folder?0:1))*16}px`}),onClick:y=>a(f)},[f.folder?(g(),j(o,{key:0,icon:f.expand?"arrow-bottom":"arrow-right"},null,8,["icon"])):X("",!0)],12,Vl),A("span",{title:f.name||"-"},B(f.name||"-"),9,Gl)]),_:1},8,["title"]),_(r,{title:h(c)("message.required"),width:"65"},{default:k(({row:f})=>[_(l,{value:f.node.required,"onUpdate:value":y=>f.node.required=y},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("message.type"),width:"80"},{default:k(({row:f})=>[_(u,{options:s.$BODY_DATA_TYPES,value:f.node.dataType,"onUpdate:value":y=>f.node.dataType=y,border:!1},null,8,["options","value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:"Value",flex:"2"},{default:k(({row:f})=>{var y;return[f.folder?(g(),w("p",zl,"-")):(g(),w("span",{key:1,class:Ee(["magic-data-type",(y=f.node.dataType)==null?void 0:y.toLowerCase()])},B(f.node.value),3))]}),_:1}),_(r,{title:h(c)("message.defaultValue")},{default:k(({row:f})=>[_(p,{value:f.node.defaultValue,"onUpdate:value":y=>f.node.defaultValue=y,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("api.validateType"),width:"115"},{default:k(({row:f})=>[_(u,{options:s.$VALIDATE_TYPES,value:f.node.validateType,"onUpdate:value":y=>f.node.validateType=y,"default-select":s.$DEFAULT_VALIDATE_TYPE,border:!1},null,8,["options","value","onUpdate:value","default-select"])]),_:1},8,["title"]),_(r,{title:h(c)("api.expression")},{default:k(({row:f})=>[_(p,{value:f.node.expression,"onUpdate:value":y=>f.node.expression=y,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("api.validate")},{default:k(({row:f})=>[_(p,{value:f.node.error,"onUpdate:value":y=>f.node.error=y,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("message.description")},{default:k(({row:f})=>[f.name?(g(),j(p,{key:0,value:f.node.description,"onUpdate:value":y=>f.node.description=y,border:!1},null,8,["value","onUpdate:value"])):(g(),w("p",Yl,"-"))]),_:1},8,["title"])]),_:1},8,["data"])}}};var Kl=q(ql,[["__scopeId","data-v-bda6618c"]]),Wl=Object.freeze(Object.defineProperty({__proto__:null,default:Kl},Symbol.toStringTag,{value:"Module"}));const Xl=["src"],Jl={setup(e){const t=se("info"),n=se("opened"),a=U(null),s=se("ELEMENT_ROOT"),i=me(()=>t.value.responseBody||""),o=me(()=>{if(n.value.responseBlob){const l=n.value.responseHeaders["content-disposition"];if(l){const u=l.replace(/.*filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/,"$1");Hn(n.value.responseBlobValue,u);return}return URL.createObjectURL(n.value.responseBlobValue)}}),r=l=>{const u=getComputedStyle(s.value),p=a.value.contentWindow.document.body.style;p.color=u.getPropertyValue("--main-color"),p.backgroundColor=u.getPropertyValue("--main-background-color")};return(l,u)=>{const p=b("magic-monaco-editor"),m=b("magic-empty");return h(n).responseBlob?h(o)?(g(),w("iframe",{key:1,src:h(o),onLoad:r,ref_key:"iframe",ref:a},null,40,Xl)):(g(),j(m,{key:2,text:h(c)("message.empty",h(c)("message.responseBody"))},null,8,["text"])):(g(),j(p,{key:0,value:h(i),"onUpdate:value":u[0]||(u[0]=f=>fa(i)?i.value=f:null),language:"json",readonly:!0},null,8,["value"]))}}};var Ql=q(Jl,[["__scopeId","data-v-27b4e47a"]]),Zl=Object.freeze(Object.defineProperty({__proto__:null,default:Ql},Symbol.toStringTag,{value:"Module"}));const ec=["title"],tc=["title"],nc={setup(e){const t=se("opened"),n=me(()=>Object.keys(t.value.responseHeaders||{}).map(a=>({key:a,value:t.value.responseHeaders[a]})));return(a,s)=>{const i=b("magic-table-column"),o=b("magic-table");return g(),j(o,{data:h(n),border:""},{default:k(()=>[_(i,{title:"Key"},{default:k(({row:r})=>[A("span",{title:r.key},B(r.key),9,ec)]),_:1}),_(i,{title:"Value"},{default:k(({row:r})=>[A("span",{title:r.value},B(r.value),9,tc)]),_:1})]),_:1},8,["data"])}}};var ac=q(nc,[["__scopeId","data-v-76813707"]]),sc=Object.freeze(Object.defineProperty({__proto__:null,default:ac},Symbol.toStringTag,{value:"Module"}));const ic=["onClick"],oc={key:0,align:"center",style:{flex:"1"}},rc={key:1,align:"center",style:{flex:"1"}},lc={setup(e){const t=se("opened"),n=s=>{const i=t.value.responseBodyTree.findIndex(r=>r===s),o=s.level;s.expand=!s.expand;for(let r=i+1,l=t.value.responseBodyTree.length;ro)u.display=s.expand;else break}},a=me(()=>{var s,i;return!t.value.responseBodyTree&&((i=(s=t.value)==null?void 0:s.item)==null?void 0:i.responseBodyDefinition)&&(t.value.responseBodyTree=an(t.value.item.responseBodyDefinition)),(t.value.responseBodyTree||[]).filter(o=>o.display)});return(s,i)=>{const o=b("magic-icon"),r=b("magic-table-column"),l=b("magic-select"),u=b("magic-input"),p=b("magic-table"),m=b("magic-empty");return h(a).length?(g(),j(p,{key:0,data:h(a),border:""},{default:k(()=>[_(r,{title:h(c)("api.field")},{default:k(({row:f})=>[A("span",{style:ze({paddingLeft:`${(f.level+(f.folder?0:1))*16}px`}),onClick:y=>n(f)},[f.folder?(g(),j(o,{key:0,icon:f.expand?"arrow-bottom":"arrow-right"},null,8,["icon"])):X("",!0)],12,ic),A("span",null,B(f.name||"-"),1)]),_:1},8,["title"]),_(r,{title:h(c)("message.type"),width:"80"},{default:k(({row:f})=>[_(l,{options:s.$BODY_DATA_TYPES,value:f.node.dataType,"onUpdate:value":y=>f.node.dataType=y,border:!1},null,8,["options","value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:"Value",flex:"3"},{default:k(({row:f})=>{var y;return[f.folder?(g(),w("p",oc,"-")):(g(),w("span",{key:1,class:Ee(["magic-data-type",(y=f.node.dataType)==null?void 0:y.toLowerCase()])},B(f.node.value),3))]}),_:1}),_(r,{title:h(c)("message.description")},{default:k(({row:f})=>[f.name?(g(),j(u,{key:0,value:f.node.description,"onUpdate:value":y=>f.node.description=y,border:!1},null,8,["value","onUpdate:value"])):(g(),w("p",rc,"-"))]),_:1},8,["title"])]),_:1},8,["data"])):(g(),j(m,{key:1,text:h(c)("message.empty",h(c)("message.responseBody"))},null,8,["text"]))}}};var cc=q(lc,[["__scopeId","data-v-051e4f5a"]]),uc=Object.freeze(Object.defineProperty({__proto__:null,default:cc},Symbol.toStringTag,{value:"Module"}));const pc={class:"magic-panel-api-response"},dc={props:{opened:Object},setup(e){const t=[{title:c("message.responseBody"),component:te("magic-api-response-body")},{title:c("message.responseHeader"),component:te("magic-api-response-header")},{title:c("message.responseStructure"),component:te("magic-api-response-structure")}];return(n,a)=>{const s=b("magic-navbar-item"),i=b("magic-navbar");return g(),w("div",pc,[_(i,{direction:"horizontal",ref:"navbar",style:{flex:"1"},"allow-close":!1},{default:k(()=>[(g(),w(Z,null,he(t,(o,r)=>_(s,{key:r,title:o.title},{default:k(()=>[(g(),j(ts,null,[(g(),j(te(o.component),{opened:e.opened},null,8,["opened"]))],1024))]),_:2},1032,["title"])),64))]),_:1},512)])}}};var _c=q(dc,[["__scopeId","data-v-a23b6466"]]),hc=Object.freeze(Object.defineProperty({__proto__:null,default:_c},Symbol.toStringTag,{value:"Module"}));const fc={class:"magic-panel-global"},mc={setup(e){const t=U(M.GLOBAL),n=U(-1);return(a,s)=>{const i=b("magic-panel-common-toolbar"),o=b("magic-input"),r=b("magic-table-column"),l=b("magic-table");return g(),w("div",fc,[_(i,{index:n.value,"onUpdate:index":s[0]||(s[0]=u=>n.value=u),value:t.value.headers},null,8,["index","value"]),_(l,{data:t.value.headers,border:"",onClickRow:s[1]||(s[1]=u=>n.value=u)},{default:k(()=>[_(r,{title:"Key"},{default:k(({row:u})=>[_(o,{value:u.name,"onUpdate:value":p=>u.name=p,border:!1},null,8,["value","onUpdate:value"])]),_:1}),_(r,{title:"Value"},{default:k(({row:u})=>[_(o,{value:u.value,"onUpdate:value":p=>u.value=p,border:!1},null,8,["value","onUpdate:value"])]),_:1})]),_:1},8,["data"])])}}};var gc=Object.freeze(Object.defineProperty({__proto__:null,default:mc},Symbol.toStringTag,{value:"Module"}));const vc={class:"magic-panel-global"},Ec={setup(e){const t=U(-1),n=U(M.GLOBAL);return(a,s)=>{const i=b("magic-panel-common-toolbar"),o=b("magic-input"),r=b("magic-table-column"),l=b("magic-file"),u=b("magic-table");return g(),w("div",vc,[_(i,{index:t.value,"onUpdate:index":s[0]||(s[0]=p=>t.value=p),value:n.value.parameters},null,8,["index","value"]),_(u,{data:n.value.parameters,border:"",onClickRow:s[1]||(s[1]=p=>t.value=p)},{default:k(()=>[_(r,{title:"Key"},{default:k(({row:p})=>[_(o,{value:p.name,"onUpdate:value":m=>p.name=m,border:!1},null,8,["value","onUpdate:value"])]),_:1}),_(r,{title:"Value"},{default:k(({row:p})=>[p.dataType==="MultipartFile"?(g(),j(l,{key:0,value:p.value,"onUpdate:value":m=>p.value=m,border:!1},null,8,["value","onUpdate:value"])):p.dataType==="MultipartFiles"?(g(),j(l,{key:1,value:p.value,"onUpdate:value":m=>p.value=m,border:!1,multiple:""},null,8,["value","onUpdate:value"])):(g(),j(o,{key:2,value:p.value,"onUpdate:value":m=>p.value=m,border:!1},null,8,["value","onUpdate:value"]))]),_:1})]),_:1},8,["data"])])}}};var bc=Object.freeze(Object.defineProperty({__proto__:null,default:Ec},Symbol.toStringTag,{value:"Module"}));const yc={class:"magic-global"},Tc={setup(e){const t=[{title:"\u5168\u5C40\u8BF7\u6C42\u53C2\u6570",component:te("magic-global-parameter")},{title:"\u5168\u5C40\u8BF7\u6C42Header",component:te("magic-global-header")}];return(n,a)=>{const s=b("magic-navbar-item"),i=b("magic-navbar");return g(),w("div",yc,[_(i,{direction:"horizontal",ref:"navbar",style:{flex:"1"},"allow-close":!1},{default:k(()=>[(g(),w(Z,null,he(t,(o,r)=>_(s,dt({key:r},o),{default:k(()=>[(g(),j(te(o.component)))]),_:2},1040)),64))]),_:1},512)])}}};var Sc=q(Tc,[["__scopeId","data-v-03e7bbcc"]]),Oc=Object.freeze(Object.defineProperty({__proto__:null,default:Sc},Symbol.toStringTag,{value:"Module"}));const xc={props:{value:Array,index:Number},emits:["update:index"],setup(e,{emit:t}){const n=e,a=[{title:c("message.addRow"),icon:"plus",onClick(){n.value.push({}),t("update:index",n.value.length-1)}},{title:c("message.removeRow"),icon:"minus",onClick(){n.value.length>0&&(n.value.splice(n.index==-1?n.value.length-1:n.index,1),t("update:index",-1))}}];return(s,i)=>{const o=b("magic-panel-toolbar");return g(),j(o,{toolbars:a})}}};var Rc=Object.freeze(Object.defineProperty({__proto__:null,default:xc},Symbol.toStringTag,{value:"Module"}));const Ac={class:"magic-panel-toolbar"},Ic=["title","onClick"],Cc={props:{toolbars:Array},setup(e){const t=n=>{n.selectable?n.disabled!==!0&&(n.selected=n.selected!==!0,n.onSelect&&n.onSelect(n.selected)):n.disabled!==!0&&n.onClick()};return(n,a)=>{const s=b("magic-icon");return g(),w("ul",Ac,[(g(!0),w(Z,null,he(e.toolbars,(i,o)=>(g(),w("li",{key:o,title:i.title,onClick:Se(r=>t(i),["stop"]),class:Ee({disabled:i.disabled,selected:i.selected})},[_(s,{icon:i.icon},null,8,["icon"])],10,Ic))),128))])}}};var Lc=q(Cc,[["__scopeId","data-v-56150b69"]]),Nc=Object.freeze(Object.defineProperty({__proto__:null,default:Lc},Symbol.toStringTag,{value:"Module"}));const wc={class:"magic-resource-choose"},kc={key:0},Dc={key:2},Mc={props:{value:[Array,Object],type:String,single:{type:Boolean,default:()=>!1},file:{type:Boolean,default:()=>!0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const a=e,s=se("resources"),i=se("service"),o=U([]),r=()=>{let E=[],C=I=>{I.id.endsWith("-root")?E.push({type:"root",id:I.type}):E.push({type:I.folder?"group":I.type,id:I.id}),I.children&&I.children.filter(O=>O.selected).forEach(O=>C(O))};o.value.filter(I=>I.selected).forEach(I=>C(I)),n("update:value",a.single?E[0]:E)},l=(E,C)=>{let I=[];return E&&E.filter(O=>O.id).forEach(O=>{var v;if(O.folder||a.file){if(O.folder)O.icon="list";else{const T=(v=i[C.type])==null?void 0:v.getIcon;O.icon=T&&T(O)||C.icon,O.textIcon=T!==void 0,O.type=C.type}I.push(O)}O.folder&&O.children&&(O.children=l(O.children,C))}),I},u=E=>{let C=E,I=[],O=v=>{v.forEach(T=>{T.id===C?(I.push(T),C=T.parentId||T.groupId,O(o.value)):T.children&&T.children.length>0&&O(T.children)})};return O(o.value),I},p=(E,C)=>{C!==void 0&&(E.selected=C);let I=O=>{O.selected=a.single?!1:E.selected,O.checkedHalf=a.single?!1:!E.selected,O.children&&O.children.forEach(v=>I(v))};E.children&&E.children.forEach(O=>I(O)),E.folder&&(E.checkedHalf=!1),u(E.folder?E.parentId:E.groupId).forEach(O=>{O.selected=a.single?!1:O.children.some(v=>v.selected),O.checkedHalf=a.single?!1:O.children.some(v=>!v.selected||v.checkedHalf)}),a.single?n("update:value",E.selected?E:void 0):r()},m=E=>p(E,!E.selected);return s().filter(E=>!a.type||a.type===E.navbar.type).forEach(E=>{const C=E.navbar.type,I=l(E.tree,E.navbar);I.forEach(O=>{O.folder?O.parentId=C+"-root":O.groupId=C+"-root"}),o.value.push({icon:E.navbar.icon,name:E.navbar.title,iconClass:"root",folder:!0,opened:!0,type:E.navbar.type,id:C+"-root",children:I})}),t({selectAll:E=>et(o.value,C=>{C.checkedHalf=!1,C.selected=E,C.children&&C.children.forEach(I=>I.selected=E),r()}),expand:E=>et(o.value,C=>{C.folder&&(C.opened=E)})}),(E,C)=>{const I=b("magic-checkbox"),O=b("magic-icon"),v=b("magic-text-icon"),T=b("magic-tree");return g(),w("div",wc,[_(T,{data:o.value,sort:!1,onItemClick:m},{folder:k(({item:R})=>[_(I,{value:R.selected,"onUpdate:value":D=>R.selected=D,"checked-half":R.checkedHalf,onChange:D=>p(R)},null,8,["value","onUpdate:value","checked-half","onChange"]),_(O,{icon:R.opened?"arrow-bottom":"arrow-right",onClick:Se(D=>R.opened=!R.opened,["stop"])},null,8,["icon","onClick"]),_(O,{icon:R.icon,class:Ee(R.iconClass)},null,8,["icon","class"]),A("label",null,B(R.name),1),R.path?(g(),w("span",kc,"("+B(R.path)+")",1)):X("",!0)]),file:k(({item:R})=>[_(I,{value:R.selected,"onUpdate:value":D=>R.selected=D,"checked-half":R.checkedHalf,onChange:D=>p(R)},null,8,["value","onUpdate:value","checked-half","onChange"]),R.textIcon?(g(),j(v,{key:0,icon:R.icon},null,8,["icon"])):(g(),j(O,{key:1,icon:R.icon},null,8,["icon"])),A("label",null,B(R.name),1),R.path?(g(),w("span",Dc,"("+B(R.path)+")",1)):X("",!0)]),_:1},8,["data"])])}}};var Pc=q(Mc,[["__scopeId","data-v-4852fc0e"]]),Uc=Object.freeze(Object.defineProperty({__proto__:null,default:Pc},Symbol.toStringTag,{value:"Module"}));const $c={class:"magic-form-row"},Bc={class:"magic-form-row"},Fc=A("label",null,"Key",-1),Hc={class:"magic-form-row"},jc=A("label",null,"URL",-1),Vc={class:"magic-form-row"},Gc={class:"magic-form-row"},zc={class:"magic-form-row"},Yc={class:"magic-form-row"},qc={class:"magic-form-row"},Kc=A("label",null,"maxRows",-1),Wc={class:"magic-form-row"},Xc={props:{info:Object},setup(e){const{info:t}=e,n=U(JSON.stringify(t.properties||{}));return tt(n,a=>{try{t.properties=JSON.parse(a)}catch{t.properties={}}}),(a,s)=>{const i=b("magic-input"),o=b("magic-select"),r=b("magic-monaco-editor");return g(),w(Z,null,[A("div",$c,[A("label",null,B(h(c)("message.name")),1),_(i,{value:e.info.name,"onUpdate:value":s[0]||(s[0]=l=>e.info.name=l),placeholder:h(c)("datasource.form.placeholder.name")},null,8,["value","placeholder"])]),A("div",Bc,[Fc,_(i,{value:e.info.key,"onUpdate:value":s[1]||(s[1]=l=>e.info.key=l),placeholder:h(c)("datasource.form.placeholder.key")},null,8,["value","placeholder"])]),A("div",Hc,[jc,_(i,{value:e.info.url,"onUpdate:value":s[2]||(s[2]=l=>e.info.url=l),placeholder:h(c)("datasource.form.placeholder.url")},null,8,["value","placeholder"])]),A("div",Vc,[A("label",null,B(h(c)("message.username")),1),_(i,{value:e.info.username,"onUpdate:value":s[3]||(s[3]=l=>e.info.username=l),placeholder:h(c)("datasource.form.placeholder.username")},null,8,["value","placeholder"])]),A("div",Gc,[A("label",null,B(h(c)("message.password")),1),_(i,{value:e.info.password,"onUpdate:value":s[4]||(s[4]=l=>e.info.password=l),type:"password",placeholder:h(c)("datasource.form.placeholder.password")},null,8,["value","placeholder"])]),A("div",zc,[A("label",null,B(h(c)("datasource.form.driver")),1),_(o,{inputable:"",value:e.info.driverClassName,"onUpdate:value":s[5]||(s[5]=l=>e.info.driverClassName=l),width:"100%",options:h(M).JDBC_DRIVERS.map(l=>({text:l,value:l})),placeholder:h(c)("datasource.form.placeholder.driver")},null,8,["value","options","placeholder"])]),A("div",Yc,[A("label",null,B(h(c)("datasource.form.type")),1),_(o,{inputable:"",value:e.info.type,"onUpdate:value":s[6]||(s[6]=l=>e.info.type=l),width:"100%",options:h(M).DATASOURCE_TYPES.map(l=>({text:l,value:l})),placeholder:h(c)("datasource.form.placeholder.type")},null,8,["value","options","placeholder"])]),A("div",qc,[Kc,_(i,{value:e.info.maxRows,"onUpdate:value":s[7]||(s[7]=l=>e.info.maxRows=l),placeholder:h(c)("datasource.form.placeholder.maxRows"),"default-value":-1,type:"number"},null,8,["value","placeholder"])]),A("div",Wc,[A("label",null,B(h(c)("datasource.form.other")),1),_(r,{language:"json",value:n.value,"onUpdate:value":s[8]||(s[8]=l=>n.value=l),style:{height:"150px"}},null,8,["value"])])],64)}}};var Jc=Object.freeze(Object.defineProperty({__proto__:null,default:Xc},Symbol.toStringTag,{value:"Module"}));const Qc={class:"magic-backup-file"},Zc={class:"magic-backup-file-diff-container"},eu={props:{id:String},setup(e){const t=e,n=se("service"),a=U(""),s=U(!0),i=U(!0),o=Je([]),r=U({}),l=U([]),u=U(""),p=()=>{u.value=n[r.value.type].language||"magicscript";const E=[];i.value=!0,a.value||E.push(new Promise(C=>z.sendGet("/resource/file/"+t.id).success(I=>a.value=I).end(()=>C()))),E.push(new Promise(C=>z.sendGet("/backup",{id:t.id,timestamp:r.value.createDate}).success(I=>r.value.script=I).end(()=>C()))),Promise.all(E).then(()=>{var C;i.value=!1,l.value=[r.value.script,(C=a.value)==null?void 0:C.script]}).catch(C=>{console.error(C),i.value=!1})},m=()=>{s.value=!0,z.sendGet("/backup/"+t.id).success(E=>{E&&E.length>0&&(o.length=0,o.push(...E),r.value=o[0]||{},r.value&&p()),s.value=!1})};m(),tt(()=>t.id,m);const f=()=>{const E=`${r.value.name}(${We(r.value.createDate)})`;z.sendPost("/backup/rollback",{id:t.id,timestamp:r.value.createDate}).success(C=>{C?(ve.alert(c("backup.rollbackSuccess",E)),S.status("backup.rollbackSuccess",!0,E),S.$emit(F.REFRESH_RESOURCE,t.id)):(ve.alert(c("backup.rollbackFailed",E)),S.status("backup.rollbackFailed",!1,E))})},y=E=>{r.value=o[E],p()};return(E,C)=>{const I=b("magic-table-column"),O=b("magic-table"),v=b("magic-button"),T=b("magic-monaco-diff-editor"),R=b("magic-loading"),D=b("magic-empty");return g(),j(R,{loading:s.value},{default:k(()=>[A("div",Qc,[h(o).length>0?(g(),w(Z,{key:0},[_(O,{data:h(o),border:!0,onClickRow:y},{default:k(()=>[_(I,{title:h(c)("message.date"),width:"160",class:"selected"},{default:k(({row:L})=>[_e(B(h(We)(L.createDate)),1)]),_:1},8,["title"]),_(I,{title:h(c)("history.operator"),width:"100"},{default:k(({row:L})=>[_e(B(L.createBy||"guest"),1)]),_:1},8,["title"])]),_:1},8,["data"]),A("div",Zc,[A("ul",null,[A("li",null,[_e(B(h(We)(r.value.createDate))+" by "+B(r.value.createBy||"guest")+" ",1),_(v,{value:h(c)("backup.rollback"),type:"active",onClick:f},null,8,["value"])]),A("li",null,[_e(B(h(c)("backup.current")),1),a.value?(g(),w(Z,{key:0},[_e("("+B(h(We)(a.value.updateTime||a.value.createTime))+" by "+B(a.value.updateBy||a.value.createBy||"guest")+")",1)],64)):X("",!0)])]),i.value?(g(),j(R,{key:1,loading:i.value},null,8,["loading"])):(g(),j(T,{key:0,value:l.value,"onUpdate:value":C[0]||(C[0]=L=>l.value=L),language:u.value},null,8,["value","language"]))])],64)):(g(),j(D,{key:1,text:h(c)("message.empty",h(c)("history.name"))},null,8,["text"]))])]),_:1},8,["loading"])}}};var tu=q(eu,[["__scopeId","data-v-ef606938"]]),nu=Object.freeze(Object.defineProperty({__proto__:null,default:tu},Symbol.toStringTag,{value:"Module"}));const au={class:"magic-backup"},su={class:"magic-backup-diff-container"},iu={class:"magic-backup-diff-header"},ou={setup(e){const t=te("magic-backup-file"),n=U(!0),a=[{icon:"refresh",title:c("message.refresh"),onClick(){E()}},{icon:"copy",title:c("backup.full"),onClick(){z.sendPost("/backup/full").success(()=>{S.status("backup.backupSuccess"),E()})}}],s=U([]),i=U([]),o=U(!1),r=U(!0),l=U(""),u=U({}),p=U("magicscript");let m=!1,f=!1,y;const E=N=>{n.value=!0,z.sendGet("/backups",{timestamp:N}).success($=>{N?i.value.push(...$):i.value=$,(f=$.length>=100)&&(y=$[$.length-1].createDate),n.value=!1})},C=se("service"),I=U({}),O=N=>{var $,Y;return N.endsWith("-group")?c("message.group",(($=C[N.replace("-group","")])==null?void 0:$.name)||"Unknown"):N==="full"?c("backup.full"):((Y=C[N])==null?void 0:Y.name)||N};let v=!1;S.$on(F.LOAD_RESOURCES_FINISH,N=>N||E());const T=()=>{f&&!m&&E(y)};ht(()=>{!v&&M.LOGINED&&E(),v=!0});const{proxy:R}=St(),D=(N,$)=>{const Y=[],re=C[$.type];$.id!=="full"&&!($.type&&$.type.endsWith("-group"))&&!(re&&re.requireScript===!1)&&(Y.push({icon:"difference",label:c("backup.difference"),onClick(){l.value=We($.createDate),o.value=!0,r.value=!0,p.value=C[$.type].language||"magicscript",Promise.all([new Promise(ie=>z.sendGet("/backup",{id:$.id,timestamp:$.createDate}).success(Q=>ie(Q))),new Promise(ie=>z.sendGet("/resource/file/"+$.id).success(Q=>ie(Q)))]).then(ie=>{var Q;I.value=ie[1],u.value=$,r.value=!1,s.value=[ie[0],(Q=ie[1])==null?void 0:Q.script]}).catch(ie=>{console.error(ie),o.value=!1})}}),Y.push({label:c("toolbars.history"),icon:"history",onClick:()=>{S.$emit(F.ADD_FOOTER_TOOLBAR,{component:$e(t),id:"backup-file",icon:"history",title:c("toolbars.viewHistory",$.name),allowClose:!0,data:{id:$.id}})}})),($.id==="full"||!$.type.endsWith("-group"))&&Y.push({icon:"rollback",label:c("backup.rollback"),onClick(){const ie=`${$.name}(${We($.createDate)})`;ve.confirm(c("backup.rollback"),c("backup.rollbackConfirm"),()=>{z.sendPost("/backup/rollback",{id:$.id,timestamp:$.createDate}).success(Q=>{Q?(S.status("backup.rollbackSuccess",!0,ie),S.$emit(F.LOAD_RESOURCES)):(ve.alert(c("backup.rollbackFailed",ie)),S.status("backup.rollbackFailed",!1,ie))})})}}),Y.length>0&&R.$contextmenu({event:N,menus:Y})},L=()=>{o.value=!1;const N=`${u.value.name}(${We(u.value.createDate)})`;z.sendPost("/backup/rollback",{id:u.value.id,timestamp:u.value.createDate}).success($=>{$?(ve.alert(c("backup.rollbackSuccess",N)),S.status("backup.rollbackSuccess",!0,N),S.$emit(F.REFRESH_RESOURCE,u.value.id)):(ve.alert(c("backup.rollbackFailed",N)),S.status("backup.rollbackFailed",!1,N))})};return(N,$)=>{const Y=b("magic-panel-toolbar"),re=b("magic-loading"),ie=b("magic-table-column"),Q=b("magic-table"),ye=b("magic-empty"),Te=b("magic-monaco-diff-editor"),Rt=b("magic-button"),At=b("magic-button-group"),ke=b("magic-dialog");return g(),w(Z,null,[A("div",au,[_(Y,{toolbars:a}),A("div",null,[_(re,{loading:n.value},null,8,["loading"]),i.value.length>0?(g(),j(Q,{key:0,data:i.value,border:!0,onContextmenu:D,onLoadNext:T},{default:k(()=>[_(ie,{title:h(c)("message.date"),width:"160"},{default:k(({row:Ne})=>[_e(B(h(We)(Ne.createDate)),1)]),_:1},8,["title"]),_(ie,{title:h(c)("message.type"),width:"90"},{default:k(({row:Ne})=>[A("span",null,B(O(Ne.type)),1)]),_:1},8,["title"]),_(ie,{title:h(c)("history.operator"),width:"100"},{default:k(({row:Ne})=>[_e(B(Ne.createBy||"guest"),1)]),_:1},8,["title"]),_(ie,{title:h(c)("message.name"),align:"left"},{default:k(({row:Ne})=>[_e(B(Ne.name),1)]),_:1},8,["title"])]),_:1},8,["data"])):(g(),j(ye,{key:1,text:h(c)("message.empty",h(c)("history.name"))},null,8,["text"]))])]),_(ke,{value:o.value,"onUpdate:value":$[1]||($[1]=Ne=>o.value=Ne),title:h(c)("history.name"),width:"80%",maxWidth:"100%",top:"60px",height:"80%",className:"magic-dialog-diff"},{default:k(()=>[A("div",su,[A("div",iu,[A("div",null,B(l.value)+" by "+B(u.value.createBy||"guest"),1),A("div",null,B(h(c)("backup.current"))+"("+B(h(We)(I.value.updateTime||I.value.createTime))+" by "+B(I.value.updateBy||I.value.createBy||"guest")+")",1)]),r.value?(g(),j(re,{key:1,loading:r.value},null,8,["loading"])):(g(),j(Te,{key:0,value:s.value,"onUpdate:value":$[0]||($[0]=Ne=>s.value=Ne),language:p.value},null,8,["value","language"]))]),_(At,{align:"right"},{default:k(()=>[_(Rt,{value:h(c)("backup.rollback"),type:"active",onClick:L},null,8,["value"])]),_:1})]),_:1},8,["value","title"])],64)}}};var ru=q(ou,[["__scopeId","data-v-b15945c0"]]),lu=Object.freeze(Object.defineProperty({__proto__:null,default:ru},Symbol.toStringTag,{value:"Module"}));const ct=e=>(Dn("data-v-71b796dc"),e=e(),Mn(),e),cu={class:"magic-debug"},uu={class:"magic-debug-variables"},pu={key:0,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},du=ct(()=>A("path",{d:"M201.472 320h-49.6V129.408l-59.2 18.368v-40.32L196.16 70.4h5.312V320z m50.816 320.128H81.024v-33.92l80.832-86.208c6.016-6.656 11.136-12.672 15.36-18.176a133.76 133.76 0 0 0 10.112-15.104 57.728 57.728 0 0 0 5.504-12.8 42.88 42.88 0 0 0 1.6-11.392c0-11.136-2.816-19.84-8.384-26.24-5.632-6.272-13.632-9.472-24.064-9.472a36.224 36.224 0 0 0-15.488 3.2 31.808 31.808 0 0 0-11.328 8.704 39.232 39.232 0 0 0-6.976 13.312 56.32 56.32 0 0 0-2.368 16.832h-49.792c0-11.2 1.984-21.76 6.016-31.744 3.968-9.984 9.792-18.624 17.28-26.112 7.616-7.424 16.704-13.312 27.392-17.664 10.688-4.352 22.784-6.528 36.16-6.528 13.12 0 24.768 1.664 34.88 4.928 10.176 3.2 18.624 7.872 25.536 13.952 6.848 6.08 12.032 13.504 15.616 22.336 3.52 8.768 5.312 18.688 5.312 29.696 0 8.32-1.28 16.384-3.968 24.192-2.56 7.744-6.336 15.552-11.136 23.296a190.08 190.08 0 0 1-17.408 23.68 528.64 528.64 0 0 1-22.784 24.768l-44.096 46.464h107.456v40zM131.456 812.8h26.432c12.608 0 21.888-3.136 27.968-9.408a34.56 34.56 0 0 0 9.088-25.088 38.656 38.656 0 0 0-2.048-12.8 26.304 26.304 0 0 0-16.832-16.704 42.112 42.112 0 0 0-14.912-2.432 41.792 41.792 0 0 0-12.928 1.984 33.664 33.664 0 0 0-10.688 5.568 25.6 25.6 0 0 0-9.856 20.608H78.08a60.8 60.8 0 0 1 6.4-28.032c4.352-8.448 10.176-15.552 17.536-21.44 7.424-5.888 16-10.496 25.984-13.76 9.984-3.2 20.608-4.864 32-4.864 12.544 0 24 1.472 34.368 4.48 10.368 3.072 19.2 7.616 26.688 13.632 7.424 5.952 13.184 13.44 17.28 22.272 4.16 8.896 6.208 19.2 6.208 30.848a52.8 52.8 0 0 1-9.856 30.72 67.968 67.968 0 0 1-28.032 22.976 62.08 62.08 0 0 1 31.488 22.656 61.44 61.44 0 0 1 10.368 35.712 66.56 66.56 0 0 1-25.408 54.336c-7.872 6.208-17.28 10.88-28.032 14.208a121.024 121.024 0 0 1-66.368 0.64 81.92 81.92 0 0 1-27.2-13.248 68.032 68.032 0 0 1-19.2-22.4 66.304 66.304 0 0 1-7.296-32h49.6a29.824 29.824 0 0 0 10.368 22.912 36.48 36.48 0 0 0 11.584 6.592 48.64 48.64 0 0 0 30.4 0 30.336 30.336 0 0 0 19.392-17.792 46.208 46.208 0 0 0-0.256-31.04 28.544 28.544 0 0 0-8.192-11.584 34.304 34.304 0 0 0-12.928-6.592 63.104 63.104 0 0 0-17.088-2.176h-26.432V812.8z",fill:"#9AA7B0"},null,-1)),_u=ct(()=>A("path",{d:"M384 128h512v192H384zM384 768h512v192H384zM384 448h512v192H384z",fill:"#40B6E0","fill-opacity":".7"},null,-1)),hu=[du,_u],fu={key:1,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},mu=ct(()=>A("path",{d:"M192 128h640v192H192zM192 384h640v192H192zM192 640h640v192H192z",fill:"#F4AF3D","fill-opacity":".6"},null,-1)),gu=[mu],vu={class:"key"},Eu=ct(()=>A("label",{class:"separator"},"=",-1)),bu={key:2,class:"object-type"},yu={key:3,class:"object-type"},Tu={key:0,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Su=ct(()=>A("path",{d:"M128 128h768v768H128z",fill:"#40B6E0","fill-opacity":".6","p-id":"8251"},null,-1)),Ou=ct(()=>A("path",{d:"M691.968 704V422.912l-62.464 15.36L613.12 373.76l102.912-30.72h53.76V704h-77.824z m-284.288 6.144c-95.744 0-158.72-80.384-158.72-184.32V524.8c0-103.936 64.512-185.344 159.744-185.344 94.72 0 158.72 80.384 158.72 184.32V524.8c0 103.936-64 185.344-159.744 185.344z m1.408-71.168c47.616 0 77.824-48.128 77.824-113.152V524.8c0-65.024-31.744-114.176-78.848-114.176S330.24 458.24 330.24 523.776V524.8c0 65.536 31.232 114.176 78.848 114.176z",fill:"#231F20","fill-opacity":".7","p-id":"8252"},null,-1)),xu=[Su,Ou],Ru={key:1,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Au=ct(()=>A("path",{d:"M192 128h640v192H192zM192 384h640v192H192zM192 640h640v192H192z",fill:"#F4AF3D","fill-opacity":".6"},null,-1)),Iu=[Au],Cu={class:"key"},Lu=ct(()=>A("label",{class:"separator"},"=",-1)),Nu={key:2,class:"object-type"},wu={setup(e){const t=se("opened"),n=me(()=>!t.value.variables),a=U([{title:c("editor.tooltip.resume")+"(F8)",icon:"continue",disabled:n,onClick(){S.$emit(F.DEBUG_CONTINUE)}},{title:c("editor.tooltip.stepInto")+"(F6)",icon:"step-over",disabled:n,onClick(){S.$emit(F.DEBUG_SETPINTO)}},{title:c("resource.header.expand"),icon:"expand-all",disabled:n,onClick:()=>et(t.value.variables,s=>s.opened=!0)},{title:c("resource.header.collapse"),icon:"collapse-all",disabled:n,onClick:()=>et(t.value.variables,s=>s.opened=!1)}]);return(s,i)=>{const o=b("magic-panel-toolbar"),r=b("magic-icon"),l=b("magic-tree"),u=b("magic-empty");return g(),w("div",cu,[_(o,{toolbars:a.value},null,8,["toolbars"]),A("div",uu,[h(t).variables?(g(),j(l,{key:0,data:h(t).variables},{folder:k(({item:p})=>[_(r,{icon:p.opened?"arrow-bottom":"arrow-right",onClick:Se(m=>p.opened=!p.opened,["stop"])},null,8,["icon","onClick"]),p.dataType==="array"?(g(),w("svg",pu,hu)):(g(),w("svg",fu,gu)),A("label",vu,B(p.name),1),Eu,p.size?(g(),w("span",bu,"("+B(p.size)+")",1)):X("",!0),p.type?(g(),w("span",yu,B(`{${p.type}}`),1)):X("",!0)]),file:k(({item:p})=>[_(r,{icon:"empty"}),p.dataType==="number"?(g(),w("svg",Tu,xu)):(g(),w("svg",Ru,Iu)),A("label",Cu,B(p.name),1),Lu,A("span",{class:Ee(["magic-data-type",p.dataType])},B(p.value),3),p.type&&!p.isNull?(g(),w("span",Nu," ("+B(p.type)+")",1)):X("",!0)]),_:1},8,["data"])):(g(),j(u,{key:1,text:h(c)("message.empty",h(c)("message.variable"))},null,8,["text"]))])])}}};var ku=q(wu,[["__scopeId","data-v-71b796dc"]]),Du=Object.freeze(Object.defineProperty({__proto__:null,default:ku},Symbol.toStringTag,{value:"Module"}));const Mu={class:"magic-event"},Pu=["innerHTML"],Uu={setup(e){const t=S.getStatusLog(),n=[{title:c("message.clear"),icon:"clear",onClick:()=>{S.clearStatusLog()}}];return(a,s)=>{const i=b("magic-panel-toolbar"),o=b("magic-table-column"),r=b("magic-table");return g(),w("div",Mu,[_(i,{toolbars:n}),A("div",null,[_(r,{data:h(t),border:"",align:"left"},{default:k(()=>[_(o,{title:h(c)("message.date"),width:"180"},{default:k(({row:l})=>[_e(B(l.timestamp),1)]),_:1},8,["title"]),_(o,{title:h(c)("event.message")},{default:k(({row:l})=>[A("div",{innerHTML:l.content},null,8,Pu)]),_:1},8,["title"])]),_:1},8,["data"])])])}}};var $u=q(Uu,[["__scopeId","data-v-06d5ba36"]]),Bu=Object.freeze(Object.defineProperty({__proto__:null,default:$u},Symbol.toStringTag,{value:"Module"}));const Fu={class:"magic-log-wrapper"},Hu=["innerHTML"],ju=["onClick"],Vu={setup(e){const t=U([]),n=U(!1),a=U([{icon:"expand-all",title:c("resource.header.expand"),onClick:()=>t.value.forEach(p=>p.showMore=!0)},{icon:"collapse-all",title:c("resource.header.collapse"),onClick:()=>t.value.forEach(p=>p.showMore=!1)},{icon:"delete",title:c("message.clear"),onClick:()=>t.value.splice(0)},{icon:"scroll-down",title:c("log.scrollEnd"),selectable:!0,onSelect:p=>{n.value=p,o()}}]),s=U(null),{proxy:i}=St(),o=()=>{n.value&&be(()=>{s.value&&(s.value.scrollTop=s.value.scrollHeight)})},r=p=>{i.$contextmenu({event:p,menus:[{icon:"delete",label:c("message.clear"),onClick:()=>t.value.splice(0)},{icon:"expand-all",label:c("resource.header.expand"),onClick:()=>t.value.forEach(m=>m.showMore=!0)},{icon:"collapse-all",label:c("resource.header.collapse"),onClick:()=>t.value.forEach(m=>m.showMore=!1)}]})},l=p=>{const m=p.map(f=>{let y=f.replace(/[&<>]/gm,function(C){return C==="&"?"&":C==="<"?"<":C===">"?">":""});y=y.replace(/(\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3}\s+)([^\s]+)( --- \[)(.{15})(] )(.{40})/gm,'$1 $2$3$4$5$6'),y=y.replace(/(https?:\/\/[^\s]+)/gm,'$1'),y=y.replace(/(\tat .*\()(.*?:\d+)(\).*?[\r\n])/g,'$1$2$3');let E=f.split(` `).length;return{html:y,multiple:E>3,lines:E-3,showMore:!1}});m&&(t.value.push(...m),M.LOG_MAX_ROWS!==1/0&&t.value.length>M.LOG_MAX_ROWS&&t.value.splice(0,t.value.length-M.LOG_MAX_ROWS),o())};S.$event(Re.LOGS,([p])=>l(p)),S.$event(Re.LOG,([p])=>l(p));const u=new IntersectionObserver(()=>{o()});return ht(()=>{u.observe(s.value)}),(p,m)=>{const f=b("magic-panel-toolbar"),y=b("magic-empty");return g(),w("div",Fu,[_(f,{toolbars:a.value},null,8,["toolbars"]),!t.value||t.value.length===0?(g(),j(y,{key:0,text:h(c)("message.empty",h(c)("message.log"))},null,8,["text"])):X("",!0),yt(A("div",{class:"magic-log",ref_key:"element",ref:s,onContextmenu:m[0]||(m[0]=Se(E=>r(E),["prevent"]))},[(g(!0),w(Z,null,he(t.value,(E,C)=>(g(),w("div",{class:Ee({multiple:E.multiple,more:E.showMore}),key:"run_log_"+C},[A("pre",{innerHTML:E.html},null,8,Hu),E.multiple?(g(),w("span",{key:0,class:"multiple",onClick:I=>E.showMore=!E.showMore},B(E.showMore?h(c)("log.hide"):h(c)("log.show",E.lines)),9,ju)):X("",!0)],2))),128))],544),[[$t,t.value&&t.value.length>0]])])}}};var Gu=Object.freeze(Object.defineProperty({__proto__:null,default:Vu},Symbol.toStringTag,{value:"Module"}));const zu={class:"magic-online"},Yu={setup(e){const t=Je([]),n=se("activateUserFiles"),a=(i,o)=>{const r=t.find(l=>l.cid===i);r&&(Object.values(n.value).forEach(l=>{const u=l.findIndex(p=>p.cid===i);u>-1&&l.splice(u,1)}),n.value[o]=n.value[o]||[],n.value[o].push(r))},s=i=>{t.some(o=>o.cid===i.cid)||t.push(i)};return S.$event(Re.LOGIN_RESPONSE,([i,o])=>{n.value={},t.splice(0,t.length),i==="1"&&s(o)}),S.$event(Re.PING,()=>{S.send(Re.PONG)}),S.$event(Re.USER_LOGIN,([i])=>{M.CLIENT_ID!==i.cid&&(S.$emit(F.NOTIFY,{title:c("online.login"),content:c("online.loginTips",i.username,i.ip),duration:3e3}),S.status("online.loginTips",!0,i.username,i.ip)),s(i)}),S.$event(Re.USER_LOGOUT,([i])=>{M.CLIENT_ID!==i.cid&&(S.$emit(F.NOTIFY,{title:c("online.logout"),content:c("online.logoutTips",i.username,i.ip),duration:3e3}),S.status("online.logoutTips",!0,i.username,i.ip));const o=t.findIndex(r=>r.cid===i.cid);a(i.cid,"0"),o>-1&&t.splice(o,1)}),S.$event(Re.ONLINE_USERS,([i])=>{i.forEach(o=>{M.CLIENT_ID!==o.cid&&(s(o),o.fileId&&a(o.cid,o.fileId))})}),S.$event(Re.INTO_FILE_ID,([i,o])=>a(i,o)),(i,o)=>{const r=b("magic-avatar-group");return g(),w("div",zu,[_(r,{users:h(t),max:9},null,8,["users"]),A("span",null,B(h(c)("online.onlines",h(t).length)),1)])}}};var qu=q(Yu,[["__scopeId","data-v-0c296fa2"]]),Ku=Object.freeze(Object.defineProperty({__proto__:null,default:qu},Symbol.toStringTag,{value:"Module"}));const Wu={class:"magic-status-bar"},Xu=["innerHTML"],Ju=["title","onClick"],Qu={props:{config:Object},setup(e){const t=e,n=U(null),a=[{icon:"gitee",title:"Gitee",displayKey:"repo",onClick:()=>window.open("https://gitee.com/ssssssss-team/magic-api")},{icon:"git",title:"Github",displayKey:"repo",onClick:()=>window.open("https://github.com/ssssssss-team/magic-api")},{icon:"qq",title:c("message.joinGroup"),displayKey:"qqGroup",onClick:()=>window.open("https://qm.qq.com/cgi-bin/qm/qr?k=Q6dLmVS8cHwoaaP18A3tteK_o0244e6B&jump_from=webapi")},{icon:"help",title:c("message.document"),displayKey:"document",onClick:()=>window.open("https://ssssssss.org/magic-api")}],s=me(()=>{const o=a.filter(r=>t.config.header[r.displayKey]!==!1);return n.value&&n.value.id&&n.value.username&&o.push({icon:"logout",title:n.value.username,onClick:()=>ve.confirm(c("message.logout"),c("message.logoutConfirm",n.value.username),()=>z.sendPost("/logout").success(()=>{n.value=null,M.HEADER_MAGIC_TOKEN_VALUE="unauthorization",M.LOGINED=!1,Fe.remove(M.STORE.token),S.$emit(F.LOGOUT),S.status("message.logoutSuccess")}))}),o}),i=U("");return S.$on(F.LOGINED,()=>{S.status("message.getCurrentLoginUser"),z.send("/user").success(o=>n.value=o)}),S.$on(F.STATUS,o=>i.value=o),(o,r)=>{const l=b("magic-online"),u=b("magic-icon");return g(),w("div",Wu,[A("div",{class:"message",innerHTML:i.value},null,8,Xu),_(l),A("ul",null,[(g(!0),w(Z,null,he(h(s),(p,m)=>(g(),w("li",{title:p.title,key:m,onClick:Se(p.onClick,["stop"])},[_(u,{icon:p.icon},null,8,["icon"])],8,Ju))),128))])])}}};var Zu=q(Qu,[["__scopeId","data-v-49bc4fc3"]]),e1=Object.freeze(Object.defineProperty({__proto__:null,default:Zu},Symbol.toStringTag,{value:"Module"}));const t1={class:"magic-todo"},n1={key:3},a1={class:"todo"},s1={setup(e){const t=U(!0),n=[{icon:"refresh",title:c("message.refresh"),onClick(){p()}},{icon:"expand-all",title:c("message.expand"),onClick:()=>et(a.value,f=>f.opened=!0)},{icon:"collapse-all",title:c("message.collapse"),onClick:()=>et(a.value,f=>f.opened=!1)}],a=U([]),s=se("resources"),i={},o=f=>{(f.groupId||f.line)&&S.$emit(F.OPEN_WITH_ID,f.id)},r=(f,y)=>{let E=f.find(C=>C.id===y);if(!E)for(let C=0;C{let y=[];return f.forEach(E=>{E.line>0?y.push(E):E.folder&&E.children&&(E.children=l(E.children),E.children.length&&y.push(E))}),y},u=se("service"),p=()=>{a.value=[],t.value=!0,z.sendGet("/todo").success(f=>{const y=s();y.forEach(C=>i[C.navbar.type]=C.navbar);let E=!1;f.forEach(C=>{for(let I=0;IC.display).map(C=>({folder:!0,icon:C.navbar.icon,name:C.navbar.title,children:C.tree,root:!0}))),et(a.value,C=>C.opened=!0)),t.value=!1})};let m=!1;return S.$on(F.LOAD_RESOURCES_FINISH,p),ht(()=>{!m&&M.LOGINED&&p(),m=!0}),(f,y)=>{const E=b("magic-panel-toolbar"),C=b("magic-loading"),I=b("magic-icon"),O=b("magic-text-icon"),v=b("magic-tree"),T=b("magic-empty");return g(),w("div",t1,[_(E,{toolbars:n}),A("div",null,[_(C,{loading:t.value},null,8,["loading"]),a.value.length>0?(g(),j(v,{key:0,data:a.value,onItemClick:o},{folder:k(({item:R})=>[_(I,{icon:R.opened?"arrow-bottom":"arrow-right",onClick:Se(D=>R.opened=!R.opened,["stop"])},null,8,["icon","onClick"]),R.root?(g(),j(I,{key:0,icon:R.icon},null,8,["icon"])):R.icon?(g(),j(O,{key:1,icon:R.icon},null,8,["icon"])):(g(),j(I,{key:2,icon:"list"})),A("label",null,B(R.name),1),R.path?(g(),w("span",n1,"("+B(R.path)+")",1)):X("",!0)]),file:k(({item:R})=>[_(I),_(I,{icon:"todo"}),A("label",a1,B(R.text),1)]),_:1},8,["data"])):(g(),j(T,{key:1,text:h(c)("message.empty","TODO")},null,8,["text"]))])])}}};var i1=q(s1,[["__scopeId","data-v-29308d9b"]]),o1=Object.freeze(Object.defineProperty({__proto__:null,default:i1},Symbol.toStringTag,{value:"Module"}));const r1={class:"magic-toolbar"},l1={class:"magic-toolbar-header"},c1={class:"magic-toolbar-header-buttons"},u1={setup(e){const t=U(null),n=Je([{type:"api",title:c("api.title"),icon:"parameter",component:$e(te("magic-api-info"))},{id:"response",type:"api",title:c("toolbars.response"),icon:"run",component:$e(te("magic-api-response"))},{type:"function",title:c("fn.title"),icon:"parameter",component:$e(te("magic-function-info"))},{type:"group-api",title:c("message.group",c("api.name")),icon:"parameter",component:$e(te("magic-api-group"))},{id:"debug",type:["api","task"],title:c("toolbars.debug"),icon:"debug-info",component:$e(te("magic-debug"))},{id:"log",title:c("toolbars.log"),icon:"log",component:$e(te("magic-log"))},{type:"api",title:c("toolbars.global"),icon:"settings",component:$e(te("magic-global"))},{id:"todo",title:"TODO",icon:"todo",component:$e(te("magic-todo"))},{id:"history",title:c("toolbars.history"),icon:"history",component:$e(te("magic-backup"))},{id:"event",title:c("toolbars.event"),icon:"event",component:$e(te("magic-event")),style:{float:"right"}}]);M.PLUGINS.filter(r=>r.toolbars&&r.toolbars.length>0).map(r=>r.toolbars).forEach(r=>r.forEach(l=>{n.unshift({id:l.id,type:l.type,icon:l.icon,title:c(l.title),component:$e(l.component)})}));const a=U({}),s=U({});Ke("opened",a),Ke("info",s);const i=(r,l)=>{n.forEach(u=>u.show=u.type===void 0||(Array.isArray(u.type)?u.type.find(p=>p.type===r):u.type===r)),t.value&&l&&t.value.select(n.findIndex(u=>u.show))};i("");const o=r=>{const l=n.findIndex(u=>u.id===r.id);l>-1&&n.splice(l,1),t.value.select(-1)};return S.$on(F.ADD_FOOTER_TOOLBAR,r=>{r.id&&o(r),t.value.select(n.push(r)-1)}),S.$on(F.OPEN_EMPTY,()=>i("")),S.$on(F.OPEN,(r,l)=>{r.responseBlobValue=null,a.value=r,s.value=r.item,i(r.type,l)}),S.$on(F.OPEN_GROUP,r=>{i("group-"+r.type,!0),s.value=r}),S.$on(F.SWITCH_TOOLBAR,r=>{const l=n.findIndex(u=>u.id===r);l>-1&&t.value.select(l)}),(r,l)=>{const u=b("magic-icon"),p=b("magic-resizer"),m=b("magic-navbar-item"),f=b("magic-navbar");return g(),w("div",r1,[_(f,{direction:"horizontal",ref_key:"navbar",ref:t},{default:k(()=>[(g(!0),w(Z,null,he(h(n),(y,E)=>(g(),j(m,dt({key:E},y),{default:k(()=>[_(p,{direction:"y",max:700,min:150,value:250},{default:k(()=>[A("div",l1,[A("label",null,B(y.title),1),A("div",c1,[_(u,{icon:"minimize",size:"14px",title:h(c)("message.hide"),onClick:l[0]||(l[0]=C=>t.value.select(-1))},null,8,["title"]),y.allowClose?(g(),j(u,{key:0,icon:"close",title:h(c)("editor.tab.close"),onClick:C=>o(y)},null,8,["title","onClick"])):X("",!0)])]),(g(),j(te(y.component),ns(as(y.data)),null,16))]),_:2},1024)]),_:2},1040))),128))]),_:1},512)])}}};var p1=q(u1,[["__scopeId","data-v-200d8d00"]]),d1=Object.freeze(Object.defineProperty({__proto__:null,default:p1},Symbol.toStringTag,{value:"Module"}));const _1={class:"magic-function-info"},h1={setup(e){const t=se("info"),n=[{title:c("fn.parameter"),component:te("magic-function-parameter")},{title:c("fn.description"),component:te("magic-api-description")}];return(a,s)=>{const i=b("magic-select"),o=b("magic-input"),r=b("magic-navbar-item"),l=b("magic-navbar");return g(),w(Z,null,[A("div",_1,[A("form",null,[A("label",null,B(h(c)("fn.returnValue")),1),_(i,{width:"100px",options:a.$FUNCTION_RETURN_TYPES,"default-select":a.$DEFAULT_FUNCTION_RETURN_TYPE,value:h(t).method,"onUpdate:value":s[0]||(s[0]=u=>h(t).method=u)},null,8,["options","default-select","value"]),A("label",null,B(h(c)("fn.form.name")),1),_(o,{value:h(t).name,"onUpdate:value":s[1]||(s[1]=u=>h(t).name=u),placeholder:h(c)("fn.form.placeholder.name"),width:"200px"},null,8,["value","placeholder"]),A("label",null,B(h(c)("fn.form.path")),1),_(o,{value:h(t).path,"onUpdate:value":s[2]||(s[2]=u=>h(t).path=u),placeholder:h(c)("fn.form.placeholder.path"),width:"auto",style:{flex:"1"}},null,8,["value","placeholder"])])]),_(l,{direction:"horizontal",ref:"navbar",style:{flex:"1"},"allow-close":!1},{default:k(()=>[(g(),w(Z,null,he(n,(u,p)=>_(r,{key:p,title:u.title},{default:k(()=>[(g(),j(te(u.component),{info:h(t)},null,8,["info"]))]),_:2},1032,["title"])),64))]),_:1},512)],64)}}};var f1=q(h1,[["__scopeId","data-v-bc8654ec"]]),m1=Object.freeze(Object.defineProperty({__proto__:null,default:f1},Symbol.toStringTag,{value:"Module"}));const g1={class:"magic-panel-function"},v1={setup(e){const t=se("info"),n=U(-1);return(a,s)=>{const i=b("magic-panel-common-toolbar"),o=b("magic-input"),r=b("magic-table-column"),l=b("magic-select"),u=b("magic-table");return g(),w("div",g1,[_(i,{index:n.value,"onUpdate:index":s[0]||(s[0]=p=>n.value=p),value:h(t).parameters},null,8,["index","value"]),_(u,{data:h(t).parameters,border:"",onClickRow:s[1]||(s[1]=p=>n.value=p)},{default:k(()=>[_(r,{title:h(c)("message.name"),width:"20%"},{default:k(({row:p})=>[_(o,{value:p.name,"onUpdate:value":m=>p.name=m,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"]),_(r,{title:h(c)("message.parameterType"),width:"20%"},{default:k(({row:p})=>[_(l,{options:a.$FUNCTION_RETURN_TYPES,value:p.type,"onUpdate:value":m=>p.type=m,"default-select":a.$DEFAULT_FUNCTION_RETURN_TYPE,border:!1},null,8,["options","value","onUpdate:value","default-select"])]),_:1},8,["title"]),_(r,{title:h(c)("message.description"),flex:"1"},{default:k(({row:p})=>[_(o,{value:p.description,"onUpdate:value":m=>p.description=m,border:!1},null,8,["value","onUpdate:value"])]),_:1},8,["title"])]),_:1},8,["data"])])}}};var E1=Object.freeze(Object.defineProperty({__proto__:null,default:v1},Symbol.toStringTag,{value:"Module"}));const b1={setup(e){const t=U(!1),n=U([]);S.$on(F.DO_DOWNLOAD,()=>t.value=!0);const a=()=>{n.value.length?z.sendJson("/download",n.value,{method:"post",headers:{"Content-Type":"application/json"},transformRequest:[],responseType:"blob"}).success(s=>{Hn(s,"magic-api.zip"),S.status("message.exported"),t.value=!1}):ve.alert(c("message.exportNoneSelect"))};return(s,i)=>{const o=b("magic-resource-choose"),r=b("magic-button"),l=b("magic-button-group"),u=b("magic-dialog");return g(),j(u,{title:h(c)("message.export"),value:t.value,"onUpdate:value":i[5]||(i[5]=p=>t.value=p),shade:!1,padding:"0",width:"480px",top:"60px",overflow:"hidden"},{default:k(()=>[_(o,{ref:"resource",value:n.value,"onUpdate:value":i[0]||(i[0]=p=>n.value=p)},null,8,["value"]),_(l,{align:"right",style:{margin:"5px 0","margin-right":"5px"}},{default:k(()=>[_(r,{value:h(c)("message.expand"),onOnClick:i[1]||(i[1]=p=>s.$refs.resource.expand(!0))},null,8,["value"]),_(r,{value:h(c)("message.collapse"),onOnClick:i[2]||(i[2]=p=>s.$refs.resource.expand(!1))},null,8,["value"]),_(r,{value:h(c)("message.selectAll"),onOnClick:i[3]||(i[3]=p=>s.$refs.resource.selectAll(!0))},null,8,["value"]),_(r,{value:h(c)("message.deselectAll"),onOnClick:i[4]||(i[4]=p=>s.$refs.resource.selectAll(!1))},null,8,["value"]),_(r,{type:"active",value:h(c)("message.export"),onOnClick:a},null,8,["value"])]),_:1})]),_:1},8,["title","value"])}}};var y1=q(b1,[["__scopeId","data-v-097eba83"]]),T1=Object.freeze(Object.defineProperty({__proto__:null,default:y1},Symbol.toStringTag,{value:"Module"}));const S1="modulepreload",da={},O1="./",_a=function(t,n){return!n||n.length===0?t():Promise.all(n.map(a=>{if(a=`${O1}${a}`,a in da)return;da[a]=!0;const s=a.endsWith(".css"),i=s?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${i}`))return;const o=document.createElement("link");if(o.rel=s?"stylesheet":S1,s||(o.as="script",o.crossOrigin=""),o.href=a,document.head.appendChild(o),s)return new Promise((r,l)=>{o.addEventListener("load",r),o.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())};const x1={class:"magic-header"},R1={class:"magic-logo"},A1=["title"],I1=["title"],C1={class:"magic-header-title"},L1=["title","onClick"],N1={class:"magic-skin-selector"},w1=["onClick"],k1={class:"magic-locale-selector"},D1=["onClick"],M1={props:{title:{type:String,default:"magic-api"},themeStyle:Object,header:Object},setup(e){const t=e,n={"../../../scripts/i18n/en.js":()=>_a(()=>Promise.resolve().then(function(){return Ts}),void 0),"../../../scripts/i18n/zh-cn.js":()=>_a(()=>Promise.resolve().then(function(){return Ss}),void 0)},a=Je([]);for(let y in n)n[y]().then(E=>{a.push({id:y.replace(/(.*?i18n\/)(.*)(\.js)/g,"$2"),name:E.default.name})});const s=M.MAGIC_API_VERSION_TEXT,i=U(!1),o=U(!1),r=U({}),l=U("");S.$on(F.OPEN_EMPTY,()=>{l.value="",r.value={}}),S.$on(F.OPEN,y=>{r.value=y,l.value=y.path(),tt(y,()=>{r.value===y&&(l.value=y.path())})});const u=me(()=>[{name:`${c("message.run")}(Ctrl + Q)`,icon:"run",disabled:()=>r.value.runnable!==!0||r.value.running===!0,onClick:()=>S.$emit(F.DO_TEST)},{name:`${c("message.save")}(Ctrl + S)`,icon:"save",onClick:()=>S.$emit(F.DO_SAVE,!0)},{name:`${c("message.search")}(Ctrl + Shift + F)`,icon:"search",onClick:()=>S.$emit(F.DO_SEARCH)},{name:c("message.upload"),icon:"upload",onClick:()=>S.$emit(F.DO_UPLOAD)},{name:c("message.export"),icon:"download",onClick:()=>S.$emit(F.DO_DOWNLOAD)},{name:c("message.push"),icon:"push",onClick:()=>S.$emit(F.DO_PUSH)},{name:c("message.skin"),displayKey:"skin",icon:"skin",onClick:()=>{i.value=!i.value,o.value=!1}},{name:c("message.i18n"),icon:"i18n",onClick:()=>{o.value=!o.value,i.value=!1}},{name:c("message.reload"),icon:"refresh",onClick:()=>S.$emit(F.RELOAD_RESOURCES)}].filter(y=>t.header[y.displayKey]!==!1)),p=y=>{M.THEME=y,S.$emit(F.SWITCH_THEME,y),S.status("message.switchSkin",!0,y),Be.setTheme(y),Object.keys(t.themeStyle).forEach(C=>t.themeStyle[C]=void 0);let E=Kt[y];Fe.set(M.STORE.theme,y),Object.keys(E).forEach(C=>t.themeStyle[`--${C}`]=E[C]),i.value=!1},m=Fe.get(M.STORE.theme);Kt[m]?p(m):p(M.THEME);const f=({id:y,name:E})=>{o.value=!1,Fe.set("locale",y),ve.confirm(c("message.tips"),c("message.switchLocale",E),()=>{location.reload()})};return(y,E)=>{const C=b("magic-icon");return g(),w(Z,null,[A("div",x1,[A("div",R1,[A("label",{title:e.title},B(e.title),9,A1),A("label",{title:h(s)},B(h(s)),9,I1)]),A("div",C1,B(l.value),1),A("ul",null,[(g(!0),w(Z,null,he(h(u),(I,O)=>(g(),w("li",{key:O,title:I.name,onClick:Se(v=>I.disabled!==!0&&I.onClick(),["stop"]),class:Ee({disabled:I.disabled&&I.disabled()===!0})},[_(C,{icon:I.icon},null,8,["icon"])],10,L1))),128))])]),yt(A("div",N1,[A("ul",null,[(g(!0),w(Z,null,he(Object.keys(h(Kt)),I=>(g(),w("li",{key:"theme_"+I,onClick:O=>p(I)},B(I),9,w1))),128))])],512),[[$t,i.value]]),yt(A("div",k1,[A("ul",null,[(g(!0),w(Z,null,he(h(a),I=>(g(),w("li",{key:"locale_"+I.id,onClick:O=>f(I)},B(I.name),9,D1))),128))])],512),[[$t,o.value]])],64)}}};var P1=q(M1,[["__scopeId","data-v-4e11654b"]]),U1=Object.freeze(Object.defineProperty({__proto__:null,default:P1},Symbol.toStringTag,{value:"Module"}));const $1={class:"magic-push-form"},B1={setup(e){const t=U(!1),n=U([]),a=U("http://host:port/_magic-api-sync"),s=U("123456789");S.$on(F.DO_PUSH,()=>t.value=!0);const i=r=>{z.sendJson("/push",n.value,{method:"post",headers:{"magic-push-target":a.value,"magic-push-secret-key":s.value,"magic-push-mode":r,"Content-Type":"application/json"},transformRequest:[]}).success(()=>{const l=c(r==="full"?"push.full":"push.increment");S.status("push.success",!0,l),t.value=!1,S.$emit(F.LOAD_RESOURCES)})},o=r=>{n.value.length?r==="full"?ve.confirm(c("message.push"),c("message.pushWarning"),()=>i(r)):i(r):ve.alert(c("message.pushNoneSelect"))};return(r,l)=>{const u=b("magic-resource-choose"),p=b("magic-input"),m=b("magic-button"),f=b("magic-button-group"),y=b("magic-dialog");return g(),j(y,{title:h(c)("message.push"),value:t.value,"onUpdate:value":l[7]||(l[7]=E=>t.value=E),shade:!1,padding:"0",width:"450px",top:"60px",overflow:"hidden"},{default:k(()=>[_(u,{ref:"resource",value:n.value,"onUpdate:value":l[0]||(l[0]=E=>n.value=E)},null,8,["value"]),A("div",$1,[A("div",null,[A("label",null,B(h(c)("message.remote"))+"\uFF1A",1),_(p,{value:a.value,"onUpdate:value":l[1]||(l[1]=E=>a.value=E)},null,8,["value"])]),A("div",null,[A("label",null,B(h(c)("message.secret"))+"\uFF1A",1),_(p,{value:s.value,"onUpdate:value":l[2]||(l[2]=E=>s.value=E),type:"password"},null,8,["value"])])]),_(f,{align:"right",style:{margin:"5px 0","margin-right":"5px"}},{default:k(()=>[_(m,{value:h(c)("message.selectAll"),onOnClick:l[3]||(l[3]=E=>r.$refs.resource.selectAll(!0))},null,8,["value"]),_(m,{value:h(c)("message.deselectAll"),onOnClick:l[4]||(l[4]=E=>r.$refs.resource.selectAll(!1))},null,8,["value"]),_(m,{value:h(c)("push.increment"),onOnClick:l[5]||(l[5]=E=>o("increment")),type:"active"},null,8,["value"]),_(m,{value:h(c)("push.full"),onOnClick:l[6]||(l[6]=E=>o("full"))},null,8,["value"])]),_:1})]),_:1},8,["title","value"])}}};var F1=q(B1,[["__scopeId","data-v-e421c192"]]),H1=Object.freeze(Object.defineProperty({__proto__:null,default:F1},Symbol.toStringTag,{value:"Module"}));const j1={class:"magic-search-result"},V1=["onClick","onDblclick"],G1=["innerHTML"],z1={class:"name"},Y1=["textContent"],q1={class:"display-text"},K1={setup(e){const t=U(""),n=U(!1),a=se("findResource"),s=se("service"),i=U([]),o=U({}),r=me(()=>o.value.name+(o.value.path?`(${o.value.path})`:"")),l=I=>{I.script||z.sendGet(`/resource/file/${I.id}`).success(O=>{I.script=O.script})},u=(I,O)=>{o.value=I,l(I),O&&(S.$emit(F.OPEN_WITH_ID,I.id),n.value=!1,i.value=[],t.value="")};S.$on(F.DO_SEARCH,()=>{i.value=[],t.value="",n.value=!n.value});let p=null;const m=I=>{const O=[...I.childNodes],v=[];for(;O.length;){const T=O.shift();T.nodeType===T.TEXT_NODE?v.push(T):O.unshift(...T.childNodes)}return v},f=I=>{let O=0;return I.map(v=>{let T=O,R=O+v.wholeText.length;return O=R,{text:v.wholeText,startIdx:T,endIdx:R}})},y=(I,O)=>{const v=[..."[]()?.+*^${}:"].reduce((R,D)=>(R[D]=!0,R),{});O=O.split("").map(R=>v[R]?`\\${R}`:R).join("[\\s\\n]*");const T=new RegExp(O,"gmi");return[...I.matchAll(T)]},E=(I,O,v)=>{for(let T=v.length-1;T>=0;T--){const R=v[T],D=R.index,L=D+R[0].length;for(let N=0;N=L)break;let ie=I[N];const Q=Math.max(0,D-Y),ye=Math.min(re,L)-Y-Q;Q>0&&(ie=ie.splitText(Q)),ye{if(!O)return I;const v=document.createElement("div");v.innerHTML=I;const T=m(v),R=f(T),D=R.map(({text:N})=>N).join(""),L=y(D,O);return E(T,R,L),v.innerHTML};return tt(t,I=>{const O=I.trim();clearTimeout(p),O&&(p=setTimeout(()=>{z.send("/search",{keyword:O},{method:"POST"}).success(async v=>{const T=[];for(let R=0;R0&&(o.value=T[0],l(o.value)),i.value=T})},600))}),(I,O)=>{const v=b("magic-input"),T=b("magic-text-icon"),R=b("magic-monaco-editor"),D=b("magic-dialog");return g(),j(D,{title:h(c)("message.search"),value:n.value,"onUpdate:value":O[1]||(O[1]=L=>n.value=L),shade:!1,padding:"0",width:"700px",top:"60px"},{default:k(()=>[_(v,{value:t.value,"onUpdate:value":O[0]||(O[0]=L=>t.value=L),placeholder:h(c)("message.searchText")},null,8,["value","placeholder"]),i.value.length>0?(g(),w(Z,{key:0},[A("div",j1,[(g(!0),w(Z,null,he(i.value,(L,N)=>(g(),w("div",{key:N,class:Ee(["magic-search-result-item",{selected:o.value===L}]),onClick:$=>u(L),onDblclick:$=>u(L,!0)},[A("div",{class:"label",innerHTML:L.text},null,8,G1),A("div",z1,[_(T,{icon:L.icon},null,8,["icon"]),_e(B(L.name),1)]),A("div",{class:"line",textContent:B(L.line)},null,8,Y1)],42,V1))),128))]),A("div",q1,[_(T,{icon:o.value.icon},null,8,["icon"]),_e(B(h(r)),1)]),_(R,{readonly:"",value:o.value.script,language:o.value.language,style:{width:"100%",height:"300px"},matches:t.value},null,8,["value","language","matches"])],64)):X("",!0)]),_:1},8,["title","value"])}}};var W1=q(K1,[["__scopeId","data-v-4bbc2d10"]]),X1=Object.freeze(Object.defineProperty({__proto__:null,default:W1},Symbol.toStringTag,{value:"Module"}));const J1={setup(e){const t=U(!1),n=U(null),a=s=>{if(n.value){const i=new FormData;i.append("file",n.value,n.value.name),i.append("mode",s);const o=()=>{z.send("/upload",i,{method:"post",headers:{"Content-Type":"multipart/form-data"}}).success(r=>{const l=c(s==="full"?"upload.full":"upload.increment");r?(S.status("upload.success",!0,l),t.value=!1,S.$emit(F.LOAD_RESOURCES)):S.status("upload.failed",!1,l)})};s==="full"?ve.confirm(c("message.upload"),c("message.uploadWarning"),o):o()}};return S.$on(F.DO_UPLOAD,()=>t.value=!0),(s,i)=>{const o=b("magic-file"),r=b("magic-button"),l=b("magic-button-group"),u=b("magic-dialog");return g(),j(u,{title:h(c)("message.upload"),value:t.value,"onUpdate:value":i[3]||(i[3]=p=>t.value=p)},{default:k(()=>[_(o,{value:n.value,"onUpdate:value":i[0]||(i[0]=p=>n.value=p),accept:"application/x-zip-compressed"},null,8,["value"]),_(l,{align:"right",style:{"margin-top":"5px"}},{default:k(()=>[_(r,{value:h(c)("upload.increment"),type:"active",onClick:i[1]||(i[1]=p=>a("increment"))},null,8,["value"]),_(r,{value:h(c)("upload.full"),onClick:i[2]||(i[2]=p=>a("full"))},null,8,["value"])]),_:1})]),_:1},8,["title","value"])}}};var Q1=Object.freeze(Object.defineProperty({__proto__:null,default:J1},Symbol.toStringTag,{value:"Module"}));const Z1={class:"magic-data-resource"},ep={class:"magic-data-resource-header"},tp=["title","onClick"],np={key:1},ap=["onContextmenu"],sp={props:{type:String,title:String,data:Array},setup(e){const t=e,n=te(`magic-datasource-${t.type}`),a=U(!1),s=U(""),i=U({}),o=U(""),r=U(""),l=U(!0),u=me(()=>t.data&&t.data.length>0&&t.data[0].children&&t.data[0].children.filter(T=>T.name.indexOf(o.value)>-1||T.key.indexOf(o.value)>-1)||[]),p=se("service")[t.type],m=[{name:c("message.createDataSource",t.title),icon:"plus",onClick:()=>{s.value=c("message.createDataSource",t.title),r.value=c("message.create"),i.value={},a.value=!0,l.value=!1}}],f=()=>{p.doTest(i.value)},{proxy:y}=St(),E=(T,R,D)=>{T.groupId=`${t.type}:0`,z.sendJson(`/resource/file/${t.type}/save`,T).success(L=>{if(L){T.id!==L&&S.loading(3),T.id=L,S.status(R+"Success",!0,D),t.data[0].children=t.data[0].children||[];const N=t.data[0].children.find($=>$.id===T.id);N?Object.keys(T).forEach($=>N[$]=T[$]):t.data[0].children.push(T),a.value=!1}else S.status(R+"Failed",!1,D),y.$alert(c(R+"Failed",D))})},C=()=>{const T=pe({},i.value);E(T,"message.save",`${t.title}\u300C${I(T)}\u300D`)},I=T=>`${T.name}(${T.key})`,O=T=>{const R=t.data[0].children.findIndex(D=>D===T);R>-1&&t.data[0].children.splice(R,1)},v=(T,R)=>{const D=[];T.id&&([{label:c("message.update"),icon:"update",divided:!0,onClick:()=>{l.value=!0,s.value=c("message.updateTips",t.title),r.value=c("message.update"),a.value=!0,S.status("message.getDetail",`${t.title}\u300C${I(T)}\u300D`),z.sendGet(`/resource/file/${T.id}`).success(L=>i.value=L).end(()=>{l.value=!1})}},{label:c("resource.contextmenu.delete"),icon:"delete",onClick:()=>{const L=`${t.title}\u300C${I(T)}\u300D`;y.$confirm(c("message.deleteTips",t.title),c("message.deleteConfirm",L),()=>{z.send("/resource/delete",{id:T.id}).success(N=>{S.status(N?"message.deleteSuccess":"message.deleteFailed",N,L),N?O(T):y.$alert(N?"message.deleteSuccess":"message.deleteFailed",L)})})}},{label:c("message.copy"),icon:"copy",divided:!0,onClick:()=>{z.send(`/resource/file/${T.id}`).success(L=>{L.id=void 0,L.name=L.name+`(${c("message.copy")})`,L.key=L.key+"_copy",E(L,"datasource.copy",`${t.title}\u300C${I(L)}\u300D`)})}}].forEach(L=>D.push(L)),T.lock===M.LOCKED?D.push({label:c("resource.contextmenu.unlock"),icon:"unlock",onClick:()=>z.sendPost("/resource/unlock",{id:T.id}).success(L=>{S.status(L?"message.unlockSuccess":"message.unlockFailed",L,`${t.title}\u300C${I(T)}\u300D`),L&&(T.lock=M.UNLOCK)})}):D.push({label:c("resource.contextmenu.lock"),icon:"lock",onClick:()=>z.sendPost("/resource/lock",{id:T.id}).success(L=>{S.status(L?"message.lockSuccess":"message.lockFailed",L,`${t.title}\u300C${I(T)}\u300D`),L&&(T.lock=M.LOCKED)})})),M.PLUGINS.forEach(L=>{if(L.contextmenu&&typeof L.contextmenu=="function"){const N=L.contextmenu(Ue(pe({},T),{menuType:"datasource"}));N&&N.length&&N.forEach($=>D.push($))}}),D.length&&y.$contextmenu({menus:D,event:R})};return(T,R)=>{const D=b("magic-icon"),L=b("magic-input"),N=b("magic-empty"),$=b("magic-button"),Y=b("magic-button-group"),re=b("magic-loading"),ie=b("magic-dialog");return g(),w(Z,null,[A("div",Z1,[A("div",ep,[A("ul",null,[(g(),w(Z,null,he(m,(Q,ye)=>(g(),w(Z,{key:ye},[!Q.show||Q.show()?(g(),w("li",{key:0,title:Q.name||"",onClick:Te=>Q.onClick&&Q.onClick(),class:Ee({separator:Q.separator})},[Q.separator?X("",!0):(g(),j(D,{key:0,icon:Q.icon},null,8,["icon"]))],10,tp)):X("",!0)],64))),64))]),_(L,{value:o.value,"onUpdate:value":R[0]||(R[0]=Q=>o.value=Q),placeholder:h(c)("message.searchText"),width:"100%"},null,8,["value","placeholder"]),_(D,{icon:"search",size:"14px"})]),h(u).length===0?(g(),j(N,{key:0,text:h(c)("message.empty",e.title)},null,8,["text"])):(g(),w("ul",np,[(g(!0),w(Z,null,he(h(u),(Q,ye)=>(g(),w("li",{key:ye,onContextmenu:Se(Te=>v(Q,Te),["prevent"])},[_(D,{icon:"datasource"}),A("label",null,B(Q.name||h(c)("datasource.primary")),1),A("span",null,"("+B(Q.key||"default")+")",1),Q.lock==="1"?(g(),j(D,{key:0,icon:"lock"})):X("",!0)],40,ap))),128))]))]),_(ie,{value:a.value,"onUpdate:value":R[4]||(R[4]=Q=>a.value=Q),title:s.value,width:"550px"},{default:k(()=>[_(re,{loading:l.value,style:{"min-height":"200px"}},{default:k(()=>[(g(),j(te(h(n)),{info:i.value},null,8,["info"])),_(Y,{align:"right",style:{padding:"5px 0"}},{default:k(()=>[_($,{value:r.value,type:"active",onOnClick:R[1]||(R[1]=Q=>C())},null,8,["value"]),_($,{value:h(c)("datasource.test"),onOnClick:R[2]||(R[2]=Q=>f())},null,8,["value"]),_($,{value:h(c)("message.cancel"),onOnClick:R[3]||(R[3]=Q=>a.value=!1)},null,8,["value"])]),_:1})]),_:1},8,["loading"])]),_:1},8,["value","title"])],64)}}};var ip=q(sp,[["__scopeId","data-v-2ca47240"]]),op=Object.freeze(Object.defineProperty({__proto__:null,default:ip},Symbol.toStringTag,{value:"Module"}));const Ha=e=>(Dn("data-v-2efca342"),e=e(),Mn(),e),rp={class:"magic-login"},lp={class:"magic-login-box"},cp=Ha(()=>A("div",{class:"magic-login-logo"},null,-1)),up={class:"magic-login-text"},pp=_e("Magic-API "),dp={key:0},_p={key:0,class:"magic-login-row error"},hp={class:"magic-login-row"},fp={class:"magic-login-row"},mp={class:"magic-login-row"},gp={class:"magic-login-copyright"},vp=Ha(()=>A("a",{href:"https://ssssssss.org.cn",target:"_blank"},"ssssssss.org.cn",-1)),Ep=_e(" All rights reserved."),bp={props:{value:Boolean,error:String},emits:["update:value","update:error"],setup(e,{emit:t}){const n=U(""),a=U(""),s=()=>{n.value&&a.value&&(t("update:error",null),z.sendPost("/login",{username:n.value,password:a.value}).success((i,o)=>{i&&(t("update:value",!1),M.HEADER_MAGIC_TOKEN_VALUE=o.headers[M.HEADER_MAGIC_TOKEN],Fe.set(M.STORE.token,M.HEADER_MAGIC_TOKEN_VALUE),S.$emit(F.LOGINED),n.value="",a.value="")}).exception((i,o)=>{i!=401&&(o=translateCode(i,o)),t("update:error",o)}).error((i,o,r)=>{if(r){let l="";r.response?l=JSON.stringify(r.response.data||"")||c("code.invalid",r.response.status):l=r.message,t("update:error",l)}}))};return(i,o)=>{const r=b("magic-icon"),l=b("magic-input"),u=b("magic-button");return g(),w("div",rp,[A("div",lp,[cp,A("div",up,[pp,h(M).MAGIC_API_VERSION_TEXT?(g(),w("span",dp,"v"+B(h(M).MAGIC_API_VERSION_TEXT),1)):X("",!0)]),e.error?(g(),w("div",_p,[_(r,{icon:"error"}),A("span",null,B(e.error),1)])):X("",!0),A("div",hp,[_(r,{icon:"user"}),_(l,{onEnter:s,value:n.value,"onUpdate:value":o[0]||(o[0]=p=>n.value=p),placeholder:h(c)("message.username")},null,8,["value","placeholder"])]),A("div",fp,[_(r,{icon:"password"}),_(l,{onEnter:s,value:a.value,"onUpdate:value":o[1]||(o[1]=p=>a.value=p),type:"password",placeholder:h(c)("message.password")},null,8,["value","placeholder"])]),A("div",mp,[_(u,{value:h(c)("message.login"),onOnClick:s},null,8,["value"])])]),A("div",gp,[_e("Copyright \xA9 2020-"+B(new Date().getYear()+1900)+" ",1),vp,Ep])])}}};var yp=q(bp,[["__scopeId","data-v-2efca342"]]),Tp=Object.freeze(Object.defineProperty({__proto__:null,default:yp},Symbol.toStringTag,{value:"Module"}));function Sp(e,t){S.$emit(F.SWITCH_TOOLBAR,"log"),t.headers[M.HEADER_REQUEST_CLIENT_ID]=M.CLIENT_ID,t.headers[M.HEADER_REQUEST_SCRIPT_ID]=e.item.id,t.headers[M.HEADER_MAGIC_TOKEN]=M.HEADER_MAGIC_TOKEN_VALUE,t.headers[M.HEADER_REQUEST_BREAKPOINTS]=(e.decorations||[]).filter(i=>i.options.linesDecorationsClassName==="breakpoints").map(i=>i.range.startLineNumber).join(","),t.responseType="blob",t.validateStatus=()=>!0;let n=0;t.transformResponse=[function(i,o){return n=i.size,o["content-disposition"]?new Promise(r=>r(i)):new Promise(r=>{const l=new FileReader;l.readAsText(i),l.onload=function(){try{JSON.parse(this.result),r(this.result)}catch{r(i)}}})}];const a=e.path();S.status("api.test.begin",!0,a);const s=new Date().getTime();z.execute(t).then(i=>i.data.then(o=>{if(S.status("api.test.success",!0,a,i.status,ii(n),new Date().getTime()-s),e.running=!1,e.responseBlob=o instanceof Blob)e.responseBlobValue=o,e.item.responseBody=null,e.item.responseBodyDefinition=null,e.responseBodyTree=null;else{e.item.responseBody=li(o);let r=Ua(e.item.responseBody,e.item.responseBodyDefinition);e.item.responseBodyDefinition=r,e.responseBodyTree=an(r)}e.responseHeaders=i.headers,be(()=>S.$emit(F.SWITCH_TOOLBAR,"response"))})).catch(i=>{S.status("api.test.requestError",!1,a),e.running=!1,z.processError(i)})}function Op(e){e.running=!0;const t=e.item,n={baseURL:M.SERVER_URL,url:e.requestPath(),method:t.method,headers:{},responseType:"json",withCredentials:!0},a=i=>i.filter(o=>o.value&&o.value.trim()).forEach(o=>n.url=n.url.replace(new RegExp(`\\{${o.name}}`,"g"),o.value.trim()));if(e.getGroups().filter(i=>i.paths&&i.paths.length>0).map(i=>i.paths).forEach(i=>a(i)),a(t.paths||[]),n.url.indexOf("{")>-1){ve.alert(c("api.test.missPath")),e.running=!1;return}M.GLOBAL.headers.filter(i=>i.name).forEach(i=>n.headers[i.name]=i.value),t.headers.filter(i=>i.name).forEach(i=>n.headers[i.name]=i.value);const s={};if(M.GLOBAL.parameters.filter(i=>i.name).forEach(i=>s[i.name]=i.value),t.parameters.filter(i=>i.name).forEach(i=>s[i.name]=i.value),Object.values(s).some(i=>i instanceof FileList||i instanceof File)){n.headers["Content-Type"]="multipart/form-data";const i=new FormData;Object.keys(s).forEach(o=>{let r=s[o];r instanceof FileList?Array.from(r).forEach(l=>i.append(o,l,l.name)):r instanceof File?i.append(o,r,r.name):i.append(o,r)}),n.data=i}else{n.headers["Content-Type"]="application/x-www-form-urlencoded",n.method!=="POST"||t.requestBody?n.params=s:n.data=s;try{if(t.requestBody){const i=JSON.parse(t.requestBody);(Array.isArray(i)&&i.length>0||typeof i=="object"&&Object.keys(i).length>0)&&(n.params=s,n.data=t.requestBody,n.headers["Content-Type"]="application/json",n.transformRequest=[])}}catch{e.running=!1,ve.alert(c("api.test.requestBodyError"))}}Sp(e,n)}var xp={doTest:Op,getIcon:e=>e.method||"GET",runnable:!0,requirePath:!0,name:c("api.name"),merge:e=>(e.method=e.method||M.DEFAULT_REQUEST_METHOD,e.parameters=e.parameters||[],e.headers=e.headers||[],e.paths=e.paths||[],e.options=e.options||[],e),processSave:e=>{const t=M.config.persistenceResponseBody!==!1;return{id:e.id,name:e.name,path:e.path,groupId:e.groupId,lock:e.lock,method:e.method,description:e.description,createBy:e.createBy,createDate:e.createDate,properties:e.properties,script:e.script,responseBody:t&&e.responseBody||void 0,responseBodyDefinition:t&&e.responseBodyDefinition||void 0,requestBody:e.requestBody,requestBodyDefinition:e.requestBodyDefinition,parameters:e.parameters.filter(n=>n.name),headers:e.headers.filter(n=>n.name),paths:e.paths.filter(n=>n.name),options:e.options.filter(n=>n.name)}}},Rp={getIcon:e=>"function",name:c("fn.name"),runnable:!1,requirePath:!0,merge:e=>(e.parameters=e.parameters||[],e)};let Nn;ne.setExtensionAttribute("org.ssssssss.magicapi.modules.db.SQLModule",()=>{var e;return Nn&&(((e=Nn("datasource")[0])==null?void 0:e.children)||[]).filter(t=>t.key).map(t=>({name:t.key,type:"org.ssssssss.magicapi.modules.db.SQLModule",comment:t.name}))||[]});var Ap={injectResources:e=>Nn=e,requireScript:!1,doTest:e=>{z.sendJson("/datasource/jdbc/test",e).success(t=>{t==="ok"?ve.alert(c("datasource.connected"),c("datasource.test")):ve.alert(c("datasource.connectFailed",t),c("datasource.test"))})}};const Ip={class:"magic-main"},Cp={class:"magic-main-body-wrapper"},Lp={class:"magic-main-body"},Np={ref:"mrl",class:"magic-navbar magic-navbar__vertical"},wp={ref:"mrr",class:"magic-navbar magic-navbar__vertical reverse"},kp={emits:["onLoad"],setup(e,{expose:t,emit:n}){const a=U(!1),s=U({}),i=U(!0),o=U(null),r=(v,T,R)=>{for(let D=0,L=v.length;D{const T=Object.entries(s.value);for(let R=0,D=T.length;R0)return{item:L[0],type:N[0],name:it("/"+L.reverse().map($=>$.name).join("/")),path:it("/"+L.reverse().map($=>$.path||"").join("/"))}}};Ke("findResource",l);const u=[{type:"api",title:c("api.name"),icon:"api"},{type:"function",title:c("fn.name"),icon:"function"}],p={api:xp,function:Rp,datasource:Ap};M.PLUGINS.filter(v=>v.resource&&v.resource.length>0).map(v=>v.resource).forEach(v=>v.forEach(T=>{u.push({type:T.type,icon:T.icon,title:c(T.title)}),T.service&&(p[T.type]=T.service)})),Ke("service",p),u.map(v=>v.type).forEach(v=>s.value[v]=[]);const m=[{type:"datasource",title:c("datasource.title"),icon:"datasource",name:c("datasource.name")}];M.PLUGINS.filter(v=>v.datasources&&v.datasources.length>0).map(v=>v.datasources).forEach(v=>v.forEach(T=>{m.push({type:T.type,icon:T.icon,title:T.title,name:T.name})})),m.map(v=>v.type).forEach(v=>s.value[v]=[]),Ke("resources",()=>{const v=[...u,...m],T=R=>R.length===1&&R[0].id.endsWith(":0")?R[0].children:R;return v.map(R=>({key:R.type,navbar:R,tree:T(JSON.parse(JSON.stringify(s.value[R.type]||[])))}))}),Object.values(p).forEach(v=>v.injectResources&&v.injectResources(T=>s.value[T])),be(()=>a.value=!0);const f=v=>Ue(pe({},v.node),{folder:v.node.parentId!==void 0,opened:v.node.parentId!==void 0&&M.DEFAULT_EXPAND===!0,children:v.children&&v.children.length?v.children.map(T=>f(T)):void 0}),y=(v,T)=>{var D;i.value=!0,s.value={};const R=v?((D=u.find(L=>L.type===v)||m.find(L=>L.type===v))==null?void 0:D.title)||"":c("message.all");S.status("message.getResource",!0,R),z.send("/resource").success(L=>{[...u,...m].filter(N=>!v||N.type===v).forEach(N=>{var $,Y;s.value[N.type]=((Y=($=L[N.type])==null?void 0:$.children)==null?void 0:Y.map(re=>f(re)))||[]}),i.value=!1,S.status("message.getResourceFinish",!0,R),be(()=>T())})};S.$on(F.RELOAD_RESOURCES,()=>{i.value=!0,z.sendGet("/reload").success(()=>{S.status("message.reloadResourceSuccess"),y(null,()=>S.$emit(F.RELOAD_RESOURCES_FINISH))}).end(()=>i.value=!1)});const E=v=>y(v,()=>S.$emit(F.LOAD_RESOURCES_FINISH,v));S.$on(F.LOAD_RESOURCES,E),S.$on(F.RELOAD_RESOURCES_FINISH,E);const C=v=>{let T;return Object.values(s.value).some(R=>{const D=[];if(r(R,v,D)){T=D[0];const L=u.findIndex(N=>N.type===D[D.length-1].type);return o.value&&o.value.select(L),!0}return!1}),T};S.$on(F.SELECT_NAVBAR_BY_ITEM,C),S.$on(F.OPEN_WITH_ID,v=>{const T=C(v);T&&S.$emit(F.OPEN_ITEM,T)}),S.$on(F.LOGOUT,()=>s.value={}),t({loadResources:E}),ht(()=>n("onLoad"));let I=0;const O=()=>{if(++I%u.length===0)try{JSON.parse(Fe.get(M.RECENT_OPENED_TAB)||"[]").forEach(v=>{S.$emit(F.OPEN_WITH_ID,v)})}catch(v){console.error(v)}};return S.$on(F.REFRESH_RESOURCE,v=>{const T=l(v);T&&z.sendGet(`/resource/file/${v}`).success(R=>{Object.keys(R).forEach(D=>T.item[D]=R[D])})}),(v,T)=>{const R=b("magic-resource"),D=b("magic-loading"),L=b("magic-resizer"),N=b("magic-navbar-item"),$=b("magic-navbar"),Y=b("magic-script-editor"),re=b("magic-toolbar"),ie=b("magic-data-resource"),Q=b("magic-search"),ye=b("magic-export"),Te=b("magic-upload"),Rt=b("magic-push"),At=b("magic-recent-opened");return g(),w("div",Ip,[a.value?(g(),j($,{key:0,direction:"vertical",to:v.$refs.mrl,ref_key:"mnl",ref:o,spliter:!0},{default:k(()=>[(g(),w(Z,null,he(u,(ke,Ne)=>_(N,dt({key:Ne},ke),{default:k(()=>[_(L,{max:750,min:270,direction:"x"},{default:k(()=>[_(D,{loading:i.value},{default:k(()=>[_(R,dt(ke,{data:s.value[ke.type],onClose:T[0]||(T[0]=Gn=>v.$refs.mnl.select(-1)),onOnLoad:O}),null,16,["data"])]),_:2},1032,["loading"])]),_:2},1024)]),_:2},1040)),64))]),_:1},8,["to"])):X("",!0),A("div",Cp,[A("div",Lp,[A("div",Np,null,512),_(Y),A("div",wp,null,512)]),_(re)]),_($,{reverse:!0,"default-select":-1,direction:"vertical",to:v.$refs.mrr,spliter:!0},{default:k(()=>[(g(),w(Z,null,he(m,(ke,Ne)=>_(N,{key:Ne,title:ke.title,icon:ke.icon},{default:k(()=>[a.value?(g(),j(L,{key:0,max:420,min:140,value:200,direction:"x",reverse:!0},{default:k(()=>[_(D,{loading:i.value},{default:k(()=>[_(ie,{type:ke.type,title:ke.name,data:s.value[ke.type]},null,8,["type","title","data"])]),_:2},1032,["loading"])]),_:2},1024)):X("",!0)]),_:2},1032,["title","icon"])),64))]),_:1},8,["to"]),_(Q),_(ye),_(Te),_(Rt),_(At)])}}};var Dp=q(kp,[["__scopeId","data-v-718a97af"]]),Mp=Object.freeze(Object.defineProperty({__proto__:null,default:Dp},Symbol.toStringTag,{value:"Module"}));const Pp={class:"magic-recent-opened"},Up=["onClick"],$p={key:1},Bp={key:0,style:{width:"100%",height:"100px"}},Fp={setup(e){const t=Je([]),n=U(!1),a=se("findResource"),s=se("service");try{JSON.parse(Fe.get(M.RECENT_OPENED)||"[]").forEach(r=>t.push(r))}catch{}const i=me(()=>t.map(r=>a(r)).filter(r=>r&&s[r.type])),o=r=>{S.$emit(F.OPEN_WITH_ID,r),n.value=!1};return S.$on(F.DO_RECENT,()=>n.value=!n.value),S.$on(F.CLOSE,r=>{if(r.id){const l=t.findIndex(u=>u===r.id);l>-1&&t.splice(l,1),t.unshift(r.id),t.length>20&&t.splice(t.length-1,1),Fe.set(M.RECENT_OPENED,je(t))}}),(r,l)=>{const u=b("magic-text-icon"),p=b("magic-empty"),m=b("magic-dialog");return g(),j(m,{value:n.value,"onUpdate:value":l[0]||(l[0]=f=>n.value=f),title:h(c)("editor.tooltip.recent"),padding:"0",shade:!1},{default:k(()=>[A("ul",Pp,[(g(!0),w(Z,null,he(h(i),(f,y)=>(g(),w("li",{key:y,onClick:Se(E=>o(f.item.id),["stop"])},[h(s)[f.type]&&h(s)[f.type].getIcon?(g(),j(u,{key:0,icon:h(s)[f.type].getIcon(f.item)},null,8,["icon"])):X("",!0),A("label",null,B(f.name),1),h(s)[f.type].requirePath&&f.path?(g(),w("span",$p,"("+B(f.path)+")",1)):X("",!0)],8,Up))),128))]),h(i).length===0?(g(),w("div",Bp,[_(p,{text:"empty."})])):X("",!0)]),_:1},8,["value","title"])}}};var Hp=q(Fp,[["__scopeId","data-v-44903aa6"]]),jp=Object.freeze(Object.defineProperty({__proto__:null,default:Hp},Symbol.toStringTag,{value:"Module"}));const Vp={class:"magic-resource-header"},Gp=["title","onClick"],zp={key:0},Yp={key:0},qp={class:"magic-create-group"},Kp={key:0},Wp={props:{type:String,title:String,data:Array},emits:["close","onLoad"],setup(e,{emit:t}){const n=e,a=te("magic-backup-file"),s=se("service")[n.type],i=s.requirePath,o=s.getIcon,r=U(""),l=U(!0),u=U(!1),p=U(""),m=U(null),f=se("activateUserFiles"),y=me(()=>l.value?c("resource.createGroup"):c("resource.updateGroup")),E=U(!0),C=U({}),I=U({}),O=U(!1),v=U({type:n.type}),T=me(()=>n.data),R=U([{name:c("resource.createGroup"),icon:"group-add",onClick:()=>{v.value={type:n.type,parentId:"0"},l.value=!0,O.value=!0}},{name:c("resource.header.expand"),icon:"expand-all",onClick:()=>et(T.value,P=>P.opened=!0)},{name:c("resource.header.collapse"),icon:"collapse-all",onClick:()=>et(T.value,P=>P.opened=!1)},{name:c("resource.header.desc"),icon:"descending",show:()=>E.value,onClick:()=>E.value=!1},{name:c("resource.header.asc"),icon:"ascending",show:()=>!E.value,onClick:()=>E.value=!0},{separator:!0},{name:c("resource.header.position"),icon:"position",onClick:()=>{I.value&&C.value&&(S.$emit(F.SELECT_NAVBAR_BY_ITEM,C.value),I.value.scrollIntoView(C.value))}},{name:c("message.hide"),icon:"minimize",onClick:()=>t("close")}]),D=(P,V,G,H,ue)=>{ue=ue||[],V=V||[];let Oe=V.find(at=>at===P||at.id===P);if(Oe)return G.push(Oe.name),ue.push(Oe),s.requirePath&&Oe.path&&H.push(Oe.path),Oe;for(let at=0,on=V.length;at{const G=[],H=[];D(je(P),je(T.value),G,H);const ue=H.length>0?it(`/${H.join("/")}`):"";return V?ue:`/${G.join("/")}${s.requirePath?`(${ue})`:""}`},N=P=>L(P),$=[],Y=(P,V)=>{if(P)if(P.folder)S.$emit(F.OPEN_GROUP,P);else{let G=$.find(H=>H.item==P);G||(G=Je({type:n.type,title:n.title,language:s.language||"magicscript",item:s.merge(P),path:()=>L(P),requestPath:()=>{const H=[];return D(je(P),je(T.value),[],H),it(`/${H.join("/")}`)},getGroups:()=>{const H=[];return D(je(P),je(T.value),[],[],H),H},getIcon:s.getIcon,runnable:s.runnable,doTest:s.doTest,processSave:s.processSave||(H=>H)}),$.push(G)),S.$emit(F.OPEN,G,V)}};S.$on(F.OPEN,P=>C.value=P.item),S.$on(F.OPEN_EMPTY,()=>C.value=null);const{proxy:re}=St(),ie=()=>{const P=pe({},v.value);delete P.children,delete P.opened,delete P.folder,z.sendJson("/resource/folder/save",P).success(V=>{if(V){const G=Ue(pe({},je(v.value)),{folder:!0,id:V});G.options=G.options||[],G.paths=G.paths||[],Te(G),S.status("resource.saveGroupSuccess",!0,n.title,L(V)),O.value=!1,S.loading(2)}else{const G=L(v.value);S.status("resource.saveGroupFailed",!1,n.title,G),re.$alert(c("resource.saveGroupFailed",n.title,G))}})},Q=(P,V)=>new Promise(G=>z.send("/resource/move",{src:P.id,groupId:V.groupId||V.id}).success(H=>{const ue=P.folder?"resource.moveGroup":"resource.moveResource",Oe=L(P);H?(P.folder?S.status(ue+"Success",!0,n.title,Oe):S.status(ue+"Success",!0,Oe),P[P.folder?"parentId":"groupId"]=V.groupId||V.id):P.folder?(S.status(ue+"Failed",!1,n.title,Oe),re.$alert(c(ue+"Failed",n.title,Oe))):(S.status(ue+"Failed",!1,Oe),re.$alert(c(ue+"Failed",Oe))),G(H)})),ye=(P,V)=>{V=V||T.value;const G=V.findIndex(H=>H===P||H.id===P.id);G>-1?V.splice(G,1):V.forEach(H=>ye(P,H.children||[]))},Te=(P,V)=>{V=V||T.value||[];const G=V.find(H=>H.id===P.id||P.groupId===H.id);if(G)return G.children=G.children||[],G.opened=!0,G.id===P.id?(G.name=P.name,G.path=P.path,G.parentId=P.parentId):G.children.push(P),!0;if(P.parentId==="0")return V.push(P),!0;{if(V.some(ue=>Te(P,ue.children||[])))return!0;const H=P.parentId!==void 0&&V.find(ue=>ue.id===P.parentId);if(H)return H.children=H.children||[],H.children.push(P),!0}return!1};S.$on(F.OPEN_ITEM,P=>{const V=je(T.value);V&&Y(D(je(P),V,[],[]),!0)});const Rt=(P,V)=>{if(P&&V){const G=[];P.folder?(G.push.apply(G,[{label:c("resource.contextmenu.newFile",n.title),icon:"plus",onClick(){const H={groupId:P.id,name:c("message.untitled"),script:s.defaultScript||"return 'Hello magic-api'",path:s.requirePath?"":void 0};Te(H),Y(H,!0)}},{label:c("resource.createGroup"),icon:"group-add",onClick(){l.value=!0,v.value={parentId:P.id,type:n.type},O.value=!0}},{label:c("resource.updateGroup"),icon:"update",onClick(){l.value=!1,v.value=pe({},P),O.value=!0}},{label:c("resource.copyGroup"),icon:"copy",onClick(){p.value=P.id,u.value=!0}},{label:c("resource.contextmenu.deleteGroup"),icon:"delete",onClick(){re.$confirm(c("resource.contextmenu.deleteGroup"),c("resource.deleteGroupConfirm",n.title,L(P)),()=>{P.id?z.send("/resource/delete",{id:P.id}).success(H=>{H?(S.status("resource.deleteGroupSuccess",!0,n.title,L(P)),ye(P)):(re.$alert("resource.deleteGroupFailed",n.title,L(P)),S.status("resource.deleteGroupFailed",!1,n.title,L(P)))}):ye(P)})}},{label:c("resource.contextmenu.exportGroup"),icon:"download",onClick(){z.send(`/download?groupId=${P.id}`,null,{headers:{"Content-Type":"application/json"},responseType:"blob"}).success(H=>{Hn(H,`${P.name}.zip`),S.status("resource.groupExport",!0,P.name,n.title)})}}]),P.parentId!=="0"&&G.push({label:c("resource.contextmenu.moveToRoot"),icon:"move",onClick(){re.$confirm(c("resource.moveGroup"),c("resource.moveRootGroupConfirm",L(P)),()=>{z.send("/resource/move",{src:P.id,groupId:"0"}).success(H=>{H?(S.status("resource.moveRootSuccess",!0,n.title,L(P)),P.parentId="0",ye(P),Te(P)):(re.$alert(c("resource.moveRootFailed",n.title,L(P))),S.status("resource.moveRootFailed",!1,n.title,L(P)))})})}})):(G.push.apply(G,[{label:c("resource.contextmenu.copy",n.title),icon:"copy",divided:!0,onClick:()=>{z.send(`/resource/file/${P.id}`).success(H=>{H.id=`copy${new Date().getTime()}d${parseInt(Math.random()*1e5)}`,Te(H),Y(H,!0),H.name=H.name+`(${c("message.copy")})`,s.requirePath&&(H.path=H.path+"_copy")})}}]),s.requirePath&&(n.type==="api"&&G.push({label:c("resource.contextmenu.copyWithPath"),icon:"copy",onClick:()=>{let H=L(P,!0);H&&(H=it(M.SERVER_URL+"/"+H),Zn(H)?S.status("resource.copyPathSuccess",!0,n.title,H):S.status("resource.copyPathFailed",!1,n.title,H))}}),G.push.apply(G,[{label:c("resource.contextmenu.copyRelativePath"),icon:"copy",divided:!0,onClick:()=>{const H=L(P,!0);H&&(Zn(H)?S.status("resource.copyRelativePathSuccess",!0,n.title,H):S.status("resource.copyRelativePathFailed",!1,n.title,H))}}]),P.lock===M.LOCKED?G.push({label:c("resource.contextmenu.unlock"),icon:"unlock",onClick:()=>z.sendPost("/resource/unlock",{id:P.id}).success(H=>{S.status(H?"message.unlockSuccess":"message.unlockFailed",H,L(P)),H&&(P.lock=M.UNLOCK)})}):G.push({label:c("resource.contextmenu.lock"),icon:"lock",onClick:()=>z.sendPost("/resource/lock",{id:P.id}).success(H=>{S.status(H?"message.lockSuccess":"message.lockFailed",H,L(P)),H&&(P.lock=M.LOCKED)})})),P.id&&G.push({label:c("toolbars.history"),icon:"history",onClick:()=>{S.$emit(F.ADD_FOOTER_TOOLBAR,{component:$e(a),id:"backup-file",icon:"history",title:c("toolbars.viewHistory",L(P)),allowClose:!0,data:{id:P.id}})}}),G.push.apply(G,[{label:c("message.refresh"),icon:"refresh",onClick:()=>{S.$emit(F.REFRESH_RESOURCE,P.id)}},{label:c("resource.contextmenu.delete"),icon:"delete",onClick:()=>{const H=`${n.title}\u300C${L(P)}\u300D`;re.$confirm(c("message.deleteTips",n.title),c("message.deleteConfirm",H),()=>{P.id?z.send("/resource/delete",{id:P.id}).success(ue=>{ue?(S.status("message.deleteSuccess",!0,H),ye(P),S.$emit(F.DELETE_FILE,P)):(S.status("message.deleteFailed",!1,H),re.$alert(c("message.deleteFailed",H)))}):(S.status("message.deleteSuccess",!0,H),ye(P),S.$emit(F.DELETE_FILE,P))})}}])),M.PLUGINS.forEach(H=>{if(H.contextmenu&&typeof H.contextmenu=="function"){const ue=H.contextmenu(Ue(pe({},P),{menuType:"resource"}));ue&&ue.length&&ue.forEach(Oe=>G.push(Oe))}}),re.$contextmenu({menus:G,event:V})}},At=P=>{re.$contextmenu({event:P,menus:R.value.slice(0,5).filter(V=>!V.show||V.show()).map(V=>({icon:V.icon,label:V.name,onClick:V.onClick}))})};let ke=null;const Ne=()=>{m.value&&z.sendPost("/resource/folder/copy",{src:p.value,target:m.value.id.endsWith("-root")?"0":m.value.id}).success(P=>{ke=P,u.value=!1,S.$emit(F.LOAD_RESOURCES)})},Gn=se("findResource");return S.$on(F.LOAD_RESOURCES_FINISH,()=>{ke&&be(()=>{const P=Gn(ke);S.$emit(F.SELECT_NAVBAR_BY_ITEM,P.item),S.$emit(F.OPEN_GROUP,P.item)})}),ht(()=>t("onLoad")),(P,V)=>{const G=b("magic-icon"),H=b("magic-input"),ue=b("magic-empty"),Oe=b("magic-text-icon"),at=b("magic-avatar-group"),on=b("magic-tree"),Pe=b("magic-button"),zn=b("magic-button-group"),Yn=b("magic-dialog"),Ga=b("magic-resource-choose");return g(),w("div",{class:"magic-resource",onContextmenu:V[10]||(V[10]=Se(ee=>At(ee),["prevent"]))},[A("div",Vp,[_(G,{icon:"search",size:"14px"}),_(H,{value:r.value,"onUpdate:value":V[0]||(V[0]=ee=>r.value=ee),placeholder:h(c)("message.searchText"),width:"100%"},null,8,["value","placeholder"]),A("ul",null,[(g(!0),w(Z,null,he(R.value,(ee,qn)=>(g(),w(Z,{key:qn},[!ee.show||ee.show()?(g(),w("li",{key:0,title:ee.name||"",onClick:Ed=>ee.onClick&&ee.onClick(),class:Ee({separator:ee.separator})},[ee.separator?X("",!0):(g(),j(G,{key:0,icon:ee.icon},null,8,["icon"]))],10,Gp)):X("",!0)],64))),128))])]),!e.data||e.data.length===0?(g(),j(ue,{key:0,text:h(c)("message.empty",e.title)},null,8,["text"])):(g(),j(on,{key:1,ref_key:"treeObj",ref:I,data:h(T),onItemClick:Y,onContextmenu:Rt,draggable:!0,sort:!0,descending:E.value,onMove:Q,filter:r.value,"filter-text":N,selected:C.value},{folder:k(({item:ee})=>[_(G,{icon:ee.opened?"arrow-bottom":"arrow-right",onClick:Se(qn=>ee.opened=!ee.opened,["stop"])},null,8,["icon","onClick"]),_(G,{icon:"list"}),A("label",null,B(ee.name),1),h(i)&&ee.path?(g(),w("span",zp,"("+B(ee.path)+")",1)):X("",!0)]),file:k(({item:ee})=>[_(Oe,{icon:h(o)(ee)},null,8,["icon"]),A("label",null,B(ee.name),1),h(i)&&ee.path?(g(),w("span",Yp,"("+B(ee.path)+")",1)):X("",!0),ee.lock==="1"?(g(),j(G,{key:1,icon:"lock"})):X("",!0),_(at,{users:h(f)[ee.id]||[],max:3,size:20},null,8,["users"])]),_:1},8,["data","descending","filter","selected"])),_(Yn,{title:h(y),value:O.value,"onUpdate:value":V[5]||(V[5]=ee=>O.value=ee),width:"350px"},{default:k(()=>[A("ul",qp,[A("li",null,[A("label",null,B(h(c)("resource.form.groupName"))+"\uFF1A",1),_(H,{value:v.value.name,"onUpdate:value":V[1]||(V[1]=ee=>v.value.name=ee),placeholder:h(c)("resource.form.placeholder.name",e.title)},null,8,["value","placeholder"])]),h(i)?(g(),w("li",Kp,[A("label",null,B(h(c)("resource.form.groupPath"))+"\uFF1A",1),_(H,{value:v.value.path,"onUpdate:value":V[2]||(V[2]=ee=>v.value.path=ee),placeholder:h(c)("resource.form.placeholder.path",e.title)},null,8,["value","placeholder"])])):X("",!0)]),_(zn,{align:"right",style:{padding:"5px 0"}},{default:k(()=>[_(Pe,{value:h(y),type:"active",onOnClick:V[3]||(V[3]=ee=>ie())},null,8,["value"]),_(Pe,{value:h(c)("message.cancel"),onOnClick:V[4]||(V[4]=ee=>O.value=!1)},null,8,["value"])]),_:1})]),_:1},8,["title","value"]),_(Yn,{value:u.value,"onUpdate:value":V[9]||(V[9]=ee=>u.value=ee),title:h(c)("resource.copyGroup"),shade:!1,padding:"0",width:"400px",overflow:"hidden"},{default:k(()=>[_(Ga,{ref:"chooseGroup",value:m.value,"onUpdate:value":V[6]||(V[6]=ee=>m.value=ee),file:!1,type:e.type,single:!0},null,8,["value","type"]),_(zn,{align:"right",style:{"margin-right":"5px","margin-bottom":"5px"}},{default:k(()=>[_(Pe,{value:h(c)("message.expand"),onOnClick:V[7]||(V[7]=ee=>P.$refs.chooseGroup.expand(!0))},null,8,["value"]),_(Pe,{value:h(c)("message.collapse"),onOnClick:V[8]||(V[8]=ee=>P.$refs.chooseGroup.expand(!1))},null,8,["value"]),_(Pe,{type:"active",value:h(c)("message.copy"),onOnClick:Ne},null,8,["value"])]),_:1})]),_:1},8,["value","title"])],32)}}};var Xp=q(Wp,[["__scopeId","data-v-d5dc3e2e"]]),Jp=Object.freeze(Object.defineProperty({__proto__:null,default:Xp},Symbol.toStringTag,{value:"Module"}));const He=e=>(Dn("data-v-1401171b"),e=e(),Mn(),e),Qp={class:"magic-script-editor"},Zp={key:0,class:"magic-empty-container"},ed={class:"magic-hot-key"},td=He(()=>A("em",null,"Ctrl + S",-1)),nd=He(()=>A("br",null,null,-1)),ad=He(()=>A("em",null,"Ctrl + Q",-1)),sd=He(()=>A("br",null,null,-1)),id=He(()=>A("em",null,"Alt + /",-1)),od=He(()=>A("br",null,null,-1)),rd=He(()=>A("em",null,"F8",-1)),ld=He(()=>A("br",null,null,-1)),cd=He(()=>A("em",null,"F6",-1)),ud=He(()=>A("br",null,null,-1)),pd=He(()=>A("em",null,"Ctrl + Alt + L",-1)),dd=He(()=>A("br",null,null,-1)),_d=He(()=>A("em",null,"Ctrl + E",-1)),hd={key:0},fd={class:"magic-monaco-editor-wrapper"},md={emits:["onLoad"],setup(e,{emit:t}){const{proxy:n}=St(),a=Je([]),s=U({}),i=U(!0),o=U(null),r=U(null),l=se("activateUserFiles"),u={String:"java.lang.String",Integer:"java.lang.Integer",Double:"java.lang.Double",Long:"java.lang.Long",Byte:"java.lang.Byte",Short:"java.lang.Short",Float:"java.lang.Float",MultipartFile:"org.springframework.web.multipart.MultipartFile",MultipartFiles:"java.util.List"};sn.setEnvironment(()=>{var R;const O={},v=(R=s.value)==null?void 0:R.item,T=D=>D&&Array.isArray(D)&&D.forEach(L=>{L&&typeof L.name=="string"&&L.dataType&&(O[L.name]=u[L.dataType]||"java.lang.Object")});return v&&(T(v==null?void 0:v.parameters),T(v==null?void 0:v.paths)),O});const p=O=>{let v=a.findIndex(T=>T===O);if(a.splice(v,1),O===s.value){let T=a.length;v0&&S.$emit(F.OPEN,a[v-1])}S.$emit(F.CLOSE,O.item),a.length===0&&(S.$emit(F.OPEN_EMPTY),s.value={})};tt(a,O=>{Fe.set(M.RECENT_OPENED_TAB,O.filter(v=>{var T;return(T=v.item)==null?void 0:T.id}).map(v=>v.item.id))});const m=O=>{const v=s.value;if(v&&v.item){const T=s.value.processSave(v.item);return Object.keys(T).forEach(R=>v.item[R]=T[R]),z.sendJson(`/resource/file/${s.value.type}/save?auto=${O?0:1}`,T).success(R=>{const D=`${v.title}\u300C${v.path()}\u300D`;R?(S.status("message.saveSuccess",!0,D),v.tmpObject=JSON.parse(JSON.stringify(T)),v.item.id!==R&&S.loading(1),v.item.id=R):(S.status("message.saveFailed",!1,D),n.$alert(c("message.saveFailed",D)))})}},f=()=>s.value.doTest(s.value),y=O=>{if(s.value.debuging){o.value.removedDecorations(s.value.debugDecorations),s.value.debuging=!1,s.value.variables=null;const v=(s.value.decorations||[]).filter(T=>T.options.linesDecorationsClassName==="breakpoints").map(T=>T.range.startLineNumber).join("|");S.send(Re.RESUME_BREAKPOINT,[s.value.item.id,O===!0?"1":"0",v].join(","))}},E=(O,v,T)=>{const R=[{label:c("editor.tab.close"),divided:!0,onClick(){p(v)}},{label:c("editor.tab.closeOther"),divided:!0,onClick(){[...a].forEach((D,L)=>L!=T&&p(D))}},{label:c("editor.tab.closeLeft"),onClick(){[...a].forEach((D,L)=>LL>T&&p(D))}},{label:c("editor.tab.closeAll"),onClick(){[...a].forEach(D=>p(D))}}];M.PLUGINS.forEach(D=>{if(D.contextmenu&&typeof D.contextmenu=="function"){const L=D.contextmenu(Ue(pe({},v),{menuType:"editorTab"}));L&&L.length&&L.forEach(N=>R.push(N))}}),n.$contextmenu({menus:R,event:O})},C=O=>Object.keys(O.tmpObject||{}).some(v=>{const T=O.tmpObject[v],R=O.item[v];return T===R||v==="properties"||v==="responseBody"||v==="responseBodyDefinition"?!1:typeof T=="object"||typeof R=="object"?JSON.stringify(T)!==JSON.stringify(R):T!==R});S.$on(F.LOGOUT,()=>[...a].forEach(O=>p(O))),S.$on(F.DELETE_FILE,O=>{const v=a.findIndex(T=>T.item===O);v>-1&&p(a[v])}),S.$on(F.RELOAD_RESOURCES_FINISH,()=>[...a].forEach(O=>p(O))),S.$event(Re.LOGIN_RESPONSE,()=>{var O;s.value&&S.send(Re.SET_FILE_ID,((O=s.value.item)==null?void 0:O.id)||"0")});const I=O=>{O&&o.value&&(O.scrollTop=o.value.getScrollTop())};return S.$on(F.OPEN,O=>{let v=a.find(T=>T.item===O.item||T.item.id&&T.item.id===O.item.id);S.send(Re.SET_FILE_ID,O.item.id||"0"),v?(s.value=v,i.value=!1,be(()=>o.value.setScrollTop(v.scrollTop||0))):(a.push(O),s.value=O,O.item.id&&!O.item.script?(i.value=!0,z.sendGet(`/resource/file/${O.item.id}`).success(T=>{S.status("message.getDetail",!0,`${O.title}\u300C${O.path()}\u300D`),Object.keys(T).forEach(R=>O.item[R]=T[R]),O.tmpObject=JSON.parse(JSON.stringify(O.processSave(T))),i.value=!1,be(()=>o.value.setScrollTop(0))})):(O.tmpObject=JSON.parse(JSON.stringify(O.processSave(O.item))),i.value=!1,be(()=>o.value.setScrollTop(0)))),s.value.decorations&&s.value.decorations.length>0&&be(()=>{const T=je(s.value.decorations);s.value.debugDecorations=o.value.appendDecoration(T).map((R,D)=>{var L;return((L=T[D].options)==null?void 0:L.className)==="debug-line"?R:null}).filter(R=>R!==null)||[]}),be(()=>r.value&&r.value.scrollIntoView(O))}),S.$on(F.DO_SAVE,m),S.$on(F.DO_TEST,()=>{const O=s.value;O&&O.item&&O.runnable&&O.doTest&&O.running!==!0&&(M.AUTO_SAVE&&O.item.lock!=="1"?m().end(v=>v&&f()):f())}),S.$event(Re.BREAKPOINT,([O,{range:v,variables:T}])=>{var R,D;if(((D=(R=s.value)==null?void 0:R.item)==null?void 0:D.id)!==O){const L=a.find(N=>N.item.id===O);L&&S.$emit(F.OPEN,L)}be(()=>{s.value.variables=si(T),s.value.debuging=!0,s.value.debugDecorations=[o.value.appendDecoration([{range:new ot(v[0],1,v[0],1),options:{isWholeLine:!0,inlineClassName:"debug-line",className:"debug-line"}}])],S.$emit(F.SWITCH_TOOLBAR,"debug")})}),S.$on(F.DEBUG_CONTINUE,y),S.$on(F.DEBUG_SETPINTO,()=>y(!0)),S.$event(Re.EXCEPTION,([[O,v,T]])=>{var R,D;if(((D=(R=s.value)==null?void 0:R.item)==null?void 0:D.id)===O){const L=new ot(T[0],T[2],T[1],T[3]+1),N=o.value.getInstance(),$=N.deltaDecorations([],[{range:L,options:{hoverMessage:{value:v},inlineClassName:"squiggly-error"}}]);N.revealRangeInCenter(L),N.focus(),M.DECORATION_TIMEOUT>=0&&setTimeout(()=>N.deltaDecorations($,[]),M.DECORATION_TIMEOUT)}}),ht(()=>t("onLoad")),(O,v)=>{const T=b("magic-text-icon"),R=b("magic-icon"),D=b("magic-avatar-group"),L=b("magic-tab"),N=b("magic-monaco-editor"),$=b("magic-loading");return g(),w("div",Qp,[h(a).length===0?(g(),w("div",Zp,[A("div",ed,[A("p",null,[_e(B(h(c)("message.save")),1),td,nd,_e(" "+B(h(c)("message.run")),1),ad,sd,_e(" "+B(h(c)("editor.tooltip.complection")),1),id,od,_e(" "+B(h(c)("editor.tooltip.resume")),1),rd,ld,_e(" "+B(h(c)("editor.tooltip.stepInto")),1),cd,ud,_e(" "+B(h(c)("editor.tooltip.format")),1),pd,dd,_e(" "+B(h(c)("editor.tooltip.recent")),1),_d])])])):(g(),w(Z,{key:1},[_(L,{value:s.value,"onUpdate:value":v[0]||(v[0]=Y=>s.value=Y),tabs:h(a),className:"magic-script-tab",ref_key:"tab",ref:r,"allow-close":!0,onClose:p,onChange:v[1]||(v[1]=Y=>h(S).$emit(h(F).OPEN,Y)),onBeforeChange:I,onItemContextmenu:E},{default:k(({tab:Y})=>[_(T,{icon:Y.getIcon(Y.item)},null,8,["icon"]),_e(B(Y.item.name),1),C(Y)?(g(),w("span",hd,"*")):X("",!0),Y.item.lock===O.$LOCKED?(g(),j(R,{key:1,icon:"lock"})):X("",!0),_(D,{users:h(l)[Y.item.id]||[],max:3,size:20},null,8,["users"])]),_:1},8,["value","tabs"]),_($,{loading:i.value},{default:k(()=>[A("div",fd,[_(N,{ref_key:"editor",ref:o,value:s.value.item.script,"onUpdate:value":v[2]||(v[2]=Y=>s.value.item.script=Y),decorations:s.value.decorations,"onUpdate:decorations":v[3]||(v[3]=Y=>s.value.decorations=Y),language:s.value.language,"support-breakpoint":!0},null,8,["value","decorations","language"])])]),_:1},8,["loading"])],64))])}}};var gd=q(md,[["__scopeId","data-v-1401171b"]]),vd=Object.freeze(Object.defineProperty({__proto__:null,default:gd},Symbol.toStringTag,{value:"Module"}));const ja={};Object.entries({"./components/magic-editor.vue":ho,"./components/common/magic-context-menu.vue":So,"./components/common/magic-empty.vue":Ao,"./components/common/magic-loading.vue":No,"./components/common/magic-monaco-diff-editor.vue":Po,"./components/common/magic-monaco-editor.vue":Ho,"./components/common/magic-resizer.vue":zo,"./components/common/data/magic-navbar-item.vue":Wo,"./components/common/data/magic-navbar.css":Jo,"./components/common/data/magic-navbar.js":ar,"./components/common/data/magic-tab.css":ir,"./components/common/data/magic-tab.js":rr,"./components/common/data/magic-table-column.vue":cr,"./components/common/data/magic-table.css":pr,"./components/common/data/magic-table.js":_r,"./components/common/data/magic-tree.css":fr,"./components/common/data/magic-tree.js":gr,"./components/common/dialog/magic-alert.vue":Cs,"./components/common/dialog/magic-confirm.vue":Ns,"./components/common/dialog/magic-dialog.vue":yr,"./components/common/dialog/magic-modal.js":ws,"./components/common/dialog/magic-notify.vue":Ir,"./components/common/form/magic-button-group.vue":Nr,"./components/common/form/magic-button.vue":Dr,"./components/common/form/magic-checkbox.vue":$r,"./components/common/form/magic-file.vue":Vr,"./components/common/form/magic-input.vue":qr,"./components/common/form/magic-select.vue":Zr,"./components/common/form/magic-textarea.vue":al,"./components/common/icon/magic-avatar-group.vue":ol,"./components/common/icon/magic-avatar.vue":ul,"./components/common/icon/magic-icon.vue":tr,"./components/common/icon/magic-text-icon.vue":hl,"./components/panel/api/magic-api-body.vue":gl,"./components/panel/api/magic-api-description.vue":El,"./components/panel/api/magic-api-group.vue":Sl,"./components/panel/api/magic-api-header.vue":Rl,"./components/panel/api/magic-api-info.vue":Ll,"./components/panel/api/magic-api-option.vue":kl,"./components/panel/api/magic-api-parameter.vue":Pl,"./components/panel/api/magic-api-path.vue":Bl,"./components/panel/api/magic-api-request-body.vue":jl,"./components/panel/api/magic-api-request-structure.vue":Wl,"./components/panel/api/magic-api-response-body.vue":Zl,"./components/panel/api/magic-api-response-header.vue":sc,"./components/panel/api/magic-api-response-structure.vue":uc,"./components/panel/api/magic-api-response.vue":hc,"./components/panel/api/magic-global-header.vue":gc,"./components/panel/api/magic-global-parameter.vue":bc,"./components/panel/api/magic-global.vue":Oc,"./components/panel/common/magic-panel-common-toolbar.vue":Rc,"./components/panel/common/magic-panel-toolbar.vue":Nc,"./components/panel/common/magic-resource-choose.vue":Uc,"./components/panel/datasource/magic-datasource-datasource.vue":Jc,"./components/panel/footer/magic-backup-file.vue":nu,"./components/panel/footer/magic-backup.vue":lu,"./components/panel/footer/magic-debug.vue":Du,"./components/panel/footer/magic-event.vue":Bu,"./components/panel/footer/magic-log.vue":Gu,"./components/panel/footer/magic-online.vue":Ku,"./components/panel/footer/magic-status-bar.vue":e1,"./components/panel/footer/magic-todo.vue":o1,"./components/panel/footer/magic-toolbar.vue":d1,"./components/panel/function/magic-function-info.vue":m1,"./components/panel/function/magic-function-parameter.vue":E1,"./components/panel/header/magic-export.vue":T1,"./components/panel/header/magic-header.vue":U1,"./components/panel/header/magic-push.vue":H1,"./components/panel/header/magic-search.vue":X1,"./components/panel/header/magic-upload.vue":Q1,"./components/panel/main/magic-data-resource.vue":op,"./components/panel/main/magic-login.vue":Tp,"./components/panel/main/magic-main.vue":Mp,"./components/panel/main/magic-recent-opened.vue":jp,"./components/panel/main/magic-resource.vue":Jp,"./components/panel/main/magic-script-editor.vue":vd}).forEach(([e,t])=>ja[e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("."))]=t.default);const wn=e=>{let t;Object.entries(ja).forEach(([n,a])=>{e.component(n,a)}),e.config.globalProperties.$contextmenu=n=>{t!=null&&t.unmount(),t=kn(Ba,{menus:n.menus,position:{x:n.event.clientX,y:n.event.clientY},onDestory:()=>{t&&t.unmount(),t=null}}),wn(t),t.mount(".magic-editor .magic-mounts")},Object.keys(M).forEach(n=>e.config.globalProperties[`$${n}`]=M[n]),ba(e,wn)};if(typeof window!="undefined"){let e=function(){var t=document.body,n=document.getElementById("__svg__icons__dom__1661694259918__");n||(n=document.createElementNS("http://www.w3.org/2000/svg","svg"),n.style.position="absolute",n.style.width="0",n.style.height="0",n.id="__svg__icons__dom__1661694259918__",n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("xmlns:link","http://www.w3.org/1999/xlink")),n.innerHTML='',t.insertBefore(n,t.firstChild)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}window.Vue=ss;const Va=kn(hs);Va.use(wn);Va.mount("#app");