hortimagic 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hortimagic.es.js +10 -7
- package/dist/hortimagic.iife.js +1 -1
- package/dist/hortimagic.js +3 -3
- package/dist/hortimagic.txt +3 -3
- package/dist/hortimagic.user.js +3 -3
- package/dist/index.d.ts +2 -0
- package/package.json +2 -2
package/dist/hortimagic.es.js
CHANGED
|
@@ -4023,8 +4023,8 @@ const scriptApp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
4023
4023
|
initScriptApp
|
|
4024
4024
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4025
4025
|
const name = "hortimagic";
|
|
4026
|
-
const version = "1.0.
|
|
4027
|
-
const changelog = "
|
|
4026
|
+
const version = "1.0.3";
|
|
4027
|
+
const changelog = "修复了对话框注册较晚的bug,增加了初始化完成的标志";
|
|
4028
4028
|
const author = "Narlen";
|
|
4029
4029
|
const description = "园艺魔法,花园插件";
|
|
4030
4030
|
const keywords = ["iirose", "plugins", "hortimagic"];
|
|
@@ -4062,9 +4062,10 @@ const pkg = {
|
|
|
4062
4062
|
async function init() {
|
|
4063
4063
|
try {
|
|
4064
4064
|
initNotificationHolder();
|
|
4065
|
+
initDialogHolder();
|
|
4066
|
+
await initDialogApp();
|
|
4065
4067
|
initMenuHolder();
|
|
4066
4068
|
initMovePanelHolder();
|
|
4067
|
-
initDialogHolder();
|
|
4068
4069
|
notice.normal(pkg.name, "注入网络钩子函数");
|
|
4069
4070
|
await initSocket();
|
|
4070
4071
|
notice.normal(pkg.name, "注入钩子函数");
|
|
@@ -4079,13 +4080,12 @@ async function init() {
|
|
|
4079
4080
|
menuHolder.appendChild(menu2);
|
|
4080
4081
|
let exampleMenu = await initExampleApp();
|
|
4081
4082
|
let scriptMenu = await initScriptApp();
|
|
4082
|
-
await initDialogApp();
|
|
4083
4083
|
menu2.addEventListener("hm-menu-click", function() {
|
|
4084
4084
|
exampleMenu.flag = menu2.flag;
|
|
4085
4085
|
scriptMenu.flag = menu2.flag;
|
|
4086
4086
|
});
|
|
4087
4087
|
menuHolder.append(menu2, exampleMenu, scriptMenu);
|
|
4088
|
-
notice.success(pkg.name, `${pkg.version}
|
|
4088
|
+
notice.success(pkg.name, `${pkg.version} 已加载`);
|
|
4089
4089
|
} catch (error) {
|
|
4090
4090
|
console.error(error);
|
|
4091
4091
|
}
|
|
@@ -4125,10 +4125,13 @@ const information = {
|
|
|
4125
4125
|
/** 项目仓库 */
|
|
4126
4126
|
repository: pkg.repository,
|
|
4127
4127
|
/** 项目构建时间 */
|
|
4128
|
-
buildTime: (/* @__PURE__ */ new Date()).toISOString()
|
|
4128
|
+
buildTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4129
|
+
/** 项目是否注入完成 */
|
|
4130
|
+
ingected: false
|
|
4129
4131
|
};
|
|
4130
4132
|
async function main() {
|
|
4131
|
-
init();
|
|
4133
|
+
await init();
|
|
4134
|
+
information.ingected = true;
|
|
4132
4135
|
}
|
|
4133
4136
|
main();
|
|
4134
4137
|
export {
|
package/dist/hortimagic.iife.js
CHANGED
|
@@ -1161,4 +1161,4 @@ hc-s
|
|
|
1161
1161
|
|
|
1162
1162
|
`}}async function Fi(){customElements.define("hm-script-app",Xi);let t=document.createElement("hm-move-panel");t.titleContent="脚本管理",t.icon="js",ki.appendChild(t);let e=It`
|
|
1163
1163
|
<hm-script-app></hm-script-app>
|
|
1164
|
-
`;te(e,await t.body);let i=document.createElement("hm-menu");return i.content="脚本管理",i.isMenuItem=!0,i.icon="js",i.addEventListener("hm-menu-click",function(){t.putTopToggel()}),i}Wi([le({type:String})],Xi.prototype,"scriptName"),Wi([le({type:String})],Xi.prototype,"scriptUrl"),Wi([le({type:Boolean})],Xi.prototype,"scriptEnable"),Wi([le({type:Boolean})],Xi.prototype,"scriptIngected"),Wi([le({type:Boolean})],Xi.prototype,"dialogOpen"),Wi([le({type:Array})],Xi.prototype,"scriptList");const Ji=Object.freeze(Object.defineProperty({__proto__:null,initScriptApp:Fi},Symbol.toStringTag,{value:"Module"})),Gi={name:"hortimagic",private:!1,version:"1.0.
|
|
1164
|
+
`;te(e,await t.body);let i=document.createElement("hm-menu");return i.content="脚本管理",i.isMenuItem=!0,i.icon="js",i.addEventListener("hm-menu-click",function(){t.putTopToggel()}),i}Wi([le({type:String})],Xi.prototype,"scriptName"),Wi([le({type:String})],Xi.prototype,"scriptUrl"),Wi([le({type:Boolean})],Xi.prototype,"scriptEnable"),Wi([le({type:Boolean})],Xi.prototype,"scriptIngected"),Wi([le({type:Boolean})],Xi.prototype,"dialogOpen"),Wi([le({type:Array})],Xi.prototype,"scriptList");const Ji=Object.freeze(Object.defineProperty({__proto__:null,initScriptApp:Fi},Symbol.toStringTag,{value:"Module"})),Gi={name:"hortimagic",private:!1,version:"1.0.3",changelog:"修复了对话框注册较晚的bug,增加了初始化完成的标志",author:"Narlen",description:"园艺魔法,花园插件",keywords:["iirose","plugins","hortimagic"],repository:{type:"git",url:"https://github.com/NarlenHua/hortimagic.git"},license:"MIT",type:"module",scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{lit:"^3.3.1",terser:"^5.44.0","tiny-emitter":"^2.1.0","vite-plugin-dts":"^4.5.4"},devDependencies:{"@types/node":"^24.9.1",typescript:"~5.9.3",vite:"^7.1.7"},main:"dist/Horticraft.life.js",module:"dist/HortiCraft.es.js",typings:"dist/index.d.ts",types:"dist/index.d.ts",files:["dist","src/components","types"]};async function Zi(){try{Oi(),Mi(),await Di(),xi(),Ci(),Ui.normal(Gi.name,"注入网络钩子函数"),await O(),Ui.normal(Gi.name,"注入钩子函数"),z(),I(),Ui.normal(Gi.name,"注入脚本"),F(),Ui.normal(Gi.name,"生成菜单");let t=document.createElement("hm-menu");t.content="HortiMagic",t.isMenuItem=!1,$i.appendChild(t);let e=await Ri(),i=await Fi();t.addEventListener("hm-menu-click",function(){e.flag=t.flag,i.flag=t.flag}),$i.append(t,e,i),Ui.success(Gi.name,`${Gi.version} 已加载`)}catch(t){}}const Yi=Object.freeze(Object.defineProperty({__proto__:null,init:Zi},Symbol.toStringTag,{value:"Module"})),Ki=Object.freeze(Object.defineProperty({__proto__:null,app_tools:Li,dialog_app:Ni,example_app:qi,main_app:Yi,script_app:Ji},Symbol.toStringTag,{value:"Module"})),Qi=Object.freeze(Object.defineProperty({__proto__:null,dialog:Hi,menu:Si,move_panel:Ai,notification:Ti},Symbol.toStringTag,{value:"Module"})),to={name:Gi.name,version:Gi.version,changelog:Gi.changelog,description:Gi.description,author:Gi.author,license:Gi.license,repository:Gi.repository,buildTime:(new Date).toISOString(),ingected:!1};return async function(){await Zi(),to.ingected=!0}(),t.apps=Ki,t.components=_i,t.core=G,t.holders=Qi,t.information=to,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
package/dist/hortimagic.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// ==UserScript==
|
|
2
2
|
// @name hortimagic
|
|
3
3
|
// @namespace hortimagic
|
|
4
|
-
// @version 1.0.
|
|
4
|
+
// @version 1.0.3
|
|
5
5
|
// @description 园艺魔法,花园插件
|
|
6
6
|
// @author Narlen
|
|
7
7
|
// @match https://iirose.com/messages.html
|
|
8
8
|
// @grant none
|
|
9
9
|
// @run-at onmessage-end
|
|
10
10
|
// @license MIT
|
|
11
|
-
// @buildtime 2025-10-
|
|
11
|
+
// @buildtime 2025-10-30T16:07:48.858Z
|
|
12
12
|
// ==/UserScript==
|
|
13
13
|
top.window.hortimagic=window.hortimagic=function(t){"use strict";async function e(t){return new Promise(e=>setTimeout(e,t))}function i(t){return t=(t=(t=(t=(t=(t=t.replace("&","&")).replace("<","<")).replace(">",">")).replace('"',""")).replace("'","'")).replace("\\","\")}function o(t){return t=(t=(t=(t=(t=(t=t.replace("<","<")).replace(">",">")).replace(""",'"')).replace("'","'")).replace("\","\\")).replace("&","&")}function n(){return window.myself?window.myself:null}function s(){return window.uid?window.uid:null}function r(){return window.avatar2&&window.avatarconv?window.avatarconv(window.avatar2):null}function l(){return window.inputcolorhex?window.inputcolorhex:null}const a=Object.freeze(Object.defineProperty({__proto__:null,addStyle:function(t){let e=document.createElement("style");e.innerText=t,document.body.append(e)},changeRoom:function(t){(t=String(t))&&window.Objs.mapHolder?.function?.roomchanger(t)},compressCSS:function(t){return t=(t=(t=(t=(t=t.replace(/\s{2,}/g," ")).replace(/\/\*[\s\S]*?\*\//g,"")).replace(/\s*([{};:,])\s*/g,"$1")).replace(/;\s*}/g,"}")).trim()},compressHTML:function(t){return t=(t=(t=(t=t.replace(/>\s+</g,"><")).replace(/\s{2,}/g," ")).replace(/<!--[\s\S]*?-->/g,"")).trim()},generatePrivateMessageBubble:function(t,e,o){window.privatechatfunc&&window.privatechatfunc([Math.floor(Date.now()/1e3).toString(10),s(),i(n()),i(r()),i(e),i(l()),"",i(l()),"","",o,t,"","","","",""].join(">"))},getAllOnlineUserInfo:function(){let t=window.Objs.mapHolder.Assets.userJson;return t?Object.keys(t).map(e=>{let i=t[e];return{name:i[2],uid:i[8],color:i[3],avatar:i[0],roomId:i[4],personalizedSignature:i[6]}}):null},getOnlineUserInfoById:function(t){t=String(t);let e=window.Objs.mapHolder?.function?.findUserByUid?.(t);return e?{name:e[2],uid:t,color:e[3],avatar:e[0],roomId:e[4],personalizedSignature:e[6]}:null},getRoomId:function(){return window.roomn?window.roomn:null},getRoomInfoById:function(t){let e=window.Objs.mapHolder?.Assets?.roomJson?.[t];if(e){let t=e[5].split("&&").map(t=>t.split(" & ")),i=o(t[0][0]),n=i.indexOf(" ");return{name:e[1],color:e[2],roomPath:e[0].split("_"),description:i.slice(n+1),roomImage:i.slice(0,n),currentUserNum:"number"==typeof e[7]?e[7]:"hidden",ownerName:t[1][0],member:t[4].map(t=>({name:o(t.slice(1)),auth:"0"==t[0]?"member":"1"==t[0]?"admin":"unknow"}))}}return null},getUserInputColor:l,getUserName:n,getUserProfilePictureUrl:r,getUserUid:s,htmlSpecialCharsDecode:o,htmlSpecialCharsEscape:i,sleep:e,switchRoom:function(t){window.Objs.mapHolder?.function?.roomchanger&&window.Objs.mapHolder.function.roomchanger(t)}},Symbol.toStringTag,{value:"Module"}));class c{constructor(){this.timeStamp="",this.headPortrait="",this.name="",this.message="",this.color="",this.gender="",this.uid="",this.designation="",this.messageUid="",this.messageClass="public"}}class h{constructor(){this.timeStamp="",this.headPortrait="",this.name="",this.message="",this.color="",this.gender="",this.uid="",this.messageUid="",this.messageClass="private"}}class d{constructor(){this.messageName="",this.uid="",this.data="",this.messageClass="hidden"}}class p{constructor(){this.username="",this.avatar="",this.message="",this.color="",this.gender="",this.timeStamp="",this.uid="",this.messageClass="danmu"}}class u{constructor(){this.privateUID="",this.uid="",this.messageUid="",this.dataUid="",this.messageClass="withdrawn"}}class m{constructor(){this.userMessageList=[],this.messageClass="system"}}class g{constructor(){this.result="",this.stockPrice=NaN,this.totalStock=NaN,this.holdingAmount=NaN,this.totalEquity=NaN,this.balance=NaN,this.messageClass="stock"}}class f{constructor(){this.message="",this.messageClass="unkonw"}}const v=Object.freeze(Object.defineProperty({__proto__:null,Danmu:p,Hidden:d,Private:h,Public:c,Stock:g,System:m,Unkonw:f,Withdrawn:u},Symbol.toStringTag,{value:"Module"}));let b=[];function y(t){let e=new c,i=t.split(">");return e.timeStamp=i[0],e.headPortrait=i[1],e.name=i[2],e.message=i[3],e.color=i[5],e.gender=i[6],e.uid=i[8],e.designation=i[9],e.messageUid=i[10],e}function w(t){let e=new h,i=t.split(">");return e.timeStamp=i[0].slice(1),e.uid=i[1],e.name=i[2],e.headPortrait=i[3],e.message=i[4],e.color=i[5],e.gender=i[8],e.messageUid=i[10],e}function _(t){let e=new p,i=t.split(">");return e.username=i[0],e.message=i[1],e.color=i[2],e.gender=i[4],e.avatar=i[5],e.timeStamp=i[6],e.uid=i[7],e}function $(t){if(b=[],/^"[^"].*/gs.test(t)){let e=t.slice(1).split("<");for(let t=e.length-1;t>=0;t--)b.push(y(e[t]))}else if(/^"".*/gs.test(t)){let e=t.slice(1).split("<");for(let t=e.length-1;t>=0;t--)b.push(w(e[t]))}else if(/^=.*/gs.test(t)){let e=t.slice(1).split("<");for(let t=e.length-1;t>=0;t--)b.push(_(e[t]))}else/^[/]<.*>[0-9|a-z]{13}:.*/gs.test(t)?b.push(function(t){let e,i=new d;return e=t.match(/(?<=^[/]<).*(?=>[0-9|a-z]{13}:.*)/gs),i.messageName=null==e?"":e[0],e=t.match(/(?<=^[/]<.*>)[0-9|a-z]{13}(?=:.*)/gs),i.uid=null==e?"":e[0],e=t.match(/(?<=^[/]<.*>[0-9|a-z]{13}:).*/gs),i.data=null==e?"":e[0],i}(t)):/^v0.*/gs.test(t)?b.push(function(t){let e=new u;return"#"==t[2]?(e.privateUID="",e.uid=t.slice(3,16),e.messageUid=t.slice(17,29),e.dataUid=t.slice(3,29)):(e.privateUID=t.slice(3,16),e.uid=t.slice(17,30),e.messageUid=t.slice(31),e.dataUid=t.slice(17)),e}(t)):/^%\*".*/gs.test(t)?b.push(function(t){let e=new m;return e.userMessageList=t.split("<"),e}(t)):/^>.*/gs.test(t)?b.push(function(t){let e=new g;if(e.result=t[2],"*"==e.result)return e;if(">"==e.result)return e.holdingAmount=parseInt(t.slice(2)),e;if("<"==e.result)return e.balance=parseInt(t.slice(2)),e;{let i=t.split('"');if(5==i.length)return e.stockPrice=parseFloat(i[2]),e.totalStock=parseInt(i[0].slice(1)),e.holdingAmount=parseInt(i[3]),e.totalEquity=parseFloat(i[1]),e.balance=parseFloat(i[4]),e;if(4==i.length)return e.stockPrice=parseFloat(i[1])/parseInt(i[0].slice(1)),e.totalStock=parseInt(i[0].slice(1)),e.holdingAmount=parseInt(i[2]),e.totalEquity=parseFloat(i[1]),e.balance=parseFloat(i[3]),e}return e}(t)):b.push(function(t){let e=new f;return e.message=t,e}(t))}const x=Object.freeze(Object.defineProperty({__proto__:null,decodeMessage:$,get messageObjList(){return b}},Symbol.toStringTag,{value:"Module"}));var S,k={exports:{}};var C=function(){if(S)return k.exports;function t(){}return S=1,t.prototype={on:function(t,e,i){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){var o=this;function n(){o.off(t,n),e.apply(i,arguments)}return n._=e,this.on(t,n,i)},emit:function(t){for(var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),o=0,n=i.length;o<n;o++)i[o].fn.apply(i[o].ctx,e);return this},off:function(t,e){var i=this.e||(this.e={}),o=i[t],n=[];if(o&&e)for(var s=0,r=o.length;s<r;s++)o[s].fn!==e&&o[s].fn._!==e&&n.push(o[s]);return n.length?i[t]=n:delete i[t],this}},k.exports=t,k.exports.TinyEmitter=t,k.exports}();let A=new C.TinyEmitter;const E=Object.freeze(Object.defineProperty({__proto__:null,TinyEmitter:C.TinyEmitter,emitter:A},Symbol.toStringTag,{value:"Module"}));async function O(){for(let i=0;i<30;i++)try{if(null==window.socket.__onmessage&&null!=window.socket._onmessage&&null!=window.socket.send)break;await e(500);continue}catch(t){}null==window.socket.__onmessage&&null!=window.socket._onmessage&&null!=window.socket.send&&(T.originalSend=window.socket.send,window.socket.send=T.send,T.originalOnmessage=window.socket._onmessage,window.socket._onmessage=T.onmessage)}const T={beforeSend:async function(t){return t},originalSend:function(t){return t},afterSend:function(t){return t},send:async function(t){let e=await T.beforeSend(t);try{null!=e&&(T.originalSend(e),T.afterSend(e))}catch(i){}},beforeOnmessage:async function(t){return $(t),t},originalOnmessage:function(t){return t},afterOnmessage:async function(t){for(let e of b)A.emit(e.messageClass,e);return t},onmessage:async function(t){let e=await T.beforeOnmessage(t);try{null!=e&&(T.originalOnmessage(e),T.afterOnmessage(e))}catch(i){}},initSocket:O},P=Object.freeze(Object.defineProperty({__proto__:null,initSocket:O,sockets:T},Symbol.toStringTag,{value:"Module"}));function M(t,e){return"cut"===t?`{0${JSON.stringify({m:t,mc:e,i:Math.random().toString().slice(2,12)})}`:JSON.stringify({m:t,mc:e,i:Math.random().toString().slice(2,12)})}const H=Object.freeze(Object.defineProperty({__proto__:null,danmu:function(t,e,i="0"){return`~{"t":"${t}","c":"${e}","v":${i}}`},hidden:function(t,e,i){return`/<${t}>${e}:${i}`},like:function(t,e=""){return`+*${t}${e}`},musicCard:function(t,e,i,o,n,s){return M(`m__4=${t}>${e}>${i}>${o}>${n}>${s}`,n)},privateChat:function(t,e,i){return JSON.stringify({g:t,m:e,mc:i,i:Math.random().toString().slice(2,12)})},publicChat:M,stockRequest:function(t){return null==t?">#":t>0?`>$${Math.round(Math.abs(t))}`:t<0?`>@${Math.round(Math.abs(t))}`:">#"},videoCard:function(t,e,i,o,n,s,r){return M(`m__4*${t}>${e}>${i}>${o}>${n}>${s}>${r}`,n)},withdrawn:function(t,e=""){return""==e?`v0#${t}`:`v0*${e}#${t}`}},Symbol.toStringTag,{value:"Module"}));let j={movePanelHolder:document.querySelector("#movePanelHolder"),functionHolder:document.querySelector("#functionHolder"),functionButtonGroupList:[...document.querySelectorAll(".functionButton.functionButtonGroup")],msgholderBox:document.querySelector("#msgholder .fullBox.msgholderBox"),homeHolderMsgBox:document.querySelector("#homeHolder .homeHolderMsgContentBox .homeHolderMsgBox.fullBox"),sessionHolderPmTaskBoxItems:[...document.querySelectorAll(".sessionHolderPmTaskBoxItem.whoisTouch2")],moveinputDisplay:document.querySelector("#moveinputDisplay"),moveinput:document.getElementById("moveinput"),moveinputSendBtnFunc:document.querySelector("#moveinputDisplay #moveinputSendBtnFunc"),moveinputSendBtnSend:document.querySelector("#moveinputDisplay #moveinputSendBtnSend")};function z(){j.movePanelHolder=document.querySelector("#movePanelHolder"),j.functionHolder=document.querySelector("#functionHolder"),j.functionButtonGroupList=[...document.querySelectorAll(".functionButton.functionButtonGroup")],j.msgholderBox=document.querySelector("#msgholder .fullBox .fullBox.msgholderBox"),j.homeHolderMsgBox=document.querySelector("#homeHolder .homeHolderMsgContentBox .homeHolderMsgBox.fullBox"),j.sessionHolderPmTaskBoxItems=[...document.querySelectorAll(".sessionHolderPmTaskBoxItem.whoisTouch2")],j.moveinputDisplay=document.querySelector("#moveinputDisplay"),j.moveinput=document.getElementById("moveinput"),j.moveinputSendBtnFunc=document.querySelector("#moveinputDisplay #moveinputSendBtnFunc"),j.moveinputSendBtnSend=document.querySelector("#moveinputDisplay #moveinputSendBtnSend")}let B={elementHooks:{moveinput:{oninputBefore:()=>!0,oninputAfter:()=>!0,onblurBefore:()=>!0,onblurAfter:()=>!0,onfocusBefore:()=>!0,onfocusAfter:()=>!0}},functionHooks:{processer:{onBefore:(t,e,i,o)=>!0,onAfter:(t,e,i,o)=>!0}},replaceMoveinput:()=>{try{let t=j.moveinput.oninput;j.moveinput.oninput=function(){1==B.elementHooks.moveinput.oninputBefore()&&(t?.call(j.moveinput),B.elementHooks.moveinput.oninputAfter())}}catch(t){}try{let t=j.moveinput.oninput;j.moveinput.onblur=function(){1==B.elementHooks.moveinput.onblurBefore()&&(t?.call(j.moveinput),B.elementHooks.moveinput.onblurAfter())}}catch(t){}try{let t=j.moveinput.oninput;j.moveinput.onfocus=function(){1==B.elementHooks.moveinput.onfocusBefore()&&(t?.call(j.moveinput),B.elementHooks.moveinput.onfocusAfter())}}catch(t){}},replaceButtonProcesser:()=>{try{let t=buttonProcesser;buttonProcesser=(e,i,o,n)=>{1==B.functionHooks.processer.onBefore(e,i,o,n)&&(t(e,i,o,n),B.functionHooks.processer.onAfter(e,i,o,n))}}catch(t){}}};function I(){B.replaceMoveinput(),B.replaceButtonProcesser()}const D=Object.freeze(Object.defineProperty({__proto__:null,Hooks:B,elements:j,initHooks:I,refreshAll:z},Symbol.toStringTag,{value:"Module"}));class N{constructor(t,e,i=!0,o=!1){this.name=t,this.url=e,this.enable=i,this.ingected=o}}let U=[];function L(t){if(""==t.name||""==t.url)return _alert("脚本名字或链接不能为空"),!1;for(let e of U){if(e.name===t.name)return e.url=t.url,e.enable=t.enable,e.ingected=t.ingected,!1;if(e.url===t.url)return e.name=t.name,e.enable=t.enable,e.ingected=t.ingected,!1}return U.push(t),!0}function R(t){U=U.filter(e=>e.name!==t.name&&e.url!==t.url)}function q(t){if(t.ingected)return _alert(`脚本 ${t.name} 已经注入`),t.ingected;const e=document.createElement("script");return e.src=t.url,e.onload=()=>{_alert(`脚本 ${t.name} 注入成功`),t.ingected=!0},e.onerror=()=>{_alert(`脚本 ${t.name} 注入失败`),t.enable=!1},document.head.appendChild(e),t.ingected}function V(t){for(let e of t)e.enable&&!e.ingected&&q(e)}function W(){let t=localStorage.getItem("hortiMagicScriptList");U=null==t?[]:JSON.parse(t);for(let e of U)e.ingected=!1}function X(){localStorage.setItem("hortiMagicScriptList",JSON.stringify(U)),_alert("脚本列表已保存")}function F(){W(),V(U)}const J=Object.freeze(Object.defineProperty({__proto__:null,Script:N,addScriptToList:L,ingectlocalScript:F,injectScript:q,injectScriptList:V,readScriptList:W,removeScriptFromList:R,saveScriptList:X,get scriptList(){return U}},Symbol.toStringTag,{value:"Module"})),G=Object.freeze(Object.defineProperty({__proto__:null,Message:v,decoder:x,elements_hooks:D,encoder:H,event_emitter:E,iirose_socket:P,script_tools:J,tools:a},Symbol.toStringTag,{value:"Module"})),Z=globalThis,Y=Z.ShadowRoot&&(void 0===Z.ShadyCSS||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,K=Symbol(),Q=new WeakMap;let tt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==K)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Y&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=Q.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Q.set(e,t))}return t}toString(){return this.cssText}};const et=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new tt(i,t,K)},it=Y?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new tt("string"==typeof t?t:t+"",void 0,K))(e)})(t):t,{is:ot,defineProperty:nt,getOwnPropertyDescriptor:st,getOwnPropertyNames:rt,getOwnPropertySymbols:lt,getPrototypeOf:at}=Object,ct=globalThis,ht=ct.trustedTypes,dt=ht?ht.emptyScript:"",pt=ct.reactiveElementPolyfillSupport,ut=(t,e)=>t,mt={toAttribute(t,e){switch(e){case Boolean:t=t?dt:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(o){i=null}}return i}},gt=(t,e)=>!ot(t,e),ft={attribute:!0,type:String,converter:mt,reflect:!1,useDefault:!1,hasChanged:gt};Symbol.metadata??=Symbol("metadata"),ct.litPropertyMetadata??=new WeakMap;let vt=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ft){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&nt(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:n}=st(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const s=o?.call(this);n?.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ft}static _$Ei(){if(this.hasOwnProperty(ut("elementProperties")))return;const t=at(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ut("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ut("properties"))){const t=this.properties,e=[...rt(t),...lt(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const t=this._$Eu(e,i);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(it(t))}else void 0!==t&&e.push(it(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(Y)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),o=Z.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(void 0!==o&&!0===i.reflect){const n=(void 0!==i.converter?.toAttribute?i.converter:mt).toAttribute(e,i.type);this._$Em=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,e){const i=this.constructor,o=i._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=i.getPropertyOptions(o),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:mt;this._$Em=o;const s=n.fromAttribute(e,t.type);this[o]=s??this._$Ej?.get(o)??s,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const o=this.constructor,n=this[t];if(i??=o.getPropertyOptions(t),!((i.hasChanged??gt)(n,e)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:o,wrapped:n},s){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,s??e??this[t]),!0!==n||void 0!==s)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,i,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};vt.elementStyles=[],vt.shadowRootOptions={mode:"open"},vt[ut("elementProperties")]=new Map,vt[ut("finalized")]=new Map,pt?.({ReactiveElement:vt}),(ct.reactiveElementVersions??=[]).push("2.1.1");const bt=globalThis,yt=bt.trustedTypes,wt=yt?yt.createPolicy("lit-html",{createHTML:t=>t}):void 0,_t="$lit$",$t=`lit$${Math.random().toFixed(9).slice(2)}$`,xt="?"+$t,St=`<${xt}>`,kt=document,Ct=()=>kt.createComment(""),At=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Et=Array.isArray,Ot="[ \t\n\f\r]",Tt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pt=/-->/g,Mt=/>/g,Ht=RegExp(`>|${Ot}(?:([^\\s"'>=/]+)(${Ot}*=${Ot}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),jt=/'/g,zt=/"/g,Bt=/^(?:script|style|textarea|title)$/i,It=(Rt=1,(t,...e)=>({_$litType$:Rt,strings:t,values:e})),Dt=Symbol.for("lit-noChange"),Nt=Symbol.for("lit-nothing"),Ut=new WeakMap,Lt=kt.createTreeWalker(kt,129);var Rt;function qt(t,e){if(!Et(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==wt?wt.createHTML(e):e}class Vt{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,s=0;const r=t.length-1,l=this.parts,[a,c]=((t,e)=>{const i=t.length-1,o=[];let n,s=2===e?"<svg>":3===e?"<math>":"",r=Tt;for(let l=0;l<i;l++){const e=t[l];let i,a,c=-1,h=0;for(;h<e.length&&(r.lastIndex=h,a=r.exec(e),null!==a);)h=r.lastIndex,r===Tt?"!--"===a[1]?r=Pt:void 0!==a[1]?r=Mt:void 0!==a[2]?(Bt.test(a[2])&&(n=RegExp("</"+a[2],"g")),r=Ht):void 0!==a[3]&&(r=Ht):r===Ht?">"===a[0]?(r=n??Tt,c=-1):void 0===a[1]?c=-2:(c=r.lastIndex-a[2].length,i=a[1],r=void 0===a[3]?Ht:'"'===a[3]?zt:jt):r===zt||r===jt?r=Ht:r===Pt||r===Mt?r=Tt:(r=Ht,n=void 0);const d=r===Ht&&t[l+1].startsWith("/>")?" ":"";s+=r===Tt?e+St:c>=0?(o.push(i),e.slice(0,c)+_t+e.slice(c)+$t+d):e+$t+(-2===c?l:d)}return[qt(t,s+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]})(t,e);if(this.el=Vt.createElement(a,i),Lt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=Lt.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(_t)){const e=c[s++],i=o.getAttribute(t).split($t),r=/([.?@])?(.*)/.exec(e);l.push({type:1,index:n,name:r[2],strings:i,ctor:"."===r[1]?Gt:"?"===r[1]?Zt:"@"===r[1]?Yt:Jt}),o.removeAttribute(t)}else t.startsWith($t)&&(l.push({type:6,index:n}),o.removeAttribute(t));if(Bt.test(o.tagName)){const t=o.textContent.split($t),e=t.length-1;if(e>0){o.textContent=yt?yt.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],Ct()),Lt.nextNode(),l.push({type:2,index:++n});o.append(t[e],Ct())}}}else if(8===o.nodeType)if(o.data===xt)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf($t,t+1));)l.push({type:7,index:n}),t+=$t.length-1}n++}}static createElement(t,e){const i=kt.createElement("template");return i.innerHTML=t,i}}function Wt(t,e,i=t,o){if(e===Dt)return e;let n=void 0!==o?i._$Co?.[o]:i._$Cl;const s=At(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),void 0===s?n=void 0:(n=new s(t),n._$AT(t,i,o)),void 0!==o?(i._$Co??=[])[o]=n:i._$Cl=n),void 0!==n&&(e=Wt(t,n._$AS(t,e.values),n,o)),e}class Xt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,o=(t?.creationScope??kt).importNode(e,!0);Lt.currentNode=o;let n=Lt.nextNode(),s=0,r=0,l=i[0];for(;void 0!==l;){if(s===l.index){let e;2===l.type?e=new Ft(n,n.nextSibling,this,t):1===l.type?e=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(e=new Kt(n,this,t)),this._$AV.push(e),l=i[++r]}s!==l?.index&&(n=Lt.nextNode(),s++)}return Lt.currentNode=kt,o}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Ft{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,o){this.type=2,this._$AH=Nt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Wt(this,t,e),At(t)?t===Nt||null==t||""===t?(this._$AH!==Nt&&this._$AR(),this._$AH=Nt):t!==this._$AH&&t!==Dt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>Et(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Nt&&At(this._$AH)?this._$AA.nextSibling.data=t:this.T(kt.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Vt.createElement(qt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new Xt(o,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Ut.get(t.strings);return void 0===e&&Ut.set(t.strings,e=new Vt(t)),e}k(t){Et(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const n of t)o===e.length?e.push(i=new Ft(this.O(Ct()),this.O(Ct()),this,this.options)):i=e[o],i._$AI(n),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Jt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,n){this.type=1,this._$AH=Nt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Nt}_$AI(t,e=this,i,o){const n=this.strings;let s=!1;if(void 0===n)t=Wt(this,t,e,0),s=!At(t)||t!==this._$AH&&t!==Dt,s&&(this._$AH=t);else{const o=t;let r,l;for(t=n[0],r=0;r<n.length-1;r++)l=Wt(this,o[i+r],e,r),l===Dt&&(l=this._$AH[r]),s||=!At(l)||l!==this._$AH[r],l===Nt?t=Nt:t!==Nt&&(t+=(l??"")+n[r+1]),this._$AH[r]=l}s&&!o&&this.j(t)}j(t){t===Nt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Gt extends Jt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Nt?void 0:t}}class Zt extends Jt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Nt)}}class Yt extends Jt{constructor(t,e,i,o,n){super(t,e,i,o,n),this.type=5}_$AI(t,e=this){if((t=Wt(this,t,e,0)??Nt)===Dt)return;const i=this._$AH,o=t===Nt&&i!==Nt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==Nt&&(i===Nt||o);o&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Kt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Wt(this,t)}}const Qt=bt.litHtmlPolyfillSupport;Qt?.(Vt,Ft),(bt.litHtmlVersions??=[]).push("3.3.1");const te=(t,e,i)=>{const o=i?.renderBefore??e;let n=o._$litPart$;if(void 0===n){const t=i?.renderBefore??null;o._$litPart$=n=new Ft(e.insertBefore(Ct(),t),t,void 0,i??{})}return n._$AI(t),n},ee=globalThis;let ie=class extends vt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=te(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Dt}};ie._$litElement$=!0,ie.finalized=!0,ee.litElementHydrateSupport?.({LitElement:ie});const oe=ee.litElementPolyfillSupport;oe?.({LitElement:ie}),(ee.litElementVersions??=[]).push("4.2.1");const ne=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},se={attribute:!0,type:String,converter:mt,reflect:!1,hasChanged:gt},re=(t=se,e,i)=>{const{kind:o,metadata:n}=i;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),s.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const n=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=i;return function(i){const n=this[o];e.call(this,i),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+o)};function le(t){return(e,i)=>"object"==typeof i?re(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}const ae=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function ce(t,e){return(e,i,o)=>ae(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}var he=Object.defineProperty,de=Object.getOwnPropertyDescriptor,pe=(t,e,i,o)=>{for(var n,s=o>1?void 0:o?de(e,i):e,r=t.length-1;r>=0;r--)(n=t[r])&&(s=(o?n(e,i,s):n(s))||s);return o&&s&&he(e,i,s),s};let ue=[],me=99999,ge=class extends ie{constructor(){super(),this.width=320,this.height=490,this.headerBackgroundColor="rgba(66,134,182,0.9)",this.headerColor="rgb(255,255,255)",this.bodyBackgroundColor="rgba(255,255,255,0.7)",this.bodyColor="rgba(23, 23, 23, 0.9)",this.footerBackgroundColor="rgba(255,255,255,0.7)",this.buttonBackgroundColor="rgba(255,255,255,0.9)",this.buttonColor="rgba(66,134,182,0.9)",this.titleContent="面板",this.leftButtonText="按钮1",this.rightButtonText="按钮2",this.isDisplay=!1,this.zIndex=me,this.icon="magic-wand",this.left=(window.innerWidth-this.width)/2,this.top=(window.innerHeight-(this.height+80))/2,this.dragging=!1,ue.push(this),this.zIndex=++me}handleLeftClick(){this.hideMovePanel()}handleRightClick(){this.hideMovePanel()}hideMovePanel(){this.isDisplay=!1,this.dispatchEvent(new CustomEvent("close",{detail:{isDisplay:this.isDisplay,message:"关闭事件"},bubbles:!0,composed:!0}))}showMovePanel(){this.isDisplay=!0,this.dispatchEvent(new CustomEvent("show",{detail:{isDisplay:this.isDisplay},bubbles:!0,composed:!0}))}toogleDisplay(){this.isDisplay?this.hideMovePanel():this.showMovePanel()}mouseDragging(t){let e=this.left,i=this.top,o=t.clientX-e,n=t.clientY-i;0==this.dragging&&(this.dragging=!0),document.onmousemove=t=>{this.dragging&&(this.left=t.clientX-o,this.top=t.clientY-n)},document.onmouseup=()=>{this.dragging&&(this.dragging=!1),document.onmousemove=null}}touchDragging(t){let e=this.left,i=this.top,o=t.touches[0].clientX-e,n=t.touches[0].clientY-i;0==this.dragging&&(this.dragging=!0),document.ontouchmove=t=>{this.dragging&&(this.left=t.touches[0].clientX-o,this.top=t.touches[0].clientY-n)},document.ontouchend=()=>{this.dragging&&(this.dragging=!1),document.onmousemove=null}}putTop(){let t=!1;if(ue.includes(this)){for(let t=0;t<ue.length;t++)ue[t].zIndex>this.zIndex&&(ue[t].zIndex=ue[t].zIndex-1);this.zIndex=me,t=!0}else t=!1;return t}putTopToggel(){this.zIndex!=me?(this.putTop(),this.showMovePanel()):this.toogleDisplay()}render(){return It`
|
|
14
14
|
<div
|
|
@@ -1173,4 +1173,4 @@ hc-s
|
|
|
1173
1173
|
|
|
1174
1174
|
`}}async function Fi(){customElements.define("hm-script-app",Xi);let t=document.createElement("hm-move-panel");t.titleContent="脚本管理",t.icon="js",ki.appendChild(t);let e=It`
|
|
1175
1175
|
<hm-script-app></hm-script-app>
|
|
1176
|
-
`;te(e,await t.body);let i=document.createElement("hm-menu");return i.content="脚本管理",i.isMenuItem=!0,i.icon="js",i.addEventListener("hm-menu-click",function(){t.putTopToggel()}),i}Wi([le({type:String})],Xi.prototype,"scriptName"),Wi([le({type:String})],Xi.prototype,"scriptUrl"),Wi([le({type:Boolean})],Xi.prototype,"scriptEnable"),Wi([le({type:Boolean})],Xi.prototype,"scriptIngected"),Wi([le({type:Boolean})],Xi.prototype,"dialogOpen"),Wi([le({type:Array})],Xi.prototype,"scriptList");const Ji=Object.freeze(Object.defineProperty({__proto__:null,initScriptApp:Fi},Symbol.toStringTag,{value:"Module"})),Gi={name:"hortimagic",private:!1,version:"1.0.
|
|
1176
|
+
`;te(e,await t.body);let i=document.createElement("hm-menu");return i.content="脚本管理",i.isMenuItem=!0,i.icon="js",i.addEventListener("hm-menu-click",function(){t.putTopToggel()}),i}Wi([le({type:String})],Xi.prototype,"scriptName"),Wi([le({type:String})],Xi.prototype,"scriptUrl"),Wi([le({type:Boolean})],Xi.prototype,"scriptEnable"),Wi([le({type:Boolean})],Xi.prototype,"scriptIngected"),Wi([le({type:Boolean})],Xi.prototype,"dialogOpen"),Wi([le({type:Array})],Xi.prototype,"scriptList");const Ji=Object.freeze(Object.defineProperty({__proto__:null,initScriptApp:Fi},Symbol.toStringTag,{value:"Module"})),Gi={name:"hortimagic",private:!1,version:"1.0.3",changelog:"修复了对话框注册较晚的bug,增加了初始化完成的标志",author:"Narlen",description:"园艺魔法,花园插件",keywords:["iirose","plugins","hortimagic"],repository:{type:"git",url:"https://github.com/NarlenHua/hortimagic.git"},license:"MIT",type:"module",scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{lit:"^3.3.1",terser:"^5.44.0","tiny-emitter":"^2.1.0","vite-plugin-dts":"^4.5.4"},devDependencies:{"@types/node":"^24.9.1",typescript:"~5.9.3",vite:"^7.1.7"},main:"dist/Horticraft.life.js",module:"dist/HortiCraft.es.js",typings:"dist/index.d.ts",types:"dist/index.d.ts",files:["dist","src/components","types"]};async function Zi(){try{Oi(),Mi(),await Di(),xi(),Ci(),Ui.normal(Gi.name,"注入网络钩子函数"),await O(),Ui.normal(Gi.name,"注入钩子函数"),z(),I(),Ui.normal(Gi.name,"注入脚本"),F(),Ui.normal(Gi.name,"生成菜单");let t=document.createElement("hm-menu");t.content="HortiMagic",t.isMenuItem=!1,$i.appendChild(t);let e=await Ri(),i=await Fi();t.addEventListener("hm-menu-click",function(){e.flag=t.flag,i.flag=t.flag}),$i.append(t,e,i),Ui.success(Gi.name,`${Gi.version} 已加载`)}catch(t){}}const Yi=Object.freeze(Object.defineProperty({__proto__:null,init:Zi},Symbol.toStringTag,{value:"Module"})),Ki=Object.freeze(Object.defineProperty({__proto__:null,app_tools:Li,dialog_app:Ni,example_app:qi,main_app:Yi,script_app:Ji},Symbol.toStringTag,{value:"Module"})),Qi=Object.freeze(Object.defineProperty({__proto__:null,dialog:Hi,menu:Si,move_panel:Ai,notification:Ti},Symbol.toStringTag,{value:"Module"})),to={name:Gi.name,version:Gi.version,changelog:Gi.changelog,description:Gi.description,author:Gi.author,license:Gi.license,repository:Gi.repository,buildTime:(new Date).toISOString(),ingected:!1};return async function(){await Zi(),to.ingected=!0}(),t.apps=Ki,t.components=_i,t.core=G,t.holders=Qi,t.information=to,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
package/dist/hortimagic.txt
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// ==UserScript==
|
|
2
2
|
// @name hortimagic
|
|
3
3
|
// @namespace hortimagic
|
|
4
|
-
// @version 1.0.
|
|
4
|
+
// @version 1.0.3
|
|
5
5
|
// @description 园艺魔法,花园插件
|
|
6
6
|
// @author Narlen
|
|
7
7
|
// @match https://iirose.com/messages.html
|
|
8
8
|
// @grant none
|
|
9
9
|
// @run-at onmessage-end
|
|
10
10
|
// @license MIT
|
|
11
|
-
// @buildtime 2025-10-
|
|
11
|
+
// @buildtime 2025-10-30T16:07:48.858Z
|
|
12
12
|
// ==/UserScript==
|
|
13
13
|
top.window.hortimagic=window.hortimagic=function(t){"use strict";async function e(t){return new Promise(e=>setTimeout(e,t))}function i(t){return t=(t=(t=(t=(t=(t=t.replace("&","&")).replace("<","<")).replace(">",">")).replace('"',""")).replace("'","'")).replace("\\","\")}function o(t){return t=(t=(t=(t=(t=(t=t.replace("<","<")).replace(">",">")).replace(""",'"')).replace("'","'")).replace("\","\\")).replace("&","&")}function n(){return window.myself?window.myself:null}function s(){return window.uid?window.uid:null}function r(){return window.avatar2&&window.avatarconv?window.avatarconv(window.avatar2):null}function l(){return window.inputcolorhex?window.inputcolorhex:null}const a=Object.freeze(Object.defineProperty({__proto__:null,addStyle:function(t){let e=document.createElement("style");e.innerText=t,document.body.append(e)},changeRoom:function(t){(t=String(t))&&window.Objs.mapHolder?.function?.roomchanger(t)},compressCSS:function(t){return t=(t=(t=(t=(t=t.replace(/\s{2,}/g," ")).replace(/\/\*[\s\S]*?\*\//g,"")).replace(/\s*([{};:,])\s*/g,"$1")).replace(/;\s*}/g,"}")).trim()},compressHTML:function(t){return t=(t=(t=(t=t.replace(/>\s+</g,"><")).replace(/\s{2,}/g," ")).replace(/<!--[\s\S]*?-->/g,"")).trim()},generatePrivateMessageBubble:function(t,e,o){window.privatechatfunc&&window.privatechatfunc([Math.floor(Date.now()/1e3).toString(10),s(),i(n()),i(r()),i(e),i(l()),"",i(l()),"","",o,t,"","","","",""].join(">"))},getAllOnlineUserInfo:function(){let t=window.Objs.mapHolder.Assets.userJson;return t?Object.keys(t).map(e=>{let i=t[e];return{name:i[2],uid:i[8],color:i[3],avatar:i[0],roomId:i[4],personalizedSignature:i[6]}}):null},getOnlineUserInfoById:function(t){t=String(t);let e=window.Objs.mapHolder?.function?.findUserByUid?.(t);return e?{name:e[2],uid:t,color:e[3],avatar:e[0],roomId:e[4],personalizedSignature:e[6]}:null},getRoomId:function(){return window.roomn?window.roomn:null},getRoomInfoById:function(t){let e=window.Objs.mapHolder?.Assets?.roomJson?.[t];if(e){let t=e[5].split("&&").map(t=>t.split(" & ")),i=o(t[0][0]),n=i.indexOf(" ");return{name:e[1],color:e[2],roomPath:e[0].split("_"),description:i.slice(n+1),roomImage:i.slice(0,n),currentUserNum:"number"==typeof e[7]?e[7]:"hidden",ownerName:t[1][0],member:t[4].map(t=>({name:o(t.slice(1)),auth:"0"==t[0]?"member":"1"==t[0]?"admin":"unknow"}))}}return null},getUserInputColor:l,getUserName:n,getUserProfilePictureUrl:r,getUserUid:s,htmlSpecialCharsDecode:o,htmlSpecialCharsEscape:i,sleep:e,switchRoom:function(t){window.Objs.mapHolder?.function?.roomchanger&&window.Objs.mapHolder.function.roomchanger(t)}},Symbol.toStringTag,{value:"Module"}));class c{constructor(){this.timeStamp="",this.headPortrait="",this.name="",this.message="",this.color="",this.gender="",this.uid="",this.designation="",this.messageUid="",this.messageClass="public"}}class h{constructor(){this.timeStamp="",this.headPortrait="",this.name="",this.message="",this.color="",this.gender="",this.uid="",this.messageUid="",this.messageClass="private"}}class d{constructor(){this.messageName="",this.uid="",this.data="",this.messageClass="hidden"}}class p{constructor(){this.username="",this.avatar="",this.message="",this.color="",this.gender="",this.timeStamp="",this.uid="",this.messageClass="danmu"}}class u{constructor(){this.privateUID="",this.uid="",this.messageUid="",this.dataUid="",this.messageClass="withdrawn"}}class m{constructor(){this.userMessageList=[],this.messageClass="system"}}class g{constructor(){this.result="",this.stockPrice=NaN,this.totalStock=NaN,this.holdingAmount=NaN,this.totalEquity=NaN,this.balance=NaN,this.messageClass="stock"}}class f{constructor(){this.message="",this.messageClass="unkonw"}}const v=Object.freeze(Object.defineProperty({__proto__:null,Danmu:p,Hidden:d,Private:h,Public:c,Stock:g,System:m,Unkonw:f,Withdrawn:u},Symbol.toStringTag,{value:"Module"}));let b=[];function y(t){let e=new c,i=t.split(">");return e.timeStamp=i[0],e.headPortrait=i[1],e.name=i[2],e.message=i[3],e.color=i[5],e.gender=i[6],e.uid=i[8],e.designation=i[9],e.messageUid=i[10],e}function w(t){let e=new h,i=t.split(">");return e.timeStamp=i[0].slice(1),e.uid=i[1],e.name=i[2],e.headPortrait=i[3],e.message=i[4],e.color=i[5],e.gender=i[8],e.messageUid=i[10],e}function _(t){let e=new p,i=t.split(">");return e.username=i[0],e.message=i[1],e.color=i[2],e.gender=i[4],e.avatar=i[5],e.timeStamp=i[6],e.uid=i[7],e}function $(t){if(b=[],/^"[^"].*/gs.test(t)){let e=t.slice(1).split("<");for(let t=e.length-1;t>=0;t--)b.push(y(e[t]))}else if(/^"".*/gs.test(t)){let e=t.slice(1).split("<");for(let t=e.length-1;t>=0;t--)b.push(w(e[t]))}else if(/^=.*/gs.test(t)){let e=t.slice(1).split("<");for(let t=e.length-1;t>=0;t--)b.push(_(e[t]))}else/^[/]<.*>[0-9|a-z]{13}:.*/gs.test(t)?b.push(function(t){let e,i=new d;return e=t.match(/(?<=^[/]<).*(?=>[0-9|a-z]{13}:.*)/gs),i.messageName=null==e?"":e[0],e=t.match(/(?<=^[/]<.*>)[0-9|a-z]{13}(?=:.*)/gs),i.uid=null==e?"":e[0],e=t.match(/(?<=^[/]<.*>[0-9|a-z]{13}:).*/gs),i.data=null==e?"":e[0],i}(t)):/^v0.*/gs.test(t)?b.push(function(t){let e=new u;return"#"==t[2]?(e.privateUID="",e.uid=t.slice(3,16),e.messageUid=t.slice(17,29),e.dataUid=t.slice(3,29)):(e.privateUID=t.slice(3,16),e.uid=t.slice(17,30),e.messageUid=t.slice(31),e.dataUid=t.slice(17)),e}(t)):/^%\*".*/gs.test(t)?b.push(function(t){let e=new m;return e.userMessageList=t.split("<"),e}(t)):/^>.*/gs.test(t)?b.push(function(t){let e=new g;if(e.result=t[2],"*"==e.result)return e;if(">"==e.result)return e.holdingAmount=parseInt(t.slice(2)),e;if("<"==e.result)return e.balance=parseInt(t.slice(2)),e;{let i=t.split('"');if(5==i.length)return e.stockPrice=parseFloat(i[2]),e.totalStock=parseInt(i[0].slice(1)),e.holdingAmount=parseInt(i[3]),e.totalEquity=parseFloat(i[1]),e.balance=parseFloat(i[4]),e;if(4==i.length)return e.stockPrice=parseFloat(i[1])/parseInt(i[0].slice(1)),e.totalStock=parseInt(i[0].slice(1)),e.holdingAmount=parseInt(i[2]),e.totalEquity=parseFloat(i[1]),e.balance=parseFloat(i[3]),e}return e}(t)):b.push(function(t){let e=new f;return e.message=t,e}(t))}const x=Object.freeze(Object.defineProperty({__proto__:null,decodeMessage:$,get messageObjList(){return b}},Symbol.toStringTag,{value:"Module"}));var S,k={exports:{}};var C=function(){if(S)return k.exports;function t(){}return S=1,t.prototype={on:function(t,e,i){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){var o=this;function n(){o.off(t,n),e.apply(i,arguments)}return n._=e,this.on(t,n,i)},emit:function(t){for(var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),o=0,n=i.length;o<n;o++)i[o].fn.apply(i[o].ctx,e);return this},off:function(t,e){var i=this.e||(this.e={}),o=i[t],n=[];if(o&&e)for(var s=0,r=o.length;s<r;s++)o[s].fn!==e&&o[s].fn._!==e&&n.push(o[s]);return n.length?i[t]=n:delete i[t],this}},k.exports=t,k.exports.TinyEmitter=t,k.exports}();let A=new C.TinyEmitter;const E=Object.freeze(Object.defineProperty({__proto__:null,TinyEmitter:C.TinyEmitter,emitter:A},Symbol.toStringTag,{value:"Module"}));async function O(){for(let i=0;i<30;i++)try{if(null==window.socket.__onmessage&&null!=window.socket._onmessage&&null!=window.socket.send)break;await e(500);continue}catch(t){}null==window.socket.__onmessage&&null!=window.socket._onmessage&&null!=window.socket.send&&(T.originalSend=window.socket.send,window.socket.send=T.send,T.originalOnmessage=window.socket._onmessage,window.socket._onmessage=T.onmessage)}const T={beforeSend:async function(t){return t},originalSend:function(t){return t},afterSend:function(t){return t},send:async function(t){let e=await T.beforeSend(t);try{null!=e&&(T.originalSend(e),T.afterSend(e))}catch(i){}},beforeOnmessage:async function(t){return $(t),t},originalOnmessage:function(t){return t},afterOnmessage:async function(t){for(let e of b)A.emit(e.messageClass,e);return t},onmessage:async function(t){let e=await T.beforeOnmessage(t);try{null!=e&&(T.originalOnmessage(e),T.afterOnmessage(e))}catch(i){}},initSocket:O},P=Object.freeze(Object.defineProperty({__proto__:null,initSocket:O,sockets:T},Symbol.toStringTag,{value:"Module"}));function M(t,e){return"cut"===t?`{0${JSON.stringify({m:t,mc:e,i:Math.random().toString().slice(2,12)})}`:JSON.stringify({m:t,mc:e,i:Math.random().toString().slice(2,12)})}const H=Object.freeze(Object.defineProperty({__proto__:null,danmu:function(t,e,i="0"){return`~{"t":"${t}","c":"${e}","v":${i}}`},hidden:function(t,e,i){return`/<${t}>${e}:${i}`},like:function(t,e=""){return`+*${t}${e}`},musicCard:function(t,e,i,o,n,s){return M(`m__4=${t}>${e}>${i}>${o}>${n}>${s}`,n)},privateChat:function(t,e,i){return JSON.stringify({g:t,m:e,mc:i,i:Math.random().toString().slice(2,12)})},publicChat:M,stockRequest:function(t){return null==t?">#":t>0?`>$${Math.round(Math.abs(t))}`:t<0?`>@${Math.round(Math.abs(t))}`:">#"},videoCard:function(t,e,i,o,n,s,r){return M(`m__4*${t}>${e}>${i}>${o}>${n}>${s}>${r}`,n)},withdrawn:function(t,e=""){return""==e?`v0#${t}`:`v0*${e}#${t}`}},Symbol.toStringTag,{value:"Module"}));let j={movePanelHolder:document.querySelector("#movePanelHolder"),functionHolder:document.querySelector("#functionHolder"),functionButtonGroupList:[...document.querySelectorAll(".functionButton.functionButtonGroup")],msgholderBox:document.querySelector("#msgholder .fullBox.msgholderBox"),homeHolderMsgBox:document.querySelector("#homeHolder .homeHolderMsgContentBox .homeHolderMsgBox.fullBox"),sessionHolderPmTaskBoxItems:[...document.querySelectorAll(".sessionHolderPmTaskBoxItem.whoisTouch2")],moveinputDisplay:document.querySelector("#moveinputDisplay"),moveinput:document.getElementById("moveinput"),moveinputSendBtnFunc:document.querySelector("#moveinputDisplay #moveinputSendBtnFunc"),moveinputSendBtnSend:document.querySelector("#moveinputDisplay #moveinputSendBtnSend")};function z(){j.movePanelHolder=document.querySelector("#movePanelHolder"),j.functionHolder=document.querySelector("#functionHolder"),j.functionButtonGroupList=[...document.querySelectorAll(".functionButton.functionButtonGroup")],j.msgholderBox=document.querySelector("#msgholder .fullBox .fullBox.msgholderBox"),j.homeHolderMsgBox=document.querySelector("#homeHolder .homeHolderMsgContentBox .homeHolderMsgBox.fullBox"),j.sessionHolderPmTaskBoxItems=[...document.querySelectorAll(".sessionHolderPmTaskBoxItem.whoisTouch2")],j.moveinputDisplay=document.querySelector("#moveinputDisplay"),j.moveinput=document.getElementById("moveinput"),j.moveinputSendBtnFunc=document.querySelector("#moveinputDisplay #moveinputSendBtnFunc"),j.moveinputSendBtnSend=document.querySelector("#moveinputDisplay #moveinputSendBtnSend")}let B={elementHooks:{moveinput:{oninputBefore:()=>!0,oninputAfter:()=>!0,onblurBefore:()=>!0,onblurAfter:()=>!0,onfocusBefore:()=>!0,onfocusAfter:()=>!0}},functionHooks:{processer:{onBefore:(t,e,i,o)=>!0,onAfter:(t,e,i,o)=>!0}},replaceMoveinput:()=>{try{let t=j.moveinput.oninput;j.moveinput.oninput=function(){1==B.elementHooks.moveinput.oninputBefore()&&(t?.call(j.moveinput),B.elementHooks.moveinput.oninputAfter())}}catch(t){}try{let t=j.moveinput.oninput;j.moveinput.onblur=function(){1==B.elementHooks.moveinput.onblurBefore()&&(t?.call(j.moveinput),B.elementHooks.moveinput.onblurAfter())}}catch(t){}try{let t=j.moveinput.oninput;j.moveinput.onfocus=function(){1==B.elementHooks.moveinput.onfocusBefore()&&(t?.call(j.moveinput),B.elementHooks.moveinput.onfocusAfter())}}catch(t){}},replaceButtonProcesser:()=>{try{let t=buttonProcesser;buttonProcesser=(e,i,o,n)=>{1==B.functionHooks.processer.onBefore(e,i,o,n)&&(t(e,i,o,n),B.functionHooks.processer.onAfter(e,i,o,n))}}catch(t){}}};function I(){B.replaceMoveinput(),B.replaceButtonProcesser()}const D=Object.freeze(Object.defineProperty({__proto__:null,Hooks:B,elements:j,initHooks:I,refreshAll:z},Symbol.toStringTag,{value:"Module"}));class N{constructor(t,e,i=!0,o=!1){this.name=t,this.url=e,this.enable=i,this.ingected=o}}let U=[];function L(t){if(""==t.name||""==t.url)return _alert("脚本名字或链接不能为空"),!1;for(let e of U){if(e.name===t.name)return e.url=t.url,e.enable=t.enable,e.ingected=t.ingected,!1;if(e.url===t.url)return e.name=t.name,e.enable=t.enable,e.ingected=t.ingected,!1}return U.push(t),!0}function R(t){U=U.filter(e=>e.name!==t.name&&e.url!==t.url)}function q(t){if(t.ingected)return _alert(`脚本 ${t.name} 已经注入`),t.ingected;const e=document.createElement("script");return e.src=t.url,e.onload=()=>{_alert(`脚本 ${t.name} 注入成功`),t.ingected=!0},e.onerror=()=>{_alert(`脚本 ${t.name} 注入失败`),t.enable=!1},document.head.appendChild(e),t.ingected}function V(t){for(let e of t)e.enable&&!e.ingected&&q(e)}function W(){let t=localStorage.getItem("hortiMagicScriptList");U=null==t?[]:JSON.parse(t);for(let e of U)e.ingected=!1}function X(){localStorage.setItem("hortiMagicScriptList",JSON.stringify(U)),_alert("脚本列表已保存")}function F(){W(),V(U)}const J=Object.freeze(Object.defineProperty({__proto__:null,Script:N,addScriptToList:L,ingectlocalScript:F,injectScript:q,injectScriptList:V,readScriptList:W,removeScriptFromList:R,saveScriptList:X,get scriptList(){return U}},Symbol.toStringTag,{value:"Module"})),G=Object.freeze(Object.defineProperty({__proto__:null,Message:v,decoder:x,elements_hooks:D,encoder:H,event_emitter:E,iirose_socket:P,script_tools:J,tools:a},Symbol.toStringTag,{value:"Module"})),Z=globalThis,Y=Z.ShadowRoot&&(void 0===Z.ShadyCSS||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,K=Symbol(),Q=new WeakMap;let tt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==K)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Y&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=Q.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Q.set(e,t))}return t}toString(){return this.cssText}};const et=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new tt(i,t,K)},it=Y?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new tt("string"==typeof t?t:t+"",void 0,K))(e)})(t):t,{is:ot,defineProperty:nt,getOwnPropertyDescriptor:st,getOwnPropertyNames:rt,getOwnPropertySymbols:lt,getPrototypeOf:at}=Object,ct=globalThis,ht=ct.trustedTypes,dt=ht?ht.emptyScript:"",pt=ct.reactiveElementPolyfillSupport,ut=(t,e)=>t,mt={toAttribute(t,e){switch(e){case Boolean:t=t?dt:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(o){i=null}}return i}},gt=(t,e)=>!ot(t,e),ft={attribute:!0,type:String,converter:mt,reflect:!1,useDefault:!1,hasChanged:gt};Symbol.metadata??=Symbol("metadata"),ct.litPropertyMetadata??=new WeakMap;let vt=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ft){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&nt(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:n}=st(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const s=o?.call(this);n?.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ft}static _$Ei(){if(this.hasOwnProperty(ut("elementProperties")))return;const t=at(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ut("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ut("properties"))){const t=this.properties,e=[...rt(t),...lt(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const t=this._$Eu(e,i);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(it(t))}else void 0!==t&&e.push(it(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(Y)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),o=Z.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(void 0!==o&&!0===i.reflect){const n=(void 0!==i.converter?.toAttribute?i.converter:mt).toAttribute(e,i.type);this._$Em=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,e){const i=this.constructor,o=i._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=i.getPropertyOptions(o),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:mt;this._$Em=o;const s=n.fromAttribute(e,t.type);this[o]=s??this._$Ej?.get(o)??s,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const o=this.constructor,n=this[t];if(i??=o.getPropertyOptions(t),!((i.hasChanged??gt)(n,e)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:o,wrapped:n},s){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,s??e??this[t]),!0!==n||void 0!==s)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,i,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};vt.elementStyles=[],vt.shadowRootOptions={mode:"open"},vt[ut("elementProperties")]=new Map,vt[ut("finalized")]=new Map,pt?.({ReactiveElement:vt}),(ct.reactiveElementVersions??=[]).push("2.1.1");const bt=globalThis,yt=bt.trustedTypes,wt=yt?yt.createPolicy("lit-html",{createHTML:t=>t}):void 0,_t="$lit$",$t=`lit$${Math.random().toFixed(9).slice(2)}$`,xt="?"+$t,St=`<${xt}>`,kt=document,Ct=()=>kt.createComment(""),At=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Et=Array.isArray,Ot="[ \t\n\f\r]",Tt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pt=/-->/g,Mt=/>/g,Ht=RegExp(`>|${Ot}(?:([^\\s"'>=/]+)(${Ot}*=${Ot}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),jt=/'/g,zt=/"/g,Bt=/^(?:script|style|textarea|title)$/i,It=(Rt=1,(t,...e)=>({_$litType$:Rt,strings:t,values:e})),Dt=Symbol.for("lit-noChange"),Nt=Symbol.for("lit-nothing"),Ut=new WeakMap,Lt=kt.createTreeWalker(kt,129);var Rt;function qt(t,e){if(!Et(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==wt?wt.createHTML(e):e}class Vt{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,s=0;const r=t.length-1,l=this.parts,[a,c]=((t,e)=>{const i=t.length-1,o=[];let n,s=2===e?"<svg>":3===e?"<math>":"",r=Tt;for(let l=0;l<i;l++){const e=t[l];let i,a,c=-1,h=0;for(;h<e.length&&(r.lastIndex=h,a=r.exec(e),null!==a);)h=r.lastIndex,r===Tt?"!--"===a[1]?r=Pt:void 0!==a[1]?r=Mt:void 0!==a[2]?(Bt.test(a[2])&&(n=RegExp("</"+a[2],"g")),r=Ht):void 0!==a[3]&&(r=Ht):r===Ht?">"===a[0]?(r=n??Tt,c=-1):void 0===a[1]?c=-2:(c=r.lastIndex-a[2].length,i=a[1],r=void 0===a[3]?Ht:'"'===a[3]?zt:jt):r===zt||r===jt?r=Ht:r===Pt||r===Mt?r=Tt:(r=Ht,n=void 0);const d=r===Ht&&t[l+1].startsWith("/>")?" ":"";s+=r===Tt?e+St:c>=0?(o.push(i),e.slice(0,c)+_t+e.slice(c)+$t+d):e+$t+(-2===c?l:d)}return[qt(t,s+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]})(t,e);if(this.el=Vt.createElement(a,i),Lt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=Lt.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(_t)){const e=c[s++],i=o.getAttribute(t).split($t),r=/([.?@])?(.*)/.exec(e);l.push({type:1,index:n,name:r[2],strings:i,ctor:"."===r[1]?Gt:"?"===r[1]?Zt:"@"===r[1]?Yt:Jt}),o.removeAttribute(t)}else t.startsWith($t)&&(l.push({type:6,index:n}),o.removeAttribute(t));if(Bt.test(o.tagName)){const t=o.textContent.split($t),e=t.length-1;if(e>0){o.textContent=yt?yt.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],Ct()),Lt.nextNode(),l.push({type:2,index:++n});o.append(t[e],Ct())}}}else if(8===o.nodeType)if(o.data===xt)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf($t,t+1));)l.push({type:7,index:n}),t+=$t.length-1}n++}}static createElement(t,e){const i=kt.createElement("template");return i.innerHTML=t,i}}function Wt(t,e,i=t,o){if(e===Dt)return e;let n=void 0!==o?i._$Co?.[o]:i._$Cl;const s=At(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),void 0===s?n=void 0:(n=new s(t),n._$AT(t,i,o)),void 0!==o?(i._$Co??=[])[o]=n:i._$Cl=n),void 0!==n&&(e=Wt(t,n._$AS(t,e.values),n,o)),e}class Xt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,o=(t?.creationScope??kt).importNode(e,!0);Lt.currentNode=o;let n=Lt.nextNode(),s=0,r=0,l=i[0];for(;void 0!==l;){if(s===l.index){let e;2===l.type?e=new Ft(n,n.nextSibling,this,t):1===l.type?e=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(e=new Kt(n,this,t)),this._$AV.push(e),l=i[++r]}s!==l?.index&&(n=Lt.nextNode(),s++)}return Lt.currentNode=kt,o}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Ft{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,o){this.type=2,this._$AH=Nt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Wt(this,t,e),At(t)?t===Nt||null==t||""===t?(this._$AH!==Nt&&this._$AR(),this._$AH=Nt):t!==this._$AH&&t!==Dt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>Et(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Nt&&At(this._$AH)?this._$AA.nextSibling.data=t:this.T(kt.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Vt.createElement(qt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new Xt(o,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Ut.get(t.strings);return void 0===e&&Ut.set(t.strings,e=new Vt(t)),e}k(t){Et(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const n of t)o===e.length?e.push(i=new Ft(this.O(Ct()),this.O(Ct()),this,this.options)):i=e[o],i._$AI(n),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Jt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,n){this.type=1,this._$AH=Nt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Nt}_$AI(t,e=this,i,o){const n=this.strings;let s=!1;if(void 0===n)t=Wt(this,t,e,0),s=!At(t)||t!==this._$AH&&t!==Dt,s&&(this._$AH=t);else{const o=t;let r,l;for(t=n[0],r=0;r<n.length-1;r++)l=Wt(this,o[i+r],e,r),l===Dt&&(l=this._$AH[r]),s||=!At(l)||l!==this._$AH[r],l===Nt?t=Nt:t!==Nt&&(t+=(l??"")+n[r+1]),this._$AH[r]=l}s&&!o&&this.j(t)}j(t){t===Nt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Gt extends Jt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Nt?void 0:t}}class Zt extends Jt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Nt)}}class Yt extends Jt{constructor(t,e,i,o,n){super(t,e,i,o,n),this.type=5}_$AI(t,e=this){if((t=Wt(this,t,e,0)??Nt)===Dt)return;const i=this._$AH,o=t===Nt&&i!==Nt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==Nt&&(i===Nt||o);o&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Kt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Wt(this,t)}}const Qt=bt.litHtmlPolyfillSupport;Qt?.(Vt,Ft),(bt.litHtmlVersions??=[]).push("3.3.1");const te=(t,e,i)=>{const o=i?.renderBefore??e;let n=o._$litPart$;if(void 0===n){const t=i?.renderBefore??null;o._$litPart$=n=new Ft(e.insertBefore(Ct(),t),t,void 0,i??{})}return n._$AI(t),n},ee=globalThis;let ie=class extends vt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=te(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Dt}};ie._$litElement$=!0,ie.finalized=!0,ee.litElementHydrateSupport?.({LitElement:ie});const oe=ee.litElementPolyfillSupport;oe?.({LitElement:ie}),(ee.litElementVersions??=[]).push("4.2.1");const ne=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},se={attribute:!0,type:String,converter:mt,reflect:!1,hasChanged:gt},re=(t=se,e,i)=>{const{kind:o,metadata:n}=i;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),s.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const n=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=i;return function(i){const n=this[o];e.call(this,i),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+o)};function le(t){return(e,i)=>"object"==typeof i?re(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}const ae=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function ce(t,e){return(e,i,o)=>ae(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}var he=Object.defineProperty,de=Object.getOwnPropertyDescriptor,pe=(t,e,i,o)=>{for(var n,s=o>1?void 0:o?de(e,i):e,r=t.length-1;r>=0;r--)(n=t[r])&&(s=(o?n(e,i,s):n(s))||s);return o&&s&&he(e,i,s),s};let ue=[],me=99999,ge=class extends ie{constructor(){super(),this.width=320,this.height=490,this.headerBackgroundColor="rgba(66,134,182,0.9)",this.headerColor="rgb(255,255,255)",this.bodyBackgroundColor="rgba(255,255,255,0.7)",this.bodyColor="rgba(23, 23, 23, 0.9)",this.footerBackgroundColor="rgba(255,255,255,0.7)",this.buttonBackgroundColor="rgba(255,255,255,0.9)",this.buttonColor="rgba(66,134,182,0.9)",this.titleContent="面板",this.leftButtonText="按钮1",this.rightButtonText="按钮2",this.isDisplay=!1,this.zIndex=me,this.icon="magic-wand",this.left=(window.innerWidth-this.width)/2,this.top=(window.innerHeight-(this.height+80))/2,this.dragging=!1,ue.push(this),this.zIndex=++me}handleLeftClick(){this.hideMovePanel()}handleRightClick(){this.hideMovePanel()}hideMovePanel(){this.isDisplay=!1,this.dispatchEvent(new CustomEvent("close",{detail:{isDisplay:this.isDisplay,message:"关闭事件"},bubbles:!0,composed:!0}))}showMovePanel(){this.isDisplay=!0,this.dispatchEvent(new CustomEvent("show",{detail:{isDisplay:this.isDisplay},bubbles:!0,composed:!0}))}toogleDisplay(){this.isDisplay?this.hideMovePanel():this.showMovePanel()}mouseDragging(t){let e=this.left,i=this.top,o=t.clientX-e,n=t.clientY-i;0==this.dragging&&(this.dragging=!0),document.onmousemove=t=>{this.dragging&&(this.left=t.clientX-o,this.top=t.clientY-n)},document.onmouseup=()=>{this.dragging&&(this.dragging=!1),document.onmousemove=null}}touchDragging(t){let e=this.left,i=this.top,o=t.touches[0].clientX-e,n=t.touches[0].clientY-i;0==this.dragging&&(this.dragging=!0),document.ontouchmove=t=>{this.dragging&&(this.left=t.touches[0].clientX-o,this.top=t.touches[0].clientY-n)},document.ontouchend=()=>{this.dragging&&(this.dragging=!1),document.onmousemove=null}}putTop(){let t=!1;if(ue.includes(this)){for(let t=0;t<ue.length;t++)ue[t].zIndex>this.zIndex&&(ue[t].zIndex=ue[t].zIndex-1);this.zIndex=me,t=!0}else t=!1;return t}putTopToggel(){this.zIndex!=me?(this.putTop(),this.showMovePanel()):this.toogleDisplay()}render(){return It`
|
|
14
14
|
<div
|
|
@@ -1173,4 +1173,4 @@ hc-s
|
|
|
1173
1173
|
|
|
1174
1174
|
`}}async function Fi(){customElements.define("hm-script-app",Xi);let t=document.createElement("hm-move-panel");t.titleContent="脚本管理",t.icon="js",ki.appendChild(t);let e=It`
|
|
1175
1175
|
<hm-script-app></hm-script-app>
|
|
1176
|
-
`;te(e,await t.body);let i=document.createElement("hm-menu");return i.content="脚本管理",i.isMenuItem=!0,i.icon="js",i.addEventListener("hm-menu-click",function(){t.putTopToggel()}),i}Wi([le({type:String})],Xi.prototype,"scriptName"),Wi([le({type:String})],Xi.prototype,"scriptUrl"),Wi([le({type:Boolean})],Xi.prototype,"scriptEnable"),Wi([le({type:Boolean})],Xi.prototype,"scriptIngected"),Wi([le({type:Boolean})],Xi.prototype,"dialogOpen"),Wi([le({type:Array})],Xi.prototype,"scriptList");const Ji=Object.freeze(Object.defineProperty({__proto__:null,initScriptApp:Fi},Symbol.toStringTag,{value:"Module"})),Gi={name:"hortimagic",private:!1,version:"1.0.
|
|
1176
|
+
`;te(e,await t.body);let i=document.createElement("hm-menu");return i.content="脚本管理",i.isMenuItem=!0,i.icon="js",i.addEventListener("hm-menu-click",function(){t.putTopToggel()}),i}Wi([le({type:String})],Xi.prototype,"scriptName"),Wi([le({type:String})],Xi.prototype,"scriptUrl"),Wi([le({type:Boolean})],Xi.prototype,"scriptEnable"),Wi([le({type:Boolean})],Xi.prototype,"scriptIngected"),Wi([le({type:Boolean})],Xi.prototype,"dialogOpen"),Wi([le({type:Array})],Xi.prototype,"scriptList");const Ji=Object.freeze(Object.defineProperty({__proto__:null,initScriptApp:Fi},Symbol.toStringTag,{value:"Module"})),Gi={name:"hortimagic",private:!1,version:"1.0.3",changelog:"修复了对话框注册较晚的bug,增加了初始化完成的标志",author:"Narlen",description:"园艺魔法,花园插件",keywords:["iirose","plugins","hortimagic"],repository:{type:"git",url:"https://github.com/NarlenHua/hortimagic.git"},license:"MIT",type:"module",scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{lit:"^3.3.1",terser:"^5.44.0","tiny-emitter":"^2.1.0","vite-plugin-dts":"^4.5.4"},devDependencies:{"@types/node":"^24.9.1",typescript:"~5.9.3",vite:"^7.1.7"},main:"dist/Horticraft.life.js",module:"dist/HortiCraft.es.js",typings:"dist/index.d.ts",types:"dist/index.d.ts",files:["dist","src/components","types"]};async function Zi(){try{Oi(),Mi(),await Di(),xi(),Ci(),Ui.normal(Gi.name,"注入网络钩子函数"),await O(),Ui.normal(Gi.name,"注入钩子函数"),z(),I(),Ui.normal(Gi.name,"注入脚本"),F(),Ui.normal(Gi.name,"生成菜单");let t=document.createElement("hm-menu");t.content="HortiMagic",t.isMenuItem=!1,$i.appendChild(t);let e=await Ri(),i=await Fi();t.addEventListener("hm-menu-click",function(){e.flag=t.flag,i.flag=t.flag}),$i.append(t,e,i),Ui.success(Gi.name,`${Gi.version} 已加载`)}catch(t){}}const Yi=Object.freeze(Object.defineProperty({__proto__:null,init:Zi},Symbol.toStringTag,{value:"Module"})),Ki=Object.freeze(Object.defineProperty({__proto__:null,app_tools:Li,dialog_app:Ni,example_app:qi,main_app:Yi,script_app:Ji},Symbol.toStringTag,{value:"Module"})),Qi=Object.freeze(Object.defineProperty({__proto__:null,dialog:Hi,menu:Si,move_panel:Ai,notification:Ti},Symbol.toStringTag,{value:"Module"})),to={name:Gi.name,version:Gi.version,changelog:Gi.changelog,description:Gi.description,author:Gi.author,license:Gi.license,repository:Gi.repository,buildTime:(new Date).toISOString(),ingected:!1};return async function(){await Zi(),to.ingected=!0}(),t.apps=Ki,t.components=_i,t.core=G,t.holders=Qi,t.information=to,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
package/dist/hortimagic.user.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// ==UserScript==
|
|
2
2
|
// @name hortimagic
|
|
3
3
|
// @namespace hortimagic
|
|
4
|
-
// @version 1.0.
|
|
4
|
+
// @version 1.0.3
|
|
5
5
|
// @description 园艺魔法,花园插件
|
|
6
6
|
// @author Narlen
|
|
7
7
|
// @match https://iirose.com/messages.html
|
|
8
8
|
// @grant none
|
|
9
9
|
// @run-at onmessage-end
|
|
10
10
|
// @license MIT
|
|
11
|
-
// @buildtime 2025-10-
|
|
11
|
+
// @buildtime 2025-10-30T16:07:48.858Z
|
|
12
12
|
// ==/UserScript==
|
|
13
13
|
top.window.hortimagic=window.hortimagic=function(t){"use strict";async function e(t){return new Promise(e=>setTimeout(e,t))}function i(t){return t=(t=(t=(t=(t=(t=t.replace("&","&")).replace("<","<")).replace(">",">")).replace('"',""")).replace("'","'")).replace("\\","\")}function o(t){return t=(t=(t=(t=(t=(t=t.replace("<","<")).replace(">",">")).replace(""",'"')).replace("'","'")).replace("\","\\")).replace("&","&")}function n(){return window.myself?window.myself:null}function s(){return window.uid?window.uid:null}function r(){return window.avatar2&&window.avatarconv?window.avatarconv(window.avatar2):null}function l(){return window.inputcolorhex?window.inputcolorhex:null}const a=Object.freeze(Object.defineProperty({__proto__:null,addStyle:function(t){let e=document.createElement("style");e.innerText=t,document.body.append(e)},changeRoom:function(t){(t=String(t))&&window.Objs.mapHolder?.function?.roomchanger(t)},compressCSS:function(t){return t=(t=(t=(t=(t=t.replace(/\s{2,}/g," ")).replace(/\/\*[\s\S]*?\*\//g,"")).replace(/\s*([{};:,])\s*/g,"$1")).replace(/;\s*}/g,"}")).trim()},compressHTML:function(t){return t=(t=(t=(t=t.replace(/>\s+</g,"><")).replace(/\s{2,}/g," ")).replace(/<!--[\s\S]*?-->/g,"")).trim()},generatePrivateMessageBubble:function(t,e,o){window.privatechatfunc&&window.privatechatfunc([Math.floor(Date.now()/1e3).toString(10),s(),i(n()),i(r()),i(e),i(l()),"",i(l()),"","",o,t,"","","","",""].join(">"))},getAllOnlineUserInfo:function(){let t=window.Objs.mapHolder.Assets.userJson;return t?Object.keys(t).map(e=>{let i=t[e];return{name:i[2],uid:i[8],color:i[3],avatar:i[0],roomId:i[4],personalizedSignature:i[6]}}):null},getOnlineUserInfoById:function(t){t=String(t);let e=window.Objs.mapHolder?.function?.findUserByUid?.(t);return e?{name:e[2],uid:t,color:e[3],avatar:e[0],roomId:e[4],personalizedSignature:e[6]}:null},getRoomId:function(){return window.roomn?window.roomn:null},getRoomInfoById:function(t){let e=window.Objs.mapHolder?.Assets?.roomJson?.[t];if(e){let t=e[5].split("&&").map(t=>t.split(" & ")),i=o(t[0][0]),n=i.indexOf(" ");return{name:e[1],color:e[2],roomPath:e[0].split("_"),description:i.slice(n+1),roomImage:i.slice(0,n),currentUserNum:"number"==typeof e[7]?e[7]:"hidden",ownerName:t[1][0],member:t[4].map(t=>({name:o(t.slice(1)),auth:"0"==t[0]?"member":"1"==t[0]?"admin":"unknow"}))}}return null},getUserInputColor:l,getUserName:n,getUserProfilePictureUrl:r,getUserUid:s,htmlSpecialCharsDecode:o,htmlSpecialCharsEscape:i,sleep:e,switchRoom:function(t){window.Objs.mapHolder?.function?.roomchanger&&window.Objs.mapHolder.function.roomchanger(t)}},Symbol.toStringTag,{value:"Module"}));class c{constructor(){this.timeStamp="",this.headPortrait="",this.name="",this.message="",this.color="",this.gender="",this.uid="",this.designation="",this.messageUid="",this.messageClass="public"}}class h{constructor(){this.timeStamp="",this.headPortrait="",this.name="",this.message="",this.color="",this.gender="",this.uid="",this.messageUid="",this.messageClass="private"}}class d{constructor(){this.messageName="",this.uid="",this.data="",this.messageClass="hidden"}}class p{constructor(){this.username="",this.avatar="",this.message="",this.color="",this.gender="",this.timeStamp="",this.uid="",this.messageClass="danmu"}}class u{constructor(){this.privateUID="",this.uid="",this.messageUid="",this.dataUid="",this.messageClass="withdrawn"}}class m{constructor(){this.userMessageList=[],this.messageClass="system"}}class g{constructor(){this.result="",this.stockPrice=NaN,this.totalStock=NaN,this.holdingAmount=NaN,this.totalEquity=NaN,this.balance=NaN,this.messageClass="stock"}}class f{constructor(){this.message="",this.messageClass="unkonw"}}const v=Object.freeze(Object.defineProperty({__proto__:null,Danmu:p,Hidden:d,Private:h,Public:c,Stock:g,System:m,Unkonw:f,Withdrawn:u},Symbol.toStringTag,{value:"Module"}));let b=[];function y(t){let e=new c,i=t.split(">");return e.timeStamp=i[0],e.headPortrait=i[1],e.name=i[2],e.message=i[3],e.color=i[5],e.gender=i[6],e.uid=i[8],e.designation=i[9],e.messageUid=i[10],e}function w(t){let e=new h,i=t.split(">");return e.timeStamp=i[0].slice(1),e.uid=i[1],e.name=i[2],e.headPortrait=i[3],e.message=i[4],e.color=i[5],e.gender=i[8],e.messageUid=i[10],e}function _(t){let e=new p,i=t.split(">");return e.username=i[0],e.message=i[1],e.color=i[2],e.gender=i[4],e.avatar=i[5],e.timeStamp=i[6],e.uid=i[7],e}function $(t){if(b=[],/^"[^"].*/gs.test(t)){let e=t.slice(1).split("<");for(let t=e.length-1;t>=0;t--)b.push(y(e[t]))}else if(/^"".*/gs.test(t)){let e=t.slice(1).split("<");for(let t=e.length-1;t>=0;t--)b.push(w(e[t]))}else if(/^=.*/gs.test(t)){let e=t.slice(1).split("<");for(let t=e.length-1;t>=0;t--)b.push(_(e[t]))}else/^[/]<.*>[0-9|a-z]{13}:.*/gs.test(t)?b.push(function(t){let e,i=new d;return e=t.match(/(?<=^[/]<).*(?=>[0-9|a-z]{13}:.*)/gs),i.messageName=null==e?"":e[0],e=t.match(/(?<=^[/]<.*>)[0-9|a-z]{13}(?=:.*)/gs),i.uid=null==e?"":e[0],e=t.match(/(?<=^[/]<.*>[0-9|a-z]{13}:).*/gs),i.data=null==e?"":e[0],i}(t)):/^v0.*/gs.test(t)?b.push(function(t){let e=new u;return"#"==t[2]?(e.privateUID="",e.uid=t.slice(3,16),e.messageUid=t.slice(17,29),e.dataUid=t.slice(3,29)):(e.privateUID=t.slice(3,16),e.uid=t.slice(17,30),e.messageUid=t.slice(31),e.dataUid=t.slice(17)),e}(t)):/^%\*".*/gs.test(t)?b.push(function(t){let e=new m;return e.userMessageList=t.split("<"),e}(t)):/^>.*/gs.test(t)?b.push(function(t){let e=new g;if(e.result=t[2],"*"==e.result)return e;if(">"==e.result)return e.holdingAmount=parseInt(t.slice(2)),e;if("<"==e.result)return e.balance=parseInt(t.slice(2)),e;{let i=t.split('"');if(5==i.length)return e.stockPrice=parseFloat(i[2]),e.totalStock=parseInt(i[0].slice(1)),e.holdingAmount=parseInt(i[3]),e.totalEquity=parseFloat(i[1]),e.balance=parseFloat(i[4]),e;if(4==i.length)return e.stockPrice=parseFloat(i[1])/parseInt(i[0].slice(1)),e.totalStock=parseInt(i[0].slice(1)),e.holdingAmount=parseInt(i[2]),e.totalEquity=parseFloat(i[1]),e.balance=parseFloat(i[3]),e}return e}(t)):b.push(function(t){let e=new f;return e.message=t,e}(t))}const x=Object.freeze(Object.defineProperty({__proto__:null,decodeMessage:$,get messageObjList(){return b}},Symbol.toStringTag,{value:"Module"}));var S,k={exports:{}};var C=function(){if(S)return k.exports;function t(){}return S=1,t.prototype={on:function(t,e,i){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){var o=this;function n(){o.off(t,n),e.apply(i,arguments)}return n._=e,this.on(t,n,i)},emit:function(t){for(var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),o=0,n=i.length;o<n;o++)i[o].fn.apply(i[o].ctx,e);return this},off:function(t,e){var i=this.e||(this.e={}),o=i[t],n=[];if(o&&e)for(var s=0,r=o.length;s<r;s++)o[s].fn!==e&&o[s].fn._!==e&&n.push(o[s]);return n.length?i[t]=n:delete i[t],this}},k.exports=t,k.exports.TinyEmitter=t,k.exports}();let A=new C.TinyEmitter;const E=Object.freeze(Object.defineProperty({__proto__:null,TinyEmitter:C.TinyEmitter,emitter:A},Symbol.toStringTag,{value:"Module"}));async function O(){for(let i=0;i<30;i++)try{if(null==window.socket.__onmessage&&null!=window.socket._onmessage&&null!=window.socket.send)break;await e(500);continue}catch(t){}null==window.socket.__onmessage&&null!=window.socket._onmessage&&null!=window.socket.send&&(T.originalSend=window.socket.send,window.socket.send=T.send,T.originalOnmessage=window.socket._onmessage,window.socket._onmessage=T.onmessage)}const T={beforeSend:async function(t){return t},originalSend:function(t){return t},afterSend:function(t){return t},send:async function(t){let e=await T.beforeSend(t);try{null!=e&&(T.originalSend(e),T.afterSend(e))}catch(i){}},beforeOnmessage:async function(t){return $(t),t},originalOnmessage:function(t){return t},afterOnmessage:async function(t){for(let e of b)A.emit(e.messageClass,e);return t},onmessage:async function(t){let e=await T.beforeOnmessage(t);try{null!=e&&(T.originalOnmessage(e),T.afterOnmessage(e))}catch(i){}},initSocket:O},P=Object.freeze(Object.defineProperty({__proto__:null,initSocket:O,sockets:T},Symbol.toStringTag,{value:"Module"}));function M(t,e){return"cut"===t?`{0${JSON.stringify({m:t,mc:e,i:Math.random().toString().slice(2,12)})}`:JSON.stringify({m:t,mc:e,i:Math.random().toString().slice(2,12)})}const H=Object.freeze(Object.defineProperty({__proto__:null,danmu:function(t,e,i="0"){return`~{"t":"${t}","c":"${e}","v":${i}}`},hidden:function(t,e,i){return`/<${t}>${e}:${i}`},like:function(t,e=""){return`+*${t}${e}`},musicCard:function(t,e,i,o,n,s){return M(`m__4=${t}>${e}>${i}>${o}>${n}>${s}`,n)},privateChat:function(t,e,i){return JSON.stringify({g:t,m:e,mc:i,i:Math.random().toString().slice(2,12)})},publicChat:M,stockRequest:function(t){return null==t?">#":t>0?`>$${Math.round(Math.abs(t))}`:t<0?`>@${Math.round(Math.abs(t))}`:">#"},videoCard:function(t,e,i,o,n,s,r){return M(`m__4*${t}>${e}>${i}>${o}>${n}>${s}>${r}`,n)},withdrawn:function(t,e=""){return""==e?`v0#${t}`:`v0*${e}#${t}`}},Symbol.toStringTag,{value:"Module"}));let j={movePanelHolder:document.querySelector("#movePanelHolder"),functionHolder:document.querySelector("#functionHolder"),functionButtonGroupList:[...document.querySelectorAll(".functionButton.functionButtonGroup")],msgholderBox:document.querySelector("#msgholder .fullBox.msgholderBox"),homeHolderMsgBox:document.querySelector("#homeHolder .homeHolderMsgContentBox .homeHolderMsgBox.fullBox"),sessionHolderPmTaskBoxItems:[...document.querySelectorAll(".sessionHolderPmTaskBoxItem.whoisTouch2")],moveinputDisplay:document.querySelector("#moveinputDisplay"),moveinput:document.getElementById("moveinput"),moveinputSendBtnFunc:document.querySelector("#moveinputDisplay #moveinputSendBtnFunc"),moveinputSendBtnSend:document.querySelector("#moveinputDisplay #moveinputSendBtnSend")};function z(){j.movePanelHolder=document.querySelector("#movePanelHolder"),j.functionHolder=document.querySelector("#functionHolder"),j.functionButtonGroupList=[...document.querySelectorAll(".functionButton.functionButtonGroup")],j.msgholderBox=document.querySelector("#msgholder .fullBox .fullBox.msgholderBox"),j.homeHolderMsgBox=document.querySelector("#homeHolder .homeHolderMsgContentBox .homeHolderMsgBox.fullBox"),j.sessionHolderPmTaskBoxItems=[...document.querySelectorAll(".sessionHolderPmTaskBoxItem.whoisTouch2")],j.moveinputDisplay=document.querySelector("#moveinputDisplay"),j.moveinput=document.getElementById("moveinput"),j.moveinputSendBtnFunc=document.querySelector("#moveinputDisplay #moveinputSendBtnFunc"),j.moveinputSendBtnSend=document.querySelector("#moveinputDisplay #moveinputSendBtnSend")}let B={elementHooks:{moveinput:{oninputBefore:()=>!0,oninputAfter:()=>!0,onblurBefore:()=>!0,onblurAfter:()=>!0,onfocusBefore:()=>!0,onfocusAfter:()=>!0}},functionHooks:{processer:{onBefore:(t,e,i,o)=>!0,onAfter:(t,e,i,o)=>!0}},replaceMoveinput:()=>{try{let t=j.moveinput.oninput;j.moveinput.oninput=function(){1==B.elementHooks.moveinput.oninputBefore()&&(t?.call(j.moveinput),B.elementHooks.moveinput.oninputAfter())}}catch(t){}try{let t=j.moveinput.oninput;j.moveinput.onblur=function(){1==B.elementHooks.moveinput.onblurBefore()&&(t?.call(j.moveinput),B.elementHooks.moveinput.onblurAfter())}}catch(t){}try{let t=j.moveinput.oninput;j.moveinput.onfocus=function(){1==B.elementHooks.moveinput.onfocusBefore()&&(t?.call(j.moveinput),B.elementHooks.moveinput.onfocusAfter())}}catch(t){}},replaceButtonProcesser:()=>{try{let t=buttonProcesser;buttonProcesser=(e,i,o,n)=>{1==B.functionHooks.processer.onBefore(e,i,o,n)&&(t(e,i,o,n),B.functionHooks.processer.onAfter(e,i,o,n))}}catch(t){}}};function I(){B.replaceMoveinput(),B.replaceButtonProcesser()}const D=Object.freeze(Object.defineProperty({__proto__:null,Hooks:B,elements:j,initHooks:I,refreshAll:z},Symbol.toStringTag,{value:"Module"}));class N{constructor(t,e,i=!0,o=!1){this.name=t,this.url=e,this.enable=i,this.ingected=o}}let U=[];function L(t){if(""==t.name||""==t.url)return _alert("脚本名字或链接不能为空"),!1;for(let e of U){if(e.name===t.name)return e.url=t.url,e.enable=t.enable,e.ingected=t.ingected,!1;if(e.url===t.url)return e.name=t.name,e.enable=t.enable,e.ingected=t.ingected,!1}return U.push(t),!0}function R(t){U=U.filter(e=>e.name!==t.name&&e.url!==t.url)}function q(t){if(t.ingected)return _alert(`脚本 ${t.name} 已经注入`),t.ingected;const e=document.createElement("script");return e.src=t.url,e.onload=()=>{_alert(`脚本 ${t.name} 注入成功`),t.ingected=!0},e.onerror=()=>{_alert(`脚本 ${t.name} 注入失败`),t.enable=!1},document.head.appendChild(e),t.ingected}function V(t){for(let e of t)e.enable&&!e.ingected&&q(e)}function W(){let t=localStorage.getItem("hortiMagicScriptList");U=null==t?[]:JSON.parse(t);for(let e of U)e.ingected=!1}function X(){localStorage.setItem("hortiMagicScriptList",JSON.stringify(U)),_alert("脚本列表已保存")}function F(){W(),V(U)}const J=Object.freeze(Object.defineProperty({__proto__:null,Script:N,addScriptToList:L,ingectlocalScript:F,injectScript:q,injectScriptList:V,readScriptList:W,removeScriptFromList:R,saveScriptList:X,get scriptList(){return U}},Symbol.toStringTag,{value:"Module"})),G=Object.freeze(Object.defineProperty({__proto__:null,Message:v,decoder:x,elements_hooks:D,encoder:H,event_emitter:E,iirose_socket:P,script_tools:J,tools:a},Symbol.toStringTag,{value:"Module"})),Z=globalThis,Y=Z.ShadowRoot&&(void 0===Z.ShadyCSS||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,K=Symbol(),Q=new WeakMap;let tt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==K)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Y&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=Q.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Q.set(e,t))}return t}toString(){return this.cssText}};const et=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new tt(i,t,K)},it=Y?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new tt("string"==typeof t?t:t+"",void 0,K))(e)})(t):t,{is:ot,defineProperty:nt,getOwnPropertyDescriptor:st,getOwnPropertyNames:rt,getOwnPropertySymbols:lt,getPrototypeOf:at}=Object,ct=globalThis,ht=ct.trustedTypes,dt=ht?ht.emptyScript:"",pt=ct.reactiveElementPolyfillSupport,ut=(t,e)=>t,mt={toAttribute(t,e){switch(e){case Boolean:t=t?dt:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(o){i=null}}return i}},gt=(t,e)=>!ot(t,e),ft={attribute:!0,type:String,converter:mt,reflect:!1,useDefault:!1,hasChanged:gt};Symbol.metadata??=Symbol("metadata"),ct.litPropertyMetadata??=new WeakMap;let vt=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ft){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&nt(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:n}=st(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const s=o?.call(this);n?.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ft}static _$Ei(){if(this.hasOwnProperty(ut("elementProperties")))return;const t=at(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ut("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ut("properties"))){const t=this.properties,e=[...rt(t),...lt(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const t=this._$Eu(e,i);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(it(t))}else void 0!==t&&e.push(it(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(Y)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),o=Z.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(void 0!==o&&!0===i.reflect){const n=(void 0!==i.converter?.toAttribute?i.converter:mt).toAttribute(e,i.type);this._$Em=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,e){const i=this.constructor,o=i._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=i.getPropertyOptions(o),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:mt;this._$Em=o;const s=n.fromAttribute(e,t.type);this[o]=s??this._$Ej?.get(o)??s,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const o=this.constructor,n=this[t];if(i??=o.getPropertyOptions(t),!((i.hasChanged??gt)(n,e)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:o,wrapped:n},s){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,s??e??this[t]),!0!==n||void 0!==s)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,i,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};vt.elementStyles=[],vt.shadowRootOptions={mode:"open"},vt[ut("elementProperties")]=new Map,vt[ut("finalized")]=new Map,pt?.({ReactiveElement:vt}),(ct.reactiveElementVersions??=[]).push("2.1.1");const bt=globalThis,yt=bt.trustedTypes,wt=yt?yt.createPolicy("lit-html",{createHTML:t=>t}):void 0,_t="$lit$",$t=`lit$${Math.random().toFixed(9).slice(2)}$`,xt="?"+$t,St=`<${xt}>`,kt=document,Ct=()=>kt.createComment(""),At=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Et=Array.isArray,Ot="[ \t\n\f\r]",Tt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pt=/-->/g,Mt=/>/g,Ht=RegExp(`>|${Ot}(?:([^\\s"'>=/]+)(${Ot}*=${Ot}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),jt=/'/g,zt=/"/g,Bt=/^(?:script|style|textarea|title)$/i,It=(Rt=1,(t,...e)=>({_$litType$:Rt,strings:t,values:e})),Dt=Symbol.for("lit-noChange"),Nt=Symbol.for("lit-nothing"),Ut=new WeakMap,Lt=kt.createTreeWalker(kt,129);var Rt;function qt(t,e){if(!Et(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==wt?wt.createHTML(e):e}class Vt{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,s=0;const r=t.length-1,l=this.parts,[a,c]=((t,e)=>{const i=t.length-1,o=[];let n,s=2===e?"<svg>":3===e?"<math>":"",r=Tt;for(let l=0;l<i;l++){const e=t[l];let i,a,c=-1,h=0;for(;h<e.length&&(r.lastIndex=h,a=r.exec(e),null!==a);)h=r.lastIndex,r===Tt?"!--"===a[1]?r=Pt:void 0!==a[1]?r=Mt:void 0!==a[2]?(Bt.test(a[2])&&(n=RegExp("</"+a[2],"g")),r=Ht):void 0!==a[3]&&(r=Ht):r===Ht?">"===a[0]?(r=n??Tt,c=-1):void 0===a[1]?c=-2:(c=r.lastIndex-a[2].length,i=a[1],r=void 0===a[3]?Ht:'"'===a[3]?zt:jt):r===zt||r===jt?r=Ht:r===Pt||r===Mt?r=Tt:(r=Ht,n=void 0);const d=r===Ht&&t[l+1].startsWith("/>")?" ":"";s+=r===Tt?e+St:c>=0?(o.push(i),e.slice(0,c)+_t+e.slice(c)+$t+d):e+$t+(-2===c?l:d)}return[qt(t,s+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]})(t,e);if(this.el=Vt.createElement(a,i),Lt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=Lt.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(_t)){const e=c[s++],i=o.getAttribute(t).split($t),r=/([.?@])?(.*)/.exec(e);l.push({type:1,index:n,name:r[2],strings:i,ctor:"."===r[1]?Gt:"?"===r[1]?Zt:"@"===r[1]?Yt:Jt}),o.removeAttribute(t)}else t.startsWith($t)&&(l.push({type:6,index:n}),o.removeAttribute(t));if(Bt.test(o.tagName)){const t=o.textContent.split($t),e=t.length-1;if(e>0){o.textContent=yt?yt.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],Ct()),Lt.nextNode(),l.push({type:2,index:++n});o.append(t[e],Ct())}}}else if(8===o.nodeType)if(o.data===xt)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf($t,t+1));)l.push({type:7,index:n}),t+=$t.length-1}n++}}static createElement(t,e){const i=kt.createElement("template");return i.innerHTML=t,i}}function Wt(t,e,i=t,o){if(e===Dt)return e;let n=void 0!==o?i._$Co?.[o]:i._$Cl;const s=At(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),void 0===s?n=void 0:(n=new s(t),n._$AT(t,i,o)),void 0!==o?(i._$Co??=[])[o]=n:i._$Cl=n),void 0!==n&&(e=Wt(t,n._$AS(t,e.values),n,o)),e}class Xt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,o=(t?.creationScope??kt).importNode(e,!0);Lt.currentNode=o;let n=Lt.nextNode(),s=0,r=0,l=i[0];for(;void 0!==l;){if(s===l.index){let e;2===l.type?e=new Ft(n,n.nextSibling,this,t):1===l.type?e=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(e=new Kt(n,this,t)),this._$AV.push(e),l=i[++r]}s!==l?.index&&(n=Lt.nextNode(),s++)}return Lt.currentNode=kt,o}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Ft{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,o){this.type=2,this._$AH=Nt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Wt(this,t,e),At(t)?t===Nt||null==t||""===t?(this._$AH!==Nt&&this._$AR(),this._$AH=Nt):t!==this._$AH&&t!==Dt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>Et(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Nt&&At(this._$AH)?this._$AA.nextSibling.data=t:this.T(kt.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Vt.createElement(qt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new Xt(o,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Ut.get(t.strings);return void 0===e&&Ut.set(t.strings,e=new Vt(t)),e}k(t){Et(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const n of t)o===e.length?e.push(i=new Ft(this.O(Ct()),this.O(Ct()),this,this.options)):i=e[o],i._$AI(n),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Jt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,n){this.type=1,this._$AH=Nt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Nt}_$AI(t,e=this,i,o){const n=this.strings;let s=!1;if(void 0===n)t=Wt(this,t,e,0),s=!At(t)||t!==this._$AH&&t!==Dt,s&&(this._$AH=t);else{const o=t;let r,l;for(t=n[0],r=0;r<n.length-1;r++)l=Wt(this,o[i+r],e,r),l===Dt&&(l=this._$AH[r]),s||=!At(l)||l!==this._$AH[r],l===Nt?t=Nt:t!==Nt&&(t+=(l??"")+n[r+1]),this._$AH[r]=l}s&&!o&&this.j(t)}j(t){t===Nt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Gt extends Jt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Nt?void 0:t}}class Zt extends Jt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Nt)}}class Yt extends Jt{constructor(t,e,i,o,n){super(t,e,i,o,n),this.type=5}_$AI(t,e=this){if((t=Wt(this,t,e,0)??Nt)===Dt)return;const i=this._$AH,o=t===Nt&&i!==Nt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==Nt&&(i===Nt||o);o&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Kt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Wt(this,t)}}const Qt=bt.litHtmlPolyfillSupport;Qt?.(Vt,Ft),(bt.litHtmlVersions??=[]).push("3.3.1");const te=(t,e,i)=>{const o=i?.renderBefore??e;let n=o._$litPart$;if(void 0===n){const t=i?.renderBefore??null;o._$litPart$=n=new Ft(e.insertBefore(Ct(),t),t,void 0,i??{})}return n._$AI(t),n},ee=globalThis;let ie=class extends vt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=te(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Dt}};ie._$litElement$=!0,ie.finalized=!0,ee.litElementHydrateSupport?.({LitElement:ie});const oe=ee.litElementPolyfillSupport;oe?.({LitElement:ie}),(ee.litElementVersions??=[]).push("4.2.1");const ne=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},se={attribute:!0,type:String,converter:mt,reflect:!1,hasChanged:gt},re=(t=se,e,i)=>{const{kind:o,metadata:n}=i;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),s.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const n=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=i;return function(i){const n=this[o];e.call(this,i),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+o)};function le(t){return(e,i)=>"object"==typeof i?re(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}const ae=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function ce(t,e){return(e,i,o)=>ae(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}var he=Object.defineProperty,de=Object.getOwnPropertyDescriptor,pe=(t,e,i,o)=>{for(var n,s=o>1?void 0:o?de(e,i):e,r=t.length-1;r>=0;r--)(n=t[r])&&(s=(o?n(e,i,s):n(s))||s);return o&&s&&he(e,i,s),s};let ue=[],me=99999,ge=class extends ie{constructor(){super(),this.width=320,this.height=490,this.headerBackgroundColor="rgba(66,134,182,0.9)",this.headerColor="rgb(255,255,255)",this.bodyBackgroundColor="rgba(255,255,255,0.7)",this.bodyColor="rgba(23, 23, 23, 0.9)",this.footerBackgroundColor="rgba(255,255,255,0.7)",this.buttonBackgroundColor="rgba(255,255,255,0.9)",this.buttonColor="rgba(66,134,182,0.9)",this.titleContent="面板",this.leftButtonText="按钮1",this.rightButtonText="按钮2",this.isDisplay=!1,this.zIndex=me,this.icon="magic-wand",this.left=(window.innerWidth-this.width)/2,this.top=(window.innerHeight-(this.height+80))/2,this.dragging=!1,ue.push(this),this.zIndex=++me}handleLeftClick(){this.hideMovePanel()}handleRightClick(){this.hideMovePanel()}hideMovePanel(){this.isDisplay=!1,this.dispatchEvent(new CustomEvent("close",{detail:{isDisplay:this.isDisplay,message:"关闭事件"},bubbles:!0,composed:!0}))}showMovePanel(){this.isDisplay=!0,this.dispatchEvent(new CustomEvent("show",{detail:{isDisplay:this.isDisplay},bubbles:!0,composed:!0}))}toogleDisplay(){this.isDisplay?this.hideMovePanel():this.showMovePanel()}mouseDragging(t){let e=this.left,i=this.top,o=t.clientX-e,n=t.clientY-i;0==this.dragging&&(this.dragging=!0),document.onmousemove=t=>{this.dragging&&(this.left=t.clientX-o,this.top=t.clientY-n)},document.onmouseup=()=>{this.dragging&&(this.dragging=!1),document.onmousemove=null}}touchDragging(t){let e=this.left,i=this.top,o=t.touches[0].clientX-e,n=t.touches[0].clientY-i;0==this.dragging&&(this.dragging=!0),document.ontouchmove=t=>{this.dragging&&(this.left=t.touches[0].clientX-o,this.top=t.touches[0].clientY-n)},document.ontouchend=()=>{this.dragging&&(this.dragging=!1),document.onmousemove=null}}putTop(){let t=!1;if(ue.includes(this)){for(let t=0;t<ue.length;t++)ue[t].zIndex>this.zIndex&&(ue[t].zIndex=ue[t].zIndex-1);this.zIndex=me,t=!0}else t=!1;return t}putTopToggel(){this.zIndex!=me?(this.putTop(),this.showMovePanel()):this.toogleDisplay()}render(){return It`
|
|
14
14
|
<div
|
|
@@ -1173,4 +1173,4 @@ hc-s
|
|
|
1173
1173
|
|
|
1174
1174
|
`}}async function Fi(){customElements.define("hm-script-app",Xi);let t=document.createElement("hm-move-panel");t.titleContent="脚本管理",t.icon="js",ki.appendChild(t);let e=It`
|
|
1175
1175
|
<hm-script-app></hm-script-app>
|
|
1176
|
-
`;te(e,await t.body);let i=document.createElement("hm-menu");return i.content="脚本管理",i.isMenuItem=!0,i.icon="js",i.addEventListener("hm-menu-click",function(){t.putTopToggel()}),i}Wi([le({type:String})],Xi.prototype,"scriptName"),Wi([le({type:String})],Xi.prototype,"scriptUrl"),Wi([le({type:Boolean})],Xi.prototype,"scriptEnable"),Wi([le({type:Boolean})],Xi.prototype,"scriptIngected"),Wi([le({type:Boolean})],Xi.prototype,"dialogOpen"),Wi([le({type:Array})],Xi.prototype,"scriptList");const Ji=Object.freeze(Object.defineProperty({__proto__:null,initScriptApp:Fi},Symbol.toStringTag,{value:"Module"})),Gi={name:"hortimagic",private:!1,version:"1.0.
|
|
1176
|
+
`;te(e,await t.body);let i=document.createElement("hm-menu");return i.content="脚本管理",i.isMenuItem=!0,i.icon="js",i.addEventListener("hm-menu-click",function(){t.putTopToggel()}),i}Wi([le({type:String})],Xi.prototype,"scriptName"),Wi([le({type:String})],Xi.prototype,"scriptUrl"),Wi([le({type:Boolean})],Xi.prototype,"scriptEnable"),Wi([le({type:Boolean})],Xi.prototype,"scriptIngected"),Wi([le({type:Boolean})],Xi.prototype,"dialogOpen"),Wi([le({type:Array})],Xi.prototype,"scriptList");const Ji=Object.freeze(Object.defineProperty({__proto__:null,initScriptApp:Fi},Symbol.toStringTag,{value:"Module"})),Gi={name:"hortimagic",private:!1,version:"1.0.3",changelog:"修复了对话框注册较晚的bug,增加了初始化完成的标志",author:"Narlen",description:"园艺魔法,花园插件",keywords:["iirose","plugins","hortimagic"],repository:{type:"git",url:"https://github.com/NarlenHua/hortimagic.git"},license:"MIT",type:"module",scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{lit:"^3.3.1",terser:"^5.44.0","tiny-emitter":"^2.1.0","vite-plugin-dts":"^4.5.4"},devDependencies:{"@types/node":"^24.9.1",typescript:"~5.9.3",vite:"^7.1.7"},main:"dist/Horticraft.life.js",module:"dist/HortiCraft.es.js",typings:"dist/index.d.ts",types:"dist/index.d.ts",files:["dist","src/components","types"]};async function Zi(){try{Oi(),Mi(),await Di(),xi(),Ci(),Ui.normal(Gi.name,"注入网络钩子函数"),await O(),Ui.normal(Gi.name,"注入钩子函数"),z(),I(),Ui.normal(Gi.name,"注入脚本"),F(),Ui.normal(Gi.name,"生成菜单");let t=document.createElement("hm-menu");t.content="HortiMagic",t.isMenuItem=!1,$i.appendChild(t);let e=await Ri(),i=await Fi();t.addEventListener("hm-menu-click",function(){e.flag=t.flag,i.flag=t.flag}),$i.append(t,e,i),Ui.success(Gi.name,`${Gi.version} 已加载`)}catch(t){}}const Yi=Object.freeze(Object.defineProperty({__proto__:null,init:Zi},Symbol.toStringTag,{value:"Module"})),Ki=Object.freeze(Object.defineProperty({__proto__:null,app_tools:Li,dialog_app:Ni,example_app:qi,main_app:Yi,script_app:Ji},Symbol.toStringTag,{value:"Module"})),Qi=Object.freeze(Object.defineProperty({__proto__:null,dialog:Hi,menu:Si,move_panel:Ai,notification:Ti},Symbol.toStringTag,{value:"Module"})),to={name:Gi.name,version:Gi.version,changelog:Gi.changelog,description:Gi.description,author:Gi.author,license:Gi.license,repository:Gi.repository,buildTime:(new Date).toISOString(),ingected:!1};return async function(){await Zi(),to.ingected=!0}(),t.apps=Ki,t.components=_i,t.core=G,t.holders=Qi,t.information=to,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED