mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-11 08:47:23 +08:00
7 lines
14 KiB
JavaScript
7 lines
14 KiB
JavaScript
import{d as D,o as C,c as A,j as g,t as N,F as G,E as J,P as ut,p as B,l as F,_ as z,s as M,h as lt,a7 as ft,a8 as dt,k as $,a9 as Y,I as X,a as V,b as pt}from"./chunks/framework.BcfwU5BI.js";var ht=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yt(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var K={exports:{}};/*!
|
||
* clipboard.js v2.0.11
|
||
* https://clipboardjs.com/
|
||
*
|
||
* Licensed MIT © Zeno Rocha
|
||
*/(function(y,_){(function(w,f){y.exports=f()})(ht,function(){return function(){var T={686:function(r,e,t){t.d(e,{default:function(){return ct}});var c=t(279),u=t.n(c),d=t(370),b=t.n(d),v=t(817),S=t.n(v);function p(s){try{return document.execCommand(s)}catch{return!1}}var m=function(o){var n=S()(o);return p("cut"),n},h=m;function E(s){var o=document.documentElement.getAttribute("dir")==="rtl",n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[o?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(i,"px"),n.setAttribute("readonly",""),n.value=s,n}var U=function(o,n){var i=E(o);n.container.appendChild(i);var a=S()(i);return p("copy"),i.remove(),a},W=function(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},i="";return typeof o=="string"?i=U(o,n):o instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(o==null?void 0:o.type)?i=U(o.value,n):(i=S()(o),p("copy")),i},j=W;function k(s){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(n){return typeof n}:k=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},k(s)}var Z=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=o.action,i=n===void 0?"copy":n,a=o.container,l=o.target,x=o.text;if(i!=="copy"&&i!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(l!==void 0)if(l&&k(l)==="object"&&l.nodeType===1){if(i==="copy"&&l.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(i==="cut"&&(l.hasAttribute("readonly")||l.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(x)return j(x,{container:a});if(l)return i==="cut"?h(l):j(l,{container:a})},q=Z;function O(s){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O=function(n){return typeof n}:O=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},O(s)}function tt(s,o){if(!(s instanceof o))throw new TypeError("Cannot call a class as a function")}function H(s,o){for(var n=0;n<o.length;n++){var i=o[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(s,i.key,i)}}function et(s,o,n){return o&&H(s.prototype,o),n&&H(s,n),s}function nt(s,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(o&&o.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),o&&I(s,o)}function I(s,o){return I=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},I(s,o)}function ot(s){var o=at();return function(){var i=L(s),a;if(o){var l=L(this).constructor;a=Reflect.construct(i,arguments,l)}else a=i.apply(this,arguments);return rt(this,a)}}function rt(s,o){return o&&(O(o)==="object"||typeof o=="function")?o:it(s)}function it(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function at(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function L(s){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},L(s)}function R(s,o){var n="data-clipboard-".concat(s);if(o.hasAttribute(n))return o.getAttribute(n)}var st=function(s){nt(n,s);var o=ot(n);function n(i,a){var l;return tt(this,n),l=o.call(this),l.resolveOptions(a),l.listenClick(i),l}return et(n,[{key:"resolveOptions",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof a.action=="function"?a.action:this.defaultAction,this.target=typeof a.target=="function"?a.target:this.defaultTarget,this.text=typeof a.text=="function"?a.text:this.defaultText,this.container=O(a.container)==="object"?a.container:document.body}},{key:"listenClick",value:function(a){var l=this;this.listener=b()(a,"click",function(x){return l.onClick(x)})}},{key:"onClick",value:function(a){var l=a.delegateTarget||a.currentTarget,x=this.action(l)||"copy",P=q({action:x,container:this.container,target:this.target(l),text:this.text(l)});this.emit(P?"success":"error",{action:x,text:P,trigger:l,clearSelection:function(){l&&l.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(a){return R("action",a)}},{key:"defaultTarget",value:function(a){var l=R("target",a);if(l)return document.querySelector(l)}},{key:"defaultText",value:function(a){return R("text",a)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(a){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return j(a,l)}},{key:"cut",value:function(a){return h(a)}},{key:"isSupported",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],l=typeof a=="string"?[a]:a,x=!!document.queryCommandSupported;return l.forEach(function(P){x=x&&!!document.queryCommandSupported(P)}),x}}]),n}(u()),ct=st},828:function(r){var e=9;if(typeof Element<"u"&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}function c(u,d){for(;u&&u.nodeType!==e;){if(typeof u.matches=="function"&&u.matches(d))return u;u=u.parentNode}}r.exports=c},438:function(r,e,t){var c=t(828);function u(v,S,p,m,h){var E=b.apply(this,arguments);return v.addEventListener(p,E,h),{destroy:function(){v.removeEventListener(p,E,h)}}}function d(v,S,p,m,h){return typeof v.addEventListener=="function"?u.apply(null,arguments):typeof p=="function"?u.bind(null,document).apply(null,arguments):(typeof v=="string"&&(v=document.querySelectorAll(v)),Array.prototype.map.call(v,function(E){return u(E,S,p,m,h)}))}function b(v,S,p,m){return function(h){h.delegateTarget=c(h.target,S),h.delegateTarget&&m.call(v,h)}}r.exports=d},879:function(r,e){e.node=function(t){return t!==void 0&&t instanceof HTMLElement&&t.nodeType===1},e.nodeList=function(t){var c=Object.prototype.toString.call(t);return t!==void 0&&(c==="[object NodeList]"||c==="[object HTMLCollection]")&&"length"in t&&(t.length===0||e.node(t[0]))},e.string=function(t){return typeof t=="string"||t instanceof String},e.fn=function(t){var c=Object.prototype.toString.call(t);return c==="[object Function]"}},370:function(r,e,t){var c=t(879),u=t(438);function d(p,m,h){if(!p&&!m&&!h)throw new Error("Missing required arguments");if(!c.string(m))throw new TypeError("Second argument must be a String");if(!c.fn(h))throw new TypeError("Third argument must be a Function");if(c.node(p))return b(p,m,h);if(c.nodeList(p))return v(p,m,h);if(c.string(p))return S(p,m,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function b(p,m,h){return p.addEventListener(m,h),{destroy:function(){p.removeEventListener(m,h)}}}function v(p,m,h){return Array.prototype.forEach.call(p,function(E){E.addEventListener(m,h)}),{destroy:function(){Array.prototype.forEach.call(p,function(E){E.removeEventListener(m,h)})}}}function S(p,m,h){return u(document.body,p,m,h)}r.exports=d},817:function(r){function e(t){var c;if(t.nodeName==="SELECT")t.focus(),c=t.value;else if(t.nodeName==="INPUT"||t.nodeName==="TEXTAREA"){var u=t.hasAttribute("readonly");u||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),u||t.removeAttribute("readonly"),c=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var d=window.getSelection(),b=document.createRange();b.selectNodeContents(t),d.removeAllRanges(),d.addRange(b),c=d.toString()}return c}r.exports=e},279:function(r){function e(){}e.prototype={on:function(t,c,u){var d=this.e||(this.e={});return(d[t]||(d[t]=[])).push({fn:c,ctx:u}),this},once:function(t,c,u){var d=this;function b(){d.off(t,b),c.apply(u,arguments)}return b._=c,this.on(t,b,u)},emit:function(t){var c=[].slice.call(arguments,1),u=((this.e||(this.e={}))[t]||[]).slice(),d=0,b=u.length;for(d;d<b;d++)u[d].fn.apply(u[d].ctx,c);return this},off:function(t,c){var u=this.e||(this.e={}),d=u[t],b=[];if(d&&c)for(var v=0,S=d.length;v<S;v++)d[v].fn!==c&&d[v].fn._!==c&&b.push(d[v]);return b.length?u[t]=b:delete u[t],this}},r.exports=e,r.exports.TinyEmitter=e}},w={};function f(r){if(w[r])return w[r].exports;var e=w[r]={exports:{}};return T[r](e,e.exports,f),e.exports}return function(){f.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return f.d(e,{a:e}),e}}(),function(){f.d=function(r,e){for(var t in e)f.o(e,t)&&!f.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}}(),function(){f.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)}}(),f(686)}().default})})(K);var vt=K.exports;const mt=yt(vt),gt=y=>(B("data-v-47fec8ad"),y=y(),F(),y),_t={class:"item-card"},bt={class:"item-name"},wt={class:"item-description"},St={class:"tags"},xt={class:"item-bar"},Et=["href"],Tt=gt(()=>g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},[g("path",{fill:"currentColor",d:"m7.775 3.275l1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0a.751.751 0 0 1 .018-1.042a.751.751 0 0 1 1.042-.018a1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018a.751.751 0 0 1-.018-1.042m-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018a.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0a.751.751 0 0 1-.018 1.042a.751.751 0 0 1-1.042.018a1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83"})],-1)),Ct=[Tt],At={class:"btn"},Ot=["href"],kt=["src"],Lt={class:"author-name"},Pt=D({__name:"PluginItemCard",props:{item:Object},setup(y){const _=y,T=()=>{const f=new mt(".copy-btn",{text:()=>`npm install ${_.item.module_name}`});f.on("success",()=>{}),f.on("error",()=>{})},w=f=>{const r=f.replace(/^#/,""),[e,t,c]=r.match(/.{2}/g).map(d=>parseInt(d,16)),u=(e*299+t*587+c*114)/1e3;return{backgroundColor:f,color:u>128?"#000":"#fff"}};return(f,r)=>(C(),A("div",_t,[g("div",bt,N(_.item.name),1),g("div",wt,N(_.item.desc),1),g("div",St,[(C(!0),A(G,null,J(_.item.tags,e=>(C(),A("span",{class:"tag",key:e,style:ut(w(e.color))},N(e.label),5))),128))]),g("div",xt,[g("a",{href:_.item.homepage,class:"btn"},Ct,8,Et),g("button",{class:"btn copy-btn",onClick:T},"复制安装命令"),g("div",At,[g("a",{class:"author-info",href:`https://github.com/${_.item.author}`},[g("img",{class:"icon avatar",src:`https://github.com/${_.item.author}.png?size=80`,alt:""},null,8,kt),g("div",Lt,N(_.item.author),1)],8,Ot)])])]))}}),Nt=z(Pt,[["__scopeId","data-v-47fec8ad"]]),jt=y=>(B("data-v-b3db11d1"),y=y(),F(),y),It={class:"switch"},Rt=["checked"],Mt=jt(()=>g("span",{class:"slider round"},null,-1)),$t=D({__name:"ToggleSwitch",props:{modelValue:Boolean},emits:["update:modelValue"],setup(y,{emit:_}){const T=_,w=f=>{T("update:modelValue",f)};return(f,r)=>(C(),A("label",It,[g("input",{type:"checkbox",checked:y.modelValue,onChange:r[0]||(r[0]=e=>w(e.target.checked))},null,40,Rt),Mt]))}}),Vt=z($t,[["__scopeId","data-v-b3db11d1"]]),Q=y=>(B("data-v-a647bdd1"),y=y(),F(),y),Dt={class:"market"},Bt=Q(()=>g("h1",null,"插件商店",-1)),Ft=Q(()=>g("p",null,[V("内容来自轻雪商店及"),g("a",{href:"https://nonebot.dev/store/plugins"},"NoneBot插件商店"),V(",轻雪通过nonebot插件实现兼容NoneBot,在此仅作引用,具体请访问NoneBot插件商店")],-1)),zt={class:"search-box-div"},Ut={class:"items"},Ht=D({__name:"PluginStore",setup(y){let _=M(!1),T=lt(()=>{let r=w.value;return f.value&&(r=r.filter(e=>e.name.toLowerCase().includes(f.value.toLowerCase())||e.desc.toLowerCase().includes(f.value.toLowerCase())||e.author.toLowerCase().includes(f.value.toLowerCase())||e.module_name.toLowerCase().includes(f.value.toLowerCase()))),_.value&&(r=r.filter(e=>e.is_liteyuki_plugin)),r}),w=M([]),f=M("");return fetch("/plugins.json").then(r=>r.json()).then(r=>{r.forEach(e=>{e.is_liteyuki_plugin=!0}),w.value=r}).catch(r=>console.error(r)),fetch("https://registry.nonebot.dev/plugins.json").then(r=>r.json()).then(r=>{r.forEach(e=>{e.is_official=!1}),w.value=w.value.concat(r)}),(r,e)=>(C(),A("div",Dt,[Bt,Ft,g("div",zt,[ft(g("input",{class:"item-search-box",type:"text",placeholder:"搜索插件","onUpdate:modelValue":e[0]||(e[0]=t=>Y(f)?f.value=t:f=t)},null,512),[[dt,$(f)]]),X(Vt,{modelValue:$(_),"onUpdate:modelValue":e[1]||(e[1]=t=>Y(_)?_.value=t:_=t)},null,8,["modelValue"]),V("仅轻雪插件 ")]),g("div",Ut,[(C(!0),A(G,null,J($(T),t=>(C(),pt(Nt,{key:t.id,item:t},null,8,["item"]))),128))])]))}}),Yt=z(Ht,[["__scopeId","data-v-a647bdd1"]]),Kt=JSON.parse('{"title":"插件商店","description":"","frontmatter":{"title":"插件商店","order":2},"headers":[],"relativePath":"store/plugin.md","filePath":"zh/store/plugin.md","lastUpdated":1725112258000}'),Gt={name:"store/plugin.md"},Qt=Object.assign(Gt,{setup(y){return(_,T)=>(C(),A("div",null,[X(Yt)]))}});export{Kt as __pageData,Qt as default};
|