@commandable/mcp 0.11.0 → 0.12.1
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{DRfk9W3W.js → B6ti3873.js} +1 -1
- package/.output/public/_nuxt/{VvnbcAzZ.js → BZ8athzM.js} +1 -1
- package/.output/public/_nuxt/{DSWYWRXT.js → BuJvZwTh.js} +9 -9
- package/.output/public/_nuxt/{D9wFDhac.js → CiSdBjBt.js} +1 -1
- package/.output/public/_nuxt/{BD6mASiY.js → D_Ecm3JY.js} +1 -1
- package/.output/public/_nuxt/{CjAs3eBq.js → Vt66r6sN.js} +1 -1
- package/.output/public/_nuxt/{BUmYUDQu.js → bOjQRRUc.js} +3 -3
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/6152dcdc-6d3b-4e0a-8c56-4584c72c8765.json +1 -0
- package/.output/server/chunks/build/{_id_-DA3Q8jun.mjs → _id_-BIPuj6eI.mjs} +4 -4
- package/.output/server/chunks/build/{_id_-DA3Q8jun.mjs.map → _id_-BIPuj6eI.mjs.map} +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{error-404-D1k2kWid.mjs → error-404-BHlLSgAJ.mjs} +1 -1
- package/.output/server/chunks/build/error-404-BHlLSgAJ.mjs.map +1 -0
- package/.output/server/chunks/build/{error-500-D2K2rAfl.mjs → error-500-D4rqaBv3.mjs} +1 -1
- package/.output/server/chunks/build/error-500-D4rqaBv3.mjs.map +1 -0
- package/.output/server/chunks/build/{fetch-aDh21opM.mjs → fetch-DJGu_p4i.mjs} +1 -1
- package/.output/server/chunks/build/fetch-DJGu_p4i.mjs.map +1 -0
- package/.output/server/chunks/build/{index-ycGPozML.mjs → index-DUjkeeyt.mjs} +1 -1
- package/.output/server/chunks/build/index-DUjkeeyt.mjs.map +1 -0
- package/.output/server/chunks/build/{index-F5lAFSQk.mjs → index-DvzWme19.mjs} +4 -4
- package/.output/server/chunks/build/index-DvzWme19.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +5 -5
- package/.output/server/chunks/build/styles.mjs +2 -2
- package/.output/server/chunks/nitro/nitro.mjs +5471 -1624
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +2 -2
- package/.output/public/_nuxt/builds/meta/9441a86b-16e9-4000-bffc-3b2e78e57710.json +0 -1
- package/.output/server/chunks/build/error-404-D1k2kWid.mjs.map +0 -1
- package/.output/server/chunks/build/error-500-D2K2rAfl.mjs.map +0 -1
- package/.output/server/chunks/build/fetch-aDh21opM.mjs.map +0 -1
- package/.output/server/chunks/build/index-F5lAFSQk.mjs.map +0 -1
- package/.output/server/chunks/build/index-ycGPozML.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as o,u as s,o as a,c as i,a as t,t as r}from"./
|
|
1
|
+
import{_ as o,u as s,o as a,c as i,a as t,t as r}from"./bOjQRRUc.js";const u={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},l={class:"max-w-520px text-center"},c=["textContent"],d=["textContent"],p=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},status:{type:Number,default:500},statusText:{type:String,default:"Internal server error"},description:{type:String,default:"This page is temporarily unavailable."},refresh:{type:String,default:"Refresh this page"}},setup(e){const n=e;return s({title:`${n.status} - ${n.statusText} | ${n.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(h,m)=>(a(),i("div",u,[t("div",l,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:r(e.status)},null,8,c),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:r(e.statusText)},null,8,d),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:r(e.description)},null,8,p)])]))}},g=o(f,[["__scopeId","data-v-4b5190e7"]]);export{g as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{g as $t,h as St,i as _t,j as Tt,k as zt,l as Rt,m as Ct,p as It,q as At,o as y,r as X,w as C,a as w,s as Ne,v as o,x as Te,c as L,y as se,z as be,A as qt,B as W,P as Pt,C as A,D as Bt,E as Ze,f as Ae,F as ie,b as R,d as P,G as qe,H as fe,I as ae,J as ze,K as Pe,L as B,M as he,_ as Lt,t as le,N as Et,O as He,Q as Mt,e as Vt,n as Ot}from"./BUmYUDQu.js";import{_ as et,a as tt,u as Ge,b as Dt,c as Ut,d as jt}from"./DRfk9W3W.js";const Ft={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-sm/4 gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-sm/4 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-base/5 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-base/5 gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},Nt=["id","type","value","name","placeholder","disabled","required","autocomplete"],Zt=Object.assign({inheritAttrs:!1},{__name:"UInput",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},type:{type:null,required:!1,default:"text"},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autocomplete:{type:[String,Object],required:!1,default:"off"},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(s,{expose:e,emit:n}){const l=s,t=n,i=$t(),r=St(l,"modelValue",t,{defaultValue:l.defaultValue}),c=_t(),a=Tt("input",l),{emitFormBlur:h,emitFormInput:p,emitFormChange:m,size:u,color:b,id:x,name:q,highlight:M,disabled:U,emitFormFocus:V,ariaAttrs:H}=zt(l,{deferInputValidation:!0}),{orientation:D,size:j}=Rt(l),{isLeading:E,isTrailing:G,leadingIconName:k,trailingIconName:g}=Ct(l),d=A(()=>j.value||u.value),$=A(()=>Ze({extend:Ze(Ft),...c.ui?.input||{}})({type:l.type,color:b.value,variant:l.variant,size:d?.value,loading:l.loading,highlight:M.value,fixed:l.fixed,leading:E.value||!!l.avatar||!!i.leading,trailing:G.value||!!i.trailing,fieldGroup:D.value})),_=It("inputRef");function te(T){l.modelModifiers?.trim&&(typeof T=="string"||T===null||T===void 0)&&(T=T?.trim()??null),(l.modelModifiers?.number||l.type==="number")&&(T=Bt(T)),l.modelModifiers?.nullable&&(T||=null),l.modelModifiers?.optional&&!l.modelModifiers?.nullable&&T!==null&&(T||=void 0),r.value=T,p()}function S(T){l.modelModifiers?.lazy||te(T.target.value)}function O(T){const ee=T.target.value;l.modelModifiers?.lazy&&te(ee),l.modelModifiers?.trim&&(T.target.value=ee.trim()),m(),t("change",T)}function ne(T){h(),t("blur",T)}function F(){l.autofocus&&_.value?.focus()}return At(()=>{setTimeout(()=>{F()},l.autofocusDelay)}),e({inputRef:_}),(T,ee)=>(y(),X(o(Pt),{as:s.as,"data-slot":"root",class:se($.value.root({class:[o(a)?.root,l.class]}))},{default:C(()=>[w("input",Ne({id:o(x),ref_key:"inputRef",ref:_,type:s.type,value:o(r),name:o(q),placeholder:s.placeholder,"data-slot":"base",class:$.value.base({class:o(a)?.base}),disabled:o(U),required:s.required,autocomplete:s.autocomplete},{...T.$attrs,...o(H)},{onInput:S,onBlur:ne,onChange:O,onFocus:ee[0]||(ee[0]=(...Se)=>o(V)&&o(V)(...Se))}),null,16,Nt),Te(T.$slots,"default",{ui:$.value}),o(E)||s.avatar||i.leading?(y(),L("span",{key:0,"data-slot":"leading",class:se($.value.leading({class:o(a)?.leading}))},[Te(T.$slots,"leading",{ui:$.value},()=>[o(E)&&o(k)?(y(),X(be,{key:0,name:o(k),"data-slot":"leadingIcon",class:se($.value.leadingIcon({class:o(a)?.leadingIcon}))},null,8,["name","class"])):s.avatar?(y(),X(qt,Ne({key:1,size:o(a)?.leadingAvatarSize||$.value.leadingAvatarSize()},s.avatar,{"data-slot":"leadingAvatar",class:$.value.leadingAvatar({class:o(a)?.leadingAvatar})}),null,16,["size","class"])):W("",!0)])],2)):W("",!0),o(G)||i.trailing?(y(),L("span",{key:1,"data-slot":"trailing",class:se($.value.trailing({class:o(a)?.trailing}))},[Te(T.$slots,"trailing",{ui:$.value},()=>[o(g)?(y(),X(be,{key:0,name:o(g),"data-slot":"trailingIcon",class:se($.value.trailingIcon({class:o(a)?.trailingIcon}))},null,8,["name","class"])):W("",!0)])],2)):W("",!0)]),_:3},8,["as","class"]))}});function Be(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ce=Be();function nt(s){ce=s}var re={exec:()=>null};function v(s,e=""){let n=typeof s=="string"?s:s.source,l={replace:(t,i)=>{let r=typeof i=="string"?i:i.source;return r=r.replace(N.caret,"$1"),n=n.replace(t,r),l},getRegex:()=>new RegExp(n,e)};return l}var Ht=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),N={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}>`)},Gt=/^(?:[ \t]*(?:\n|$))+/,Qt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ke=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Le=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,st=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=v(st).replace(/bull/g,Le).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Kt=v(st).replace(/bull/g,Le).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ee=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jt=/^[^\n]+/,Me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Yt=v(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),en=v(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Le).getRegex(),we="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tn=v("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ve).replace("tag",we).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rt=v(Ee).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",we).getRegex(),nn=v(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rt).getRegex(),Oe={blockquote:nn,code:Qt,def:Yt,fences:Xt,heading:Wt,hr:ke,html:tn,lheading:lt,list:en,newline:Gt,paragraph:rt,table:re,text:Jt},Qe=v("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",we).getRegex(),sn={...Oe,lheading:Kt,table:Qe,paragraph:v(Ee).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",we).getRegex()},ln={...Oe,html:v(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:re,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:v(Ee).replace("hr",ke).replace("heading",` *#{1,6} *[^
|
|
2
|
-
]`).replace("lheading",lt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,an=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,it=/^( {2,}|\\)\n(?!\s*$)/,on=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$e=/[\p{P}\p{S}]/u,
|
|
1
|
+
import{g as $t,h as St,i as _t,j as Tt,k as zt,l as Rt,m as Ct,p as It,q as At,o as y,r as W,w as C,a as w,s as Ne,v as o,x as Te,c as L,y as se,z as be,A as qt,B as X,P as Pt,C as A,D as Bt,E as Ze,f as Ae,F as ie,b as R,d as P,G as qe,H as fe,I as ae,J as ze,K as Pe,L as B,M as he,_ as Lt,t as le,N as Et,O as He,Q as Vt,e as Mt,n as Dt}from"./bOjQRRUc.js";import{_ as et,a as tt,u as Ge,b as Ot,c as jt,d as Ut}from"./B6ti3873.js";const Ft={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-sm/4 gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-sm/4 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-base/5 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-base/5 gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},Nt=["id","type","value","name","placeholder","disabled","required","autocomplete"],Zt=Object.assign({inheritAttrs:!1},{__name:"UInput",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},type:{type:null,required:!1,default:"text"},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autocomplete:{type:[String,Object],required:!1,default:"off"},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(s,{expose:e,emit:n}){const l=s,t=n,i=$t(),r=St(l,"modelValue",t,{defaultValue:l.defaultValue}),c=_t(),a=Tt("input",l),{emitFormBlur:h,emitFormInput:p,emitFormChange:m,size:u,color:b,id:x,name:q,highlight:V,disabled:j,emitFormFocus:M,ariaAttrs:H}=zt(l,{deferInputValidation:!0}),{orientation:O,size:U}=Rt(l),{isLeading:E,isTrailing:G,leadingIconName:k,trailingIconName:g}=Ct(l),d=A(()=>U.value||u.value),$=A(()=>Ze({extend:Ze(Ft),...c.ui?.input||{}})({type:l.type,color:b.value,variant:l.variant,size:d?.value,loading:l.loading,highlight:V.value,fixed:l.fixed,leading:E.value||!!l.avatar||!!i.leading,trailing:G.value||!!i.trailing,fieldGroup:O.value})),_=It("inputRef");function te(T){l.modelModifiers?.trim&&(typeof T=="string"||T===null||T===void 0)&&(T=T?.trim()??null),(l.modelModifiers?.number||l.type==="number")&&(T=Bt(T)),l.modelModifiers?.nullable&&(T||=null),l.modelModifiers?.optional&&!l.modelModifiers?.nullable&&T!==null&&(T||=void 0),r.value=T,p()}function S(T){l.modelModifiers?.lazy||te(T.target.value)}function D(T){const ee=T.target.value;l.modelModifiers?.lazy&&te(ee),l.modelModifiers?.trim&&(T.target.value=ee.trim()),m(),t("change",T)}function ne(T){h(),t("blur",T)}function F(){l.autofocus&&_.value?.focus()}return At(()=>{setTimeout(()=>{F()},l.autofocusDelay)}),e({inputRef:_}),(T,ee)=>(y(),W(o(Pt),{as:s.as,"data-slot":"root",class:se($.value.root({class:[o(a)?.root,l.class]}))},{default:C(()=>[w("input",Ne({id:o(x),ref_key:"inputRef",ref:_,type:s.type,value:o(r),name:o(q),placeholder:s.placeholder,"data-slot":"base",class:$.value.base({class:o(a)?.base}),disabled:o(j),required:s.required,autocomplete:s.autocomplete},{...T.$attrs,...o(H)},{onInput:S,onBlur:ne,onChange:D,onFocus:ee[0]||(ee[0]=(...Se)=>o(M)&&o(M)(...Se))}),null,16,Nt),Te(T.$slots,"default",{ui:$.value}),o(E)||s.avatar||i.leading?(y(),L("span",{key:0,"data-slot":"leading",class:se($.value.leading({class:o(a)?.leading}))},[Te(T.$slots,"leading",{ui:$.value},()=>[o(E)&&o(k)?(y(),W(be,{key:0,name:o(k),"data-slot":"leadingIcon",class:se($.value.leadingIcon({class:o(a)?.leadingIcon}))},null,8,["name","class"])):s.avatar?(y(),W(qt,Ne({key:1,size:o(a)?.leadingAvatarSize||$.value.leadingAvatarSize()},s.avatar,{"data-slot":"leadingAvatar",class:$.value.leadingAvatar({class:o(a)?.leadingAvatar})}),null,16,["size","class"])):X("",!0)])],2)):X("",!0),o(G)||i.trailing?(y(),L("span",{key:1,"data-slot":"trailing",class:se($.value.trailing({class:o(a)?.trailing}))},[Te(T.$slots,"trailing",{ui:$.value},()=>[o(g)?(y(),W(be,{key:0,name:o(g),"data-slot":"trailingIcon",class:se($.value.trailingIcon({class:o(a)?.trailingIcon}))},null,8,["name","class"])):X("",!0)])],2)):X("",!0)]),_:3},8,["as","class"]))}});function Be(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ce=Be();function nt(s){ce=s}var re={exec:()=>null};function v(s,e=""){let n=typeof s=="string"?s:s.source,l={replace:(t,i)=>{let r=typeof i=="string"?i:i.source;return r=r.replace(N.caret,"$1"),n=n.replace(t,r),l},getRegex:()=>new RegExp(n,e)};return l}var Ht=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),N={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}>`)},Gt=/^(?:[ \t]*(?:\n|$))+/,Qt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ke=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Le=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,st=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=v(st).replace(/bull/g,Le).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Kt=v(st).replace(/bull/g,Le).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ee=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jt=/^[^\n]+/,Ve=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Yt=v(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ve).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),en=v(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Le).getRegex(),we="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Me=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tn=v("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Me).replace("tag",we).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rt=v(Ee).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",we).getRegex(),nn=v(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rt).getRegex(),De={blockquote:nn,code:Qt,def:Yt,fences:Wt,heading:Xt,hr:ke,html:tn,lheading:lt,list:en,newline:Gt,paragraph:rt,table:re,text:Jt},Qe=v("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",we).getRegex(),sn={...De,lheading:Kt,table:Qe,paragraph:v(Ee).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",we).getRegex()},ln={...De,html:v(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Me).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:re,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:v(Ee).replace("hr",ke).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",lt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,an=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,it=/^( {2,}|\\)\n(?!\s*$)/,on=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$e=/[\p{P}\p{S}]/u,Oe=/[\s\p{P}\p{S}]/u,at=/[^\s\p{P}\p{S}]/u,cn=v(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Oe).getRegex(),ot=/(?!~)[\p{P}\p{S}]/u,un=/(?!~)[\s\p{P}\p{S}]/u,pn=/(?:[^\s\p{P}\p{S}]|~)/u,ct=/(?![*_])[\p{P}\p{S}]/u,dn=/(?![*_])[\s\p{P}\p{S}]/u,hn=/(?:[^\s\p{P}\p{S}]|[*_])/u,gn=v(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ht?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ut=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,fn=v(ut,"u").replace(/punct/g,$e).getRegex(),kn=v(ut,"u").replace(/punct/g,ot).getRegex(),pt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mn=v(pt,"gu").replace(/notPunctSpace/g,at).replace(/punctSpace/g,Oe).replace(/punct/g,$e).getRegex(),bn=v(pt,"gu").replace(/notPunctSpace/g,pn).replace(/punctSpace/g,un).replace(/punct/g,ot).getRegex(),xn=v("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,at).replace(/punctSpace/g,Oe).replace(/punct/g,$e).getRegex(),yn=v(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ct).getRegex(),vn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wn=v(vn,"gu").replace(/notPunctSpace/g,hn).replace(/punctSpace/g,dn).replace(/punct/g,ct).getRegex(),$n=v(/\\(punct)/,"gu").replace(/punct/g,$e).getRegex(),Sn=v(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_n=v(Me).replace("(?:-->|$)","-->").getRegex(),Tn=v("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_n).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xe=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,zn=v(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",xe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),dt=v(/^!?\[(label)\]\[(ref)\]/).replace("label",xe).replace("ref",Ve).getRegex(),ht=v(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ve).getRegex(),Rn=v("reflink|nolink(?!\\()","g").replace("reflink",dt).replace("nolink",ht).getRegex(),We=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,je={_backpedal:re,anyPunctuation:$n,autolink:Sn,blockSkip:gn,br:it,code:an,del:re,delLDelim:re,delRDelim:re,emStrongLDelim:fn,emStrongRDelimAst:mn,emStrongRDelimUnd:xn,escape:rn,link:zn,nolink:ht,punctuation:cn,reflink:dt,reflinkSearch:Rn,tag:Tn,text:on,url:re},Cn={...je,link:v(/^!?\[(label)\]\((.*?)\)/).replace("label",xe).getRegex(),reflink:v(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xe).getRegex()},Re={...je,emStrongRDelimAst:bn,emStrongLDelim:kn,delLDelim:yn,delRDelim:wn,url:v(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",We).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:v(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",We).getRegex()},In={...Re,br:v(it).replace("{2,}","*").getRegex(),text:v(Re.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},me={normal:De,gfm:sn,pedantic:ln},pe={normal:je,gfm:Re,breaks:In,pedantic:Cn},An={"&":"&","<":"<",">":">",'"':""","'":"'"},Xe=s=>An[s];function Y(s,e){if(e){if(N.escapeTest.test(s))return s.replace(N.escapeReplace,Xe)}else if(N.escapeTestNoEncode.test(s))return s.replace(N.escapeReplaceNoEncode,Xe);return s}function Ke(s){try{s=encodeURI(s).replace(N.percentDecode,"%")}catch{return null}return s}function Je(s,e){let n=s.replace(N.findPipe,(i,r,c)=>{let a=!1,h=r;for(;--h>=0&&c[h]==="\\";)a=!a;return a?"|":" |"}),l=n.split(N.splitPipe),t=0;if(l[0].trim()||l.shift(),l.length>0&&!l.at(-1)?.trim()&&l.pop(),e)if(l.length>e)l.splice(e);else for(;l.length<e;)l.push("");for(;t<l.length;t++)l[t]=l[t].trim().replace(N.slashPipe,"|");return l}function de(s,e,n){let l=s.length;if(l===0)return"";let t=0;for(;t<l&&s.charAt(l-t-1)===e;)t++;return s.slice(0,l-t)}function qn(s,e){if(s.indexOf(e[1])===-1)return-1;let n=0;for(let l=0;l<s.length;l++)if(s[l]==="\\")l++;else if(s[l]===e[0])n++;else if(s[l]===e[1]&&(n--,n<0))return l;return n>0?-2:-1}function Pn(s,e=0){let n=e,l="";for(let t of s)if(t===" "){let i=4-n%4;l+=" ".repeat(i),n+=i}else l+=t,n++;return l}function Ye(s,e,n,l,t){let i=e.href,r=e.title||null,c=s[1].replace(t.other.outputLinkReplace,"$1");l.state.inLink=!0;let a={type:s[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:r,text:c,tokens:l.inlineTokens(c)};return l.state.inLink=!1,a}function Bn(s,e,n){let l=s.match(n.other.indentCodeCompensation);if(l===null)return e;let t=l[1];return e.split(`
|
|
3
3
|
`).map(i=>{let r=i.match(n.other.beginningSpace);if(r===null)return i;let[c]=r;return c.length>=t.length?i.slice(t.length):i}).join(`
|
|
4
4
|
`)}var ye=class{options;rules;lexer;constructor(s){this.options=s||ce}space(s){let e=this.rules.block.newline.exec(s);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(s){let e=this.rules.block.code.exec(s);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:de(n,`
|
|
5
5
|
`)}}}fences(s){let e=this.rules.block.fences.exec(s);if(e){let n=e[0],l=Bn(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:l}}}heading(s){let e=this.rules.block.heading.exec(s);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let l=de(n,"#");(this.options.pedantic||!l||this.rules.other.endingSpaceChar.test(l))&&(n=l.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(s){let e=this.rules.block.hr.exec(s);if(e)return{type:"hr",raw:de(e[0],`
|
|
@@ -17,11 +17,11 @@ ${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
17
17
|
`);continue}}return{type:"blockquote",raw:l,tokens:i,text:t}}}list(s){let e=this.rules.block.list.exec(s);if(e){let n=e[1].trim(),l=n.length>1,t={type:"list",raw:"",ordered:l,start:l?+n.slice(0,-1):"",loose:!1,items:[]};n=l?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=l?n:"[*+-]");let i=this.rules.other.listItemRegex(n),r=!1;for(;s;){let a=!1,h="",p="";if(!(e=i.exec(s))||this.rules.block.hr.test(s))break;h=e[0],s=s.substring(h.length);let m=Pn(e[2].split(`
|
|
18
18
|
`,1)[0],e[1].length),u=s.split(`
|
|
19
19
|
`,1)[0],b=!m.trim(),x=0;if(this.options.pedantic?(x=2,p=m.trimStart()):b?x=e[1].length+1:(x=m.search(this.rules.other.nonSpaceChar),x=x>4?1:x,p=m.slice(x),x+=e[1].length),b&&this.rules.other.blankLine.test(u)&&(h+=u+`
|
|
20
|
-
`,s=s.substring(u.length+1),a=!0),!a){let q=this.rules.other.nextBulletRegex(x),
|
|
21
|
-
`,1)[0],E;if(u=
|
|
22
|
-
`+E.slice(x);else{if(b||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||
|
|
23
|
-
`+u}b=!u.trim(),h+=
|
|
24
|
-
`,s=s.substring(
|
|
20
|
+
`,s=s.substring(u.length+1),a=!0),!a){let q=this.rules.other.nextBulletRegex(x),V=this.rules.other.hrRegex(x),j=this.rules.other.fencesBeginRegex(x),M=this.rules.other.headingBeginRegex(x),H=this.rules.other.htmlBeginRegex(x),O=this.rules.other.blockquoteBeginRegex(x);for(;s;){let U=s.split(`
|
|
21
|
+
`,1)[0],E;if(u=U,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),E=u):E=u.replace(this.rules.other.tabCharGlobal," "),j.test(u)||M.test(u)||H.test(u)||O.test(u)||q.test(u)||V.test(u))break;if(E.search(this.rules.other.nonSpaceChar)>=x||!u.trim())p+=`
|
|
22
|
+
`+E.slice(x);else{if(b||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||j.test(m)||M.test(m)||V.test(m))break;p+=`
|
|
23
|
+
`+u}b=!u.trim(),h+=U+`
|
|
24
|
+
`,s=s.substring(U.length+1),m=E.slice(x)}}t.loose||(r?t.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(r=!0)),t.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),t.raw+=h}let c=t.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let a of t.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(a.raw);if(h){let p={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};a.checked=p.checked,t.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=p.raw+a.tokens[0].raw,a.tokens[0].text=p.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(p)):a.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):a.tokens.unshift(p)}}if(!t.loose){let h=a.tokens.filter(m=>m.type==="space"),p=h.length>0&&h.some(m=>this.rules.other.anyLine.test(m.raw));t.loose=p}}if(t.loose)for(let a of t.items){a.loose=!0;for(let h of a.tokens)h.type==="text"&&(h.type="paragraph")}return t}}html(s){let e=this.rules.block.html.exec(s);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(s){let e=this.rules.block.def.exec(s);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:l,title:t}}}table(s){let e=this.rules.block.table.exec(s);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Je(e[1]),l=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
25
|
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===l.length){for(let r of l)this.rules.other.tableAlignRight.test(r)?i.align.push("right"):this.rules.other.tableAlignCenter.test(r)?i.align.push("center"):this.rules.other.tableAlignLeft.test(r)?i.align.push("left"):i.align.push(null);for(let r=0;r<n.length;r++)i.header.push({text:n[r],tokens:this.lexer.inline(n[r]),header:!0,align:i.align[r]});for(let r of t)i.rows.push(Je(r,i.header.length).map((c,a)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[a]})));return i}}lheading(s){let e=this.rules.block.lheading.exec(s);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(s){let e=this.rules.block.paragraph.exec(s);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
26
26
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(s){let e=this.rules.block.text.exec(s);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(s){let e=this.rules.inline.escape.exec(s);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(s){let e=this.rules.inline.tag.exec(s);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(s){let e=this.rules.inline.link.exec(s);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=de(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=qn(e[2],"()");if(i===-2)return;if(i>-1){let r=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let l=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(l);i&&(l=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?l=l.slice(1):l=l.slice(1,-1)),Ye(e,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(s,e){let n;if((n=this.rules.inline.reflink.exec(s))||(n=this.rules.inline.nolink.exec(s))){let l=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[l.toLowerCase()];if(!t){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Ye(n,t,n[0],this.lexer,this.rules)}}emStrong(s,e,n=""){let l=this.rules.inline.emStrongLDelim.exec(s);if(!(!l||l[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(l[1]||l[2])||!n||this.rules.inline.punctuation.exec(n))){let t=[...l[0]].length-1,i,r,c=t,a=0,h=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*s.length+t);(l=h.exec(e))!=null;){if(i=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!i)continue;if(r=[...i].length,l[3]||l[4]){c+=r;continue}else if((l[5]||l[6])&&t%3&&!((t+r)%3)){a+=r;continue}if(c-=r,c>0)continue;r=Math.min(r,r+c+a);let p=[...l[0]][0].length,m=s.slice(0,t+l.index+p+r);if(Math.min(t,r)%2){let b=m.slice(1,-1);return{type:"em",raw:m,text:b,tokens:this.lexer.inlineTokens(b)}}let u=m.slice(2,-2);return{type:"strong",raw:m,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(s){let e=this.rules.inline.code.exec(s);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),l=this.rules.other.nonSpaceChar.test(n),t=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return l&&t&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(s){let e=this.rules.inline.br.exec(s);if(e)return{type:"br",raw:e[0]}}del(s,e,n=""){let l=this.rules.inline.delLDelim.exec(s);if(l&&(!l[1]||!n||this.rules.inline.punctuation.exec(n))){let t=[...l[0]].length-1,i,r,c=t,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*s.length+t);(l=a.exec(e))!=null;){if(i=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!i||(r=[...i].length,r!==t))continue;if(l[3]||l[4]){c+=r;continue}if(c-=r,c>0)continue;r=Math.min(r,r+c);let h=[...l[0]][0].length,p=s.slice(0,t+l.index+h+r),m=p.slice(t,-t);return{type:"del",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(s){let e=this.rules.inline.autolink.exec(s);if(e){let n,l;return e[2]==="@"?(n=e[1],l="mailto:"+n):(n=e[1],l=n),{type:"link",raw:e[0],text:n,href:l,tokens:[{type:"text",raw:n,text:n}]}}}url(s){let e;if(e=this.rules.inline.url.exec(s)){let n,l;if(e[2]==="@")n=e[0],l="mailto:"+n;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);n=e[0],e[1]==="www."?l="http://"+e[0]:l=e[0]}return{type:"link",raw:e[0],text:n,href:l,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(s){let e=this.rules.inline.text.exec(s);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},K=class Ce{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ce,this.options.tokenizer=this.options.tokenizer||new ye,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:N,block:me.normal,inline:pe.normal};this.options.pedantic?(n.block=me.pedantic,n.inline=pe.pedantic):this.options.gfm&&(n.block=me.gfm,this.options.breaks?n.inline=pe.breaks:n.inline=pe.gfm),this.tokenizer.rules=n}static get rules(){return{block:me,inline:pe}}static lex(e,n){return new Ce(n).lex(e)}static lexInline(e,n){return new Ce(n).inlineTokens(e)}lex(e){e=e.replace(N.carriageReturn,`
|
|
27
27
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let l=this.inlineQueue[n];this.inlineTokens(l.src,l.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],l=!1){for(this.options.pedantic&&(e=e.replace(N.tabCharGlobal," ").replace(N.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(r=>(t=r.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let r=n.at(-1);t.raw.length===1&&r!==void 0?r.raw+=`
|
|
@@ -55,5 +55,5 @@ ${this.parser.parse(s)}</blockquote>
|
|
|
55
55
|
`}tablerow({text:s}){return`<tr>
|
|
56
56
|
${s}</tr>
|
|
57
57
|
`}tablecell(s){let e=this.parser.parseInline(s.tokens),n=s.header?"th":"td";return(s.align?`<${n} align="${s.align}">`:`<${n}>`)+e+`</${n}>
|
|
58
|
-
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${Y(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:e,tokens:n}){let l=this.parser.parseInline(n),t=Ke(s);if(t===null)return l;s=t;let i='<a href="'+s+'"';return e&&(i+=' title="'+Y(e)+'"'),i+=">"+l+"</a>",i}image({href:s,title:e,text:n,tokens:l}){l&&(n=this.parser.parseInline(l,this.parser.textRenderer));let t=Ke(s);if(t===null)return Y(n);s=t;let i=`<img src="${s}" alt="${Y(n)}"`;return e&&(i+=` title="${Y(e)}"`),i+=">",i}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Y(s.text)}},
|
|
59
|
-
Please report this to https://github.com/markedjs/marked.`,s){let l="<p>An error occurred:</p><pre>"+Y(n.message+"",!0)+"</pre>";return e?Promise.resolve(l):l}if(e)return Promise.reject(n);throw n}}},oe=new Ln;function z(s,e){return oe.parse(s,e)}z.options=z.setOptions=function(s){return oe.setOptions(s),z.defaults=oe.defaults,nt(z.defaults),z};z.getDefaults=Be;z.defaults=ce;z.use=function(...s){return oe.use(...s),z.defaults=oe.defaults,nt(z.defaults),z};z.walkTokens=function(s,e){return oe.walkTokens(s,e)};z.parseInline=oe.parseInline;z.Parser=J;z.parser=J.parse;z.Renderer=ve;z.TextRenderer=je;z.Lexer=K;z.lexer=K.lex;z.Tokenizer=ye;z.Hooks=ge;z.parse=z;z.options;z.setOptions;z.use;z.walkTokens;z.parseInline;J.parse;K.lex;const En={key:0,class:"flex items-center gap-2 text-sm text-muted"},Mn={key:1,class:"flex items-center gap-2 text-sm text-muted"},Vn={key:2,class:"flex items-center gap-3 flex-wrap"},On={key:3,class:"flex items-center gap-3 flex-wrap"},Dn={key:4,class:"flex items-center gap-3 flex-wrap"},Un={class:"space-y-4"},jn={key:0,class:"text-sm text-red-600"},Fn=["innerHTML"],Nn={class:"space-y-3"},Zn={class:"flex items-center justify-end gap-2 w-full"},Hn=Ae({__name:"IntegrationCredentials",props:{integrationId:{},integrationType:{},currentVariant:{}},emits:["saved","disconnected"],setup(s,{emit:e}){const n=s,l=e,t=B(null),i=B(!0),r=B(!1),c=B(!1),a=B(null),h=B(void 0),p=he({}),m=B(!1),u=B(!1),b=B(!1),x=A(()=>(t.value?.variants?.length??0)>1),q=A(()=>(t.value?.variants||[]).map(g=>({label:g.label,value:g.key}))),M=A(()=>t.value?.variants?.find(g=>g.key===h.value)??null),U=A(()=>{const g=M.value?.schema?.properties||{};return Object.entries(g)}),V=A(()=>{const g=M.value?.hintMarkdown;return g?z.parse(g):""});function H(g){const d=g.toLowerCase();return d.includes("token")||d.includes("key")||d.includes("secret")||d.includes("password")||d.includes("json")}function D(){for(const g of Object.keys(p))p[g]=""}function j(){D(),b.value=!0}ie(h,()=>{D()});async function E(){i.value=!0,r.value=!1;try{const[g,d]=await Promise.all([$fetch(`/api/integrations/${n.integrationId}/credentials-config`),$fetch(`/api/integrations/${n.integrationId}/credentials-status`)]);t.value=g,c.value=!!d?.hasCredentials,a.value=d?.health_status??null,h.value=n.currentVariant||g?.defaultVariant||g?.variants?.[0]?.key||void 0}catch{r.value=!0}finally{i.value=!1}}async function G(){m.value=!0;try{const g={};for(const[$]of U.value){const _=(p[$]||"").trim();_&&(g[$]=_)}h.value&&(g.credentialVariant=h.value);const d=await $fetch(`/api/integrations/${n.integrationId}/credentials`,{method:"POST",body:g});c.value=!0,a.value=d.health_status??"connected",b.value=!1,D(),l("saved")}finally{m.value=!1}}async function k(){u.value=!0;try{await $fetch(`/api/integrations/${n.integrationId}/credentials`,{method:"DELETE"}),c.value=!1,a.value="disconnected",l("disconnected")}finally{u.value=!1}}return E(),(g,d)=>{const $=be,_=qe,te=tt,S=et,O=Zt,ne=Pe;return y(),L("div",null,[o(i)?(y(),L("div",En,[R($,{name:"i-lucide-loader-2",class:"animate-spin"}),d[3]||(d[3]=P(" Checking connection… ",-1))])):o(t)?.supportsCredentials===!1?(y(),L("div",Mn,[R($,{name:"i-lucide-info"}),d[4]||(d[4]=P(" No credentials required for this integration. ",-1))])):o(a)==="connected"?(y(),L("div",Vn,[d[7]||(d[7]=w("div",{class:"flex items-center gap-2 text-sm font-medium text-green-600 dark:text-green-400"},[w("span",{class:"inline-block w-2 h-2 rounded-full bg-green-500"}),P(" Connected ")],-1)),R(_,{size:"xs",variant:"soft",color:"neutral",icon:"i-lucide-refresh-cw",onClick:j},{default:C(()=>[...d[5]||(d[5]=[P(" Reconfigure ",-1)])]),_:1}),R(_,{size:"xs",variant:"soft",color:"error",icon:"i-lucide-unplug",loading:o(u),onClick:k},{default:C(()=>[...d[6]||(d[6]=[P(" Disconnect ",-1)])]),_:1},8,["loading"])])):o(a)==="invalid_credentials"?(y(),L("div",On,[d[10]||(d[10]=w("div",{class:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400"},[w("span",{class:"inline-block w-2 h-2 rounded-full bg-red-500"}),P(" Invalid credentials ")],-1)),R(_,{size:"sm",icon:"i-lucide-refresh-cw",color:"primary",onClick:j},{default:C(()=>[...d[8]||(d[8]=[P(" Reconfigure ",-1)])]),_:1}),R(_,{size:"xs",variant:"soft",color:"error",icon:"i-lucide-unplug",loading:o(u),onClick:k},{default:C(()=>[...d[9]||(d[9]=[P(" Disconnect ",-1)])]),_:1},8,["loading"])])):(y(),L("div",Dn,[d[12]||(d[12]=w("div",{class:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400"},[w("span",{class:"inline-block w-2 h-2 rounded-full bg-red-500"}),P(" Not connected ")],-1)),R(_,{size:"sm",icon:"i-lucide-plug",color:"primary",onClick:j},{default:C(()=>[...d[11]||(d[11]=[P(" Connect ",-1)])]),_:1})])),R(ne,{open:o(b),"onUpdate:open":d[2]||(d[2]=F=>ae(b)?b.value=F:null),title:o(c)?"Reconfigure Credentials":"Connect Integration",description:"Enter your credentials to connect this integration."},{body:C(()=>[w("div",Un,[o(r)?(y(),L("div",jn," Failed to load credential schema. Please try again. ")):(y(),L(fe,{key:1},[o(x)?(y(),X(S,{key:0,label:"Credential type"},{default:C(()=>[R(te,{modelValue:o(h),"onUpdate:modelValue":d[0]||(d[0]=F=>ae(h)?h.value=F:null),items:o(q),class:"w-full"},null,8,["modelValue","items"])]),_:1})):W("",!0),o(M)?.hintMarkdown?(y(),L("div",{key:1,class:"hint-markdown text-sm bg-[var(--ui-bg-elevated)] rounded-md px-3 py-2",innerHTML:o(V)},null,8,Fn)):W("",!0),w("div",Nn,[(y(!0),L(fe,null,ze(o(U),([F,T])=>(y(),X(S,{key:F,label:T.title||F,description:T.description},{default:C(()=>[R(O,{modelValue:o(p)[F],"onUpdate:modelValue":ee=>o(p)[F]=ee,type:H(F)?"password":"text",class:"w-full"},null,8,["modelValue","onUpdate:modelValue","type"])]),_:2},1032,["label","description"]))),128))])],64))])]),footer:C(()=>[w("div",Zn,[R(_,{variant:"ghost",color:"neutral",disabled:o(m),onClick:d[1]||(d[1]=F=>b.value=!1)},{default:C(()=>[...d[13]||(d[13]=[P(" Cancel ",-1)])]),_:1},8,["disabled"]),R(_,{loading:o(m),icon:"i-lucide-check",onClick:G},{default:C(()=>[...d[14]||(d[14]=[P(" Save Credentials ",-1)])]),_:1},8,["loading"])])]),_:1},8,["open","title"])])}}}),Gn=Object.assign(Lt(Hn,[["__scopeId","data-v-7de84f63"]]),{__name:"IntegrationCredentials"}),Qn={class:"space-y-4"},Xn={key:1,class:"space-y-2"},Wn=["checked","disabled","onChange"],Kn={key:1,class:"text-sm text-red-600 dark:text-red-400"},Jn={class:"flex items-center justify-end gap-2 w-full"},Yn=Ae({__name:"IntegrationVariantConfigDialog",props:{open:{type:Boolean},integrationId:{},currentType:{},baseType:{},baseName:{},variants:{},saving:{type:Boolean}},emits:["update:open","confirm"],setup(s,{emit:e}){const n=s,l=e,t=A({get:()=>n.open,set:k=>l("update:open",k)}),i=B(n.currentType),r=he({}),c=he({}),a=he({}),h=he({}),p=B(null),m=A(()=>[{label:`Full ${n.baseName}`,value:n.baseType},...n.variants.map(k=>({label:k.label||k.type,value:k.type}))]),u=A(()=>n.variants.find(k=>k.type===i.value)??null),b=A(()=>u.value?.variantConfig??[]),x=A(()=>b.value.map(k=>k.selectionMode==="multi"?`${k.key}:${(a[k.key]||[]).join(",")}`:`${k.key}:${c[k.key]||""}`).join("|"));function q(){for(const k of Object.keys(c))delete c[k];for(const k of Object.keys(a))delete a[k]}function M(){p.value=null,q();for(const k of Object.keys(r))delete r[k];for(const k of Object.keys(h))delete h[k]}function U(k){const g=r[k.key]||[];return k.selectionMode==="multi"?g.filter(d=>(a[k.key]||[]).includes(d.id)):g.filter(d=>d.id===c[k.key])}function V(k=!1){const g={};for(const d of b.value){const $=U(d);if(d.selectionMode==="multi"){if(!$.length)continue;g[`${d.key}Ids`]=$.map(_=>_.id),k||(g[`${d.key}Names`]=$.map(_=>_.name))}else{const _=$[0];if(!_)continue;g[`${d.key}Id`]=_.id,k||(g[`${d.key}Name`]=_.name)}}return g}async function H(){if(!t.value)return;if(!u.value){p.value=null;return}p.value=null;const k={};for(const g of b.value){h[g.key]=!0;try{const d=await $fetch(`/api/integrations/${n.integrationId}/variant-options`,{method:"POST",body:{forIntegrationType:u.value.type,key:g.key,config:k}});r[g.key]=d.options}catch(d){console.error(`Failed to load options for ${g.key}`,d),r[g.key]=[],p.value=d instanceof Error?d.message:`Failed to load ${g.label.toLowerCase()} options`}finally{h[g.key]=!1}if(g.selectionMode==="multi"){const d=new Set((r[g.key]||[]).map($=>$.id));a[g.key]=(a[g.key]||[]).filter($=>d.has($))}else c[g.key]&&!(r[g.key]||[]).some(d=>d.id===c[g.key])&&(c[g.key]="");Object.assign(k,V())}}function D(k,g){const d=new Set(a[k.key]||[]);d.has(g)?d.delete(g):d.add(g),a[k.key]=[...d]}const j=A(()=>i.value===n.baseType?!0:u.value?b.value.every(k=>k.selectionMode==="multi"?!!(a[k.key]||[]).length:!!c[k.key]):!1),E=A(()=>b.value.flatMap(k=>U(k).map(g=>g.name)).join(" / ")||null);ie(()=>n.open,k=>{k&&(i.value=n.currentType,M(),H())},{immediate:!0}),ie(i,()=>{t.value&&(M(),H())}),ie(x,()=>{!t.value||i.value===n.baseType||H()});function G(){l("confirm",{type:i.value,config:i.value===n.baseType?null:V(),labelSuffix:i.value===n.baseType?null:E.value})}return(k,g)=>{const d=tt,$=et,_=qe,te=Pe;return y(),X(te,{open:o(t),"onUpdate:open":g[2]||(g[2]=S=>ae(t)?t.value=S:null),title:"Reduce integration scope",description:"Choose a reduced scope for this integration or keep full access."},{body:C(()=>[w("div",Qn,[R($,{label:"Scope mode"},{default:C(()=>[R(d,{modelValue:o(i),"onUpdate:modelValue":g[0]||(g[0]=S=>ae(i)?i.value=S:null),items:o(m),class:"w-full"},null,8,["modelValue","items"])]),_:1}),o(i)!==s.baseType&&o(b).length?(y(!0),L(fe,{key:0},ze(o(b),S=>(y(),X($,{key:S.key,label:S.label,description:S.selectionMode==="multi"?`Choose one or more ${S.label.toLowerCase()} values.`:`Choose a ${S.label.toLowerCase()} value.`},{default:C(()=>[S.selectionMode==="single"?(y(),X(d,{key:0,modelValue:o(c)[S.key],"onUpdate:modelValue":O=>o(c)[S.key]=O,items:(o(r)[S.key]||[]).map(O=>({label:O.name,value:O.id})),loading:o(h)[S.key],disabled:o(h)[S.key],placeholder:`Select ${S.label.toLowerCase()}...`,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","items","loading","disabled","placeholder"])):(y(),L("div",Xn,[(y(!0),L(fe,null,ze(o(r)[S.key]||[],O=>(y(),L("label",{key:O.id,class:"flex items-center gap-2 text-sm"},[w("input",{type:"checkbox",checked:(o(a)[S.key]||[]).includes(O.id),disabled:o(h)[S.key],onChange:ne=>D(S,O.id)},null,40,Wn),w("span",null,le(O.name),1)]))),128))]))]),_:2},1032,["label","description"]))),128)):W("",!0),o(p)?(y(),L("p",Kn,le(o(p)),1)):W("",!0)])]),footer:C(()=>[w("div",Jn,[R(_,{variant:"ghost",color:"neutral",disabled:s.saving,onClick:g[1]||(g[1]=S=>t.value=!1)},{default:C(()=>[...g[3]||(g[3]=[P(" Cancel ",-1)])]),_:1},8,["disabled"]),R(_,{disabled:!o(j)||s.saving,loading:s.saving,onClick:G},{default:C(()=>[...g[4]||(g[4]=[P(" Save Scope ",-1)])]),_:1},8,["disabled","loading"])])]),_:1},8,["open"])}}}),es=Object.assign(Yn,{__name:"IntegrationVariantConfigDialog"}),ts={key:0,class:"text-sm text-muted py-8 text-center"},ns={key:1,class:"py-8 text-center space-y-4"},ss={class:"flex items-center justify-between gap-4"},ls={class:"flex items-center gap-3"},rs={class:"text-2xl font-semibold"},is={class:"text-sm text-muted mt-1"},as={class:"flex items-center justify-between gap-4 mb-1"},os={class:"border border-[var(--ui-border)] rounded-lg px-4 py-3"},cs={key:0,class:"mt-2 text-xs text-muted"},us={class:"space-y-3"},ps={class:"flex gap-2"},ds={key:0,class:"text-xs text-amber-600 dark:text-amber-400"},hs={class:"space-y-3"},gs={class:"sticky bottom-0 py-4 bg-[var(--ui-bg)] border-t border-[var(--ui-border)] -mx-4 px-4 flex items-center justify-between gap-4"},fs={class:"flex items-center justify-end gap-2 w-full"},bs=Ae({__name:"[id]",async setup(s){let e,n;const l=/-/g,t=/\s+/,r=Et().params.id,{data:c,pending:a,error:h,refresh:p}=([e,n]=He(()=>Ge("/api/integrations","$tUtKcl3GqX")),e=await e,n(),e),{data:m}=([e,n]=He(()=>Ge("/api/catalog","$NlPmMk6-3b")),e=await e,n(),e),u=A(()=>c.value?.find(I=>I.id===r)??null),b=B(!0),x=B(null),q=B([]),M=B([]),U=B(null),V=B(!1),H=B(!1),D=B(!1),j=B(!1),E=B(null),G=B(!1);function k(I){return I.replace(l," ").split(t).filter(Boolean).map(f=>f[0]?`${f[0].toUpperCase()}${f.slice(1)}`:f).join(" ")}const g=A(()=>(m.value||[]).find(I=>I.type===u.value?.type||I.variants?.some(f=>f.type===u.value?.type))??null),d=A(()=>g.value?.type??u.value?.type??null),$=A(()=>g.value?.variants?.filter(I=>(I.variantConfig?.length??0)>0)??[]),_=A(()=>$.value.length>0&&!!u.value),te=A(()=>E.value==="connected"),S=A(()=>_.value&&te.value),O=A(()=>g.value?.name||(d.value?k(d.value):"Integration")),ne=A(()=>!_.value||S.value?null:G.value?"Checking connection before enabling reduced scope...":E.value==="invalid_credentials"?"Reconnect this integration before choosing a reduced scope.":"Connect this integration before choosing a reduced scope.");async function F(){if(!u.value||!_.value){E.value=null;return}G.value=!0;try{const I=await $fetch(`/api/integrations/${u.value.id}/credentials-status`);E.value=I?.health_status??"disconnected"}catch{E.value="disconnected"}finally{G.value=!1}}function T(){if(!u.value)return;b.value=u.value.enabled!==!1,x.value=u.value.maxScope==="read"?"read":null,M.value=u.value.disabledTools?[...u.value.disabledTools]:[];const I=U.value?.toolsets,f=Array.isArray(I)?I.map(Z=>Z.key).filter(Z=>Z!=="__all__"&&Z!=="custom"):[];q.value=u.value.enabledToolsets?.length?[...u.value.enabledToolsets]:f}ie(u,()=>T(),{immediate:!0}),ie(()=>u.value?.id,()=>{F()},{immediate:!0}),ie(()=>U.value?.toolsets,I=>{!u.value||!I?.length||u.value.enabledToolsets?.length||(q.value=I.map(f=>f.key).filter(f=>f!=="__all__"))},{deep:!0});async function ee(){if(u.value){H.value=!0;try{const I=u.value.id;await $fetch("/api/integrations",{method:"POST",body:{...u.value,enabled:b.value}});const f=U.value?.toolsets,Z=Array.isArray(f)?f.map(ue=>ue.key).filter(ue=>ue!=="__all__"&&ue!=="custom"):[],_e=Z.length&&q.value.length<Z.length?q.value:[];await $fetch(`/api/integrations/${I}/toolsets`,{method:"POST",body:{enabledToolsets:_e}}),await $fetch(`/api/integrations/${I}/permissions`,{method:"POST",body:{maxScope:x.value,disabledTools:M.value.length?M.value:null}}),await p()}finally{H.value=!1}}}async function Se(){u.value&&(V.value=!0)}async function gt(){u.value&&(V.value=!1,await $fetch(`/api/integrations/${u.value.id}`,{method:"DELETE"}),Ot("/integrations"))}async function ft(){S.value&&(D.value=!0)}async function Fe(){await p(),await F(),S.value&&(D.value=!0)}async function kt(I){if(!(!u.value||!d.value)){j.value=!0;try{const f=I.type===d.value?O.value:I.labelSuffix?`${O.value}: ${I.labelSuffix}`:u.value.label;await $fetch("/api/integrations",{method:"POST",body:{...u.value,type:I.type,label:f,config:I.config}}),D.value=!1,await p()}finally{j.value=!1}}}return(I,f)=>{const Z=qe,_e=be,ue=Vt,mt=Dt,bt=Ut,xt=Gn,yt=jt,vt=Pe,wt=Mt;return y(),X(wt,{class:"py-10 space-y-8 max-w-3xl"},{default:C(()=>[o(a)?(y(),L("div",ts," Loading… ")):o(h)||!o(u)?(y(),L("div",ns,[f[9]||(f[9]=w("div",{class:"text-sm text-red-600"}," Integration not found. ",-1)),R(Z,{to:"/integrations",variant:"soft",color:"neutral",icon:"i-lucide-arrow-left"},{default:C(()=>[...f[8]||(f[8]=[P(" Back to Integrations ",-1)])]),_:1})])):(y(),L(fe,{key:2},[w("div",null,[R(ue,{to:"/integrations",class:"inline-flex items-center gap-1 text-sm text-muted hover:text-[var(--ui-text)] transition-colors mb-4"},{default:C(()=>[R(_e,{name:"i-lucide-arrow-left",class:"w-4 h-4"}),f[10]||(f[10]=P(" Back to Integrations ",-1))]),_:1}),w("div",ss,[w("div",ls,[w("h1",rs,le(o(u).label),1),R(mt,{size:"sm",color:"neutral",variant:"subtle"},{default:C(()=>[P(le(o(u).type),1)]),_:1})]),R(bt,{modelValue:o(b),"onUpdate:modelValue":f[0]||(f[0]=Q=>ae(b)?b.value=Q:null),size:"lg"},null,8,["modelValue"])]),w("p",is,le(o(u).type)+" · "+le(o(u).referenceId),1)]),w("section",null,[w("div",as,[f[12]||(f[12]=w("h2",{class:"text-lg font-medium"}," Connection ",-1)),o(_)?(y(),X(Z,{key:0,size:"xs",variant:"soft",color:"neutral",icon:"i-lucide-filter",disabled:!o(S)||o(G),loading:o(G),onClick:ft},{default:C(()=>[...f[11]||(f[11]=[P(" Reduce Scope ",-1)])]),_:1},8,["disabled","loading"])):W("",!0)]),w("div",os,[R(xt,{"integration-id":o(u).id,"integration-type":o(u).type,"current-variant":o(u).credentialVariant,onSaved:Fe,onDisconnected:Fe},null,8,["integration-id","integration-type","current-variant"])]),o(ne)?(y(),L("p",cs,le(o(ne)),1)):W("",!0)]),w("section",us,[f[13]||(f[13]=w("h2",{class:"text-lg font-medium"}," Access Level ",-1)),w("div",ps,[w("button",{type:"button",class:se(["px-4 py-2 text-sm rounded-lg border transition-colors",o(x)!=="read"?"border-green-500 bg-green-50 text-green-700 font-medium dark:bg-green-950 dark:text-green-300":"border-[var(--ui-border)] text-muted hover:bg-[var(--ui-bg-elevated)]"]),onClick:f[1]||(f[1]=Q=>x.value=null)}," Read + Write ",2),w("button",{type:"button",class:se(["px-4 py-2 text-sm rounded-lg border transition-colors",o(x)==="read"?"border-green-500 bg-green-50 text-green-700 font-medium dark:bg-green-950 dark:text-green-300":"border-[var(--ui-border)] text-muted hover:bg-[var(--ui-bg-elevated)]"]),onClick:f[2]||(f[2]=Q=>x.value="read")}," Read-only ",2)]),o(x)==="read"?(y(),L("p",ds," Only read tools will be available. Write and admin tools will be greyed out below. ")):W("",!0)]),w("section",hs,[f[14]||(f[14]=w("h2",{class:"text-lg font-medium"}," Tools ",-1)),R(yt,{ref_key:"toolsTreeRef",ref:U,"integration-id":o(u).id,"max-scope":o(x),"enabled-toolsets":o(q),"disabled-tools":o(M),"onUpdate:enabledToolsets":f[3]||(f[3]=Q=>q.value=Q),"onUpdate:disabledTools":f[4]||(f[4]=Q=>M.value=Q)},null,8,["integration-id","max-scope","enabled-toolsets","disabled-tools"])]),w("div",gs,[R(Z,{loading:o(H),size:"lg",onClick:ee},{default:C(()=>[...f[15]||(f[15]=[P(" Save Changes ",-1)])]),_:1},8,["loading"]),R(Z,{variant:"soft",color:"error",icon:"i-lucide-trash-2",onClick:Se},{default:C(()=>[...f[16]||(f[16]=[P(" Remove Integration ",-1)])]),_:1})]),R(vt,{open:o(V),"onUpdate:open":f[6]||(f[6]=Q=>ae(V)?V.value=Q:null),title:"Remove integration",description:o(u)?`Remove "${o(u).label}"? This cannot be undone.`:void 0},{footer:C(()=>[w("div",fs,[R(Z,{variant:"ghost",color:"neutral",onClick:f[5]||(f[5]=Q=>V.value=!1)},{default:C(()=>[...f[17]||(f[17]=[P(" Cancel ",-1)])]),_:1}),R(Z,{color:"error",icon:"i-lucide-trash-2",onClick:gt},{default:C(()=>[...f[18]||(f[18]=[P(" Remove ",-1)])]),_:1})])]),_:1},8,["open","description"]),o(u)&&o(d)?(y(),X(es,{key:0,open:o(D),"onUpdate:open":f[7]||(f[7]=Q=>ae(D)?D.value=Q:null),"integration-id":o(u).id,"current-type":o(u).type,"base-type":o(d),"base-name":o(O),variants:o($),saving:o(j),onConfirm:kt},null,8,["open","integration-id","current-type","base-type","base-name","variants","saving"])):W("",!0)],64))]),_:1})}}});export{bs as default};
|
|
58
|
+
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${Y(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:e,tokens:n}){let l=this.parser.parseInline(n),t=Ke(s);if(t===null)return l;s=t;let i='<a href="'+s+'"';return e&&(i+=' title="'+Y(e)+'"'),i+=">"+l+"</a>",i}image({href:s,title:e,text:n,tokens:l}){l&&(n=this.parser.parseInline(l,this.parser.textRenderer));let t=Ke(s);if(t===null)return Y(n);s=t;let i=`<img src="${s}" alt="${Y(n)}"`;return e&&(i+=` title="${Y(e)}"`),i+=">",i}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Y(s.text)}},Ue=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},J=class Ie{options;renderer;textRenderer;constructor(e){this.options=e||ce,this.options.renderer=this.options.renderer||new ve,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ue}static parse(e,n){return new Ie(n).parse(e)}static parseInline(e,n){return new Ie(n).parseInline(e)}parse(e){let n="";for(let l=0;l<e.length;l++){let t=e[l];if(this.options.extensions?.renderers?.[t.type]){let r=t,c=this.options.extensions.renderers[r.type].call({parser:this},r);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(r.type)){n+=c||"";continue}}let i=t;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let r='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return n}parseInline(e,n=this.renderer){let l="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let c=this.options.extensions.renderers[i.type].call({parser:this},i);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){l+=c||"";continue}}let r=i;switch(r.type){case"escape":{l+=n.text(r);break}case"html":{l+=n.html(r);break}case"link":{l+=n.link(r);break}case"image":{l+=n.image(r);break}case"checkbox":{l+=n.checkbox(r);break}case"strong":{l+=n.strong(r);break}case"em":{l+=n.em(r);break}case"codespan":{l+=n.codespan(r);break}case"br":{l+=n.br(r);break}case"del":{l+=n.del(r);break}case"text":{l+=n.text(r);break}default:{let c='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return l}},ge=class{options;block;constructor(s){this.options=s||ce}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(){return this.block?K.lex:K.lexInline}provideParser(){return this.block?J.parse:J.parseInline}},Ln=class{defaults=Be();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=J;Renderer=ve;TextRenderer=Ue;Lexer=K;Tokenizer=ye;Hooks=ge;constructor(...s){this.use(...s)}walkTokens(s,e){let n=[];for(let l of s)switch(n=n.concat(e.call(this,l)),l.type){case"table":{let t=l;for(let i of t.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let r of i)n=n.concat(this.walkTokens(r.tokens,e));break}case"list":{let t=l;n=n.concat(this.walkTokens(t.items,e));break}default:{let t=l;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let r=t[i].flat(1/0);n=n.concat(this.walkTokens(r,e))}):t.tokens&&(n=n.concat(this.walkTokens(t.tokens,e)))}}return n}use(...s){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(n=>{let l={...n};if(l.async=this.defaults.async||l.async||!1,n.extensions&&(n.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...r){let c=t.renderer.apply(this,r);return c===!1&&(c=i.apply(this,r)),c}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),l.extensions=e),n.renderer){let t=this.defaults.renderer||new ve(this.defaults);for(let i in n.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let r=i,c=n.renderer[r],a=t[r];t[r]=(...h)=>{let p=c.apply(t,h);return p===!1&&(p=a.apply(t,h)),p||""}}l.renderer=t}if(n.tokenizer){let t=this.defaults.tokenizer||new ye(this.defaults);for(let i in n.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let r=i,c=n.tokenizer[r],a=t[r];t[r]=(...h)=>{let p=c.apply(t,h);return p===!1&&(p=a.apply(t,h)),p}}l.tokenizer=t}if(n.hooks){let t=this.defaults.hooks||new ge;for(let i in n.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let r=i,c=n.hooks[r],a=t[r];ge.passThroughHooks.has(i)?t[r]=h=>{if(this.defaults.async&&ge.passThroughHooksRespectAsync.has(i))return(async()=>{let m=await c.call(t,h);return a.call(t,m)})();let p=c.call(t,h);return a.call(t,p)}:t[r]=(...h)=>{if(this.defaults.async)return(async()=>{let m=await c.apply(t,h);return m===!1&&(m=await a.apply(t,h)),m})();let p=c.apply(t,h);return p===!1&&(p=a.apply(t,h)),p}}l.hooks=t}if(n.walkTokens){let t=this.defaults.walkTokens,i=n.walkTokens;l.walkTokens=function(r){let c=[];return c.push(i.call(this,r)),t&&(c=c.concat(t.call(this,r))),c}}this.defaults={...this.defaults,...l}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,e){return K.lex(s,e??this.defaults)}parser(s,e){return J.parse(s,e??this.defaults)}parseMarkdown(s){return(e,n)=>{let l={...n},t={...this.defaults,...l},i=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&l.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=s),t.async)return(async()=>{let r=t.hooks?await t.hooks.preprocess(e):e,c=await(t.hooks?await t.hooks.provideLexer():s?K.lex:K.lexInline)(r,t),a=t.hooks?await t.hooks.processAllTokens(c):c;t.walkTokens&&await Promise.all(this.walkTokens(a,t.walkTokens));let h=await(t.hooks?await t.hooks.provideParser():s?J.parse:J.parseInline)(a,t);return t.hooks?await t.hooks.postprocess(h):h})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let r=(t.hooks?t.hooks.provideLexer():s?K.lex:K.lexInline)(e,t);t.hooks&&(r=t.hooks.processAllTokens(r)),t.walkTokens&&this.walkTokens(r,t.walkTokens);let c=(t.hooks?t.hooks.provideParser():s?J.parse:J.parseInline)(r,t);return t.hooks&&(c=t.hooks.postprocess(c)),c}catch(r){return i(r)}}}onError(s,e){return n=>{if(n.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,s){let l="<p>An error occurred:</p><pre>"+Y(n.message+"",!0)+"</pre>";return e?Promise.resolve(l):l}if(e)return Promise.reject(n);throw n}}},oe=new Ln;function z(s,e){return oe.parse(s,e)}z.options=z.setOptions=function(s){return oe.setOptions(s),z.defaults=oe.defaults,nt(z.defaults),z};z.getDefaults=Be;z.defaults=ce;z.use=function(...s){return oe.use(...s),z.defaults=oe.defaults,nt(z.defaults),z};z.walkTokens=function(s,e){return oe.walkTokens(s,e)};z.parseInline=oe.parseInline;z.Parser=J;z.parser=J.parse;z.Renderer=ve;z.TextRenderer=Ue;z.Lexer=K;z.lexer=K.lex;z.Tokenizer=ye;z.Hooks=ge;z.parse=z;z.options;z.setOptions;z.use;z.walkTokens;z.parseInline;J.parse;K.lex;const En={key:0,class:"flex items-center gap-2 text-sm text-muted"},Vn={key:1,class:"flex items-center gap-2 text-sm text-muted"},Mn={key:2,class:"flex items-center gap-3 flex-wrap"},Dn={key:3,class:"flex items-center gap-3 flex-wrap"},On={key:4,class:"flex items-center gap-3 flex-wrap"},jn={class:"space-y-4"},Un={key:0,class:"text-sm text-red-600"},Fn=["innerHTML"],Nn={class:"space-y-3"},Zn={class:"flex items-center justify-end gap-2 w-full"},Hn=Ae({__name:"IntegrationCredentials",props:{integrationId:{},integrationType:{},currentVariant:{}},emits:["saved","disconnected"],setup(s,{emit:e}){const n=s,l=e,t=B(null),i=B(!0),r=B(!1),c=B(!1),a=B(null),h=B(void 0),p=he({}),m=B(!1),u=B(!1),b=B(!1),x=A(()=>(t.value?.variants?.length??0)>1),q=A(()=>(t.value?.variants||[]).map(g=>({label:g.label,value:g.key}))),V=A(()=>t.value?.variants?.find(g=>g.key===h.value)??null),j=A(()=>{const g=V.value?.schema?.properties||{};return Object.entries(g)}),M=A(()=>{const g=V.value?.hintMarkdown;return g?z.parse(g):""});function H(g){const d=g.toLowerCase();return d.includes("token")||d.includes("key")||d.includes("secret")||d.includes("password")||d.includes("json")}function O(){for(const g of Object.keys(p))p[g]=""}function U(){O(),b.value=!0}ie(h,()=>{O()});async function E(){i.value=!0,r.value=!1;try{const[g,d]=await Promise.all([$fetch(`/api/integrations/${n.integrationId}/credentials-config`),$fetch(`/api/integrations/${n.integrationId}/credentials-status`)]);t.value=g,c.value=!!d?.hasCredentials,a.value=d?.health_status??null,h.value=n.currentVariant||g?.defaultVariant||g?.variants?.[0]?.key||void 0}catch{r.value=!0}finally{i.value=!1}}async function G(){m.value=!0;try{const g={};for(const[$]of j.value){const _=(p[$]||"").trim();_&&(g[$]=_)}h.value&&(g.credentialVariant=h.value);const d=await $fetch(`/api/integrations/${n.integrationId}/credentials`,{method:"POST",body:g});c.value=!0,a.value=d.health_status??"connected",b.value=!1,O(),l("saved")}finally{m.value=!1}}async function k(){u.value=!0;try{await $fetch(`/api/integrations/${n.integrationId}/credentials`,{method:"DELETE"}),c.value=!1,a.value="disconnected",l("disconnected")}finally{u.value=!1}}return E(),(g,d)=>{const $=be,_=qe,te=tt,S=et,D=Zt,ne=Pe;return y(),L("div",null,[o(i)?(y(),L("div",En,[R($,{name:"i-lucide-loader-2",class:"animate-spin"}),d[3]||(d[3]=P(" Checking connection… ",-1))])):o(t)?.supportsCredentials===!1?(y(),L("div",Vn,[R($,{name:"i-lucide-info"}),d[4]||(d[4]=P(" No credentials required for this integration. ",-1))])):o(a)==="connected"?(y(),L("div",Mn,[d[7]||(d[7]=w("div",{class:"flex items-center gap-2 text-sm font-medium text-green-600 dark:text-green-400"},[w("span",{class:"inline-block w-2 h-2 rounded-full bg-green-500"}),P(" Connected ")],-1)),R(_,{size:"xs",variant:"soft",color:"neutral",icon:"i-lucide-refresh-cw",onClick:U},{default:C(()=>[...d[5]||(d[5]=[P(" Reconfigure ",-1)])]),_:1}),R(_,{size:"xs",variant:"soft",color:"error",icon:"i-lucide-unplug",loading:o(u),onClick:k},{default:C(()=>[...d[6]||(d[6]=[P(" Disconnect ",-1)])]),_:1},8,["loading"])])):o(a)==="invalid_credentials"?(y(),L("div",Dn,[d[10]||(d[10]=w("div",{class:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400"},[w("span",{class:"inline-block w-2 h-2 rounded-full bg-red-500"}),P(" Invalid credentials ")],-1)),R(_,{size:"sm",icon:"i-lucide-refresh-cw",color:"primary",onClick:U},{default:C(()=>[...d[8]||(d[8]=[P(" Reconfigure ",-1)])]),_:1}),R(_,{size:"xs",variant:"soft",color:"error",icon:"i-lucide-unplug",loading:o(u),onClick:k},{default:C(()=>[...d[9]||(d[9]=[P(" Disconnect ",-1)])]),_:1},8,["loading"])])):(y(),L("div",On,[d[12]||(d[12]=w("div",{class:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400"},[w("span",{class:"inline-block w-2 h-2 rounded-full bg-red-500"}),P(" Not connected ")],-1)),R(_,{size:"sm",icon:"i-lucide-plug",color:"primary",onClick:U},{default:C(()=>[...d[11]||(d[11]=[P(" Connect ",-1)])]),_:1})])),R(ne,{open:o(b),"onUpdate:open":d[2]||(d[2]=F=>ae(b)?b.value=F:null),title:o(c)?"Reconfigure Credentials":"Connect Integration",description:"Enter your credentials to connect this integration."},{body:C(()=>[w("div",jn,[o(r)?(y(),L("div",Un," Failed to load credential schema. Please try again. ")):(y(),L(fe,{key:1},[o(x)?(y(),W(S,{key:0,label:"Credential type"},{default:C(()=>[R(te,{modelValue:o(h),"onUpdate:modelValue":d[0]||(d[0]=F=>ae(h)?h.value=F:null),items:o(q),class:"w-full"},null,8,["modelValue","items"])]),_:1})):X("",!0),o(V)?.hintMarkdown?(y(),L("div",{key:1,class:"hint-markdown text-sm bg-[var(--ui-bg-elevated)] rounded-md px-3 py-2",innerHTML:o(M)},null,8,Fn)):X("",!0),w("div",Nn,[(y(!0),L(fe,null,ze(o(j),([F,T])=>(y(),W(S,{key:F,label:T.title||F,description:T.description},{default:C(()=>[R(D,{modelValue:o(p)[F],"onUpdate:modelValue":ee=>o(p)[F]=ee,type:H(F)?"password":"text",class:"w-full"},null,8,["modelValue","onUpdate:modelValue","type"])]),_:2},1032,["label","description"]))),128))])],64))])]),footer:C(()=>[w("div",Zn,[R(_,{variant:"ghost",color:"neutral",disabled:o(m),onClick:d[1]||(d[1]=F=>b.value=!1)},{default:C(()=>[...d[13]||(d[13]=[P(" Cancel ",-1)])]),_:1},8,["disabled"]),R(_,{loading:o(m),icon:"i-lucide-check",onClick:G},{default:C(()=>[...d[14]||(d[14]=[P(" Save Credentials ",-1)])]),_:1},8,["loading"])])]),_:1},8,["open","title"])])}}}),Gn=Object.assign(Lt(Hn,[["__scopeId","data-v-7de84f63"]]),{__name:"IntegrationCredentials"}),Qn={class:"space-y-4"},Wn={key:1,class:"space-y-2"},Xn=["checked","disabled","onChange"],Kn={key:1,class:"text-sm text-red-600 dark:text-red-400"},Jn={class:"flex items-center justify-end gap-2 w-full"},Yn=Ae({__name:"IntegrationVariantConfigDialog",props:{open:{type:Boolean},integrationId:{},currentType:{},baseType:{},baseName:{},variants:{},saving:{type:Boolean}},emits:["update:open","confirm"],setup(s,{emit:e}){const n=s,l=e,t=A({get:()=>n.open,set:k=>l("update:open",k)}),i=B(n.currentType),r=he({}),c=he({}),a=he({}),h=he({}),p=B(null),m=A(()=>[{label:`Full ${n.baseName}`,value:n.baseType},...n.variants.map(k=>({label:k.label||k.type,value:k.type}))]),u=A(()=>n.variants.find(k=>k.type===i.value)??null),b=A(()=>u.value?.variantConfig??[]),x=A(()=>b.value.map(k=>k.selectionMode==="multi"?`${k.key}:${(a[k.key]||[]).join(",")}`:`${k.key}:${c[k.key]||""}`).join("|"));function q(){for(const k of Object.keys(c))delete c[k];for(const k of Object.keys(a))delete a[k]}function V(){p.value=null,q();for(const k of Object.keys(r))delete r[k];for(const k of Object.keys(h))delete h[k]}function j(k){const g=r[k.key]||[];return k.selectionMode==="multi"?g.filter(d=>(a[k.key]||[]).includes(d.id)):g.filter(d=>d.id===c[k.key])}function M(k=!1){const g={};for(const d of b.value){const $=j(d);if(d.selectionMode==="multi"){if(!$.length)continue;g[`${d.key}Ids`]=$.map(_=>_.id),k||(g[`${d.key}Names`]=$.map(_=>_.name))}else{const _=$[0];if(!_)continue;g[`${d.key}Id`]=_.id,k||(g[`${d.key}Name`]=_.name)}}return g}async function H(){if(!t.value)return;if(!u.value){p.value=null;return}p.value=null;const k={};for(const g of b.value){h[g.key]=!0;try{const d=await $fetch(`/api/integrations/${n.integrationId}/variant-options`,{method:"POST",body:{forIntegrationType:u.value.type,key:g.key,config:k}});r[g.key]=d.options}catch(d){console.error(`Failed to load options for ${g.key}`,d),r[g.key]=[],p.value=d instanceof Error?d.message:`Failed to load ${g.label.toLowerCase()} options`}finally{h[g.key]=!1}if(g.selectionMode==="multi"){const d=new Set((r[g.key]||[]).map($=>$.id));a[g.key]=(a[g.key]||[]).filter($=>d.has($))}else c[g.key]&&!(r[g.key]||[]).some(d=>d.id===c[g.key])&&(c[g.key]="");Object.assign(k,M())}}function O(k,g){const d=new Set(a[k.key]||[]);d.has(g)?d.delete(g):d.add(g),a[k.key]=[...d]}const U=A(()=>i.value===n.baseType?!0:u.value?b.value.every(k=>k.selectionMode==="multi"?!!(a[k.key]||[]).length:!!c[k.key]):!1),E=A(()=>b.value.flatMap(k=>j(k).map(g=>g.name)).join(" / ")||null);ie(()=>n.open,k=>{k&&(i.value=n.currentType,V(),H())},{immediate:!0}),ie(i,()=>{t.value&&(V(),H())}),ie(x,()=>{!t.value||i.value===n.baseType||H()});function G(){l("confirm",{type:i.value,config:i.value===n.baseType?null:M(),labelSuffix:i.value===n.baseType?null:E.value})}return(k,g)=>{const d=tt,$=et,_=qe,te=Pe;return y(),W(te,{open:o(t),"onUpdate:open":g[2]||(g[2]=S=>ae(t)?t.value=S:null),title:"Reduce integration scope",description:"Choose a reduced scope for this integration or keep full access."},{body:C(()=>[w("div",Qn,[R($,{label:"Scope mode"},{default:C(()=>[R(d,{modelValue:o(i),"onUpdate:modelValue":g[0]||(g[0]=S=>ae(i)?i.value=S:null),items:o(m),class:"w-full"},null,8,["modelValue","items"])]),_:1}),o(i)!==s.baseType&&o(b).length?(y(!0),L(fe,{key:0},ze(o(b),S=>(y(),W($,{key:S.key,label:S.label,description:S.selectionMode==="multi"?`Choose one or more ${S.label.toLowerCase()} values.`:`Choose a ${S.label.toLowerCase()} value.`},{default:C(()=>[S.selectionMode==="single"?(y(),W(d,{key:0,modelValue:o(c)[S.key],"onUpdate:modelValue":D=>o(c)[S.key]=D,items:(o(r)[S.key]||[]).map(D=>({label:D.name,value:D.id})),loading:o(h)[S.key],disabled:o(h)[S.key],placeholder:`Select ${S.label.toLowerCase()}...`,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","items","loading","disabled","placeholder"])):(y(),L("div",Wn,[(y(!0),L(fe,null,ze(o(r)[S.key]||[],D=>(y(),L("label",{key:D.id,class:"flex items-center gap-2 text-sm"},[w("input",{type:"checkbox",checked:(o(a)[S.key]||[]).includes(D.id),disabled:o(h)[S.key],onChange:ne=>O(S,D.id)},null,40,Xn),w("span",null,le(D.name),1)]))),128))]))]),_:2},1032,["label","description"]))),128)):X("",!0),o(p)?(y(),L("p",Kn,le(o(p)),1)):X("",!0)])]),footer:C(()=>[w("div",Jn,[R(_,{variant:"ghost",color:"neutral",disabled:s.saving,onClick:g[1]||(g[1]=S=>t.value=!1)},{default:C(()=>[...g[3]||(g[3]=[P(" Cancel ",-1)])]),_:1},8,["disabled"]),R(_,{disabled:!o(U)||s.saving,loading:s.saving,onClick:G},{default:C(()=>[...g[4]||(g[4]=[P(" Save Scope ",-1)])]),_:1},8,["disabled","loading"])])]),_:1},8,["open"])}}}),es=Object.assign(Yn,{__name:"IntegrationVariantConfigDialog"}),ts={key:0,class:"text-sm text-muted py-8 text-center"},ns={key:1,class:"py-8 text-center space-y-4"},ss={class:"flex items-center justify-between gap-4"},ls={class:"flex items-center gap-3"},rs={class:"text-2xl font-semibold"},is={class:"text-sm text-muted mt-1"},as={class:"flex items-center justify-between gap-4 mb-1"},os={class:"border border-[var(--ui-border)] rounded-lg px-4 py-3"},cs={key:0,class:"mt-2 text-xs text-muted"},us={class:"space-y-3"},ps={class:"flex gap-2"},ds={key:0,class:"text-xs text-amber-600 dark:text-amber-400"},hs={class:"space-y-3"},gs={class:"sticky bottom-0 py-4 bg-[var(--ui-bg)] border-t border-[var(--ui-border)] -mx-4 px-4 flex items-center justify-between gap-4"},fs={class:"flex items-center justify-end gap-2 w-full"},bs=Ae({__name:"[id]",async setup(s){let e,n;const l=/-/g,t=/\s+/,r=Et().params.id,{data:c,pending:a,error:h,refresh:p}=([e,n]=He(()=>Ge("/api/integrations","$DBVliiSHcs")),e=await e,n(),e),{data:m}=([e,n]=He(()=>Ge("/api/catalog","$vqD4MA92Lb")),e=await e,n(),e),u=A(()=>c.value?.find(I=>I.id===r)??null),b=B(!0),x=B(null),q=B([]),V=B([]),j=B(null),M=B(!1),H=B(!1),O=B(!1),U=B(!1),E=B(null),G=B(!1);function k(I){return I.replace(l," ").split(t).filter(Boolean).map(f=>f[0]?`${f[0].toUpperCase()}${f.slice(1)}`:f).join(" ")}const g=A(()=>(m.value||[]).find(I=>I.type===u.value?.type||I.variants?.some(f=>f.type===u.value?.type))??null),d=A(()=>g.value?.type??u.value?.type??null),$=A(()=>g.value?.variants?.filter(I=>(I.variantConfig?.length??0)>0)??[]),_=A(()=>$.value.length>0&&!!u.value),te=A(()=>E.value==="connected"),S=A(()=>_.value&&te.value),D=A(()=>g.value?.name||(d.value?k(d.value):"Integration")),ne=A(()=>!_.value||S.value?null:G.value?"Checking connection before enabling reduced scope...":E.value==="invalid_credentials"?"Reconnect this integration before choosing a reduced scope.":"Connect this integration before choosing a reduced scope.");async function F(){if(!u.value||!_.value){E.value=null;return}G.value=!0;try{const I=await $fetch(`/api/integrations/${u.value.id}/credentials-status`);E.value=I?.health_status??"disconnected"}catch{E.value="disconnected"}finally{G.value=!1}}function T(){if(!u.value)return;b.value=u.value.enabled!==!1,x.value=u.value.maxScope==="read"?"read":null,V.value=u.value.disabledTools?[...u.value.disabledTools]:[];const I=j.value?.toolsets,f=Array.isArray(I)?I.map(Z=>Z.key).filter(Z=>Z!=="__all__"&&Z!=="custom"):[];q.value=u.value.enabledToolsets?.length?[...u.value.enabledToolsets]:f}ie(u,()=>T(),{immediate:!0}),ie(()=>u.value?.id,()=>{F()},{immediate:!0}),ie(()=>j.value?.toolsets,I=>{!u.value||!I?.length||u.value.enabledToolsets?.length||(q.value=I.map(f=>f.key).filter(f=>f!=="__all__"))},{deep:!0});async function ee(){if(u.value){H.value=!0;try{const I=u.value.id;await $fetch("/api/integrations",{method:"POST",body:{...u.value,enabled:b.value}});const f=j.value?.toolsets,Z=Array.isArray(f)?f.map(ue=>ue.key).filter(ue=>ue!=="__all__"&&ue!=="custom"):[],_e=Z.length&&q.value.length<Z.length?q.value:[];await $fetch(`/api/integrations/${I}/toolsets`,{method:"POST",body:{enabledToolsets:_e}}),await $fetch(`/api/integrations/${I}/permissions`,{method:"POST",body:{maxScope:x.value,disabledTools:V.value.length?V.value:null}}),await p()}finally{H.value=!1}}}async function Se(){u.value&&(M.value=!0)}async function gt(){u.value&&(M.value=!1,await $fetch(`/api/integrations/${u.value.id}`,{method:"DELETE"}),Dt("/integrations"))}async function ft(){S.value&&(O.value=!0)}async function Fe(){await p(),await F(),S.value&&(O.value=!0)}async function kt(I){if(!(!u.value||!d.value)){U.value=!0;try{const f=I.type===d.value?D.value:I.labelSuffix?`${D.value}: ${I.labelSuffix}`:u.value.label;await $fetch("/api/integrations",{method:"POST",body:{...u.value,type:I.type,label:f,config:I.config}}),O.value=!1,await p()}finally{U.value=!1}}}return(I,f)=>{const Z=qe,_e=be,ue=Mt,mt=Ot,bt=jt,xt=Gn,yt=Ut,vt=Pe,wt=Vt;return y(),W(wt,{class:"py-10 space-y-8 max-w-3xl"},{default:C(()=>[o(a)?(y(),L("div",ts," Loading… ")):o(h)||!o(u)?(y(),L("div",ns,[f[9]||(f[9]=w("div",{class:"text-sm text-red-600"}," Integration not found. ",-1)),R(Z,{to:"/integrations",variant:"soft",color:"neutral",icon:"i-lucide-arrow-left"},{default:C(()=>[...f[8]||(f[8]=[P(" Back to Integrations ",-1)])]),_:1})])):(y(),L(fe,{key:2},[w("div",null,[R(ue,{to:"/integrations",class:"inline-flex items-center gap-1 text-sm text-muted hover:text-[var(--ui-text)] transition-colors mb-4"},{default:C(()=>[R(_e,{name:"i-lucide-arrow-left",class:"w-4 h-4"}),f[10]||(f[10]=P(" Back to Integrations ",-1))]),_:1}),w("div",ss,[w("div",ls,[w("h1",rs,le(o(u).label),1),R(mt,{size:"sm",color:"neutral",variant:"subtle"},{default:C(()=>[P(le(o(u).type),1)]),_:1})]),R(bt,{modelValue:o(b),"onUpdate:modelValue":f[0]||(f[0]=Q=>ae(b)?b.value=Q:null),size:"lg"},null,8,["modelValue"])]),w("p",is,le(o(u).type)+" · "+le(o(u).referenceId),1)]),w("section",null,[w("div",as,[f[12]||(f[12]=w("h2",{class:"text-lg font-medium"}," Connection ",-1)),o(_)?(y(),W(Z,{key:0,size:"xs",variant:"soft",color:"neutral",icon:"i-lucide-filter",disabled:!o(S)||o(G),loading:o(G),onClick:ft},{default:C(()=>[...f[11]||(f[11]=[P(" Reduce Scope ",-1)])]),_:1},8,["disabled","loading"])):X("",!0)]),w("div",os,[R(xt,{"integration-id":o(u).id,"integration-type":o(u).type,"current-variant":o(u).credentialVariant,onSaved:Fe,onDisconnected:Fe},null,8,["integration-id","integration-type","current-variant"])]),o(ne)?(y(),L("p",cs,le(o(ne)),1)):X("",!0)]),w("section",us,[f[13]||(f[13]=w("h2",{class:"text-lg font-medium"}," Access Level ",-1)),w("div",ps,[w("button",{type:"button",class:se(["px-4 py-2 text-sm rounded-lg border transition-colors",o(x)!=="read"?"border-green-500 bg-green-50 text-green-700 font-medium dark:bg-green-950 dark:text-green-300":"border-[var(--ui-border)] text-muted hover:bg-[var(--ui-bg-elevated)]"]),onClick:f[1]||(f[1]=Q=>x.value=null)}," Read + Write ",2),w("button",{type:"button",class:se(["px-4 py-2 text-sm rounded-lg border transition-colors",o(x)==="read"?"border-green-500 bg-green-50 text-green-700 font-medium dark:bg-green-950 dark:text-green-300":"border-[var(--ui-border)] text-muted hover:bg-[var(--ui-bg-elevated)]"]),onClick:f[2]||(f[2]=Q=>x.value="read")}," Read-only ",2)]),o(x)==="read"?(y(),L("p",ds," Only read tools will be available. Write and admin tools will be greyed out below. ")):X("",!0)]),w("section",hs,[f[14]||(f[14]=w("h2",{class:"text-lg font-medium"}," Tools ",-1)),R(yt,{ref_key:"toolsTreeRef",ref:j,"integration-id":o(u).id,"max-scope":o(x),"enabled-toolsets":o(q),"disabled-tools":o(V),"onUpdate:enabledToolsets":f[3]||(f[3]=Q=>q.value=Q),"onUpdate:disabledTools":f[4]||(f[4]=Q=>V.value=Q)},null,8,["integration-id","max-scope","enabled-toolsets","disabled-tools"])]),w("div",gs,[R(Z,{loading:o(H),size:"lg",onClick:ee},{default:C(()=>[...f[15]||(f[15]=[P(" Save Changes ",-1)])]),_:1},8,["loading"]),R(Z,{variant:"soft",color:"error",icon:"i-lucide-trash-2",onClick:Se},{default:C(()=>[...f[16]||(f[16]=[P(" Remove Integration ",-1)])]),_:1})]),R(vt,{open:o(M),"onUpdate:open":f[6]||(f[6]=Q=>ae(M)?M.value=Q:null),title:"Remove integration",description:o(u)?`Remove "${o(u).label}"? This cannot be undone.`:void 0},{footer:C(()=>[w("div",fs,[R(Z,{variant:"ghost",color:"neutral",onClick:f[5]||(f[5]=Q=>M.value=!1)},{default:C(()=>[...f[17]||(f[17]=[P(" Cancel ",-1)])]),_:1}),R(Z,{color:"error",icon:"i-lucide-trash-2",onClick:gt},{default:C(()=>[...f[18]||(f[18]=[P(" Remove ",-1)])]),_:1})])]),_:1},8,["open","description"]),o(u)&&o(d)?(y(),W(es,{key:0,open:o(O),"onUpdate:open":f[7]||(f[7]=Q=>ae(O)?O.value=Q:null),"integration-id":o(u).id,"current-type":o(u).type,"base-type":o(d),"base-name":o(D),variants:o($),saving:o(U),onConfirm:kt},null,8,["open","integration-id","current-type","base-type","base-name","variants","saving"])):X("",!0)],64))]),_:1})}}});export{bs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as s,u as a,o as i,c as u,a as t,t as n,b as c,w as l,d,e as f}from"./
|
|
1
|
+
import{_ as s,u as a,o as i,c as u,a as t,t as n,b as c,w as l,d,e as f}from"./bOjQRRUc.js";const p={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},m={class:"max-w-520px text-center"},h=["textContent"],b=["textContent"],x=["textContent"],g={class:"flex items-center justify-center w-full"},y={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},status:{type:Number,default:404},statusText:{type:String,default:"Page not found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(e){const r=e;return a({title:`${r.status} - ${r.statusText} | ${r.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(k,w)=>{const o=f;return i(),u("div",p,[t("div",m,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:n(e.status)},null,8,h),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:n(e.statusText)},null,8,b),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:n(e.description)},null,8,x),t("div",g,[c(o,{to:"/",class:"font-medium hover:text-[#00DC82] text-sm underline underline-offset-3"},{default:l(()=>[d(n(e.backHome),1)]),_:1})])])])}}},v=s(y,[["__scopeId","data-v-eed6b592"]]);export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,n,o as t,c as a}from"./
|
|
1
|
+
import{f as e,n,o as t,c as a}from"./bOjQRRUc.js";const i=e({__name:"index",setup(o){return n("/integrations",{replace:!0}),(r,c)=>(t(),a("div"))}});export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as
|
|
1
|
+
import{f as E,O as K,F as R,o as a,r as S,w as p,a as n,b as m,G as L,d as v,v as s,I as F,c as i,y as V,B as $,C as z,L as k,K as G,R as P,Q as W,H as I,J as H,e as J,t as w,S as Q,z as X,M as q,n as Y}from"./bOjQRRUc.js";import{u as j,_ as Z,a as ee,d as te,b as oe,c as se}from"./B6ti3873.js";const ne={class:"space-y-4"},ae={key:0,class:"space-y-2"},le={class:"flex gap-2"},de={key:0,class:"text-xs text-amber-600 dark:text-amber-400"},re={key:1,class:"border border-[var(--ui-border)] rounded-md"},ie={class:"px-3 pb-3 pt-1 space-y-3"},ce={class:"flex justify-end gap-2"},ue=E({__name:"AddIntegrationModal",props:{open:{type:Boolean}},emits:["update:open","created"],async setup(O,{emit:T}){let x,y;const M=O,A=T,f=z({get:()=>M.open,set:r=>A("update:open",r)}),{data:c}=([x,y]=K(()=>j("/api/catalog","$U0hSIeBVuo")),x=await x,y(),x),g=z(()=>(c.value||[]).map(r=>({label:r.name||r.type,value:r.type}))),d=k(void 0),u=k(null),l=k([]),o=k([]),h=k(null),b=k(!1);R(f,r=>{r&&(d.value=void 0,u.value=null,l.value=[],o.value=[])}),R(d,()=>{u.value=null,l.value=[],o.value=[]}),R(()=>h.value?.toolsets,r=>{!d.value||!r?.length||l.value.length||(l.value=r.map(t=>t.key).filter(t=>t!=="custom"))},{deep:!0});async function N(){if(d.value){b.value=!0;try{const t=(h.value?.toolsets||[]).map(e=>e.key).filter(e=>e!=="__all__"&&e!=="custom"),C=t.length&&l.value.length<t.length?l.value.filter(e=>e!=="__all__"):void 0,U=await $fetch("/api/integrations",{method:"POST",body:{type:d.value,maxScope:u.value||void 0,enabledToolsets:C,disabledTools:o.value.length?o.value:void 0}});f.value=!1,A("created",U.id)}finally{b.value=!1}}}return(r,t)=>{const C=ee,U=Z,e=te,B=L,D=G;return a(),S(D,{open:s(f),"onUpdate:open":t[6]||(t[6]=_=>F(f)?f.value=_:null),title:"Add integration",description:"Choose a service to connect."},{body:p(()=>[n("div",ne,[m(U,{label:"Integration type"},{default:p(()=>[m(C,{modelValue:s(d),"onUpdate:modelValue":t[0]||(t[0]=_=>F(d)?d.value=_:null),items:s(g),placeholder:"Select a service...",class:"w-full"},null,8,["modelValue","items"])]),_:1}),s(d)?(a(),i("div",ae,[t[7]||(t[7]=n("div",{class:"text-sm font-medium"}," Access level ",-1)),n("div",le,[n("button",{type:"button",class:V(["px-3 py-1.5 text-sm rounded-md border transition-colors",s(u)!=="read"?"border-green-500 bg-green-50 text-green-700 font-medium dark:bg-green-950 dark:text-green-300":"border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-400"]),onClick:t[1]||(t[1]=_=>u.value=null)}," Read + Write ",2),n("button",{type:"button",class:V(["px-3 py-1.5 text-sm rounded-md border transition-colors",s(u)==="read"?"border-green-500 bg-green-50 text-green-700 font-medium dark:bg-green-950 dark:text-green-300":"border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-400"]),onClick:t[2]||(t[2]=_=>u.value="read")}," Read-only ",2)]),s(u)==="read"?(a(),i("p",de," Write/admin tools are greyed out automatically. ")):$("",!0)])):$("",!0),s(d)?(a(),i("details",re,[t[8]||(t[8]=n("summary",{class:"cursor-pointer select-none px-3 py-2 text-sm font-medium"}," Advanced tool controls (optional) ",-1)),n("div",ie,[m(e,{ref_key:"toolsTreeRef",ref:h,"integration-type":s(d),"max-scope":s(u),"enabled-toolsets":s(l),"disabled-tools":s(o),"onUpdate:enabledToolsets":t[3]||(t[3]=_=>l.value=_),"onUpdate:disabledTools":t[4]||(t[4]=_=>o.value=_)},null,8,["integration-type","max-scope","enabled-toolsets","disabled-tools"])])])):$("",!0)])]),footer:p(()=>[n("div",ce,[m(B,{variant:"soft",color:"neutral",onClick:t[5]||(t[5]=_=>f.value=!1)},{default:p(()=>[...t[9]||(t[9]=[v(" Cancel ",-1)])]),_:1}),m(B,{disabled:!s(d)||s(b),loading:s(b),onClick:N},{default:p(()=>[...t[10]||(t[10]=[v(" Add ",-1)])]),_:1},8,["disabled","loading"])])]),_:1},8,["open"])}}}),pe=Object.assign(ue,{__name:"AddIntegrationModal"}),me={class:"flex items-center justify-between gap-4"},_e={key:0,class:"text-sm text-muted py-8 text-center"},ve={key:1,class:"text-sm text-red-600 py-8 text-center"},fe={key:2,class:"py-16 text-center space-y-4"},xe={key:3,class:"space-y-2"},ye={class:"min-w-0 flex-1"},ge={class:"flex items-center gap-2"},be={class:"font-medium truncate"},ke={class:"mt-1 flex items-center gap-2 flex-wrap"},$e={key:1,class:"text-xs text-muted"},Te={key:2,class:"text-xs text-muted"},Ce=E({__name:"index",async setup(O){let T,x;const{data:y,pending:M,error:A,refresh:f}=([T,x]=K(()=>j("/api/integrations","$GX_g-BN8AB")),T=await T,x(),T),c=q({}),g=k(!1);P(async()=>{if(y.value)for(const l of y.value){if(c[l.id]!==void 0)continue;const o=await $fetch(`/api/integrations/${l.id}/credentials-status`).catch(()=>null);c[l.id]=o?.health_status??"disconnected"}});async function d(l,o){await $fetch("/api/integrations",{method:"POST",body:{...l,enabled:o}}),await f()}function u(l){Y(`/integrations/${l}`)}return(l,o)=>{const h=L,b=oe,N=se,r=X,t=J,C=pe,U=W;return a(),S(U,{class:"py-10 space-y-6"},{default:p(()=>[n("div",me,[o[5]||(o[5]=n("div",{class:"space-y-1"},[n("h1",{class:"text-2xl font-semibold"}," Integrations "),n("p",{class:"text-sm text-muted"}," Manage your connected services. ")],-1)),m(h,{icon:"i-lucide-plus",onClick:o[0]||(o[0]=e=>g.value=!0)},{default:p(()=>[...o[4]||(o[4]=[v(" Add Integration ",-1)])]),_:1})]),s(M)?(a(),i("div",_e," Loading… ")):s(A)?(a(),i("div",ve," Failed to load integrations. ")):s(y)?.length?(a(),i("div",xe,[(a(!0),i(I,null,H(s(y),e=>(a(),S(t,{key:e.id,to:`/integrations/${e.id}`,class:"flex items-center gap-4 p-4 rounded-lg border border-[var(--ui-border)] hover:bg-[var(--ui-bg-elevated)] transition-colors group"},{default:p(()=>[n("div",ye,[n("div",ge,[n("span",be,w(e.label),1),m(b,{size:"xs",color:"neutral",variant:"subtle"},{default:p(()=>[v(w(e.type),1)]),_:2},1024),e.maxScope==="read"?(a(),S(b,{key:0,size:"xs",color:"warning",variant:"soft"},{default:p(()=>[...o[8]||(o[8]=[v(" Read-only ",-1)])]),_:1})):$("",!0)]),n("div",ke,[s(c)[e.id]!==void 0?(a(),i("span",{key:0,class:V(["inline-flex items-center gap-1 text-xs font-medium px-1.5 py-0.5 rounded",{"bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-400":s(c)[e.id]==="connected","bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-400":s(c)[e.id]==="invalid_credentials"||s(c)[e.id]==="disconnected"}])},[n("span",{class:V(["inline-block w-1.5 h-1.5 rounded-full",{"bg-green-500":s(c)[e.id]==="connected","bg-red-500":s(c)[e.id]==="invalid_credentials"||s(c)[e.id]==="disconnected"}])},null,2),s(c)[e.id]==="connected"?(a(),i(I,{key:0},[v("Connected")],64)):s(c)[e.id]==="invalid_credentials"?(a(),i(I,{key:1},[v("Invalid credentials")],64)):(a(),i(I,{key:2},[v("Not connected")],64))],2)):$("",!0),e.enabledToolsets?.length?(a(),i("span",$e,w(e.enabledToolsets.length)+" toolset"+w(e.enabledToolsets.length===1?"":"s"),1)):$("",!0),e.disabledTools?.length?(a(),i("span",Te,w(e.disabledTools.length)+" tool"+w(e.disabledTools.length===1?"":"s")+" blocked ",1)):$("",!0)])]),n("div",{class:"flex items-center gap-3",onClick:o[2]||(o[2]=Q(()=>{},["prevent","stop"]))},[m(N,{"model-value":e.enabled!==!1,"onUpdate:modelValue":B=>d(e,B)},null,8,["model-value","onUpdate:modelValue"])]),m(r,{name:"i-lucide-chevron-right",class:"text-muted opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]),_:2},1032,["to"]))),128))])):(a(),i("div",fe,[o[7]||(o[7]=n("div",{class:"text-muted text-sm"}," No integrations yet. ",-1)),m(h,{icon:"i-lucide-plus",variant:"soft",onClick:o[1]||(o[1]=e=>g.value=!0)},{default:p(()=>[...o[6]||(o[6]=[v(" Add your first integration ",-1)])]),_:1})])),m(C,{open:s(g),"onUpdate:open":o[3]||(o[3]=e=>F(g)?g.value=e:null),onCreated:u},null,8,["open"])]),_:1})}}});export{Ce as default};
|