nextcloud/dist/appstore-main.mjs
nextcloud-command 230b14978e chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-06-22 18:44:49 +00:00

66 lines
94 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/AppstoreDiscover-DLzLfjqx.chunk.mjs'),window.OC.filePath('', '', 'dist/Web-ByHSuvRG.chunk.mjs'),window.OC.filePath('', '', 'dist/public-C1mLBHT3.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-Ci0zJ0QG.chunk.mjs'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-B261d025.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-CZ2eH1SD.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-C5oC8Tcn.chunk.mjs'),window.OC.filePath('', '', 'dist/index-C6ey-Mhx.chunk.mjs'),window.OC.filePath('', '', 'dist/common-createElementId-DhjFt1I9-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/common-logger-D3RVzcfQ-BE3lcFW4.chunk.css'),window.OC.filePath('', '', 'dist/common-mdi-BWNFKLbC.chunk.css'),window.OC.filePath('', '', 'dist/index-DL1yHC1K-orb-zzee.chunk.mjs'),window.OC.filePath('', '', 'dist/index-BRuD4Qrz.chunk.mjs'),window.OC.filePath('', '', 'dist/NcModal-DUWLRm_F-C0gD58QY.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcModal-DUWLRm_F-BsKc2RT9.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-CW4_EEhq.chunk.mjs'),window.OC.filePath('', '', 'dist/common-TrashCanOutline-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/common-index-DYA_tnKg.chunk.css'),window.OC.filePath('', '', 'dist/NcEmptyContent-CGAPqk4S-q4HLj68a.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcEmptyContent-CGAPqk4S-Don1d5Bd.chunk.css'),window.OC.filePath('', '', 'dist/index-D-iKxf2E.chunk.mjs'),window.OC.filePath('', '', 'dist/util-djQ-4xJ5.chunk.mjs'),window.OC.filePath('', '', 'dist/pinia-Bn5aG74F.chunk.mjs'),window.OC.filePath('', '', 'dist/NcContent-BhMoPROW-DsKLJ41z.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcContent-BhMoPROW-CuEPejA5.chunk.css'),window.OC.filePath('', '', 'dist/PencilOutline-DJX4SP_q.chunk.mjs'),window.OC.filePath('', '', 'dist/common-PencilOutline-B3DMd8SU.chunk.css'),window.OC.filePath('', '', 'dist/NcTextArea-Dxzj4zdb-BLv5JT3R.chunk.mjs'),window.OC.filePath('', '', 'dist/index-C13i_MTM.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index-BWhNCeJl.chunk.css'),window.OC.filePath('', '', 'dist/TrayArrowDown-BRoulKIv.chunk.mjs'),window.OC.filePath('', '', 'dist/common-TrayArrowDown-CaC9_ffV.chunk.css'),window.OC.filePath('', '', 'dist/NcInputField-B1bGxYHt-DVZQKody.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcInputField-B1bGxYHt-BYHxARP-.chunk.css'),window.OC.filePath('', '', 'dist/NcAvatar-M3-CbKbq-DbNpmr-b.chunk.mjs'),window.OC.filePath('', '', 'dist/ArrowRight-BgQTbtKu.chunk.mjs'),window.OC.filePath('', '', 'dist/common-ArrowRight-vZpQWIqF.chunk.css'),window.OC.filePath('', '', 'dist/colors-BDeMBgfq-D1xNHBAd.chunk.mjs'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-DsviB2Cr-CJ45dJff.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcUserStatusIcon-DsviB2Cr-Bq_6hmXG.chunk.css'),window.OC.filePath('', '', 'dist/NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7-BRczm9CK.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcDateTime-b9UhLDij.chunk.css'),window.OC.filePath('', '', 'dist/common-NcAvatar-M3-CbKbq-DTVmI7NO.chunk.css'),window.OC.filePath('', '', 'dist/NcBreadcrumbs-5gl8Syfa-M1WEN1lc.chunk.mjs'),window.OC.filePath('', '', 'dist/NcPasswordField-Be5_qcfm-DrwSQ-mu.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcPasswordField-Be5_qcfm-Crp_EMfV.chunk.css'),window.OC.filePath('', '', 'dist/NcTextField.vue_vue_type_script_setup_true_lang-BQHjkK8r-Dv0_ThWG.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcBreadcrumbs-5gl8Syfa-CfbvucBX.chunk.css'),window.OC.filePath('', '', 'dist/common-NcTextArea-Dxzj4zdb-CzDMVgRO.chunk.css'),window.OC.filePath('', '', 'dist/NcCheckboxRadioSwitch-D8Dfv4iw-B_doZ1-m.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcCheckboxRadioSwitch-D8Dfv4iw-CPGkDj-p.chunk.css'),window.OC.filePath('', '', 'dist/Plus-Dpju2rIw.chunk.mjs'),window.OC.filePath('', '', 'dist/common-Plus-Som-mR4B.chunk.css'),window.OC.filePath('', '', 'dist/index-BWDoVtMf.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index-bfXBK-tQ.chunk.css'),window.OC.filePath('', '', 'dist/index-B2gPRygg.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index--xyrXnuf.chunk.css'),window.OC.filePath('', '', 'dist/NcEmojiPicker-Bpw-68QP-DLh7rUK8.chunk.mjs'),window.OC.filePath('', '', 'dist/emoji-C8k9NUlo-D9ZtzMuc.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcEmojiPicker-Bpw-68QP-ChsL0oK6.chunk.css'),window.OC.filePath('', '', 'dist/index-CwsnDr9r.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index-CpSoVYoo.chunk.css'),window.OC.filePath('', '', 'dist/index-B7f4H-mg.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index-MZEZ7XGj.chunk.css'),window.OC.filePath('', '', 'dist/NcSelectTags-D7qWNjXa-DmaYJhIo.chunk.mjs'),window.OC.filePath('', '', 'dist/ContentCopy-DX69rUn6.chunk.mjs'),window.OC.filePath('', '', 'dist/common-ContentCopy-D7mIRwIy.chunk.css'),window.OC.filePath('', '', 'dist/NcUserBubble-CDQa0hGy-DMYvkftD.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcUserBubble-CDQa0hGy-f2DD9EAL.chunk.css'),window.OC.filePath('', '', 'dist/index-Bm5HdBcE.chunk.mjs'),window.OC.filePath('', '', 'dist/modulepreload-polyfill-BxzAKjcf.chunk.mjs'),window.OC.filePath('', '', 'dist/index-BTFugZfg.chunk.mjs'),window.OC.filePath('', '', 'dist/appstore-AppstoreDiscover-D5SWaP1O.chunk.css'),window.OC.filePath('', '', 'dist/common-NcActionSeparator-Ct2RnclR-pXJ_-D_I.chunk.css'),window.OC.filePath('', '', 'dist/common-NcGuestContent-j8ai4O1K-D0718NyY.chunk.css'),window.OC.filePath('', '', 'dist/UpdateAllDialog-Bx9vMq27.chunk.mjs'),window.OC.filePath('', '', 'dist/common-UpdateAllDialog-CZVJ1CV6.chunk.css'),window.OC.filePath('', '', 'dist/AppstoreBrowse-COQXh2ij.chunk.mjs'),window.OC.filePath('', '', 'dist/appstore-AppstoreBrowse-BmXPxQ1G.chunk.css')])))=>i.map(i=>d[i]);
import{d as _e,c as Xt}from"./pinia-Bn5aG74F.chunk.mjs";import{b as B,o as h,f as x,g as _,t as v,i as Yt,y as w,c as D,u as i,N as Jt,w as y,j as q,v as $,F as M,B as H,k,l as E,aa as gt,p as mt,z as oe,h as I,q as Oe,a9 as be,U as Kt,a as ea,_ as ce,H as ta,D as aa,r as na,e as sa}from"./Web-ByHSuvRG.chunk.mjs";import{t as d,p as la,g as ra}from"./translation-DoG5ZELJ-C5oC8Tcn.chunk.mjs";import{N as pe,v as Ge,u as ye,H as ia,I as oa}from"./logger-D3RVzcfQ-B261d025.chunk.mjs";import{N as pa,a as ca}from"./NcContent-BhMoPROW-DsKLJ41z.chunk.mjs";import{c as je,f as ft,g as ua,b as K}from"./index-C6ey-Mhx.chunk.mjs";import{_ as N,l as te}from"./public-C1mLBHT3.chunk.mjs";import{N as da}from"./PencilOutline-DJX4SP_q.chunk.mjs";import{_ as bt,N as L}from"./createElementId-DhjFt1I9-CZ2eH1SD.chunk.mjs";import{c as ha,d as J,e as ga,f as ma,N as fa}from"./NcTextArea-Dxzj4zdb-BLv5JT3R.chunk.mjs";import{P as kt}from"./NcBreadcrumbs-5gl8Syfa-M1WEN1lc.chunk.mjs";import{N as ba,a as ka,_ as _a}from"./NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7-BRczm9CK.chunk.mjs";import{M as ya,a as wa}from"./NcModal-DUWLRm_F-C0gD58QY.chunk.mjs";/* empty css */import"./NcAvatar-M3-CbKbq-DbNpmr-b.chunk.mjs";import{N as Ce}from"./TrashCanOutline-CW4_EEhq.chunk.mjs";import"./NcCheckboxRadioSwitch-D8Dfv4iw-B_doZ1-m.chunk.mjs";import{N as va}from"./Plus-Dpju2rIw.chunk.mjs";import"./index-BWDoVtMf.chunk.mjs";import{N as xa,a as $a}from"./TrayArrowDown-BRoulKIv.chunk.mjs";import"./index-B2gPRygg.chunk.mjs";import{N as _t,s as yt}from"./index-BRuD4Qrz.chunk.mjs";import"./index-C13i_MTM.chunk.mjs";import"./NcEmojiPicker-Bpw-68QP-DLh7rUK8.chunk.mjs";import{N as He}from"./NcEmptyContent-CGAPqk4S-q4HLj68a.chunk.mjs";import"./index-CwsnDr9r.chunk.mjs";/* empty css */import"./NcInputField-B1bGxYHt-DVZQKody.chunk.mjs";import{L as Ta,M as Aa,O as Sa,P as Ra,Q as Da,R as za,S as Ia,T as Ca,U as La,V as Ea,W as Ba,w as Pa,X as qa,D as Re,Y as Na,Z as Ma,_ as Ze,y as Ue,$ as wt,a0 as Oa,a1 as vt,q as xt,a2 as Ga,a3 as ja,a4 as Ha,a5 as $t,a6 as Za,a7 as Ua,a8 as Tt,N as nt,a9 as Fa,aa as Qa,ab as Va,ac as Wa,ad as Xa,K as Ya,ae as Ja,l as Ka,J as en,af as tn,v as an,ag as nn}from"./mdi-Ci0zJ0QG.chunk.mjs";import"./NcPasswordField-Be5_qcfm-DrwSQ-mu.chunk.mjs";import"./index-B7f4H-mg.chunk.mjs";import{c as O}from"./index-D-iKxf2E.chunk.mjs";import"./NcTextField.vue_vue_type_script_setup_true_lang-BQHjkK8r-Dv0_ThWG.chunk.mjs";import"./NcSelectTags-D7qWNjXa-DmaYJhIo.chunk.mjs";import"./ContentCopy-DX69rUn6.chunk.mjs";import"./NcUserBubble-CDQa0hGy-DMYvkftD.chunk.mjs";import"./NcUserStatusIcon-DsviB2Cr-CJ45dJff.chunk.mjs";import"./emoji-C8k9NUlo-D9ZtzMuc.chunk.mjs";import"./colors-BDeMBgfq-D1xNHBAd.chunk.mjs";import{w as sn,b as ln,u as rn}from"./index-Bm5HdBcE.chunk.mjs";import"./modulepreload-polyfill-BxzAKjcf.chunk.mjs";import{a as ke}from"./index-DL1yHC1K-orb-zzee.chunk.mjs";import{a as on,P as we,c as Fe}from"./index-BTFugZfg.chunk.mjs";import"./ArrowRight-BgQTbtKu.chunk.mjs";import"./util-djQ-4xJ5.chunk.mjs";const pn={class:"app-navigation-spacer"},cn=B({__name:"NcAppNavigationSpacer",setup(e){return(t,a)=>(h(),x("li",pn))}}),un=bt(cn,[["__scopeId","data-v-277fa710"]]),dn={name:"NcAppSidebarTab",inject:["registerTab","unregisterTab","getActiveTab","isTablistShown"],props:{id:{type:String,required:!0},name:{type:String,required:!0},icon:{type:String,default:""},order:{type:Number,default:0}},emits:["bottomReached","scroll"],expose:["id","name","icon","order","renderIcon"],computed:{isActive(){return this.getActiveTab()===this.id}},created(){this.registerTab(this)},beforeUnmount(){this.unregisterTab(this.id)},methods:{onScroll(e){this.$el.scrollHeight-this.$el.scrollTop===this.$el.clientHeight&&this.$emit("bottomReached",e),this.$emit("scroll",e)},renderIcon(){return this.$slots.icon?.()}}},hn=["id","aria-hidden","aria-label","aria-labelledby","role","tabindex"],gn={class:"hidden-visually"};function mn(e,t,a,s,n,l){return h(),x("section",{id:`tab-${a.id}`,"aria-hidden":!l.isActive,"aria-label":l.isTablistShown()?void 0:a.name,"aria-labelledby":l.isTablistShown()?`tab-button-${a.id}`:void 0,class:w(["app-sidebar__tab",{"app-sidebar__tab--active":l.isActive}]),role:l.isTablistShown()?"tabpanel":void 0,tabindex:l.isTablistShown()?0:-1,onScroll:t[0]||(t[0]=(...r)=>l.onScroll&&l.onScroll(...r))},[_("h3",gn,v(a.name),1),Yt(e.$slots,"default",{},void 0,!0)],42,hn)}const Le=bt(dn,[["render",mn],["__scopeId","data-v-dba10798"]]),W=Object.freeze({discover:d("appstore","Discover"),installed:d("appstore","Your apps"),enabled:d("appstore","Active apps"),disabled:d("appstore","Disabled apps"),updates:d("appstore","Updates"),bundles:d("appstore","App bundles"),featured:d("appstore","Featured apps"),supported:d("appstore","Supported apps"),search:d("appstore","Search results")}),X=Object.freeze({discover:ja,installed:Ga,enabled:xt,disabled:vt,bundles:Oa,supported:wt,featured:Ue,updates:Ze,ai:Ma,auth:Na,customization:Re,dashboard:qa,files:Pa,games:Ba,integration:Ea,monitoring:La,multimedia:Ca,office:Ia,organization:za,search:Da,security:Ra,social:Sa,tools:Aa,workflow:Ta}),to=["post","showcase","carousel"];on(O);const ae=je("apps/appstore/api/v1"),le=Object.freeze({apps:`${ae}/apps`,categories:`${ae}/apps/categories`,enable:`${ae}/apps/enable`,disable:`${ae}/apps/disable`,uninstall:`${ae}/apps/uninstall`,update:`${ae}/apps/update`,bundleEnable:`${ae}/bundles/enable`}),ve=new kt({concurrency:1});async function st(e,t=!1,a){return ve.add(async()=>{await O.post(le.enable,{appId:e,groups:a,force:t||void 0},{confirmPassword:we.Strict})})}async function fn(e){return ve.add(async()=>{await O.post(le.disable,{appId:e},{confirmPassword:we.Lax})})}async function bn(e){return ve.add(async()=>{await O.post(le.update,{appId:e},{confirmPassword:we.Strict})})}async function kn(e){return ve.add(async()=>{await O.post(le.uninstall,{appId:e},{confirmPassword:we.Strict})})}async function _n(){const{data:e}=await O.get(le.apps);return e.ocs.data}async function yn(){const{data:e}=await O.get(le.categories);for(const t of e.ocs.data)t.icon=X[t.id]??"";return e.ocs.data}async function wn(e){return ve.add(async()=>{await O.post(le.bundleEnable,{bundleId:e},{confirmPassword:we.Strict})})}async function me(){const{data:e}=await O.get(je("core/navigation/apps?format=json"));e.ocs.meta.statuscode===200&&(ft("nextcloud:app-menu.refresh",{apps:e.ocs.data}),window.dispatchEvent(new Event("resize")))}function ue(e){return e.installed||e.internal?!1:e.missingDependencies===void 0||e.missingDependencies.length===0||!e.isCompatible&&e.missingDependencies.length===1}function At(e){return e.installed&&e.removable&&!e.active}function St(e){return!zt(e)&&!It(e)&&Rt(e)&&e.isCompatible}function Rt(e){return!e.active&&(e.installed||ue(e))}function xe(e){return!e.active&&!e.isCompatible}function Dt(e){return!zt(e)&&!It(e)&&e.active&&!e.internal}function vn(e){return e.update!==void 0}const xn=["filesystem","prelogin","authentication","logging","prevent_group_restriction"];function Qe(e){return!e.active&&!e.installed||!e.active&&xe(e)?!1:e.types?e.types.every(t=>!xn.includes(t)):!0}function zt(e){return e.app_api&&(e.status.action==="init"||e.status.action==="healthcheck")}function It(e){return e.app_api&&e.status.action==="deploy"}const U=ua().setApp("appstore").detectUser().build(),$n=B({__name:"DaemonSelectionDialogListEntry",props:{daemon:{},isDefault:{type:Boolean}},emits:["selected"],setup(e,{emit:t}){const a=e,s=t,n=$(()=>`${a.daemon.name} - ${a.daemon.display_name}`);return(l,r)=>(h(),D(i(xa),{active:e.isDefault,counterNumber:e.daemon.exAppsCount,counterType:"highlighted",details:e.isDefault?i(d)("appstore","Default"):"",forceDisplayActions:"",name:n.value,onClick:r[0]||(r[0]=Jt(o=>s("selected"),["stop"]))},{subname:y(()=>[q(v(e.daemon.accepts_deploy_id),1)]),_:1},8,["active","counterNumber","details","name"]))}}),Tn=["aria-label"],An=B({__name:"DaemonSelectionDialogList",emits:["selected"],setup(e){const t=$e();return(a,s)=>(h(),x("ul",{class:w(a.$style.DaemonSelectionDialogList),"aria-label":i(d)("appstore","Registered Deploy daemons list")},[(h(!0),x(M,null,H(i(t).dockerDaemons,n=>(h(),D($n,{key:n.id,daemon:n,isDefault:i(t).defaultDaemon?.name===n.name,onSelected:l=>a.$emit("selected",n)},null,8,["daemon","isDefault","onSelected"]))),128))],10,Tn))}}),Sn="_DaemonSelectionDialogList_x38pt_2",Rn={DaemonSelectionDialogList:Sn},Dn={$style:Rn},zn=N(An,[["__cssModules",Dn]]),In=B({__name:"DaemonSelectionDialog",props:{app:{}},emits:["close"],setup(e){const t=$e(),a=K("/settings/admin/app_api");return(s,n)=>(h(),D(i(_t),{name:i(d)("appstore","Choose Deploy Daemon for {appName}",{appName:e.app.name}),size:"normal","onUpdate:open":n[1]||(n[1]=l=>l||s.$emit("close"))},{default:y(()=>[i(t).dockerDaemons.length===0?(h(),D(i(He),{key:0,class:"daemon-selection-list__empty-content",name:i(d)("appstore","No Deploy daemons configured"),description:i(d)("appstore","Register a custom one or setup from available templates")},{icon:y(()=>[k(i(L),{path:i(Ha)},null,8,["path"])]),action:y(()=>[k(i(pe),{href:i(a)},{default:y(()=>[q(v(i(d)("appstore","Manage Deploy daemons")),1)]),_:1},8,["href"])]),_:1},8,["name","description"])):(h(),D(zn,{key:1,app:e.app,onSelected:n[0]||(n[0]=l=>s.$emit("close",l))},null,8,["app"]))]),_:1},8,["name"]))}});async function Cn(){const{data:e}=await O.get(K("/apps/app_api/apps/list"));return e.apps}async function Ln(e){const{data:t}=await O.get(K(`/apps/app_api/apps/status/${e}`));return t}async function Pe(e,t,a){await Fe(),await O.post(K(`/apps/app_api/apps/enable/${e.id}/${t.name}`),{deployOptions:a})}async function En(e){await Fe(),await O.post(K("/apps/app_api/apps/force"),{appId:e})}async function lt(e){await Fe(),await O.get(K(`apps/app_api/apps/disable/${e}`))}const $e=_e("external-apps",()=>{const e=te("appstore","appApiEnabled",!1),t=E([]),a=E(te("appstore","appstoreExAppUpdateCount",0));let s=null;const n=E(te("appstore","defaultDaemonConfigAccessible",!1)),l=E(te("appstore","defaultDaemonConfig",null)),r=E([]),o=$(()=>t.value.filter(g=>g?.status?.action&&g.status.type!==""&&(g?.status?.action==="deploy"||g.status.action==="init"||g.status.action==="healthcheck")));function c(g){return t.value.find(({id:m})=>m===g)??null}async function p(g){const m=c(g);if(!m)throw new Error(`App with id ${g} not found`);m.loading=!0;try{if(r.value.length===1&&m.needsDownload)Pe(m,r[0]),m.daemon=r[0];else if(m.needsDownload){const j=await yt(In,{app:m});if(!j)throw new Error("No daemon selected");await Pe(m,j),m.daemon=j}else await Pe(m,m.daemon);m.installed||(m.needsDownload=!1,m.status={type:"install",action:"deploy",init:0,deploy:0}),m.removable=!0,delete m.error,await T(g)}finally{m.loading=!1}}async function b(g){const m=c(g);if(!m)throw new Error(`App with id ${g} not found`);m.loading=!0;try{await En(g),await S(!0),m.active=!1}finally{m.loading=!1}}async function u(g){const m=c(g);if(!m)throw new Error(`App with id ${g} not found`);m.loading=!0;try{await lt(g),m.active=!1}finally{m.loading=!1}}async function f(g){const m=c(g);if(!m)throw new Error(`App with id ${g} not found`);m.loading=!0;try{await lt(g),m.active=!1,m.needsDownload=!0,m.installed=!1,m.daemon=null,m.status={},m.update!==null&&a.value--,delete m.update,delete m.error}finally{m.loading=!1}}async function A(g){const m=c(g);if(!m)throw new Error(`App with id ${g} not found`);m.loading=!0;try{await O.get(K(`/apps/app_api/apps/update/${g}`)),m.version=m.update||m.version,m.status={type:"update",action:"deploy",init:0,deploy:0},delete m.update,delete m.error,a.value--,await T(g)}catch(j){U.error("Failed to update ex app",{appId:g,error:j}),ke(d("appstore","Could not update the app. Please try again later."))}finally{m.loading=!1}}async function S(g=!1){(g||!l.value||!r.value.length)&&await P(),(g||t.value.length===0)&&await Y()}return{isEnabled:e,apps:t,updateCount:a,defaultDaemon:l,dockerDaemons:r,daemonAccessible:n,getById:c,disableApp:u,enableApp:p,forceEnableApp:b,updateApp:A,uninstallApp:f,initialize:S};async function P(){try{const{data:g}=await O.get(K("/apps/app_api/daemons"));l.value=g.daemons.find(m=>m.name===g.default_daemon_config),r.value=g.daemons.filter(m=>m.accepts_deploy_id==="docker-install")}catch(g){return U.error("[app-api-store] Failed to fetch Docker daemons",{error:g}),!1}return!0}async function Y(){try{t.value=await Cn()}catch(g){U.error("An error occurred while fetching apps",{error:g}),ke(d("appstore","An error occurred during the request. Unable to proceed."))}}async function T(g){const m=c(g);if(!m){U.error("[app-api-store] app not found while fetching status",{appId:g});return}m.loading=!0;try{const j=await Ln(g);m.status=j,U.debug("[app-api-store] initializingOrDeployingApps after setAppStatus",{initializingOrDeployingApps:o}),o.value.length===0&&(U.debug("[app-api-store] Clearing interval"),clearInterval(s),s=null),m.status.error&&o.value.length===1&&(clearInterval(s),s=null)}catch(j){throw R(),j}finally{m.loading=!1}}function R(){clearInterval(s),o.value.length!==0&&(s=window.setInterval(()=>{U.debug("[app-api-store] initializingOrDeployingApps",{initializingOrDeployingApps:o});for(const g of o.value)T(g.id)},2e3))}}),Z=_e("apps",()=>{const e=$e(),t=E([]),a=E([]),s=gt(te("appstore","appstoreBundles")),n=E(!1),l=E(!1),r=$(()=>[...t.value,...e.isEnabled?e.apps:[]]);function o(T){return a.value.find(({id:R})=>R===T)??null}function c(T){return r.value.find(({id:R})=>R===T)??null}function p(T){return r.value.filter(R=>[R.category].flat().includes(T))}async function b(T,R=!1){const g=c(T);if(!g)throw new Error(`App with id ${T} not found`);if(g.active||!g.installed&&!ue(g))throw new Error(`App with id ${T} cannot be enabled`);if(!R&&xe(g))throw new Error(`App with id ${T} requires force enable`);g.loading=!0;try{g.app_api?await e.enableApp(T):await st(T,R),R&&(g.isCompatible=!0),g.active=!0,g.installed=!0,g.removable=!0,await me()}finally{g.loading=!1}}async function u(T){const R=c(T);if(!R)throw new Error(`App with id ${T} not found`);if(!Dt(R))throw new Error(`App with id ${T} cannot be disabled`);R.loading=!0;try{R.app_api?await e.disableApp(T):await fn(T),R.active=!1,R.isCompatible=R.missingDependencies===void 0||R.missingDependencies.length===0,await me()}finally{R.loading=!1}}async function f(T){const R=c(T);if(!R)throw new Error(`App with id ${T} not found`);if(!At(R))throw new Error(`App with id ${T} cannot be uninstalled`);R.loading=!0;try{R.app_api?await e.uninstallApp(T):await kn(T),R.active=!1,R.installed=!1,await me()}finally{R.loading=!1}}async function A(T,R){const g=c(T);if(!g)throw new Error(`App with id ${T} not found`);if(!Qe(g))throw new Error(`App with id ${T} cannot be limited to groups`);if(!g.app_api)try{g.loading=!0,await st(T,!1,R),g.groups=R}finally{g.loading=!1}}async function S(T){const R=s.find(g=>g.id===T);if(!R)throw new Error(`Bundle with id ${T} not found`);try{for(const g of R.appIdentifiers){const m=c(g);m.loading=!0}await wn(R.id);for(const g of R.appIdentifiers){const m=c(g);m.active=!0,m.installed=!0,m.removable=!0,await me()}}finally{for(const g of R.appIdentifiers){const m=c(g);m.loading=!1}}}async function P(){try{l.value=!0,a.value=await yn()}catch(T){U.error("Failed to load app categories",{error:T}),ke(d("appstore","Could not load app categories. Please try again later."))}finally{l.value=!1}}async function Y(){try{n.value=!0,t.value=await _n()}catch(T){U.error("Failed to load apps list",{error:T}),ke(d("appstore","Could not load apps list. Please try again later."))}finally{n.value=!1}}return Y(),P(),{apps:r,bundles:s,categories:a,isLoadingApps:n,isLoadingCategories:l,disableApp:u,enableApp:b,uninstallApp:f,enableBundle:S,getAppById:c,getAppsByCategory:p,getCategoryById:o,limitAppToGroups:A}}),Ct=_e("updates",()=>{const e=$e(),t=E(te("appstore","appstoreUpdateCount",0)),a=$(()=>t.value+e.updateCount);async function s(n){const l=Z().getAppById(n);if(!l)throw new Error(`App with id ${n} not found`);try{"app_api"in l&&l.app_api?await e.updateApp(n):(await bn(n),t.value=Math.max(t.value-1,0)),l.update=void 0,me()}catch(r){U.error("Failed to update app",{appId:n,error:r}),ke(d("appstore","Could not update the app. Please try again later."))}}return{updateCount:a,updateApp:s}}),Lt=_e("userSettings",()=>{const e=E(""),t=E(!1),a=E(!0),s=$(()=>e.value==="m"?"468px":e.value==="l"?"512px":"320px");function n(r){return{...(ye()??{}).query,grid:r??t.value?e.value||null:void 0,compatible:a.value?void 0:null}}return Ge().afterEach(r=>{l(r.query)}),{defaultGridSize:e,gridSizePx:s,isGridView:t,showIncompatible:a,getQuery:n};function l(r){t.value="grid"in r,e.value=[r.grid??""].flat()[0].toLowerCase(),a.value=!("compatible"in r)}}),Bn=B({__name:"AppstoreNavigation",setup(e){const t=te("settings","appstoreEnabled",!0),a=Z(),s=Ct(),n=Lt(),l=$(()=>a.categories),r=$(()=>a.isLoadingCategories),o=ye(),c=Ge(),p=mt("search");ya("f",()=>{p.value?.$refs.inputElement||(ft("toggle-navigation",{open:!0}),window.setTimeout(()=>p.value?.$refs.inputElement?.focus(),400)),p.value?.$refs.inputElement?.focus()},{ctrl:!0,stop:!0,prevent:!0});const b=E("");oe(()=>o.query.q,f=>{b.value=[f||""].flat()[0]},{immediate:!0}),sn(b,(f,A)=>{if(f.trim()!==A.trim()){if(c.currentRoute.value.name==="apps-discover"||c.currentRoute.value.name==="apps-manage"&&o.params.category==="bundles"){c.push({name:"apps-search",query:{...o.query,q:f.trim()||void 0}});return}c.replace({...o,query:{...o.query,q:f.trim()||void 0}})}},{debounce:500});const u=$(()=>a.apps.find(({level:f})=>f===300)!==void 0);return(f,A)=>(h(),D(i(ha),{"aria-label":i(d)("appstore","Appstore categories")},{search:y(()=>[k(i(ga),{ref_key:"search",ref:b,modelValue:b.value,"onUpdate:modelValue":A[0]||(A[0]=S=>b.value=S),label:i(d)("appstore","Search apps…")},null,8,["modelValue","label"])]),list:y(()=>[i(t)?(h(),D(i(J),{key:0,to:{name:"apps-discover"},name:i(W).discover},{icon:y(()=>[k(i(L),{path:i(X).discover},null,8,["path"])]),_:1},8,["name"])):I("",!0),k(i(J),{to:{name:"apps-manage",params:{category:"installed"}},name:i(W).installed},{icon:y(()=>[k(i(L),{path:i(X).installed},null,8,["path"])]),_:1},8,["name"]),k(i(J),{to:{name:"apps-manage",params:{category:"enabled"}},name:i(W).enabled},{icon:y(()=>[k(i(L),{path:i(X).enabled},null,8,["path"])]),_:1},8,["name"]),k(i(J),{to:{name:"apps-manage",params:{category:"disabled"}},name:i(W).disabled},{icon:y(()=>[k(i(L),{path:i(X).disabled},null,8,["path"])]),_:1},8,["name"]),i(s).updateCount>0?(h(),D(i(J),{key:1,to:{name:"apps-manage",params:{category:"updates"}},name:i(W).updates},{counter:y(()=>[k(i($a),{count:i(s).updateCount},null,8,["count"])]),icon:y(()=>[k(i(L),{path:i(X).updates},null,8,["path"])]),_:1},8,["name"])):I("",!0),k(i(J),{to:{name:"apps-bundles"},name:i(W).bundles},{icon:y(()=>[k(i(L),{path:i(X).bundles},null,8,["path"])]),_:1},8,["name"]),k(i(un)),i(t)&&r.value?(h(),x("li",{key:2,class:w(f.$style.appstoreNavigation__categories_loading)},[k(i(Ce),{size:20,name:i(d)("appstore","Loading categories")},null,8,["name"])],2)):i(t)&&!r.value?(h(),x(M,{key:3},[u.value?(h(),D(i(J),{key:0,id:"app-category-supported",to:{name:"apps-category",params:{category:"supported"},query:i(n).getQuery(!0)},name:i(W).supported},{icon:y(()=>[k(i(L),{path:i(X).supported},null,8,["path"])]),_:1},8,["to","name"])):I("",!0),k(i(J),{id:"app-category-featured",to:{name:"apps-category",params:{category:"featured"},query:i(n).getQuery(!0)},name:i(W).featured},{icon:y(()=>[k(i(L),{path:i(X).featured},null,8,["path"])]),_:1},8,["to","name"]),(h(!0),x(M,null,H(l.value,S=>(h(),D(i(J),{id:`app-category-${S.id}`,key:S.id,name:S.displayName,to:{name:"apps-category",params:{category:S.id},query:i(n).getQuery(!0)}},{icon:y(()=>[k(i(L),{path:S.icon},null,8,["path"])]),_:2},1032,["id","name","to"]))),128))],64)):I("",!0)]),_:1},8,["aria-label"]))}}),Pn="_appstoreNavigation__categories_loading_1fsn2_2",qn={appstoreNavigation__categories_loading:Pn},Nn={$style:qn},Mn=N(Bn,[["__cssModules",Nn]]),On=B({__name:"AppActions",props:{app:{},actions:{},maxInlineActions:{default:1},iconOnly:{type:Boolean}},setup(e){const t=$(()=>e.actions.length<=e.maxInlineActions?e.actions:e.actions.filter(s=>s.inline!==!1).slice(0,e.maxInlineActions)),a=$(()=>e.actions.filter(s=>!t.value.includes(s)));return(s,n)=>(h(),x("div",{class:w(s.$style.appActions)},[(h(!0),x(M,null,H(t.value,l=>(h(),D(i(pe),{key:l.id,ariaLabel:e.iconOnly?l.label(e.app):void 0,title:e.iconOnly?l.label(e.app):void 0,variant:l.variant,href:"href"in l?l.href(e.app):void 0,to:"to"in l?l.to(e.app):void 0,target:"href"in l?"_blank":void 0,onClick:r=>"callback"in l&&l.callback(e.app)},Oe({icon:y(()=>[k(i(L),{path:l.icon},null,8,["path"])]),_:2},[e.iconOnly?void 0:{name:"default",fn:y(()=>[q(v(l.label(e.app)),1)]),key:"0"}]),1032,["ariaLabel","title","variant","href","to","target","onClick"]))),128)),k(i(wa),{forceMenu:""},{default:y(()=>[(h(!0),x(M,null,H(a.value,l=>(h(),x(M,null,["callback"in l?(h(),D(i(da),{key:"callback-"+l.id,closeAfterClick:"",variant:l.variant,onClick:r=>l.callback(e.app)},{icon:y(()=>[k(i(L),{path:l.icon},null,8,["path"])]),default:y(()=>[q(" "+v(l.label(e.app)),1)]),_:2},1032,["variant","onClick"])):"href"in l?(h(),D(i(ba),{key:"link-"+l.id,closeAfterClick:"",variant:l.variant,href:l.href(e.app)},{icon:y(()=>[k(i(L),{path:l.icon},null,8,["path"])]),default:y(()=>[q(" "+v(l.label(e.app)),1)]),_:2},1032,["variant","href"])):(h(),D(i(ka),{key:"route-"+l.id,closeAfterClick:"",variant:l.variant,to:l.to(e.app)},{icon:y(()=>[k(i(L),{path:l.icon},null,8,["path"])]),default:y(()=>[q(" "+v(l.label(e.app)),1)]),_:2},1032,["variant","to"]))],64))),256))]),_:1})],2))}}),Gn="_appActions_lrf6h_2",jn={appActions:Gn},Hn={$style:jn},Et=N(On,[["__cssModules",Hn]]),Zn=B({__name:"AppDeployDaemonTab",props:{app:{}},setup(e){const t=E(e.app?.daemon?.deploy_config?.computeDevice?.id!=="cpu"||!1);return(a,s)=>e.app?.daemon?(h(),D(i(Le),{key:0,id:"daemon",name:i(d)("appstore","Daemon"),order:5},{icon:y(()=>[k(i(L),{path:i($t),size:24},null,8,["path"])]),default:y(()=>[_("div",{class:w(a.$style.appDeployDaemonTab)},[_("h4",null,v(i(d)("appstore","Deploy Daemon")),1),_("p",null,[_("b",null,v(i(d)("appstore","Type")),1),q(": "+v(e.app?.daemon.accepts_deploy_id),1)]),_("p",null,[_("b",null,v(i(d)("appstore","Name")),1),q(": "+v(e.app?.daemon.name),1)]),_("p",null,[_("b",null,v(i(d)("appstore","Display Name")),1),q(": "+v(e.app?.daemon.display_name),1)]),_("p",null,[_("b",null,v(i(d)("appstore","GPUs support")),1),q(": "+v(t.value),1)]),_("p",null,[_("b",null,v(i(d)("appstore","Compute device")),1),q(": "+v(e.app?.daemon?.deploy_config?.computeDevice?.label),1)])],2)]),_:1},8,["name"])):I("",!0)}}),Un="_appDeployDaemonTab_1xkhp_2",Fn={appDeployDaemonTab:Un},Qn={$style:Fn},Vn=N(Zn,[["__cssModules",Qn]]);function Ve(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var re=Ve();function rt(e){re=e}var se={exec:()=>null};function ie(e){let t=[];return a=>{let s=Math.max(0,Math.min(3,a-1)),n=t[s];return n||(n=e(s),t[s]=n),n}}function z(e,t=""){let a=typeof e=="string"?e:e.source,s={replace:(n,l)=>{let r=typeof l=="string"?l:l.source;return r=r.replace(G.caret,"$1"),a=a.replace(n,r),s},getRegex:()=>new RegExp(a,t)};return s}var Wn=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),G={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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ie(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ie(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ie(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:ie(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:ie(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:ie(e=>new RegExp(`^ {0,${e}}>`))},Xn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Te=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Kn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,We=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Bt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Pt=z(Bt).replace(/bull/g,We).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(),es=z(Bt).replace(/bull/g,We).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(),Xe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ts=/^[^\n]+/,Ye=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,as=z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ye).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ns=z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,We).getRegex(),Ee="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",Je=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ss=z("^ {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",Je).replace("tag",Ee).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qt=z(Xe).replace("hr",Te).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]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ee).getRegex(),ls=z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",qt).getRegex(),Ke={blockquote:ls,code:Yn,def:as,fences:Jn,heading:Kn,hr:Te,html:ss,lheading:Pt,list:ns,newline:Xn,paragraph:qt,table:se,text:ts},it=z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Te).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",Ee).getRegex(),rs={...Ke,lheading:es,table:it,paragraph:z(Xe).replace("hr",Te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",it).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ee).getRegex()},is={...Ke,html:z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Je).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:se,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:z(Xe).replace("hr",Te).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Pt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},os=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ps=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Nt=/^( {2,}|\\)\n(?!\s*$)/,cs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,de=/[\p{P}\p{S}]/u,Be=/[\s\p{P}\p{S}]/u,et=/[^\s\p{P}\p{S}]/u,us=z(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Be).getRegex(),Mt=/(?!~)[\p{P}\p{S}]/u,ds=/(?!~)[\s\p{P}\p{S}]/u,hs=/(?:[^\s\p{P}\p{S}]|~)/u,gs=z(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Wn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ot=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ms=z(Ot,"u").replace(/punct/g,de).getRegex(),fs=z(Ot,"u").replace(/punct/g,Mt).getRegex(),Gt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bs=z(Gt,"gu").replace(/notPunctSpace/g,et).replace(/punctSpace/g,Be).replace(/punct/g,de).getRegex(),ks=z(Gt,"gu").replace(/notPunctSpace/g,hs).replace(/punctSpace/g,ds).replace(/punct/g,Mt).getRegex(),_s=z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,et).replace(/punctSpace/g,Be).replace(/punct/g,de).getRegex(),ys=z(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,de).getRegex(),ws="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",vs=z(ws,"gu").replace(/notPunctSpace/g,et).replace(/punctSpace/g,Be).replace(/punct/g,de).getRegex(),xs=z(/\\(punct)/,"gu").replace(/punct/g,de).getRegex(),$s=z(/^<(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(),Ts=z(Je).replace("(?:-->|$)","-->").getRegex(),As=z("^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",Ts).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),De=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ss=z(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",De).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),jt=z(/^!?\[(label)\]\[(ref)\]/).replace("label",De).replace("ref",Ye).getRegex(),Ht=z(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ye).getRegex(),Rs=z("reflink|nolink(?!\\()","g").replace("reflink",jt).replace("nolink",Ht).getRegex(),ot=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,tt={_backpedal:se,anyPunctuation:xs,autolink:$s,blockSkip:gs,br:Nt,code:ps,del:se,delLDelim:se,delRDelim:se,emStrongLDelim:ms,emStrongRDelimAst:bs,emStrongRDelimUnd:_s,escape:os,link:Ss,nolink:Ht,punctuation:us,reflink:jt,reflinkSearch:Rs,tag:As,text:cs,url:se},Ds={...tt,link:z(/^!?\[(label)\]\((.*?)\)/).replace("label",De).getRegex(),reflink:z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",De).getRegex()},qe={...tt,emStrongRDelimAst:ks,emStrongLDelim:fs,delLDelim:ys,delRDelim:vs,url:z(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ot).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:z(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ot).getRegex()},zs={...qe,br:z(Nt).replace("{2,}","*").getRegex(),text:z(qe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ae={normal:Ke,gfm:rs,pedantic:is},ge={normal:tt,gfm:qe,breaks:zs,pedantic:Ds},Is={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pt=e=>Is[e];function V(e,t){if(t){if(G.escapeTest.test(e))return e.replace(G.escapeReplace,pt)}else if(G.escapeTestNoEncode.test(e))return e.replace(G.escapeReplaceNoEncode,pt);return e}function ct(e){try{e=encodeURI(e).replace(G.percentDecode,"%")}catch{return null}return e}function ut(e,t){let a=e.replace(G.findPipe,(l,r,o)=>{let c=!1,p=r;for(;--p>=0&&o[p]==="\\";)c=!c;return c?"|":" |"}),s=a.split(G.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(G.slashPipe,"|");return s}function ee(e,t,a){let s=e.length;if(s===0)return"";let n=0;for(;n<s&&e.charAt(s-n-1)===t;)n++;return e.slice(0,s-n)}function dt(e){let t=e.split(`
`),a=t.length-1;for(;a>=0&&G.blankLine.test(t[a]);)a--;return t.length-a<=2?e:t.slice(0,a+1).join(`
`)}function Cs(e,t){if(e.indexOf(t[1])===-1)return-1;let a=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])a++;else if(e[s]===t[1]&&(a--,a<0))return s;return a>0?-2:-1}function Ls(e,t=0){let a=t,s="";for(let n of e)if(n===" "){let l=4-a%4;s+=" ".repeat(l),a+=l}else s+=n,a++;return s}function ht(e,t,a,s,n){let l=t.href,r=t.title||null,o=e[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:a,href:l,title:r,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,c}function Es(e,t,a){let s=e.match(a.other.indentCodeCompensation);if(s===null)return t;let n=s[1];return t.split(`
`).map(l=>{let r=l.match(a.other.beginningSpace);if(r===null)return l;let[o]=r;return o.length>=n.length?l.slice(n.length):l}).join(`
`)}var ze=class{options;rules;lexer;constructor(e){this.options=e||re}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let a=this.options.pedantic?t[0]:dt(t[0]),s=a.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:a,codeBlockStyle:"indented",text:s}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let a=t[0],s=Es(a,t[3]||"",this.rules);return{type:"code",raw:a,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let a=t[2].trim();if(this.rules.other.endingHash.test(a)){let s=ee(a,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(a=s.trim())}return{type:"heading",raw:ee(t[0],`
`),depth:t[1].length,text:a,tokens:this.lexer.inline(a)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ee(t[0],`
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let a=ee(t[0],`
`).split(`
`),s="",n="",l=[];for(;a.length>0;){let r=!1,o=[],c;for(c=0;c<a.length;c++)if(this.rules.other.blockquoteStart.test(a[c]))o.push(a[c]),r=!0;else if(!r)o.push(a[c]);else break;a=a.slice(c);let p=o.join(`
`),b=p.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
${p}`:p,n=n?`${n}
${b}`:b;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,l,!0),this.lexer.state.top=u,a.length===0)break;let f=l.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let A=f,S=A.raw+`
`+a.join(`
`),P=this.blockquote(S);l[l.length-1]=P,s=s.substring(0,s.length-A.raw.length)+P.raw,n=n.substring(0,n.length-A.text.length)+P.text;break}else if(f?.type==="list"){let A=f,S=A.raw+`
`+a.join(`
`),P=this.list(S);l[l.length-1]=P,s=s.substring(0,s.length-f.raw.length)+P.raw,n=n.substring(0,n.length-A.raw.length)+P.raw,a=S.substring(l.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:s,tokens:l,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let a=t[1].trim(),s=a.length>1,n={type:"list",raw:"",ordered:s,start:s?+a.slice(0,-1):"",loose:!1,items:[]};a=s?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=s?a:"[*+-]");let l=this.rules.other.listItemRegex(a),r=!1;for(;e;){let c=!1,p="",b="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let u=Ls(t[2].split(`
`,1)[0],t[1].length),f=e.split(`
`,1)[0],A=!u.trim(),S=0;if(this.options.pedantic?(S=2,b=u.trimStart()):A?S=t[1].length+1:(S=u.search(this.rules.other.nonSpaceChar),S=S>4?1:S,b=u.slice(S),S+=t[1].length),A&&this.rules.other.blankLine.test(f)&&(p+=f+`
`,e=e.substring(f.length+1),c=!0),!c){let P=this.rules.other.nextBulletRegex(S),Y=this.rules.other.hrRegex(S),T=this.rules.other.fencesBeginRegex(S),R=this.rules.other.headingBeginRegex(S),g=this.rules.other.htmlBeginRegex(S),m=this.rules.other.blockquoteBeginRegex(S);for(;e;){let j=e.split(`
`,1)[0],he;if(f=j,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),he=f):he=f.replace(this.rules.other.tabCharGlobal," "),T.test(f)||R.test(f)||g.test(f)||m.test(f)||P.test(f)||Y.test(f))break;if(he.search(this.rules.other.nonSpaceChar)>=S||!f.trim())b+=`
`+he.slice(S);else{if(A||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(u)||R.test(u)||Y.test(u))break;b+=`
`+f}A=!f.trim(),p+=j+`
`,e=e.substring(j.length+1),u=he.slice(S)}}n.loose||(r?n.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(r=!0)),n.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),n.raw+=p}let o=n.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c of n.items){this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]);let p=c.tokens[0];if(c.task&&(p?.type==="text"||p?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}let b=this.rules.other.listTaskCheckbox.exec(c.raw);if(b){let u={type:"checkbox",raw:b[0]+" ",checked:b[0]!=="[ ]"};c.checked=u.checked,n.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=u.raw+c.tokens[0].raw,c.tokens[0].text=u.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(u)):c.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):c.tokens.unshift(u)}}else c.task&&(c.task=!1);if(!n.loose){let b=c.tokens.filter(f=>f.type==="space"),u=b.length>0&&b.some(f=>this.rules.other.anyLine.test(f.raw));n.loose=u}}if(n.loose)for(let c of n.items){c.loose=!0;for(let p of c.tokens)p.type==="text"&&(p.type="paragraph")}return n}}html(e){let t=this.rules.block.html.exec(e);if(t){let a=dt(t[0]);return{type:"html",block:!0,raw:a,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:a}}}def(e){let t=this.rules.block.def.exec(e);if(t){let a=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:a,raw:ee(t[0],`
`),href:s,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let a=ut(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],l={type:"table",raw:ee(t[0],`
`),header:[],align:[],rows:[]};if(a.length===s.length){for(let r of s)this.rules.other.tableAlignRight.test(r)?l.align.push("right"):this.rules.other.tableAlignCenter.test(r)?l.align.push("center"):this.rules.other.tableAlignLeft.test(r)?l.align.push("left"):l.align.push(null);for(let r=0;r<a.length;r++)l.header.push({text:a[r],tokens:this.lexer.inline(a[r]),header:!0,align:l.align[r]});for(let r of n)l.rows.push(ut(r,l.header.length).map((o,c)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:l.align[c]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let a=t[1].trim();return{type:"heading",raw:ee(t[0],`
`),depth:t[2].charAt(0)==="="?1:2,text:a,tokens:this.lexer.inline(a)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let a=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:a,tokens:this.lexer.inline(a)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let a=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;let l=ee(a.slice(0,-1),"\\");if((a.length-l.length)%2===0)return}else{let l=Cs(t[2],"()");if(l===-2)return;if(l>-1){let r=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let s=t[2],n="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],n=l[3])}else n=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?s=s.slice(1):s=s.slice(1,-1)),ht(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let a;if((a=this.rules.inline.reflink.exec(e))||(a=this.rules.inline.nolink.exec(e))){let s=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[s.toLowerCase()];if(!n){let l=a[0].charAt(0);return{type:"text",raw:l,text:l}}return ht(a,n,a[0],this.lexer,this.rules)}}emStrong(e,t,a=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&a.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!a||this.rules.inline.punctuation.exec(a))){let n=[...s[0]].length-1,l,r,o=n,c=0,p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+n);(s=p.exec(t))!==null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(r=[...l].length,s[3]||s[4]){o+=r;continue}else if((s[5]||s[6])&&n%3&&!((n+r)%3)){c+=r;continue}if(o-=r,o>0)continue;r=Math.min(r,r+o+c);let b=[...s[0]][0].length,u=e.slice(0,n+s.index+b+r);if(Math.min(n,r)%2){let A=u.slice(1,-1);return{type:"em",raw:u,text:A,tokens:this.lexer.inlineTokens(A)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let a=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(a),n=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return s&&n&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:t[0],text:a}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,a=""){let s=this.rules.inline.delLDelim.exec(e);if(s&&(!s[1]||!a||this.rules.inline.punctuation.exec(a))){let n=[...s[0]].length-1,l,r,o=n,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(s=c.exec(t))!==null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l||(r=[...l].length,r!==n))continue;if(s[3]||s[4]){o+=r;continue}if(o-=r,o>0)continue;r=Math.min(r,r+o);let p=[...s[0]][0].length,b=e.slice(0,n+s.index+p+r),u=b.slice(n,-n);return{type:"del",raw:b,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let a,s;return t[2]==="@"?(a=t[1],s="mailto:"+a):(a=t[1],s=a),{type:"link",raw:t[0],text:a,href:s,tokens:[{type:"text",raw:a,text:a}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let a,s;if(t[2]==="@")a=t[0],s="mailto:"+a;else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);a=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:a,href:s,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let a=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:a}}}},F=class Ne{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||re,this.options.tokenizer=this.options.tokenizer||new ze,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 a={other:G,block:Ae.normal,inline:ge.normal};this.options.pedantic?(a.block=Ae.pedantic,a.inline=ge.pedantic):this.options.gfm&&(a.block=Ae.gfm,this.options.breaks?a.inline=ge.breaks:a.inline=ge.gfm),this.tokenizer.rules=a}static get rules(){return{block:Ae,inline:ge}}static lex(t,a){return new Ne(a).lex(t)}static lexInline(t,a){return new Ne(a).inlineTokens(t)}lex(t){t=t.replace(G.carriageReturn,`
`),this.blockTokens(t,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){let s=this.inlineQueue[a];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,a=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(G.tabCharGlobal," ").replace(G.spaceLine,""));let n=1/0;for(;t;){if(t.length<n)n=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let l;if(this.options.extensions?.block?.some(o=>(l=o.call({lexer:this},t,a))?(t=t.substring(l.raw.length),a.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let o=a.at(-1);l.raw.length===1&&o!==void 0?o.raw+=`
`:a.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let o=a.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+l.raw,o.text+=`
`+l.text,this.inlineQueue.at(-1).src=o.text):a.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let o=a.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+l.raw,o.text+=`
`+l.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},a.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),a.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),a.push(l);continue}let r=t;if(this.options.extensions?.startBlock){let o=1/0,c=t.slice(1),p;this.options.extensions.startBlock.forEach(b=>{p=b.call({lexer:this},c),typeof p=="number"&&p>=0&&(o=Math.min(o,p))}),o<1/0&&o>=0&&(r=t.substring(0,o+1))}if(this.state.top&&(l=this.tokenizer.paragraph(r))){let o=a.at(-1);s&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+l.raw,o.text+=`
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):a.push(l),s=r.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let o=a.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+l.raw,o.text+=`
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):a.push(l);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,a}inline(t,a=[]){return this.inlineQueue.push({src:t,tokens:a}),a}inlineTokens(t,a=[]){this.tokenizer.lexer=this;let s=t,n=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)p.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)l=n[2]?n[2].length:0,s=s.slice(0,n.index+l)+"["+"a".repeat(n[0].length-l-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let r=!1,o="",c=1/0;for(;t;){if(t.length<c)c=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}r||(o=""),r=!1;let p;if(this.options.extensions?.inline?.some(u=>(p=u.call({lexer:this},t,a))?(t=t.substring(p.raw.length),a.push(p),!0):!1))continue;if(p=this.tokenizer.escape(t)){t=t.substring(p.raw.length),a.push(p);continue}if(p=this.tokenizer.tag(t)){t=t.substring(p.raw.length),a.push(p);continue}if(p=this.tokenizer.link(t)){t=t.substring(p.raw.length),a.push(p);continue}if(p=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(p.raw.length);let u=a.at(-1);p.type==="text"&&u?.type==="text"?(u.raw+=p.raw,u.text+=p.text):a.push(p);continue}if(p=this.tokenizer.emStrong(t,s,o)){t=t.substring(p.raw.length),a.push(p);continue}if(p=this.tokenizer.codespan(t)){t=t.substring(p.raw.length),a.push(p);continue}if(p=this.tokenizer.br(t)){t=t.substring(p.raw.length),a.push(p);continue}if(p=this.tokenizer.del(t,s,o)){t=t.substring(p.raw.length),a.push(p);continue}if(p=this.tokenizer.autolink(t)){t=t.substring(p.raw.length),a.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(t))){t=t.substring(p.raw.length),a.push(p);continue}let b=t;if(this.options.extensions?.startInline){let u=1/0,f=t.slice(1),A;this.options.extensions.startInline.forEach(S=>{A=S.call({lexer:this},f),typeof A=="number"&&A>=0&&(u=Math.min(u,A))}),u<1/0&&u>=0&&(b=t.substring(0,u+1))}if(p=this.tokenizer.inlineText(b)){t=t.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),r=!0;let u=a.at(-1);u?.type==="text"?(u.raw+=p.raw,u.text+=p.text):a.push(p);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return a}infiniteLoopError(t){let a="Infinite loop on byte: "+t;if(this.options.silent)console.error(a);else throw new Error(a)}},Ie=class{options;parser;constructor(e){this.options=e||re}space(e){return""}code({text:e,lang:t,escaped:a}){let s=(t||"").match(G.notSpaceStart)?.[0],n=e.replace(G.endingNewline,"")+`
`;return s?'<pre><code class="language-'+V(s)+'">'+(a?n:V(n,!0))+`</code></pre>
`:"<pre><code>"+(a?n:V(n,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){let t=e.ordered,a=e.start,s="";for(let r=0;r<e.items.length;r++){let o=e.items[r];s+=this.listitem(o)}let n=t?"ol":"ul",l=t&&a!==1?' start="'+a+'"':"";return"<"+n+l+`>
`+s+"</"+n+`>
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t="",a="";for(let n=0;n<e.header.length;n++)a+=this.tablecell(e.header[n]);t+=this.tablerow({text:a});let s="";for(let n=0;n<e.rows.length;n++){let l=e.rows[n];a="";for(let r=0;r<l.length;r++)a+=this.tablecell(l[r]);s+=this.tablerow({text:a})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
<thead>
`+t+`</thead>
`+s+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let t=this.parser.parseInline(e.tokens),a=e.header?"th":"td";return(e.align?`<${a} align="${e.align}">`:`<${a}>`)+t+`</${a}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${V(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:a}){let s=this.parser.parseInline(a),n=ct(e);if(n===null)return s;e=n;let l='<a href="'+e+'"';return t&&(l+=' title="'+V(t)+'"'),l+=">"+s+"</a>",l}image({href:e,title:t,text:a,tokens:s}){s&&(a=this.parser.parseInline(s,this.parser.textRenderer));let n=ct(e);if(n===null)return V(a);e=n;let l=`<img src="${e}" alt="${V(a)}"`;return t&&(l+=` title="${V(t)}"`),l+=">",l}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:V(e.text)}},at=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Q=class Me{options;renderer;textRenderer;constructor(t){this.options=t||re,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new at}static parse(t,a){return new Me(a).parse(t)}static parseInline(t,a){return new Me(a).parseInline(t)}parse(t){this.renderer.parser=this;let a="";for(let s=0;s<t.length;s++){let n=t[s];if(this.options.extensions?.renderers?.[n.type]){let r=n,o=this.options.extensions.renderers[r.type].call({parser:this},r);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(r.type)){a+=o||"";continue}}let l=n;switch(l.type){case"space":{a+=this.renderer.space(l);break}case"hr":{a+=this.renderer.hr(l);break}case"heading":{a+=this.renderer.heading(l);break}case"code":{a+=this.renderer.code(l);break}case"table":{a+=this.renderer.table(l);break}case"blockquote":{a+=this.renderer.blockquote(l);break}case"list":{a+=this.renderer.list(l);break}case"checkbox":{a+=this.renderer.checkbox(l);break}case"html":{a+=this.renderer.html(l);break}case"def":{a+=this.renderer.def(l);break}case"paragraph":{a+=this.renderer.paragraph(l);break}case"text":{a+=this.renderer.text(l);break}default:{let r='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return a}parseInline(t,a=this.renderer){this.renderer.parser=this;let s="";for(let n=0;n<t.length;n++){let l=t[n];if(this.options.extensions?.renderers?.[l.type]){let o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=o||"";continue}}let r=l;switch(r.type){case"escape":{s+=a.text(r);break}case"html":{s+=a.html(r);break}case"link":{s+=a.link(r);break}case"image":{s+=a.image(r);break}case"checkbox":{s+=a.checkbox(r);break}case"strong":{s+=a.strong(r);break}case"em":{s+=a.em(r);break}case"codespan":{s+=a.codespan(r);break}case"br":{s+=a.br(r);break}case"del":{s+=a.del(r);break}case"text":{s+=a.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},fe=class{options;block;constructor(e){this.options=e||re}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?F.lex:F.lexInline}provideParser(e=this.block){return e?Q.parse:Q.parseInline}},Bs=class{defaults=Ve();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Q;Renderer=Ie;TextRenderer=at;Lexer=F;Tokenizer=ze;Hooks=fe;constructor(...e){this.use(...e)}walkTokens(e,t){let a=[];for(let s of e)switch(a=a.concat(t.call(this,s)),s.type){case"table":{let n=s;for(let l of n.header)a=a.concat(this.walkTokens(l.tokens,t));for(let l of n.rows)for(let r of l)a=a.concat(this.walkTokens(r.tokens,t));break}case"list":{let n=s;a=a.concat(this.walkTokens(n.items,t));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(l=>{let r=n[l].flat(1/0);a=a.concat(this.walkTokens(r,t))}):n.tokens&&(a=a.concat(this.walkTokens(n.tokens,t)))}}return a}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(a=>{let s={...a};if(s.async=this.defaults.async||s.async||!1,a.extensions&&(a.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let l=t.renderers[n.name];l?t.renderers[n.name]=function(...r){let o=n.renderer.apply(this,r);return o===!1&&(o=l.apply(this,r)),o}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=t[n.level];l?l.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),s.extensions=t),a.renderer){let n=this.defaults.renderer||new Ie(this.defaults);for(let l in a.renderer){if(!(l in n))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let r=l,o=a.renderer[r],c=n[r];n[r]=(...p)=>{let b=o.apply(n,p);return b===!1&&(b=c.apply(n,p)),b||""}}s.renderer=n}if(a.tokenizer){let n=this.defaults.tokenizer||new ze(this.defaults);for(let l in a.tokenizer){if(!(l in n))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let r=l,o=a.tokenizer[r],c=n[r];n[r]=(...p)=>{let b=o.apply(n,p);return b===!1&&(b=c.apply(n,p)),b}}s.tokenizer=n}if(a.hooks){let n=this.defaults.hooks||new fe;for(let l in a.hooks){if(!(l in n))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let r=l,o=a.hooks[r],c=n[r];fe.passThroughHooks.has(l)?n[r]=p=>{if(this.defaults.async&&fe.passThroughHooksRespectAsync.has(l))return(async()=>{let u=await o.call(n,p);return c.call(n,u)})();let b=o.call(n,p);return c.call(n,b)}:n[r]=(...p)=>{if(this.defaults.async)return(async()=>{let u=await o.apply(n,p);return u===!1&&(u=await c.apply(n,p)),u})();let b=o.apply(n,p);return b===!1&&(b=c.apply(n,p)),b}}s.hooks=n}if(a.walkTokens){let n=this.defaults.walkTokens,l=a.walkTokens;s.walkTokens=function(r){let o=[];return o.push(l.call(this,r)),n&&(o=o.concat(n.call(this,r))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return F.lex(e,t??this.defaults)}parser(e,t){return Q.parse(e,t??this.defaults)}parseMarkdown(e){return(t,a)=>{let s={...a},n={...this.defaults,...s},l=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return l(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 t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=e),n.async)return(async()=>{let r=n.hooks?await n.hooks.preprocess(t):t,o=await(n.hooks?await n.hooks.provideLexer(e):e?F.lex:F.lexInline)(r,n),c=n.hooks?await n.hooks.processAllTokens(o):o;n.walkTokens&&await Promise.all(this.walkTokens(c,n.walkTokens));let p=await(n.hooks?await n.hooks.provideParser(e):e?Q.parse:Q.parseInline)(c,n);return n.hooks?await n.hooks.postprocess(p):p})().catch(l);try{n.hooks&&(t=n.hooks.preprocess(t));let r=(n.hooks?n.hooks.provideLexer(e):e?F.lex:F.lexInline)(t,n);n.hooks&&(r=n.hooks.processAllTokens(r)),n.walkTokens&&this.walkTokens(r,n.walkTokens);let o=(n.hooks?n.hooks.provideParser(e):e?Q.parse:Q.parseInline)(r,n);return n.hooks&&(o=n.hooks.postprocess(o)),o}catch(r){return l(r)}}}onError(e,t){return a=>{if(a.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+V(a.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(a);throw a}}},ne=new Bs;function C(e,t){return ne.parse(e,t)}C.options=C.setOptions=function(e){return ne.setOptions(e),C.defaults=ne.defaults,rt(C.defaults),C},C.getDefaults=Ve,C.defaults=re,C.use=function(...e){return ne.use(...e),C.defaults=ne.defaults,rt(C.defaults),C},C.walkTokens=function(e,t){return ne.walkTokens(e,t)},C.parseInline=ne.parseInline,C.Parser=Q,C.parser=Q.parse,C.Renderer=Ie,C.TextRenderer=at,C.Lexer=F,C.lexer=F.lex,C.Tokenizer=ze,C.Hooks=fe,C.parse=C,C.options,C.setOptions,C.use,C.walkTokens,C.parseInline,Q.parse,F.lex;function Ps(e,t){const a=new C.Renderer;return a.blockquote=Ms,a.link=qs,a.image=Ns,$(()=>{const s=t?.minHeadingLevel??1;a.heading=Os(s);const n=be(e).trim();return la.sanitize(C(n,{async:!1,renderer:a,gfm:!1,breaks:!1,pedantic:!1}),{ALLOWED_TAGS:["h1","h2","h3","h4","h5","h6","strong","p","a","ul","ol","li","em","del","blockquote"]})})}function qs({href:e,title:t,text:a}){let s;try{s=new URL(e)}catch{return""}if(s.protocol!=="http:"&&s.protocol!=="https:")return"";let n='<a href="'+e+'" rel="noreferrer noopener"';return t&&(n+=' title="'+t+'"'),n+=">"+a.replaceAll(/(?<!\\)\\([^\\])/g,"$1")+"</a>",n}function Ns({title:e,text:t}){return t||(e??"")}function Ms({text:e}){return`<blockquote>${e}</blockquote>`}function Os(e){return({text:t,depth:a})=>(a=Math.min(6,a+(e-1)),`<h${a}>${t}</h${a}>`)}const Gs=["innerHTML"],js=B({__name:"MarkdownPreview",props:{text:{},minHeadingLevel:{default:1}},setup(e){const t=Ps(()=>e.text,{minHeadingLevel:e.minHeadingLevel});return(a,s)=>(h(),x("div",{class:"settings-markdown",innerHTML:i(t)},null,8,Gs))}}),Zt=N(js,[["__scopeId","data-v-cf1f9874"]]),Hs=B({__name:"AppDescriptionTab",props:{app:{}},setup(e){return(t,a)=>(h(),D(i(Le),{id:"desc",name:i(d)("appstore","Description"),order:0},{icon:y(()=>[k(i(L),{path:i(Za)},null,8,["path"])]),default:y(()=>[_("div",{class:w(t.$style.appDescriptionTab)},[k(Zt,{text:e.app.description,minHeadingLevel:3},null,8,["text"])],2)]),_:1},8,["name"]))}}),Zs="_appDescriptionTab_118mz_2",Us={appDescriptionTab:Zs},Fs={$style:Us},Qs=N(Hs,[["__cssModules",Fs]]),Vs=["title"],Ws=B({__name:"BadgeAppDaemon",props:{daemon:{}},setup(e){return(t,a)=>e.daemon?(h(),x("span",{key:0,class:w(t.$style.appDaemonBadge),title:e.daemon.name},[k(i(L),{path:i($t),size:20,inline:""},null,8,["path"]),q(" "+v(e.daemon.display_name),1)],10,Vs)):I("",!0)}}),Xs="_appDaemonBadge_1n34s_2",Ys={appDaemonBadge:Xs},Js={$style:Ys},Ut=N(Ws,[["__cssModules",Js]]),Ks=["title"],el=B({__name:"BadgeAppLevel",props:{level:{}},setup(e){const t=e,a=$(()=>t.level===300),s=$(()=>t.level===200),n=$(()=>a.value?wt:Ue),l=$(()=>a.value?d("appstore","Supported"):d("appstore","Featured")),r=$(()=>a.value?d("appstore","This app is supported via your current Nextcloud subscription."):d("appstore","Featured apps are developed by and within the community. They offer central functionality and are ready for production use."));return(o,c)=>a.value||s.value?(h(),x("span",{key:0,class:w([o.$style.appLevelBadge,{[o.$style.appLevelBadge__supported]:a.value}]),title:r.value},[k(i(L),{path:n.value,size:20,inline:""},null,8,["path"]),q(" "+v(l.value),1)],10,Ks)):I("",!0)}}),tl="_appLevelBadge_q2et3_2",al="_appLevelBadge__supported_q2et3_15",nl={appLevelBadge:tl,appLevelBadge__supported:al},sl={$style:nl},Ft=N(el,[["__cssModules",sl]]),ll=["aria-label","title"],rl=B({__name:"BadgeAppScore",props:{app:{}},setup(e){const t=$(()=>!e.app.shipped&&e.app.ratingNumOverall&&e.app.ratingNumOverall>5),a=$(()=>e.app.ratingOverall??4),s=$(()=>{const o=(a.value*5).toFixed(1);return d("appstore","Community rating: {score}/5",{score:o})}),n=$(()=>Math.floor(a.value*5+.25)),l=$(()=>Math.min(Math.floor((1-a.value)*5+.25),5-n.value)),r=$(()=>n.value+l.value<5);return(o,c)=>t.value?(h(),x("span",{key:0,role:"img","aria-label":s.value,title:s.value,class:w(o.$style.badgeAppScore)},[(h(!0),x(M,null,H(n.value,p=>(h(),D(i(L),{key:`full-star-${p}`,path:i(Ue),inline:""},null,8,["path"]))),128)),r.value?(h(),D(i(L),{key:0,path:i(Ua),inline:""},null,8,["path"])):I("",!0),(h(!0),x(M,null,H(l.value,p=>(h(),D(i(L),{key:`empty-star-${p}`,path:i(Tt),inline:""},null,8,["path"]))),128))],10,ll)):I("",!0)}}),il="_badgeAppScore_1t97c_2",ol={badgeAppScore:il},pl={$style:ol},cl=N(rl,[["__cssModules",pl]]),ul=new kt({concurrency:3}),Qt=_e("groups",()=>{const e=E(new Map);async function t(l){return await ul.add(()=>n(l))}async function a(l){const r=je("/cloud/groups/details");try{const{data:o}=await O.get(r,{params:{search:l.trim(),limit:10}});for(const c of o.ocs.data.groups)e.value.has(c.id)||e.value.set(c.id,{id:c.id,displayName:c.displayname,isNoUser:!0})}catch(o){U.error("Failed to search groups",{error:o})}}function s(l){return e.value.get(l)}return{groups:$(()=>Array.from(e.value.values())),searchGroups:a,getGroupById:s,fetchGroupById:t};async function n(l){return e.value.has(l)||await a(l),e.value.get(l)}});function Vt(e){const t=Qt(),a=E([]);return oe(()=>be(e).groups,async()=>{const s=be(e).groups;if(s===void 0){a.value=[];return}const n=s.map(r=>t.fetchGroupById(r)),l=await Promise.all(n);a.value=l.filter(Boolean)},{immediate:!0}),gt(a)}const dl={class:"app-details"},hl=["aria-label"],gl=["id"],ml=["aria-labelledby"],fl=["title"],bl=["aria-label"],kl=["href"],_l=B({__name:"AppDetailsTab",props:{app:{}},setup(e){const t=Z(),a=Kt(),s=$(()=>e.app.releases?.map(u=>u.lastModified).map(u=>Date.parse(u)).sort().at(-1)),n=$(()=>e.app?[e.app.author].flat().map(b).sort((u,f)=>u.split(" ").at(-1).localeCompare(f.split(" ").at(-1))).join(", "):""),l=$(()=>`https://apps.nextcloud.com/apps/${e.app.id}`),r=Vt(()=>e.app),o=$(()=>{const u=[];return e.app.internal||u.push({id:"appstore",href:l.value,label:d("appstore","View in store")}),e.app.website&&u.push({id:"website",href:e.app.website,label:d("appstore","Visit website")}),e.app.documentation&&(e.app.documentation.user&&u.push({id:"doc-user",href:e.app.documentation.user,label:d("appstore","Usage documentation")}),e.app.documentation.admin&&u.push({id:"doc-admin",href:e.app.documentation.admin,label:d("appstore","Admin documentation")}),e.app.documentation.developer&&u.push({id:"doc-developer",href:e.app.documentation.developer,label:d("appstore","Developer documentation")})),u}),c=$(()=>[e.app.category].flat().map(u=>t.getCategoryById(u)?.displayName??u).join(", ")),p=$(()=>e.app.active&&!Qe(e.app));function b(u){return u["@value"]?u["@value"]:u}return(u,f)=>(h(),D(i(Le),{id:"details",name:i(d)("appstore","Details"),order:1},{icon:y(()=>[k(i(L),{path:i(Fa)},null,8,["path"])]),default:y(()=>[_("div",dl,[_("div",{class:w(u.$style.appstoreDetailsTab__badges)},[k(Ft,{level:e.app.level},null,8,["level"]),e.app.app_api&&e.app.daemon?(h(),D(Ut,{key:0,daemon:e.app.daemon},null,8,["daemon"])):I("",!0),k(cl,{app:e.app},null,8,["app"])],2),!e.app.isCompatible&&e.app.missingDependencies&&e.app.missingDependencies.length?(h(),D(i(nt),{key:0,type:"error"},{default:y(()=>[q(v(i(d)("appstore","This app cannot be installed because the following dependencies are not fulfilled:"))+" ",1),_("ul",{"aria-label":i(d)("appstore","Missing dependencies"),class:w(u.$style.appstoreDetailsTab__missingDependencies)},[(h(!0),x(M,null,H(e.app.missingDependencies,(A,S)=>(h(),x("li",{key:S},v(A),1))),128))],10,hl)]),_:1})):I("",!0),p.value?(h(),D(i(nt),{key:1,type:"info"},{default:y(()=>[q(v(i(d)("appstore","This app cannot be limited to groups because it provides functionality that is executed before group membership is determined.")),1)]),_:1})):I("",!0),i(r).length?(h(),x("div",{key:2,class:w(u.$style.appstoreDetailsTab__section)},[_("h4",{id:i(a)},v(i(d)("appstore","Limited to groups")),9,gl),_("ul",{"aria-labelledby":i(a),class:w(u.$style.appstoreDetailsTab__sectionDetails)},[(h(!0),x(M,null,H(i(r),A=>(h(),x("li",{key:A.id,title:A.id},v(A.displayName),9,fl))),128))],10,ml)],2)):I("",!0),s.value&&!e.app.shipped?(h(),x("div",{key:3,class:w(u.$style.appstoreDetailsTab__section)},[_("h4",null,v(i(d)("appstore","Latest updated")),1),k(i(_a),{class:w(u.$style.appstoreDetailsTab__sectionDetails),timestamp:s.value},null,8,["class","timestamp"])],2)):I("",!0),_("div",{class:w(u.$style.appstoreDetailsTab__section)},[_("h4",null,v(i(d)("appstore","Author")),1),_("p",{class:w(u.$style.appstoreDetailsTab__sectionDetails)},v(n.value),3)],2),_("div",{class:w(u.$style.appstoreDetailsTab__section)},[_("h4",null,v(i(d)("appstore","Categories")),1),_("p",{class:w(u.$style.appstoreDetailsTab__sectionDetails)},v(c.value),3)],2),o.value.length>0?(h(),x("div",{key:4,class:w(u.$style.appstoreDetailsTab__section)},[_("h4",null,v(i(d)("appstore","Resources")),1),_("ul",{class:w(u.$style.appstoreDetailsTab__resources),"aria-label":i(d)("appstore","Documentation resources")},[(h(!0),x(M,null,H(o.value,A=>(h(),x("li",{key:A.id,class:w(u.$style.appstoreDetailsTab__resourcesItem)},[_("a",{class:w(u.$style.appstoreDetailsTab__resourcesLink),href:A.href,target:"_blank",rel:"noreferrer noopener"},v(A.label)+" ↗ ",11,kl)],2))),128))],10,bl)],2)):I("",!0)])]),_:1},8,["name"]))}}),yl="_appstoreDetailsTab__badges_4x76r_2",wl="_appstoreDetailsTab__section_4x76r_8",vl="_appstoreDetailsTab__sectionDetails_4x76r_18",xl="_appstoreDetailsTab__missingDependencies_4x76r_22",$l="_appstoreDetailsTab__resourcesLink_4x76r_28",Tl="_appstoreDetailsTab__resourcesItem_4x76r_32",Al={appstoreDetailsTab__badges:yl,appstoreDetailsTab__section:wl,appstoreDetailsTab__sectionDetails:vl,appstoreDetailsTab__missingDependencies:xl,appstoreDetailsTab__resourcesLink:$l,appstoreDetailsTab__resourcesItem:Tl},Sl={$style:Al},Rl=N(_l,[["__cssModules",Sl]]),Dl=B({__name:"AppReleasesTab",props:{app:{}},setup(e){const t=e,a=$(()=>(t.app.releases??[]).filter(n=>{const l=Object.values(n.translations??{});return l.length>0&&l.some(({changelog:r})=>!!r)}));function s(n){return n.translations[ra()]?.changelog??n.translations.en?.changelog??""}return(n,l)=>a.value.length>0?(h(),D(i(Le),{key:0,id:"changelog",name:i(d)("appstore","Changelog"),order:2},{icon:y(()=>[k(i(L),{path:i(Qa),size:24},null,8,["path"])]),default:y(()=>[(h(!0),x(M,null,H(a.value,r=>(h(),x("div",{key:r.version,class:w(n.$style.appReleasesTab)},[_("h3",{class:w(n.$style.appReleasesTab__heading)},v(r.version),3),k(Zt,{class:w(n.$style.appReleasesTab__text),minHeadingLevel:3,text:s(r)},null,8,["class","text"])],2))),128))]),_:1},8,["name"])):I("",!0)}}),zl="_appReleasesTab__heading_9xawz_2",Il="_appReleasesTab__text_9xawz_7",Cl={appReleasesTab__heading:zl,appReleasesTab__text:Il},Ll={$style:Cl},El=N(Dl,[["__cssModules",Ll]]),Bl={id:"disable",icon:vt,order:10,enabled:Dt,label:()=>d("appstore","Disable"),async callback(e){await Z().disableApp(e.id)}},Pl={id:"enable",icon:xt,order:1,variant:"primary",enabled(e){return!ue(e)&&St(e)},label:()=>d("appstore","Enable"),async callback(e){await Z().enableApp(e.id)}},ql={id:"force-enable",icon:Va,order:3,inline:!1,variant:"warning",label:()=>d("appstore","Force enable"),enabled(e){return!ue(e)&&Rt(e)&&xe(e)},async callback(e){await Z().enableApp(e.id,!0)}},Nl={id:"install",icon:Ze,order:5,enabled(e){return ue(e)&&!xe(e)},label:e=>e.app_api?d("appstore","Deploy and enable"):e.needsDownload?d("appstore","Download and enable"):d("appstore","Install and enable"),async callback(e){await Z().enableApp(e.id)}},Ml={id:"install-forced",icon:Ze,order:5,inline:!1,enabled(e){return ue(e)&&xe(e)},label:e=>e.app_api?d("appstore","Deploy and force enable"):e.needsDownload?d("appstore","Download and force enable"):d("appstore","Install and force enable"),async callback(e){await Z().enableApp(e.id,!0)}},Ol=[{id:"rate",icon:Tt,order:30,inline:!1,label:()=>d("appstore","Rate the app"),enabled(e){return!e.shipped},href(e){return`https://apps.nextcloud.com/apps/${encodeURIComponent(e.id)}#comments`}},{id:"report-bug",icon:Wa,order:32,inline:!1,label:()=>d("appstore","Report a bug"),enabled(e){return!!e.bugs},href(e){return e.bugs}},{id:"discussion",icon:Xa,order:35,inline:!1,label:()=>d("appstore","Ask questions or discuss the app"),enabled(e){return!!e.discussion},href(e){return e.discussion}},{id:"website",icon:Ya,order:38,inline:!1,label:()=>d("appstore","Visit the website"),enabled(e){return!!e.website},href(e){return e.website}}],Gl=ea(()=>ce(()=>Promise.resolve().then(()=>_r),void 0,import.meta.url)),jl={id:"limit-to-group",icon:Ja,order:16,inline:!1,label:()=>d("appstore","Limit to groups"),enabled:Qe,async callback(e){await yt(Gl,{app:e})}},Hl={id:"remove",order:20,icon:Ka,variant:"error",inline:!1,enabled:At,label:()=>d("appstore","Remove"),async callback(e){await Z().uninstallApp(e.id)}},Zl={id:"update",icon:en,variant:"primary",order:0,enabled(e){return vn(e)?e.app_api?e.daemon&&e.daemon?.accepts_deploy_id==="manual-install"?!0:$e().daemonAccessible:!0:!1},label:e=>d("appstore","Update to {version}",{version:e.update}),async callback(e){await Ct().updateApp(e.id)}},Ul=[Zl,Pl,Bl,ql,Nl,Ml,Hl,jl,...Ol].sort((e,t)=>e.order-t.order);function Wt(e){return $(()=>be(e)?Ul.filter(t=>t.enabled(be(e))):[])}function Fl(e){const t=E(null),a=$(()=>{let s;return e.value?.app_api?s=Re:s=[e.value?.category??[]].flat().map(n=>X[n]).filter(n=>!!n).at(0)??(e.value?.app_api?Re:tn),s?`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="${s}" /></svg>`:null});return ta(async()=>{if(!e.value?.icon)t.value=a.value;else{t.value=null;try{const s=await(await(await window.fetch(e.value.icon)).blob()).text();t.value=s.replaceAll(/fill="#(fff|ffffff)([a-z0-9]{1,2})?"/ig,'fill="currentColor"')}catch(s){t.value=a.value,U.error("Could not load app icon",{error:s})}}}),{appIcon:t}}const Ql=B({__name:"AppstoreSidebar",setup(e){const t=ye(),a=Ge(),s=Z(),n=Lt(),l=$(()=>[t.params.id].flat()[0]),r=$(()=>s.getAppById(l.value)??null),{appIcon:o}=Fl(r),c=$(()=>r.value?r.value.license?d("appstore","Version {version}, {license}-licensed",{version:r.value.version,license:String(r.value.license).toUpperCase()}):d("appstore","Version {version}",{version:r.value.version}):""),p=E("details");oe([r],()=>{p.value="details"});function b(){a.replace({name:t.name,params:{...t.params,id:void 0},query:n.getQuery()})}const u=E(!1),f=$(()=>r.value?.screenshot&&u.value);function A(){if(r.value?.releases&&r.value?.screenshot){const P=new Image;P.onload=()=>{u.value=!0},P.src=r.value.screenshot}}oe([r],A),aa(A);const S=Wt(()=>r.value);return(P,Y)=>(h(),D(i(ma),{active:p.value,"onUpdate:active":Y[0]||(Y[0]=T=>p.value=T),class:w([P.$style.appstoreSidebar,{[P.$style.appstoreSidebar_withScreenshot]:f.value}]),background:f.value?r.value.screenshot:void 0,compact:!f.value,name:r.value?.name??l.value,title:r.value?.name??l.value,subname:c.value,subtitle:c.value,onClose:b},Oe({default:y(()=>[r.value?(h(),x(M,{key:1},[k(Qs,{app:r.value},null,8,["app"]),k(El,{app:r.value},null,8,["app"]),k(Rl,{app:r.value},null,8,["app"]),r.value.app_api?(h(),D(Vn,{key:0,app:r.value},null,8,["app"])):I("",!0)],64)):(h(),D(i(He),{key:0,name:"No such app"}))]),_:2},[f.value?void 0:{name:"header",fn:y(()=>[k(i(L),{class:w(P.$style.appstoreSidebar__fallbackIcon),svg:i(o)??"",size:64},null,8,["class","svg"])]),key:"0"},r.value?{name:"description",fn:y(()=>[k(Et,{app:r.value,actions:i(S),iconOnly:"",maxInlineActions:6},null,8,["app","actions"])]),key:"1"}:void 0]),1032,["active","class","background","compact","name","title","subname","subtitle"]))}}),Vl="_appstoreSidebar_withScreenshot_1224s_3",Wl="_appstoreSidebar__fallbackIcon_1224s_9",Xl={appstoreSidebar_withScreenshot:Vl,appstoreSidebar__fallbackIcon:Wl},Yl={$style:Xl},Jl=N(Ql,[["__cssModules",Yl]]),Kl=B({__name:"AppstoreApp",setup(e){const t=ye(),a=Z(),s=$(()=>t.params.category?[t.params.category].flat()[0]:t.name==="apps-bundles"?"bundles":t.name==="apps-search"?"search":"discover"),n=$(()=>s.value in W?W[s.value]:a.getCategoryById(s.value)?.displayName??s.value),l=$(()=>`${n.value} - ${d("appstore","App store")}`),r=$(()=>!!t.params.id);return(o,c)=>{const p=na("router-view");return h(),D(i(ca),{appName:"appstore"},{default:y(()=>[k(Mn),k(i(pa),{class:w(o.$style.appstoreApp__content),pageHeading:i(d)("appstore","App store"),pageTitle:l.value},{default:y(()=>[n.value?(h(),x("h2",{key:0,class:w(o.$style.appstoreApp__heading)},v(n.value),3)):I("",!0),k(p)]),_:1},8,["class","pageHeading","pageTitle"]),r.value?(h(),D(Jl,{key:0})):I("",!0)]),_:1})}}}),er="_appstoreApp__content_1pi7x_2",tr="_appstoreApp__heading_1pi7x_7",ar={appstoreApp__content:er,appstoreApp__heading:tr},nr={$style:ar},sr=N(Kl,[["__cssModules",nr]]),lr=te("appstore","appstoreEnabled",!0),rr=()=>ce(()=>import("./AppstoreDiscover-DLzLfjqx.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74]),import.meta.url),ir=()=>ce(()=>import("./UpdateAllDialog-Bx9vMq27.chunk.mjs").then(e=>e.c),__vite__mapDeps([75,1,2,3,4,5,6,7,8,9,10,25,13,14,26,27,23,24,28,15,16,29,30,31,32,33,12,17,34,20,21,35,36,37,38,39,40,41,42,18,19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,11,76,73,74]),import.meta.url),or=()=>ce(()=>Promise.resolve().then(()=>pi),void 0,import.meta.url),pr=()=>ce(()=>import("./AppstoreBrowse-COQXh2ij.chunk.mjs"),__vite__mapDeps([77,6,7,4,1,2,5,8,9,18,19,15,16,75,3,10,25,13,14,26,27,23,24,28,29,30,31,32,33,12,17,34,20,21,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,11,76,73,74,22,70,71,78]),import.meta.url),cr=()=>ce(()=>import("./UpdateAllDialog-Bx9vMq27.chunk.mjs").then(e=>e.d),__vite__mapDeps([75,1,2,3,4,5,6,7,8,9,10,25,13,14,26,27,23,24,28,15,16,29,30,31,32,33,12,17,34,20,21,35,36,37,38,39,40,41,42,18,19,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,11,76,73,74]),import.meta.url),ur=[{path:"/:index(index.php/)?settings/apps",name:"apps",redirect:lr?{name:"apps-discover"}:{name:"apps-manage",params:{category:"installed"}},children:[{path:"discover/:id?",name:"apps-discover",component:rr},{path:"bundles/:id?",name:"apps-bundles",component:or},{path:":category(installed|enabled|disabled|updates)/:id?",name:"apps-manage",component:ir},{path:":category/:id?",name:"apps-category",component:pr},{path:"search/:id?",name:"apps-search",component:cr}]}],dr=ia({history:oa(K("")),linkActiveClass:"active",routes:ur}),hr=Xt(),Se=sa(sr);Se.config.idPrefix="appstore",Se.use(hr),Se.use(dr),Se.mount("#content");const gr=B({__name:"LimitToGroupDialog",props:{app:{}},emits:["close"],setup(e,{emit:t}){const a=t,s=Z(),n=Qt(),l=E(!1),r=E([]);oe(()=>e.app,()=>{r.value=(e.app.groups??[]).map(u=>{const f=n.getGroupById(u);return f||n.searchGroups(u),f??{id:u,displayName:u,isNoUser:!0}})},{immediate:!0});const o=$(()=>n.groups.filter(u=>!r.value.includes(u))),c=ln(n.searchGroups,400);async function p(){try{l.value=!0,await s.limitAppToGroups(e.app.id,r.value.map(u=>u.id)),a("close")}finally{l.value=!1}}async function b(){try{l.value=!0,await s.limitAppToGroups(e.app.id,[]),a("close")}finally{l.value=!1}}return(u,f)=>(h(),D(i(_t),{isForm:"",name:i(d)("appstore","Limit to groups"),onSubmit:p,onReset:b},{actions:y(()=>[k(i(pe),{disabled:l.value,type:"reset"},{default:y(()=>[q(v(i(d)("appstore","Reset limitation")),1)]),_:1},8,["disabled"]),k(i(pe),{disabled:l.value,type:"submit",variant:"primary"},Oe({default:y(()=>[q(" "+v(i(d)("appstore","Save")),1)]),_:2},[l.value?{name:"icon",fn:y(()=>[k(i(Ce))]),key:"0"}:void 0]),1032,["disabled"])]),default:y(()=>[_("p",null,v(i(d)("appstore","Restrict the usage of {app} to members of the following groups.",{app:e.app.name})),1),k(i(fa),{modelValue:r.value,"onUpdate:modelValue":f[0]||(f[0]=A=>r.value=A),class:w(u.$style.limitToGroupDialog__input),keepOpen:"",labelOutside:"",multiple:"",options:o.value,onSearch:i(c)},null,8,["modelValue","class","options","onSearch"])]),_:1},8,["name"]))}}),mr="_limitToGroupDialog__input_sofp5_2",fr={limitToGroupDialog__input:mr},br={$style:fr},kr=N(gr,[["__cssModules",br]]),_r=Object.freeze(Object.defineProperty({__proto__:null,default:kr},Symbol.toStringTag,{value:"Module"})),yr=["src","height","width"],wr=B({__name:"AppIcon",props:{app:{},noFallback:{type:Boolean},size:{default:20}},setup(e){const t=$(()=>e.app.icon?.endsWith(".svg")),a=E("");return oe(()=>e.app.icon,async()=>{if(a.value="",e.app.icon?.endsWith(".svg")){const s=await fetch(e.app.icon);s.ok&&(a.value=await s.text())}},{immediate:!0}),(s,n)=>(h(),x("span",{class:w(s.$style.appIcon)},[a.value?(h(),D(i(L),{key:0,size:e.size,svg:a.value},null,8,["size","svg"])):e.app.icon&&!t.value?(h(),x("img",{key:1,class:w(s.$style.appIcon__image),alt:"",src:e.app.icon,height:e.size,width:e.size},null,10,yr)):e.noFallback?I("",!0):(h(),D(i(L),{key:2,path:i(Re),size:e.size},null,8,["path","size"]))],2))}}),vr="_appIcon_mcsmb_2",xr="_appIcon__image_mcsmb_7",$r={appIcon:vr,appIcon__image:xr},Tr={$style:$r},Ar=N(wr,[["__cssModules",Tr]]),Sr={key:0,class:"hidden-visually"},Rr={class:"hidden-visually"},Dr={key:0},zr={key:1},Ir=["title"],Cr={key:0,"aria-hidden":"true"},Lr=B({__name:"AppTableRow",props:{app:{},isNarrow:{type:Boolean},isWide:{type:Boolean}},setup(e){const t=ye(),a=$(()=>({...t,params:{...t.params,id:e.app.id},query:{...t.query}})),s=$(()=>({id:"details",order:99,enabled:()=>!0,label:()=>d("appstore","Show details"),icon:an,to:()=>a.value,inline:!1})),n=Vt(()=>e.app),l=Wt(()=>e.app),r=$(()=>[...l.value,s.value]);return(o,c)=>(h(),x("tr",{class:w(o.$style.appTableRow)},[_("td",{class:w(o.$style.appTableRow__nameCell)},[k(i(pe),{alignment:"start",title:i(d)("appstore","Show details"),to:a.value,variant:"tertiary-no-background",wide:""},{icon:y(()=>[e.app.loading?(h(),D(i(Ce),{key:0,size:24})):(h(),D(Ar,{key:1,app:e.app,size:24},null,8,["app"]))]),default:y(()=>[q(" "+v(e.app.name)+" ",1),e.app.loading?(h(),x("span",Sr,"("+v(i(d)("appstore","is loading…"))+")",1)):I("",!0),_("span",Rr,"("+v(i(d)("appstore","Show details"))+")",1)]),_:1},8,["title","to"])],2),_("td",null,[_("span",{class:w(o.$style.appTableRow__versionCell)},v(e.app.version),3)]),e.isNarrow?I("",!0):(h(),x("td",Dr,[_("div",{class:w(o.$style.appTableRow__levelCell)},[e.app.level?(h(),D(Ft,{key:0,level:e.app.level},null,8,["level"])):I("",!0),"daemon"in e.app&&e.app.daemon?(h(),D(Ut,{key:1,daemon:e.app.daemon},null,8,["daemon"])):I("",!0)],2)])),e.isWide?(h(),x("td",zr,[i(n).length>0?(h(),x("ul",{key:0,class:w(o.$style.appTableRow__groupsCell),title:i(n).map(p=>p.displayName).join(", ")},[(h(!0),x(M,null,H(i(n),(p,b)=>(h(),x(M,{key:p.id},[b===3?(h(),x("li",Cr," … ")):I("",!0),_("li",{class:w({"hidden-visually":b>2})},[k(i(va),{text:p.displayName,noClose:""},null,8,["text"])],2)],64))),128))],10,Ir)):I("",!0)])):I("",!0),_("td",null,[_("div",{class:w(o.$style.appTableRow__actionsCell)},[k(Et,{class:w(o.$style.appTableRow__actionsCellActions),app:e.app,actions:r.value,iconOnly:e.isNarrow},null,8,["class","app","actions","iconOnly"])],2)])],2))}}),Er="_appTableRow_yekky_2",Br="_appTableRow__nameCell_yekky_11",Pr="_appTableRow__levelCell_yekky_16",qr="_appTableRow__versionCell_yekky_22",Nr="_appTableRow__groupsCell_yekky_26",Mr="_appTableRow__actionsCell_yekky_31",Or="_appTableRow__actionsCellActions_yekky_37",Gr={appTableRow:Er,appTableRow__nameCell:Br,appTableRow__levelCell:Pr,appTableRow__versionCell:qr,appTableRow__groupsCell:Nr,appTableRow__actionsCell:Mr,appTableRow__actionsCellActions:Or},jr={$style:Gr},Hr=N(Lr,[["__cssModules",jr]]),Zr={hidden:""},Ur={key:0},Fr={key:1},Qr=B({__name:"AppTable",props:{apps:{}},setup(e){const t=mt("table"),{width:a}=rn(t),s=$(()=>a.value<768),n=$(()=>a.value>=1280);return(l,r)=>(h(),x("table",{ref:"table",class:w([l.$style.appTable,{[l.$style.appTable_narrow]:s.value,[l.$style.appTable_wide]:n.value}])},[_("colgroup",null,[_("col",{class:w(l.$style.appTable__colName)},null,2),_("col",{class:w(l.$style.appTable__colVersion)},null,2),s.value?I("",!0):(h(),x("col",{key:0,class:w(l.$style.appTable__colSupport)},null,2)),n.value?(h(),x("col",{key:1,class:w(l.$style.appTable__colGroups)},null,2)):I("",!0),_("col",{class:w(l.$style.appTable__colActions)},null,2)]),_("thead",Zr,[_("tr",null,[_("th",null,v(i(d)("appstore","App name")),1),_("th",null,v(i(d)("appstore","Version")),1),s.value?I("",!0):(h(),x("th",Ur,v(i(d)("appstore","Support level")),1)),n.value?(h(),x("th",Fr,v(i(d)("appstore","Groups")),1)):I("",!0),_("th",null,v(i(d)("appstore","Actions")),1)])]),_("tbody",null,[(h(!0),x(M,null,H(e.apps,o=>(h(),D(Hr,{key:o.id,app:o,isNarrow:s.value,isWide:n.value},null,8,["app","isNarrow","isWide"]))),128))])],2))}}),Vr="_appTable_ss46x_2",Wr="_appTable__colName_ss46x_7",Xr="_appTable_narrow_ss46x_11",Yr="_appTable_wide_ss46x_15",Jr="_appTable__colSupport_ss46x_19",Kr="_appTable__colActions_ss46x_27",ei={appTable:Vr,appTable__colName:Wr,appTable_narrow:Xr,appTable_wide:Yr,appTable__colSupport:Jr,appTable__colActions:Kr},ti={$style:ei},ai=N(Qr,[["__cssModules",ti]]),ni=B({__name:"AppstoreBundles",setup(e){const t=Z(),a=$(()=>t.bundles.map(r=>({...r,apps:r.appIdentifiers.map(o=>t.apps.find(c=>c.id===o)).filter(Boolean),isEnabling:!1})));function s(r){return r.appIdentifiers.every(o=>{const c=t.apps.find(p=>p.id===o);return c&&(c.active||St(c))})}function n(r){return r.appIdentifiers.every(o=>{const c=t.apps.find(p=>p.id===o);return c&&c.active})}async function l(r){r.isEnabling=!0,await t.enableBundle(r.id),r.isEnabling=!1}return(r,o)=>i(t).isLoadingApps?(h(),D(i(He),{key:0,name:i(d)("appstore","Loading app list")},{icon:y(()=>[k(i(Ce),{size:64})]),_:1},8,["name"])):(h(!0),x(M,{key:1},H(a.value,c=>(h(),x("section",{key:c.id},[_("div",{class:w(r.$style.appstoreBundles__header)},[_("h3",null,v(c.name),1),n(c)?I("",!0):(h(),D(i(pe),{key:0,disabled:!s(c),variant:"primary",onClick:p=>l(c)},{icon:y(()=>[k(i(L),{path:i(nn)},null,8,["path"])]),default:y(()=>[q(" "+v(i(d)("appstore","Download and enable all")),1)]),_:1},8,["disabled","onClick"]))],2),k(ai,{class:w(r.$style.appstoreBundles__appTable),apps:c.apps},null,8,["class","apps"])]))),128))}}),si="_appstoreBundles__header_oplvy_2",li="_appstoreBundles__appTable_oplvy_11",ri={appstoreBundles__header:si,appstoreBundles__appTable:li},ii={$style:ri},oi=N(ni,[["__cssModules",ii]]),pi=Object.freeze(Object.defineProperty({__proto__:null,default:oi},Symbol.toStringTag,{value:"Module"}));export{to as A,cl as B,Zt as M,Dt as a,Lt as b,ue as c,ai as d,Ft as e,Ut as f,Ct as g,U as l,xe as n,Z as u};
//# sourceMappingURL=appstore-main.mjs.map