This commit is contained in:
1 parent
b9655a5ab1
commit
e292824161
122 files changed
+90002
-69
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import{r as Q,j as g}from"./react-vendor-jWT2yUdV.js";import{u as yr,k as Qt,c as Ye,b as ge,O as zi,Q as ji,R as Ni,S as Li,s as kr,T as Di,aI as _i}from"./index-DiaaLdUu.js";import{i as Fi}from"./chunk-2QAN2V2R-B2qCPZrG.js";import{t as Ri,a as Mi}from"./chunk-ML27DD5T-ZFWrMOn-.js";import{t as Xe}from"./chunk-6LIX6LVT-B246pOuK.js";import{p as Oi}from"./chunk-APIAPHLK-nGgOe_Nr.js";import{z as Ce}from"./react-hot-toast-cGcFZPSt.js";import{g as Yt,h as In,i as An,a as Bi,j as $i,e as Hi}from"./index-DvErMbt6.js";import{k as Xt}from"./index-BBhZPeTB.js";import{a as br}from"./chunk-SXMLSBOY-NckgDZ9w.js";import{a as Ui,c as Vi}from"./chunk-5PILOUBS-KHYNqMZE.js";import{c as qi}from"./chunk-TE6SZS6W-DGowl7ka.js";import{c as De}from"./chunk-NAV3ZXLI-ChbUTMf0.js";import{u as wr,v as Wi}from"./index-DE7yoXMZ.js";import{E as Qi}from"./empty_state-BmDJmEaB.js";import{P as Tt}from"./plugin_manager-OIjldREQ.js";import{M as Pn}from"./mirror_selector_modal-CyjkhfUx.js";import{g as Sr}from"./qface-BZLvZXJ8.js";import{u as Yi}from"./use-dialog-CRIMuzeE.js";import{c as Xi}from"./react-router-dom-C6k78GT4.js";import"./chunk-SLABUSGS-Cmz8sGrU.js";import"./useFocusable-DA5Croun.js";import"./chunk-M3MASYO7-B4fjH-eW.js";import"./index-BV9-YCKp.js";import"./chunk-UX7UMZL5-CMHjUaC_.js";import"./SelectionManager-Dl9uHsLK.js";import"./usePress-BrNwsdVw.js";import"./layout-Buao20KT.js";import"./gestures-BHfQC-M8.js";import"./features-animation-BkV7kg8P.js";import"./Item-D8Sud-UP.js";import"./chunk-WQVQ7P2I-BJd1EiqP.js";import"./useHover-DC1o5-bm.js";import"./chunk-RJKRL3AU-CjtrMR1U.js";import"./iconBase-B7bT1FlI.js";import"./index-BsnVex0g.js";function Gi(e,n){if(n)try{const t=new URL(n);if(t.hostname==="github.com"||t.hostname==="www.github.com"){const r=t.pathname.split("/").filter(Boolean);if(r.length>=1)return`https://github.com/${r[0]}.png`}}catch{}if(e)try{const t=new URL(e);if(t.hostname==="github.com"||t.hostname==="www.github.com"){const r=t.pathname.split("/").filter(Boolean);if(r.length>=1)return`https://github.com/${r[0]}.png`}else return`https://api.iowen.cn/favicon/${t.hostname}.png`}catch{}}const Ki=({data:e,onInstall:n,onViewDetail:t,installStatus:r="not-installed",installedVersion:i})=>{const{name:o,version:l,author:a,description:s,tags:u,homepage:f,downloadUrl:c}=e,[p]=yr(Qt.backgroundImage,""),[h,x]=Q.useState(!1),C=!!p,w=Gi(f,c)||`https://avatar.vercel.sh/${encodeURIComponent(o)}`,y=g.jsx("span",{className:Ye("font-medium transition-colors",f?"hover:text-primary hover:underline cursor-pointer":""),children:a||"未知作者"});return g.jsxs(Ui,{className:Ye("group w-full backdrop-blur-xl rounded-2xl overflow-hidden transition-all duration-300","hover:shadow-lg hover:shadow-primary-500/10 hover:-translate-y-0.5","border border-white/60 dark:border-white/10 hover:border-primary/40",C?"bg-black/25 dark:bg-black/30":"bg-white/65 dark:bg-white/[0.04]"),shadow:"none",children:[g.jsxs(Vi,{className:Ye("p-4 flex flex-col gap-3",t&&"cursor-pointer"),onClick:t,children:[g.jsxs("div",{className:"flex items-start gap-3",children:[g.jsx(br,{src:w,name:a||"?",size:"md",isBordered:!0,color:"default",radius:"full",className:"flex-shrink-0 transition-transform group-hover:scale-105"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"flex items-center justify-between",children:g.jsx("div",{className:"flex items-center gap-1.5 min-w-0",children:f?g.jsx(Xe,{content:"访问项目主页",placement:"top",delay:500,children:g.jsx("a",{href:f,target:"_blank",rel:"noreferrer",className:"text-base font-bold text-default-900 hover:text-primary transition-colors truncate",onClick:v=>v.stopPropagation(),children:o})}):g.jsx("h3",{className:"text-base font-bold text-default-900 truncate",title:o,children:o})})}),g.jsxs("div",{className:"text-xs text-default-500 mt-0.5 truncate",children:["by ",f?g.jsx("a",{href:f,target:"_blank",rel:"noreferrer",onClick:v=>v.stopPropagation(),children:y}):y]})]})]}),g.jsx("div",{className:"relative min-h-[2.5rem] cursor-pointer group/desc",onClick:()=>x(!h),children:g.jsx(Xe,{content:s,isDisabled:!s||s.length<50||h,placement:"bottom",className:"max-w-[280px]",delay:500,children:g.jsx("p",{className:Ye("text-sm text-default-600 dark:text-default-400 leading-relaxed transition-all duration-300",h?"line-clamp-none":"line-clamp-2"),children:s||"暂无描述"})})}),g.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[g.jsxs(De,{size:"sm",variant:"flat",color:"primary",className:"h-5 text-xs font-semibold px-0.5",classNames:{content:"px-1"},children:["v",l]}),u==null?void 0:u.slice(0,2).map(v=>g.jsx(De,{size:"sm",variant:"flat",className:"h-5 text-xs px-0.5 bg-default-100 dark:bg-default-50/50 text-default-600",classNames:{content:"px-1"},children:v},v)),u&&u.length>2&&g.jsx(Xe,{content:g.jsx("div",{className:"flex flex-wrap gap-1 max-w-[200px] p-1",children:u.map(v=>g.jsx("span",{className:"text-xs bg-white/10 px-1.5 py-0.5 rounded-md border border-white/10",children:v},v))Line truncated
|
||||
`,u="/",f="*",c="",p="comment",h="declaration";function x(w,y){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];y=y||{};var v=1,E=1;function D(j){var P=j.match(n);P&&(v+=P.length);var W=j.lastIndexOf(s);E=~W?j.length-W:E+j.length}function F(){var j={line:v,column:E};return function(P){return P.position=new b(j),B(),P}}function b(j){this.start=j,this.end={line:v,column:E},this.source=y.source}b.prototype.content=w;function _(j){var P=new Error(y.source+":"+v+":"+E+": "+j);if(P.reason=j,P.filename=y.source,P.line=v,P.column=E,P.source=w,!y.silent)throw P}function U(j){var P=j.exec(w);if(P){var W=P[0];return D(W),w=w.slice(W.length),P}}function B(){U(t)}function k(j){var P;for(j=j||[];P=T();)P!==!1&&j.push(P);return j}function T(){var j=F();if(!(u!=w.charAt(0)||f!=w.charAt(1))){for(var P=2;c!=w.charAt(P)&&(f!=w.charAt(P)||u!=w.charAt(P+1));)++P;if(P+=2,c===w.charAt(P-1))return _("End of comment missing");var W=w.slice(2,P-2);return E+=2,D(W),w=w.slice(P),E+=2,j({type:p,comment:W})}}function z(){var j=F(),P=U(r);if(P){if(T(),!U(i))return _("property missing ':'");var W=U(o),ee=j({type:h,property:C(P[0].replace(e,c)),value:W?C(W[0].replace(e,c)):c});return U(l),ee}}function q(){var j=[];k(j);for(var P;P=z();)P!==!1&&(j.push(P),k(j));return j}return B(),q()}function C(w){return w?w.replace(a,c):c}return jt=x,jt}var Dn;function gl(){if(Dn)return qe;Dn=1;var e=qe&&qe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qe,"__esModule",{value:!0}),qe.default=t;const n=e(dl());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:f}=s;a?i(u,f,s):f&&(o=o||{},o[u]=f)}),o}return qe}var nt={},_n;function xl(){if(_n)return nt;_n=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||t.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},a=function(u,f){return"".concat(f,"-")},s=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(n,l))};return nt.camelCase=s,nt}var rt,Fn;function yl(){if(Fn)return rt;Fn=1;var e=rt&&rt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(gl()),t=xl();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,s){a&&s&&(l[(0,t.camelCase)(a,o)]=s)}),l}return r.default=r,rt=r,rt}var kl=yl();const bl=Sr(kl),zr=jr("end"),cn=jr("start");function jr(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function wl(e){const n=cn(e),t=zr(e);if(n&&t)return{start:n,end:t}}function ot(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rn(e.position):"start"in e||"end"in e?Rn(e):"line"in e||"column"in e?Zt(e):""}function Zt(e){return Mn(e&&e.line)+":"+Mn(e&&e.column)}function Rn(e){return Zt(e&&e.start)+"-"+Zt(e&&e.end)}function Mn(e){return e&&typeof e=="number"?e:1}class ie extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=ot(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ie.prototype.file="";ie.prototype.name="";ie.prototype.reason="";ie.prototype.message="";ie.prototype.stack="";ie.prototype.column=void 0;ie.prototype.line=void 0;ie.prototype.ancestors=void 0;ie.prototype.cause=void 0;ie.prototype.fatal=void 0;ie.prototype.place=void 0;ie.prototype.ruleId=void 0;ie.prototype.source=void 0;const fn={}.hasOwnProperty,Sl=new Map,Cl=/[A-Z]/g,vl=new Set(["table","tbody","thead","tfoot","tr"]),El=new Set(["td","th"]),Nr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Il(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n
Line truncated
|
||||
`;break}case-3:{l=`\r
|
||||
`;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function _a(e){const r={constructs:Rr([ja,...(e||{}).extensions||[]]),content:i(Xl),defined:[],document:i(Kl),flow:i(ga),lazy:{},string:i(ka),text:i(ba)};return r;function i(o){return l;function l(a){return Na(r,o,a)}}}function Fa(e){for(;!Hr(e););return e}const Yn=/[\0\t\n\r]/g;function Ra(){let e=1,n="",t=!0,r;return i;function i(o,l,a){const s=[];let u,f,c,p,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(Yn.lastIndex=c,u=Yn.exec(o),p=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(p),!u){n=o.slice(c);break}if(h===10&&c===p&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<p&&(s.push(o.slice(c,p)),e+=p-c),h){case 0:{s.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,s.push(-2);e++<f;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const Ma=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Oa(e){return e.replace(Ma,Ba)}function Ba(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return Mr(t.slice(o?2:1),o?16:10)}return dn(t)||e}const Yr={}.hasOwnProperty;function $a(e,n,t){return typeof n!="string"&&(t=n,n=void 0),Ha(t)(Fa(_a(t).document().write(Ra()(e,n,!0))))}function Ha(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ne),autolinkProtocol:B,autolinkEmail:B,atxHeading:o($),blockQuote:o(je),characterEscape:B,characterReference:B,codeFenced:o(He),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(He,l),codeText:o(Pt,l),codeTextData:B,data:B,codeFlowValue:B,definition:o(N),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Y),hardBreakEscape:o(J),hardBreakTrailing:o(J),htmlFlow:o(be,l),htmlFlowData:B,htmlText:o(be,l),htmlTextData:B,image:o(Re),label:l,link:o(Ne),listItem:o(Z),listItemValue:p,listOrdered:o(Ue,c),listUnordered:o(Ue),paragraph:o(he),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o($),strong:o(Ai),thematicBreak:o(Ti)},exit:{atxHeading:s(),atxHeadingSequence:F,autolink:s(),autolinkEmail:ze,autolinkProtocol:ke,blockQuote:s(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:ne,characterReference:Fe,codeFenced:s(w),codeFencedFence:C,codeFencedFenceInfo:h,codeFencedFenceMeta:x,codeFlowValue:k,codeIndented:s(y),codeText:s(P),codeTextData:k,data:k,definition:s(),definitionDestinationString:D,definitionLabelString:v,definitionTitleString:E,emphasis:s(),hardBreakEscape:s(z),hardBreakTrailing:s(z),htmlFlow:s(q),htmlFlowData:k,htmlText:s(j),htmlTextData:k,image:s(ee),label:fe,labelText:le,lineEnding:T,link:s(W),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:se,resourceDestinationString:m,resourceTitleString:oe,resource:ye,setextHeading:s(U),setextHeadingLineSequence:_,setextHeadingText:b,strong:s(),thematicBreak:s()}};Xr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(S){let A={type:"root",children:[]};const R={stack:[A],tokenStack:[],config:n,enter:a,exit:u,buffer:l,resume:f,data:t},H=[];let X=-1;for(;++X<S.length;)if(S[X][1].type==="listOrdered"||S[X][1].type==="listUnordered")if(S[X][0]==="enter")H.push(X);else{const we=H.pop();X=i(S,we,X)}for(X=-1;++X<S.length;){const we=n[S[X][0]];Yr.call(we,S[X][1].type)&&we[S[X][1].type].call(Object.assign({sliceSerialize:S[X][2].sliceSerialize},R),S[X][1])}if(R.tokenStack.length>0){const we=R.tokenStack[R.tokenStack.length-1];(we[1]||Xn).call(R,void 0,we[0])}for(A.position={start:Le(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:Le(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},X=-1;++X<n.transforms.length;)A=n.transforms[X](A)||A;return A}function i(S,A,R){let H=A-1,X=-1,we=!1,Me,Ae,et,tt;for(;++H<=R;){const pe=S[H];switch(pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pe[0]==="enter"?X++:X--,tt=void 0;break}case"lineEndingBlank":{pe[0]==="enter"&&(Me&&!tt&&!X&&!et&&(et=H),tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tt=void 0}if(!X&&pe[0]==="enter"&&pe[1].type==="listItemPrefix"||X===-1&&pe[0]==="exit"&&(pe[1].type==="listUnordered"||pe[1].type==="listOrdered")){if(Me){let Ve=H;for(Ae=void 0;Ve--;){const Pe=S[Ve];if(Pe[1].type==="lineEnding"||Pe[1].type==="lineEndingBlank"){if(Pe[0]==="exit")continue;Ae&&(S[Ae][1].type="lineEndingBlank",we=!0),Pe[1].type="lineEnding",Ae=Ve}else if(!(Pe[1].type==="linePrefix"||Pe[1].type==="blockQuotePrefix"||Pe[1].type==="blockQuotePrefixWhitespace"||Pe[1].type==="blockQuoteMarker"||Pe[1].type==="listItemIndent"))break}etLine truncated
|
||||
`}]}function Qa(e,n){const t=n.value?n.value+`
|
||||
`:"",r={};n.lang&&(r.className=["language-"+n.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Ya(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Xa(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ga(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Ze(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(n,u),e.applyData(n,u)}function Ka(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ja(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Gr(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function Za(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Gr(e,n);const i={src:Ze(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function es(e,n){const t={src:Ze(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function ts(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function ns(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Gr(e,n);const i={href:Ze(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function rs(e,n){const t={href:Ze(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function is(e,n,t){const r=e.all(n),i=t?ls(t):Kr(n),o={},l=[];if(typeof n.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
||||
`}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const s=r[r.length-1];s&&(i||s.type!=="element"||s.tagName!=="p")&&l.push({type:"text",value:`
|
||||
`});const u={type:"element",tagName:"li",properties:o,children:l};return e.patch(n,u),e.applyData(n,u)}function ls(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r<t.length;)n=Kr(t[r])}return n}function Kr(e){const n=e.spread;return n??e.children.length>1}function os(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function as(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ss(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function us(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function cs(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=cn(n.children[1]),s=zr(n.children[n.children.length-1]);a&&s&&(l.position={start:a,end:s}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function fs(e,n,t){const r=t?t.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,a=l?l.length:n.children.length;let s=-1;const u=[];for(;++s<a;){const c=n.children[s],p={},h=l?l[s]:void 0;h&&(p.align=h);let x={type:"element",tagName:o,properties:p,children:[]};c&&(x.children=e.all(c),e.patch(c,x),x=e.applyData(c,x)),u.push(x)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,f),e.applyData(n,f)}function hs(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const Gn=9,Kn=32;function ps(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const o=[];for(;r;)o.push(Jn(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return o.push(Jn(n.slice(i),i>0,!1)),o.join("")}function Jn(e,n,t){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===Gn||o===Kn;)r++,o=e.codePointAt(r)}if(t){let o=e.codePointAt(i-1);for(;o===Gn||o===Kn;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ms(e,n){const t={type:"text",value:ps(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function ds(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const gs={blockquote:qa,break:Wa,code:Qa,delete:Ya,emphasis:Xa,footnoteReference:Ga,heading:Ka,html:Ja,imageReference:Za,image:es,inlineCode:ts,linkReference:ns,link:rs,listItem:is,list:os,paragraph:as,root:ss,strong:us,table:cs,tableCell:hs,tableRow:fs,text:ms,thematicBreak:ds,toml:mt,yaml:mt,definition:mt,footnoteDefinition:mt};function mt(){}const Jr=-1,Et=0,st=1,bt=2,xn=3,yn=4,kn=5,bn=6,Zr=7,ei=8,Zn=typeof self=="object"?self:globalThis,xs=(e,n)=>{const t=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=n[i];switch(o){case Et:case Jr:return t(l,i);case st:{const a=t([],i);for(const s of l)a.push(r(s));return a}case bt:{const a=t({},i);for(const[s,u]of l)a[r(s)]=r(u);return a}case xn:return t(new Date(l),i);case yn:{const{source:a,flags:s}=l;return t(new RegExp(a,s),i)}case kn:{const a=t(new Map,i);for(const[s,u]of l)a.set(r(s),r(u));return a}case bn:{const a=t(new Set,i);for(const s of l)a.add(r(s));return a}case Zr:{const{name:a,message:s}=l;return t(new Zn[a](s),i)}case ei:return t(BigInt(l),i);case"BigInt":return t(Object(BigInt(l)),i);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:a}=new Uint8Array(l);return t(new DataView(a),l)}}return t(new Zn[o](l),i)};return r},er=e=>xs(new Map,e)(0),We="",{toString:ys}={},{keys:ks}=Object,lt=e=>{const n=typeof e;if(n!=="object"||!e)return[Et,n];const t=ys.call(e).slice(8,-1);switch(t){case"Array":return[st,We];case"Object":return[bt,We];case"Date":return[xn,We];case"RegExp":return[yn,We];case"Map":return[kn,We];case"Set":return[bn,We];case"DataView":return[st,t]}return t.includes("Array")?[st,t]:t.includes("Error")?[Zr,t]:[bt,t]},dt=([e,n])=>e===Et&&(n==="function"||n==="symbol"),bs=(e,n,t,r)=>{const i=(l,a)=>{const s=r.push(l)-1;return t.set(a,s),s},o=l=>{if(t.has(l))return t.get(l);let[a,s]=lt(l);switch(a){case Et:{let f=l;switch(s){case"bigint":a=ei,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);f=null;break;case"undefined":return i([Jr],l)}return i([a,f],l)}case st:{if(s){let p=l;return s==="DataView"?p=new Uint8Array(l.buffer):s==="ArrayBuffer"&&(p=new Uint8Array(
Line truncated
|
||||
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
||||
`}]}}const It=(function(e){if(e==null)return As;if(typeof e=="function")return At(e);if(typeof e=="object")return Array.isArray(e)?vs(e):Es(e);if(typeof e=="string")return Is(e);throw new Error("Expected function, string, or object as test")});function vs(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=It(e[t]);return At(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function Es(e){const n=e;return At(t);function t(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function Is(e){return At(n);function n(t){return t&&t.type===e}}function At(e){return n;function n(t,r,i){return!!(Ps(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function As(){return!0}function Ps(e){return e!==null&&typeof e=="object"&&"type"in e}const ti=[],Ts=!0,nn=!1,zs="skip";function ni(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const o=It(i),l=r?-1:1;a(e,void 0,[])();function a(s,u,f){const c=s&&typeof s=="object"?s:{};if(typeof c.type=="string"){const h=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(s.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=ti,x,C,w;if((!n||o(s,u,f[f.length-1]||void 0))&&(h=js(t(s,f)),h[0]===nn))return h;if("children"in s&&s.children){const y=s;if(y.children&&h[0]!==zs)for(C=(r?y.children.length:-1)+l,w=f.concat(y);C>-1&&C<y.children.length;){const v=y.children[C];if(x=a(v,C,w)(),x[0]===nn)return x;C=typeof x[1]=="number"?x[1]:C+l}}return h}}}function js(e){return Array.isArray(e)?e:typeof e=="number"?[Ts,e]:e==null?ti:[e]}function wn(e,n,t,r){let i,o,l;typeof n=="function"&&typeof t!="function"?(o=void 0,l=n,i=t):(o=n,l=t,i=r),ni(e,o,a,i);function a(s,u){const f=u[u.length-1],c=f?f.children.indexOf(s):void 0;return l(s,c,f)}}const rn={}.hasOwnProperty,Ns={};function Ls(e,n){const t=n||Ns,r=new Map,i=new Map,o=new Map,l={...gs,...t.handlers},a={all:u,applyData:_s,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:s,options:t,patch:Ds,wrap:Rs};return wn(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),a;function s(f,c){const p=f.type,h=a.handlers[p];if(rn.call(a.handlers,p)&&h)return h(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:C,...w}=f,y=wt(w);return y.children=a.all(f),y}return wt(f)}return(a.options.unknownHandler||Fs)(a,f,c)}function u(f){const c=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const x=a.one(p[h],f);if(x){if(h&&p[h-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=nr(x.value)),!Array.isArray(x)&&x.type==="element")){const C=x.children[0];C&&C.type==="text"&&(C.value=nr(C.value))}Array.isArray(x)?c.push(...x):c.push(x)}}}return c}}function Ds(e,n){e.position&&(n.position=wl(e))}function _s(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const l="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:l}}t.type==="element"&&o&&Object.assign(t.properties,wt(o)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function Fs(e,n){const t=n.data||{},r="value"in n&&!(rn.call(t,"hProperties")||rn.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Rs(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
|
||||
`});++r<e.length;)r&&t.push({type:"text",value:`
|
||||
`}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
|
||||
`}),t}function nr(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function rr(e,n){const t=Ls(e,n),r=t.one(e,void 0),i=Cs(t),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
||||
`},i),o}function Ms(e,n){return e&&"run"in e?async function(t,r){const i=rr(t,{file:r,...n});await e.run(i,r)}:function(t,r){return rr(t,{file:r,...e||n})}}function ir(e){if(e)throw e}var _t,lr;function Os(){if(lr)return _t;lr=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},o=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),c=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!c)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},l=function(u,f){t&&f.name==="__proto__"?t(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},a=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return _t=function s(){var u,f,c,p,h,x,C=arguments[0],w=1,y=arguments.length,v=!1;for(typeof C=="boolean"&&(v=C,C=arguments[1]||{},w=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});w<y;++w)if(u=arguments[w],u!=null)for(f in u)c=a(C,f),p=a(u,f),C!==p&&(v&&p&&(o(p)||(h=i(p)))?(h?(h=!1,x=c&&i(c)?c:[]):x=c&&o(c)?c:{},l(C,{name:f,newValue:s(v,x,p)})):typeof p<"u"&&l(C,{name:f,newValue:p}));return C},_t}var Bs=Os();const Ft=Sr(Bs);function ln(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function $s(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(s,...u){const f=e[++o];let c=-1;if(s){l(s);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?Hs(f,a)(...u):l(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function Hs(e,n){let t;return r;function r(...l){const a=e.length>l.length;let s;a&&l.push(i);try{s=e.apply(this,l)}catch(u){const f=u;if(a&&t)throw f;return i(f)}a||(s&&s.then&&typeof s.then=="function"?s.then(o,i):s instanceof Error?i(s):o(s))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}const ve={basename:Us,dirname:Vs,extname:qs,join:Ws,sep:"/"};function Us(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');pt(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function Vs(e){if(pt(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function qs(e){pt(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Ws(...e){let n=-1,t;for(;++n<e.length;)pt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Qs(t)}function Qs(e){pt(e);const n=e.codePointAt(0)===47;let t=Ys(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Ys(e,n){let t="",r=0,i=-1,o=0,l=-1,a,s;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(s=t.lastIndexOf("/"),s!==t.length-1){s<0?(t="",r=0):(t=t.slice(0,s),r=t.length-1-t.lastIndexOf("/")),i=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function pt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Xs={cwd:Gs};function Gs(){return"/"}function on(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ks(e){if(typeof e=="string")e=new URL(e);else if(!on(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return Js(e)}function Js(e){if(e.hostname!==""){consLine truncated
|
||||
`:" ")+o.indentLines(o.containerFlow(r,a.current()),n?oi:Hu))),u(),s}}function Hu(e,n,t){return n===0?e:oi(e,n,t)}function oi(e,n,t){return(t?"":" ")+e}const Uu=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ai.peek=Yu;function Vu(){return{canContainEols:["delete"],enter:{strikethrough:Wu},exit:{strikethrough:Qu}}}function qu(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Uu}],handlers:{delete:ai}}}function Wu(e){this.enter({type:"delete",children:[]},e)}function Qu(e){this.exit(e)}function ai(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function Yu(){return"~"}function Xu(e){return e.length}function Gu(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||Xu,o=[],l=[],a=[],s=[];let u=0,f=-1;for(;++f<e.length;){const C=[],w=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const v=Ku(e[f][y]);if(t.alignDelimiters!==!1){const E=i(v);w[y]=E,(s[y]===void 0||E>s[y])&&(s[y]=E)}C.push(v)}l[f]=C,a[f]=w}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=hr(r[c]);else{const C=hr(r);for(;++c<u;)o[c]=C}c=-1;const p=[],h=[];for(;++c<u;){const C=o[c];let w="",y="";C===99?(w=":",y=":"):C===108?w=":":C===114&&(y=":");let v=t.alignDelimiters===!1?1:Math.max(1,s[c]-w.length-y.length);const E=w+"-".repeat(v)+y;t.alignDelimiters!==!1&&(v=w.length+v+y.length,v>s[c]&&(s[c]=v),h[c]=v),p[c]=E}l.splice(1,0,p),a.splice(1,0,h),f=-1;const x=[];for(;++f<l.length;){const C=l[f],w=a[f];c=-1;const y=[];for(;++c<u;){const v=C[c]||"";let E="",D="";if(t.alignDelimiters!==!1){const F=s[c]-(w[c]||0),b=o[c];b===114?E=" ".repeat(F):b===99?F%2?(E=" ".repeat(F/2+.5),D=" ".repeat(F/2-.5)):(E=" ".repeat(F/2),D=E):D=" ".repeat(F)}t.delimiterStart!==!1&&!c&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||c)&&y.push(" "),t.alignDelimiters!==!1&&y.push(E),y.push(v),t.alignDelimiters!==!1&&y.push(D),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||c!==u-1)&&y.push("|")}x.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return x.join(`
|
||||
`)}function Ku(e){return e==null?"":String(e)}function hr(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function Ju(e,n,t,r){const i=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);const l=t.indentLines(t.containerFlow(e,o.current()),Zu);return i(),l}function Zu(e,n,t){return">"+(t?"":" ")+e}function ec(e,n){return pr(e,n.inConstruct,!0)&&!pr(e,n.notInConstruct,!1)}function pr(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function mr(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
|
||||
`&&ec(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
||||
`}function tc(e,n){const t=String(e);let r=t.indexOf(n),i=r,o=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+n.length,r=t.indexOf(n,i);return l}function nc(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function rc(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function ic(e,n,t,r){const i=rc(t),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(nc(e,t)){const c=t.enter("codeIndented"),p=t.indentLines(o,lc);return c(),p}const a=t.createTracker(r),s=i.repeat(Math.max(tc(o,i)+1,3)),u=t.enter("codeFenced");let f=a.move(s);if(e.lang){const c=t.enter(`codeFencedLang${l}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
|
||||
`,encode:["`"],...a.current()})),c()}return f+=a.move(`
|
||||
`),o&&(f+=a.move(o+`
|
||||
`)),f+=a.move(s),u(),f}function lc(e,n,t){return(t?"":" ")+e}function Cn(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function oc(e,n,t,r){const i=Cn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("definition");let a=t.enter("label");const s=t.createTracker(r);let u=s.move("[");return u+=s.move(t.safe(t.associationId(e),{before:u,after:"]",...s.current()})),u+=s.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":`
|
||||
`,...s.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),l(),u}function ac(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function ct(e){return"&#x"+e.toString(16).toUpperCase()+";"}function St(e,n,t){const r=Ke(e),i=Ke(n);return r===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}si.peek=sc;function si(e,n,t,r){const i=ac(t),o=t.enter("emphasis"),l=t.createTracker(r),a=l.move(i);let s=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=St(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=ct(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=St(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+ct(c));const h=l.move(i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+s+h}function sc(e,n,t){return t.options.emphasis||"*"}function uc(e,n){let t=!1;return wn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,nn}),!!((!e.depth||e.depth<3)&&mn(e)&&(n.options.setext||t))}function cc(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(uc(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),p=t.containerPhrasing(e,{...o.current(),before:`
|
||||
`,after:`
|
||||
`});return c(),f(),p+`
|
||||
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
||||
`))+1))}const l="#".repeat(i),a=t.enter("headingAtx"),s=t.enter("phrasing");o.move(l+" ");let u=t.containerPhrasing(e,{before:"# ",after:`
|
||||
`,...o.current()});return/^[\t ]/.test(u)&&(u=ct(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,t.options.closeAtx&&(u+=" "+l),s(),a(),u}ui.peek=fc;function ui(e){return e.value||""}function fc(){return"<"}ci.peek=hc;function ci(e,n,t,r){const i=Cn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let a=t.enter("label");const s=t.createTracker(r);let u=s.move("![");return u+=s.move(t.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),u+=s.move(")"),l(),u}function hc(){return"!"}fi.peek=pc;function fi(e,n,t,r){const i=e.referenceType,o=t.enter("imageReference");let l=t.enter("label");const a=t.createTracker(r);let s=a.move("![");const u=t.safe(e.alt,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function pc(){return"!"}hi.peek=mc;function hi(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const l=t.unsafe[o],a=t.compilePattern(l);let s;if(l.atBreak)for(;s=a.exec(r);){let u=s.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(s.index+1)}}return i+r+i}function mc(){return"`"}function pi(e,n){const t=mn(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}mi.peek=dc;function mi(e,n,t,r){const i=Cn(t),o=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let a,s;if(pi(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let c=l.move("<");return c+=l.move(t.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),t.stack=f,c}a=t.enter("link"),s=t.enter("label");let u=l.move("[");return u+=l.move(t.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=t.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(t.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),u+=l.move(")"),a(),u}function dc(e,n,t){return pi(e,t)?"<":"["}di.peek=gc;function di(e,n,t,r){const i=e.referenceType,o=t.enter("linkReference");let l=t.enter("label");const a=t.createTracker(r);let s=a.move("[");const u=t.containerPhrasing(e,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function gc(){return"["}function vn(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function xc(e){const n=vn(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function yc(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function gi(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function kc(e,n,t,r){const i=t.enter("list"),o=t.bulletCurrent;let l=e.ordered?yc(t):vn(t);const a=e.ordered?l==="."?")":".":xc(t);let s=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(s=!0),gi(t)===l&&f){let c=-1;for(;++c<e.chilLine truncated
|
||||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:s,tableRow:a}};function l(h,x,C,w){return u(f(h,C,w),h.align)}function a(h,x,C,w){const y=c(h,C,w),v=u([y]);return v.slice(0,v.indexOf(`
|
||||
`))}function s(h,x,C,w){const y=C.enter("tableCell"),v=C.enter("phrasing"),E=C.containerPhrasing(h,{...w,before:o,after:o});return v(),y(),E}function u(h,x){return Gu(h,{align:x,alignDelimiters:r,padding:t,stringLength:i})}function f(h,x,C){const w=h.children;let y=-1;const v=[],E=x.enter("table");for(;++y<w.length;)v[y]=c(w[y],x,C);return E(),v}function c(h,x,C){const w=h.children;let y=-1;const v=[],E=x.enter("tableRow");for(;++y<w.length;)v[y]=s(w[y],h,x,C);return E(),v}function p(h,x,C){let w=yi.inlineCode(h,x,C);return C.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function Rc(){return{exit:{taskListCheckValueChecked:gr,taskListCheckValueUnchecked:gr,paragraph:Oc}}}function Mc(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Bc}}}function gr(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function Oc(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Bc(e,n,t,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);o&&a.move(l);let s=yi.listItem(e,n,t,{...r,...a.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(f){return f+l}}function $c(){return[ku(),Bu(),Vu(),zc(),Rc()]}function Hc(e){return{extensions:[bu(),$u(e),qu(),Fc(e),Mc()]}}const Uc={tokenize:Xc,partial:!0},ki={tokenize:Gc,partial:!0},bi={tokenize:Kc,partial:!0},wi={tokenize:Jc,partial:!0},Vc={tokenize:Zc,partial:!0},Si={name:"wwwAutolink",tokenize:Qc,previous:vi},Ci={name:"protocolAutolink",tokenize:Yc,previous:Ei},Te={name:"emailAutolink",tokenize:Wc,previous:Ii},Ee={};function qc(){return{text:Ee}}let Oe=48;for(;Oe<123;)Ee[Oe]=Te,Oe++,Oe===58?Oe=65:Oe===91&&(Oe=97);Ee[43]=Te;Ee[45]=Te;Ee[46]=Te;Ee[95]=Te;Ee[72]=[Te,Ci];Ee[104]=[Te,Ci];Ee[87]=[Te,Si];Ee[119]=[Te,Si];function Wc(e,n,t){const r=this;let i,o;return l;function l(c){return!an(c)||!Ii.call(r,r.previous)||En(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return an(c)?(e.consume(c),a):c===64?(e.consume(c),s):t(c)}function s(c){return c===46?e.check(Vc,f,u)(c):c===45||c===95||re(c)?(o=!0,e.consume(c),s):f(c)}function u(c){return e.consume(c),i=!0,s}function f(c){return o&&i&&ae(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function Qc(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!vi.call(r,r.previous)||En(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Uc,e.attempt(ki,e.attempt(bi,o),t),t)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function Yc(e,n,t){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&Ei.call(r,r.previous)&&!En(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(ae(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),s}return t(c)}function s(c){return c===47?(e.consume(c),o?u:(o=!0,s)):t(c)}function u(c){return c===null||kt(c)||G(c)||Be(c)||Ct(c)?t(c):e.attempt(ki,e.attempt(bi,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function Xc(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):t(l)}function o(l){return l===null?t(l):n(l)}}function Gc(e,n,t){let r,i,o;return l;function l(u){return u===46||u===95?e.check(wi,s,a)(u):u===null||G(u)||Be(u)||u!==45&&Ct(u)?s(u):(o=!0,e.consume(u),l)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function s(u){return i||r||!o?t(u):n(u)}}function Kc(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(wi,n,o)(l):l===null||G(l)||Be(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function Jc(e,n,t){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||G(a)||Be(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||G(a)||Be(a)?n(a):r(a)}function o(a){return ae(a)?l(a):t(a)}function l(a){return
Line truncated
|
||||
|
||||
`),n.trim()}function Tf({isOpen:e,onClose:n,plugin:t,installStatus:r="not-installed",installedVersion:i,onInstall:o}){const[l,a]=Q.useState(""),[s,u]=Q.useState(!1),[f,c]=Q.useState(!1),p=t?If(t.homepage):null;if(Q.useEffect(()=>{if(!e||!p){a(""),c(!1);return}(async()=>{u(!0),c(!1);try{const _=await Af(p.owner,p.repo);a(Pf(_))}catch(_){console.error("Failed to fetch README:",_),c(!0)}finally{u(!1)}})()},[e,p==null?void 0:p.owner,p==null?void 0:p.repo]),!t)return null;const{name:h,version:x,author:C,description:w,tags:y,homepage:v,downloadUrl:E,minVersion:D}=t,F=Ef(v,E)||`https://avatar.vercel.sh/${encodeURIComponent(h)}`;return g.jsx(zi,{isOpen:e,onClose:n,size:"4xl",scrollBehavior:"inside",classNames:{backdrop:"z-[200]",wrapper:"z-[200]"},children:g.jsx(ji,{className:"rounded-3xl border border-white/70 dark:border-white/10 bg-white/92 dark:bg-zinc-900/92 backdrop-blur-2xl shadow-2xl shadow-primary-900/15",children:b=>g.jsxs(g.Fragment,{children:[g.jsx(Ni,{className:"flex flex-col gap-3 pb-2",children:g.jsxs("div",{className:"flex items-start gap-4",children:[g.jsx(br,{src:F,name:C||"?",size:"lg",isBordered:!0,color:"primary",radius:"lg",className:"flex-shrink-0"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("h2",{className:"text-2xl font-bold text-default-900",children:h}),v&&g.jsx(Xe,{content:"访问项目主页",children:g.jsx(ge,{isIconOnly:!0,size:"sm",variant:"flat",color:"primary",as:"a",href:v,target:"_blank",rel:"noreferrer",children:g.jsx(In,{size:18})})})]}),g.jsxs("p",{className:"text-sm text-default-500 mt-1",children:["by ",g.jsx("span",{className:"font-medium",children:C||"未知作者"})]}),g.jsxs("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:[g.jsxs(De,{size:"sm",color:"primary",variant:"flat",children:["v",x]}),y==null?void 0:y.map(_=>g.jsx(De,{size:"sm",variant:"flat",className:"bg-default-100 text-default-600",children:_},_)),r==="update-available"&&i&&g.jsx(De,{size:"sm",color:"warning",variant:"shadow",className:"animate-pulse",children:"可更新"}),r==="installed"&&g.jsx(De,{size:"sm",color:"success",variant:"flat",startContent:g.jsx(Yt,{size:14}),children:"已安装"})]})]})]})}),g.jsxs(Li,{className:"gap-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-sm font-semibold text-default-700 mb-2",children:"插件描述"}),g.jsx("p",{className:"text-sm text-default-600 leading-relaxed",children:w||"暂无描述"})]}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-sm font-semibold text-default-700 mb-3",children:"插件信息"}),g.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm",children:[g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"最新版本:"}),g.jsxs("span",{className:"font-medium text-default-900",children:["v",x]})]}),i&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"已安装版本:"}),g.jsxs("span",{className:"font-medium text-default-900",children:["v",i]})]}),D&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"最低要求版本:"}),g.jsxs("span",{className:"font-medium text-default-900",children:["v",D]})]}),g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"插件 ID:"}),g.jsx("span",{className:"font-mono text-xs text-default-900",children:t.id})]}),E&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"下载地址:"}),g.jsx(ge,{size:"sm",variant:"flat",color:"primary",as:"a",href:E,target:"_blank",rel:"noreferrer",startContent:g.jsx(An,{size:14}),children:"下载插件"})]})]})]}),p&&g.jsx(g.Fragment,{children:g.jsxs("div",{className:"mt-2",children:[g.jsx("h3",{className:"text-sm font-semibold text-default-700 mb-3",children:"详情"}),s&&g.jsx("div",{className:"flex justify-center items-center py-12",children:g.jsx(kr,{size:"lg"})}),f&&g.jsxs("div",{className:"text-center py-8",children:[g.jsx("p",{className:"text-sm text-default-500 mb-3",children:"无法加载 README"}),g.jsx(ge,{color:"primary",variant:"flat",as:"a",href:v,target:"_blank",rel:"noreferrer",startContent:g.jsx(In,{}),children:"在 GitHub 查看"})]}),!s&&!f&&l&&g.jsx("div",{className:"rounded-lg border border-default-200 p-4 bg-default-50",children:g.jsx(vf,{content:l})})]})})]}),g.jsxs(Di,{children:[g.jsx(ge,{variant:"light",onPress:b,children:"关闭"}),r==="installed"?g.jsx(ge,{color:"success",variant:"flat",startContent:g.jsx(Yt,{size:18}),isDisabled:!0,children:"已安装"}):r==="update-available"?g.jsxs(ge,{color:"warning",variant:"shadow",startContent:g.jsx(wr,{size:18}),onPress:()=>{o==null||o(),b()},children:["更新到 v",x]}):g.jsx(ge,{color:"primary",variant:"shadow",startContent:g.jsx(An,{size
Line truncated
|
||||
Reference in new issue
Block a user