@weapp-vite/dashboard 6.17.2 → 6.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AppEmptyState.js +1 -1
- package/dist/assets/AppInsetPanel.js +1 -1
- package/dist/assets/AppMetricTile.js +1 -1
- package/dist/assets/AppRuntimeBadge.js +1 -1
- package/dist/assets/AppSectionHeading.js +1 -1
- package/dist/assets/activity.js +4 -4
- package/dist/assets/analyze.js +29 -29
- package/dist/assets/{css.worker-CvXBzhp8.js → css.worker-C078mPpn.js} +1 -1
- package/dist/assets/echarts.js +11 -11
- package/dist/assets/index.js +1 -1
- package/dist/assets/{json.worker-BkJRGcCJ.js → json.worker-C4lWBgVJ.js} +1 -1
- package/dist/assets/monaco.js +13 -13
- package/dist/assets/pages.js +2 -2
- package/dist/assets/rolldown-runtime.js +1 -1
- package/dist/assets/tokens.js +1 -1
- package/dist/assets/{ts.worker-B0J26iPs.js → ts.worker-CDlTriQ3.js} +8 -8
- package/dist/assets/vue.js +1 -1
- package/package.json +2 -2
package/dist/assets/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./monaco.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{A as e,C as t,K as n,L as r,M as i,N as a,P as o,R as s,S as c,T as l,U as u,W as d,X as f,_ as p,a as ee,c as m,g as h,h as g,i as _,j as v,k as y,n as te,p as b,q as x,r as S,s as C,t as w,v as T,x as E,y as D,z as O}from"./vue.js";import{n as ne,t as k}from"./vendor.js";import{s as A}from"./monaco.js";function re(e,t){if(e){if(Array.isArray(e)){for(let n of e)re(n,t);return}if(typeof e==`object`){for(let[n,r]of Object.entries(e))r&&t.push(n);return}t.push(String(e))}}function j(...e){let t=[];for(let n of e)re(n,t);return ne(t.join(` `))}var M=t({__name:`DashboardIcon`,props:{name:{}},setup(e){let t=e,n={"theme-system":`icon-[mdi--theme-light-dark]`,"theme-light":`icon-[mdi--white-balance-sunny]`,"theme-dark":`icon-[mdi--moon-waning-crescent]`,"nav-menu":`icon-[mdi--menu]`,"nav-home":`icon-[mdi--view-grid-outline]`,"nav-analyze":`icon-[mdi--chart-box-outline]`,"nav-activity":`icon-[mdi--timeline-text-outline]`,"nav-tokens":`icon-[mdi--palette-outline]`,"tab-overview":`icon-[mdi--view-dashboard-outline]`,"tab-packages":`icon-[mdi--package-variant-closed]`,"tab-modules":`icon-[mdi--vector-link]`,"tab-source":`icon-[mdi--source-branch]`,"status-dark":`icon-[mdi--circle-slice-8]`,"status-light":`icon-[mdi--checkbox-blank-circle]`,"status-live":`icon-[mdi--motion-play-outline]`,"metric-packages":`icon-[mdi--package-variant]`,"metric-subpackages":`icon-[mdi--layers-triple-outline]`,"metric-chunks":`icon-[mdi--chart-tree]`,"metric-assets":`icon-[mdi--file-document-multiple-outline]`,"metric-size-outline":`icon-[mdi--database-outline]`,"metric-modules":`icon-[mdi--cube-outline]`,"metric-duplicates":`icon-[mdi--vector-link]`,"metric-sources":`icon-[mdi--source-branch]`,"metric-copy":`icon-[mdi--content-copy]`,"metric-time":`icon-[mdi--clock-outline]`,"metric-entries":`icon-[mdi--export-variant]`,"metric-size":`icon-[mdi--database]`,treemap:`icon-[mdi--chart-box-outline]`,"top-files":`icon-[mdi--file-star-outline]`,subpackages:`icon-[mdi--layers-triple-outline]`,"duplicate-modules":`icon-[mdi--vector-link]`,"module-sources":`icon-[mdi--source-branch]`,"file-samples":`icon-[mdi--file-document-outline]`,"hero-workspace":`icon-[mdi--view-quilt-outline]`,"hero-commands":`icon-[mdi--console-line]`,"hero-system":`icon-[mdi--shape-outline]`,"metric-ready":`icon-[mdi--rocket-launch-outline]`,"metric-health":`icon-[mdi--heart-pulse]`,"metric-latency":`icon-[mdi--timer-sand]`,"metric-quality":`icon-[mdi--shield-check-outline]`,"metric-search":`icon-[mdi--magnify]`,"metric-history":`icon-[mdi--history]`,"metric-bookmark":`icon-[mdi--bookmark-check-outline]`,"metric-link":`icon-[mdi--link-variant]`,"metric-reset":`icon-[mdi--restore]`,"token-color":`icon-[mdi--palette-outline]`,"token-surface":`icon-[mdi--card-bulleted-outline]`,"token-type":`icon-[mdi--format-letter-spacing]`},r=g(()=>n[t.name]??`icon-[mdi--file-document-multiple-outline]`);return(e,t)=>(v(),D(`span`,{class:x([`h-full w-full`,r.value])},null,2))}}),ie={class:`grid gap-2 overflow-y-auto pr-1`},ae={class:`flex items-start gap-3`},oe={class:`h-5 w-5`},se={class:`min-w-0`},ce={class:`font-medium text-(--dashboard-text)`},le={key:0,class:`ml-5 grid gap-1 border-l border-(--dashboard-border) pl-3`},ue={class:`h-4 w-4 shrink-0`},de={class:`min-w-0 truncate`},N=t({__name:`AppNavigationList`,props:{currentAnalyzeTab:{},currentPath:{},items:{},mobile:{type:Boolean,default:!1}},emits:[`navigate`],setup(e,{emit:t}){let r=e,i=t;function o(e){return e===`/`?r.currentPath===`/`:r.currentPath===e||r.currentPath.startsWith(`${e}/`)}function s(e){let t=e.indexOf(`?`);return t===-1?`overview`:new URLSearchParams(e.slice(t+1)).get(`tab`)??`overview`}function l(e){return e.startsWith(`/analyze`)?r.currentPath===`/analyze`&&s(e)===r.currentAnalyzeTab:o(e)}function u(e){return o(e.to)||!!e.children?.some(e=>l(e.to))}return(t,r)=>(v(),D(`nav`,ie,[(v(!0),D(b,null,a(e.items,t=>(v(),D(`div`,{key:t.to,class:`grid gap-1`},[c(n(w),{to:t.to,class:x(n(j)(`group rounded-md border px-3 py-3 transition`,u(t)?`border-(--dashboard-border-strong) bg-(--dashboard-panel-strong) shadow-(--dashboard-shadow)`:`border-(--dashboard-border) bg-(--dashboard-panel-muted) hover:border-(--dashboard-border-strong) hover:bg-(--dashboard-panel)`)),onClick:r[0]||=e=>i(`navigate`)},{default:O(()=>[h(`div`,ae,[h(`span`,{class:x(n(j)(`flex h-10 w-10 shrink-0 items-center justify-center rounded-md`,u(t)?`bg-(--dashboard-accent-soft) text-(--dashboard-accent)`:`bg-(--dashboard-panel) text-(--dashboard-text-soft) group-hover:text-(--dashboard-accent)`))},[h(`span`,oe,[c(M,{name:t.iconName},null,8,[`name`])])],2),h(`div`,se,[h(`p`,ce,f(t.label),1),h(`p`,{class:x([`text-xs leading-5 text-(--dashboard-text-soft)`,e.mobile?`mt-1`:`mt-0.5 truncate`])},f(t.caption),3)])])]),_:2},1032,[`to`,`class`]),t.children?.length&&u(t)?(v(),D(`div`,le,[(v(!0),D(b,null,a(t.children,e=>(v(),p(n(w),{key:e.to,to:e.to,class:x(n(j)(`group flex min-w-0 items-center gap-2 rounded-md px-2.5 py-2 text-sm transition`,l(e.to)?`bg-(--dashboard-accent-soft) text-(--dashboard-accent)`:`text-(--dashboard-text-soft) hover:bg-(--dashboard-panel-muted) hover:text-(--dashboard-text)`)),onClick:r[1]||=e=>i(`navigate`)},{default:O(()=>[h(`span`,ue,[c(M,{name:e.iconName},null,8,[`name`])]),h(`span`,de,f(e.label),1)]),_:2},1032,[`to`,`class`]))),128))])):T(``,!0)]))),128))]))}}),fe={key:0,class:`mr-1.5 h-4 w-4 text-(--dashboard-accent)`},P=t({__name:`AppInfoPill`,props:{label:{},iconName:{},uppercase:{type:Boolean}},setup(e){return(t,n)=>(v(),D(`span`,{class:x([`inline-flex items-center rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-2.5 py-1 text-xs font-medium text-(--dashboard-text-soft)`,e.uppercase?`tracking-[0.18em] uppercase`:void 0])},[e.iconName?(v(),D(`span`,fe,[c(M,{name:e.iconName},null,8,[`name`])])):T(``,!0),E(` `+f(e.label),1)],2))}}),pe={class:`flex flex-col gap-3 rounded-lg border border-(--dashboard-border-strong) bg-(--dashboard-panel-strong) px-4 py-3 shadow-(--dashboard-shadow) md:px-5`},me={class:`flex items-start justify-between gap-3`},he={class:`flex items-start gap-3`},ge={class:`h-5 w-5`},_e={class:`mt-1 text-2xl font-semibold tracking-tight md:text-[1.8rem]`},ve={key:0,class:`mt-1 max-w-3xl text-sm leading-6 text-(--dashboard-text-muted)`},ye={key:0,class:`hidden items-center gap-2 rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2 text-xs font-medium text-(--dashboard-text-soft) md:inline-flex`,for:`dashboard-global-theme`},be={class:`h-4 w-4 text-(--dashboard-accent)`},xe=[`value`],Se=[`value`],Ce={class:`flex flex-wrap items-center gap-2 md:hidden`},we={key:0,class:`inline-flex items-center gap-2 rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2 text-xs font-medium text-(--dashboard-text-soft)`,for:`dashboard-mobile-theme`},Te={class:`h-4 w-4 text-(--dashboard-accent)`},Ee=[`value`],De=[`value`],Oe=t({__name:`AppShellHeader`,props:{title:{},description:{},themeOptions:{},themePreference:{}},emits:[`menu`,`setTheme`],setup(e,{emit:t}){let n=e,r=t,i=g(()=>n.themeOptions.find(e=>e.value===n.themePreference)?.iconName??`theme-system`),o=g(()=>n.themeOptions.length>0);function s(e){r(`setTheme`,e.target.value)}return(t,n)=>(v(),D(`header`,pe,[h(`div`,me,[h(`div`,he,[h(`button`,{class:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text) md:hidden`,type:`button`,onClick:n[0]||=e=>r(`menu`)},[h(`span`,ge,[c(M,{name:`nav-menu`})])]),h(`div`,null,[n[1]||=h(`p`,{class:`text-[11px] uppercase tracking-[0.28em] text-(--dashboard-accent)`},` weapp-vite dashboard `,-1),h(`h1`,_e,f(e.title),1),e.description?(v(),D(`p`,ve,f(e.description),1)):T(``,!0)])]),o.value?(v(),D(`label`,ye,[h(`span`,be,[c(M,{name:i.value},null,8,[`name`])]),h(`select`,{id:`dashboard-global-theme`,class:`min-w-32 bg-transparent text-(--dashboard-text) outline-none`,value:e.themePreference,onChange:s},[(v(!0),D(b,null,a(e.themeOptions,e=>(v(),D(`option`,{key:e.value,value:e.value},f(e.label),9,Se))),128))],40,xe)])):T(``,!0)]),h(`div`,Ce,[o.value?(v(),D(`label`,we,[h(`span`,Te,[c(M,{name:i.value},null,8,[`name`])]),h(`select`,{id:`dashboard-mobile-theme`,class:`min-w-32 bg-transparent text-(--dashboard-text) outline-none`,value:e.themePreference,onChange:s},[(v(!0),D(b,null,a(e.themeOptions,e=>(v(),D(`option`,{key:e.value,value:e.value},f(e.label),9,De))),128))],40,Ee)])):T(``,!0),o.value?(v(),p(P,{key:1,"icon-name":`status-live`,label:`shell ready`,uppercase:``})):T(``,!0)])]))}}),F=k({base:`flex flex-col rounded-lg border shadow-(--dashboard-shadow)`,variants:{tone:{default:`border-(--dashboard-border) bg-(--dashboard-panel)`,strong:`border-(--dashboard-border-strong) bg-(--dashboard-panel-strong)`,muted:`border-(--dashboard-border) bg-(--dashboard-panel-muted)`},padding:{none:``,sm:`p-3`,md:`p-4`,header:`px-4 py-4 md:px-5`}},defaultVariants:{tone:`default`,padding:`md`}}),I=k({base:`flex items-center justify-center rounded-md bg-(--dashboard-accent-soft) text-(--dashboard-accent)`,variants:{size:{sm:`h-8 w-8`,md:`h-9 w-9`,lg:`h-10 w-10`}},defaultVariants:{size:`md`}}),ke=k({base:`rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted)`,variants:{padding:{sm:`px-4 py-3`,md:`p-4`},interactive:{true:`transition hover:border-(--dashboard-border-strong) hover:bg-(--dashboard-panel)`,false:``}},defaultVariants:{padding:`md`,interactive:!1}}),Ae=k({base:`inline-flex items-center gap-2 rounded-full border transition`,variants:{kind:{nav:`px-3.5 py-1.5 text-sm`,theme:`px-3 py-1.5 text-xs font-medium`,badge:`px-2.5 py-1 text-[11px] uppercase tracking-[0.18em]`},active:{true:`border-(--dashboard-accent) bg-(--dashboard-accent-soft) text-(--dashboard-text)`,false:`border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text-soft) hover:border-(--dashboard-border-strong) hover:text-(--dashboard-text)`}},defaultVariants:{kind:`nav`,active:!1}}),je=k({base:`rounded-full border px-2.5 py-1 text-[11px] font-medium uppercase tracking-[0.16em]`,variants:{tone:{neutral:`border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text-soft)`,info:`border-(--dashboard-border-strong) bg-(--dashboard-accent-soft) text-(--dashboard-accent)`,success:`border-emerald-200 bg-emerald-100 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/12 dark:text-emerald-300`,warning:`border-amber-200 bg-amber-100 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/12 dark:text-amber-300`,error:`border-rose-200 bg-rose-100 text-rose-700 dark:border-rose-500/30 dark:bg-rose-500/12 dark:text-rose-300`}},defaultVariants:{tone:`neutral`}});k({base:`rounded-lg border border-(--dashboard-border) bg-(--dashboard-panel) px-4 py-3 text-[11px] uppercase tracking-[0.24em] text-(--dashboard-text-soft) shadow-(--dashboard-shadow)`});var Me={key:0,class:`flex items-start justify-between gap-4`},Ne={class:`flex min-w-0 items-start gap-3`},Pe={class:`h-5 w-5`},Fe={class:`min-w-0`},Ie={key:0,class:`text-[11px] uppercase tracking-[0.24em] text-(--dashboard-accent)`},Le={key:1,class:`text-lg font-semibold tracking-tight`},Re={key:2,class:`mt-1 text-sm leading-6 text-(--dashboard-text-muted)`},L=t({__name:`AppSurfaceCard`,props:{title:{default:void 0},description:{default:void 0},eyebrow:{default:void 0},iconName:{default:void 0},tone:{default:`default`},padding:{default:`md`},contentClass:{default:``}},setup(e){let t=e,i=r(),a=!!(t.title||t.description||i.header);return(t,r)=>(v(),D(`section`,{class:x(n(j)(n(F)({tone:e.tone,padding:e.padding}),e.contentClass))},[n(a)?(v(),D(`header`,Me,[h(`div`,Ne,[e.iconName?(v(),D(`span`,{key:0,class:x([n(I)({size:`md`}),`shrink-0`])},[h(`span`,Pe,[c(M,{name:e.iconName},null,8,[`name`])])],2)):T(``,!0),h(`div`,Fe,[e.eyebrow?(v(),D(`p`,Ie,f(e.eyebrow),1)):T(``,!0),e.title?(v(),D(`h2`,Le,f(e.title),1)):T(``,!0),e.description?(v(),D(`p`,Re,f(e.description),1)):T(``,!0)])]),o(t.$slots,`header`)])):T(``,!0),h(`div`,{class:x(n(j)(`min-h-0 flex-1`,n(a)?`mt-4`:``))},[o(t.$slots,`default`)],2)],2))}}),R=`weapp-vite-dashboard-theme`;function ze(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(R);return e===`light`||e===`dark`||e===`system`?e:`system`}function Be(e,t){return e===`light`||e===`dark`?e:t?.matches?`dark`:`light`}function z(){let t=u(ze()),n=typeof window<`u`?window.matchMedia(`(prefers-color-scheme: dark)`):null,r=g(()=>Be(t.value,n)),i=e=>{typeof document>`u`||(document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e)},a=e=>{typeof window>`u`||window.localStorage.setItem(R,e)},o=()=>{i(r.value)};return s(t,e=>{a(e),i(r.value)},{immediate:!0}),e(()=>{n?.addEventListener(`change`,o),i(r.value)}),y(()=>{n?.removeEventListener(`change`,o)}),{themePreference:t,resolvedTheme:r,setThemePreference(e){t.value=e}}}var B=Symbol(`dashboard-theme`);function Ve(e){i(B,e)}function He(){return l(B,null)||z()}var V=`weapp-vite-dashboard:analyze-result-history`;function Ue(e){return e.toLocaleString(`zh-CN`,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function H(e){return e?JSON.stringify({packages:e.packages,modules:e.modules,subPackages:e.subPackages,budgets:e.metadata?.budgets}):``}function U(e,t){return H(e)===H(t)}function W(e){return e.packages.flatMap(e=>e.files).reduce((e,t)=>e+(t.size??0),0)}function We(e){return e.packages.flatMap(e=>e.files).reduce((e,t)=>e+(t.brotliSize??t.gzipSize??Math.round((t.size??0)*.32)),0)}function Ge(e,t){let n=W(e);return`${Date.parse(t).toString(36)}-${n.toString(36)}-${e.modules.length.toString(36)}`}function G(e,t=new Date().toISOString()){let n=e.modules.filter(e=>e.packages.length>1).length;return{id:Ge(e,t),capturedAt:t,label:Ue(new Date(t)),result:e,totalBytes:W(e),compressedBytes:We(e),packageCount:e.packages.length,moduleCount:e.modules.length,duplicateCount:n}}function Ke(e){let t=[...e.snapshots??[]];e.previous&&t.push(G(e.previous)),t.push(G(e.current));let n=new Map;for(let e of t){let t=H(e.result);n.has(t)||n.set(t,e)}return[...n.values()].sort((e,t)=>Date.parse(t.capturedAt)-Date.parse(e.capturedAt)).slice(0,12)}function qe(){try{let e=window.localStorage.getItem(V);if(!e)return null;let t=JSON.parse(e);return!t?.current?.packages||!Array.isArray(t.current.packages)?null:{current:t.current,previous:t.previous?.packages?t.previous:null,snapshots:Array.isArray(t.snapshots)?t.snapshots.filter(e=>e?.result?.packages&&Array.isArray(e.result.packages)):void 0,baselineSnapshotId:typeof t.baselineSnapshotId==`string`?t.baselineSnapshotId:null,comparisonMode:t.comparisonMode===`baseline`?`baseline`:`previous`}}catch{return null}}function K(e){try{window.localStorage.setItem(V,JSON.stringify(e))}catch{}}function Je(e,t,n){return t||(e&&n?.current&&!U(e,n.current)?n.current:n?.previous??null)}var Ye=[{value:`system`,label:`跟随系统`,iconName:`theme-system`},{value:`light`,label:`亮色`,iconName:`theme-light`},{value:`dark`,label:`暗色`,iconName:`theme-dark`}],Xe=[{key:`overview`,label:`总览`,iconName:`tab-overview`},{key:`diagnostics`,label:`诊断`,iconName:`metric-health`},{key:`review`,label:`评审清单`,iconName:`metric-bookmark`},{key:`treemap`,label:`体积地图`,iconName:`treemap`},{key:`files`,label:`文件详情`,iconName:`top-files`},{key:`source`,label:`源码对比`,iconName:`tab-source`},{key:`packages`,label:`包与产物`,iconName:`tab-packages`},{key:`modules`,label:`模块与复用`,iconName:`tab-modules`}],Ze=[{value:`all`,label:`全部`},{value:`growth`,label:`增长`},{value:`duplicates`,label:`重复`},{value:`node_modules`,label:`依赖`},{value:`source`,label:`业务`},{value:`selected-package`,label:`当前包`}],q=[{to:`/`,label:`工作台`,caption:`应用入口与状态总览`,iconName:`nav-home`},{to:`/analyze`,label:`分析视图`,caption:`包体、模块与分包结构`,iconName:`nav-analyze`,children:Xe.map(e=>({to:e.key===`overview`?`/analyze`:`/analyze?tab=${e.key}`,label:e.label,caption:e.key===`overview`?`全局摘要和建议动作`:e.key===`diagnostics`?`预算、增量和历史基线`:e.key===`review`?`PR 风险和评审清单`:e.key===`treemap`?`产物体积地图`:e.key===`files`?`文件、预算和模块明细`:e.key===`source`?`源码与产物 Diff`:e.key===`packages`?`包体和产物列表`:`模块复用与来源`,iconName:e.iconName}))},{to:`/activity`,label:`活动流`,caption:`命令、诊断与运行事件`,iconName:`nav-activity`},{to:`/tokens`,label:`设计令牌`,caption:`主题、表面与组件状态`,iconName:`nav-tokens`}],Qe=[{label:`启动开发`,command:`pnpm --filter @weapp-vite/dashboard dev`,note:`本地预览完整 UI 壳子`,category:`dev`},{label:`生产构建`,command:`pnpm --filter @weapp-vite/dashboard build`,note:`验证静态产物可发布`,category:`build`},{label:`主包联调`,command:`weapp-vite build --ui`,note:`从 CLI 注入真实分析数据`,category:`analyze`}],$e=["`analyze` payload 契约保持兼容,CLI 注入无需迁移。",`工作台可在无 payload 状态下展示稳定空态和示例事件。`,`主题偏好在应用级共享,页面之间状态一致。`],et=[{time:`09:12`,title:`analyze payload synced`,summary:`CLI 已把最新构建结果注入 dashboard,全局状态已完成一次同步。`,tone:`live`},{time:`09:26`,title:`workspace shell extended`,summary:`工作台、活动流、设计令牌已经拆成独立页面。`,tone:`default`},{time:`10:03`,title:`theme system unified`,summary:`主题偏好收敛到应用根部,所有页面共享同一套明暗模式。`,tone:`default`}],tt=[{label:`CLI 注入链路`,detail:"保留 `window.__WEAPP_VITE_ANALYZE_RESULT__` 兼容层。",status:`兼容`},{label:`路由拓展性`,detail:`页面采用文件路由,主路由表保持稳定。`,status:`可扩展`},{label:`组件复用`,detail:`通用卡片与区块标题已独立,避免页面继续拷贝结构。`,status:`已落地`},{label:`视觉令牌`,detail:`颜色、表面、排版预览集中在 tokens 页面统一检查。`,status:`可验证`}],nt=[{id:`evt-command-build-ui`,kind:`command`,level:`success`,title:`build --ui completed`,detail:`示例事件: dashboard 已经准备好承接来自 CLI 的真实命令生命周期事件。`,timestamp:`10:18:12`,source:`cli`,durationMs:842,tags:[`build`,`ui`]},{id:`evt-hmr-shell`,kind:`hmr`,level:`info`,title:`workspace shell hot updated`,detail:`工作台页面已完成一次热更新并记录到事件流。`,timestamp:`10:19:44`,source:`vite-hmr`,tags:[`hmr`,`shell`]},{id:`evt-diagnostic-payload`,kind:`diagnostic`,level:`warning`,title:`analyze payload pending`,detail:`当前页面支持在没有 payload 时进入空态。`,timestamp:`10:20:07`,source:`dashboard`,tags:[`diagnostic`]}],rt=[{title:`Accent`,iconName:`token-color`,tokens:[{name:`--dashboard-accent`,sample:`var(--dashboard-accent)`},{name:`--dashboard-accent-soft`,sample:`var(--dashboard-accent-soft)`},{name:`--dashboard-border-strong`,sample:`var(--dashboard-border-strong)`}]},{title:`Surfaces`,iconName:`token-surface`,tokens:[{name:`--dashboard-panel`,sample:`var(--dashboard-panel)`},{name:`--dashboard-panel-strong`,sample:`var(--dashboard-panel-strong)`},{name:`--dashboard-panel-muted`,sample:`var(--dashboard-panel-muted)`}]},{title:`Typography`,iconName:`token-type`,tokens:[{name:`--dashboard-text`,sample:`var(--dashboard-text)`},{name:`--dashboard-text-muted`,sample:`var(--dashboard-text-muted)`},{name:`--dashboard-text-soft`,sample:`var(--dashboard-text-soft)`}]}];function J(e){if(!e||Number.isNaN(e))return`—`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=e,i=0;for(;r>=t&&i<n.length-1;)r/=t,i++;return`${r.toFixed(r>=100||i===0?0:2)} ${n[i]}`}function it(e,t=``,n=``){if(!e||Number.isNaN(e)||e<=0)return 0;let r=t.toLowerCase().split(`.`).pop()??``,i=new Set([`cjs`,`css`,`html`,`js`,`json`,`map`,`mjs`,`svg`,`txt`,`wxml`,`wxss`,`xml`]),a=new Set([`avif`,`br`,`gif`,`gz`,`jpeg`,`jpg`,`mp3`,`mp4`,`ogg`,`otf`,`png`,`webp`,`woff`,`woff2`,`zip`]);return i.has(r)?Math.max(1,Math.round(e*.34)):a.has(r)?Math.max(1,Math.round(e*.92)):n===`chunk`?Math.max(1,Math.round(e*.38)):Math.max(1,Math.round(e*.72))}function at(e){switch(e){case`main`:return`主包`;case`subPackage`:return`分包`;case`independent`:return`独立分包`;case`virtual`:return`虚拟包`;default:return e}}function ot(e){return e===`independent`?`独立构建`:`主构建`}function st(e){switch(e){case`src`:return`业务源码`;case`workspace`:return`工作区包`;case`plugin`:return`插件`;case`node_modules`:return`依赖`;default:return e}}function ct(e){switch(e){case`command`:return`命令`;case`build`:return`构建`;case`diagnostic`:return`诊断`;case`hmr`:return`HMR`;case`system`:return`系统`;default:return e}}function lt(e){switch(e){case`info`:return`信息`;case`success`:return`成功`;case`warning`:return`警告`;case`error`:return`错误`;default:return e}}function ut(e){return e??`dashboard`}function dt(e){return e}function ft(e){return{label:lt(e.level),tone:dt(e.level)}}function pt(e){return e>0?`error`:`info`}function mt(e){return{label:e.latestTimestamp?`${e.count} 条`:`错误 ${e.errorCount}`,tone:pt(e.errorCount)}}function Y(e){return typeof e!=`number`||Number.isNaN(e)||e<0?`未记录`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?1:2)} s`:`${e} ms`}function ht(e){let t=[ct(e.kind),ut(e.source),e.timestamp];return typeof e.durationMs==`number`&&Number.isFinite(e.durationMs)&&e.durationMs>=0&&t.push(Y(e.durationMs)),t.join(` · `)}function X(e,t){return{label:e,value:t}}function gt(){return new Date().toLocaleTimeString(`zh-CN`,{hour12:!1})}function _t(e){if(!e)return{packageCount:0,moduleCount:0,duplicateCount:0,totalBytes:0};let t=e.packages.flatMap(e=>e.files);return{packageCount:e.packages.length,moduleCount:e.modules.length,duplicateCount:e.modules.filter(e=>e.packages.length>1).length,totalBytes:t.reduce((e,t)=>e+(t.size??0),0)}}function vt(e){let t=e.filter(e=>e.level===`error`).length,n=e.filter(e=>e.level===`warning`).length,r=e.filter(e=>e.kind===`command`).length,i=e.filter(e=>typeof e.durationMs==`number`),a=i.length>0?Math.round(i.reduce((e,t)=>e+(t.durationMs??0),0)/i.length):void 0;return[X(`总事件数`,String(e.length)),X(`命令事件`,String(r)),X(`已记录耗时`,String(i.length)),X(`平均耗时`,Y(a)),X(`警告事件`,String(n)),X(`错误事件`,String(t))]}function yt(e){return[{label:`页面骨架`,value:`4 个`,iconName:`metric-ready`},{label:`连接状态`,value:e.result?`已接入 payload`:`等待注入`,iconName:e.result?`status-live`:`metric-health`},{label:`数据同步`,value:`${e.updateCount} 次`,iconName:`metric-latency`},{label:`产物体积`,value:e.result?J(e.summary.totalBytes):`未载入`,iconName:`metric-quality`},{label:`运行事件`,value:`${e.runtimeEventCount} 条`,iconName:e.latestRuntimeEvent?.level===`error`?`metric-health`:`metric-time`}]}function bt(e){return e.result?[{label:`重新分析当前工程`,command:`weapp-vite analyze`,note:`最近同步于 ${e.lastUpdatedAt},当前可读取 ${e.summary.packageCount} 个包。`,category:`analyze`},{label:`进入构建联调`,command:`weapp-vite build --ui`,note:`当前产物总体积 ${J(e.summary.totalBytes)},适合继续核对 chunk 结构。`,category:`build`},{label:`观察开发态更新`,command:`weapp-vite dev --ui`,note:`已记录 ${e.updateCount} 次 payload 同步,后续可继续接入更细粒度事件。`,category:`dev`}]:Qe}function xt(e){let t=[...et];for(let n of e.runtimeEvents.slice(0,4))t.unshift({time:n.timestamp,title:n.title,summary:n.detail,tone:n.level===`error`||n.level===`warning`?`default`:`live`});return e.result&&t.unshift({time:e.lastUpdatedAt,title:`workspace payload received`,summary:`已收到一份真实 analyze 结果,包含 ${e.summary.packageCount} 个包和 ${e.summary.moduleCount} 个模块。`,tone:`live`}),t}function St(e){let t=[...tt];return e.latestRuntimeEvent&&t.unshift({label:`最新运行事件`,detail:`${e.latestRuntimeEvent.title} · ${e.latestRuntimeEvent.detail}`,status:e.latestRuntimeEvent.level}),e.result?[{label:`实时分析状态`,detail:`已接入 payload,当前记录 ${e.summary.duplicateCount} 个跨包复用模块。`,status:`在线`},{label:`产物规模`,detail:`总产物体积 ${J(e.summary.totalBytes)},可继续进入分析页查看 treemap 与最大文件。`,status:`可分析`},...t]:[{label:`CLI 注入链路`,detail:`尚未接收到 analyze payload,当前页面以空态方式工作。`,status:`待接入`},...t]}var Ct=Symbol(`dashboard-workspace`),wt=[`command`,`build`,`diagnostic`,`hmr`,`system`],Tt=[`info`,`success`,`warning`,`error`];function Et(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Dt(e){return typeof e==`string`&&wt.includes(e)?e:`system`}function Ot(e){return typeof e==`string`&&Tt.includes(e)?e:`info`}function Z(e,t){return typeof e==`string`&&e.trim()?e:t}function Q(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function kt(e){if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&e.trim()).map(e=>String(e));return t.length>0?t:void 0}function At(e){if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&e.trim()).map(e=>String(e));return t.length>0?t:void 0}function jt(e){if(!Et(e))return;let t={timestamp:typeof e.timestamp==`string`?e.timestamp:void 0,totalMs:Q(e.totalMs),eventId:typeof e.eventId==`string`?e.eventId:void 0,event:typeof e.event==`string`?e.event:void 0,file:typeof e.file==`string`?e.file:void 0,relativeFile:typeof e.relativeFile==`string`?e.relativeFile:void 0,sourceRootFile:typeof e.sourceRootFile==`string`?e.sourceRootFile:void 0,buildCoreMs:Q(e.buildCoreMs),transformMs:Q(e.transformMs),writeMs:Q(e.writeMs),watchToDirtyMs:Q(e.watchToDirtyMs),emitMs:Q(e.emitMs),sharedChunkResolveMs:Q(e.sharedChunkResolveMs),dirtyCount:Q(e.dirtyCount),pendingCount:Q(e.pendingCount),emittedCount:Q(e.emittedCount),dirtyReasonSummary:At(e.dirtyReasonSummary),pendingReasonSummary:At(e.pendingReasonSummary)};return Object.values(t).some(e=>e!==void 0)?t:void 0}function Mt(e,t){return{id:Z(e.id,`dashboard-runtime-event-${t}`),kind:Dt(e.kind),level:Ot(e.level),title:Z(e.title,`untitled event`),detail:Z(e.detail,`no event detail`),timestamp:Z(e.timestamp,`—`),source:Z(e.source,`dashboard`),durationMs:Q(e.durationMs),tags:kt(e.tags),profile:jt(e.profile)}}function Nt(e){return{count:1,errorCount:+(e.level===`error`),latestTimestamp:e.timestamp,durationTotal:e.durationMs??0,timedCount:+(typeof e.durationMs==`number`)}}function Pt(e,t){return{count:e.count+1,errorCount:e.errorCount+ +(t.level===`error`),latestTimestamp:e.latestTimestamp,durationTotal:e.durationTotal+(t.durationMs??0),timedCount:e.timedCount+ +(typeof t.durationMs==`number`)}}function Ft(e,t){return{source:e,count:t.count,errorCount:t.errorCount,latestTimestamp:t.latestTimestamp,averageDurationMs:t.timedCount>0?Math.round(t.durationTotal/t.timedCount):void 0}}function It(e){return{...e,averageDuration:Y(e.averageDurationMs)}}function Lt(e,t){return Et(e)?Mt(e,t):null}function $(e){let t=(Array.isArray(e)?e:[e]).map((e,t)=>Lt(e,t)).filter(e=>!!e),n=new Map;for(let e of t)n.set(e.id,e);return[...n.values()]}function Rt(e){let t=new Map;for(let n of e){let e=n.source??`dashboard`,r=t.get(e);if(!r){t.set(e,Nt(n));continue}t.set(e,Pt(r,n))}return Array.from(t,([e,t])=>Ft(e,t)).sort((e,t)=>t.count-e.count||e.source.localeCompare(t.source,`zh-CN`))}function zt(e){return e.map(e=>It(e))}function Bt(){return window.__WEAPP_VITE_DASHBOARD_EVENTS__?.length?$(window.__WEAPP_VITE_DASHBOARD_EVENTS__):$(nt)}function Vt(t){let n=g(()=>t.value[0]??null),r=g(()=>vt(t.value)),i=g(()=>Rt(t.value)),a=e=>{let n=$(e);if(n.length===0)return;let r=[...n,...t.value],i=new Map;for(let e of r)i.set(e.id,e);t.value=[...i.values()].slice(0,24),window.__WEAPP_VITE_DASHBOARD_EVENTS__=[...t.value]},o=e=>{let t=e instanceof CustomEvent?e.detail:null;a(Array.isArray(t)?t:t?[t]:null)};return e(()=>{window.addEventListener(`weapp-dashboard:event`,o),a(window.__WEAPP_VITE_DASHBOARD_EVENTS__)}),y(()=>{window.removeEventListener(`weapp-dashboard:event`,o)}),{eventSummary:r,latestRuntimeEvent:n,runtimeSourceSummary:i}}function Ht(){let t=window.__WEAPP_VITE_ANALYZE_RESULT__??null,n=window.__WEAPP_VITE_PREVIOUS_ANALYZE_RESULT__??null,r=qe(),i=d(t),a=d(Je(t,n,r)),o=d(r?Ke(r):t?[G(t)]:[]),s=d(r?.baselineSnapshotId&&o.value.some(e=>e.id===r.baselineSnapshotId)?r.baselineSnapshotId:null),c=d(r?.comparisonMode===`baseline`&&s.value?`baseline`:`previous`),l=d(Bt()),u=d(0),f=d(i.value?gt():`—`);t&&K({current:t,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value});let p=g(()=>_t(i.value)),{eventSummary:ee,latestRuntimeEvent:m,runtimeSourceSummary:h}=Vt(l),_=g(()=>i.value?`payload ready`:`awaiting payload`),v=g(()=>i.value?`${p.value.packageCount} 个包 · ${p.value.moduleCount} 个模块`:`尚未接收到 CLI analyze 数据`),te=g(()=>o.value.find(e=>e.id===s.value)??null),b=g(()=>c.value===`baseline`?te.value?.result??a.value:a.value),x=g(()=>yt({result:i.value,updateCount:u.value,summary:p.value,runtimeEventCount:l.value.length,latestRuntimeEvent:m.value})),S=g(()=>bt({result:i.value,lastUpdatedAt:f.value,summary:p.value,updateCount:u.value})),C=g(()=>xt({runtimeEvents:l.value,result:i.value,lastUpdatedAt:f.value,summary:p.value})),w=g(()=>St({result:i.value,latestRuntimeEvent:m.value,summary:p.value})),T=()=>{let e=window.__WEAPP_VITE_ANALYZE_RESULT__;if(!e)return;let t=window.__WEAPP_VITE_PREVIOUS_ANALYZE_RESULT__??null,n=qe(),r=n?.previous??a.value;n?.current&&!U(e,n.current)&&(r=n.current),i.value&&!U(e,i.value)&&(r=i.value),t&&!U(e,t)&&(r=t),a.value=U(e,r)?null:r,i.value=e;let l=G(e),d=Ke({current:e,previous:a.value,snapshots:[l,...o.value]});o.value=d,s.value&&!d.some(e=>e.id===s.value)&&(s.value=d[d.length-1]?.id??null),c.value===`baseline`&&!s.value&&(c.value=`previous`),K({current:e,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value}),u.value+=1,f.value=gt()},E=()=>{i.value&&K({current:i.value,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value})};return e(()=>{window.addEventListener(`weapp-analyze:update`,T),T()}),y(()=>{window.removeEventListener(`weapp-analyze:update`,T)}),{resultRef:i,previousResultRef:a,comparisonResultRef:b,historySnapshots:o,baselineSnapshotId:s,comparisonMode:c,updateCount:u,lastUpdatedAt:f,statusLabel:_,statusSummary:v,commandItems:S,activityItems:C,diagnostics:w,signals:x,runtimeEvents:l,latestRuntimeEvent:m,eventSummary:ee,runtimeSourceSummary:h,setBaselineSnapshot:e=>{o.value.some(t=>t.id===e)&&(s.value=e,c.value=`baseline`,E())},setComparisonMode:e=>{c.value=e===`baseline`&&!s.value?`previous`:e,E()}}}function Ut(e){i(Ct,e)}function Wt(){let e=l(Ct,null);if(!e)throw Error(`[dashboard] workspace context is not available`);return e}var Gt={class:`h-dvh overflow-hidden px-3 py-3 text-(--dashboard-text) md:px-4 md:py-4 lg:px-5`},Kt={class:`mx-auto grid h-full max-w-400 gap-3 overflow-hidden lg:grid-cols-[17rem_minmax(0,1fr)]`},qt={class:`hidden min-h-0 overflow-hidden lg:block`},Jt={class:`grid h-full grid-rows-[minmax(0,1fr)_auto] gap-3`},Yt={class:`grid min-h-0 min-w-0 grid-rows-[auto_minmax(0,1fr)] gap-3 overflow-hidden`},Xt={class:`min-h-0 overflow-hidden`},Zt={key:0,class:`fixed inset-y-3 left-3 z-50 w-[min(22rem,calc(100vw-1.5rem))] lg:hidden`},Qt=t({__name:`App`,setup(e){let t=ee(),r=u(!1),{themePreference:i,resolvedTheme:a,setThemePreference:o}=z(),l=Ht(),d=g(()=>!!l.resultRef.value),f=g(()=>typeof t.query.tab==`string`?t.query.tab:`overview`);Ve({themePreference:i,resolvedTheme:a,setThemePreference:o}),Ut(l);let p=g(()=>t.path.startsWith(`/analyze`)?{title:`Analyze Workspace`}:t.path.startsWith(`/activity`)?{title:`Activity Stream`}:t.path.startsWith(`/tokens`)?{title:`Design Tokens`}:{title:`Workspace Console`});return s(()=>t.fullPath,()=>{r.value=!1}),(e,s)=>(v(),D(`div`,Gt,[h(`div`,Kt,[h(`aside`,qt,[h(`div`,Jt,[c(L,{eyebrow:`Shell`,title:`weapp-vite dashboard`,"icon-name":`hero-system`,tone:`strong`,"content-class":`min-h-0 overflow-hidden`},{default:O(()=>[c(N,{"current-analyze-tab":f.value,"current-path":n(t).path,items:n(q)},null,8,[`current-analyze-tab`,`current-path`,`items`])]),_:1}),c(L,{eyebrow:`Status`,title:n(l).statusLabel.value,description:n(l).statusSummary.value,"icon-name":d.value?`status-live`:n(a)===`dark`?`theme-dark`:`theme-light`,padding:`sm`},null,8,[`title`,`description`,`icon-name`])])]),h(`div`,Yt,[c(Oe,{title:p.value.title,description:p.value.description,"theme-options":n(Ye),"theme-preference":n(i),onMenu:s[0]||=e=>r.value=!0,onSetTheme:n(o)},null,8,[`title`,`description`,`theme-options`,`theme-preference`,`onSetTheme`]),h(`div`,Xt,[c(n(te))])])]),c(C,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:O(()=>[r.value?(v(),D(`div`,{key:0,class:`fixed inset-0 z-40 bg-slate-950/35 backdrop-blur-sm lg:hidden`,onClick:s[1]||=e=>r.value=!1})):T(``,!0)]),_:1}),c(C,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`-translate-x-6 opacity-0`,"enter-to-class":`translate-x-0 opacity-100`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`translate-x-0 opacity-100`,"leave-to-class":`-translate-x-6 opacity-0`},{default:O(()=>[r.value?(v(),D(`aside`,Zt,[c(L,{eyebrow:`Navigation`,title:`Workspace Modules`,description:`选择要查看的工作区。`,"icon-name":`nav-menu`,tone:`strong`,"content-class":`h-full`},{default:O(()=>[c(N,{mobile:``,"current-analyze-tab":f.value,"current-path":n(t).path,items:n(q),onNavigate:s[2]||=e=>r.value=!1},null,8,[`current-analyze-tab`,`current-path`,`items`])]),_:1})])):T(``,!0)]),_:1})]))}}),$t=S({history:_(),routes:[{path:`/`,name:`/`,component:()=>A(()=>import(`./pages.js`),[],import.meta.url)},{path:`/activity`,name:`/activity`,component:()=>A(()=>import(`./activity.js`),[],import.meta.url)},{path:`/analyze`,name:`/analyze`,component:()=>A(()=>import(`./analyze.js`),__vite__mapDeps([0]),import.meta.url)},{path:`/tokens`,name:`/tokens`,component:()=>A(()=>import(`./tokens.js`),[],import.meta.url)}]});function en(){let e=m(Qt);e.config.errorHandler=(e,t,n)=>{},e.use($t),e.mount(`#app`)}try{en()}catch{}export{ke as C,P as D,F as E,M as O,I as S,je as T,q as _,mt as a,He as b,J as c,ct as d,lt as f,rt as g,$e as h,ft as i,Y as l,st as m,zt as n,it as o,ht as p,Rt as r,ot as s,Wt as t,at as u,Ye as v,Ae as w,L as x,Ze as y};
|
|
2
|
+
import{A as e,C as t,G as n,H as r,J as i,L as a,M as o,N as s,P as c,R as l,S as u,T as d,U as f,_ as p,a as ee,c as m,g as h,h as g,i as _,j as v,k as y,n as te,p as b,r as ne,s as x,t as S,v as C,x as w,y as T,z as E}from"./vue.js";import{n as re,t as D}from"./vendor.js";import{s as O}from"./monaco.js";function ie(e,t){if(e){if(Array.isArray(e)){for(let n of e)ie(n,t);return}if(typeof e==`object`){for(let[n,r]of Object.entries(e))r&&t.push(n);return}t.push(String(e))}}function ae(...e){let t=[];for(let n of e)ie(n,t);return re(t.join(` `))}var k=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},oe=t({__name:`DashboardIcon`,props:{name:{}},setup(e,{expose:t}){t();let n=e,r={"theme-system":`icon-[mdi--theme-light-dark]`,"theme-light":`icon-[mdi--white-balance-sunny]`,"theme-dark":`icon-[mdi--moon-waning-crescent]`,"nav-menu":`icon-[mdi--menu]`,"nav-home":`icon-[mdi--view-grid-outline]`,"nav-analyze":`icon-[mdi--chart-box-outline]`,"nav-activity":`icon-[mdi--timeline-text-outline]`,"nav-tokens":`icon-[mdi--palette-outline]`,"tab-overview":`icon-[mdi--view-dashboard-outline]`,"tab-packages":`icon-[mdi--package-variant-closed]`,"tab-modules":`icon-[mdi--vector-link]`,"tab-source":`icon-[mdi--source-branch]`,"status-dark":`icon-[mdi--circle-slice-8]`,"status-light":`icon-[mdi--checkbox-blank-circle]`,"status-live":`icon-[mdi--motion-play-outline]`,"metric-packages":`icon-[mdi--package-variant]`,"metric-subpackages":`icon-[mdi--layers-triple-outline]`,"metric-chunks":`icon-[mdi--chart-tree]`,"metric-assets":`icon-[mdi--file-document-multiple-outline]`,"metric-size-outline":`icon-[mdi--database-outline]`,"metric-modules":`icon-[mdi--cube-outline]`,"metric-duplicates":`icon-[mdi--vector-link]`,"metric-sources":`icon-[mdi--source-branch]`,"metric-copy":`icon-[mdi--content-copy]`,"metric-time":`icon-[mdi--clock-outline]`,"metric-entries":`icon-[mdi--export-variant]`,"metric-size":`icon-[mdi--database]`,treemap:`icon-[mdi--chart-box-outline]`,"top-files":`icon-[mdi--file-star-outline]`,subpackages:`icon-[mdi--layers-triple-outline]`,"duplicate-modules":`icon-[mdi--vector-link]`,"module-sources":`icon-[mdi--source-branch]`,"file-samples":`icon-[mdi--file-document-outline]`,"hero-workspace":`icon-[mdi--view-quilt-outline]`,"hero-commands":`icon-[mdi--console-line]`,"hero-system":`icon-[mdi--shape-outline]`,"metric-ready":`icon-[mdi--rocket-launch-outline]`,"metric-health":`icon-[mdi--heart-pulse]`,"metric-latency":`icon-[mdi--timer-sand]`,"metric-quality":`icon-[mdi--shield-check-outline]`,"metric-search":`icon-[mdi--magnify]`,"metric-history":`icon-[mdi--history]`,"metric-bookmark":`icon-[mdi--bookmark-check-outline]`,"metric-link":`icon-[mdi--link-variant]`,"metric-reset":`icon-[mdi--restore]`,"token-color":`icon-[mdi--palette-outline]`,"token-surface":`icon-[mdi--card-bulleted-outline]`,"token-type":`icon-[mdi--format-letter-spacing]`},i={props:n,ICON_CLASS_MAP:r,iconClassName:g(()=>r[n.name]??`icon-[mdi--file-document-multiple-outline]`)};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}});function se(e,t,r,i,a,o){return v(),T(`span`,{class:n([`h-full w-full`,i.iconClassName])},null,2)}var A=k(oe,[[`render`,se]]),ce=t({__name:`AppNavigationList`,props:{currentAnalyzeTab:{},currentPath:{},items:{},mobile:{type:Boolean,default:!1}},emits:[`navigate`],setup(e,{expose:t,emit:n}){t();let r=e,i=n;function a(e){return e===`/`?r.currentPath===`/`:r.currentPath===e||r.currentPath.startsWith(`${e}/`)}function o(e){let t=e.indexOf(`?`);return t===-1?`overview`:new URLSearchParams(e.slice(t+1)).get(`tab`)??`overview`}function s(e){return e.startsWith(`/analyze`)?r.currentPath===`/analyze`&&o(e)===r.currentAnalyzeTab:a(e)}function c(e){return a(e.to)||!!e.children?.some(e=>s(e.to))}let l={props:r,emit:i,isActive:a,getAnalyzeTabFromPath:o,isNavigationItemActive:s,isNavigationSectionActive:c,get RouterLink(){return S},get cn(){return ae},DashboardIcon:A};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}}),le={class:`grid gap-2 overflow-y-auto pr-1`},ue={class:`flex items-start gap-3`},de={class:`h-5 w-5`},fe={class:`min-w-0`},pe={class:`font-medium text-(--dashboard-text)`},me={key:0,class:`ml-5 grid gap-1 border-l border-(--dashboard-border) pl-3`},he={class:`h-4 w-4 shrink-0`},ge={class:`min-w-0 truncate`};function _e(e,t,r,a,o,c){return v(),T(`nav`,le,[(v(!0),T(b,null,s(r.items,e=>(v(),T(`div`,{key:e.to,class:`grid gap-1`},[u(a.RouterLink,{to:e.to,class:n(a.cn(`group rounded-md border px-3 py-3 transition`,a.isNavigationSectionActive(e)?`border-(--dashboard-border-strong) bg-(--dashboard-panel-strong) shadow-(--dashboard-shadow)`:`border-(--dashboard-border) bg-(--dashboard-panel-muted) hover:border-(--dashboard-border-strong) hover:bg-(--dashboard-panel)`)),onClick:t[0]||=e=>a.emit(`navigate`)},{default:E(()=>[h(`div`,ue,[h(`span`,{class:n(a.cn(`flex h-10 w-10 shrink-0 items-center justify-center rounded-md`,a.isNavigationSectionActive(e)?`bg-(--dashboard-accent-soft) text-(--dashboard-accent)`:`bg-(--dashboard-panel) text-(--dashboard-text-soft) group-hover:text-(--dashboard-accent)`))},[h(`span`,de,[u(a.DashboardIcon,{name:e.iconName},null,8,[`name`])])],2),h(`div`,fe,[h(`p`,pe,i(e.label),1),h(`p`,{class:n([`text-xs leading-5 text-(--dashboard-text-soft)`,r.mobile?`mt-1`:`mt-0.5 truncate`])},i(e.caption),3)])])]),_:2},1032,[`to`,`class`]),e.children?.length&&a.isNavigationSectionActive(e)?(v(),T(`div`,me,[(v(!0),T(b,null,s(e.children,e=>(v(),p(a.RouterLink,{key:e.to,to:e.to,class:n(a.cn(`group flex min-w-0 items-center gap-2 rounded-md px-2.5 py-2 text-sm transition`,a.isNavigationItemActive(e.to)?`bg-(--dashboard-accent-soft) text-(--dashboard-accent)`:`text-(--dashboard-text-soft) hover:bg-(--dashboard-panel-muted) hover:text-(--dashboard-text)`)),onClick:t[1]||=e=>a.emit(`navigate`)},{default:E(()=>[h(`span`,he,[u(a.DashboardIcon,{name:e.iconName},null,8,[`name`])]),h(`span`,ge,i(e.label),1)]),_:2},1032,[`to`,`class`]))),128))])):C(``,!0)]))),128))])}var ve=k(ce,[[`render`,_e]]),ye=t({__name:`AppInfoPill`,props:{label:{},iconName:{},uppercase:{type:Boolean}},setup(e,{expose:t}){t();let n={DashboardIcon:A};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),be={key:0,class:`mr-1.5 h-4 w-4 text-(--dashboard-accent)`};function xe(e,t,r,a,o,s){return v(),T(`span`,{class:n([`inline-flex items-center rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-2.5 py-1 text-xs font-medium text-(--dashboard-text-soft)`,r.uppercase?`tracking-[0.18em] uppercase`:void 0])},[r.iconName?(v(),T(`span`,be,[u(a.DashboardIcon,{name:r.iconName},null,8,[`name`])])):C(``,!0),w(` `+i(r.label),1)],2)}var j=k(ye,[[`render`,xe]]),Se=t({__name:`AppShellHeader`,props:{title:{},description:{},themeOptions:{},themePreference:{}},emits:[`menu`,`setTheme`],setup(e,{expose:t,emit:n}){t();let r=e,i=n,a=g(()=>r.themeOptions.find(e=>e.value===r.themePreference)?.iconName??`theme-system`),o=g(()=>r.themeOptions.length>0);function s(e){i(`setTheme`,e.target.value)}let c={props:r,emit:i,currentThemeIconName:a,hasThemeOptions:o,handleThemeChange:s,AppInfoPill:j,DashboardIcon:A};return Object.defineProperty(c,"__isScriptSetup",{enumerable:!1,value:!0}),c}}),Ce={class:`flex flex-col gap-3 rounded-lg border border-(--dashboard-border-strong) bg-(--dashboard-panel-strong) px-4 py-3 shadow-(--dashboard-shadow) md:px-5`},we={class:`flex items-start justify-between gap-3`},Te={class:`flex items-start gap-3`},Ee={class:`h-5 w-5`},De={class:`mt-1 text-2xl font-semibold tracking-tight md:text-[1.8rem]`},Oe={key:0,class:`mt-1 max-w-3xl text-sm leading-6 text-(--dashboard-text-muted)`},ke={key:0,class:`hidden items-center gap-2 rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2 text-xs font-medium text-(--dashboard-text-soft) md:inline-flex`,for:`dashboard-global-theme`},Ae={class:`h-4 w-4 text-(--dashboard-accent)`},je=[`value`],Me=[`value`],Ne={class:`flex flex-wrap items-center gap-2 md:hidden`},Pe={key:0,class:`inline-flex items-center gap-2 rounded-full border border-(--dashboard-border) bg-(--dashboard-panel-muted) px-3 py-2 text-xs font-medium text-(--dashboard-text-soft)`,for:`dashboard-mobile-theme`},Fe={class:`h-4 w-4 text-(--dashboard-accent)`},Ie=[`value`],Le=[`value`];function Re(e,t,n,r,a,o){return v(),T(`header`,Ce,[h(`div`,we,[h(`div`,Te,[h(`button`,{class:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text) md:hidden`,type:`button`,onClick:t[0]||=e=>r.emit(`menu`)},[h(`span`,Ee,[u(r.DashboardIcon,{name:`nav-menu`})])]),h(`div`,null,[t[1]||=h(`p`,{class:`text-[11px] uppercase tracking-[0.28em] text-(--dashboard-accent)`},` weapp-vite dashboard `,-1),h(`h1`,De,i(n.title),1),n.description?(v(),T(`p`,Oe,i(n.description),1)):C(``,!0)])]),r.hasThemeOptions?(v(),T(`label`,ke,[h(`span`,Ae,[u(r.DashboardIcon,{name:r.currentThemeIconName},null,8,[`name`])]),h(`select`,{id:`dashboard-global-theme`,class:`min-w-32 bg-transparent text-(--dashboard-text) outline-none`,value:n.themePreference,onChange:r.handleThemeChange},[(v(!0),T(b,null,s(n.themeOptions,e=>(v(),T(`option`,{key:e.value,value:e.value},i(e.label),9,Me))),128))],40,je)])):C(``,!0)]),h(`div`,Ne,[r.hasThemeOptions?(v(),T(`label`,Pe,[h(`span`,Fe,[u(r.DashboardIcon,{name:r.currentThemeIconName},null,8,[`name`])]),h(`select`,{id:`dashboard-mobile-theme`,class:`min-w-32 bg-transparent text-(--dashboard-text) outline-none`,value:n.themePreference,onChange:r.handleThemeChange},[(v(!0),T(b,null,s(n.themeOptions,e=>(v(),T(`option`,{key:e.value,value:e.value},i(e.label),9,Le))),128))],40,Ie)])):C(``,!0),r.hasThemeOptions?(v(),p(r.AppInfoPill,{key:1,"icon-name":`status-live`,label:`shell ready`,uppercase:``})):C(``,!0)])])}var ze=k(Se,[[`render`,Re]]),M=D({base:`flex flex-col rounded-lg border shadow-(--dashboard-shadow)`,variants:{tone:{default:`border-(--dashboard-border) bg-(--dashboard-panel)`,strong:`border-(--dashboard-border-strong) bg-(--dashboard-panel-strong)`,muted:`border-(--dashboard-border) bg-(--dashboard-panel-muted)`},padding:{none:``,sm:`p-3`,md:`p-4`,header:`px-4 py-4 md:px-5`}},defaultVariants:{tone:`default`,padding:`md`}}),N=D({base:`flex items-center justify-center rounded-md bg-(--dashboard-accent-soft) text-(--dashboard-accent)`,variants:{size:{sm:`h-8 w-8`,md:`h-9 w-9`,lg:`h-10 w-10`}},defaultVariants:{size:`md`}}),Be=D({base:`rounded-md border border-(--dashboard-border) bg-(--dashboard-panel-muted)`,variants:{padding:{sm:`px-4 py-3`,md:`p-4`},interactive:{true:`transition hover:border-(--dashboard-border-strong) hover:bg-(--dashboard-panel)`,false:``}},defaultVariants:{padding:`md`,interactive:!1}}),Ve=D({base:`inline-flex items-center gap-2 rounded-full border transition`,variants:{kind:{nav:`px-3.5 py-1.5 text-sm`,theme:`px-3 py-1.5 text-xs font-medium`,badge:`px-2.5 py-1 text-[11px] uppercase tracking-[0.18em]`},active:{true:`border-(--dashboard-accent) bg-(--dashboard-accent-soft) text-(--dashboard-text)`,false:`border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text-soft) hover:border-(--dashboard-border-strong) hover:text-(--dashboard-text)`}},defaultVariants:{kind:`nav`,active:!1}}),He=D({base:`rounded-full border px-2.5 py-1 text-[11px] font-medium uppercase tracking-[0.16em]`,variants:{tone:{neutral:`border-(--dashboard-border) bg-(--dashboard-panel-muted) text-(--dashboard-text-soft)`,info:`border-(--dashboard-border-strong) bg-(--dashboard-accent-soft) text-(--dashboard-accent)`,success:`border-emerald-200 bg-emerald-100 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/12 dark:text-emerald-300`,warning:`border-amber-200 bg-amber-100 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/12 dark:text-amber-300`,error:`border-rose-200 bg-rose-100 text-rose-700 dark:border-rose-500/30 dark:bg-rose-500/12 dark:text-rose-300`}},defaultVariants:{tone:`neutral`}});D({base:`rounded-lg border border-(--dashboard-border) bg-(--dashboard-panel) px-4 py-3 text-[11px] uppercase tracking-[0.24em] text-(--dashboard-text-soft) shadow-(--dashboard-shadow)`});var Ue=t({__name:`AppSurfaceCard`,props:{title:{default:void 0},description:{default:void 0},eyebrow:{default:void 0},iconName:{default:void 0},tone:{default:`default`},padding:{default:`md`},contentClass:{default:``}},setup(e,{expose:t}){t();let n=e,r=a(),i={props:n,slots:r,hasHeader:!!(n.title||n.description||r.header),get cn(){return ae},get iconFrameStyles(){return N},get surfaceStyles(){return M},DashboardIcon:A};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}}),We={key:0,class:`flex items-start justify-between gap-4`},Ge={class:`flex min-w-0 items-start gap-3`},Ke={class:`h-5 w-5`},qe={class:`min-w-0`},Je={key:0,class:`text-[11px] uppercase tracking-[0.24em] text-(--dashboard-accent)`},Ye={key:1,class:`text-lg font-semibold tracking-tight`},Xe={key:2,class:`mt-1 text-sm leading-6 text-(--dashboard-text-muted)`};function Ze(e,t,r,a,o,s){return v(),T(`section`,{class:n(a.cn(a.surfaceStyles({tone:r.tone,padding:r.padding}),r.contentClass))},[a.hasHeader?(v(),T(`header`,We,[h(`div`,Ge,[r.iconName?(v(),T(`span`,{key:0,class:n([a.iconFrameStyles({size:`md`}),`shrink-0`])},[h(`span`,Ke,[u(a.DashboardIcon,{name:r.iconName},null,8,[`name`])])],2)):C(``,!0),h(`div`,qe,[r.eyebrow?(v(),T(`p`,Je,i(r.eyebrow),1)):C(``,!0),r.title?(v(),T(`h2`,Ye,i(r.title),1)):C(``,!0),r.description?(v(),T(`p`,Xe,i(r.description),1)):C(``,!0)])]),c(e.$slots,`header`)])):C(``,!0),h(`div`,{class:n(a.cn(`min-h-0 flex-1`,a.hasHeader?`mt-4`:``))},[c(e.$slots,`default`)],2)],2)}var P=k(Ue,[[`render`,Ze]]),F=`weapp-vite-dashboard-theme`;function Qe(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(F);return e===`light`||e===`dark`||e===`system`?e:`system`}function $e(e,t){return e===`light`||e===`dark`?e:t?.matches?`dark`:`light`}function I(){let t=r(Qe()),n=typeof window<`u`?window.matchMedia(`(prefers-color-scheme: dark)`):null,i=g(()=>$e(t.value,n)),a=e=>{typeof document>`u`||(document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e)},o=e=>{typeof window>`u`||window.localStorage.setItem(F,e)},s=()=>{a(i.value)};return l(t,e=>{o(e),a(i.value)},{immediate:!0}),e(()=>{n?.addEventListener(`change`,s),a(i.value)}),y(()=>{n?.removeEventListener(`change`,s)}),{themePreference:t,resolvedTheme:i,setThemePreference(e){t.value=e}}}var L=Symbol(`dashboard-theme`);function et(e){o(L,e)}function tt(){return d(L,null)||I()}var R=`weapp-vite-dashboard:analyze-result-history`;function nt(e){return e.toLocaleString(`zh-CN`,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function z(e){return e?JSON.stringify({packages:e.packages,modules:e.modules,subPackages:e.subPackages,budgets:e.metadata?.budgets}):``}function B(e,t){return z(e)===z(t)}function V(e){return e.packages.flatMap(e=>e.files).reduce((e,t)=>e+(t.size??0),0)}function rt(e){return e.packages.flatMap(e=>e.files).reduce((e,t)=>e+(t.brotliSize??t.gzipSize??Math.round((t.size??0)*.32)),0)}function it(e,t){let n=V(e);return`${Date.parse(t).toString(36)}-${n.toString(36)}-${e.modules.length.toString(36)}`}function H(e,t=new Date().toISOString()){let n=e.modules.filter(e=>e.packages.length>1).length;return{id:it(e,t),capturedAt:t,label:nt(new Date(t)),result:e,totalBytes:V(e),compressedBytes:rt(e),packageCount:e.packages.length,moduleCount:e.modules.length,duplicateCount:n}}function U(e){let t=[...e.snapshots??[]];e.previous&&t.push(H(e.previous)),t.push(H(e.current));let n=new Map;for(let e of t){let t=z(e.result);n.has(t)||n.set(t,e)}return[...n.values()].sort((e,t)=>Date.parse(t.capturedAt)-Date.parse(e.capturedAt)).slice(0,12)}function W(){try{let e=window.localStorage.getItem(R);if(!e)return null;let t=JSON.parse(e);return!t?.current?.packages||!Array.isArray(t.current.packages)?null:{current:t.current,previous:t.previous?.packages?t.previous:null,snapshots:Array.isArray(t.snapshots)?t.snapshots.filter(e=>e?.result?.packages&&Array.isArray(e.result.packages)):void 0,baselineSnapshotId:typeof t.baselineSnapshotId==`string`?t.baselineSnapshotId:null,comparisonMode:t.comparisonMode===`baseline`?`baseline`:`previous`}}catch{return null}}function G(e){try{window.localStorage.setItem(R,JSON.stringify(e))}catch{}}function at(e,t,n){return t||(e&&n?.current&&!B(e,n.current)?n.current:n?.previous??null)}var ot=[{value:`system`,label:`跟随系统`,iconName:`theme-system`},{value:`light`,label:`亮色`,iconName:`theme-light`},{value:`dark`,label:`暗色`,iconName:`theme-dark`}],st=[{key:`overview`,label:`总览`,iconName:`tab-overview`},{key:`diagnostics`,label:`诊断`,iconName:`metric-health`},{key:`review`,label:`评审清单`,iconName:`metric-bookmark`},{key:`treemap`,label:`体积地图`,iconName:`treemap`},{key:`files`,label:`文件详情`,iconName:`top-files`},{key:`source`,label:`源码对比`,iconName:`tab-source`},{key:`packages`,label:`包与产物`,iconName:`tab-packages`},{key:`modules`,label:`模块与复用`,iconName:`tab-modules`}],ct=[{value:`all`,label:`全部`},{value:`growth`,label:`增长`},{value:`duplicates`,label:`重复`},{value:`node_modules`,label:`依赖`},{value:`source`,label:`业务`},{value:`selected-package`,label:`当前包`}],lt=[{to:`/`,label:`工作台`,caption:`应用入口与状态总览`,iconName:`nav-home`},{to:`/analyze`,label:`分析视图`,caption:`包体、模块与分包结构`,iconName:`nav-analyze`,children:st.map(e=>({to:e.key===`overview`?`/analyze`:`/analyze?tab=${e.key}`,label:e.label,caption:e.key===`overview`?`全局摘要和建议动作`:e.key===`diagnostics`?`预算、增量和历史基线`:e.key===`review`?`PR 风险和评审清单`:e.key===`treemap`?`产物体积地图`:e.key===`files`?`文件、预算和模块明细`:e.key===`source`?`源码与产物 Diff`:e.key===`packages`?`包体和产物列表`:`模块复用与来源`,iconName:e.iconName}))},{to:`/activity`,label:`活动流`,caption:`命令、诊断与运行事件`,iconName:`nav-activity`},{to:`/tokens`,label:`设计令牌`,caption:`主题、表面与组件状态`,iconName:`nav-tokens`}],ut=[{label:`启动开发`,command:`pnpm --filter @weapp-vite/dashboard dev`,note:`本地预览完整 UI 壳子`,category:`dev`},{label:`生产构建`,command:`pnpm --filter @weapp-vite/dashboard build`,note:`验证静态产物可发布`,category:`build`},{label:`主包联调`,command:`weapp-vite build --ui`,note:`从 CLI 注入真实分析数据`,category:`analyze`}],dt=["`analyze` payload 契约保持兼容,CLI 注入无需迁移。",`工作台可在无 payload 状态下展示稳定空态和示例事件。`,`主题偏好在应用级共享,页面之间状态一致。`],ft=[{time:`09:12`,title:`analyze payload synced`,summary:`CLI 已把最新构建结果注入 dashboard,全局状态已完成一次同步。`,tone:`live`},{time:`09:26`,title:`workspace shell extended`,summary:`工作台、活动流、设计令牌已经拆成独立页面。`,tone:`default`},{time:`10:03`,title:`theme system unified`,summary:`主题偏好收敛到应用根部,所有页面共享同一套明暗模式。`,tone:`default`}],pt=[{label:`CLI 注入链路`,detail:"保留 `window.__WEAPP_VITE_ANALYZE_RESULT__` 兼容层。",status:`兼容`},{label:`路由拓展性`,detail:`页面采用文件路由,主路由表保持稳定。`,status:`可扩展`},{label:`组件复用`,detail:`通用卡片与区块标题已独立,避免页面继续拷贝结构。`,status:`已落地`},{label:`视觉令牌`,detail:`颜色、表面、排版预览集中在 tokens 页面统一检查。`,status:`可验证`}],mt=[{id:`evt-command-build-ui`,kind:`command`,level:`success`,title:`build --ui completed`,detail:`示例事件: dashboard 已经准备好承接来自 CLI 的真实命令生命周期事件。`,timestamp:`10:18:12`,source:`cli`,durationMs:842,tags:[`build`,`ui`]},{id:`evt-hmr-shell`,kind:`hmr`,level:`info`,title:`workspace shell hot updated`,detail:`工作台页面已完成一次热更新并记录到事件流。`,timestamp:`10:19:44`,source:`vite-hmr`,tags:[`hmr`,`shell`]},{id:`evt-diagnostic-payload`,kind:`diagnostic`,level:`warning`,title:`analyze payload pending`,detail:`当前页面支持在没有 payload 时进入空态。`,timestamp:`10:20:07`,source:`dashboard`,tags:[`diagnostic`]}],ht=[{title:`Accent`,iconName:`token-color`,tokens:[{name:`--dashboard-accent`,sample:`var(--dashboard-accent)`},{name:`--dashboard-accent-soft`,sample:`var(--dashboard-accent-soft)`},{name:`--dashboard-border-strong`,sample:`var(--dashboard-border-strong)`}]},{title:`Surfaces`,iconName:`token-surface`,tokens:[{name:`--dashboard-panel`,sample:`var(--dashboard-panel)`},{name:`--dashboard-panel-strong`,sample:`var(--dashboard-panel-strong)`},{name:`--dashboard-panel-muted`,sample:`var(--dashboard-panel-muted)`}]},{title:`Typography`,iconName:`token-type`,tokens:[{name:`--dashboard-text`,sample:`var(--dashboard-text)`},{name:`--dashboard-text-muted`,sample:`var(--dashboard-text-muted)`},{name:`--dashboard-text-soft`,sample:`var(--dashboard-text-soft)`}]}];function K(e){if(!e||Number.isNaN(e))return`—`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=e,i=0;for(;r>=t&&i<n.length-1;)r/=t,i++;return`${r.toFixed(r>=100||i===0?0:2)} ${n[i]}`}function gt(e,t=``,n=``){if(!e||Number.isNaN(e)||e<=0)return 0;let r=t.toLowerCase().split(`.`).pop()??``,i=new Set([`cjs`,`css`,`html`,`js`,`json`,`map`,`mjs`,`svg`,`txt`,`wxml`,`wxss`,`xml`]),a=new Set([`avif`,`br`,`gif`,`gz`,`jpeg`,`jpg`,`mp3`,`mp4`,`ogg`,`otf`,`png`,`webp`,`woff`,`woff2`,`zip`]);return i.has(r)?Math.max(1,Math.round(e*.34)):a.has(r)?Math.max(1,Math.round(e*.92)):n===`chunk`?Math.max(1,Math.round(e*.38)):Math.max(1,Math.round(e*.72))}function _t(e){switch(e){case`main`:return`主包`;case`subPackage`:return`分包`;case`independent`:return`独立分包`;case`virtual`:return`虚拟包`;default:return e}}function vt(e){return e===`independent`?`独立构建`:`主构建`}function yt(e){switch(e){case`src`:return`业务源码`;case`workspace`:return`工作区包`;case`plugin`:return`插件`;case`node_modules`:return`依赖`;default:return e}}function bt(e){switch(e){case`command`:return`命令`;case`build`:return`构建`;case`diagnostic`:return`诊断`;case`hmr`:return`HMR`;case`system`:return`系统`;default:return e}}function xt(e){switch(e){case`info`:return`信息`;case`success`:return`成功`;case`warning`:return`警告`;case`error`:return`错误`;default:return e}}function St(e){return e??`dashboard`}function Ct(e){return e}function wt(e){return{label:xt(e.level),tone:Ct(e.level)}}function Tt(e){return e>0?`error`:`info`}function Et(e){return{label:e.latestTimestamp?`${e.count} 条`:`错误 ${e.errorCount}`,tone:Tt(e.errorCount)}}function q(e){return typeof e!=`number`||Number.isNaN(e)||e<0?`未记录`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?1:2)} s`:`${e} ms`}function Dt(e){let t=[bt(e.kind),St(e.source),e.timestamp];return typeof e.durationMs==`number`&&Number.isFinite(e.durationMs)&&e.durationMs>=0&&t.push(q(e.durationMs)),t.join(` · `)}function J(e,t){return{label:e,value:t}}function Ot(){return new Date().toLocaleTimeString(`zh-CN`,{hour12:!1})}function kt(e){if(!e)return{packageCount:0,moduleCount:0,duplicateCount:0,totalBytes:0};let t=e.packages.flatMap(e=>e.files);return{packageCount:e.packages.length,moduleCount:e.modules.length,duplicateCount:e.modules.filter(e=>e.packages.length>1).length,totalBytes:t.reduce((e,t)=>e+(t.size??0),0)}}function At(e){let t=e.filter(e=>e.level===`error`).length,n=e.filter(e=>e.level===`warning`).length,r=e.filter(e=>e.kind===`command`).length,i=e.filter(e=>typeof e.durationMs==`number`),a=i.length>0?Math.round(i.reduce((e,t)=>e+(t.durationMs??0),0)/i.length):void 0;return[J(`总事件数`,String(e.length)),J(`命令事件`,String(r)),J(`已记录耗时`,String(i.length)),J(`平均耗时`,q(a)),J(`警告事件`,String(n)),J(`错误事件`,String(t))]}function jt(e){return[{label:`页面骨架`,value:`4 个`,iconName:`metric-ready`},{label:`连接状态`,value:e.result?`已接入 payload`:`等待注入`,iconName:e.result?`status-live`:`metric-health`},{label:`数据同步`,value:`${e.updateCount} 次`,iconName:`metric-latency`},{label:`产物体积`,value:e.result?K(e.summary.totalBytes):`未载入`,iconName:`metric-quality`},{label:`运行事件`,value:`${e.runtimeEventCount} 条`,iconName:e.latestRuntimeEvent?.level===`error`?`metric-health`:`metric-time`}]}function Mt(e){return e.result?[{label:`重新分析当前工程`,command:`weapp-vite analyze`,note:`最近同步于 ${e.lastUpdatedAt},当前可读取 ${e.summary.packageCount} 个包。`,category:`analyze`},{label:`进入构建联调`,command:`weapp-vite build --ui`,note:`当前产物总体积 ${K(e.summary.totalBytes)},适合继续核对 chunk 结构。`,category:`build`},{label:`观察开发态更新`,command:`weapp-vite dev --ui`,note:`已记录 ${e.updateCount} 次 payload 同步,后续可继续接入更细粒度事件。`,category:`dev`}]:ut}function Nt(e){let t=[...ft];for(let n of e.runtimeEvents.slice(0,4))t.unshift({time:n.timestamp,title:n.title,summary:n.detail,tone:n.level===`error`||n.level===`warning`?`default`:`live`});return e.result&&t.unshift({time:e.lastUpdatedAt,title:`workspace payload received`,summary:`已收到一份真实 analyze 结果,包含 ${e.summary.packageCount} 个包和 ${e.summary.moduleCount} 个模块。`,tone:`live`}),t}function Pt(e){let t=[...pt];return e.latestRuntimeEvent&&t.unshift({label:`最新运行事件`,detail:`${e.latestRuntimeEvent.title} · ${e.latestRuntimeEvent.detail}`,status:e.latestRuntimeEvent.level}),e.result?[{label:`实时分析状态`,detail:`已接入 payload,当前记录 ${e.summary.duplicateCount} 个跨包复用模块。`,status:`在线`},{label:`产物规模`,detail:`总产物体积 ${K(e.summary.totalBytes)},可继续进入分析页查看 treemap 与最大文件。`,status:`可分析`},...t]:[{label:`CLI 注入链路`,detail:`尚未接收到 analyze payload,当前页面以空态方式工作。`,status:`待接入`},...t]}var Ft=Symbol(`dashboard-workspace`),It=[`command`,`build`,`diagnostic`,`hmr`,`system`],Lt=[`info`,`success`,`warning`,`error`];function Rt(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function zt(e){return typeof e==`string`&&It.includes(e)?e:`system`}function Bt(e){return typeof e==`string`&&Lt.includes(e)?e:`info`}function Y(e,t){return typeof e==`string`&&e.trim()?e:t}function X(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function Vt(e){if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&e.trim()).map(e=>String(e));return t.length>0?t:void 0}function Z(e){if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&e.trim()).map(e=>String(e));return t.length>0?t:void 0}function Ht(e){if(!Rt(e))return;let t={timestamp:typeof e.timestamp==`string`?e.timestamp:void 0,totalMs:X(e.totalMs),eventId:typeof e.eventId==`string`?e.eventId:void 0,event:typeof e.event==`string`?e.event:void 0,file:typeof e.file==`string`?e.file:void 0,relativeFile:typeof e.relativeFile==`string`?e.relativeFile:void 0,sourceRootFile:typeof e.sourceRootFile==`string`?e.sourceRootFile:void 0,buildCoreMs:X(e.buildCoreMs),transformMs:X(e.transformMs),writeMs:X(e.writeMs),watchToDirtyMs:X(e.watchToDirtyMs),emitMs:X(e.emitMs),sharedChunkResolveMs:X(e.sharedChunkResolveMs),dirtyCount:X(e.dirtyCount),pendingCount:X(e.pendingCount),emittedCount:X(e.emittedCount),dirtyReasonSummary:Z(e.dirtyReasonSummary),pendingReasonSummary:Z(e.pendingReasonSummary)};return Object.values(t).some(e=>e!==void 0)?t:void 0}function Ut(e,t){return{id:Y(e.id,`dashboard-runtime-event-${t}`),kind:zt(e.kind),level:Bt(e.level),title:Y(e.title,`untitled event`),detail:Y(e.detail,`no event detail`),timestamp:Y(e.timestamp,`—`),source:Y(e.source,`dashboard`),durationMs:X(e.durationMs),tags:Vt(e.tags),profile:Ht(e.profile)}}function Wt(e){return{count:1,errorCount:+(e.level===`error`),latestTimestamp:e.timestamp,durationTotal:e.durationMs??0,timedCount:+(typeof e.durationMs==`number`)}}function Gt(e,t){return{count:e.count+1,errorCount:e.errorCount+ +(t.level===`error`),latestTimestamp:e.latestTimestamp,durationTotal:e.durationTotal+(t.durationMs??0),timedCount:e.timedCount+ +(typeof t.durationMs==`number`)}}function Kt(e,t){return{source:e,count:t.count,errorCount:t.errorCount,latestTimestamp:t.latestTimestamp,averageDurationMs:t.timedCount>0?Math.round(t.durationTotal/t.timedCount):void 0}}function qt(e){return{...e,averageDuration:q(e.averageDurationMs)}}function Jt(e,t){return Rt(e)?Ut(e,t):null}function Q(e){let t=(Array.isArray(e)?e:[e]).map((e,t)=>Jt(e,t)).filter(e=>!!e),n=new Map;for(let e of t)n.set(e.id,e);return[...n.values()]}function $(e){let t=new Map;for(let n of e){let e=n.source??`dashboard`,r=t.get(e);if(!r){t.set(e,Wt(n));continue}t.set(e,Gt(r,n))}return Array.from(t,([e,t])=>Kt(e,t)).sort((e,t)=>t.count-e.count||e.source.localeCompare(t.source,`zh-CN`))}function Yt(e){return e.map(e=>qt(e))}function Xt(){return window.__WEAPP_VITE_DASHBOARD_EVENTS__?.length?Q(window.__WEAPP_VITE_DASHBOARD_EVENTS__):Q(mt)}function Zt(t){let n=g(()=>t.value[0]??null),r=g(()=>At(t.value)),i=g(()=>$(t.value)),a=e=>{let n=Q(e);if(n.length===0)return;let r=[...n,...t.value],i=new Map;for(let e of r)i.set(e.id,e);t.value=[...i.values()].slice(0,24),window.__WEAPP_VITE_DASHBOARD_EVENTS__=[...t.value]},o=e=>{let t=e instanceof CustomEvent?e.detail:null;a(Array.isArray(t)?t:t?[t]:null)};return e(()=>{window.addEventListener(`weapp-dashboard:event`,o),a(window.__WEAPP_VITE_DASHBOARD_EVENTS__)}),y(()=>{window.removeEventListener(`weapp-dashboard:event`,o)}),{eventSummary:r,latestRuntimeEvent:n,runtimeSourceSummary:i}}function Qt(){let t=window.__WEAPP_VITE_ANALYZE_RESULT__??null,n=window.__WEAPP_VITE_PREVIOUS_ANALYZE_RESULT__??null,r=W(),i=f(t),a=f(at(t,n,r)),o=f(r?U(r):t?[H(t)]:[]),s=f(r?.baselineSnapshotId&&o.value.some(e=>e.id===r.baselineSnapshotId)?r.baselineSnapshotId:null),c=f(r?.comparisonMode===`baseline`&&s.value?`baseline`:`previous`),l=f(Xt()),u=f(0),d=f(i.value?Ot():`—`);t&&G({current:t,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value});let p=g(()=>kt(i.value)),{eventSummary:ee,latestRuntimeEvent:m,runtimeSourceSummary:h}=Zt(l),_=g(()=>i.value?`payload ready`:`awaiting payload`),v=g(()=>i.value?`${p.value.packageCount} 个包 · ${p.value.moduleCount} 个模块`:`尚未接收到 CLI analyze 数据`),te=g(()=>o.value.find(e=>e.id===s.value)??null),b=g(()=>c.value===`baseline`?te.value?.result??a.value:a.value),ne=g(()=>jt({result:i.value,updateCount:u.value,summary:p.value,runtimeEventCount:l.value.length,latestRuntimeEvent:m.value})),x=g(()=>Mt({result:i.value,lastUpdatedAt:d.value,summary:p.value,updateCount:u.value})),S=g(()=>Nt({runtimeEvents:l.value,result:i.value,lastUpdatedAt:d.value,summary:p.value})),C=g(()=>Pt({result:i.value,latestRuntimeEvent:m.value,summary:p.value})),w=()=>{let e=window.__WEAPP_VITE_ANALYZE_RESULT__;if(!e)return;let t=window.__WEAPP_VITE_PREVIOUS_ANALYZE_RESULT__??null,n=W(),r=n?.previous??a.value;n?.current&&!B(e,n.current)&&(r=n.current),i.value&&!B(e,i.value)&&(r=i.value),t&&!B(e,t)&&(r=t),a.value=B(e,r)?null:r,i.value=e;let l=H(e),f=U({current:e,previous:a.value,snapshots:[l,...o.value]});o.value=f,s.value&&!f.some(e=>e.id===s.value)&&(s.value=f[f.length-1]?.id??null),c.value===`baseline`&&!s.value&&(c.value=`previous`),G({current:e,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value}),u.value+=1,d.value=Ot()},T=()=>{i.value&&G({current:i.value,previous:a.value,snapshots:o.value,baselineSnapshotId:s.value,comparisonMode:c.value})};return e(()=>{window.addEventListener(`weapp-analyze:update`,w),w()}),y(()=>{window.removeEventListener(`weapp-analyze:update`,w)}),{resultRef:i,previousResultRef:a,comparisonResultRef:b,historySnapshots:o,baselineSnapshotId:s,comparisonMode:c,updateCount:u,lastUpdatedAt:d,statusLabel:_,statusSummary:v,commandItems:x,activityItems:S,diagnostics:C,signals:ne,runtimeEvents:l,latestRuntimeEvent:m,eventSummary:ee,runtimeSourceSummary:h,setBaselineSnapshot:e=>{o.value.some(t=>t.id===e)&&(s.value=e,c.value=`baseline`,T())},setComparisonMode:e=>{c.value=e===`baseline`&&!s.value?`previous`:e,T()}}}function $t(e){o(Ft,e)}function en(){let e=d(Ft,null);if(!e)throw Error(`[dashboard] workspace context is not available`);return e}var tn=t({__name:`App`,setup(e,{expose:t}){t();let n=ee(),i=r(!1),{themePreference:a,resolvedTheme:o,setThemePreference:s}=I(),c=Qt(),u=g(()=>!!c.resultRef.value),d=g(()=>typeof n.query.tab==`string`?n.query.tab:`overview`);et({themePreference:a,resolvedTheme:o,setThemePreference:s}),$t(c);let f=g(()=>n.path.startsWith(`/analyze`)?{title:`Analyze Workspace`}:n.path.startsWith(`/activity`)?{title:`Activity Stream`}:n.path.startsWith(`/tokens`)?{title:`Design Tokens`}:{title:`Workspace Console`});l(()=>n.fullPath,()=>{i.value=!1});let p={route:n,mobileNavOpen:i,themePreference:a,resolvedTheme:o,setThemePreference:s,workspace:c,hasPayload:u,currentAnalyzeTab:d,pageMeta:f,get RouterView(){return te},AppNavigationList:ve,AppShellHeader:ze,AppSurfaceCard:P,get workspaceNavigation(){return lt},get themeOptions(){return ot}};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}}),nn={class:`h-dvh overflow-hidden px-3 py-3 text-(--dashboard-text) md:px-4 md:py-4 lg:px-5`},rn={class:`mx-auto grid h-full max-w-400 gap-3 overflow-hidden lg:grid-cols-[17rem_minmax(0,1fr)]`},an={class:`hidden min-h-0 overflow-hidden lg:block`},on={class:`grid h-full grid-rows-[minmax(0,1fr)_auto] gap-3`},sn={class:`grid min-h-0 min-w-0 grid-rows-[auto_minmax(0,1fr)] gap-3 overflow-hidden`},cn={class:`min-h-0 overflow-hidden`},ln={key:0,class:`fixed inset-y-3 left-3 z-50 w-[min(22rem,calc(100vw-1.5rem))] lg:hidden`};function un(e,t,n,r,i,a){return v(),T(`div`,nn,[h(`div`,rn,[h(`aside`,an,[h(`div`,on,[u(r.AppSurfaceCard,{eyebrow:`Shell`,title:`weapp-vite dashboard`,"icon-name":`hero-system`,tone:`strong`,"content-class":`min-h-0 overflow-hidden`},{default:E(()=>[u(r.AppNavigationList,{"current-analyze-tab":r.currentAnalyzeTab,"current-path":r.route.path,items:r.workspaceNavigation},null,8,[`current-analyze-tab`,`current-path`,`items`])]),_:1}),u(r.AppSurfaceCard,{eyebrow:`Status`,title:r.workspace.statusLabel.value,description:r.workspace.statusSummary.value,"icon-name":r.hasPayload?`status-live`:r.resolvedTheme===`dark`?`theme-dark`:`theme-light`,padding:`sm`},null,8,[`title`,`description`,`icon-name`])])]),h(`div`,sn,[u(r.AppShellHeader,{title:r.pageMeta.title,description:r.pageMeta.description,"theme-options":r.themeOptions,"theme-preference":r.themePreference,onMenu:t[0]||=e=>r.mobileNavOpen=!0,onSetTheme:r.setThemePreference},null,8,[`title`,`description`,`theme-options`,`theme-preference`,`onSetTheme`]),h(`div`,cn,[u(r.RouterView)])])]),u(x,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:E(()=>[r.mobileNavOpen?(v(),T(`div`,{key:0,class:`fixed inset-0 z-40 bg-slate-950/35 backdrop-blur-sm lg:hidden`,onClick:t[1]||=e=>r.mobileNavOpen=!1})):C(``,!0)]),_:1}),u(x,{"enter-active-class":`transition duration-200 ease-out`,"enter-from-class":`-translate-x-6 opacity-0`,"enter-to-class":`translate-x-0 opacity-100`,"leave-active-class":`transition duration-150 ease-in`,"leave-from-class":`translate-x-0 opacity-100`,"leave-to-class":`-translate-x-6 opacity-0`},{default:E(()=>[r.mobileNavOpen?(v(),T(`aside`,ln,[u(r.AppSurfaceCard,{eyebrow:`Navigation`,title:`Workspace Modules`,description:`选择要查看的工作区。`,"icon-name":`nav-menu`,tone:`strong`,"content-class":`h-full`},{default:E(()=>[u(r.AppNavigationList,{mobile:``,"current-analyze-tab":r.currentAnalyzeTab,"current-path":r.route.path,items:r.workspaceNavigation,onNavigate:t[2]||=e=>r.mobileNavOpen=!1},null,8,[`current-analyze-tab`,`current-path`,`items`])]),_:1})])):C(``,!0)]),_:1})])}var dn=k(tn,[[`render`,un]]),fn=ne({history:_(),routes:[{path:`/`,name:`/`,component:()=>O(()=>import(`./pages.js`),[],import.meta.url)},{path:`/activity`,name:`/activity`,component:()=>O(()=>import(`./activity.js`),[],import.meta.url)},{path:`/analyze`,name:`/analyze`,component:()=>O(()=>import(`./analyze.js`),__vite__mapDeps([0]),import.meta.url)},{path:`/tokens`,name:`/tokens`,component:()=>O(()=>import(`./tokens.js`),[],import.meta.url)}]});function pn(){let e=m(dn);e.config.errorHandler=(e,t,n)=>{},e.use(fn),e.mount(`#app`)}try{pn()}catch{}export{Be as C,j as D,M as E,A as O,N as S,He as T,lt as _,Et as a,tt as b,K as c,bt as d,xt as f,ht as g,dt as h,wt as i,k,q as l,yt as m,Yt as n,gt as o,Dt as p,$ as r,vt as s,en as t,_t as u,ot as v,Ve as w,P as x,ct as y};
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
|
|
55
55
|
`),l+=`\`${al(c)}\`: ${o}`),s([l])}return null})}};function il(e){if(e)return e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
|
|
56
56
|
|
|
57
|
-
$3`).replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)}function al(e){return e.indexOf("`")===-1?e:"`` "+e+" ``"}var ol=class{constructor(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}configure(e){e&&(this.validationEnabled=e.validate!==!1,this.commentSeverity=e.allowComments?void 0:U.Error)}doValidation(e,t,n,r){if(!this.validationEnabled)return this.promise.resolve([]);let i=[],a={},o=e=>{let t=e.range.start.line+` `+e.range.start.character+` `+e.message;a[t]||(a[t]=!0,i.push(e))},s=r=>{let a=n?.trailingCommas?ul(n.trailingCommas):U.Error,s=n?.comments?ul(n.comments):this.commentSeverity,c=n?.schemaValidation?ul(n.schemaValidation):U.Warning,l=n?.schemaRequest?ul(n.schemaRequest):U.Warning;if(r){let i=(n,r)=>{if(t.root&&l){let i=t.root,a=i.type===`object`?i.properties[0]:void 0;if(a&&a.keyNode.value===`$schema`){let t=a.valueNode||a,i=H.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length));o(_s.create(i,n,l,r))}else{let t=H.create(e.positionAt(i.offset),e.positionAt(i.offset+1));o(_s.create(t,n,l,r))}}};if(r.errors.length)i(r.errors[0],q.SchemaResolveError);else if(c){for(let e of r.warnings)i(e,q.SchemaUnsupportedFeature);let a=t.validate(e,r.schema,c,n?.schemaDraft);a&&a.forEach(o)}cl(r.schema)&&(s=void 0),ll(r.schema)&&(a=void 0)}for(let e of t.syntaxErrors){if(e.code===q.TrailingComma){if(typeof a!=`number`)continue;e.severity=a}o(e)}if(typeof s==`number`){let e=J(`Comments are not permitted in JSON.`);t.comments.forEach(t=>{o(_s.create(t,e,s,q.CommentNotPermitted))})}return i};if(r){let e=r.id||`schemaservice://untitled/`+ sl++;return this.jsonSchemaService.registerExternalSchema({uri:e,schema:r}).getResolvedSchema().then(e=>s(e))}return this.jsonSchemaService.getSchemaForResource(e.uri,t).then(e=>s(e))}getLanguageStatus(e,t){return{schemas:this.jsonSchemaService.getSchemaURIsForResource(e.uri,t)}}};let sl=0;function cl(e){if(e&&typeof e==`object`){if(Xo(e.allowComments))return e.allowComments;if(e.allOf)for(let t of e.allOf){let e=cl(t);if(Xo(e))return e}}}function ll(e){if(e&&typeof e==`object`){if(Xo(e.allowTrailingCommas))return e.allowTrailingCommas;let t=e;if(Xo(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(e.allOf)for(let t of e.allOf){let e=ll(t);if(Xo(e))return e}}}function ul(e){switch(e){case`error`:return U.Error;case`warning`:return U.Warning;case`ignore`:return}}function Q(e){return e<48?0:e<=57?e-48:(e<97&&(e+=32),e>=97&&e<=102?e-97+10:0)}function dl(e){if(e[0]===`#`)switch(e.length){case 4:return{red:Q(e.charCodeAt(1))*17/255,green:Q(e.charCodeAt(2))*17/255,blue:Q(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Q(e.charCodeAt(1))*17/255,green:Q(e.charCodeAt(2))*17/255,blue:Q(e.charCodeAt(3))*17/255,alpha:Q(e.charCodeAt(4))*17/255};case 7:return{red:(Q(e.charCodeAt(1))*16+Q(e.charCodeAt(2)))/255,green:(Q(e.charCodeAt(3))*16+Q(e.charCodeAt(4)))/255,blue:(Q(e.charCodeAt(5))*16+Q(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Q(e.charCodeAt(1))*16+Q(e.charCodeAt(2)))/255,green:(Q(e.charCodeAt(3))*16+Q(e.charCodeAt(4)))/255,blue:(Q(e.charCodeAt(5))*16+Q(e.charCodeAt(6)))/255,alpha:(Q(e.charCodeAt(7))*16+Q(e.charCodeAt(8)))/255}}}var fl=class{constructor(e){this.schemaService=e}findDocumentSymbols(e,t,n={resultLimit:Number.MAX_VALUE}){let r=t.root;if(!r)return[];let i=n.resultLimit||Number.MAX_VALUE,a=e.uri;if((a===`vscode://defaultsettings/keybindings.json`||es(a.toLowerCase(),`/user/keybindings.json`))&&r.type===`array`){let t=[];for(let o of r.items)if(o.type===`object`){for(let r of o.properties)if(r.keyNode.value===`key`&&r.valueNode){let s=ss.create(e.uri,pl(e,o));if(t.push({name:ml(r.valueNode),kind:Ks.Function,location:s}),i--,i<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),t}}return t}let o=[{node:r,containerName:``}],s=0,c=!1,l=[],u=(t,n)=>{t.type===`array`?t.items.forEach(e=>{e&&o.push({node:e,containerName:n})}):t.type===`object`&&t.properties.forEach(t=>{let r=t.valueNode;if(r)if(i>0){i--;let a=ss.create(e.uri,pl(e,t)),s=n?n+`.`+t.keyNode.value:t.keyNode.value;l.push({name:this.getKeyLabel(t),kind:this.getSymbolKind(r.type),location:a,containerName:n}),o.push({node:r,containerName:s})}else c=!0})};for(;s<o.length;){let e=o[s++];u(e.node,e.containerName)}return c&&n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),l}findDocumentSymbols2(e,t,n={resultLimit:Number.MAX_VALUE}){let r=t.root;if(!r)return[];let i=n.resultLimit||Number.MAX_VALUE,a=e.uri;if((a===`vscode://defaultsettings/keybindings.json`||es(a.toLowerCase(),`/user/keybindings.json`))&&r.type===`array`){let t=[];for(let o of r.items)if(o.type===`object`){for(let r of o.properties)if(r.keyNode.value===`key`&&r.valueNode){let s=pl(e,o),c=pl(e,r.keyNode);if(t.push({name:ml(r.valueNode),kind:Ks.Function,range:s,selectionRange:c}),i--,i<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),t}}return t}let o=[],s=[{node:r,result:o}],c=0,l=!1,u=(t,n)=>{t.type===`array`?t.items.forEach((t,r)=>{if(t)if(i>0){i--;let a=pl(e,t),o=a,c={name:String(r),kind:this.getSymbolKind(t.type),range:a,selectionRange:o,children:[]};n.push(c),s.push({result:c.children,node:t})}else l=!0}):t.type===`object`&&t.properties.forEach(t=>{let r=t.valueNode;if(r)if(i>0){i--;let a=pl(e,t),o=pl(e,t.keyNode),c=[],l={name:this.getKeyLabel(t),kind:this.getSymbolKind(r.type),range:a,selectionRange:o,children:c,detail:this.getDetail(r)};n.push(l),s.push({result:c,node:r})}else l=!0})};for(;c<s.length;){let e=s[c++];u(e.node,e.result)}return l&&n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),o}getSymbolKind(e){switch(e){case`object`:return Ks.Module;case`string`:return Ks.String;case`number`:return Ks.Number;case`array`:return Ks.Array;case`boolean`:return Ks.Boolean;default:return Ks.Variable}}getKeyLabel(e){let t=e.keyNode.value;return t&&=t.replace(/[\n]/g,`↵`),t&&t.trim()?t:`"${t}"`}getDetail(e){if(e){if(e.type===`boolean`||e.type===`number`||e.type===`null`||e.type===`string`)return String(e.value);if(e.type===`array`)return e.children.length?void 0:`[]`;if(e.type===`object`)return e.children.length?void 0:`{}`}}findDocumentColors(e,t,n){return this.schemaService.getSchemaForResource(e.uri,t).then(r=>{let i=[];if(r){let a=n&&typeof n.resultLimit==`number`?n.resultLimit:Number.MAX_VALUE,o=t.getMatchingSchemas(r.schema),s={};for(let t of o)if(!t.inverted&&t.schema&&(t.schema.format===`color`||t.schema.format===`color-hex`)&&t.node&&t.node.type===`string`){let r=String(t.node.offset);if(!s[r]){let o=dl(Yc(t.node));if(o){let n=pl(e,t.node);i.push({color:o,range:n})}if(s[r]=!0,a--,a<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(e.uri),i}}}return i})}getColorPresentations(e,t,n,r){let i=[],a=Math.round(n.red*255),o=Math.round(n.green*255),s=Math.round(n.blue*255);function c(e){let t=e.toString(16);return t.length===2?t:`0`+t}let l;return l=n.alpha===1?`#${c(a)}${c(o)}${c(s)}`:`#${c(a)}${c(o)}${c(s)}${c(Math.round(n.alpha*255))}`,i.push({label:l,textEdit:ys.replace(r,JSON.stringify(l))}),i}};function pl(e,t){return H.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length))}function ml(e){return Yc(e)||J(`<empty>`)}let hl={schemaAssociations:[],schemas:{"http://json-schema.org/draft-04/schema#":{$schema:`http://json-schema.org/draft-04/schema#`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},positiveInteger:{type:`integer`,minimum:0},positiveIntegerDefault0:{allOf:[{$ref:`#/definitions/positiveInteger`},{default:0}]},simpleTypes:{type:`string`,enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},minItems:1,uniqueItems:!0}},type:`object`,properties:{id:{type:`string`,format:`uri`},$schema:{type:`string`,format:`uri`},title:{type:`string`},description:{type:`string`},default:{},multipleOf:{type:`number`,minimum:0,exclusiveMinimum:!0},maximum:{type:`number`},exclusiveMaximum:{type:`boolean`,default:!1},minimum:{type:`number`},exclusiveMinimum:{type:`boolean`,default:!1},maxLength:{allOf:[{$ref:`#/definitions/positiveInteger`}]},minLength:{allOf:[{$ref:`#/definitions/positiveIntegerDefault0`}]},pattern:{type:`string`,format:`regex`},additionalItems:{anyOf:[{type:`boolean`},{$ref:`#`}],default:{}},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:{}},maxItems:{allOf:[{$ref:`#/definitions/positiveInteger`}]},minItems:{allOf:[{$ref:`#/definitions/positiveIntegerDefault0`}]},uniqueItems:{type:`boolean`,default:!1},maxProperties:{allOf:[{$ref:`#/definitions/positiveInteger`}]},minProperties:{allOf:[{$ref:`#/definitions/positiveIntegerDefault0`}]},required:{allOf:[{$ref:`#/definitions/stringArray`}]},additionalProperties:{anyOf:[{type:`boolean`},{$ref:`#`}],default:{}},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},enum:{type:`array`,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{anyOf:[{type:`string`,enum:[`date-time`,`uri`,`email`,`hostname`,`ipv4`,`ipv6`,`regex`]},{type:`string`}]},allOf:{allOf:[{$ref:`#/definitions/schemaArray`}]},anyOf:{allOf:[{$ref:`#/definitions/schemaArray`}]},oneOf:{allOf:[{$ref:`#/definitions/schemaArray`}]},not:{allOf:[{$ref:`#`}]}},dependencies:{exclusiveMaximum:[`maximum`],exclusiveMinimum:[`minimum`]},default:{}},"http://json-schema.org/draft-07/schema#":{definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0}}},gl={id:J(`A unique identifier for the schema.`),$schema:J(`The schema to verify this document against.`),title:J(`A descriptive title of the element.`),description:J(`A long description of the element. Used in hover menus and suggestions.`),default:J(`A default value. Used by suggestions.`),multipleOf:J(`A number that should cleanly divide the current value (i.e. have no remainder).`),maximum:J(`The maximum numerical value, inclusive by default.`),exclusiveMaximum:J(`Makes the maximum property exclusive.`),minimum:J(`The minimum numerical value, inclusive by default.`),exclusiveMinimum:J(`Makes the minimum property exclusive.`),maxLength:J(`The maximum length of a string.`),minLength:J(`The minimum length of a string.`),pattern:J(`A regular expression to match the string against. It is not implicitly anchored.`),additionalItems:J(`For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail.`),items:J(`For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on.`),maxItems:J(`The maximum number of items that can be inside an array. Inclusive.`),minItems:J(`The minimum number of items that can be inside an array. Inclusive.`),uniqueItems:J(`If all of the items in the array must be unique. Defaults to false.`),maxProperties:J(`The maximum number of properties an object can have. Inclusive.`),minProperties:J(`The minimum number of properties an object can have. Inclusive.`),required:J(`An array of strings that lists the names of all properties required on this object.`),additionalProperties:J(`Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail.`),definitions:J(`Not used for validation. Place subschemas here that you wish to reference inline with $ref.`),properties:J(`A map of property names to schemas for each property.`),patternProperties:J(`A map of regular expressions on property names to schemas for matching properties.`),dependencies:J(`A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object.`),enum:J(`The set of literal values that are valid.`),type:J(`Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types.`),format:J(`Describes the format expected for the value.`),allOf:J(`An array of schemas, all of which must match.`),anyOf:J(`An array of schemas, where at least one must match.`),oneOf:J(`An array of schemas, exactly one of which must match.`),not:J(`A schema which must not match.`),$id:J(`A unique identifier for the schema.`),$ref:J(`Reference a definition hosted on any location.`),$comment:J(`Comments from schema authors to readers or maintainers of the schema.`),readOnly:J(`Indicates that the value of the instance is managed exclusively by the owning authority.`),examples:J(`Sample JSON values associated with a particular schema, for the purpose of illustrating usage.`),contains:J(`An array instance is valid against "contains" if at least one of its elements is valid against the given schema.`),propertyNames:J(`If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema.`),const:J(`An instance validates successfully against this keyword if its value is equal to the value of the keyword.`),contentMediaType:J(`Describes the media type of a string property.`),contentEncoding:J(`Describes the content encoding of a string property.`),if:J(`The validation outcome of the "if" subschema controls which of the "then" or "else" keywords are evaluated.`),then:J(`The "if" subschema is used for validation when the "if" subschema succeeds.`),else:J(`The "else" subschema is used for validation when the "if" subschema fails.`)};for(let e in hl.schemas){let t=hl.schemas[e];for(let e in t.properties){let n=t.properties[e];typeof n==`boolean`&&(n=t.properties[e]={});let r=gl[e];r&&(n.description=r)}}var _l;(()=>{var e={470:e=>{function t(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}function n(e,t){for(var n,r=``,i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===47)break;n=47}if(n===47){if(!(a===s-1||o===1))if(a!==s-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var c=r.lastIndexOf(`/`);if(c!==r.length-1){c===-1?(r=``,i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf(`/`),a=s,o=0;continue}}else if(r.length===2||r.length===1){r=``,i=0,a=s,o=0;continue}}t&&(r.length>0?r+=`/..`:r=`..`,i=2)}else r.length>0?r+=`/`+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1;a=s,o=0}else n===46&&o!==-1?++o:o=-1}return r}var r={resolve:function(){for(var e,r=``,i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(e===void 0&&(e=process.cwd()),o=e),t(o),o.length!==0&&(r=o+`/`+r,i=o.charCodeAt(0)===47)}return r=n(r,!i),i?r.length>0?`/`+r:`/`:r.length>0?r:`.`},normalize:function(e){if(t(e),e.length===0)return`.`;var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return(e=n(e,!r)).length!==0||r||(e=`.`),e.length>0&&i&&(e+=`/`),r?`/`+e:e},isAbsolute:function(e){return t(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(e===void 0?e=i:e+=`/`+i)}return e===void 0?`.`:r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n||(e=r.resolve(e))===(n=r.resolve(n)))return``;for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var a=e.length,o=a-i,s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var c=n.length-s,l=o<c?o:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(n.charCodeAt(s+d)===47)return n.slice(s+d+1);if(d===0)return n.slice(s+d)}else o>l&&(e.charCodeAt(i+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(i+d);if(f!==n.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=i+u+1;d<=a;++d)d!==a&&e.charCodeAt(d)!==47||(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+n.slice(s+u):(s+=u,n.charCodeAt(s)===47&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),e.length===0)return`.`;for(var n=e.charCodeAt(0),r=n===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if((n=e.charCodeAt(o))===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},basename:function(e,n){if(n!==void 0&&typeof n!=`string`)throw TypeError(`"ext" argument must be a string`);t(e);var r,i=0,a=-1,o=!0;if(n!==void 0&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return``;var s=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(l===47){if(!o){i=r+1;break}}else c===-1&&(o=!1,c=r+1),s>=0&&(l===n.charCodeAt(s)?--s==-1&&(a=r):(s=-1,a=c))}return i===a?a=c:a===-1&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===47){if(!o){i=r+1;break}}else a===-1&&(o=!1,a=r+1);return a===-1?``:e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c!==47)i===-1&&(a=!1,i=s+1),c===46?n===-1?n=s:o!==1&&(o=1):n!==-1&&(o=-1);else if(!a){r=s+1;break}}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?``:e.slice(n,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+`/`+r:r}(0,e)},parse:function(e){t(e);var n={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return n;var r,i=e.charCodeAt(0),a=i===47;a?(n.root=`/`,r=1):r=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if((i=e.charCodeAt(u))!==47)c===-1&&(l=!1,c=u+1),i===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1);else if(!l){s=u+1;break}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(n.base=n.name=s===0&&a?e.slice(1,c):e.slice(s,c)):(s===0&&a?(n.name=e.slice(1,o),n.base=e.slice(1,c)):(n.name=e.slice(s,o),n.base=e.slice(s,c)),n.ext=e.slice(o,c)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir=`/`),n},sep:`/`,delimiter:`:`,win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{let e;n.r(r),n.d(r,{URI:()=>c,Utils:()=>x}),typeof process==`object`?e=process.platform===`win32`:typeof navigator==`object`&&(e=navigator.userAgent.indexOf(`Windows`)>=0);let t=/^\w[\w\d+.-]*$/,i=/^\//,a=/^\/\//;function o(e,n){if(!e.scheme&&n)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!t.test(e.scheme))throw Error(`[UriError]: Scheme contains illegal characters.`);if(e.path){if(e.authority){if(!i.test(e.path))throw Error(`[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character`)}else if(a.test(e.path))throw Error(`[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")`)}}let s=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class c{static isUri(e){return e instanceof c||!!e&&typeof e.authority==`string`&&typeof e.fragment==`string`&&typeof e.path==`string`&&typeof e.query==`string`&&typeof e.scheme==`string`&&typeof e.fsPath==`string`&&typeof e.with==`function`&&typeof e.toString==`function`}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,a=!1){typeof e==`object`?(this.scheme=e.scheme||``,this.authority=e.authority||``,this.path=e.path||``,this.query=e.query||``,this.fragment=e.fragment||``):(this.scheme=function(e,t){return e||t?e:`file`}(e,a),this.authority=t||``,this.path=function(e,t){switch(e){case`https`:case`http`:case`file`:t?t[0]!==`/`&&(t=`/`+t):t=`/`}return t}(this.scheme,n||``),this.query=r||``,this.fragment=i||``,o(this,a))}get fsPath(){return m(this)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return t===void 0?t=this.scheme:t===null&&(t=``),n===void 0?n=this.authority:n===null&&(n=``),r===void 0?r=this.path:r===null&&(r=``),i===void 0?i=this.query:i===null&&(i=``),a===void 0?a=this.fragment:a===null&&(a=``),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new u(t,n,r,i,a)}static parse(e,t=!1){let n=s.exec(e);return n?new u(n[2]||``,v(n[4]||``),v(n[5]||``),v(n[7]||``),v(n[9]||``),t):new u(``,``,``,``,``)}static file(t){let n=``;if(e&&(t=t.replace(/\\/g,`/`)),t[0]===`/`&&t[1]===`/`){let e=t.indexOf(`/`,2);e===-1?(n=t.substring(2),t=`/`):(n=t.substring(2,e),t=t.substring(e)||`/`)}return new u(`file`,n,t,``,``)}static from(e){let t=new u(e.scheme,e.authority,e.path,e.query,e.fragment);return o(t,!0),t}toString(e=!1){return h(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof c)return e;{let t=new u(e);return t._formatted=e.external,t._fsPath=e._sep===l?e.fsPath:null,t}}return e}}let l=e?1:void 0;class u extends c{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||=m(this),this._fsPath}toString(e=!1){return e?h(this,!0):(this._formatted||=h(this,!1),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=l),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}let d={58:`%3A`,47:`%2F`,63:`%3F`,35:`%23`,91:`%5B`,93:`%5D`,64:`%40`,33:`%21`,36:`%24`,38:`%26`,39:`%27`,40:`%28`,41:`%29`,42:`%2A`,43:`%2B`,44:`%2C`,59:`%3B`,61:`%3D`,32:`%20`};function f(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||t&&o===47||n&&o===91||n&&o===93||n&&o===58)i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r!==void 0&&(r+=e.charAt(a));else{r===void 0&&(r=e.substr(0,a));let t=d[o];t===void 0?i===-1&&(i=a):(i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t)}}return i!==-1&&(r+=encodeURIComponent(e.substring(i))),r===void 0?e:r}function p(e){let t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r===35||r===63?(t===void 0&&(t=e.substr(0,n)),t+=d[r]):t!==void 0&&(t+=e[n])}return t===void 0?e:t}function m(t,n){let r;return r=t.authority&&t.path.length>1&&t.scheme===`file`?`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,`\\`)),r}function h(e,t){let n=t?p:f,r=``,{scheme:i,authority:a,path:o,query:s,fragment:c}=e;if(i&&(r+=i,r+=`:`),(a||i===`file`)&&(r+=`/`,r+=`/`),a){let e=a.indexOf(`@`);if(e!==-1){let t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(`:`),e===-1?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=`:`,r+=n(t.substr(e+1),!1,!0)),r+=`@`}a=a.toLowerCase(),e=a.lastIndexOf(`:`),e===-1?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){let e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){let e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+=`?`,r+=n(s,!1,!1)),c&&(r+=`#`,r+=t?c:f(c,!1,!1)),r}function g(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+g(e.substr(3)):e}}let _=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function v(e){return e.match(_)?e.replace(_,(e=>g(e))):e}var y=n(470);let b=y.posix||y;var x;(function(e){e.joinPath=function(e,...t){return e.with({path:b.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==`/`&&(n=`/`+n,r=!0);let i=b.resolve(n,...t);return r&&i[0]===`/`&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(e.path.length===0||e.path===`/`)return e;let t=b.dirname(e.path);return t.length===1&&t.charCodeAt(0)===46&&(t=``),e.with({path:t})},e.basename=function(e){return b.basename(e.path)},e.extname=function(e){return b.extname(e.path)}})(x||={})})(),_l=r})();let{URI:vl,Utils:yl}=_l;function bl(e,t){if(typeof e!=`string`)throw TypeError(`Expected a string`);let n=String(e),r=``,i=!!t,a=!!t,o=!1,s=t&&typeof t.flags==`string`?t.flags:``,c;for(let e=0,t=n.length;e<t;e++)switch(c=n[e],c){case`/`:case`$`:case`^`:case`+`:case`.`:case`(`:case`)`:case`=`:case`!`:case`|`:r+=`\\`+c;break;case`?`:if(i){r+=`.`;break}case`[`:case`]`:if(i){r+=c;break}case`{`:if(i){o=!0,r+=`(`;break}case`}`:if(i){o=!1,r+=`)`;break}case`,`:if(o){r+=`|`;break}r+=`\\`+c;break;case`*`:let t=n[e-1],s=1;for(;n[e+1]===`*`;)s++,e++;let l=n[e+1];a?s>1&&(t===`/`||t===void 0||t===`{`||t===`,`)&&(l===`/`||l===void 0||l===`,`||l===`}`)?(l===`/`?e++:t===`/`&&r.endsWith(`\\/`)&&(r=r.substr(0,r.length-2)),r+=`((?:[^/]*(?:/|$))*)`):r+=`([^/]*)`:r+=`.*`;break;default:r+=c}return(!s||!~s.indexOf(`g`))&&(r=`^`+r+`$`),new RegExp(r,s)}var xl=class{constructor(e,t,n){this.folderUri=t,this.uris=n,this.globWrappers=[];try{for(let t of e){let e=t[0]!==`!`;e||(t=t.substring(1)),t.length>0&&(t[0]===`/`&&(t=t.substring(1)),this.globWrappers.push({regexp:bl(`**/`+t,{extended:!0,globstar:!0}),include:e}))}t&&(t=Ol(t),t.endsWith(`/`)||(t+=`/`),this.folderUri=t)}catch{this.globWrappers.length=0,this.uris=[]}}matchesPattern(e){if(this.folderUri&&!e.startsWith(this.folderUri))return!1;let t=!1;for(let{regexp:n,include:r}of this.globWrappers)n.test(e)&&(t=r);return t}getURIs(){return this.uris}},Sl=class{constructor(e,t,n){this.service=e,this.uri=t,this.dependencies=new Set,this.anchors=void 0,n&&(this.unresolvedSchema=this.service.promise.resolve(new Cl(n)))}getUnresolvedSchema(){return this.unresolvedSchema||=this.service.loadSchema(this.uri),this.unresolvedSchema}getResolvedSchema(){return this.resolvedSchema||=this.getUnresolvedSchema().then(e=>this.service.resolveSchemaContent(e,this)),this.resolvedSchema}clearSchema(){let e=!!this.unresolvedSchema;return this.resolvedSchema=void 0,this.unresolvedSchema=void 0,this.dependencies.clear(),this.anchors=void 0,e}},Cl=class{constructor(e,t=[]){this.schema=e,this.errors=t}},wl=class{constructor(e,t=[],n=[],r){this.schema=e,this.errors=t,this.warnings=n,this.schemaDraft=r}getSection(e){let t=this.getSectionRecursive(e,this.schema);if(t)return Y(t)}getSectionRecursive(e,t){if(!t||typeof t==`boolean`||e.length===0)return t;let n=e.shift();if(t.properties&&typeof t.properties[n])return this.getSectionRecursive(e,t.properties[n]);if(t.patternProperties){for(let r of Object.keys(t.patternProperties))if(ts(r)?.test(n))return this.getSectionRecursive(e,t.patternProperties[r])}else if(typeof t.additionalProperties==`object`)return this.getSectionRecursive(e,t.additionalProperties);else if(n.match(`[0-9]+`)){if(Array.isArray(t.items)){let r=parseInt(n,10);if(!isNaN(r)&&t.items[r])return this.getSectionRecursive(e,t.items[r])}else if(t.items)return this.getSectionRecursive(e,t.items)}}},Tl=class{constructor(e,t,n){this.contextService=t,this.requestService=e,this.promiseConstructor=n||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations=[],this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={}}getRegisteredSchemaIds(e){return Object.keys(this.registeredSchemasIds).filter(t=>{let n=vl.parse(t).scheme;return n!==`schemaservice`&&(!e||e(n))})}get promise(){return this.promiseConstructor}dispose(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()}onResourceChange(e){this.cachedSchemaForResource=void 0;let t=!1;e=Dl(e);let n=[e],r=Object.keys(this.schemasById).map(e=>this.schemasById[e]);for(;n.length;){let e=n.pop();for(let i=0;i<r.length;i++){let a=r[i];a&&(a.uri===e||a.dependencies.has(e))&&(a.uri!==e&&n.push(a.uri),a.clearSchema()&&(t=!0),r[i]=void 0)}}return t}setSchemaContributions(e){if(e.schemas){let t=e.schemas;for(let e in t){let n=Dl(e);this.contributionSchemas[n]=this.addSchemaHandle(n,t[e])}}if(Array.isArray(e.schemaAssociations)){let t=e.schemaAssociations;for(let e of t){let t=e.uris.map(Dl),n=this.addFilePatternAssociation(e.pattern,e.folderUri,t);this.contributionAssociations.push(n)}}}addSchemaHandle(e,t){let n=new Sl(this,e,t);return this.schemasById[e]=n,n}getOrAddSchemaHandle(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)}addFilePatternAssociation(e,t,n){let r=new xl(e,t,n);return this.filePatternAssociations.push(r),r}registerExternalSchema(e){let t=Dl(e.uri);return this.registeredSchemasIds[t]=!0,this.cachedSchemaForResource=void 0,e.fileMatch&&e.fileMatch.length&&this.addFilePatternAssociation(e.fileMatch,e.folderUri,[t]),e.schema?this.addSchemaHandle(t,e.schema):this.getOrAddSchemaHandle(t)}clearExternalSchemas(){this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={},this.cachedSchemaForResource=void 0;for(let e in this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(let e of this.contributionAssociations)this.filePatternAssociations.push(e)}getResolvedSchema(e){let t=Dl(e),n=this.schemasById[t];return n?n.getResolvedSchema():this.promise.resolve(void 0)}loadSchema(e){if(!this.requestService){let t=J(`Unable to load schema from '{0}'. No schema request service available`,kl(e));return this.promise.resolve(new Cl({},[t]))}return e.startsWith(`http://json-schema.org/`)&&(e=`https`+e.substring(4)),this.requestService(e).then(t=>{if(!t)return new Cl({},[J(`Unable to load schema from '{0}': No content.`,kl(e))]);let n=[];t.charCodeAt(0)===65279&&(n.push(J(`Problem reading content from '{0}': UTF-8 with BOM detected, only UTF 8 is allowed.`,kl(e))),t=t.trimStart());let r={},i=[];return r=Ho(t,i),i.length&&n.push(J(`Unable to parse content from '{0}': Parse error at offset {1}.`,kl(e),i[0].offset)),new Cl(r,n)},t=>{let n=t.toString(),r=t.toString().split(`Error: `);return r.length>1&&(n=r[1]),es(n,`.`)&&(n=n.substr(0,n.length-1)),new Cl({},[J(`Unable to load schema from '{0}': {1}.`,kl(e),n)])})}resolveSchemaContent(e,t){let n=e.errors.slice(0),r=e.schema,i=r.$schema?Dl(r.$schema):void 0;if(i===`http://json-schema.org/draft-03/schema`)return this.promise.resolve(new wl({},[J(`Draft-03 schemas are not supported.`)],[],i));let a=new Set,o=this.contextService,s=(e,t)=>{t=decodeURIComponent(t);let n=e;return t[0]===`/`&&(t=t.substring(1)),t.split(`/`).some(e=>(e=e.replace(/~1/g,`/`).replace(/~0/g,`~`),n=n[e],!n)),n},c=(e,t,n)=>(t.anchors||=p(e),t.anchors.get(n)),l=(e,t)=>{for(let n in t)t.hasOwnProperty(n)&&n!==`id`&&n!==`$id`&&(e[n]=t[n])},u=(e,t,r,i)=>{let a;a=i===void 0||i.length===0?t:i.charAt(0)===`/`?s(t,i):c(t,r,i),a?l(e,a):n.push(J(`$ref '{0}' in '{1}' can not be resolved.`,i||``,r.uri))},d=(e,t,r,i)=>{o&&!/^[A-Za-z][A-Za-z0-9+\-.+]*:\/\/.*/.test(t)&&(t=o.resolveRelativePath(t,i.uri)),t=Dl(t);let a=this.getOrAddSchemaHandle(t);return a.getUnresolvedSchema().then(o=>{if(i.dependencies.add(t),o.errors.length){let e=r?t+`#`+r:t;n.push(J(`Problems loading reference '{0}': {1}`,e,o.errors[0]))}return u(e,o.schema,a,r),f(e,o.schema,a)})},f=(e,t,n)=>{let r=[];return this.traverseNodes(e,e=>{let i=new Set;for(;e.$ref;){let a=e.$ref,o=a.split(`#`,2);if(delete e.$ref,o[0].length>0){r.push(d(e,o[0],o[1],n));return}else if(!i.has(a)){let r=o[1];u(e,t,n,r),i.add(a)}}e.$recursiveRef&&a.add(`$recursiveRef`),e.$dynamicRef&&a.add(`$dynamicRef`)}),this.promise.all(r)},p=e=>{let t=new Map;return this.traverseNodes(e,e=>{let r=e.$id||e.id,i=Zo(r)&&r.charAt(0)===`#`?r.substring(1):e.$anchor;i&&(t.has(i)?n.push(J(`Duplicate anchor declaration: '{0}'`,i)):t.set(i,e)),e.$recursiveAnchor&&a.add(`$recursiveAnchor`),e.$dynamicAnchor&&a.add(`$dynamicAnchor`)}),t};return f(r,r,t).then(e=>{let t=[];return a.size&&t.push(J(`The schema uses meta-schema features ({0}) that are not yet supported by the validator.`,Array.from(a.keys()).join(`, `))),new wl(r,n,t,i)})}traverseNodes(e,t){if(!e||typeof e!=`object`)return Promise.resolve(null);let n=new Set,r=(...e)=>{for(let t of e)Qo(t)&&s.push(t)},i=(...e)=>{for(let t of e)if(Qo(t))for(let e in t){let n=t[e];Qo(n)&&s.push(n)}},a=(...e)=>{for(let t of e)if(Array.isArray(t))for(let e of t)Qo(e)&&s.push(e)},o=e=>{if(Array.isArray(e))for(let t of e)Qo(t)&&s.push(t);else Qo(e)&&s.push(e)},s=[e],c=s.pop();for(;c;)n.has(c)||(n.add(c),t(c),r(c.additionalItems,c.additionalProperties,c.not,c.contains,c.propertyNames,c.if,c.then,c.else,c.unevaluatedItems,c.unevaluatedProperties),i(c.definitions,c.$defs,c.properties,c.patternProperties,c.dependencies,c.dependentSchemas),a(c.anyOf,c.allOf,c.oneOf,c.prefixItems),o(c.items)),c=s.pop()}getSchemaFromProperty(e,t){if(t.root?.type===`object`){for(let n of t.root.properties)if(n.keyNode.value===`$schema`&&n.valueNode?.type===`string`){let t=n.valueNode.value;return this.contextService&&!/^\w[\w\d+.-]*:/.test(t)&&(t=this.contextService.resolveRelativePath(t,e)),t}}}getAssociatedSchemas(e){let t=Object.create(null),n=[],r=Ol(e);for(let e of this.filePatternAssociations)if(e.matchesPattern(r))for(let r of e.getURIs())t[r]||(n.push(r),t[r]=!0);return n}getSchemaURIsForResource(e,t){let n=t&&this.getSchemaFromProperty(e,t);return n?[n]:this.getAssociatedSchemas(e)}getSchemaForResource(e,t){if(t){let n=this.getSchemaFromProperty(e,t);if(n){let e=Dl(n);return this.getOrAddSchemaHandle(e).getResolvedSchema()}}if(this.cachedSchemaForResource&&this.cachedSchemaForResource.resource===e)return this.cachedSchemaForResource.resolvedSchema;let n=this.getAssociatedSchemas(e),r=n.length>0?this.createCombinedSchema(e,n).getResolvedSchema():this.promise.resolve(void 0);return this.cachedSchemaForResource={resource:e,resolvedSchema:r},r}createCombinedSchema(e,t){if(t.length===1)return this.getOrAddSchemaHandle(t[0]);{let n=`schemaservice://combinedSchema/`+encodeURIComponent(e),r={allOf:t.map(e=>({$ref:e}))};return this.addSchemaHandle(n,r)}}getMatchingSchemas(e,t,n){if(n){let e=n.id||`schemaservice://untitled/matchingSchemas/`+ El++;return this.addSchemaHandle(e,n).getResolvedSchema().then(e=>t.getMatchingSchemas(e.schema).filter(e=>!e.inverted))}return this.getSchemaForResource(e.uri,t).then(e=>e?t.getMatchingSchemas(e.schema).filter(e=>!e.inverted):[])}};let El=0;function Dl(e){try{return vl.parse(e).toString(!0)}catch{return e}}function Ol(e){try{return vl.parse(e).with({fragment:null,query:null}).toString(!0)}catch{return e}}function kl(e){try{let t=vl.parse(e);if(t.scheme===`file`)return t.fsPath}catch{}return e}function Al(e,t){let n=[],r=[],i=[],a=-1,o=zo(e.getText(),!1),s=o.scan();function c(e){n.push(e),r.push(i.length)}for(;s!==17;){switch(s){case 1:case 3:{let t=e.positionAt(o.getTokenOffset()).line,n={startLine:t,endLine:t,kind:s===1?`object`:`array`};i.push(n);break}case 2:case 4:{let t=s===2?`object`:`array`;if(i.length>0&&i[i.length-1].kind===t){let t=i.pop(),n=e.positionAt(o.getTokenOffset()).line;t&&n>t.startLine+1&&a!==t.startLine&&(t.endLine=n-1,c(t),a=t.startLine)}break}case 13:{let t=e.positionAt(o.getTokenOffset()).line,n=e.positionAt(o.getTokenOffset()+o.getTokenLength()).line;o.getTokenError()===1&&t+1<e.lineCount?o.setPosition(e.offsetAt(V.create(t+1,0))):t<n&&(c({startLine:t,endLine:n,kind:fs.Comment}),a=t);break}case 12:{let t=e.getText().substr(o.getTokenOffset(),o.getTokenLength()).match(/^\/\/\s*#(region\b)|(endregion\b)/);if(t){let n=e.positionAt(o.getTokenOffset()).line;if(t[1]){let e={startLine:n,endLine:n,kind:fs.Region};i.push(e)}else{let e=i.length-1;for(;e>=0&&i[e].kind!==fs.Region;)e--;if(e>=0){let t=i[e];i.length=e,n>t.startLine&&a!==t.startLine&&(t.endLine=n,c(t),a=t.startLine)}}}break}}s=o.scan()}let l=t&&t.rangeLimit;if(typeof l!=`number`||n.length<=l)return n;t&&t.onRangeLimitExceeded&&t.onRangeLimitExceeded(e.uri);let u=[];for(let e of r)e<30&&(u[e]=(u[e]||0)+1);let d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t){if(t+d>l){f=e;break}d+=t}}let p=[];for(let e=0;e<n.length;e++){let t=r[e];typeof t==`number`&&(t<f||t===f&&d++<l)&&p.push(n[e])}return p}function jl(e,t,n){function r(t){let r=e.offsetAt(t),a=n.getNodeFromOffset(r,!0),s=[];for(;a;){switch(a.type){case`string`:case`object`:case`array`:let e=a.offset+1,t=a.offset+a.length-1;e<t&&r>=e&&r<=t&&s.push(i(e,t)),s.push(i(a.offset,a.offset+a.length));break;case`number`:case`boolean`:case`null`:case`property`:s.push(i(a.offset,a.offset+a.length));break}if(a.type===`property`||a.parent&&a.parent.type===`array`){let e=o(a.offset+a.length,5);e!==-1&&s.push(i(a.offset,e))}a=a.parent}let c;for(let e=s.length-1;e>=0;e--)c=ic.create(s[e],c);return c||=ic.create(H.create(t,t)),c}function i(t,n){return H.create(e.positionAt(t),e.positionAt(n))}let a=zo(e.getText(),!0);function o(e,t){return a.setPosition(e),a.scan()===t?a.getTokenOffset()+a.getTokenLength():-1}return t.map(r)}function Ml(e,t,n){let r;if(n){let t=e.offsetAt(n.start);r={offset:t,length:e.offsetAt(n.end)-t}}let i={tabSize:t?t.tabSize:4,insertSpaces:t?.insertSpaces===!0,insertFinalNewline:t?.insertFinalNewline===!0,eol:`
|
|
57
|
+
$3`).replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)}function al(e){return e.indexOf("`")===-1?e:"`` "+e+" ``"}var ol=class{constructor(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}configure(e){e&&(this.validationEnabled=e.validate!==!1,this.commentSeverity=e.allowComments?void 0:U.Error)}doValidation(e,t,n,r){if(!this.validationEnabled)return this.promise.resolve([]);let i=[],a={},o=e=>{let t=e.range.start.line+` `+e.range.start.character+` `+e.message;a[t]||(a[t]=!0,i.push(e))},s=r=>{let a=n?.trailingCommas?ul(n.trailingCommas):U.Error,s=n?.comments?ul(n.comments):this.commentSeverity,c=n?.schemaValidation?ul(n.schemaValidation):U.Warning,l=n?.schemaRequest?ul(n.schemaRequest):U.Warning;if(r){let i=(n,r)=>{if(t.root&&l){let i=t.root,a=i.type===`object`?i.properties[0]:void 0;if(a&&a.keyNode.value===`$schema`){let t=a.valueNode||a,i=H.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length));o(_s.create(i,n,l,r))}else{let t=H.create(e.positionAt(i.offset),e.positionAt(i.offset+1));o(_s.create(t,n,l,r))}}};if(r.errors.length)i(r.errors[0],q.SchemaResolveError);else if(c){for(let e of r.warnings)i(e,q.SchemaUnsupportedFeature);let a=t.validate(e,r.schema,c,n?.schemaDraft);a&&a.forEach(o)}cl(r.schema)&&(s=void 0),ll(r.schema)&&(a=void 0)}for(let e of t.syntaxErrors){if(e.code===q.TrailingComma){if(typeof a!=`number`)continue;e.severity=a}o(e)}if(typeof s==`number`){let e=J(`Comments are not permitted in JSON.`);t.comments.forEach(t=>{o(_s.create(t,e,s,q.CommentNotPermitted))})}return i};if(r){let e=r.id||`schemaservice://untitled/`+sl++;return this.jsonSchemaService.registerExternalSchema({uri:e,schema:r}).getResolvedSchema().then(e=>s(e))}return this.jsonSchemaService.getSchemaForResource(e.uri,t).then(e=>s(e))}getLanguageStatus(e,t){return{schemas:this.jsonSchemaService.getSchemaURIsForResource(e.uri,t)}}};let sl=0;function cl(e){if(e&&typeof e==`object`){if(Xo(e.allowComments))return e.allowComments;if(e.allOf)for(let t of e.allOf){let e=cl(t);if(Xo(e))return e}}}function ll(e){if(e&&typeof e==`object`){if(Xo(e.allowTrailingCommas))return e.allowTrailingCommas;let t=e;if(Xo(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(e.allOf)for(let t of e.allOf){let e=ll(t);if(Xo(e))return e}}}function ul(e){switch(e){case`error`:return U.Error;case`warning`:return U.Warning;case`ignore`:return}}function Q(e){return e<48?0:e<=57?e-48:(e<97&&(e+=32),e>=97&&e<=102?e-97+10:0)}function dl(e){if(e[0]===`#`)switch(e.length){case 4:return{red:Q(e.charCodeAt(1))*17/255,green:Q(e.charCodeAt(2))*17/255,blue:Q(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Q(e.charCodeAt(1))*17/255,green:Q(e.charCodeAt(2))*17/255,blue:Q(e.charCodeAt(3))*17/255,alpha:Q(e.charCodeAt(4))*17/255};case 7:return{red:(Q(e.charCodeAt(1))*16+Q(e.charCodeAt(2)))/255,green:(Q(e.charCodeAt(3))*16+Q(e.charCodeAt(4)))/255,blue:(Q(e.charCodeAt(5))*16+Q(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Q(e.charCodeAt(1))*16+Q(e.charCodeAt(2)))/255,green:(Q(e.charCodeAt(3))*16+Q(e.charCodeAt(4)))/255,blue:(Q(e.charCodeAt(5))*16+Q(e.charCodeAt(6)))/255,alpha:(Q(e.charCodeAt(7))*16+Q(e.charCodeAt(8)))/255}}}var fl=class{constructor(e){this.schemaService=e}findDocumentSymbols(e,t,n={resultLimit:Number.MAX_VALUE}){let r=t.root;if(!r)return[];let i=n.resultLimit||Number.MAX_VALUE,a=e.uri;if((a===`vscode://defaultsettings/keybindings.json`||es(a.toLowerCase(),`/user/keybindings.json`))&&r.type===`array`){let t=[];for(let o of r.items)if(o.type===`object`){for(let r of o.properties)if(r.keyNode.value===`key`&&r.valueNode){let s=ss.create(e.uri,pl(e,o));if(t.push({name:ml(r.valueNode),kind:Ks.Function,location:s}),i--,i<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),t}}return t}let o=[{node:r,containerName:``}],s=0,c=!1,l=[],u=(t,n)=>{t.type===`array`?t.items.forEach(e=>{e&&o.push({node:e,containerName:n})}):t.type===`object`&&t.properties.forEach(t=>{let r=t.valueNode;if(r)if(i>0){i--;let a=ss.create(e.uri,pl(e,t)),s=n?n+`.`+t.keyNode.value:t.keyNode.value;l.push({name:this.getKeyLabel(t),kind:this.getSymbolKind(r.type),location:a,containerName:n}),o.push({node:r,containerName:s})}else c=!0})};for(;s<o.length;){let e=o[s++];u(e.node,e.containerName)}return c&&n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),l}findDocumentSymbols2(e,t,n={resultLimit:Number.MAX_VALUE}){let r=t.root;if(!r)return[];let i=n.resultLimit||Number.MAX_VALUE,a=e.uri;if((a===`vscode://defaultsettings/keybindings.json`||es(a.toLowerCase(),`/user/keybindings.json`))&&r.type===`array`){let t=[];for(let o of r.items)if(o.type===`object`){for(let r of o.properties)if(r.keyNode.value===`key`&&r.valueNode){let s=pl(e,o),c=pl(e,r.keyNode);if(t.push({name:ml(r.valueNode),kind:Ks.Function,range:s,selectionRange:c}),i--,i<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),t}}return t}let o=[],s=[{node:r,result:o}],c=0,l=!1,u=(t,n)=>{t.type===`array`?t.items.forEach((t,r)=>{if(t)if(i>0){i--;let a=pl(e,t),o=a,c={name:String(r),kind:this.getSymbolKind(t.type),range:a,selectionRange:o,children:[]};n.push(c),s.push({result:c.children,node:t})}else l=!0}):t.type===`object`&&t.properties.forEach(t=>{let r=t.valueNode;if(r)if(i>0){i--;let a=pl(e,t),o=pl(e,t.keyNode),c=[],l={name:this.getKeyLabel(t),kind:this.getSymbolKind(r.type),range:a,selectionRange:o,children:c,detail:this.getDetail(r)};n.push(l),s.push({result:c,node:r})}else l=!0})};for(;c<s.length;){let e=s[c++];u(e.node,e.result)}return l&&n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(a),o}getSymbolKind(e){switch(e){case`object`:return Ks.Module;case`string`:return Ks.String;case`number`:return Ks.Number;case`array`:return Ks.Array;case`boolean`:return Ks.Boolean;default:return Ks.Variable}}getKeyLabel(e){let t=e.keyNode.value;return t&&=t.replace(/[\n]/g,`↵`),t&&t.trim()?t:`"${t}"`}getDetail(e){if(e){if(e.type===`boolean`||e.type===`number`||e.type===`null`||e.type===`string`)return String(e.value);if(e.type===`array`)return e.children.length?void 0:`[]`;if(e.type===`object`)return e.children.length?void 0:`{}`}}findDocumentColors(e,t,n){return this.schemaService.getSchemaForResource(e.uri,t).then(r=>{let i=[];if(r){let a=n&&typeof n.resultLimit==`number`?n.resultLimit:Number.MAX_VALUE,o=t.getMatchingSchemas(r.schema),s={};for(let t of o)if(!t.inverted&&t.schema&&(t.schema.format===`color`||t.schema.format===`color-hex`)&&t.node&&t.node.type===`string`){let r=String(t.node.offset);if(!s[r]){let o=dl(Yc(t.node));if(o){let n=pl(e,t.node);i.push({color:o,range:n})}if(s[r]=!0,a--,a<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(e.uri),i}}}return i})}getColorPresentations(e,t,n,r){let i=[],a=Math.round(n.red*255),o=Math.round(n.green*255),s=Math.round(n.blue*255);function c(e){let t=e.toString(16);return t.length===2?t:`0`+t}let l;return l=n.alpha===1?`#${c(a)}${c(o)}${c(s)}`:`#${c(a)}${c(o)}${c(s)}${c(Math.round(n.alpha*255))}`,i.push({label:l,textEdit:ys.replace(r,JSON.stringify(l))}),i}};function pl(e,t){return H.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length))}function ml(e){return Yc(e)||J(`<empty>`)}let hl={schemaAssociations:[],schemas:{"http://json-schema.org/draft-04/schema#":{$schema:`http://json-schema.org/draft-04/schema#`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},positiveInteger:{type:`integer`,minimum:0},positiveIntegerDefault0:{allOf:[{$ref:`#/definitions/positiveInteger`},{default:0}]},simpleTypes:{type:`string`,enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},minItems:1,uniqueItems:!0}},type:`object`,properties:{id:{type:`string`,format:`uri`},$schema:{type:`string`,format:`uri`},title:{type:`string`},description:{type:`string`},default:{},multipleOf:{type:`number`,minimum:0,exclusiveMinimum:!0},maximum:{type:`number`},exclusiveMaximum:{type:`boolean`,default:!1},minimum:{type:`number`},exclusiveMinimum:{type:`boolean`,default:!1},maxLength:{allOf:[{$ref:`#/definitions/positiveInteger`}]},minLength:{allOf:[{$ref:`#/definitions/positiveIntegerDefault0`}]},pattern:{type:`string`,format:`regex`},additionalItems:{anyOf:[{type:`boolean`},{$ref:`#`}],default:{}},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:{}},maxItems:{allOf:[{$ref:`#/definitions/positiveInteger`}]},minItems:{allOf:[{$ref:`#/definitions/positiveIntegerDefault0`}]},uniqueItems:{type:`boolean`,default:!1},maxProperties:{allOf:[{$ref:`#/definitions/positiveInteger`}]},minProperties:{allOf:[{$ref:`#/definitions/positiveIntegerDefault0`}]},required:{allOf:[{$ref:`#/definitions/stringArray`}]},additionalProperties:{anyOf:[{type:`boolean`},{$ref:`#`}],default:{}},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},enum:{type:`array`,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{anyOf:[{type:`string`,enum:[`date-time`,`uri`,`email`,`hostname`,`ipv4`,`ipv6`,`regex`]},{type:`string`}]},allOf:{allOf:[{$ref:`#/definitions/schemaArray`}]},anyOf:{allOf:[{$ref:`#/definitions/schemaArray`}]},oneOf:{allOf:[{$ref:`#/definitions/schemaArray`}]},not:{allOf:[{$ref:`#`}]}},dependencies:{exclusiveMaximum:[`maximum`],exclusiveMinimum:[`minimum`]},default:{}},"http://json-schema.org/draft-07/schema#":{definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0}}},gl={id:J(`A unique identifier for the schema.`),$schema:J(`The schema to verify this document against.`),title:J(`A descriptive title of the element.`),description:J(`A long description of the element. Used in hover menus and suggestions.`),default:J(`A default value. Used by suggestions.`),multipleOf:J(`A number that should cleanly divide the current value (i.e. have no remainder).`),maximum:J(`The maximum numerical value, inclusive by default.`),exclusiveMaximum:J(`Makes the maximum property exclusive.`),minimum:J(`The minimum numerical value, inclusive by default.`),exclusiveMinimum:J(`Makes the minimum property exclusive.`),maxLength:J(`The maximum length of a string.`),minLength:J(`The minimum length of a string.`),pattern:J(`A regular expression to match the string against. It is not implicitly anchored.`),additionalItems:J(`For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail.`),items:J(`For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on.`),maxItems:J(`The maximum number of items that can be inside an array. Inclusive.`),minItems:J(`The minimum number of items that can be inside an array. Inclusive.`),uniqueItems:J(`If all of the items in the array must be unique. Defaults to false.`),maxProperties:J(`The maximum number of properties an object can have. Inclusive.`),minProperties:J(`The minimum number of properties an object can have. Inclusive.`),required:J(`An array of strings that lists the names of all properties required on this object.`),additionalProperties:J(`Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail.`),definitions:J(`Not used for validation. Place subschemas here that you wish to reference inline with $ref.`),properties:J(`A map of property names to schemas for each property.`),patternProperties:J(`A map of regular expressions on property names to schemas for matching properties.`),dependencies:J(`A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object.`),enum:J(`The set of literal values that are valid.`),type:J(`Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types.`),format:J(`Describes the format expected for the value.`),allOf:J(`An array of schemas, all of which must match.`),anyOf:J(`An array of schemas, where at least one must match.`),oneOf:J(`An array of schemas, exactly one of which must match.`),not:J(`A schema which must not match.`),$id:J(`A unique identifier for the schema.`),$ref:J(`Reference a definition hosted on any location.`),$comment:J(`Comments from schema authors to readers or maintainers of the schema.`),readOnly:J(`Indicates that the value of the instance is managed exclusively by the owning authority.`),examples:J(`Sample JSON values associated with a particular schema, for the purpose of illustrating usage.`),contains:J(`An array instance is valid against "contains" if at least one of its elements is valid against the given schema.`),propertyNames:J(`If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema.`),const:J(`An instance validates successfully against this keyword if its value is equal to the value of the keyword.`),contentMediaType:J(`Describes the media type of a string property.`),contentEncoding:J(`Describes the content encoding of a string property.`),if:J(`The validation outcome of the "if" subschema controls which of the "then" or "else" keywords are evaluated.`),then:J(`The "if" subschema is used for validation when the "if" subschema succeeds.`),else:J(`The "else" subschema is used for validation when the "if" subschema fails.`)};for(let e in hl.schemas){let t=hl.schemas[e];for(let e in t.properties){let n=t.properties[e];typeof n==`boolean`&&(n=t.properties[e]={});let r=gl[e];r&&(n.description=r)}}var _l;(()=>{var e={470:e=>{function t(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}function n(e,t){for(var n,r=``,i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===47)break;n=47}if(n===47){if(!(a===s-1||o===1))if(a!==s-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var c=r.lastIndexOf(`/`);if(c!==r.length-1){c===-1?(r=``,i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf(`/`),a=s,o=0;continue}}else if(r.length===2||r.length===1){r=``,i=0,a=s,o=0;continue}}t&&(r.length>0?r+=`/..`:r=`..`,i=2)}else r.length>0?r+=`/`+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1;a=s,o=0}else n===46&&o!==-1?++o:o=-1}return r}var r={resolve:function(){for(var e,r=``,i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(e===void 0&&(e=process.cwd()),o=e),t(o),o.length!==0&&(r=o+`/`+r,i=o.charCodeAt(0)===47)}return r=n(r,!i),i?r.length>0?`/`+r:`/`:r.length>0?r:`.`},normalize:function(e){if(t(e),e.length===0)return`.`;var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return(e=n(e,!r)).length!==0||r||(e=`.`),e.length>0&&i&&(e+=`/`),r?`/`+e:e},isAbsolute:function(e){return t(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(e===void 0?e=i:e+=`/`+i)}return e===void 0?`.`:r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n||(e=r.resolve(e))===(n=r.resolve(n)))return``;for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var a=e.length,o=a-i,s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var c=n.length-s,l=o<c?o:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(n.charCodeAt(s+d)===47)return n.slice(s+d+1);if(d===0)return n.slice(s+d)}else o>l&&(e.charCodeAt(i+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(i+d);if(f!==n.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=i+u+1;d<=a;++d)d!==a&&e.charCodeAt(d)!==47||(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+n.slice(s+u):(s+=u,n.charCodeAt(s)===47&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),e.length===0)return`.`;for(var n=e.charCodeAt(0),r=n===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if((n=e.charCodeAt(o))===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},basename:function(e,n){if(n!==void 0&&typeof n!=`string`)throw TypeError(`"ext" argument must be a string`);t(e);var r,i=0,a=-1,o=!0;if(n!==void 0&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return``;var s=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(l===47){if(!o){i=r+1;break}}else c===-1&&(o=!1,c=r+1),s>=0&&(l===n.charCodeAt(s)?--s==-1&&(a=r):(s=-1,a=c))}return i===a?a=c:a===-1&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===47){if(!o){i=r+1;break}}else a===-1&&(o=!1,a=r+1);return a===-1?``:e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c!==47)i===-1&&(a=!1,i=s+1),c===46?n===-1?n=s:o!==1&&(o=1):n!==-1&&(o=-1);else if(!a){r=s+1;break}}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?``:e.slice(n,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+`/`+r:r}(0,e)},parse:function(e){t(e);var n={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return n;var r,i=e.charCodeAt(0),a=i===47;a?(n.root=`/`,r=1):r=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if((i=e.charCodeAt(u))!==47)c===-1&&(l=!1,c=u+1),i===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1);else if(!l){s=u+1;break}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(n.base=n.name=s===0&&a?e.slice(1,c):e.slice(s,c)):(s===0&&a?(n.name=e.slice(1,o),n.base=e.slice(1,c)):(n.name=e.slice(s,o),n.base=e.slice(s,c)),n.ext=e.slice(o,c)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir=`/`),n},sep:`/`,delimiter:`:`,win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{let e;n.r(r),n.d(r,{URI:()=>c,Utils:()=>x}),typeof process==`object`?e=process.platform===`win32`:typeof navigator==`object`&&(e=navigator.userAgent.indexOf(`Windows`)>=0);let t=/^\w[\w\d+.-]*$/,i=/^\//,a=/^\/\//;function o(e,n){if(!e.scheme&&n)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!t.test(e.scheme))throw Error(`[UriError]: Scheme contains illegal characters.`);if(e.path){if(e.authority){if(!i.test(e.path))throw Error(`[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character`)}else if(a.test(e.path))throw Error(`[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")`)}}let s=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class c{static isUri(e){return e instanceof c||!!e&&typeof e.authority==`string`&&typeof e.fragment==`string`&&typeof e.path==`string`&&typeof e.query==`string`&&typeof e.scheme==`string`&&typeof e.fsPath==`string`&&typeof e.with==`function`&&typeof e.toString==`function`}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,a=!1){typeof e==`object`?(this.scheme=e.scheme||``,this.authority=e.authority||``,this.path=e.path||``,this.query=e.query||``,this.fragment=e.fragment||``):(this.scheme=function(e,t){return e||t?e:`file`}(e,a),this.authority=t||``,this.path=function(e,t){switch(e){case`https`:case`http`:case`file`:t?t[0]!==`/`&&(t=`/`+t):t=`/`}return t}(this.scheme,n||``),this.query=r||``,this.fragment=i||``,o(this,a))}get fsPath(){return m(this)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return t===void 0?t=this.scheme:t===null&&(t=``),n===void 0?n=this.authority:n===null&&(n=``),r===void 0?r=this.path:r===null&&(r=``),i===void 0?i=this.query:i===null&&(i=``),a===void 0?a=this.fragment:a===null&&(a=``),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new u(t,n,r,i,a)}static parse(e,t=!1){let n=s.exec(e);return n?new u(n[2]||``,v(n[4]||``),v(n[5]||``),v(n[7]||``),v(n[9]||``),t):new u(``,``,``,``,``)}static file(t){let n=``;if(e&&(t=t.replace(/\\/g,`/`)),t[0]===`/`&&t[1]===`/`){let e=t.indexOf(`/`,2);e===-1?(n=t.substring(2),t=`/`):(n=t.substring(2,e),t=t.substring(e)||`/`)}return new u(`file`,n,t,``,``)}static from(e){let t=new u(e.scheme,e.authority,e.path,e.query,e.fragment);return o(t,!0),t}toString(e=!1){return h(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof c)return e;{let t=new u(e);return t._formatted=e.external,t._fsPath=e._sep===l?e.fsPath:null,t}}return e}}let l=e?1:void 0;class u extends c{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||=m(this),this._fsPath}toString(e=!1){return e?h(this,!0):(this._formatted||=h(this,!1),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=l),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}let d={58:`%3A`,47:`%2F`,63:`%3F`,35:`%23`,91:`%5B`,93:`%5D`,64:`%40`,33:`%21`,36:`%24`,38:`%26`,39:`%27`,40:`%28`,41:`%29`,42:`%2A`,43:`%2B`,44:`%2C`,59:`%3B`,61:`%3D`,32:`%20`};function f(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||t&&o===47||n&&o===91||n&&o===93||n&&o===58)i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r!==void 0&&(r+=e.charAt(a));else{r===void 0&&(r=e.substr(0,a));let t=d[o];t===void 0?i===-1&&(i=a):(i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t)}}return i!==-1&&(r+=encodeURIComponent(e.substring(i))),r===void 0?e:r}function p(e){let t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r===35||r===63?(t===void 0&&(t=e.substr(0,n)),t+=d[r]):t!==void 0&&(t+=e[n])}return t===void 0?e:t}function m(t,n){let r;return r=t.authority&&t.path.length>1&&t.scheme===`file`?`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,`\\`)),r}function h(e,t){let n=t?p:f,r=``,{scheme:i,authority:a,path:o,query:s,fragment:c}=e;if(i&&(r+=i,r+=`:`),(a||i===`file`)&&(r+=`/`,r+=`/`),a){let e=a.indexOf(`@`);if(e!==-1){let t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(`:`),e===-1?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=`:`,r+=n(t.substr(e+1),!1,!0)),r+=`@`}a=a.toLowerCase(),e=a.lastIndexOf(`:`),e===-1?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){let e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){let e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+=`?`,r+=n(s,!1,!1)),c&&(r+=`#`,r+=t?c:f(c,!1,!1)),r}function g(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+g(e.substr(3)):e}}let _=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function v(e){return e.match(_)?e.replace(_,(e=>g(e))):e}var y=n(470);let b=y.posix||y;var x;(function(e){e.joinPath=function(e,...t){return e.with({path:b.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==`/`&&(n=`/`+n,r=!0);let i=b.resolve(n,...t);return r&&i[0]===`/`&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(e.path.length===0||e.path===`/`)return e;let t=b.dirname(e.path);return t.length===1&&t.charCodeAt(0)===46&&(t=``),e.with({path:t})},e.basename=function(e){return b.basename(e.path)},e.extname=function(e){return b.extname(e.path)}})(x||={})})(),_l=r})();let{URI:vl,Utils:yl}=_l;function bl(e,t){if(typeof e!=`string`)throw TypeError(`Expected a string`);let n=String(e),r=``,i=!!t,a=!!t,o=!1,s=t&&typeof t.flags==`string`?t.flags:``,c;for(let e=0,t=n.length;e<t;e++)switch(c=n[e],c){case`/`:case`$`:case`^`:case`+`:case`.`:case`(`:case`)`:case`=`:case`!`:case`|`:r+=`\\`+c;break;case`?`:if(i){r+=`.`;break}case`[`:case`]`:if(i){r+=c;break}case`{`:if(i){o=!0,r+=`(`;break}case`}`:if(i){o=!1,r+=`)`;break}case`,`:if(o){r+=`|`;break}r+=`\\`+c;break;case`*`:let t=n[e-1],s=1;for(;n[e+1]===`*`;)s++,e++;let l=n[e+1];a?s>1&&(t===`/`||t===void 0||t===`{`||t===`,`)&&(l===`/`||l===void 0||l===`,`||l===`}`)?(l===`/`?e++:t===`/`&&r.endsWith(`\\/`)&&(r=r.substr(0,r.length-2)),r+=`((?:[^/]*(?:/|$))*)`):r+=`([^/]*)`:r+=`.*`;break;default:r+=c}return(!s||!~s.indexOf(`g`))&&(r=`^`+r+`$`),new RegExp(r,s)}var xl=class{constructor(e,t,n){this.folderUri=t,this.uris=n,this.globWrappers=[];try{for(let t of e){let e=t[0]!==`!`;e||(t=t.substring(1)),t.length>0&&(t[0]===`/`&&(t=t.substring(1)),this.globWrappers.push({regexp:bl(`**/`+t,{extended:!0,globstar:!0}),include:e}))}t&&(t=Ol(t),t.endsWith(`/`)||(t+=`/`),this.folderUri=t)}catch{this.globWrappers.length=0,this.uris=[]}}matchesPattern(e){if(this.folderUri&&!e.startsWith(this.folderUri))return!1;let t=!1;for(let{regexp:n,include:r}of this.globWrappers)n.test(e)&&(t=r);return t}getURIs(){return this.uris}},Sl=class{constructor(e,t,n){this.service=e,this.uri=t,this.dependencies=new Set,this.anchors=void 0,n&&(this.unresolvedSchema=this.service.promise.resolve(new Cl(n)))}getUnresolvedSchema(){return this.unresolvedSchema||=this.service.loadSchema(this.uri),this.unresolvedSchema}getResolvedSchema(){return this.resolvedSchema||=this.getUnresolvedSchema().then(e=>this.service.resolveSchemaContent(e,this)),this.resolvedSchema}clearSchema(){let e=!!this.unresolvedSchema;return this.resolvedSchema=void 0,this.unresolvedSchema=void 0,this.dependencies.clear(),this.anchors=void 0,e}},Cl=class{constructor(e,t=[]){this.schema=e,this.errors=t}},wl=class{constructor(e,t=[],n=[],r){this.schema=e,this.errors=t,this.warnings=n,this.schemaDraft=r}getSection(e){let t=this.getSectionRecursive(e,this.schema);if(t)return Y(t)}getSectionRecursive(e,t){if(!t||typeof t==`boolean`||e.length===0)return t;let n=e.shift();if(t.properties&&typeof t.properties[n])return this.getSectionRecursive(e,t.properties[n]);if(t.patternProperties){for(let r of Object.keys(t.patternProperties))if(ts(r)?.test(n))return this.getSectionRecursive(e,t.patternProperties[r])}else if(typeof t.additionalProperties==`object`)return this.getSectionRecursive(e,t.additionalProperties);else if(n.match(`[0-9]+`)){if(Array.isArray(t.items)){let r=parseInt(n,10);if(!isNaN(r)&&t.items[r])return this.getSectionRecursive(e,t.items[r])}else if(t.items)return this.getSectionRecursive(e,t.items)}}},Tl=class{constructor(e,t,n){this.contextService=t,this.requestService=e,this.promiseConstructor=n||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations=[],this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={}}getRegisteredSchemaIds(e){return Object.keys(this.registeredSchemasIds).filter(t=>{let n=vl.parse(t).scheme;return n!==`schemaservice`&&(!e||e(n))})}get promise(){return this.promiseConstructor}dispose(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()}onResourceChange(e){this.cachedSchemaForResource=void 0;let t=!1;e=Dl(e);let n=[e],r=Object.keys(this.schemasById).map(e=>this.schemasById[e]);for(;n.length;){let e=n.pop();for(let i=0;i<r.length;i++){let a=r[i];a&&(a.uri===e||a.dependencies.has(e))&&(a.uri!==e&&n.push(a.uri),a.clearSchema()&&(t=!0),r[i]=void 0)}}return t}setSchemaContributions(e){if(e.schemas){let t=e.schemas;for(let e in t){let n=Dl(e);this.contributionSchemas[n]=this.addSchemaHandle(n,t[e])}}if(Array.isArray(e.schemaAssociations)){let t=e.schemaAssociations;for(let e of t){let t=e.uris.map(Dl),n=this.addFilePatternAssociation(e.pattern,e.folderUri,t);this.contributionAssociations.push(n)}}}addSchemaHandle(e,t){let n=new Sl(this,e,t);return this.schemasById[e]=n,n}getOrAddSchemaHandle(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)}addFilePatternAssociation(e,t,n){let r=new xl(e,t,n);return this.filePatternAssociations.push(r),r}registerExternalSchema(e){let t=Dl(e.uri);return this.registeredSchemasIds[t]=!0,this.cachedSchemaForResource=void 0,e.fileMatch&&e.fileMatch.length&&this.addFilePatternAssociation(e.fileMatch,e.folderUri,[t]),e.schema?this.addSchemaHandle(t,e.schema):this.getOrAddSchemaHandle(t)}clearExternalSchemas(){this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={},this.cachedSchemaForResource=void 0;for(let e in this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(let e of this.contributionAssociations)this.filePatternAssociations.push(e)}getResolvedSchema(e){let t=Dl(e),n=this.schemasById[t];return n?n.getResolvedSchema():this.promise.resolve(void 0)}loadSchema(e){if(!this.requestService){let t=J(`Unable to load schema from '{0}'. No schema request service available`,kl(e));return this.promise.resolve(new Cl({},[t]))}return e.startsWith(`http://json-schema.org/`)&&(e=`https`+e.substring(4)),this.requestService(e).then(t=>{if(!t)return new Cl({},[J(`Unable to load schema from '{0}': No content.`,kl(e))]);let n=[];t.charCodeAt(0)===65279&&(n.push(J(`Problem reading content from '{0}': UTF-8 with BOM detected, only UTF 8 is allowed.`,kl(e))),t=t.trimStart());let r={},i=[];return r=Ho(t,i),i.length&&n.push(J(`Unable to parse content from '{0}': Parse error at offset {1}.`,kl(e),i[0].offset)),new Cl(r,n)},t=>{let n=t.toString(),r=t.toString().split(`Error: `);return r.length>1&&(n=r[1]),es(n,`.`)&&(n=n.substr(0,n.length-1)),new Cl({},[J(`Unable to load schema from '{0}': {1}.`,kl(e),n)])})}resolveSchemaContent(e,t){let n=e.errors.slice(0),r=e.schema,i=r.$schema?Dl(r.$schema):void 0;if(i===`http://json-schema.org/draft-03/schema`)return this.promise.resolve(new wl({},[J(`Draft-03 schemas are not supported.`)],[],i));let a=new Set,o=this.contextService,s=(e,t)=>{t=decodeURIComponent(t);let n=e;return t[0]===`/`&&(t=t.substring(1)),t.split(`/`).some(e=>(e=e.replace(/~1/g,`/`).replace(/~0/g,`~`),n=n[e],!n)),n},c=(e,t,n)=>(t.anchors||=p(e),t.anchors.get(n)),l=(e,t)=>{for(let n in t)t.hasOwnProperty(n)&&n!==`id`&&n!==`$id`&&(e[n]=t[n])},u=(e,t,r,i)=>{let a;a=i===void 0||i.length===0?t:i.charAt(0)===`/`?s(t,i):c(t,r,i),a?l(e,a):n.push(J(`$ref '{0}' in '{1}' can not be resolved.`,i||``,r.uri))},d=(e,t,r,i)=>{o&&!/^[A-Za-z][A-Za-z0-9+\-.+]*:\/\/.*/.test(t)&&(t=o.resolveRelativePath(t,i.uri)),t=Dl(t);let a=this.getOrAddSchemaHandle(t);return a.getUnresolvedSchema().then(o=>{if(i.dependencies.add(t),o.errors.length){let e=r?t+`#`+r:t;n.push(J(`Problems loading reference '{0}': {1}`,e,o.errors[0]))}return u(e,o.schema,a,r),f(e,o.schema,a)})},f=(e,t,n)=>{let r=[];return this.traverseNodes(e,e=>{let i=new Set;for(;e.$ref;){let a=e.$ref,o=a.split(`#`,2);if(delete e.$ref,o[0].length>0){r.push(d(e,o[0],o[1],n));return}else if(!i.has(a)){let r=o[1];u(e,t,n,r),i.add(a)}}e.$recursiveRef&&a.add(`$recursiveRef`),e.$dynamicRef&&a.add(`$dynamicRef`)}),this.promise.all(r)},p=e=>{let t=new Map;return this.traverseNodes(e,e=>{let r=e.$id||e.id,i=Zo(r)&&r.charAt(0)===`#`?r.substring(1):e.$anchor;i&&(t.has(i)?n.push(J(`Duplicate anchor declaration: '{0}'`,i)):t.set(i,e)),e.$recursiveAnchor&&a.add(`$recursiveAnchor`),e.$dynamicAnchor&&a.add(`$dynamicAnchor`)}),t};return f(r,r,t).then(e=>{let t=[];return a.size&&t.push(J(`The schema uses meta-schema features ({0}) that are not yet supported by the validator.`,Array.from(a.keys()).join(`, `))),new wl(r,n,t,i)})}traverseNodes(e,t){if(!e||typeof e!=`object`)return Promise.resolve(null);let n=new Set,r=(...e)=>{for(let t of e)Qo(t)&&s.push(t)},i=(...e)=>{for(let t of e)if(Qo(t))for(let e in t){let n=t[e];Qo(n)&&s.push(n)}},a=(...e)=>{for(let t of e)if(Array.isArray(t))for(let e of t)Qo(e)&&s.push(e)},o=e=>{if(Array.isArray(e))for(let t of e)Qo(t)&&s.push(t);else Qo(e)&&s.push(e)},s=[e],c=s.pop();for(;c;)n.has(c)||(n.add(c),t(c),r(c.additionalItems,c.additionalProperties,c.not,c.contains,c.propertyNames,c.if,c.then,c.else,c.unevaluatedItems,c.unevaluatedProperties),i(c.definitions,c.$defs,c.properties,c.patternProperties,c.dependencies,c.dependentSchemas),a(c.anyOf,c.allOf,c.oneOf,c.prefixItems),o(c.items)),c=s.pop()}getSchemaFromProperty(e,t){if(t.root?.type===`object`){for(let n of t.root.properties)if(n.keyNode.value===`$schema`&&n.valueNode?.type===`string`){let t=n.valueNode.value;return this.contextService&&!/^\w[\w\d+.-]*:/.test(t)&&(t=this.contextService.resolveRelativePath(t,e)),t}}}getAssociatedSchemas(e){let t=Object.create(null),n=[],r=Ol(e);for(let e of this.filePatternAssociations)if(e.matchesPattern(r))for(let r of e.getURIs())t[r]||(n.push(r),t[r]=!0);return n}getSchemaURIsForResource(e,t){let n=t&&this.getSchemaFromProperty(e,t);return n?[n]:this.getAssociatedSchemas(e)}getSchemaForResource(e,t){if(t){let n=this.getSchemaFromProperty(e,t);if(n){let e=Dl(n);return this.getOrAddSchemaHandle(e).getResolvedSchema()}}if(this.cachedSchemaForResource&&this.cachedSchemaForResource.resource===e)return this.cachedSchemaForResource.resolvedSchema;let n=this.getAssociatedSchemas(e),r=n.length>0?this.createCombinedSchema(e,n).getResolvedSchema():this.promise.resolve(void 0);return this.cachedSchemaForResource={resource:e,resolvedSchema:r},r}createCombinedSchema(e,t){if(t.length===1)return this.getOrAddSchemaHandle(t[0]);{let n=`schemaservice://combinedSchema/`+encodeURIComponent(e),r={allOf:t.map(e=>({$ref:e}))};return this.addSchemaHandle(n,r)}}getMatchingSchemas(e,t,n){if(n){let e=n.id||`schemaservice://untitled/matchingSchemas/`+El++;return this.addSchemaHandle(e,n).getResolvedSchema().then(e=>t.getMatchingSchemas(e.schema).filter(e=>!e.inverted))}return this.getSchemaForResource(e.uri,t).then(e=>e?t.getMatchingSchemas(e.schema).filter(e=>!e.inverted):[])}};let El=0;function Dl(e){try{return vl.parse(e).toString(!0)}catch{return e}}function Ol(e){try{return vl.parse(e).with({fragment:null,query:null}).toString(!0)}catch{return e}}function kl(e){try{let t=vl.parse(e);if(t.scheme===`file`)return t.fsPath}catch{}return e}function Al(e,t){let n=[],r=[],i=[],a=-1,o=zo(e.getText(),!1),s=o.scan();function c(e){n.push(e),r.push(i.length)}for(;s!==17;){switch(s){case 1:case 3:{let t=e.positionAt(o.getTokenOffset()).line,n={startLine:t,endLine:t,kind:s===1?`object`:`array`};i.push(n);break}case 2:case 4:{let t=s===2?`object`:`array`;if(i.length>0&&i[i.length-1].kind===t){let t=i.pop(),n=e.positionAt(o.getTokenOffset()).line;t&&n>t.startLine+1&&a!==t.startLine&&(t.endLine=n-1,c(t),a=t.startLine)}break}case 13:{let t=e.positionAt(o.getTokenOffset()).line,n=e.positionAt(o.getTokenOffset()+o.getTokenLength()).line;o.getTokenError()===1&&t+1<e.lineCount?o.setPosition(e.offsetAt(V.create(t+1,0))):t<n&&(c({startLine:t,endLine:n,kind:fs.Comment}),a=t);break}case 12:{let t=e.getText().substr(o.getTokenOffset(),o.getTokenLength()).match(/^\/\/\s*#(region\b)|(endregion\b)/);if(t){let n=e.positionAt(o.getTokenOffset()).line;if(t[1]){let e={startLine:n,endLine:n,kind:fs.Region};i.push(e)}else{let e=i.length-1;for(;e>=0&&i[e].kind!==fs.Region;)e--;if(e>=0){let t=i[e];i.length=e,n>t.startLine&&a!==t.startLine&&(t.endLine=n,c(t),a=t.startLine)}}}break}}s=o.scan()}let l=t&&t.rangeLimit;if(typeof l!=`number`||n.length<=l)return n;t&&t.onRangeLimitExceeded&&t.onRangeLimitExceeded(e.uri);let u=[];for(let e of r)e<30&&(u[e]=(u[e]||0)+1);let d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t){if(t+d>l){f=e;break}d+=t}}let p=[];for(let e=0;e<n.length;e++){let t=r[e];typeof t==`number`&&(t<f||t===f&&d++<l)&&p.push(n[e])}return p}function jl(e,t,n){function r(t){let r=e.offsetAt(t),a=n.getNodeFromOffset(r,!0),s=[];for(;a;){switch(a.type){case`string`:case`object`:case`array`:let e=a.offset+1,t=a.offset+a.length-1;e<t&&r>=e&&r<=t&&s.push(i(e,t)),s.push(i(a.offset,a.offset+a.length));break;case`number`:case`boolean`:case`null`:case`property`:s.push(i(a.offset,a.offset+a.length));break}if(a.type===`property`||a.parent&&a.parent.type===`array`){let e=o(a.offset+a.length,5);e!==-1&&s.push(i(a.offset,e))}a=a.parent}let c;for(let e=s.length-1;e>=0;e--)c=ic.create(s[e],c);return c||=ic.create(H.create(t,t)),c}function i(t,n){return H.create(e.positionAt(t),e.positionAt(n))}let a=zo(e.getText(),!0);function o(e,t){return a.setPosition(e),a.scan()===t?a.getTokenOffset()+a.getTokenLength():-1}return t.map(r)}function Ml(e,t,n){let r;if(n){let t=e.offsetAt(n.start);r={offset:t,length:e.offsetAt(n.end)-t}}let i={tabSize:t?t.tabSize:4,insertSpaces:t?.insertSpaces===!0,insertFinalNewline:t?.insertFinalNewline===!0,eol:`
|
|
58
58
|
`,keepLines:t?.keepLines===!0};return qo(e.getText(),r,i).map(t=>ys.replace(H.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length)),t.content))}var $;(function(e){e[e.Object=0]=`Object`,e[e.Array=1]=`Array`})($||={});var Nl=class{constructor(e,t){this.propertyName=e??``,this.beginningLineNumber=t,this.childrenProperties=[],this.lastProperty=!1,this.noKeyName=!1}addChildProperty(e){if(e.parent=this,this.childrenProperties.length>0){let t=0;t=e.noKeyName?this.childrenProperties.length:Fl(this.childrenProperties,e,Pl),t<0&&(t=t*-1-1),this.childrenProperties.splice(t,0,e)}else this.childrenProperties.push(e);return e}};function Pl(e,t){let n=e.propertyName.toLowerCase(),r=t.propertyName.toLowerCase();return n<r?-1:+(n>r)}function Fl(e,t,n){let r=t.propertyName.toLowerCase(),i=e[0].propertyName.toLowerCase(),a=e[e.length-1].propertyName.toLowerCase();if(r<i)return 0;if(r>a)return e.length;let o=0,s=e.length-1;for(;o<=s;){let r=s+o>>1,i=n(t,e[r]);if(i>0)o=r+1;else if(i<0)s=r-1;else return r}return-o-1}function Il(e,t){let n={...t,keepLines:!1},r=Tc.applyEdits(e,Ml(e,n,void 0)),i=Tc.create(`test://test.json`,`json`,0,r),a=Rl(i,Ll(i)),o=Ml(a,n,void 0),s=Tc.applyEdits(a,o);return[ys.replace(H.create(V.create(0,0),e.positionAt(e.getText().length)),s)]}function Ll(e){let t=zo(e.getText(),!1),n=new Nl,r=n,i=n,a=n,o,s=0,c=0,l,u,d=-1,f=-1,p=0,m=0,h=[],g=!1,_=!1;for(;(o=t.scan())!==17;){if(g===!0&&o!==14&&o!==15&&o!==12&&o!==13&&i.endLineNumber===void 0){let e=t.getTokenStartLine();u===2||u===4?a.endLineNumber=e-1:i.endLineNumber=e-1,p=e,g=!1}if(_===!0&&o!==14&&o!==15&&o!==12&&o!==13&&(p=t.getTokenStartLine(),_=!1),t.getTokenStartLine()!==s){for(let n=s;n<t.getTokenStartLine();n++){let t=e.getText(H.create(V.create(n,0),V.create(n+1,0))).length;c+=t}s=t.getTokenStartLine()}switch(o){case 10:if(l===void 0||l===1||l===5&&h[h.length-1]===$.Object){let e=new Nl(t.getTokenValue(),p);a=i,i=r.addChildProperty(e)}break;case 3:if(n.beginningLineNumber===void 0&&(n.beginningLineNumber=t.getTokenStartLine()),h[h.length-1]===$.Object)r=i;else if(h[h.length-1]===$.Array){let e=new Nl(t.getTokenValue(),p);e.noKeyName=!0,a=i,i=r.addChildProperty(e),r=i}h.push($.Array),i.type=$.Array,p=t.getTokenStartLine(),p++;break;case 1:if(n.beginningLineNumber===void 0)n.beginningLineNumber=t.getTokenStartLine();else if(h[h.length-1]===$.Array){let e=new Nl(t.getTokenValue(),p);e.noKeyName=!0,a=i,i=r.addChildProperty(e)}i.type=$.Object,h.push($.Object),r=i,p=t.getTokenStartLine(),p++;break;case 4:m=t.getTokenStartLine(),h.pop(),i.endLineNumber===void 0&&(l===2||l===4)&&(i.endLineNumber=m-1,i.lastProperty=!0,i.lineWhereToAddComma=d,i.indexWhereToAddComa=f,a=i,i=i?i.parent:void 0,r=i),n.endLineNumber=m,p=m+1;break;case 2:m=t.getTokenStartLine(),h.pop(),l!==1&&(i.endLineNumber===void 0&&(i.endLineNumber=m-1,i.lastProperty=!0,i.lineWhereToAddComma=d,i.indexWhereToAddComa=f),a=i,i=i?i.parent:void 0,r=i),n.endLineNumber=t.getTokenStartLine(),p=m+1;break;case 5:m=t.getTokenStartLine(),i.endLineNumber===void 0&&(h[h.length-1]===$.Object||h[h.length-1]===$.Array&&(l===2||l===4))&&(i.endLineNumber=m,i.commaIndex=t.getTokenOffset()-c,i.commaLine=m),(l===2||l===4)&&(a=i,i=i?i.parent:void 0,r=i),p=m+1;break;case 13:l===5&&d===t.getTokenStartLine()&&(h[h.length-1]===$.Array&&(u===2||u===4)||h[h.length-1]===$.Object)&&(h[h.length-1]===$.Array&&(u===2||u===4)||h[h.length-1]===$.Object)&&(i.endLineNumber=void 0,g=!0),(l===1||l===3)&&d===t.getTokenStartLine()&&(_=!0);break}o!==14&&o!==13&&o!==12&&o!==15&&(u=l,l=o,d=t.getTokenStartLine(),f=t.getTokenOffset()+t.getTokenLength()-c)}return n}function Rl(e,t){if(t.childrenProperties.length===0)return e;let n=Tc.create(`test://test.json`,`json`,0,e.getText()),r=[];for(zl(r,t,t.beginningLineNumber);r.length>0;){let t=r.shift(),i=t.propertyTreeArray,a=t.beginningLineNumber;for(let t=0;t<i.length;t++){let o=i[t],s=H.create(V.create(o.beginningLineNumber,0),V.create(o.endLineNumber+1,0)),c=e.getText(s),l=Tc.create(`test://test.json`,`json`,0,c);if(o.lastProperty===!0&&t!==i.length-1){let e=o.lineWhereToAddComma-o.beginningLineNumber,t=o.indexWhereToAddComa,n={range:H.create(V.create(e,t),V.create(e,t)),text:`,`};Tc.update(l,[n],1)}else if(o.lastProperty===!1&&t===i.length-1){let e=o.commaIndex,t=o.commaLine-o.beginningLineNumber,n={range:H.create(V.create(t,e),V.create(t,e+1)),text:``};Tc.update(l,[n],1)}let u=o.endLineNumber-o.beginningLineNumber+1,d={range:H.create(V.create(a,0),V.create(a+u,0)),text:l.getText()};Tc.update(n,[d],1),zl(r,o,a),a+=u}}return n}function zl(e,t,n){if(t.childrenProperties.length!==0)if(t.type===$.Object){let r=1/0;for(let e of t.childrenProperties)e.beginningLineNumber<r&&(r=e.beginningLineNumber);let i=r-t.beginningLineNumber;n+=i,e.push(new Vl(n,t.childrenProperties))}else t.type===$.Array&&Bl(e,t,n)}function Bl(e,t,n){for(let r of t.childrenProperties){if(r.type===$.Object){let i=1/0;for(let e of r.childrenProperties)e.beginningLineNumber<i&&(i=e.beginningLineNumber);let a=i-r.beginningLineNumber;e.push(new Vl(n+r.beginningLineNumber-t.beginningLineNumber+a,r.childrenProperties))}r.type===$.Array&&Bl(e,r,n+r.beginningLineNumber-t.beginningLineNumber)}}var Vl=class{constructor(e,t){this.beginningLineNumber=e,this.propertyTreeArray=t}};function Hl(e,t){let n=[];return t.visit(r=>{if(r.type===`property`&&r.keyNode.value===`$ref`&&r.valueNode?.type===`string`){let i=r.valueNode.value,a=Wl(t,i);if(a){let t=e.positionAt(a.offset);n.push({target:`${e.uri}#${t.line+1},${t.character+1}`,range:Ul(e,r.valueNode)})}}return!0}),Promise.resolve(n)}function Ul(e,t){return H.create(e.positionAt(t.offset+1),e.positionAt(t.offset+t.length-1))}function Wl(e,t){let n=Kl(t);return n?Gl(n,e.root):null}function Gl(e,t){if(!t)return null;if(e.length===0)return t;let n=e.shift();if(t&&t.type===`object`){let r=t.properties.find(e=>e.keyNode.value===n);return r?Gl(e,r.valueNode):null}else if(t&&t.type===`array`&&n.match(/^(0|[1-9][0-9]*)$/)){let r=Number.parseInt(n),i=t.items[r];return i?Gl(e,i):null}return null}function Kl(e){return e===`#`?[]:e[0]!==`#`||e[1]!==`/`?null:e.substring(2).split(/\//).map(ql)}function ql(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Jl(e){let t=e.promiseConstructor||Promise,n=new Tl(e.schemaRequestService,e.workspaceContext,t);n.setSchemaContributions(hl);let r=new nl(n,e.contributions,t,e.clientCapabilities),i=new rl(n,e.contributions,t),a=new fl(n),o=new ol(n,t);return{configure:e=>{n.clearExternalSchemas(),e.schemas?.forEach(n.registerExternalSchema.bind(n)),o.configure(e)},resetSchema:e=>n.onResourceChange(e),doValidation:o.doValidation.bind(o),getLanguageStatus:o.getLanguageStatus.bind(o),parseJSONDocument:e=>el(e,{collectComments:!0}),newJSONDocument:(e,t)=>Jc(e,t),getMatchingSchemas:n.getMatchingSchemas.bind(n),doResolve:r.doResolve.bind(r),doComplete:r.doComplete.bind(r),findDocumentSymbols:a.findDocumentSymbols.bind(a),findDocumentSymbols2:a.findDocumentSymbols2.bind(a),findDocumentColors:a.findDocumentColors.bind(a),getColorPresentations:a.getColorPresentations.bind(a),doHover:i.doHover.bind(i),getFoldingRanges:Al,getSelectionRanges:jl,findDefinition:()=>Promise.resolve([]),findLinks:Hl,format:(e,t,n)=>Ml(e,n,t),sort:(e,t)=>Il(e,t)}}let Yl;typeof fetch<`u`&&(Yl=function(e){return fetch(e).then(e=>e.text())});var Xl=class{constructor(e,t){this._ctx=e,this._languageSettings=t.languageSettings,this._languageId=t.languageId,this._languageService=Jl({workspaceContext:{resolveRelativePath:(e,t)=>Ql(t.substr(0,t.lastIndexOf(`/`)+1),e)},schemaRequestService:t.enableSchemaRequest?Yl:void 0,clientCapabilities:jc.LATEST}),this._languageService.configure(this._languageSettings)}async doValidation(e){let t=this._getTextDocument(e);if(t){let e=this._languageService.parseJSONDocument(t);return this._languageService.doValidation(t,e,this._languageSettings)}return Promise.resolve([])}async doComplete(e,t){let n=this._getTextDocument(e);if(!n)return null;let r=this._languageService.parseJSONDocument(n);return this._languageService.doComplete(n,t,r)}async doResolve(e){return this._languageService.doResolve(e)}async doHover(e,t){let n=this._getTextDocument(e);if(!n)return null;let r=this._languageService.parseJSONDocument(n);return this._languageService.doHover(n,t,r)}async format(e,t,n){let r=this._getTextDocument(e);if(!r)return[];let i=this._languageService.format(r,t,n);return Promise.resolve(i)}async resetSchema(e){return Promise.resolve(this._languageService.resetSchema(e))}async findDocumentSymbols(e){let t=this._getTextDocument(e);if(!t)return[];let n=this._languageService.parseJSONDocument(t),r=this._languageService.findDocumentSymbols2(t,n);return Promise.resolve(r)}async findDocumentColors(e){let t=this._getTextDocument(e);if(!t)return[];let n=this._languageService.parseJSONDocument(t),r=this._languageService.findDocumentColors(t,n);return Promise.resolve(r)}async getColorPresentations(e,t,n){let r=this._getTextDocument(e);if(!r)return[];let i=this._languageService.parseJSONDocument(r),a=this._languageService.getColorPresentations(r,i,t,n);return Promise.resolve(a)}async getFoldingRanges(e,t){let n=this._getTextDocument(e);if(!n)return[];let r=this._languageService.getFoldingRanges(n,t);return Promise.resolve(r)}async getSelectionRanges(e,t){let n=this._getTextDocument(e);if(!n)return[];let r=this._languageService.parseJSONDocument(n),i=this._languageService.getSelectionRanges(n,t,r);return Promise.resolve(i)}async parseJSONDocument(e){let t=this._getTextDocument(e);if(!t)return null;let n=this._languageService.parseJSONDocument(t);return Promise.resolve(n)}async getMatchingSchemas(e){let t=this._getTextDocument(e);if(!t)return[];let n=this._languageService.parseJSONDocument(t);return Promise.resolve(this._languageService.getMatchingSchemas(t,n))}_getTextDocument(e){let t=this._ctx.getMirrorModels();for(let n of t)if(n.uri.toString()===e)return Tc.create(e,this._languageId,n.version,n.getValue());return null}};function Zl(e){return e.charCodeAt(0)===47}function Ql(e,t){if(Zl(t)){let n=vl.parse(e),r=t.split(`/`);return n.with({path:$l(r)}).toString()}return eu(e,t)}function $l(e){let t=[];for(let n of e)n.length===0||n.length===1&&n.charCodeAt(0)===46||(n.length===2&&n.charCodeAt(0)===46&&n.charCodeAt(1)===46?t.pop():t.push(n));e.length>1&&e[e.length-1].length===0&&t.push(``);let n=t.join(`/`);return e[0].length===0&&(n=`/`+n),n}function eu(e,...t){let n=vl.parse(e),r=n.path.split(`/`);for(let e of t)r.push(...e.split(`/`));return n.with({path:$l(r)}).toString()}self.onmessage=()=>{yo((e,t)=>new Xl(e,t))}})();
|