@dbt-tools/web 0.4.2 → 0.4.3
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.
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./rolldown-runtime-Dw2cE7zH.js";import{i as r,n as i,r as a,t as o}from"./react-vendor-DL38pS2M.js";import{t as s}from"./tanstack-virtual-vendor-DdCr1qam.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=t(r(),1),l=i(),u=o();function d({message:e}){return(0,u.jsx)(`div`,{className:`error-banner`,children:e})}var f=typeof window<`u`?new URLSearchParams(window.location.search).get(`debug`)===`1`:!1;function p(...e){f&&console.log(`[dbt-tools]`,...e)}function m(e){!f||typeof performance>`u`||performance.mark(e)}function h(e,t,n){if(!f||typeof performance>`u`)return;performance.measure(e,t,n);let r=performance.getEntriesByName(e,`measure`),i=r[r.length-1];i&&p(`${e}: ${i.duration.toFixed(1)}ms`)}var g=`Unexpected analysis worker response`,_=`Unexpected resource-code worker response`,v=`Unexpected search-resources worker response`,y=`search-resources`,b=class{worker;requestId=0;pending=new Map;constructor(){this.worker=new Worker(new URL(`/assets/analysis.worker-DCy3HfXU.js`,``+import.meta.url),{type:`module`}),this.worker.onmessage=e=>{this.handleMessage(e.data)},this.worker.onerror=e=>{let t=e.message||`Analysis worker failed`;for(let e of this.pending.values())e.reject(Error(t));this.pending.clear()}}async loadAnalysis(e,t,n){let r=this.requestId+1;this.requestId=r;let i=`analysis-load:${r}:dispatch`,a=`analysis-load:${r}:ready`,o=`analysis-load:${r}:analysis-ready`;m(i);let s={type:`load-analysis`,protocolVersion:2,requestId:r,manifestBytes:e,runResultsBytes:t,source:n},c=new Promise((e,t)=>{this.pending.set(r,{kind:`load`,resolve:e,reject:t,source:n})});return this.worker.postMessage(s,[e,t]),c.then(e=>(m(a),h(o,i,a),p(`Analysis worker ready`,{requestId:r,source:n,timings:e.metrics.timings}),{...e,metrics:{...e.metrics,dispatchMarkName:i,readyMarkName:a,analysisReadyMeasureName:o}}))}async requestResourceCode(e){let t=this.requestId+1;this.requestId=t;let n={type:`get-resource-code`,protocolVersion:2,requestId:t,uniqueId:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:`resource-code`,resolve:e,reject:n})});return this.worker.postMessage(n),r}async searchResources(e){let t=this.requestId+1;this.requestId=t;let n={type:y,protocolVersion:2,requestId:t,query:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:y,resolve:e,reject:n})});return this.worker.postMessage(n),r}terminate(){this.worker.terminate();for(let e of this.pending.values())e.reject(Error(`Analysis worker terminated`));this.pending.clear()}handleMessage(e){let t=this.pending.get(e.requestId);if(t){if(this.pending.delete(e.requestId),t.kind===`load`){if(e.type===`analysis-error`){t.reject(Error(e.message));return}if(e.type===`analysis-ready`){t.resolve({analysis:e.analysis,metrics:{requestId:e.requestId,source:t.source,dispatchMarkName:``,readyMarkName:``,analysisReadyMeasureName:``,timings:e.timings}});return}t.reject(Error(g));return}if(t.kind===`resource-code`){if(e.type===`resource-code-error`){t.reject(Error(e.message));return}if(e.type===`resource-code-ready`){t.resolve({compiledCode:e.compiledCode,rawCode:e.rawCode});return}t.reject(Error(_));return}if(t.kind===y){if(e.type===`search-resources-error`){t.reject(Error(e.message));return}if(e.type===`search-resources-ready`){t.resolve(e.resources);return}t.reject(Error(v))}}}},x=null;function S(){return x??=new b,x}async function C(e,t,n){return S().loadAnalysis(e,t,n)}async function w(e){return S().requestResourceCode(e)}async function T(e){return S().searchResources(e)}var E=8;function D(e,t){return!e||t.query.trim()?[]:t.recentResourceIds.map(t=>e.resources.find(e=>e.uniqueId===t)??null).filter(e=>e!=null).slice(0,E)}function O(e,t){let n=t.query.trim(),r=(0,c.useMemo)(()=>D(e,t),[e,t.query,t.recentResourceIds]),[i,a]=(0,c.useState)([]),[o,s]=(0,c.useState)(!1),l=(0,c.useRef)(0);return(0,c.useEffect)(()=>{if(!e||!n){l.current+=1,a([]),s(!1);return}l.current+=1;let r=l.current,i=!1;return a([]),s(!0),T(t.query).then(e=>{!i&&l.current===r&&(a(e),s(!1))}).catch(()=>{!i&&l.current===r&&(a([]),s(!1))}),()=>{i=!0}},[e,n,t.query]),n?{results:i,loading:o}:{results:r,loading:!1}}function k(e){return e===`preload`?`Live target`:e===`remote`?`Remote source`:e===`upload`?`Local upload`:`Waiting for artifacts`}function A(e){return e===`preload`?`DBT_TOOLS_TARGET_DIR`:e===`remote`?`REMOTE SOURCE`:e===`upload`?`UPLOADED`:`ARTIFACTS`}var ee=`/assets/app-logo-ByfNNtT8.svg`;function j({className:e,size:t,title:n,testId:r}){return(0,u.jsx)(`img`,{src:ee,alt:n??``,"aria-hidden":n?void 0:!0,className:e,style:t?{width:`${t}px`,height:`${t}px`}:void 0,"data-testid":r})}var M=[{id:`health`,view:`health`,label:`Health`},{id:`timeline`,view:`timeline`,label:`Timeline`},{id:`inventory`,view:`inventory`,label:`Inventory`},{id:`runs`,view:`runs`,label:`Runs`}],te=new Set([`health`,`inventory`,`runs`,`timeline`,`settings`,`overview`,`catalog`,`execution`,`quality`,`dependencies`,`search`]);function N(e){let t=new URLSearchParams(e).get(`view`);return t===`lineage`||t===`dependencies`}function P(e){switch(e){case`overview`:return`health`;case`catalog`:return`inventory`;case`execution`:case`quality`:return`runs`;case`dependencies`:case`lineage`:return`inventory`;case`search`:return`inventory`;case`runs`:case`timeline`:case`inventory`:case`health`:case`settings`:return e;default:return`health`}}function F(e){let t=new URLSearchParams(e),n=t.get(`view`);return n?n===`runs`&&t.get(`tab`)===`timeline`?`timeline`:n===`lineage`||n===`dependencies`?`inventory`:te.has(n)?P(n):null:null}function I(e){return new URLSearchParams(e).get(`resource`)}function ne(e){return new URLSearchParams(e).get(`selected`)}function re(e){let t=new URLSearchParams(e).get(`assetTab`);return t===`summary`||t===`lineage`||t===`sql`||t===`runtime`||t===`tests`?t:null}function ie(e){return re(e)??(N(e)?`lineage`:`summary`)}function ae(e){let t=new URLSearchParams(e).get(`kind`);return t===`all`||t===`models`||t===`tests`||t===`seeds`||t===`snapshots`||t===`operations`?t:null}function oe(e){let t=new URLSearchParams(e).get(`adapter`);if(t==null||t===``)return!0;let n=t.trim().toLowerCase();return!(n===`0`||n===`false`||n===`no`)}function se(e){let t=new URLSearchParams(e).get(`lens`);return t===`status`||t===`type`||t===`coverage`?t:null}function ce(e){let t=new URLSearchParams(e).get(`up`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function le(e){let t=new URLSearchParams(e).get(`down`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function ue(e){let t=new URLSearchParams(e).get(`allDeps`);return t===`1`?!0:t===`0`?!1:null}function de(e){return Math.max(0,Math.min(10,e))}function fe(e){let t=I(e),n=new URLSearchParams(e).get(`selected`),r=re(e),i=N(e)||r===`lineage`,a=ce(e),o=le(e),s=ue(e),c=se(e);return{rootResourceId:t,selectedResourceId:i?n??t:t,upstreamDepth:de(a??2),downstreamDepth:de(o??2),allDepsMode:s??!1,lensMode:c??`type`,activeLegendKeys:new Set}}var pe=`dbt-tools.sidebarCollapsed`;function me(e=!0){try{let e=window.localStorage.getItem(pe);if(e!==null)return e===`true`}catch{}return e}function he(e,t){return P(t)===e.view}function ge({id:e}){let t={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,width:20,height:20,"aria-hidden":!0};return e===`health`?(0,u.jsx)(`svg`,{...t,children:(0,u.jsx)(`polyline`,{points:`2,12 6,12 8,5 10,19 13,12 15,12 17,8 19,12 22,12`})}):e===`runs`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`rect`,{x:`3`,y:`4`,width:`3`,height:`16`,rx:`1`}),(0,u.jsx)(`rect`,{x:`9`,y:`8`,width:`3`,height:`12`,rx:`1`}),(0,u.jsx)(`rect`,{x:`15`,y:`6`,width:`3`,height:`14`,rx:`1`}),(0,u.jsx)(`rect`,{x:`21`,y:`10`,width:`0`,height:`0`}),(0,u.jsx)(`line`,{x1:`3`,y1:`20`,x2:`21`,y2:`20`})]}):e===`timeline`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M4 18V7`}),(0,u.jsx)(`path`,{d:`M10 18V11`}),(0,u.jsx)(`path`,{d:`M16 18V5`}),(0,u.jsx)(`path`,{d:`M2 18h20`}),(0,u.jsx)(`path`,{d:`M4 9h3M10 13h3M16 7h3`})]}):e===`inventory`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M2 7l10-4 10 4-10 4-10-4z`}),(0,u.jsx)(`path`,{d:`M2 12l10 4 10-4`}),(0,u.jsx)(`path`,{d:`M2 17l10 4 10-4`})]}):e===`settings`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,u.jsx)(`path`,{d:`M12 2.75v2.5`}),(0,u.jsx)(`path`,{d:`M12 18.75v2.5`}),(0,u.jsx)(`path`,{d:`M21.25 12h-2.5`}),(0,u.jsx)(`path`,{d:`M5.25 12h-2.5`}),(0,u.jsx)(`path`,{d:`M18.54 5.46l-1.77 1.77`}),(0,u.jsx)(`path`,{d:`M7.23 16.77l-1.77 1.77`}),(0,u.jsx)(`path`,{d:`M18.54 18.54l-1.77-1.77`}),(0,u.jsx)(`path`,{d:`M7.23 7.23L5.46 5.46`})]}):(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M4 7h16`}),(0,u.jsx)(`path`,{d:`M4 12h9`}),(0,u.jsx)(`path`,{d:`M4 17h13`})]})}var _e=`Waiting for artifacts`;function ve({activeView:e,setNavigationTarget:t,sidebarCollapsed:n,setSidebarCollapsed:r,onNavigate:i,analysis:a,analysisSource:o}){let s=k(o);return(0,u.jsxs)(`aside`,{id:`app-sidebar`,className:`app-sidebar${n?` app-sidebar--collapsed`:``}`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`app-sidebar__brand-link`,onClick:()=>{t({view:`health`}),i()},title:`Go to Health`,children:[(0,u.jsx)(j,{className:`app-logo app-logo--brand`}),!n&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`dbt-tools`}),(0,u.jsx)(`span`,{children:`Artifact operations console`})]})]}),(0,u.jsx)(`nav`,{className:`app-sidebar__nav`,"aria-label":`Workspace sections`,children:(0,u.jsx)(`div`,{className:`nav-group`,children:M.map(n=>{let r=!a;return(0,u.jsxs)(`button`,{type:`button`,className:he(n,e)?`sidebar-link sidebar-link--active`:`sidebar-link`,disabled:r,onClick:()=>{t(n),i()},"aria-label":n.label,title:n.label,children:[(0,u.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,u.jsx)(ge,{id:n.id})}),(0,u.jsx)(`div`,{className:`sidebar-link__body`,children:(0,u.jsx)(`strong`,{children:n.label})})]},n.id)})})}),(0,u.jsx)(`button`,{type:`button`,className:`sidebar-toggle`,onClick:()=>r(e=>!e),"aria-label":n?`Expand sidebar`:`Collapse sidebar`,children:n?`›`:`‹`}),(0,u.jsxs)(`div`,{className:`app-sidebar__footer`,children:[(0,u.jsxs)(`button`,{type:`button`,className:e===`settings`?`sidebar-link sidebar-link--active sidebar-settings-trigger`:`sidebar-link sidebar-settings-trigger`,onClick:()=>{t({view:`settings`}),i()},"aria-current":e===`settings`?`page`:void 0,"aria-label":`Open settings`,title:`Settings`,children:[(0,u.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,u.jsx)(ge,{id:`settings`})}),!n&&(0,u.jsx)(`div`,{className:`sidebar-link__body`,children:(0,u.jsx)(`strong`,{children:`Settings`})})]}),!n&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`sidebar-settings-divider`}),(0,u.jsxs)(`div`,{className:`app-sidebar__session`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Session`}),(0,u.jsx)(`strong`,{children:s}),(0,u.jsx)(`span`,{children:a?`${a.summary.total_nodes} executions analyzed`:_e})]})]})]})]})}function ye({pendingRemoteRun:e,acceptingRemoteRun:t,onAcceptPendingRemoteRun:n}){return e==null?null:(0,u.jsxs)(`section`,{className:`remote-update-banner`,"aria-label":`Remote update available`,children:[(0,u.jsxs)(`div`,{className:`remote-update-banner__copy`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Remote update available`}),(0,u.jsx)(`strong`,{children:e.label}),(0,u.jsx)(`span`,{children:`A newer complete remote artifact pair is ready. Keep the current investigation until you decide to switch.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`primary-action`,onClick:()=>void n(),disabled:t,children:t?`Switching…`:`Load latest remote run`})]})}function be(e){return e?e.fail+e.error+e.warn+e.skipped>0:!1}var L={accent:`#635BFF`,text:`#171C28`,textSoft:`#6B7385`,bg:`#F6F7FB`,bgSoft:`#FFFFFF`,borderDefault:`#D7DCE7`,borderSubtle:`#E6E9F0`,slate:`#64748B`,rose:`#C0352B`,mint:`#0F8A4B`,amber:`#A56315`},R={accent:`#8A7CFF`,text:`#F3F6FC`,textSoft:`#98A3BC`,bg:`#0D1120`,bgSoft:`#151A2E`,borderDefault:`#313A58`,borderSubtle:`#262E47`,slate:`#8690AA`,rose:`#FF8D86`,mint:`#59D38C`,amber:`#F5B95C`};function xe(e){return e===`dark`?R:L}var Se={success:L.mint,error:L.rose,skipped:L.slate,"run error":L.rose,pass:L.mint,fail:L.rose,warn:L.amber,"no op":L.slate},Ce={success:R.mint,error:R.rose,skipped:R.slate,"run error":R.rose,pass:R.mint,fail:R.rose,warn:R.amber,"no op":R.slate},we=`#059669`,Te=`#45c49a`,Ee=`rgba(100, 116, 139, 0.14)`,De=`rgba(134, 144, 170, 0.2)`,Oe=`rgba(5, 150, 105, 0.14)`,ke=`rgba(69, 196, 154, 0.2)`,Ae={model:`#1D4ED8`,test:`#64748B`,seed:`#635BFF`,snapshot:`#D97706`,source:we,source_freshness:we,exposure:`#EA580C`,metric:`#DB2777`,semantic_model:`#0891B2`,analysis:`#64748B`,unit_test:`#64748B`},je={model:`#5c8deb`,test:`#8690aa`,seed:`#9588e8`,snapshot:`#d4a24a`,source:Te,source_freshness:Te,exposure:`#d9845c`,metric:`#d172ae`,semantic_model:`#3eb0c8`,analysis:`#8690aa`,unit_test:`#8690aa`},Me={model:`rgba(29, 78, 216, 0.14)`,test:Ee,seed:`rgba(99, 91, 255, 0.14)`,snapshot:`rgba(217, 119, 6, 0.14)`,source:Oe,source_freshness:Oe,semantic_model:`rgba(8, 145, 178, 0.14)`,metric:`rgba(219, 39, 119, 0.14)`,exposure:`rgba(234, 88, 12, 0.14)`,analysis:Ee,unit_test:Ee},Ne={model:`rgba(92, 141, 235, 0.22)`,test:De,seed:`rgba(149, 136, 232, 0.22)`,snapshot:`rgba(212, 162, 74, 0.22)`,source:ke,source_freshness:ke,semantic_model:`rgba(62, 176, 200, 0.22)`,metric:`rgba(209, 114, 174, 0.22)`,exposure:`rgba(217, 132, 92, 0.22)`,analysis:De,unit_test:De};function Pe(e){return e===`dark`?je:Ae}function Fe(e){return e===`dark`?Ne:Me}function Ie(e,t){let n=Fe(t);return e&&n[e]?n[e]:t===`dark`?De:Ee}var Le={rowStripe:`#F1F3F8`,rowStripeHover:`#EEF0FF`,labelText:L.text,metaText:L.textSoft,axisTick:L.slate,gridLine:`#E6E9F0`,barHoverStroke:L.accent,testFailStripe:`rgba(192, 53, 43, 0.9)`,testSkipStripe:`rgba(165, 99, 21, 0.88)`,hullStroke:`#C8CEDB`,hullFill:`rgba(230, 233, 240, 0.35)`},Re={rowStripe:`#101527`,rowStripeHover:`#232845`,labelText:R.text,metaText:R.textSoft,axisTick:R.slate,gridLine:`#262E47`,barHoverStroke:R.accent,testFailStripe:`rgba(255, 141, 134, 0.88)`,testSkipStripe:`rgba(245, 185, 92, 0.88)`,hullStroke:`#2E3759`,hullFill:`rgba(38, 46, 71, 0.4)`};function ze(e){return e===`dark`?Re:Le}function Be(e){let t=xe(e);return{positive:t.mint,warning:t.amber,danger:t.rose,neutral:t.slate,skipped:t.accent}}var Ve=`workspace-pill workspace-pill--active`,He=`workspace-pill`,Ue=[{key:`model`,label:`Models`},{key:`source`,label:`Sources`},{key:`tests`,label:`Tests`},{key:`snapshot`,label:`Snapshots`},{key:`metric`,label:`Metrics`},{key:`semantic_model`,label:`Semantic models`}],We=new Set([`model`,`seed`,`snapshot`,`source`,`source_freshness`,`test`,`unit_test`,`metric`,`semantic_model`]),z=new Set([`test`,`unit_test`]),Ge=[...We].filter(e=>!z.has(e)).sort((e,t)=>e.localeCompare(t)),Ke=new Set([`model`,`seed`,`snapshot`,`source`]),qe={project:`Project`,database:`Database`};function Je(e){return e.statusTone===`danger`&&!z.has(e.resourceType)&&e.resourceType!==`operation`&&e.resourceType!==`sql_operation`}function Ye(e){return typeof e!=`number`||Number.isNaN(e)?`n/a`:e>=60?`${Math.floor(e/60)}m ${(e%60).toFixed(2).padStart(5,`0`)}s`:e>=10?`${e.toFixed(1)}s`:`${e.toFixed(2)}s`}function Xe(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Ze(e){return new Date(e).toLocaleString(`en-US`,{dateStyle:`medium`,timeStyle:`short`})}function Qe(e){return e.runStartedAt}function $e(e){return`tone-badge tone-badge--${e}`}function et(e){return tt(e.originalFilePath??e.patchPath??e.path)}function tt(e){if(!e)return null;let t=e.includes(`://`)?e.split(`://`)[1]??null:e;if(!t)return null;let n=t.split(`/`).map(e=>e.trim()).filter(Boolean).join(`/`);return n.length>0?n:null}function nt(e,t){if(!t)return!0;let n=t.trim().toLowerCase();return n?[e.name,e.resourceType,e.packageName,e.path??``,e.originalFilePath??``,e.patchPath??``,e.uniqueId].some(e=>e.toLowerCase().includes(n)):!0}function rt(e,t,n){return t===`all`?!0:t===`issues`?e.statusTone===`danger`?!0:be(n?.get(e.uniqueId)):e.statusTone===t}function it(e,t){return t.size===0||t.has(e.resourceType)}function at(e,t){if(!t)return!0;let n=t.trim().toLowerCase();return n?[e.name,e.resourceType,e.packageName,e.path??``,e.uniqueId,e.status,e.threadId??``].some(e=>e.toLowerCase().includes(n)):!0}function ot(e,t){return t===`all`?!0:t===`issues`?e.statusTone===`danger`||e.statusTone===`warning`:e.statusTone===t}function st(e){if(e.length===0)return null;let t={};for(let n of e)n.packageName&&(t[n.packageName]=(t[n.packageName]??0)+1);return Object.entries(t).sort((e,t)=>t[1]-e[1])[0]?.[0]??null}function ct(e,t){return t!=null&&e.packageName===t}function lt({name:e,packageName:t,path:n}){let r=e.toLowerCase(),i=t.toLowerCase(),a=(n??``).toLowerCase();return new Set([`dbt_artifacts_hashes`,`dbt_columns`,`dbt_exposures`,`dbt_groups`,`dbt_invocations`,`dbt_metrics`,`dbt_models`,`dbt_run_results`,`dbt_seeds`,`dbt_snapshots`,`dbt_source_freshness_results`,`dbt_sources`,`dbt_tests`,`elementary_test_results`,`job_run_results`,`locations`,`metadata`,`metricflow_time_spine`,`model_run_results`,`schema_columns_snapshot`,`seed_run_results`,`snapshot_run_results`,`test_result_rows`]).has(r)||r.startsWith(`dbt_`)||r.startsWith(`alerts_dbt_`)||a.includes(`/edr/`)||a.includes(`/dbt_artifacts/`)||a.includes(`/run_results/`)||a.includes(`/manifest/`)||a.includes(`/catalog/`)||i===`elementary`&&(r.includes(`dbt_`)||a.includes(`/edr/dbt_artifacts/`))}function ut(e){return new Set(e.filter(e=>e!==`macro`&&e!==`test`&&e!==`unit_test`))}function dt(e,t){return!We.has(e.resourceType)||z.has(e.resourceType)||lt(e)?!1:t==null?!0:e.packageName===t}function ft(e,t,n){return e.filter(e=>n&&!ot(e,t.status)||t.resourceTypes.size>0&&!t.resourceTypes.has(e.resourceType)?!1:at(e,t.query))}function pt(e,t){let n=t?.denominatorTotal??e.length,r=new Map;for(let t of e){let e=r.get(t.status)??{count:0,duration:0,tone:t.statusTone};e.count+=1,e.duration+=t.executionTime,r.set(t.status,e)}return[...r.entries()].map(([e,t])=>({status:e,count:t.count,duration:t.duration,share:n>0?t.count/n:0,tone:t.tone})).sort((e,t)=>t.count-e.count)}function mt(e,t){let n=new Map;for(let e of t)n.set(e.resourceType,(n.get(e.resourceType)??0)+1);let r=new Map;for(let t of e){let e=r.get(t.resourceType)??[];e.push(t),r.set(t.resourceType,e)}return[...r.entries()].map(([e,t])=>{let r=n.get(e)??0;return{resourceType:e,count:t.length,duration:t.reduce((e,t)=>e+t.executionTime,0),rowDenominatorCount:r,statusBreakdown:pt(t,{denominatorTotal:r})}}).sort((e,t)=>t.count-e.count)}function ht(e){let t=new Map;for(let n of e){let e=n.threadId??`unknown`,r=t.get(e)??{count:0,totalExecutionTime:0};r.count+=1,r.totalExecutionTime+=n.executionTime,t.set(e,r)}return[...t.entries()].map(([e,t])=>({threadId:e,count:t.count,totalExecutionTime:t.totalExecutionTime})).sort((e,t)=>t.totalExecutionTime-e.totalExecutionTime)}function gt(e,t){let n=ft(e.executions,t,!0),r=ft(e.executions,t,!1),i=n.filter(e=>z.has(e.resourceType)),a=ht(n);return{filteredExecutions:n,baselineExecutionsForBreakdown:r,filteredStatusBreakdown:pt(n),filteredThreadStats:a,filteredTypes:Array.from(new Set(n.map(e=>e.resourceType))).sort(),failingNodes:n.filter(e=>e.statusTone===`danger`).length,warningNodes:n.filter(e=>e.statusTone===`warning`).length,failedModels:n.filter(Je).length,passingTests:i.filter(e=>e.statusTone===`positive`).length,failingTests:i.filter(e=>e.statusTone===`danger`).length,threadCount:a.filter(e=>e.threadId!==`unknown`).length,filteredExecutionTime:n.reduce((e,t)=>e+t.executionTime,0),topFailures:n.filter(e=>e.statusTone===`danger`).slice(0,3),topBottlenecks:[...n].sort((e,t)=>t.executionTime-e.executionTime).slice(0,3)}}function _t({icon:e,headline:t,subtext:n}){return(0,u.jsxs)(`div`,{className:`empty-state-block`,children:[e!==void 0&&(0,u.jsx)(`span`,{className:`empty-state-block__icon`,"aria-hidden":`true`,children:e}),(0,u.jsx)(`strong`,{className:`empty-state-block__headline`,children:t}),n&&(0,u.jsx)(`p`,{className:`empty-state-block__subtext`,children:n})]})}function vt({label:e}){return(0,u.jsx)(`span`,{className:`overview-scope-badge`,children:e})}function yt({derived:e,title:t=`Bottlenecks`,subtitle:n=`Longest-running nodes in the filtered execution slice.`,embedded:r=!1}){let i=e.topBottlenecks;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--bottlenecks${r?` overview-module--embedded`:``}`,children:[!r&&(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:t}),(0,u.jsx)(`p`,{children:n})]}),i.length>0?(0,u.jsx)(`div`,{className:`action-list`,children:i.map((t,n)=>(0,u.jsxs)(`div`,{className:`action-list__row`,children:[(0,u.jsxs)(`div`,{className:`action-list__body`,children:[(0,u.jsx)(`strong`,{children:`${n+1}. ${t.name}`}),(0,u.jsx)(`span`,{children:`${(t.executionTime/Math.max(e.filteredExecutionTime,1e-4)*100).toFixed(1)}% of filtered run`})]}),(0,u.jsx)(`div`,{className:`action-list__metric`,children:(0,u.jsx)(`strong`,{children:Ye(t.executionTime)})})]},t.uniqueId))}):(0,u.jsx)(_t,{icon:`⚡`,headline:`No matching bottlenecks`,subtext:`No executions match the current dashboard filters.`})]})}function bt({analysis:e,filtered:t}){let n=e.summary.critical_path?.path.length??0;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--critical`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:`Critical path`}),(0,u.jsx)(`p`,{children:`Dependency pressure and scheduling risk.`})]}),t&&(0,u.jsx)(vt,{label:`Workspace-wide`})]}),(0,u.jsxs)(`div`,{className:`critical-path-card`,children:[(0,u.jsxs)(`div`,{className:`critical-path-card__headline`,children:[(0,u.jsxs)(`strong`,{children:[n,` nodes`]}),(0,u.jsx)(`span`,{children:e.graphSummary.hasCycles?`Cycles detected in the dependency graph.`:`No cycles detected in the dependency graph.`})]}),(0,u.jsxs)(`div`,{className:`critical-path-card__detail`,children:[(0,u.jsx)(`span`,{children:`Graph edges`}),(0,u.jsx)(`strong`,{children:e.graphSummary.totalEdges})]})]})]})}function xt({analysis:e,filtered:t}){let n=e.resources.filter(e=>!!e.description?.trim()).length,r=e.resources.length>0?Math.round(n/e.resources.length*100):0,i=Math.max(e.resources.length-n,0),a=e.resources.filter(e=>e.resourceType===`model`).length;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--coverage`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:`Coverage`}),(0,u.jsx)(`p`,{children:`Structural health of metadata and discovery quality.`})]}),t&&(0,u.jsx)(vt,{label:`Workspace-wide`})]}),(0,u.jsxs)(`div`,{className:`coverage-card`,children:[(0,u.jsxs)(`div`,{className:`coverage-card__headline`,children:[(0,u.jsxs)(`strong`,{children:[r,`%`]}),(0,u.jsx)(`span`,{children:`Metadata coverage`})]}),(0,u.jsxs)(`div`,{className:`coverage-card__stats`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{children:`Documented`}),(0,u.jsxs)(`strong`,{children:[n,` / `,e.resources.length]})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{children:`Missing descriptions`}),(0,u.jsx)(`strong`,{children:i})]})]}),(0,u.jsx)(`p`,{children:a>0?`Next improvement: document core models first to improve catalog-style discovery.`:`Add descriptions to core resources to improve catalog-style discovery.`})]})]})}var St=`data-theme`,Ct=`dark`,wt=`light`,Tt=`system`;function Et(e){if(e===Ct)return Ct;if(e===wt)return wt;try{return window.matchMedia(`(prefers-color-scheme: dark)`).matches?Ct:wt}catch{return wt}}function Dt(){return typeof document>`u`?`light`:document.documentElement.getAttribute(St)===Ct?Ct:`light`}function Ot(e){e(Dt());let t=new MutationObserver(()=>e(Dt()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:[St]}),()=>t.disconnect()}function kt(){let[e,t]=(0,c.useState)(()=>Dt());return(0,c.useEffect)(()=>(t(Dt()),Ot(t)),[]),e}function At(){let[e,t]=(0,c.useState)(()=>{try{let e=window.localStorage.getItem(`dbt-tools.theme`);if(e===wt||e===Ct||e===Tt)return e}catch{}return Tt}),[n,r]=(0,c.useState)(()=>Et(e));return(0,c.useEffect)(()=>{r(Et(e));try{window.localStorage.setItem(`dbt-tools.theme`,e)}catch{}},[e]),(0,c.useEffect)(()=>{document.documentElement.setAttribute(St,n)},[n]),{theme:n,themePreference:e,setThemePreference:t,toggleTheme:()=>t(e=>e===wt?Ct:e===Ct?wt:Ct)}}var jt=.08;function Mt(e){return[...e].sort((e,t)=>t.count-e.count)}var Nt=.999999999999,Pt=5e-4;function Ft(e,t=jt){return e>=t}function It(e){if(e>=Nt)return`100%`;let t=e*100;if(e<Pt)return`<0.1%`;let n=Math.round(t);if(n===100){let e=t.toFixed(1);return Number.parseFloat(e)>=100&&(e=t.toFixed(2)),`${e}%`}if(n===0&&e>0)return t<.1?`<0.1%`:`${t.toFixed(1)}%`;if(Math.abs(t-n)<1e-9)return`${n}%`;let r=t.toFixed(1);return Number.parseFloat(r)>=100&&e<Nt&&(r=t.toFixed(2)),`${r}%`}function Lt({title:e,subtitle:t,headerRight:n,children:r}){return(0,u.jsxs)(`section`,{className:`workspace-card`,children:[(0,u.jsxs)(`div`,{className:`workspace-card__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:e}),t&&(0,u.jsx)(`p`,{children:t})]}),n]}),r]})}function Rt({resourceType:e}){return(0,u.jsxs)(`span`,{className:`resource-type-badge`,children:[(0,u.jsx)(zt,{resourceType:e}),Xe(e)]})}function zt({resourceType:e}){switch(e){case`model`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`m8 2.2 4.8 2.7L8 7.6 3.2 4.9 8 2.2Z`}),(0,u.jsx)(`path`,{d:`m3.2 5 4.8 2.6L12.8 5M3.2 8l4.8 2.7 4.8-2.7M3.2 11l4.8 2.8 4.8-2.8`})]});case`source`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,u.jsx)(`path`,{d:`M3.4 4v5.3C3.4 10.7 5.5 12 8 12s4.6-1.3 4.6-2.7V4`}),(0,u.jsx)(`path`,{d:`M3.4 6.7C3.4 8 5.5 9.3 8 9.3s4.6-1.3 4.6-2.6`})]});case`test`:case`unit_test`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M8 2.2 12.6 4v3.8c0 2.6-1.7 5-4.6 5.8-2.9-.8-4.6-3.2-4.6-5.8V4L8 2.2Z`}),(0,u.jsx)(`path`,{d:`m5.6 7.9 1.5 1.5 3.3-3.3`})]});case`metric`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M2.5 11.8h11`}),(0,u.jsx)(`path`,{d:`M4.2 10.8V8.1M8 10.8V5.2m3.8 5.6V3.6`})]});case`semantic_model`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`rect`,{x:`2.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`rect`,{x:`9.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`rect`,{x:`5.9`,y:`9`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`path`,{d:`M6.6 5.1h2.8M8 7.2V9`})]});case`macro`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M5.2 3.3H3.4v9.4h1.8M10.8 3.3h1.8v9.4h-1.8`}),(0,u.jsx)(`path`,{d:`m9.6 5.1-3.2 5.8`})]});case`operation`:case`sql_operation`:return(0,u.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,u.jsx)(`path`,{d:`M9.8 2.9a3.2 3.2 0 1 1-1.1 6.2L4 13.8 2.2 12l4.7-4.7a3.2 3.2 0 0 1 2.9-4.4Z`})});default:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M4.3 2.8h5l2.4 2.4v7.9H4.3z`}),(0,u.jsx)(`path`,{d:`M9.3 2.8v2.4h2.4`}),(0,u.jsx)(`path`,{d:`M5.8 8h4.4M5.8 10.2h4.4`})]})}}function Bt({mode:e,depth:t}){return e===`database`&&t===0?(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,u.jsx)(`path`,{d:`M3.4 4v4.6C3.4 10 5.5 11.2 8 11.2s4.6-1.2 4.6-2.6V4`}),(0,u.jsx)(`path`,{d:`M3.4 6.4C3.4 7.8 5.5 9 8 9s4.6-1.2 4.6-2.6`})]}):(0,u.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,u.jsx)(`path`,{d:`M2.5 4.3h4.1l1.2 1.5H13a.9.9 0 0 1 .9.9v5a.9.9 0 0 1-.9.9H3a.9.9 0 0 1-.9-.9V5.2a.9.9 0 0 1 .4-.9Z`})})}function Vt({title:e,description:t,toolbar:n,leadingPane:r,children:i,inspector:a,className:o=``,suppressHeader:s=!1}){return(0,u.jsxs)(`div`,{className:`workspace-view workspace-scaffold ${o}`.trim(),children:[s?null:(0,u.jsx)(`div`,{className:`lens-header`,children:(0,u.jsxs)(`div`,{className:`lens-header__title`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,u.jsx)(`h2`,{children:e}),(0,u.jsx)(`p`,{className:`lens-header__desc`,children:t})]})}),n?(0,u.jsx)(`div`,{className:`workspace-scaffold__toolbar`,children:n}):null,(0,u.jsxs)(`div`,{className:`workspace-scaffold__body${r?` workspace-scaffold__body--with-leading`:``}${a?` workspace-scaffold__body--with-inspector`:``}`,children:[r?(0,u.jsx)(`aside`,{className:`workspace-scaffold__leading`,children:r}):null,(0,u.jsx)(`div`,{className:`workspace-scaffold__main`,children:i}),a?(0,u.jsx)(`aside`,{className:`workspace-scaffold__inspector`,children:a}):null]})]})}function Ht({actions:e}){return(0,u.jsx)(`div`,{className:`entity-inspector__actions`,children:e.map(e=>(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:e.onClick,disabled:e.disabled,children:e.label},e.label))})}function Ut({eyebrow:e,title:t,typeLabel:n,status:r,stats:i,sections:a,actions:o,emptyMessage:s}){return t?(0,u.jsxs)(`aside`,{className:`entity-inspector`,children:[e?(0,u.jsx)(`p`,{className:`eyebrow`,children:e}):null,(0,u.jsxs)(`div`,{className:`entity-inspector__header`,children:[n?(0,u.jsx)(`span`,{className:`entity-inspector__type-badge`,children:n}):null,r]}),(0,u.jsx)(`div`,{className:`entity-inspector__name`,children:(0,u.jsx)(`strong`,{children:t})}),i&&i.length>0?(0,u.jsx)(`dl`,{className:`entity-inspector__stats`,children:i.map(e=>(0,u.jsxs)(`div`,{className:`entity-inspector__stat`,children:[(0,u.jsx)(`dt`,{children:e.label}),(0,u.jsx)(`dd`,{children:e.value})]},e.label))}):null,a?.map(e=>(0,u.jsxs)(`div`,{className:`entity-inspector__section`,children:[(0,u.jsx)(`p`,{className:`entity-inspector__section-label`,children:e.label}),(0,u.jsx)(`div`,{className:`entity-inspector__mono`,children:e.value})]},e.label)),o&&o.length>0?(0,u.jsx)(Ht,{actions:o}):null]}):(0,u.jsx)(`aside`,{className:`entity-inspector entity-inspector--empty`,children:(0,u.jsx)(`p`,{className:`entity-inspector__placeholder`,children:s??`Select an item to inspect`})})}function Wt({group:e,statusColors:t}){let n=(0,c.useId)(),r=e.statusBreakdown.filter(e=>e.count>0),i=r.length>0?Mt(r):[],a=Xe(e.resourceType);return(0,u.jsxs)(`div`,{className:`exec-type-bar-row`,children:[(0,u.jsx)(`div`,{className:`exec-type-bar-row__label`,id:n,title:a,children:a}),(0,u.jsxs)(`div`,{className:`exec-type-bar-row__bars`,children:[(0,u.jsx)(`div`,{className:`exec-type-bar-track`,role:`group`,"aria-labelledby":n,children:r.map(n=>{let r=Ft(n.share),i=It(n.share),a=`${n.status}: ${n.count} runs (${i}) of ${e.rowDenominatorCount}`;return(0,u.jsx)(`div`,{className:n.share<.08?`exec-type-bar-segment exec-type-bar-segment--minor`:`exec-type-bar-segment`,style:{flex:`${n.count} 1 0%`,backgroundColor:t[n.tone]},title:a,"aria-label":a,children:r?(0,u.jsxs)(`span`,{className:`exec-type-bar-segment__inner`,children:[i,` (`,n.count,`)`]}):null},`${e.resourceType}-${n.status}`)})}),r.length>0?(0,u.jsx)(`ul`,{className:`exec-type-bar-row__breakdown`,"aria-label":`${a} status breakdown`,children:i.map(n=>{let r=It(n.share);return(0,u.jsxs)(`li`,{className:`exec-type-bar-row__breakdown-item`,children:[(0,u.jsx)(`span`,{className:`legend-row__swatch`,style:{background:t[n.tone]},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`exec-type-bar-row__breakdown-label`,children:n.status}),(0,u.jsxs)(`span`,{className:`exec-type-bar-row__breakdown-metric`,children:[n.count,` · `,r]})]},`${e.resourceType}-${n.status}-breakdown`)})}):null]})]})}function Gt({executions:e,executionsForShareDenominator:t}){let n=kt(),r=(0,c.useMemo)(()=>Be(n),[n]),i=(0,c.useMemo)(()=>mt(e,t),[e,t]);return i.length===0?(0,u.jsx)(`div`,{className:`empty-state`,children:`No execution data.`}):(0,u.jsx)(`div`,{className:`exec-type-bar-stack`,"data-testid":`exec-type-bar-stack`,children:i.map(e=>(0,u.jsx)(Wt,{group:e,statusColors:r},e.resourceType))})}function Kt({executions:e,executionsForShareDenominator:t}){return(0,u.jsx)(Gt,{executions:e,executionsForShareDenominator:t})}function qt({graphSummary:e}){let t=Object.entries(e.nodesByType).sort((e,t)=>t[1]-e[1]);return t.length===0?(0,u.jsx)(`div`,{className:`empty-state`,children:`No node-type breakdown available.`}):(0,u.jsx)(`div`,{className:`rank-list`,children:t.map(([t,n])=>(0,u.jsxs)(`div`,{className:`rank-list__row`,children:[(0,u.jsx)(`div`,{className:`rank-list__body`,children:(0,u.jsx)(`strong`,{children:t})}),(0,u.jsxs)(`div`,{className:`rank-list__metric`,children:[(0,u.jsx)(`strong`,{children:n}),(0,u.jsx)(`span`,{children:e.totalNodes>0?`${(n/e.totalNodes*100).toFixed(0)}% of graph`:``})]})]},t))})}var Jt=[{value:`resources`,label:`Resources`},{value:`totalTime`,label:`Total time`},{value:`avgTime`,label:`Avg time`}];function Yt(e,t){switch(t){case`resources`:return e.count;case`totalTime`:return e.totalExecutionTime;case`avgTime`:return e.count>0?e.totalExecutionTime/e.count:0}}function Xt(e,t){let n=Yt(e,t);return t===`resources`?n.toLocaleString():Ye(n)}function Zt(e,t){let n=0;for(let r of e){let e=Yt(r,t);e>n&&(n=e)}return n}function Qt(e){return e===`unknown`}function $t(e,t){return[...e].sort((e,n)=>{let r=Yt(e,t),i=Yt(n,t);if(i!==r)return i-r;let a=Qt(e.threadId);return a===Qt(n.threadId)?e.threadId.localeCompare(n.threadId):a?1:-1})}var en=12;function tn(e){let t=e.length,n=t>en;return{rows:n?e.slice(0,en):e,totalLanes:t,isTruncated:n}}function nn(e,t,n){let r=Xt(e,t);return t===`resources`?`${e.threadId}: ${r} runs (${n}% of slice)`:t===`avgTime`?`${e.threadId}: ${r} (${e.count.toLocaleString()} runs)`:`${e.threadId}: ${r}`}function rn({derived:e}){let[t,n]=(0,c.useState)(`totalTime`),r=(0,c.useMemo)(()=>e.filteredThreadStats.reduce((e,t)=>e+t.count,0),[e.filteredThreadStats]),{displayRows:i,maxVal:a,isTruncated:o,totalLanes:s}=(0,c.useMemo)(()=>{let{rows:n,totalLanes:r,isTruncated:i}=tn($t(e.filteredThreadStats,t));return{displayRows:n,maxVal:Zt(n,t),isTruncated:i,totalLanes:r}},[e.filteredThreadStats,t]);return(0,u.jsxs)(`section`,{className:`overview-module overview-module--threads`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Thread distribution`}),(0,u.jsx)(`p`,{children:o?`Top ${i.length} of ${s.toLocaleString()} worker lanes by selected metric.`:`Worker lanes in the current execution slice.`})]}),e.filteredThreadStats.length>0?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`thread-dist-metric-pills pill-row`,role:`radiogroup`,"aria-label":`Thread distribution metric`,children:Jt.map(e=>(0,u.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e.value,"aria-label":`${e.label}, thread distribution metric`,className:t===e.value?Ve:He,onClick:()=>n(e.value),children:e.label},e.value))}),(0,u.jsx)(`ul`,{className:`thread-dist-list`,"aria-label":`Worker lanes by metric`,children:i.map(e=>{let n=Yt(e,t),i=a>0?Math.min(100,n/a*100):0,o=nn(e,t,r>0?Math.round(e.count/r*1e3)/10:0),s=`${e.threadId}, ${o}`;return(0,u.jsxs)(`li`,{className:`thread-dist-row`,"aria-label":s,children:[(0,u.jsx)(`div`,{className:`thread-dist-row__label`,title:e.threadId,children:e.threadId}),(0,u.jsx)(`div`,{className:`thread-dist-row__track-wrap`,children:(0,u.jsx)(`div`,{className:`thread-dist-row__track`,title:o,role:`presentation`,children:(0,u.jsx)(`div`,{className:`thread-dist-row__fill`,style:{width:`${i}%`}})})}),(0,u.jsx)(`div`,{className:`thread-dist-row__value`,children:Xt(e,t)})]},e.threadId)})})]}):(0,u.jsx)(_t,{icon:`⋯`,headline:`No thread data in slice`,subtext:`No matching executions were found for the current dashboard filters.`})]})}function an({derived:e,analysis:t,workerThreadCount:n,modelsCount:r,testsCount:i}){let a=t.summary.critical_path?.path.length??0;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--footprint`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Footprint`}),(0,u.jsx)(`p`,{children:`Filtered execution volume, duration, and worker scale.`})]}),(0,u.jsxs)(`div`,{className:`footprint-card`,children:[(0,u.jsxs)(`div`,{className:`footprint-card__stats`,children:[(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Executed`}),(0,u.jsx)(`strong`,{children:e.filteredExecutions.length})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Runtime`}),(0,u.jsx)(`strong`,{children:Ye(e.filteredExecutionTime)})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Worker lanes`}),(0,u.jsx)(`strong`,{children:n})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Models`}),(0,u.jsx)(`strong`,{children:r})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Tests`}),(0,u.jsx)(`strong`,{children:i})]})]}),(0,u.jsxs)(`p`,{className:`footprint-card__detail`,children:[`Graph totals remain workspace-wide: `,t.graphSummary.totalNodes,` `,`nodes, `,t.graphSummary.totalEdges,` edges, `,a,` `,`critical-path nodes.`]})]})]})}var on=[`model`,`source`,`seed`,`snapshot`];function sn(e,t){let n={};for(let r of e){if(!ct(r,t))continue;let e=r.resourceType;n[e]=(n[e]??0)+1}return n}function cn(e,t){let n=e.resources??[],r=t==null?e.graphSummary.nodesByType:sn(n,t),i={};for(let n of e.executions){if(t!=null&&!ct(n,t))continue;let e=n.resourceType;i[e]=(i[e]??0)+1}let a={};for(let n of e.ganttData){if(!dt(n,t))continue;let e=n.resourceType;a[e]=(a[e]??0)+1}let o=new Set([...on,...Object.keys(r),...Object.keys(i),...Object.keys(a)]),s=[];for(let e of[...o].sort((e,t)=>e.localeCompare(t)))s.push({resourceType:e,graphCount:r[e]??0,runCount:i[e]??0,timelineCount:a[e]??0});return s.filter(e=>on.includes(e.resourceType)||e.graphCount>0||e.runCount>0||e.timelineCount>0)}function ln({rows:e}){return e.length===0?null:(0,u.jsxs)(`div`,{className:`invocation-resource-stats`,role:`region`,"aria-label":`Invocation resource counts by type`,children:[(0,u.jsx)(`p`,{className:`invocation-resource-stats__title`,children:`Resource counts (manifest graph vs this run vs timeline rows)`}),(0,u.jsxs)(`table`,{className:`invocation-resource-stats__table`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{scope:`col`,children:`Type`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`Manifest graph`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`This run`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`Timeline`})]})}),(0,u.jsx)(`tbody`,{children:e.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{scope:`row`,children:Xe(e.resourceType)}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.graphCount.toLocaleString()}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.runCount.toLocaleString()}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.timelineCount.toLocaleString()})]},e.resourceType))})]}),(0,u.jsxs)(`p`,{className:`invocation-resource-stats__note`,children:[`When a project package is in scope, manifest graph counts match that package (same scope as this run and timeline). Synthetic source rows are described in ADR-0032 (`,(0,u.jsx)(`code`,{children:`docs/adr/0032-timeline-includes-dbt-sources-via-snapshot-synthesis.md`}),`).`]})]})}function un({analysis:e}){let t=e.projectName??st(e.executions);return(0,u.jsx)(ln,{rows:(0,c.useMemo)(()=>cn(e,t),[e,t])})}function dn(e,t){return e.failingNodes>0?{tone:`danger`,title:`${e.failingNodes} failing node${e.failingNodes===1?``:`s`} require attention`,summary:`Prioritize failing nodes before reviewing downstream impact.`}:e.warningNodes>0?{tone:`warning`,title:`${e.warningNodes} warning node${e.warningNodes===1?``:`s`} need review`,summary:`Warnings surfaced in this run. Review tests and runtime hotspots next.`}:{tone:`positive`,title:`Healthy run`,summary:t?`No failing nodes match the current dashboard filters.`:`No failing nodes surfaced in the latest run.`}}function fn(e,t){let n=Qe(e);return[t??`Workspace`,`${e.graphSummary.totalNodes} graph nodes`,`${e.summary.total_nodes} executions`,e.invocationId==null?null:`invocation ${e.invocationId}`,n==null?null:`invocation started ${Ze(n)}`].filter(e=>!!e)}function pn(e){return e.find(e=>e.label===`Workspace mode`)?.value??`—`}function mn({analysis:e,projectName:t,analysisSource:n,derived:r,filtered:i,workspaceSignals:a}){let{tone:o,title:s,summary:c}=dn(r,i),l=fn(e,t),d=Ye(i?r.filteredExecutionTime:e.summary.total_execution_time),f=A(n),p=pn(a),m=r.failingNodes>0?`${r.failedModels} failed model${r.failedModels===1?``:`s`} may block downstream investigation.`:r.warningNodes>0?`Review tests and runtime hotspots next.`:null;return(0,u.jsxs)(`section`,{className:`health-posture health-posture--${o}`,"aria-label":`Run posture`,children:[(0,u.jsxs)(`div`,{className:`health-posture__top`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Run posture`}),(0,u.jsx)(`span`,{className:`health-posture__source`,children:f})]}),(0,u.jsx)(`p`,{className:`health-posture__meta`,children:l.join(` · `)}),(0,u.jsx)(`h3`,{className:`health-posture__headline`,children:s}),(0,u.jsx)(`p`,{className:`health-posture__summary`,children:c}),m!=null&&(0,u.jsx)(`p`,{className:`health-posture__followup`,children:m}),(0,u.jsxs)(`div`,{className:`health-posture__metrics`,role:`list`,children:[(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Failing`}),(0,u.jsx)(`strong`,{children:r.failingNodes})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Warnings`}),(0,u.jsx)(`strong`,{children:r.warningNodes})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Runtime`}),(0,u.jsx)(`strong`,{children:d})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Workspace`}),(0,u.jsx)(`strong`,{children:p})]})]})]})}function hn(e){return z.has(e)?`tests`:e}function gn({analysis:e,projectName:t}){let n=(0,c.useMemo)(()=>{let n=e.resources.filter(e=>ct(e,t)),r=new Map;for(let e of n){let t=hn(e.resourceType);r.set(t,(r.get(t)??0)+1)}let i=[];for(let{key:e,label:t}of Ue){let n=r.get(e)??0;n>0&&i.push({label:t,value:n.toLocaleString()})}let a=e.resources.filter(e=>!!e.description?.trim()).length,o=e.resources.length,s=o>0?Math.round(a/o*100):0;i.push({label:`Coverage`,value:`${s}%`}),i.push({label:`Graph nodes`,value:e.graphSummary.totalNodes.toLocaleString()}),i.push({label:`Edges`,value:e.graphSummary.totalEdges.toLocaleString()});let c=e.adapterTotals;return c!=null&&c.nodesWithAdapterData>0&&i.push({label:`Warehouse nodes`,value:c.nodesWithAdapterData.toLocaleString()}),i},[e,t]);return n.length===0?null:(0,u.jsx)(`div`,{className:`health-metric-row`,role:`region`,"aria-label":`Workspace metrics`,children:n.map((e,t)=>(0,u.jsxs)(`div`,{className:`health-metric-row__item`,children:[(0,u.jsx)(`span`,{className:`health-metric-row__label`,children:e.label}),(0,u.jsx)(`strong`,{className:`health-metric-row__value`,children:e.value})]},`${e.label}-${t}`))})}var _n=[{value:`all`,label:`All`},{value:`positive`,label:`Healthy`},{value:`warning`,label:`Warnings`},{value:`danger`,label:`Errors`}];function vn({filters:e,setFilters:t}){return(0,u.jsx)(`div`,{className:`health-exec-status-pills pill-row`,role:`group`,"aria-label":`Filter executions by status`,children:_n.map(n=>(0,u.jsx)(`button`,{type:`button`,className:e.status===n.value?Ve:He,onClick:()=>t(e=>({...e,status:n.value})),children:n.label},n.value))})}function yn({analysis:e,projectName:t,analysisSource:n,filters:r,setFilters:i,workspaceSignals:a}){let o=(0,c.useMemo)(()=>({status:r.status,query:``,resourceTypes:new Set}),[r.status]),s=(0,c.useMemo)(()=>gt(e,o),[e,o]),l=r.status!==`all`,d=s.threadCount||s.filteredThreadStats.length,f=s.filteredExecutions.filter(e=>e.resourceType===`model`).length,p=s.filteredExecutions.filter(e=>z.has(e.resourceType)).length;return(0,u.jsxs)(`div`,{className:`workspace-view health-view`,children:[(0,u.jsxs)(`div`,{className:`lens-header`,children:[(0,u.jsxs)(`div`,{className:`lens-header__title`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,u.jsx)(`h2`,{children:`Health`}),(0,u.jsx)(`p`,{className:`lens-header__desc`,children:`Run posture, critical issues, and dependency pressure at a glance.`})]}),l&&(0,u.jsx)(`span`,{className:`lens-header__badge`,children:`Filtered view`})]}),(0,u.jsxs)(`div`,{className:`health-fold`,children:[(0,u.jsx)(mn,{analysis:e,projectName:t,analysisSource:n,derived:s,filtered:l,workspaceSignals:a}),(0,u.jsx)(gn,{analysis:e,projectName:t}),(0,u.jsx)(`section`,{className:`health-fold__bottlenecks`,"aria-label":`Bottlenecks`,children:(0,u.jsx)(yt,{derived:s})})]}),(0,u.jsxs)(`div`,{className:`health-detail`,children:[(0,u.jsxs)(`section`,{className:`health-section health-detail__execution`,children:[(0,u.jsxs)(`div`,{className:`health-section__header health-section__header--with-inline-controls`,children:[(0,u.jsxs)(`div`,{className:`health-section__header-text`,children:[(0,u.jsx)(`h3`,{children:`Execution breakdown`}),(0,u.jsxs)(`p`,{children:[s.filteredExecutions.length.toLocaleString(),` runs. Status mix by resource type.`]})]}),(0,u.jsx)(vn,{filters:r,setFilters:i})]}),s.filteredExecutions.length>0?(0,u.jsx)(Kt,{executions:s.filteredExecutions,executionsForShareDenominator:s.baselineExecutionsForBreakdown}):(0,u.jsx)(_t,{icon:`◌`,headline:`No matching executions`,subtext:`Set status to All to include every run, or pick another status filter.`})]}),(0,u.jsxs)(`section`,{className:`health-section health-detail__context`,children:[(0,u.jsxs)(`div`,{className:`health-section__header`,children:[(0,u.jsx)(`h3`,{children:`Execution context`}),(0,u.jsx)(`p`,{children:`Worker pressure, footprint, and critical path.`})]}),(0,u.jsxs)(`div`,{className:`health-detail__grid`,children:[(0,u.jsx)(rn,{derived:s}),(0,u.jsxs)(`div`,{className:`health-detail__stack`,children:[(0,u.jsx)(bt,{analysis:e,filtered:l}),(0,u.jsx)(an,{derived:s,analysis:e,workerThreadCount:d,modelsCount:f,testsCount:p})]})]})]}),(0,u.jsxs)(`section`,{className:`health-section health-detail__structure`,children:[(0,u.jsxs)(`div`,{className:`health-section__header`,children:[(0,u.jsx)(`h3`,{children:`Structural health`}),(0,u.jsx)(`p`,{children:`Coverage and graph shape across the workspace.`})]}),(0,u.jsxs)(`div`,{className:`health-detail__grid`,children:[(0,u.jsx)(xt,{analysis:e,filtered:l}),(0,u.jsxs)(`div`,{className:`health-structure-composition`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Graph composition`}),(0,u.jsx)(`p`,{children:`Node type breakdown in the manifest graph.`})]}),(0,u.jsx)(qt,{graphSummary:e.graphSummary})]})]})]}),(0,u.jsxs)(`details`,{className:`health-detail__resource-stats`,children:[(0,u.jsx)(`summary`,{className:`health-detail__resource-stats-summary`,children:`Invocation resource counts`}),(0,u.jsx)(un,{analysis:e})]})]})]})}var bn=a();function xn(){return{pass:0,fail:0,error:0,warn:0,skipped:0,notExecuted:0}}function Sn(e){return be(e)}function Cn(e,t){let n=t??{},r=e.filter(e=>z.has(e.resourceType)),i=new Map;for(let e of r){let t=n[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];for(let n of t){let t=i.get(n)??xn();e.statusTone===`positive`?t.pass+=1:e.statusTone===`danger`?t.error+=1:e.statusTone===`warning`?t.warn+=1:e.statusTone===`skipped`?t.skipped+=1:t.notExecuted+=1,i.set(n,t)}}return i}function wn(e,t,n){let r=n??{},i=t.filter(e=>z.has(e.resourceType)).filter(t=>(r[t.uniqueId]?.upstream?.map(e=>e.uniqueId)??[]).includes(e)).sort((e,t)=>{let n={danger:0,warning:1,positive:2,skipped:3,neutral:4},r=n[e.statusTone??`neutral`]-n[t.statusTone??`neutral`];if(r!==0)return r;let i=(t.executionTime??-1/0)-(e.executionTime??-1/0);return i===0?e.name.localeCompare(t.name):i}),a=i.filter(e=>e.statusTone===`positive`).length,o=i.filter(e=>e.statusTone===`warning`||e.statusTone===`danger`).length;return{total:i.length,passing:a,attention:o,tests:i}}function Tn(e,t,n){return{id:e,label:t,kind:`branch`,children:[],count:0,parentIds:n}}function En(e,t,n){return{id:e,label:t.name,kind:`resource`,children:[],resource:t,count:1,parentIds:n}}function Dn(e){let t=e.split(`/`).map(e=>e.trim()).filter(Boolean);return{directories:t.slice(0,-1),fileName:t[t.length-1]??e}}function On(e){return tt(e.originalFilePath??e.patchPath??e.path)}function kn(e){let t=On(e);return t?Dn(t).directories:[]}function An(e){let t=On(e);return t?Dn(t).fileName:null}function jn(e){return!e.database||!e.schema?[]:[e.database,e.schema,e.packageName]}function Mn(e,t){let n=[`model`,`seed`,`snapshot`,`source`,`macro`,`operation`,`sql_operation`,`analysis`,`semantic_model`,`metric`,`test`,`unit_test`,`exposure`],r=n.indexOf(e.resourceType),i=n.indexOf(t.resourceType);return r===i?e.name.localeCompare(t.name):r===-1?1:i===-1?-1:r-i}function Nn(e,t){let n={branch:0,resource:1};return e.kind===t.kind?e.kind===`resource`&&t.kind===`resource`&&e.resource&&t.resource?Mn(e.resource,t.resource):e.label.localeCompare(t.label):n[e.kind]-n[t.kind]}function Pn(e){return e.map(e=>{if(e.kind===`resource`)return e;let t=Pn(e.children).sort(Nn);return{...e,children:t,count:t.reduce((e,t)=>e+t.count,0)}}).sort(Nn)}function Fn(e){return`project:branch:${e??`Workspace`}`}function In(e,t,n,r){let i=r??{},a=e.filter(e=>!z.has(e.resourceType)),o=Cn(e,i),s=e=>{let t=xn();for(let n of e){let e;n.kind===`resource`?e=n.testStats??xn():(e=s(n.children),Sn(e)&&(n.testStats=e)),t.pass+=e.pass,t.fail+=e.fail,t.error+=e.error,t.warn+=e.warn,t.skipped+=e.skipped}return t},c=[],l=(e,t,n,r)=>{let i=e.find(e=>e.kind===`branch`&&e.id===t);if(i)return i;let a=Tn(t,n,r);return e.push(a),a};if(t===`project`){let e=n??`Workspace`,r=l(c,Fn(n),e,[]);for(let n of a){if(!On(n))continue;let i=kn(n),a=[r.id],s=r.children;for(let n=0;n<i.length;n+=1){let r=i[n],o=`${t}:branch:${[e,...i.slice(0,n+1)].join(`/`)}`,c=l(s,o,r,[...a]);a.push(o),s=c.children}let c=En(`${t}:resource:${n.uniqueId}`,n,a),u=o.get(n.uniqueId);u&&Sn(u)&&(c.testStats=u),s.push(c)}return s(c),Pn(c).filter(e=>e.count>0)}for(let e of a){let n=jn(e);if(n.length===0)continue;let r=[],i=c;for(let e=0;e<n.length;e+=1){let a=n[e],o=`${t}:branch:${n.slice(0,e+1).join(`/`)}`,s=l(i,o,a,[...r]);r.push(o),i=s.children}let a=En(`${t}:resource:${e.uniqueId}`,e,r),s=o.get(e.uniqueId);s&&Sn(s)&&(a.testStats=s),i.push(a)}return s(c),Pn(c)}function Ln(e,t,n=0){let r=[];for(let i of e)r.push({node:i,depth:n}),i.kind===`branch`&&t.has(i.id)&&r.push(...Ln(i.children,t,n+1));return r}function Rn(e){let t=new Set,n=[...e];for(;n.length>0;){let e=n.pop();e.kind!==`resource`&&(t.add(e.id),n.push(...e.children))}return t}function zn(e){let t=[],n=[...e];for(;n.length>0;){let e=n.pop();e.kind===`resource`&&e.resource?t.push(e.resource.uniqueId):n.push(...[...e.children].reverse())}return t}function Bn(e,t){if(!t)return null;let n=[...e];for(;n.length>0;){let e=n.pop();if(e.kind===`resource`&&e.resource?.uniqueId===t)return e;n.push(...e.children)}return null}function Vn(e,t){let n=Bn(e,t);return new Set(n?.parentIds??[])}function Hn(e){return Math.max(0,Math.min(10,e))}function Un(e){return Ke.has(e)}function Wn(e,t,n,r){let i=new Map,a=[t];for(let o=1;o<=n;o+=1){let n=[];for(let s of a){let a=e[s],c=r===`upstream`?a?.upstream?.map(e=>e.uniqueId)??[]:a?.downstream?.map(e=>e.uniqueId)??[];for(let e of c)i.has(e)||e===t||(i.set(e,o),n.push(e))}if(a=n,a.length===0)break}return i}function Gn(e){switch(e){case`source`:case`seed`:case`snapshot`:return 0;case`model`:return 1;case`semantic_model`:return 2;case`metric`:case`exposure`:return 3;default:return 4}}function Kn(e,t,n,r){if(e===t)return{side:`selected`,depth:0};let i=n.get(e),a=r.get(e);return i!=null&&a!=null?i<=a?{side:`upstream`,depth:i}:{side:`downstream`,depth:a}:i==null?a==null?{side:`selected`,depth:0}:{side:`downstream`,depth:a}:{side:`upstream`,depth:i}}function qn(e,t,n,r,i){let a=new Map,o=[...t.keys()].sort((e,n)=>t.get(e)-t.get(n));for(let t of o){let n=r.get(t);if(!n||z.has(n.resourceType))continue;let o=i[t]?.downstream?.map(e=>e.uniqueId)??[],s=0;for(let t of o)if(t===e)s=Math.max(s,0);else{let e=a.get(t);e!==void 0&&(s=Math.max(s,e))}a.set(t,s+1)}let s=new Map,c=[...n.keys()].sort((e,t)=>n.get(e)-n.get(t));for(let t of c){let n=r.get(t);if(!n||z.has(n.resourceType))continue;let a=i[t]?.upstream?.map(e=>e.uniqueId)??[],o=0;for(let t of a)if(t===e)o=Math.max(o,0);else{let e=s.get(t);e!==void 0&&(o=Math.max(o,e))}s.set(t,o+1)}let l=new Map,u=r.get(e);u&&l.set(0,[u]);for(let[e]of t){let t=r.get(e);if(!t||z.has(t.resourceType))continue;let n=-(a.get(e)??1),i=l.get(n)??[];i.push(t),l.set(n,i)}for(let[e]of n){let t=r.get(e);if(!t||z.has(t.resourceType))continue;let n=s.get(e)??1,i=l.get(n)??[];i.push(t),l.set(n,i)}return Array.from(l.entries()).sort((e,t)=>e[0]-t[0]).map(([e,t])=>({column:e,resources:[...new Map(t.map(e=>[e.uniqueId,e])).values()].sort((e,t)=>{let n=Gn(e.resourceType)-Gn(t.resourceType);return n===0?e.name.localeCompare(t.name):n})}))}function Jn(e,t){let n=new Map;e.forEach(e=>e.resources.forEach((e,t)=>n.set(e.uniqueId,t)));let r=e.map(e=>({...e,resources:[...e.resources]}));for(let e=0;e<4;e+=1){for(let e=1;e<r.length;e+=1){let i=r[e-1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}for(let e=r.length-2;e>=0;--e){let i=r[e+1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.downstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.downstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}}return r}function Yn({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,displayMode:o=`focused`}){let s=Wn(n,e.uniqueId,i,`upstream`),c=Wn(n,e.uniqueId,a,`downstream`),l=Jn(qn(e.uniqueId,s,c,r,n),n).filter(e=>e.resources.length>0),u=Cn(Array.from(r.values()),n),d=l.length,f=o===`summary`?176:212,p=o===`summary`?64:80,m=o===`summary`?14:18,h=o===`summary`?104:160,g=o===`summary`?24:40,_=o===`summary`?40:56,v=o===`summary`?40:52,y=_*2+d*f+Math.max(0,d-1)*h,b=Math.max(1,...l.map(e=>e.resources.length)),x=v*2+b*p+Math.max(0,b-1)*g,S=new Map;l.forEach((t,n)=>{let r=t.resources.length*p+Math.max(0,t.resources.length-1)*g,i=v+(x-v*2-r)/2,a=_+n*(f+h);t.resources.forEach((n,r)=>{let o=i+r*(p+g),{depth:l,side:d}=Kn(n.uniqueId,e.uniqueId,s,c),f=u.get(n.uniqueId);S.set(n.uniqueId,{resource:n,x:a,y:o,column:t.column,depth:l,side:d,passCount:f?.pass??0,failCount:(f?.error??0)+(f?.warn??0),notExecutedCount:f?.notExecuted??0,skippedCount:f?.skipped??0})})});let C=new Set(S.keys()),w=[];for(let e of C){let t=n[e];if(t)for(let n of t.downstream.map(e=>e.uniqueId))C.has(n)&&w.push({from:e,to:n})}return{upstreamMap:s,downstreamMap:c,columnNodes:l,nodeLayouts:S,graphEdges:w,svgWidth:y,svgHeight:x,hasRelatedNodes:S.size>1&&((t?.upstreamCount??0)>0||(t?.downstreamCount??0)>0),nodeWidth:f,nodeHeight:p,nodeRadius:m,displayMode:o}}function Xn(e,t){if(!e)return new Set;let n=new Set([e]);for(let r of t)r.from===e&&n.add(r.to),r.to===e&&n.add(r.from);return n}function Zn(e){return Array.from(new Set(Array.from(e.values()).map(e=>e.resource.resourceType))).sort((e,t)=>{let n=Gn(e)-Gn(t);return n===0?e.localeCompare(t):n})}var Qn={positive:`var(--bg-success-soft)`,warning:`var(--bg-warning-soft)`,danger:`var(--bg-danger-soft)`,skipped:`var(--bg-accent-soft)`,neutral:`var(--bg-surface-muted)`},$n=`var(--bg-success-soft)`,er=`var(--bg-danger-soft)`,tr=`var(--dbt-type-generic-soft)`,nr={model:`var(--dbt-type-model-soft)`,source:`var(--dbt-type-source-soft)`,seed:`var(--dbt-type-seed-soft)`,snapshot:`var(--dbt-type-snapshot-soft)`,test:`var(--dbt-type-test-soft)`,unit_test:`var(--dbt-type-test-soft)`,metric:`var(--dbt-type-metric-soft)`,semantic_model:`var(--dbt-type-semantic-model-soft)`,exposure:`var(--dbt-type-exposure-soft)`,macro:`var(--dbt-type-macro-soft)`,operation:`var(--dbt-type-operation-soft)`,sql_operation:`var(--dbt-type-operation-soft)`},rr={model:`var(--dbt-type-model)`,source:`var(--dbt-type-source)`,seed:`var(--dbt-type-seed)`,snapshot:`var(--dbt-type-snapshot)`,test:`var(--dbt-type-test)`,unit_test:`var(--dbt-type-test)`,metric:`var(--dbt-type-metric)`,semantic_model:`var(--dbt-type-semantic-model)`,exposure:`var(--dbt-type-exposure)`,macro:`var(--dbt-type-macro)`,operation:`var(--dbt-type-operation)`,sql_operation:`var(--dbt-type-operation)`};function ir(e,t){switch(t){case`status`:return Qn[e.statusTone??`neutral`];case`type`:return nr[e.resourceType]??tr;case`coverage`:return e.description?$n:er}}function ar(e,t){switch(t){case`status`:return e.statusTone??`neutral`;case`type`:return e.resourceType;case`coverage`:return e.description?`documented`:`undocumented`}}function or(e){return e.charAt(0).toUpperCase()+e.slice(1)}function sr(e){return e.split(`_`).map(e=>or(e)).join(` `)}function cr(e,t){switch(e){case`status`:{let e=new Set;for(let n of t.values())e.add(n.resource.statusTone??`neutral`);return[`positive`,`warning`,`danger`,`skipped`,`neutral`].map(e=>({key:e,label:or(e),color:Qn[e]}))}case`type`:return Zn(t).map(e=>({key:e,label:sr(e),color:nr[e]??tr,borderColor:rr[e]??`var(--dbt-type-generic)`}));case`coverage`:return[{key:`documented`,label:`Documented`,color:$n},{key:`undocumented`,label:`No description`,color:er}]}}function lr(e,t,n){let r=new Map;for(let{from:t,to:i}of e){if(!n.has(t)||!n.has(i))continue;let e=r.get(t);e?e.push(i):r.set(t,[i]);let a=r.get(i);a?a.push(t):r.set(i,[t])}let i=new Set;if(!n.has(t))return i;let a=[t];i.add(t);for(let e=0;e<a.length;e+=1){let t=a[e];for(let e of r.get(t)??[])i.has(e)||(i.add(e),a.push(e))}return i}function ur(e,t,n){if(!e.has(n))return{nodeLayouts:e,graphEdges:t};let r=lr(t,n,new Set(e.keys()));if(r.size===e.size)return{nodeLayouts:e,graphEdges:t};let i=new Map;for(let[t,n]of e.entries())r.has(t)&&i.set(t,n);let a=new Set(i.keys());return{nodeLayouts:i,graphEdges:t.filter(e=>a.has(e.from)&&a.has(e.to))}}function dr(e,t,n,r){if(n.size===0)return ur(e.nodeLayouts,e.graphEdges,r);let i=new Map;for(let[a,o]of e.nodeLayouts.entries())(a===r||n.has(ar(o.resource,t)))&&i.set(a,o);let a=new Set(i.keys());return ur(i,e.graphEdges.filter(e=>a.has(e.from)&&a.has(e.to)),r)}function fr({label:e,value:t,setValue:n,disabled:r=!1}){return(0,u.jsxs)(`div`,{className:`lineage-stepper${r?` lineage-stepper--disabled`:``}`,children:[(0,u.jsx)(`span`,{className:`lineage-stepper__label`,children:e}),(0,u.jsxs)(`div`,{className:`lineage-stepper__controls`,children:[(0,u.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t<=1,onClick:()=>n(e=>Hn(e-1)),children:`−`}),(0,u.jsx)(`span`,{className:`lineage-stepper__value`,children:t}),(0,u.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t>=3,onClick:()=>n(e=>Hn(e+1)),children:`+`})]})]})}function pr(e,t,n){return n?`all`:e===t&&e>=1&&e<=3?String(e):`custom`}function mr({upstreamDepth:e,downstreamDepth:t,allDepsMode:n,setUpstreamDepth:r,setDownstreamDepth:i,setAllDepsMode:a}){let o=pr(e,t,n),s=e=>{if(e===`all`){a(!0);return}let t=Number(e);a(!1),r(t),i(t)};return(0,u.jsxs)(`div`,{className:`shared-depth-selector`,children:[(0,u.jsx)(`span`,{className:`shared-depth-selector__label`,children:`Depth`}),[`1`,`2`,`3`,`all`].map(e=>(0,u.jsx)(`button`,{type:`button`,className:o===e?Ve:He,onClick:()=>s(e),children:e===`all`?`All`:e},e)),o===`custom`&&(0,u.jsx)(`span`,{className:`shared-depth-selector__state`,children:`Custom`})]})}function hr({lensMode:e,setLensMode:t}){return(0,u.jsxs)(`div`,{className:`lens-selector`,children:[(0,u.jsx)(`span`,{className:`lens-selector__label`,children:`Lens`}),[{value:`type`,label:`Type`},{value:`status`,label:`Status`},{value:`coverage`,label:`Coverage`}].map(({value:n,label:r})=>(0,u.jsx)(`button`,{type:`button`,className:e===n?Ve:He,onClick:()=>t(n),children:r},n))]})}function gr(e){let{layoutX:t,layoutY:n,nodeWidth:r,nodeHeight:i,zoom:a,viewportClientWidth:o,viewportClientHeight:s,scrollWidth:c,scrollHeight:l}=e;if(o<=0||s<=0||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return{scrollLeft:0,scrollTop:0};let u=(t+r/2)*a,d=(n+i/2)*a,f=Math.max(0,c-o),p=Math.max(0,l-s),m=u-o/2,h=d-s/2;return{scrollLeft:Math.min(f,Math.max(0,m)),scrollTop:Math.min(p,Math.max(0,h))}}var _r={width:248,height:176},vr={width:220,height:120},yr={x:10,y:8};function br(e){return 16+e.length*6.2}function xr({anchorX:e,anchorY:t,width:n,height:r,offset:i=6,margin:a=12}){let o=window.innerWidth,s=window.innerHeight,c=e+i,l=t+i;return c+n+a>o&&(c=e-n-i),l+r+a>s&&(l=t-r-i),c=Math.min(Math.max(a,c),Math.max(a,o-n-a)),l=Math.min(Math.max(a,l),Math.max(a,s-r-a)),{x:c,y:l}}function Sr({visibleNodeLayouts:e,getEffectivePos:t,svgWidth:n,svgHeight:r,nodeWidth:i,nodeHeight:a,zoom:o,nodeOffsets:s,nodeDragRef:c,onSelectResource:l,setHoveredId:d,setTooltipNodeId:f,setContextMenu:p,setNodeOffsets:m}){return(0,u.jsx)(`div`,{className:`dependency-graph__interactive-layer`,children:Array.from(e.values()).map(e=>{let{x:h,y:g}=t(e.resource.uniqueId,e.x,e.y),_={left:`${h/n*100}%`,top:`${g/r*100}%`,width:`${i/n*100}%`,height:`${a/r*100}%`};return(0,u.jsx)(`button`,{type:`button`,className:`dependency-graph__hotspot dependency-graph__hotspot--${e.side}`,style:_,onClick:()=>{c.current?.hasMoved||l(e.resource.uniqueId)},onContextMenu:t=>{t.preventDefault();let n=xr({anchorX:t.clientX,anchorY:t.clientY,width:vr.width,height:vr.height});p({x:n.x,y:n.y,nodeId:e.resource.uniqueId})},onMouseEnter:()=>{d(e.resource.uniqueId),f(e.resource.uniqueId)},onMouseLeave:()=>{d(null),f(null)},title:e.resource.uniqueId,onPointerDown:t=>{t.stopPropagation();let n=s.get(e.resource.uniqueId)??{dx:0,dy:0};c.current={nodeId:e.resource.uniqueId,pointerId:t.pointerId,startClientX:t.clientX,startClientY:t.clientY,initialDx:n.dx,initialDy:n.dy,hasMoved:!1},t.currentTarget.setPointerCapture(t.pointerId)},onPointerMove:t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId||n.nodeId!==e.resource.uniqueId)return;let r=t.clientX-n.startClientX,i=t.clientY-n.startClientY;(Math.abs(r)>4||Math.abs(i)>4)&&(n.hasMoved=!0);let a=n.initialDx+r/o,s=n.initialDy+i/o;m(e=>{let t=new Map(e);return t.set(n.nodeId,{dx:a,dy:s}),t})},onPointerUp:e=>{c.current?.pointerId===e.pointerId&&(e.currentTarget.releasePointerCapture(e.pointerId),setTimeout(()=>{c.current=null},0))},onPointerCancel:()=>{c.current=null}},e.resource.uniqueId)})})}function Cr({lensMode:e,legendItems:t,activeLegendKeys:n,onToggleLegendKey:r}){return(0,u.jsxs)(`div`,{className:`lineage-legend`,children:[(0,u.jsx)(`span`,{className:`lineage-legend__mode-label`,children:e===`status`?`By status`:e===`type`?`By type`:`By coverage`}),t.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`lineage-legend__item${n.size===0||n.has(e.key)?` lineage-legend__item--active`:` lineage-legend__item--inactive`}`,onClick:()=>r(e.key),children:[(0,u.jsx)(`span`,{className:`lineage-legend__swatch`,style:{background:e.color,borderColor:e.borderColor}}),e.label]},e.key)),n.size>0&&(0,u.jsx)(`button`,{type:`button`,className:`lineage-legend__clear`,onClick:()=>n.forEach(e=>{r(e)}),children:`Clear`})]})}function wr({node:e,x:t,badgeY:n,badgeHeight:r,badgeRadius:i,displayMode:a}){let o=String(e.passCount),s=String(e.failCount),c=br(o),l=br(s),d=e.notExecutedCount>0||e.skippedCount>0,f=a===`summary`&&d?4:6,p=e.notExecutedCount>0?String(e.notExecutedCount):``,m=e.skippedCount>0?String(e.skippedCount):``,h=p?br(p):0,g=m?br(m):0,_=t+16+c+f+l,v=e.notExecutedCount>0?_+f:0,y=e.skippedCount>0?e.notExecutedCount>0?v+h+f:_+f:0;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`rect`,{x:t+16,y:n,width:c,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--pass`}),(0,u.jsx)(`text`,{x:t+16+c/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--pass`,textAnchor:`middle`,dominantBaseline:`middle`,children:o}),(0,u.jsx)(`rect`,{x:t+16+c+f,y:n,width:l,height:r,rx:i,className:`dependency-graph__node-stat-pill ${e.failCount===0?`dependency-graph__node-stat-pill--neutral`:`dependency-graph__node-stat-pill--fail`}`}),(0,u.jsx)(`text`,{x:t+16+c+f+l/2,y:n+r/2,className:`dependency-graph__node-stat ${e.failCount===0?`dependency-graph__node-stat--neutral`:`dependency-graph__node-stat--fail`}`,textAnchor:`middle`,dominantBaseline:`middle`,children:s}),e.notExecutedCount>0?(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`title`,{children:`Not executed in this run: ${e.notExecutedCount}`}),(0,u.jsx)(`rect`,{x:v,y:n,width:h,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--not-executed`}),(0,u.jsx)(`text`,{x:v+h/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--not-executed`,textAnchor:`middle`,dominantBaseline:`middle`,children:p})]}):null,e.skippedCount>0?(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`title`,{children:`Skipped dbt tests: ${e.skippedCount}`}),(0,u.jsx)(`rect`,{x:y,y:n,width:g,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--skipped`}),(0,u.jsx)(`text`,{x:y+g/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--skipped`,textAnchor:`middle`,dominantBaseline:`middle`,children:m})]}):null]})}function Tr({node:e,getEffectivePos:t,nodeWidth:n,nodeHeight:r,nodeRadius:i,displayMode:a,lensMode:o,highlightedIds:s,hasHoverFocus:c}){let l=!c||s.has(e.resource.uniqueId),{x:d,y:f}=t(e.resource.uniqueId,e.x,e.y),p=a===`summary`?f+r-20:f+r-23,m=a===`summary`?15:17,h=m/2,g=` dependency-graph__node--tone-${e.resource.statusTone??`neutral`}`;return(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`rect`,{x:d,y:f,width:n,height:r,rx:i,className:`dependency-graph__node${e.side===`selected`?` dependency-graph__node--selected`:``}${l?``:` dependency-graph__node--dimmed`}${g}`,...e.side===`selected`?{stroke:`var(--graph-node-selected-stroke)`,strokeWidth:3}:{},style:{fill:ir(e.resource,o)}}),(0,u.jsx)(`foreignObject`,{x:d+16,y:a===`summary`?f+10:f+14,width:n-32,height:24,children:(0,u.jsxs)(`div`,{className:`dependency-graph__node-title-row`,title:`${e.resource.name} (${Xe(e.resource.resourceType)})`,children:[(0,u.jsx)(`span`,{className:`dependency-graph__node-title-icon`,title:Xe(e.resource.resourceType),children:(0,u.jsx)(zt,{resourceType:e.resource.resourceType})}),(0,u.jsx)(`span`,{className:`dependency-graph__node-title-text`,children:e.resource.name})]})}),Un(e.resource.resourceType)?(0,u.jsx)(wr,{node:e,x:d,badgeY:p,badgeHeight:m,badgeRadius:h,displayMode:a}):null]})}function Er({visibleEdges:e,visibleNodeLayouts:t,getEffectivePos:n,nodeWidth:r,nodeHeight:i,nodeRadius:a,displayMode:o,lensMode:s,highlightedIds:c,hasHoverFocus:l}){return(0,u.jsxs)(u.Fragment,{children:[e.map(e=>{let a=t.get(e.from),o=t.get(e.to);if(!a||!o)return null;let s=n(e.from,a.x,a.y),d=n(e.to,o.x,o.y),f=s.x+r,p=s.y+i/2,m=d.x,h=d.y+i/2,g=Math.max(28,Math.abs(m-f)*.34);return(0,u.jsx)(`path`,{d:`M ${f} ${p} C ${f+g} ${p}, ${m-g} ${h}, ${m} ${h}`,className:`dependency-graph__edge${!l||c.has(e.from)||c.has(e.to)?``:` dependency-graph__edge--dimmed`}`},`${e.from}->${e.to}`)}),Array.from(t.values()).map(e=>(0,u.jsx)(Tr,{node:e,getEffectivePos:n,nodeWidth:r,nodeHeight:i,nodeRadius:a,displayMode:o,lensMode:s,highlightedIds:c,hasHoverFocus:l},e.resource.uniqueId))]})}function Dr({zoom:e,setZoom:t,nodeOffsetsSize:n,onResetLayout:r,visibleNodeCount:i,upstreamCount:a,downstreamCount:o}){return(0,u.jsxs)(`div`,{className:`lineage-graph__viewport-toolbar`,children:[(0,u.jsxs)(`div`,{className:`lineage-graph__zoom-controls`,children:[(0,u.jsx)(`button`,{type:`button`,className:He,onClick:()=>t(e=>Math.max(.4,e-.1)),children:`−`}),(0,u.jsxs)(`button`,{type:`button`,className:He,onClick:()=>t(1),children:[Math.round(e*100),`%`]}),(0,u.jsx)(`button`,{type:`button`,className:He,onClick:()=>t(e=>Math.min(2.5,e+.1)),children:`+`}),n>0&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:r,children:`Reset layout`})]}),(0,u.jsxs)(`p`,{className:`lineage-graph__summary`,children:[i,` nodes · `,a,` upstream · `,o,` `,`downstream`]})]})}function Or({model:e,displayMode:t,fullscreen:n,lensMode:r,legendItems:i,activeLegendKeys:a,onToggleLegendKey:o,zoom:s,setZoom:c,nodeOffsets:l,setNodeOffsets:d,visibleNodeLayouts:f,visibleEdges:p,highlightedIds:m,hasHoverFocus:h,getEffectivePos:g,svgWidth:_,svgHeight:v,nodeWidth:y,nodeHeight:b,nodeRadius:x,viewportRef:S,panDragRef:C,nodeDragRef:w,onSelectResource:T,setHoveredId:E,setTooltipNodeId:D,setContextMenu:O,setViewportTick:k,tooltipLayout:A,tooltipPosition:ee,contextMenu:j}){return(0,u.jsxs)(`div`,{className:`dependency-graph dependency-graph--${t}${n?` dependency-graph--fullscreen`:``}`,children:[(0,u.jsx)(Cr,{lensMode:r,legendItems:i,activeLegendKeys:a,onToggleLegendKey:o}),(0,u.jsx)(Dr,{zoom:s,setZoom:c,nodeOffsetsSize:l.size,onResetLayout:()=>d(new Map),visibleNodeCount:f.size,upstreamCount:e.upstreamMap.size,downstreamCount:e.downstreamMap.size}),(0,u.jsx)(`div`,{ref:S,className:`lineage-graph__viewport${n?` lineage-graph__viewport--fullscreen`:``}`,onPointerDown:e=>{let t=S.current;t&&(C.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop},t.setPointerCapture(e.pointerId))},onPointerMove:e=>{let t=C.current,n=S.current;!t||!n||t.pointerId!==e.pointerId||(n.scrollLeft=t.scrollLeft-(e.clientX-t.startX),n.scrollTop=t.scrollTop-(e.clientY-t.startY))},onPointerUp:e=>{let t=S.current;C.current?.pointerId===e.pointerId&&t&&t.releasePointerCapture(e.pointerId),C.current=null},onPointerCancel:()=>{C.current=null},onScroll:()=>k(e=>e+1),children:(0,u.jsxs)(`div`,{className:`lineage-graph__canvas`,style:{width:`${_*s}px`,height:`${v*s}px`},children:[(0,u.jsxs)(`div`,{className:`lineage-graph__zoom-layer`,style:{width:`${_}px`,height:`${v}px`,transform:`scale(${s})`},children:[(0,u.jsx)(`svg`,{className:`dependency-graph__svg dependency-graph__svg--lens-${r}`,viewBox:`0 0 ${_} ${v}`,preserveAspectRatio:`xMidYMid meet`,"aria-hidden":`true`,children:(0,u.jsx)(Er,{visibleEdges:p,visibleNodeLayouts:f,getEffectivePos:g,nodeWidth:y,nodeHeight:b,nodeRadius:x,displayMode:t,lensMode:r,highlightedIds:m,hasHoverFocus:h})}),(0,u.jsx)(Sr,{visibleNodeLayouts:f,getEffectivePos:g,svgWidth:_,svgHeight:v,nodeWidth:y,nodeHeight:b,zoom:s,nodeOffsets:l,nodeDragRef:w,onSelectResource:T,setHoveredId:E,setTooltipNodeId:D,setContextMenu:O,setNodeOffsets:d})]}),A&&ee&&(0,u.jsxs)(`div`,{className:`graph-node-tooltip`,style:{left:ee.left,top:ee.top},"aria-hidden":`true`,children:[(0,u.jsx)(`div`,{className:`graph-node-tooltip__name`,children:A.resource.name}),(0,u.jsxs)(`div`,{className:`graph-node-tooltip__meta`,children:[Xe(A.resource.resourceType),A.resource.packageName?` · ${A.resource.packageName}`:``]}),A.resource.status&&(0,u.jsxs)(`div`,{className:`graph-node-tooltip__status graph-node-tooltip__status--${A.resource.statusTone}`,children:[A.resource.status,A.resource.executionTime==null?``:` · ${Ye(A.resource.executionTime)}`]}),A.resource.description&&(0,u.jsx)(`div`,{className:`graph-node-tooltip__description`,children:A.resource.description})]})]})}),j&&(0,u.jsxs)(`div`,{className:`graph-context-menu`,style:{left:j.x,top:j.y},onPointerDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`button`,{type:`button`,className:`graph-context-menu__item`,onClick:()=>{T(j.nodeId),O(null)},children:`Focus on this node`}),(()=>{let e=f.get(j.nodeId);return e?(0,u.jsx)(`div`,{className:`graph-context-menu__label`,children:e.resource.name}):null})()]})]})}function kr(e,t,n,r,i,a,o,s){(0,c.useLayoutEffect)(()=>{if(!e)return;let i=o.current;if(!i)return;let{x:c,y:l}=a(e.resource.uniqueId,e.x,e.y),u=c*t,d=l*t,f=n*t,p=r*t,m=u+f-_r.width-yr.x,h=d+yr.y;m<i.scrollLeft+12&&(m=u+yr.x),h+_r.height>i.scrollTop+i.clientHeight&&(h=d+p-_r.height-yr.y),m=Math.min(Math.max(i.scrollLeft+12,m),Math.max(i.scrollLeft+12,i.scrollLeft+i.clientWidth-_r.width-12)),h=Math.min(Math.max(i.scrollTop+12,h),Math.max(i.scrollTop+12,i.scrollTop+i.clientHeight-_r.height-12)),s({left:m,top:h})},[e,t,n,r,i,a,o,s])}function Ar({model:e,onSelectResource:t,lensMode:n=`type`,activeLegendKeys:r,onToggleLegendKey:i,fullscreen:a=!1,displayMode:o=`focused`}){let{nodeLayouts:s,svgHeight:l,svgWidth:d,nodeWidth:f,nodeHeight:p,nodeRadius:m}=e,[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(null),[y,b]=(0,c.useState)(1),[x,S]=(0,c.useState)(0),[C,w]=(0,c.useState)(null),[T,E]=(0,c.useState)(new Map),[D,O]=(0,c.useState)(0),[k,A]=(0,c.useState)(null),ee=(0,c.useRef)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(null),te=(0,c.useRef)(null),N=(0,c.useRef)(y),P=(0,c.useMemo)(()=>Array.from(s.values()).find(e=>e.side===`selected`)?.resource.uniqueId??``,[s]),F=(0,c.useMemo)(()=>dr(e,n,r,P),[r,n,e,P]),I=F.nodeLayouts,ne=F.graphEdges;(0,c.useEffect)(()=>{queueMicrotask(()=>{b(1),E(new Map),O(e=>e+1)})},[e]),(0,c.useLayoutEffect)(()=>{N.current=y;let e=te.current,t=M.current;e&&t&&(t.scrollLeft=e.x,t.scrollTop=e.y,te.current=null)},[y]),(0,c.useLayoutEffect)(()=>{if(N.current!==1||T.size>0)return;let e=M.current;if(!e)return;if(!P){e.scrollLeft=0,e.scrollTop=0;return}let t=I.get(P);if(!t){e.scrollLeft=0,e.scrollTop=0;return}let{scrollLeft:n,scrollTop:r}=gr({layoutX:t.x,layoutY:t.y,nodeWidth:f,nodeHeight:p,zoom:1,viewportClientWidth:e.clientWidth,viewportClientHeight:e.clientHeight,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight});e.scrollLeft=n,e.scrollTop=r},[D,e,T,P,I,f,p]),(0,c.useEffect)(()=>{if(!k)return;let e=()=>A(null),t=t=>{t.key===`Escape`&&e()};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[k]),(0,c.useEffect)(()=>{let e=M.current;if(!e)return;let t=t=>{if(t.preventDefault(),t.ctrlKey){let n=e.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top,a=e.scrollLeft,o=e.scrollTop;b(e=>{let n=Math.max(.4,Math.min(2.5,e*(1-t.deltaY*.003)));return te.current={x:(a+r)/e*n-r,y:(o+i)/e*n-i},n})}else e.scrollLeft+=t.deltaX,e.scrollTop+=t.deltaY};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let re=(0,c.useCallback)((e,t,n)=>{let r=T.get(e);return{x:t+(r?.dx??0),y:n+(r?.dy??0)}},[T]),ie=_!==null&&I.has(_)?_:null,ae=ie?I.get(ie)??null:null;if(kr(ae,y,f,p,x,re,M,w),I.size===0)return(0,u.jsx)(`div`,{className:`dependency-graph dependency-graph--empty dependency-graph--${o}${a?` dependency-graph--fullscreen`:``}`,children:(0,u.jsx)(_t,{icon:`↔`,headline:`No lineage available`,subtext:`This resource could not be placed on the lineage canvas.`})});let oe=cr(n,s),se=Xn(h,ne);return(0,u.jsx)(Or,{model:e,displayMode:o,fullscreen:a,lensMode:n,legendItems:oe,activeLegendKeys:r,onToggleLegendKey:i,zoom:y,setZoom:b,nodeOffsets:T,setNodeOffsets:E,visibleNodeLayouts:I,visibleEdges:ne,highlightedIds:se,hasHoverFocus:se.size>0,getEffectivePos:re,svgWidth:d,svgHeight:l,nodeWidth:f,nodeHeight:p,nodeRadius:m,viewportRef:M,panDragRef:ee,nodeDragRef:j,onSelectResource:t,setHoveredId:g,setTooltipNodeId:v,setContextMenu:A,setViewportTick:S,tooltipLayout:ae,tooltipPosition:C,contextMenu:k})}function jr({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,allDepsMode:o,lensMode:s,activeLegendKeys:l,setUpstreamDepth:d,setDownstreamDepth:f,setAllDepsMode:p,setLensMode:m,setActiveLegendKeys:h,onSelectResource:g,displayMode:_=`focused`,openFullscreen:v=!1,onFullscreenChange:y,fullscreenScope:b=`viewport`}){let[x,S]=(0,c.useState)(!1);(0,c.useEffect)(()=>{S(v)},[v]);let C=(0,c.useCallback)(e=>{S(e),y?.(e)},[y]);(0,c.useEffect)(()=>{if(!x)return;let e=e=>{e.key===`Escape`&&C(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x,C]),(0,c.useEffect)(()=>{if(!x||typeof document>`u`)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[x]);let w=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},T=(0,c.useMemo)(()=>Yn({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:o?20:i,downstreamDepth:o?20:a,displayMode:_}),[o,n,t,_,a,e,r,i]),E=()=>(0,u.jsxs)(`div`,{className:`lineage-toolbar`,children:[(0,u.jsx)(hr,{lensMode:s,setLensMode:m}),(0,u.jsx)(mr,{upstreamDepth:i,downstreamDepth:a,allDepsMode:o,setUpstreamDepth:d,setDownstreamDepth:f,setAllDepsMode:p}),(0,u.jsx)(fr,{label:`Upstream`,value:i,setValue:d,disabled:o}),(0,u.jsx)(fr,{label:`Downstream`,value:a,setValue:f,disabled:o}),l.size>0&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>h(new Set),children:`Clear filters`}),_===`focused`&&!x?(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>C(!0),children:`Expand`}):null]}),D=_===`summary`?(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>C(!0),children:`Expand lineage`}):void 0,O=x?(0,u.jsxs)(`div`,{className:`lineage-dialog lineage-dialog--${b}`,role:`dialog`,"aria-modal":`true`,children:[(0,u.jsx)(`button`,{type:`button`,className:`lineage-dialog__backdrop`,"aria-label":`Dismiss lineage overlay`,onClick:()=>C(!1)}),(0,u.jsxs)(`section`,{className:`lineage-dialog__panel`,children:[(0,u.jsxs)(`div`,{className:`lineage-dialog__header`,children:[(0,u.jsxs)(`div`,{className:`lineage-dialog__header-main`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Lineage`}),(0,u.jsx)(`h3`,{children:e.name}),(0,u.jsx)(`p`,{className:`lineage-dialog__subtitle`,children:`Exact dependency graph with staged upstream and downstream columns.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`lineage-dialog__close`,"aria-label":`Close lineage graph`,onClick:()=>C(!1),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`×`})})]}),(0,u.jsx)(`div`,{className:`lineage-dialog__toolbar`,children:E()})]}),(0,u.jsx)(Ar,{model:T,onSelectResource:g,lensMode:s,activeLegendKeys:l,onToggleLegendKey:w,displayMode:`focused`,fullscreen:!0})]})]}):null;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Lt,{title:_===`summary`?`Lineage graph`:`Lineage`,subtitle:_===`summary`?void 0:`Exact upstream and downstream lineage for ${e.name}.`,headerRight:_===`focused`?E():D,children:(0,u.jsxs)(`div`,{className:`lineage-summary lineage-summary--${_}`,children:[(0,u.jsxs)(`div`,{className:`lineage-summary__stats`,children:[(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Selected resource`}),(0,u.jsx)(`strong`,{children:Xe(e.resourceType)})]}),(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Direct upstream`}),(0,u.jsx)(`strong`,{children:t?.upstreamCount??0})]}),(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Direct downstream`}),(0,u.jsx)(`strong`,{children:t?.downstreamCount??0})]})]}),(0,u.jsx)(Ar,{model:T,onSelectResource:g,lensMode:s,activeLegendKeys:l,onToggleLegendKey:w,displayMode:_})]})}),O&&typeof document<`u`&&(0,bn.createPortal)(O,document.body)]})}function Mr(e,t){return t===`asc`?e:-e}function Nr(e){return e.statusTone===`danger`||e.statusTone===`warning`?0:e.statusTone===`positive`?1:e.statusTone===`skipped`?2:3}function Pr(e,t,n){return e==null&&t==null?0:e==null?n===`asc`?1:-1:t==null?n===`asc`?-1:1:Mr(e.localeCompare(t),n)}function Fr(e,t){return(t.executionTime??-1/0)-(e.executionTime??-1/0)}function Ir(e,t){return e===0?0:t===`asc`?-e:e}function Lr(e,t,n){let r=e.name.localeCompare(t.name);return r===0?e.uniqueId.localeCompare(t.uniqueId):Mr(r,n)}function Rr(e,t,n){let r=Fr(e,t);return r===0?e.name.localeCompare(t.name):Ir(r,n)}function zr(e,t,n){let r=Xe(e.resourceType).localeCompare(Xe(t.resourceType));return r===0?e.name.localeCompare(t.name):Mr(r,n)}function Br(e,t,n){let r=Pr(et(e),et(t),n);return r===0?e.name.localeCompare(t.name):r}function Vr(e,t,n){let r=Nr(e)-Nr(t);if(r!==0)return-Mr(r,n);let i=Fr(e,t);if(i!==0)return Ir(i,n);let a=e.name.localeCompare(t.name);return a===0?e.uniqueId.localeCompare(t.uniqueId):Mr(a,n)}function Hr(e,t,n,r){switch(n){case`test`:return Lr(e,t,r);case`duration`:return Rr(e,t,r);case`type`:return zr(e,t,r);case`location`:return Br(e,t,r);case`status`:return Vr(e,t,r);default:return n}}function Ur(e,t,n){return[...e].sort((e,r)=>Hr(e,r,t,n))}function Wr(e){return e.total===0?{label:`No attached tests`,tone:`neutral`,detail:`No quality evidence was linked to this asset in the current artifacts.`}:e.attention>0?{label:`Attention needed`,tone:`warning`,detail:`${e.attention} attention item${e.attention===1?``:`s`} across ${e.total} attached tests.`}:{label:`All attached tests passing`,tone:`positive`,detail:`${e.passing} of ${e.total} attached tests passed in the current artifacts.`}}function Gr(e,t,n){return e===t?n===`asc`?{indicator:`↑`,ariaSort:`ascending`}:{indicator:`↓`,ariaSort:`descending`}:{indicator:` `,ariaSort:`none`}}function Kr(e,t,n){return e===t?n===`asc`?`desc`:`asc`:t===`status`||t===`duration`?`desc`:`asc`}var qr=[{key:`test`,label:`Test`,alignEnd:!1,testCell:!0},{key:`status`,label:`Status`,alignEnd:!1,testCell:!1},{key:`type`,label:`Type`,alignEnd:!1,testCell:!1},{key:`duration`,label:`Duration`,alignEnd:!0,testCell:!1},{key:`location`,label:`Location`,alignEnd:!1,testCell:!1}];function Jr({resource:e,analysis:t,onNavigateTo:n}){let[r,i]=(0,c.useState)(`status`),[a,o]=(0,c.useState)(`desc`),s=(0,c.useMemo)(()=>wn(e.uniqueId,t.resources,t.dependencyIndex),[t.dependencyIndex,t.resources,e.uniqueId]),l=Wr(s),d=(0,c.useMemo)(()=>Ur(s.tests,r,a),[s.tests,a,r]),f=e=>{o(t=>Kr(r,e,t)),i(e)};return(0,u.jsxs)(Lt,{title:`Tests`,subtitle:`Quality evidence and related dependency posture.`,children:[(0,u.jsxs)(`div`,{className:`asset-tests-summary`,children:[(0,u.jsxs)(`div`,{className:`asset-tests-summary__headline`,children:[(0,u.jsx)(`span`,{className:`tone-badge tone-badge--${l.tone}`,children:l.label}),(0,u.jsx)(`p`,{children:l.detail})]}),(0,u.jsxs)(`div`,{className:`asset-tests-summary__metrics`,"aria-label":`Test summary`,children:[(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.total}),(0,u.jsx)(`span`,{children:`Attached tests`})]}),(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.passing}),(0,u.jsx)(`span`,{children:`Passing`})]}),(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.attention}),(0,u.jsx)(`span`,{children:`Attention items`})]})]})]}),s.tests.length===0?(0,u.jsx)(`p`,{className:`resource-spotlight__description resource-spotlight__description--muted`,children:`No attached tests were found for this asset in the current artifacts.`}):(0,u.jsxs)(`div`,{className:`asset-tests-table`,"aria-label":`Attached tests evidence`,children:[(0,u.jsx)(`div`,{className:`asset-tests-table__toolbar`,children:(0,u.jsx)(`p`,{className:`asset-tests-table__caption`,children:`Compare attached test evidence by status, duration, and source location.`})}),(0,u.jsxs)(`div`,{className:`asset-tests-table__header`,role:`row`,children:[qr.map(({key:e,label:t,alignEnd:n,testCell:i})=>{let o=Gr(r,e,a);return(0,u.jsx)(`div`,{className:`asset-tests-table__cell${i?` asset-tests-table__cell--test`:``}${n?` asset-tests-table__cell--align-end`:``}`,role:`columnheader`,"aria-sort":o.ariaSort,children:(0,u.jsxs)(`button`,{type:`button`,className:`asset-tests-table__sort-button${n?` asset-tests-table__sort-button--align-end`:``}`,onClick:()=>f(e),children:[t,(0,u.jsx)(`span`,{className:`asset-tests-table__sort-indicator`,"aria-hidden":`true`,children:o.indicator})]})},e)}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,role:`columnheader`,children:`Action`})]}),(0,u.jsx)(`div`,{className:`asset-tests-table__body`,children:d.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`asset-tests-table__row`,onClick:()=>n(`runs`,{executionId:e.uniqueId}),children:[(0,u.jsxs)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--test`,children:[(0,u.jsx)(`strong`,{title:e.name,children:e.name}),(0,u.jsx)(`span`,{children:e.packageName||`workspace`})]}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell`,"data-label":`Status`,children:(0,u.jsx)(`span`,{className:$e(e.statusTone),children:e.status??`Not executed`})}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell`,"data-label":`Type`,children:(0,u.jsx)(Rt,{resourceType:e.resourceType})}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,"data-label":`Duration`,children:Ye(e.executionTime)}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--location`,"data-label":`Location`,children:et(e)??`No path captured`}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,"data-label":`Action`,children:(0,u.jsx)(`span`,{className:`asset-tests-table__link`,children:`Open in Runs`})})]},e.uniqueId))})]})]})}function Yr(e,t){let[n,r]=(0,c.useState)(null),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!1),[l,u]=(0,c.useState)(null),d=(0,c.useRef)(0);return(0,c.useEffect)(()=>{d.current+=1;let t=d.current;if(!e){r(null),a(null),u(null),s(!1);return}let n=!1;return r(null),a(null),s(!0),u(null),w(e).then(e=>{n||d.current!==t||(r(e.compiledCode),a(e.rawCode))}).catch(e=>{n||d.current!==t||(r(null),a(null),u(e instanceof Error?e.message:`Failed to load SQL`))}).finally(()=>{!n&&d.current===t&&s(!1)}),()=>{n=!0}},[t,e]),{compiledCode:n,rawCode:i,loading:o,error:l}}function Xr(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Zr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$r={};function ei(e,t){return((t||$r).jsx?Qr:Zr).test(e)}var ti=/[ \t\n\f\r]/g;function ni(e){return typeof e==`object`?e.type===`text`?ri(e.value):!1:ri(e)}function ri(e){return e.replace(ti,``)===``}var ii=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ii.prototype.normal={},ii.prototype.property={},ii.prototype.space=void 0;function ai(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ii(n,r,t)}function oi(e){return e.toLowerCase()}var B=class{constructor(e,t){this.attribute=t,this.property=e}};B.prototype.attribute=``,B.prototype.booleanish=!1,B.prototype.boolean=!1,B.prototype.commaOrSpaceSeparated=!1,B.prototype.commaSeparated=!1,B.prototype.defined=!1,B.prototype.mustUseProperty=!1,B.prototype.number=!1,B.prototype.overloadedBoolean=!1,B.prototype.property=``,B.prototype.spaceSeparated=!1,B.prototype.space=void 0;var si=e({boolean:()=>V,booleanish:()=>H,commaOrSpaceSeparated:()=>di,commaSeparated:()=>ui,number:()=>U,overloadedBoolean:()=>li,spaceSeparated:()=>W}),ci=0,V=fi(),H=fi(),li=fi(),U=fi(),W=fi(),ui=fi(),di=fi();function fi(){return 2**++ci}var pi=Object.keys(si),mi=class extends B{constructor(e,t,n,r){let i=-1;if(super(e,t),hi(this,`space`,r),typeof n==`number`)for(;++i<pi.length;){let e=pi[i];hi(this,pi[i],(n&si[e])===si[e])}}};mi.prototype.defined=!0;function hi(e,t,n){n&&(e[t]=n)}function gi(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new mi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[oi(r)]=r,n[oi(a.attribute)]=r}return new ii(t,n,e.space)}var _i=gi({properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:H,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:W,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:U,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:W,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:H,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function vi(e,t){return t in e?e[t]:t}function yi(e,t){return vi(e,t.toLowerCase())}var bi=gi({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ui,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:W,autoFocus:V,autoPlay:V,blocking:W,capture:null,charSet:null,checked:V,cite:null,className:W,cols:U,colSpan:null,content:null,contentEditable:H,controls:V,controlsList:W,coords:U|ui,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:li,draggable:H,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:W,height:U,hidden:li,high:U,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:W,itemRef:W,itemScope:V,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:V,optimum:U,pattern:null,ping:W,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:W,required:V,reversed:V,rows:U,rowSpan:U,sandbox:W,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:H,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:H,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:H,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:V,disableRemotePlayback:V,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:yi}),xi=gi({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:di,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:W,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ui,g2:ui,glyphName:ui,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:di,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:di,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:di,rev:di,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:di,requiredFeatures:di,requiredFonts:di,requiredFormats:di,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:di,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:di,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:di,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:vi}),Si=gi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Ci=gi({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:yi}),wi=gi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ti={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Ei=/[A-Z]/g,Di=/-[a-z]/g,Oi=/^data[-\w.:]+$/i;function ki(e,t){let n=oi(t),r=t,i=B;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Oi.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Di,ji);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Di.test(e)){let n=e.replace(Ei,Ai);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=mi}return new i(r,t)}function Ai(e){return`-`+e.toLowerCase()}function ji(e){return e.charAt(1).toUpperCase()}var Mi=ai([_i,bi,Si,Ci,wi],`html`),Ni=ai([_i,xi,Si,Ci,wi],`svg`);function Pi(e){return e.join(` `).trim()}var Fi=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
2
|
-
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),Ii=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(Fi());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Li=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Ri=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ii()),r=Li();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),zi=Vi(`end`),Bi=Vi(`start`);function Vi(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Hi(e){let t=Bi(e),n=zi(e);if(t&&n)return{start:t,end:n}}function Ui(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Gi(e.position):`start`in e||`end`in e?Gi(e):`line`in e||`column`in e?Wi(e):``}function Wi(e){return Ki(e&&e.line)+`:`+Ki(e&&e.column)}function Gi(e){return Wi(e&&e.start)+`-`+Wi(e&&e.end)}function Ki(e){return e&&typeof e==`number`?e:1}var G=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ui(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};G.prototype.file=``,G.prototype.name=``,G.prototype.reason=``,G.prototype.message=``,G.prototype.stack=``,G.prototype.column=void 0,G.prototype.line=void 0,G.prototype.ancestors=void 0,G.prototype.cause=void 0,G.prototype.fatal=void 0,G.prototype.place=void 0,G.prototype.ruleId=void 0,G.prototype.source=void 0;var qi=t(Ri(),1),Ji={}.hasOwnProperty,Yi=new Map,Xi=/[A-Z]/g,Zi=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Qi=new Set([`td`,`th`]),$i=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function ea(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=da(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=ua(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Ni:Mi,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ta(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ta(e,t,n){if(t.type===`element`)return na(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return ra(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return aa(e,t,n);if(t.type===`mdxjsEsm`)return ia(e,t);if(t.type===`root`)return oa(e,t,n);if(t.type===`text`)return sa(e,t)}function na(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ni,e.schema=i),e.ancestors.push(t);let a=_a(e,t.tagName,!1),o=fa(e,t),s=ma(e,t);return Zi.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!ni(e):!0})),ca(e,o,a,t),la(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ra(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}va(e,t.position)}function ia(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);va(e,t.position)}function aa(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ni,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:_a(e,t.name,!0),o=pa(e,t),s=ma(e,t);return ca(e,o,a,t),la(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function oa(e,t,n){let r={};return la(r,ma(e,t)),e.create(t,e.Fragment,r,n)}function sa(e,t){return t.value}function ca(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function la(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ua(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function da(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Bi(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function fa(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ji.call(t.properties,i)){let a=ha(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Qi.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function pa(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else va(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else va(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function ma(e,t){let n=[],r=-1,i=e.passKeys?new Map:Yi;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=ta(e,a,o);s!==void 0&&n.push(s)}return n}function ha(e,t,n){let r=ki(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Xr(n):Pi(n)),r.property===`style`){let t=typeof n==`object`?n:ga(e,String(n));return e.stylePropertyNameCase===`css`&&(t=ya(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ti[r.property]||r.property:r.attribute,n]}}function ga(e,t){try{return(0,qi.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new G("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=$i+`#cannot-parse-style-attribute`,r}}function _a(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ei(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ei(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ji.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);va(e)}function va(e,t){let n=new G("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=$i+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function ya(e){let t={},n;for(n in e)Ji.call(e,n)&&(t[ba(n)]=e[n]);return t}function ba(e){let t=e.replace(Xi,xa);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function xa(e){return`-`+e.toLowerCase()}var Sa={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Ca={};function wa(e,t){let n=t||Ca;return Ta(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Ta(e,t,n){if(Da(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Ea(e.children,t,n)}return Array.isArray(e)?Ea(e,t,n):``}function Ea(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Ta(e[i],t,n);return r.join(``)}function Da(e){return!!(e&&typeof e==`object`)}var Oa=document.createElement(`i`);function ka(e){let t=`&`+e+`;`;Oa.innerHTML=t;let n=Oa.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function Aa(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ja(e,t){return e.length>0?(Aa(e,e.length,0,t),e):t}var Ma={}.hasOwnProperty;function Na(e){let t={},n=-1;for(;++n<e.length;)Pa(t,e[n]);return t}function Pa(e,t){let n;for(n in t){let r=(Ma.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ma.call(r,a)||(r[a]=[]);let e=i[a];Fa(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Fa(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Aa(e,0,0,r)}function Ia(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function La(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var K=Ga(/[A-Za-z]/),q=Ga(/[\dA-Za-z]/),Ra=Ga(/[#-'*+\--9=?A-Z^-~]/);function za(e){return e!==null&&(e<32||e===127)}var Ba=Ga(/\d/),Va=Ga(/[\dA-Fa-f]/),Ha=Ga(/[!-/:-@[-`{-~]/);function J(e){return e!==null&&e<-2}function Y(e){return e!==null&&(e<0||e===32)}function X(e){return e===-2||e===-1||e===32}var Ua=Ga(/\p{P}|\p{S}/u),Wa=Ga(/\s/);function Ga(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ka(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&q(e.charCodeAt(n+1))&&q(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return X(r)?(e.enter(n),s(r)):t(r)}function s(r){return X(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var qa={tokenize:Ja};function Ja(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return J(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Ya={tokenize:Za},Xa={tokenize:Qa};function Za(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Aa(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xa,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Xa,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return J(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Aa(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Qa(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function $a(e){if(e===null||Y(e)||Wa(e))return 1;if(Ua(e))return 2}function eo(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var to={name:`attention`,resolveAll:no,tokenize:ro};function no(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};io(d,-c),io(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ja(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ja(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ja(l,eo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ja(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ja(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Aa(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ro(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=$a(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=$a(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function io(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ao={name:`autolink`,tokenize:oo};function oo(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return K(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||q(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||q(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||za(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ra(t)?(e.consume(t),l):n(t)}function u(e){return q(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||q(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var so={partial:!0,tokenize:co};function co(e,t,n){return r;function r(t){return X(t)?Z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||J(e)?t(e):n(e)}}var lo={continuation:{tokenize:fo},exit:po,name:`blockQuote`,tokenize:uo};function uo(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return X(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function fo(e,t,n){let r=this;return i;function i(t){return X(t)?Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(lo,t,n)(r)}}function po(e){e.exit(`blockQuote`)}var mo={name:`characterEscape`,tokenize:ho};function ho(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ha(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var go={name:`characterReference`,tokenize:_o};function _o(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=q,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Va,u):(e.enter(`characterReferenceValue`),a=7,o=Ba,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===q&&!ka(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var vo={partial:!0,tokenize:xo},yo={concrete:!0,name:`codeFenced`,tokenize:bo};function bo(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||J(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(vo,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Z(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||J(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&X(t)?Z(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||J(t)?e.check(vo,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||J(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),X(t)?Z(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||J(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function xo(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var So={name:`codeIndented`,tokenize:wo},Co={partial:!0,tokenize:To};function wo(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Z(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):J(t)?e.attempt(Co,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||J(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function To(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Z(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):J(e)?i(e):n(e)}}var Eo={name:`codeText`,previous:Oo,resolve:Do,tokenize:ko};function Do(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Oo(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function ko(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||J(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Ao=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&jo(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),jo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),jo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);jo(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);jo(this.left,t.reverse())}}};function jo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Mo(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Ao(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,No(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Aa(e,0,1/0,u.slice(0)),!l}function No(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Po={resolve:Io,tokenize:Lo},Fo={partial:!0,tokenize:Ro};function Io(e){return Mo(e),e}function Lo(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):J(t)?e.check(Fo,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Ro(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,a,`linePrefix`)}function a(i){if(i===null||J(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function zo(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||za(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||J(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Y(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||za(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Bo(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):J(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||J(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!X(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Vo(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||J(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ho(e,t){let n;return r;function r(i){return J(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):X(i)?Z(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Uo={name:`definition`,tokenize:Go},Wo={partial:!0,tokenize:Ko};function Go(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Bo.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=La(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Y(t)?Ho(e,l)(t):l(t)}function l(t){return zo(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Wo,d,d)(t)}function d(t){return X(t)?Z(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||J(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ko(e,t,n){return r;function r(t){return Y(t)?Ho(e,i)(t):n(t)}function i(t){return Vo(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return X(t)?Z(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||J(e)?t(e):n(e)}}var qo={name:`hardBreakEscape`,tokenize:Jo};function Jo(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return J(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Yo={name:`headingAtx`,resolve:Xo,tokenize:Zo};function Xo(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Aa(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Zo(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Y(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||J(n)?(e.exit(`atxHeading`),t(n)):X(n)?Z(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Y(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Qo=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),$o=[`pre`,`script`,`style`,`textarea`],es={concrete:!0,name:`htmlFlow`,resolveTo:rs,tokenize:is},ts={partial:!0,tokenize:os},ns={partial:!0,tokenize:as};function rs(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function is(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):K(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):K(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return K(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Y(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&$o.includes(l)?(i=1,r.interrupt?t(s):O(s)):Qo.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||q(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return X(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||K(t)?(e.consume(t),b):X(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):X(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):X(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||J(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Y(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||X(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||J(t)?O(t):X(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):J(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(ts,I,k)(t)):t===null||J(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(ns,A,I)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||J(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),P):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return $o.includes(n)?(e.consume(t),F):O(t)}return K(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function N(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||J(t)?(e.exit(`htmlFlowData`),I(t)):(e.consume(t),F)}function I(n){return e.exit(`htmlFlow`),t(n)}}function as(e,t,n){let r=this;return i;function i(t){return J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function os(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(so,t,n)}}var ss={name:`htmlText`,tokenize:cs};function cs(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):K(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):K(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):J(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):J(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):J(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):J(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return K(t)?(e.consume(t),S):n(t)}function S(t){return t===45||q(t)?(e.consume(t),S):C(t)}function C(t){return J(t)?(o=C,M(t)):X(t)?(e.consume(t),C):j(t)}function w(t){return t===45||q(t)?(e.consume(t),w):t===47||t===62||Y(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||K(t)?(e.consume(t),E):J(t)?(o=T,M(t)):X(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):J(t)?(o=D,M(t)):X(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):J(t)?(o=O,M(t)):X(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):J(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Y(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||Y(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return X(t)?Z(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var ls={name:`labelEnd`,resolveAll:ps,resolveTo:ms,tokenize:hs},us={tokenize:gs},ds={tokenize:_s},fs={tokenize:vs};function ps(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Aa(e,0,e.length,n),e}function ms(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=ja(s,e.slice(a+1,a+r+3)),s=ja(s,[[`enter`,u,t]]),s=ja(s,eo(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=ja(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=ja(s,e.slice(o+1)),s=ja(s,[[`exit`,c,t]]),Aa(e,a,e.length,s),e}function hs(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(La(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(us,u,o?u:d)(t):t===91?e.attempt(ds,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(fs,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function gs(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Y(t)?Ho(e,a)(t):a(t)}function a(t){return t===41?u(t):zo(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Y(t)?Ho(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Vo(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Y(t)?Ho(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function _s(e,t,n){let r=this;return i;function i(t){return Bo.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(La(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function vs(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var ys={name:`labelStartImage`,resolveAll:ls.resolveAll,tokenize:bs};function bs(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var xs={name:`labelStartLink`,resolveAll:ls.resolveAll,tokenize:Ss};function Ss(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Cs={name:`lineEnding`,tokenize:ws};function ws(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}}var Ts={name:`thematicBreak`,tokenize:Es};function Es(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||J(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),X(t)?Z(e,s,`whitespace`)(t):s(t))}}var Q={continuation:{tokenize:As},exit:Ms,name:`list`,tokenize:ks},Ds={partial:!0,tokenize:Ns},Os={partial:!0,tokenize:js};function ks(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ba(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ts,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ba(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(so,r.interrupt?n:u,e.attempt(Ds,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return X(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function As(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(so,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Z(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!X(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Os,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Z(e,e.attempt(Q,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function js(e,t,n){let r=this;return Z(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Ms(e){e.exit(this.containerState.type)}function Ns(e,t,n){let r=this;return Z(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!X(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ps={name:`setextUnderline`,resolveTo:Fs,tokenize:Is};function Fs(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Is(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),X(t)?Z(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||J(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Ls={tokenize:Rs};function Rs(e){let t=this,n=e.attempt(so,r,e.attempt(this.parser.constructs.flowInitial,i,Z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Po,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var zs={resolveAll:Us()},Bs=Hs(`string`),Vs=Hs(`text`);function Hs(e){return{resolveAll:Us(e===`text`?Ws:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Us(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Ws(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Gs=e({attentionMarkers:()=>$s,contentInitial:()=>qs,disable:()=>ec,document:()=>Ks,flow:()=>Ys,flowInitial:()=>Js,insideSpan:()=>Qs,string:()=>Xs,text:()=>Zs}),Ks={42:Q,43:Q,45:Q,48:Q,49:Q,50:Q,51:Q,52:Q,53:Q,54:Q,55:Q,56:Q,57:Q,62:lo},qs={91:Uo},Js={[-2]:So,[-1]:So,32:So},Ys={35:Yo,42:Ts,45:[Ps,Ts],60:es,61:Ps,95:Ts,96:yo,126:yo},Xs={38:go,92:mo},Zs={[-5]:Cs,[-4]:Cs,[-3]:Cs,33:ys,38:go,42:to,60:[ao,ss],91:xs,92:[qo,mo],93:ls,95:to,96:Eo},Qs={null:[to,zs]},$s={null:[42,95]},ec={null:[]};function tc(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=ja(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=eo(a,l.events,l),l.events):[]}function f(e,t){return rc(p(e),t)}function p(e){return nc(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){J(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Aa(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function nc(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function rc(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
1
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-Dw2cE7zH.js";import{i as r,n as i,r as a,t as o}from"./react-vendor-DL38pS2M.js";import{t as s}from"./tanstack-virtual-vendor-DdCr1qam.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var c=t(r(),1),l=i(),u=o();function d({message:e}){return(0,u.jsx)(`div`,{className:`error-banner`,children:e})}var f=typeof window<`u`?new URLSearchParams(window.location.search).get(`debug`)===`1`:!1;function p(...e){f&&console.log(`[dbt-tools]`,...e)}function m(e){!f||typeof performance>`u`||performance.mark(e)}function h(e,t,n){if(!f||typeof performance>`u`)return;performance.measure(e,t,n);let r=performance.getEntriesByName(e,`measure`),i=r[r.length-1];i&&p(`${e}: ${i.duration.toFixed(1)}ms`)}var g=`Unexpected analysis worker response`,_=`Unexpected resource-code worker response`,v=`Unexpected search-resources worker response`,y=`search-resources`,b=class{worker;requestId=0;pending=new Map;constructor(){this.worker=new Worker(new URL(`/assets/analysis.worker-DCy3HfXU.js`,``+import.meta.url),{type:`module`}),this.worker.onmessage=e=>{this.handleMessage(e.data)},this.worker.onerror=e=>{let t=e.message||`Analysis worker failed`;for(let e of this.pending.values())e.reject(Error(t));this.pending.clear()}}async loadAnalysis(e,t,n){let r=this.requestId+1;this.requestId=r;let i=`analysis-load:${r}:dispatch`,a=`analysis-load:${r}:ready`,o=`analysis-load:${r}:analysis-ready`;m(i);let s={type:`load-analysis`,protocolVersion:2,requestId:r,manifestBytes:e,runResultsBytes:t,source:n},c=new Promise((e,t)=>{this.pending.set(r,{kind:`load`,resolve:e,reject:t,source:n})});return this.worker.postMessage(s,[e,t]),c.then(e=>(m(a),h(o,i,a),p(`Analysis worker ready`,{requestId:r,source:n,timings:e.metrics.timings}),{...e,metrics:{...e.metrics,dispatchMarkName:i,readyMarkName:a,analysisReadyMeasureName:o}}))}async requestResourceCode(e){let t=this.requestId+1;this.requestId=t;let n={type:`get-resource-code`,protocolVersion:2,requestId:t,uniqueId:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:`resource-code`,resolve:e,reject:n})});return this.worker.postMessage(n),r}async searchResources(e){let t=this.requestId+1;this.requestId=t;let n={type:y,protocolVersion:2,requestId:t,query:e},r=new Promise((e,n)=>{this.pending.set(t,{kind:y,resolve:e,reject:n})});return this.worker.postMessage(n),r}terminate(){this.worker.terminate();for(let e of this.pending.values())e.reject(Error(`Analysis worker terminated`));this.pending.clear()}handleMessage(e){let t=this.pending.get(e.requestId);if(t){if(this.pending.delete(e.requestId),t.kind===`load`){if(e.type===`analysis-error`){t.reject(Error(e.message));return}if(e.type===`analysis-ready`){t.resolve({analysis:e.analysis,metrics:{requestId:e.requestId,source:t.source,dispatchMarkName:``,readyMarkName:``,analysisReadyMeasureName:``,timings:e.timings}});return}t.reject(Error(g));return}if(t.kind===`resource-code`){if(e.type===`resource-code-error`){t.reject(Error(e.message));return}if(e.type===`resource-code-ready`){t.resolve({compiledCode:e.compiledCode,rawCode:e.rawCode});return}t.reject(Error(_));return}if(t.kind===y){if(e.type===`search-resources-error`){t.reject(Error(e.message));return}if(e.type===`search-resources-ready`){t.resolve(e.resources);return}t.reject(Error(v))}}}},x=null;function S(){return x??=new b,x}async function C(e,t,n){return S().loadAnalysis(e,t,n)}async function w(e){return S().requestResourceCode(e)}async function T(e){return S().searchResources(e)}var E=8;function D(e,t){return!e||t.query.trim()?[]:t.recentResourceIds.map(t=>e.resources.find(e=>e.uniqueId===t)??null).filter(e=>e!=null).slice(0,E)}function O(e,t){let n=t.query.trim(),r=(0,c.useMemo)(()=>D(e,t),[e,t.query,t.recentResourceIds]),[i,a]=(0,c.useState)([]),[o,s]=(0,c.useState)(!1),l=(0,c.useRef)(0);return(0,c.useEffect)(()=>{if(!e||!n){l.current+=1,a([]),s(!1);return}l.current+=1;let r=l.current,i=!1;return a([]),s(!0),T(t.query).then(e=>{!i&&l.current===r&&(a(e),s(!1))}).catch(()=>{!i&&l.current===r&&(a([]),s(!1))}),()=>{i=!0}},[e,n,t.query]),n?{results:i,loading:o}:{results:r,loading:!1}}function k(e){return e===`preload`?`Live target`:e===`remote`?`Remote source`:e===`upload`?`Local upload`:`Waiting for artifacts`}function A(e){return e===`preload`?`DBT_TOOLS_TARGET_DIR`:e===`remote`?`REMOTE SOURCE`:e===`upload`?`UPLOADED`:`ARTIFACTS`}var ee=`/assets/app-logo-ByfNNtT8.svg`;function j({className:e,size:t,title:n,testId:r}){return(0,u.jsx)(`img`,{src:ee,alt:n??``,"aria-hidden":n?void 0:!0,className:e,style:t?{width:`${t}px`,height:`${t}px`}:void 0,"data-testid":r})}var M=[{id:`health`,view:`health`,label:`Health`},{id:`timeline`,view:`timeline`,label:`Timeline`},{id:`inventory`,view:`inventory`,label:`Inventory`},{id:`runs`,view:`runs`,label:`Runs`}],te=new Set([`health`,`inventory`,`runs`,`timeline`,`settings`,`overview`,`catalog`,`execution`,`quality`,`dependencies`,`search`]);function N(e){let t=new URLSearchParams(e).get(`view`);return t===`lineage`||t===`dependencies`}function P(e){switch(e){case`overview`:return`health`;case`catalog`:return`inventory`;case`execution`:case`quality`:return`runs`;case`dependencies`:case`lineage`:return`inventory`;case`search`:return`inventory`;case`runs`:case`timeline`:case`inventory`:case`health`:case`settings`:return e;default:return`health`}}function F(e){let t=new URLSearchParams(e),n=t.get(`view`);return n?n===`runs`&&t.get(`tab`)===`timeline`?`timeline`:n===`lineage`||n===`dependencies`?`inventory`:te.has(n)?P(n):null:null}function I(e){return new URLSearchParams(e).get(`resource`)}function ne(e){return new URLSearchParams(e).get(`selected`)}function re(e){let t=new URLSearchParams(e).get(`assetTab`);return t===`summary`||t===`lineage`||t===`sql`||t===`runtime`||t===`tests`?t:null}function ie(e){return re(e)??(N(e)?`lineage`:`summary`)}function ae(e){let t=new URLSearchParams(e).get(`kind`);return t===`all`||t===`models`||t===`tests`||t===`seeds`||t===`snapshots`||t===`operations`?t:null}function oe(e){let t=new URLSearchParams(e).get(`adapter`);if(t==null||t===``)return!0;let n=t.trim().toLowerCase();return!(n===`0`||n===`false`||n===`no`)}function se(e){let t=new URLSearchParams(e).get(`lens`);return t===`status`||t===`type`||t===`coverage`?t:null}function ce(e){let t=new URLSearchParams(e).get(`up`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function le(e){let t=new URLSearchParams(e).get(`down`);if(t==null||t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function ue(e){let t=new URLSearchParams(e).get(`allDeps`);return t===`1`?!0:t===`0`?!1:null}function de(e){return Math.max(0,Math.min(10,e))}function fe(e){let t=I(e),n=new URLSearchParams(e).get(`selected`),r=re(e),i=N(e)||r===`lineage`,a=ce(e),o=le(e),s=ue(e),c=se(e);return{rootResourceId:t,selectedResourceId:i?n??t:t,upstreamDepth:de(a??2),downstreamDepth:de(o??2),allDepsMode:s??!1,lensMode:c??`type`,activeLegendKeys:new Set}}var pe=`dbt-tools.sidebarCollapsed`;function me(e=!0){try{let e=window.localStorage.getItem(pe);if(e!==null)return e===`true`}catch{}return e}function he(e,t){return P(t)===e.view}function ge({id:e}){let t={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,width:20,height:20,"aria-hidden":!0};return e===`health`?(0,u.jsx)(`svg`,{...t,children:(0,u.jsx)(`polyline`,{points:`2,12 6,12 8,5 10,19 13,12 15,12 17,8 19,12 22,12`})}):e===`runs`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`rect`,{x:`3`,y:`4`,width:`3`,height:`16`,rx:`1`}),(0,u.jsx)(`rect`,{x:`9`,y:`8`,width:`3`,height:`12`,rx:`1`}),(0,u.jsx)(`rect`,{x:`15`,y:`6`,width:`3`,height:`14`,rx:`1`}),(0,u.jsx)(`rect`,{x:`21`,y:`10`,width:`0`,height:`0`}),(0,u.jsx)(`line`,{x1:`3`,y1:`20`,x2:`21`,y2:`20`})]}):e===`timeline`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M4 18V7`}),(0,u.jsx)(`path`,{d:`M10 18V11`}),(0,u.jsx)(`path`,{d:`M16 18V5`}),(0,u.jsx)(`path`,{d:`M2 18h20`}),(0,u.jsx)(`path`,{d:`M4 9h3M10 13h3M16 7h3`})]}):e===`inventory`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M2 7l10-4 10 4-10 4-10-4z`}),(0,u.jsx)(`path`,{d:`M2 12l10 4 10-4`}),(0,u.jsx)(`path`,{d:`M2 17l10 4 10-4`})]}):e===`settings`?(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,u.jsx)(`path`,{d:`M12 2.75v2.5`}),(0,u.jsx)(`path`,{d:`M12 18.75v2.5`}),(0,u.jsx)(`path`,{d:`M21.25 12h-2.5`}),(0,u.jsx)(`path`,{d:`M5.25 12h-2.5`}),(0,u.jsx)(`path`,{d:`M18.54 5.46l-1.77 1.77`}),(0,u.jsx)(`path`,{d:`M7.23 16.77l-1.77 1.77`}),(0,u.jsx)(`path`,{d:`M18.54 18.54l-1.77-1.77`}),(0,u.jsx)(`path`,{d:`M7.23 7.23L5.46 5.46`})]}):(0,u.jsxs)(`svg`,{...t,children:[(0,u.jsx)(`path`,{d:`M4 7h16`}),(0,u.jsx)(`path`,{d:`M4 12h9`}),(0,u.jsx)(`path`,{d:`M4 17h13`})]})}var _e=`Waiting for artifacts`;function ve({activeView:e,setNavigationTarget:t,sidebarCollapsed:n,setSidebarCollapsed:r,onNavigate:i,analysis:a,analysisSource:o}){let s=k(o);return(0,u.jsxs)(`aside`,{id:`app-sidebar`,className:`app-sidebar${n?` app-sidebar--collapsed`:``}`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`app-sidebar__brand-link`,onClick:()=>{t({view:`health`}),i()},title:`Go to Health`,children:[(0,u.jsx)(j,{className:`app-logo app-logo--brand`}),!n&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`dbt-tools`}),(0,u.jsx)(`span`,{children:`Artifact operations console`})]})]}),(0,u.jsx)(`nav`,{className:`app-sidebar__nav`,"aria-label":`Workspace sections`,children:(0,u.jsx)(`div`,{className:`nav-group`,children:M.map(n=>{let r=!a;return(0,u.jsxs)(`button`,{type:`button`,className:he(n,e)?`sidebar-link sidebar-link--active`:`sidebar-link`,disabled:r,onClick:()=>{t(n),i()},"aria-label":n.label,title:n.label,children:[(0,u.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,u.jsx)(ge,{id:n.id})}),(0,u.jsx)(`div`,{className:`sidebar-link__body`,children:(0,u.jsx)(`strong`,{children:n.label})})]},n.id)})})}),(0,u.jsx)(`button`,{type:`button`,className:`sidebar-toggle`,onClick:()=>r(e=>!e),"aria-label":n?`Expand sidebar`:`Collapse sidebar`,children:n?`›`:`‹`}),(0,u.jsxs)(`div`,{className:`app-sidebar__footer`,children:[(0,u.jsxs)(`button`,{type:`button`,className:e===`settings`?`sidebar-link sidebar-link--active sidebar-settings-trigger`:`sidebar-link sidebar-settings-trigger`,onClick:()=>{t({view:`settings`}),i()},"aria-current":e===`settings`?`page`:void 0,"aria-label":`Open settings`,title:`Settings`,children:[(0,u.jsx)(`span`,{className:`sidebar-link__icon`,children:(0,u.jsx)(ge,{id:`settings`})}),!n&&(0,u.jsx)(`div`,{className:`sidebar-link__body`,children:(0,u.jsx)(`strong`,{children:`Settings`})})]}),!n&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`sidebar-settings-divider`}),(0,u.jsxs)(`div`,{className:`app-sidebar__session`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Session`}),(0,u.jsx)(`strong`,{children:s}),(0,u.jsx)(`span`,{children:a?`${a.summary.total_nodes} executions analyzed`:_e})]})]})]})]})}function ye({pendingRemoteRun:e,acceptingRemoteRun:t,onAcceptPendingRemoteRun:n}){return e==null?null:(0,u.jsxs)(`section`,{className:`remote-update-banner`,"aria-label":`Remote update available`,children:[(0,u.jsxs)(`div`,{className:`remote-update-banner__copy`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Remote update available`}),(0,u.jsx)(`strong`,{children:e.label}),(0,u.jsx)(`span`,{children:`A newer complete remote artifact pair is ready. Keep the current investigation until you decide to switch.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`primary-action`,onClick:()=>void n(),disabled:t,children:t?`Switching…`:`Load latest remote run`})]})}function be(e){return e?e.fail+e.error+e.warn+e.skipped>0:!1}var L={accent:`#635BFF`,text:`#171C28`,textSoft:`#6B7385`,bg:`#F6F7FB`,bgSoft:`#FFFFFF`,borderDefault:`#D7DCE7`,borderSubtle:`#E6E9F0`,slate:`#64748B`,rose:`#C0352B`,mint:`#0F8A4B`,amber:`#A56315`},R={accent:`#8A7CFF`,text:`#F3F6FC`,textSoft:`#98A3BC`,bg:`#0D1120`,bgSoft:`#151A2E`,borderDefault:`#313A58`,borderSubtle:`#262E47`,slate:`#8690AA`,rose:`#FF8D86`,mint:`#59D38C`,amber:`#F5B95C`};function xe(e){return e===`dark`?R:L}var Se={success:L.mint,error:L.rose,skipped:L.slate,"run error":L.rose,pass:L.mint,fail:L.rose,warn:L.amber,"no op":L.slate},Ce={success:R.mint,error:R.rose,skipped:R.slate,"run error":R.rose,pass:R.mint,fail:R.rose,warn:R.amber,"no op":R.slate},we=`#059669`,Te=`#45c49a`,Ee=`rgba(100, 116, 139, 0.14)`,De=`rgba(134, 144, 170, 0.2)`,Oe=`rgba(5, 150, 105, 0.14)`,ke=`rgba(69, 196, 154, 0.2)`,Ae={model:`#1D4ED8`,test:`#64748B`,seed:`#635BFF`,snapshot:`#D97706`,source:we,source_freshness:we,exposure:`#EA580C`,metric:`#DB2777`,semantic_model:`#0891B2`,analysis:`#64748B`,unit_test:`#64748B`},je={model:`#5c8deb`,test:`#8690aa`,seed:`#9588e8`,snapshot:`#d4a24a`,source:Te,source_freshness:Te,exposure:`#d9845c`,metric:`#d172ae`,semantic_model:`#3eb0c8`,analysis:`#8690aa`,unit_test:`#8690aa`},Me={model:`rgba(29, 78, 216, 0.14)`,test:Ee,seed:`rgba(99, 91, 255, 0.14)`,snapshot:`rgba(217, 119, 6, 0.14)`,source:Oe,source_freshness:Oe,semantic_model:`rgba(8, 145, 178, 0.14)`,metric:`rgba(219, 39, 119, 0.14)`,exposure:`rgba(234, 88, 12, 0.14)`,analysis:Ee,unit_test:Ee},Ne={model:`rgba(92, 141, 235, 0.22)`,test:De,seed:`rgba(149, 136, 232, 0.22)`,snapshot:`rgba(212, 162, 74, 0.22)`,source:ke,source_freshness:ke,semantic_model:`rgba(62, 176, 200, 0.22)`,metric:`rgba(209, 114, 174, 0.22)`,exposure:`rgba(217, 132, 92, 0.22)`,analysis:De,unit_test:De};function Pe(e){return e===`dark`?je:Ae}function Fe(e){return e===`dark`?Ne:Me}function Ie(e,t){let n=Fe(t);return e&&n[e]?n[e]:t===`dark`?De:Ee}var Le={rowStripe:`#F1F3F8`,rowStripeHover:`#EEF0FF`,labelText:L.text,metaText:L.textSoft,axisTick:L.slate,gridLine:`#E6E9F0`,barHoverStroke:L.accent,testFailStripe:`rgba(192, 53, 43, 0.9)`,testSkipStripe:`rgba(165, 99, 21, 0.88)`,hullStroke:`#C8CEDB`,hullFill:`rgba(230, 233, 240, 0.35)`},Re={rowStripe:`#101527`,rowStripeHover:`#232845`,labelText:R.text,metaText:R.textSoft,axisTick:R.slate,gridLine:`#262E47`,barHoverStroke:R.accent,testFailStripe:`rgba(255, 141, 134, 0.88)`,testSkipStripe:`rgba(245, 185, 92, 0.88)`,hullStroke:`#2E3759`,hullFill:`rgba(38, 46, 71, 0.4)`};function ze(e){return e===`dark`?Re:Le}function Be(e){let t=xe(e);return{positive:t.mint,warning:t.amber,danger:t.rose,neutral:t.slate,skipped:t.accent}}var Ve=`workspace-pill workspace-pill--active`,He=`workspace-pill`,Ue=[{key:`model`,label:`Models`},{key:`source`,label:`Sources`},{key:`tests`,label:`Tests`},{key:`snapshot`,label:`Snapshots`},{key:`metric`,label:`Metrics`},{key:`semantic_model`,label:`Semantic models`}],We=new Set([`model`,`seed`,`snapshot`,`source`,`source_freshness`,`test`,`unit_test`,`metric`,`semantic_model`]),z=new Set([`test`,`unit_test`]),Ge=[...We].filter(e=>!z.has(e)).sort((e,t)=>e.localeCompare(t)),Ke=new Set([`model`,`seed`,`snapshot`,`source`]),qe={project:`Project`,database:`Database`};function Je(e){return e.statusTone===`danger`&&!z.has(e.resourceType)&&e.resourceType!==`operation`&&e.resourceType!==`sql_operation`}function Ye(e){return typeof e!=`number`||Number.isNaN(e)?`n/a`:e>=60?`${Math.floor(e/60)}m ${(e%60).toFixed(2).padStart(5,`0`)}s`:e>=10?`${e.toFixed(1)}s`:`${e.toFixed(2)}s`}function Xe(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Ze(e){return new Date(e).toLocaleString(`en-US`,{dateStyle:`medium`,timeStyle:`short`})}function Qe(e){return e.runStartedAt}function $e(e){return`tone-badge tone-badge--${e}`}function et(e){return tt(e.originalFilePath??e.patchPath??e.path)}function tt(e){if(!e)return null;let t=e.includes(`://`)?e.split(`://`)[1]??null:e;if(!t)return null;let n=t.split(`/`).map(e=>e.trim()).filter(Boolean).join(`/`);return n.length>0?n:null}function nt(e,t){if(!t)return!0;let n=t.trim().toLowerCase();return n?[e.name,e.resourceType,e.packageName,e.path??``,e.originalFilePath??``,e.patchPath??``,e.uniqueId].some(e=>e.toLowerCase().includes(n)):!0}function rt(e,t,n){return t===`all`?!0:t===`issues`?e.statusTone===`danger`?!0:be(n?.get(e.uniqueId)):e.statusTone===t}function it(e,t){return t.size===0||t.has(e.resourceType)}function at(e,t){if(!t)return!0;let n=t.trim().toLowerCase();return n?[e.name,e.resourceType,e.packageName,e.path??``,e.uniqueId,e.status,e.threadId??``].some(e=>e.toLowerCase().includes(n)):!0}function ot(e,t){return t===`all`?!0:t===`issues`?e.statusTone===`danger`||e.statusTone===`warning`:e.statusTone===t}function st(e){if(e.length===0)return null;let t={};for(let n of e)n.packageName&&(t[n.packageName]=(t[n.packageName]??0)+1);return Object.entries(t).sort((e,t)=>t[1]-e[1])[0]?.[0]??null}function ct(e,t){return t!=null&&e.packageName===t}function lt({name:e,packageName:t,path:n}){let r=e.toLowerCase(),i=t.toLowerCase(),a=(n??``).toLowerCase();return new Set([`dbt_artifacts_hashes`,`dbt_columns`,`dbt_exposures`,`dbt_groups`,`dbt_invocations`,`dbt_metrics`,`dbt_models`,`dbt_run_results`,`dbt_seeds`,`dbt_snapshots`,`dbt_source_freshness_results`,`dbt_sources`,`dbt_tests`,`elementary_test_results`,`job_run_results`,`locations`,`metadata`,`metricflow_time_spine`,`model_run_results`,`schema_columns_snapshot`,`seed_run_results`,`snapshot_run_results`,`test_result_rows`]).has(r)||r.startsWith(`dbt_`)||r.startsWith(`alerts_dbt_`)||a.includes(`/edr/`)||a.includes(`/dbt_artifacts/`)||a.includes(`/run_results/`)||a.includes(`/manifest/`)||a.includes(`/catalog/`)||i===`elementary`&&(r.includes(`dbt_`)||a.includes(`/edr/dbt_artifacts/`))}function ut(e){return new Set(e.filter(e=>e!==`macro`&&e!==`test`&&e!==`unit_test`))}function dt(e,t){return!We.has(e.resourceType)||z.has(e.resourceType)||lt(e)?!1:t==null?!0:e.packageName===t}function ft(e){return e.some(e=>e.compileStart!=null&&e.compileEnd!=null&&e.compileEnd>e.compileStart&&e.executeStart!=null&&e.executeEnd!=null&&e.executeEnd>e.executeStart)}function pt(e,t){let n=0;for(let r of e)z.has(r.resourceType??``)&&(lt(r)||t!=null&&r.packageName!==t||n++);return n}function mt(e,t,n){return e.filter(e=>n&&!ot(e,t.status)||t.resourceTypes.size>0&&!t.resourceTypes.has(e.resourceType)?!1:at(e,t.query))}function ht(e,t){let n=t?.denominatorTotal??e.length,r=new Map;for(let t of e){let e=r.get(t.status)??{count:0,duration:0,tone:t.statusTone};e.count+=1,e.duration+=t.executionTime,r.set(t.status,e)}return[...r.entries()].map(([e,t])=>({status:e,count:t.count,duration:t.duration,share:n>0?t.count/n:0,tone:t.tone})).sort((e,t)=>t.count-e.count)}function gt(e,t){let n=new Map;for(let e of t)n.set(e.resourceType,(n.get(e.resourceType)??0)+1);let r=new Map;for(let t of e){let e=r.get(t.resourceType)??[];e.push(t),r.set(t.resourceType,e)}return[...r.entries()].map(([e,t])=>{let r=n.get(e)??0;return{resourceType:e,count:t.length,duration:t.reduce((e,t)=>e+t.executionTime,0),rowDenominatorCount:r,statusBreakdown:ht(t,{denominatorTotal:r})}}).sort((e,t)=>t.count-e.count)}function _t(e){let t=new Map;for(let n of e){let e=n.threadId??`unknown`,r=t.get(e)??{count:0,totalExecutionTime:0};r.count+=1,r.totalExecutionTime+=n.executionTime,t.set(e,r)}return[...t.entries()].map(([e,t])=>({threadId:e,count:t.count,totalExecutionTime:t.totalExecutionTime})).sort((e,t)=>t.totalExecutionTime-e.totalExecutionTime)}function vt(e,t){let n=mt(e.executions,t,!0),r=mt(e.executions,t,!1),i=n.filter(e=>z.has(e.resourceType)),a=_t(n);return{filteredExecutions:n,baselineExecutionsForBreakdown:r,filteredStatusBreakdown:ht(n),filteredThreadStats:a,filteredTypes:Array.from(new Set(n.map(e=>e.resourceType))).sort(),failingNodes:n.filter(e=>e.statusTone===`danger`).length,warningNodes:n.filter(e=>e.statusTone===`warning`).length,failedModels:n.filter(Je).length,passingTests:i.filter(e=>e.statusTone===`positive`).length,failingTests:i.filter(e=>e.statusTone===`danger`).length,threadCount:a.filter(e=>e.threadId!==`unknown`).length,filteredExecutionTime:n.reduce((e,t)=>e+t.executionTime,0),topFailures:n.filter(e=>e.statusTone===`danger`).slice(0,3),topBottlenecks:[...n].sort((e,t)=>t.executionTime-e.executionTime).slice(0,3)}}function yt({icon:e,headline:t,subtext:n}){return(0,u.jsxs)(`div`,{className:`empty-state-block`,children:[e!==void 0&&(0,u.jsx)(`span`,{className:`empty-state-block__icon`,"aria-hidden":`true`,children:e}),(0,u.jsx)(`strong`,{className:`empty-state-block__headline`,children:t}),n&&(0,u.jsx)(`p`,{className:`empty-state-block__subtext`,children:n})]})}function bt({label:e}){return(0,u.jsx)(`span`,{className:`overview-scope-badge`,children:e})}function xt({derived:e,title:t=`Bottlenecks`,subtitle:n=`Longest-running nodes in the filtered execution slice.`,embedded:r=!1}){let i=e.topBottlenecks;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--bottlenecks${r?` overview-module--embedded`:``}`,children:[!r&&(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:t}),(0,u.jsx)(`p`,{children:n})]}),i.length>0?(0,u.jsx)(`div`,{className:`action-list`,children:i.map((t,n)=>(0,u.jsxs)(`div`,{className:`action-list__row`,children:[(0,u.jsxs)(`div`,{className:`action-list__body`,children:[(0,u.jsx)(`strong`,{children:`${n+1}. ${t.name}`}),(0,u.jsx)(`span`,{children:`${(t.executionTime/Math.max(e.filteredExecutionTime,1e-4)*100).toFixed(1)}% of filtered run`})]}),(0,u.jsx)(`div`,{className:`action-list__metric`,children:(0,u.jsx)(`strong`,{children:Ye(t.executionTime)})})]},t.uniqueId))}):(0,u.jsx)(yt,{icon:`⚡`,headline:`No matching bottlenecks`,subtext:`No executions match the current dashboard filters.`})]})}function St({analysis:e,filtered:t}){let n=e.summary.critical_path?.path.length??0;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--critical`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:`Critical path`}),(0,u.jsx)(`p`,{children:`Dependency pressure and scheduling risk.`})]}),t&&(0,u.jsx)(bt,{label:`Workspace-wide`})]}),(0,u.jsxs)(`div`,{className:`critical-path-card`,children:[(0,u.jsxs)(`div`,{className:`critical-path-card__headline`,children:[(0,u.jsxs)(`strong`,{children:[n,` nodes`]}),(0,u.jsx)(`span`,{children:e.graphSummary.hasCycles?`Cycles detected in the dependency graph.`:`No cycles detected in the dependency graph.`})]}),(0,u.jsxs)(`div`,{className:`critical-path-card__detail`,children:[(0,u.jsx)(`span`,{children:`Graph edges`}),(0,u.jsx)(`strong`,{children:e.graphSummary.totalEdges})]})]})]})}function Ct({analysis:e,filtered:t}){let n=e.resources.filter(e=>!!e.description?.trim()).length,r=e.resources.length>0?Math.round(n/e.resources.length*100):0,i=Math.max(e.resources.length-n,0),a=e.resources.filter(e=>e.resourceType===`model`).length;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--coverage`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:`Coverage`}),(0,u.jsx)(`p`,{children:`Structural health of metadata and discovery quality.`})]}),t&&(0,u.jsx)(bt,{label:`Workspace-wide`})]}),(0,u.jsxs)(`div`,{className:`coverage-card`,children:[(0,u.jsxs)(`div`,{className:`coverage-card__headline`,children:[(0,u.jsxs)(`strong`,{children:[r,`%`]}),(0,u.jsx)(`span`,{children:`Metadata coverage`})]}),(0,u.jsxs)(`div`,{className:`coverage-card__stats`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{children:`Documented`}),(0,u.jsxs)(`strong`,{children:[n,` / `,e.resources.length]})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{children:`Missing descriptions`}),(0,u.jsx)(`strong`,{children:i})]})]}),(0,u.jsx)(`p`,{children:a>0?`Next improvement: document core models first to improve catalog-style discovery.`:`Add descriptions to core resources to improve catalog-style discovery.`})]})]})}var wt=`data-theme`,Tt=`dark`,Et=`light`,Dt=`system`;function Ot(e){if(e===Tt)return Tt;if(e===Et)return Et;try{return window.matchMedia(`(prefers-color-scheme: dark)`).matches?Tt:Et}catch{return Et}}function kt(){return typeof document>`u`?`light`:document.documentElement.getAttribute(wt)===Tt?Tt:`light`}function At(e){e(kt());let t=new MutationObserver(()=>e(kt()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:[wt]}),()=>t.disconnect()}function jt(){let[e,t]=(0,c.useState)(()=>kt());return(0,c.useEffect)(()=>(t(kt()),At(t)),[]),e}function Mt(){let[e,t]=(0,c.useState)(()=>{try{let e=window.localStorage.getItem(`dbt-tools.theme`);if(e===Et||e===Tt||e===Dt)return e}catch{}return Dt}),[n,r]=(0,c.useState)(()=>Ot(e));return(0,c.useEffect)(()=>{r(Ot(e));try{window.localStorage.setItem(`dbt-tools.theme`,e)}catch{}},[e]),(0,c.useEffect)(()=>{document.documentElement.setAttribute(wt,n)},[n]),{theme:n,themePreference:e,setThemePreference:t,toggleTheme:()=>t(e=>e===Et?Tt:e===Tt?Et:Tt)}}var Nt=.08;function Pt(e){return[...e].sort((e,t)=>t.count-e.count)}var Ft=.999999999999,It=5e-4;function Lt(e,t=Nt){return e>=t}function Rt(e){if(e>=Ft)return`100%`;let t=e*100;if(e<It)return`<0.1%`;let n=Math.round(t);if(n===100){let e=t.toFixed(1);return Number.parseFloat(e)>=100&&(e=t.toFixed(2)),`${e}%`}if(n===0&&e>0)return t<.1?`<0.1%`:`${t.toFixed(1)}%`;if(Math.abs(t-n)<1e-9)return`${n}%`;let r=t.toFixed(1);return Number.parseFloat(r)>=100&&e<Ft&&(r=t.toFixed(2)),`${r}%`}function zt({title:e,subtitle:t,headerRight:n,children:r}){return(0,u.jsxs)(`section`,{className:`workspace-card`,children:[(0,u.jsxs)(`div`,{className:`workspace-card__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{children:e}),t&&(0,u.jsx)(`p`,{children:t})]}),n]}),r]})}function Bt({resourceType:e}){return(0,u.jsxs)(`span`,{className:`resource-type-badge`,children:[(0,u.jsx)(Vt,{resourceType:e}),Xe(e)]})}function Vt({resourceType:e}){switch(e){case`model`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`m8 2.2 4.8 2.7L8 7.6 3.2 4.9 8 2.2Z`}),(0,u.jsx)(`path`,{d:`m3.2 5 4.8 2.6L12.8 5M3.2 8l4.8 2.7 4.8-2.7M3.2 11l4.8 2.8 4.8-2.8`})]});case`source`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,u.jsx)(`path`,{d:`M3.4 4v5.3C3.4 10.7 5.5 12 8 12s4.6-1.3 4.6-2.7V4`}),(0,u.jsx)(`path`,{d:`M3.4 6.7C3.4 8 5.5 9.3 8 9.3s4.6-1.3 4.6-2.6`})]});case`test`:case`unit_test`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M8 2.2 12.6 4v3.8c0 2.6-1.7 5-4.6 5.8-2.9-.8-4.6-3.2-4.6-5.8V4L8 2.2Z`}),(0,u.jsx)(`path`,{d:`m5.6 7.9 1.5 1.5 3.3-3.3`})]});case`metric`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M2.5 11.8h11`}),(0,u.jsx)(`path`,{d:`M4.2 10.8V8.1M8 10.8V5.2m3.8 5.6V3.6`})]});case`semantic_model`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`rect`,{x:`2.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`rect`,{x:`9.4`,y:`3`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`rect`,{x:`5.9`,y:`9`,width:`4.2`,height:`4.2`,rx:`1`}),(0,u.jsx)(`path`,{d:`M6.6 5.1h2.8M8 7.2V9`})]});case`macro`:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M5.2 3.3H3.4v9.4h1.8M10.8 3.3h1.8v9.4h-1.8`}),(0,u.jsx)(`path`,{d:`m9.6 5.1-3.2 5.8`})]});case`operation`:case`sql_operation`:return(0,u.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,u.jsx)(`path`,{d:`M9.8 2.9a3.2 3.2 0 1 1-1.1 6.2L4 13.8 2.2 12l4.7-4.7a3.2 3.2 0 0 1 2.9-4.4Z`})});default:return(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`path`,{d:`M4.3 2.8h5l2.4 2.4v7.9H4.3z`}),(0,u.jsx)(`path`,{d:`M9.3 2.8v2.4h2.4`}),(0,u.jsx)(`path`,{d:`M5.8 8h4.4M5.8 10.2h4.4`})]})}}function Ht({mode:e,depth:t}){return e===`database`&&t===0?(0,u.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:[(0,u.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`4.6`,ry:`1.8`}),(0,u.jsx)(`path`,{d:`M3.4 4v4.6C3.4 10 5.5 11.2 8 11.2s4.6-1.2 4.6-2.6V4`}),(0,u.jsx)(`path`,{d:`M3.4 6.4C3.4 7.8 5.5 9 8 9s4.6-1.2 4.6-2.6`})]}):(0,u.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,children:(0,u.jsx)(`path`,{d:`M2.5 4.3h4.1l1.2 1.5H13a.9.9 0 0 1 .9.9v5a.9.9 0 0 1-.9.9H3a.9.9 0 0 1-.9-.9V5.2a.9.9 0 0 1 .4-.9Z`})})}function Ut({title:e,description:t,toolbar:n,leadingPane:r,children:i,inspector:a,className:o=``,suppressHeader:s=!1}){return(0,u.jsxs)(`div`,{className:`workspace-view workspace-scaffold ${o}`.trim(),children:[s?null:(0,u.jsx)(`div`,{className:`lens-header`,children:(0,u.jsxs)(`div`,{className:`lens-header__title`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,u.jsx)(`h2`,{children:e}),(0,u.jsx)(`p`,{className:`lens-header__desc`,children:t})]})}),n?(0,u.jsx)(`div`,{className:`workspace-scaffold__toolbar`,children:n}):null,(0,u.jsxs)(`div`,{className:`workspace-scaffold__body${r?` workspace-scaffold__body--with-leading`:``}${a?` workspace-scaffold__body--with-inspector`:``}`,children:[r?(0,u.jsx)(`aside`,{className:`workspace-scaffold__leading`,children:r}):null,(0,u.jsx)(`div`,{className:`workspace-scaffold__main`,children:i}),a?(0,u.jsx)(`aside`,{className:`workspace-scaffold__inspector`,children:a}):null]})]})}function Wt({actions:e}){return(0,u.jsx)(`div`,{className:`entity-inspector__actions`,children:e.map(e=>(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:e.onClick,disabled:e.disabled,children:e.label},e.label))})}function Gt({eyebrow:e,title:t,typeLabel:n,status:r,stats:i,sections:a,actions:o,emptyMessage:s}){return t?(0,u.jsxs)(`aside`,{className:`entity-inspector`,children:[e?(0,u.jsx)(`p`,{className:`eyebrow`,children:e}):null,(0,u.jsxs)(`div`,{className:`entity-inspector__header`,children:[n?(0,u.jsx)(`span`,{className:`entity-inspector__type-badge`,children:n}):null,r]}),(0,u.jsx)(`div`,{className:`entity-inspector__name`,children:(0,u.jsx)(`strong`,{children:t})}),i&&i.length>0?(0,u.jsx)(`dl`,{className:`entity-inspector__stats`,children:i.map(e=>(0,u.jsxs)(`div`,{className:`entity-inspector__stat`,children:[(0,u.jsx)(`dt`,{children:e.label}),(0,u.jsx)(`dd`,{children:e.value})]},e.label))}):null,a?.map(e=>(0,u.jsxs)(`div`,{className:`entity-inspector__section`,children:[(0,u.jsx)(`p`,{className:`entity-inspector__section-label`,children:e.label}),(0,u.jsx)(`div`,{className:`entity-inspector__mono`,children:e.value})]},e.label)),o&&o.length>0?(0,u.jsx)(Wt,{actions:o}):null]}):(0,u.jsx)(`aside`,{className:`entity-inspector entity-inspector--empty`,children:(0,u.jsx)(`p`,{className:`entity-inspector__placeholder`,children:s??`Select an item to inspect`})})}function Kt({group:e,statusColors:t}){let n=(0,c.useId)(),r=e.statusBreakdown.filter(e=>e.count>0),i=r.length>0?Pt(r):[],a=Xe(e.resourceType);return(0,u.jsxs)(`div`,{className:`exec-type-bar-row`,children:[(0,u.jsx)(`div`,{className:`exec-type-bar-row__label`,id:n,title:a,children:a}),(0,u.jsxs)(`div`,{className:`exec-type-bar-row__bars`,children:[(0,u.jsx)(`div`,{className:`exec-type-bar-track`,role:`group`,"aria-labelledby":n,children:r.map(n=>{let r=Lt(n.share),i=Rt(n.share),a=`${n.status}: ${n.count} runs (${i}) of ${e.rowDenominatorCount}`;return(0,u.jsx)(`div`,{className:n.share<.08?`exec-type-bar-segment exec-type-bar-segment--minor`:`exec-type-bar-segment`,style:{flex:`${n.count} 1 0%`,backgroundColor:t[n.tone]},title:a,"aria-label":a,children:r?(0,u.jsxs)(`span`,{className:`exec-type-bar-segment__inner`,children:[i,` (`,n.count,`)`]}):null},`${e.resourceType}-${n.status}`)})}),r.length>0?(0,u.jsx)(`ul`,{className:`exec-type-bar-row__breakdown`,"aria-label":`${a} status breakdown`,children:i.map(n=>{let r=Rt(n.share);return(0,u.jsxs)(`li`,{className:`exec-type-bar-row__breakdown-item`,children:[(0,u.jsx)(`span`,{className:`legend-row__swatch`,style:{background:t[n.tone]},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`exec-type-bar-row__breakdown-label`,children:n.status}),(0,u.jsxs)(`span`,{className:`exec-type-bar-row__breakdown-metric`,children:[n.count,` · `,r]})]},`${e.resourceType}-${n.status}-breakdown`)})}):null]})]})}function qt({executions:e,executionsForShareDenominator:t}){let n=jt(),r=(0,c.useMemo)(()=>Be(n),[n]),i=(0,c.useMemo)(()=>gt(e,t),[e,t]);return i.length===0?(0,u.jsx)(`div`,{className:`empty-state`,children:`No execution data.`}):(0,u.jsx)(`div`,{className:`exec-type-bar-stack`,"data-testid":`exec-type-bar-stack`,children:i.map(e=>(0,u.jsx)(Kt,{group:e,statusColors:r},e.resourceType))})}function Jt({executions:e,executionsForShareDenominator:t}){return(0,u.jsx)(qt,{executions:e,executionsForShareDenominator:t})}function Yt({graphSummary:e}){let t=Object.entries(e.nodesByType).sort((e,t)=>t[1]-e[1]);return t.length===0?(0,u.jsx)(`div`,{className:`empty-state`,children:`No node-type breakdown available.`}):(0,u.jsx)(`div`,{className:`rank-list`,children:t.map(([t,n])=>(0,u.jsxs)(`div`,{className:`rank-list__row`,children:[(0,u.jsx)(`div`,{className:`rank-list__body`,children:(0,u.jsx)(`strong`,{children:t})}),(0,u.jsxs)(`div`,{className:`rank-list__metric`,children:[(0,u.jsx)(`strong`,{children:n}),(0,u.jsx)(`span`,{children:e.totalNodes>0?`${(n/e.totalNodes*100).toFixed(0)}% of graph`:``})]})]},t))})}var Xt=[{value:`resources`,label:`Resources`},{value:`totalTime`,label:`Total time`},{value:`avgTime`,label:`Avg time`}];function Zt(e,t){switch(t){case`resources`:return e.count;case`totalTime`:return e.totalExecutionTime;case`avgTime`:return e.count>0?e.totalExecutionTime/e.count:0}}function Qt(e,t){let n=Zt(e,t);return t===`resources`?n.toLocaleString():Ye(n)}function $t(e,t){let n=0;for(let r of e){let e=Zt(r,t);e>n&&(n=e)}return n}function en(e){return e===`unknown`}function tn(e,t){return[...e].sort((e,n)=>{let r=Zt(e,t),i=Zt(n,t);if(i!==r)return i-r;let a=en(e.threadId);return a===en(n.threadId)?e.threadId.localeCompare(n.threadId):a?1:-1})}var nn=12;function rn(e){let t=e.length,n=t>nn;return{rows:n?e.slice(0,nn):e,totalLanes:t,isTruncated:n}}function an(e,t,n){let r=Qt(e,t);return t===`resources`?`${e.threadId}: ${r} runs (${n}% of slice)`:t===`avgTime`?`${e.threadId}: ${r} (${e.count.toLocaleString()} runs)`:`${e.threadId}: ${r}`}function on({derived:e}){let[t,n]=(0,c.useState)(`totalTime`),r=(0,c.useMemo)(()=>e.filteredThreadStats.reduce((e,t)=>e+t.count,0),[e.filteredThreadStats]),{displayRows:i,maxVal:a,isTruncated:o,totalLanes:s}=(0,c.useMemo)(()=>{let{rows:n,totalLanes:r,isTruncated:i}=rn(tn(e.filteredThreadStats,t));return{displayRows:n,maxVal:$t(n,t),isTruncated:i,totalLanes:r}},[e.filteredThreadStats,t]);return(0,u.jsxs)(`section`,{className:`overview-module overview-module--threads`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Thread distribution`}),(0,u.jsx)(`p`,{children:o?`Top ${i.length} of ${s.toLocaleString()} worker lanes by selected metric.`:`Worker lanes in the current execution slice.`})]}),e.filteredThreadStats.length>0?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`thread-dist-metric-pills pill-row`,role:`radiogroup`,"aria-label":`Thread distribution metric`,children:Xt.map(e=>(0,u.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e.value,"aria-label":`${e.label}, thread distribution metric`,className:t===e.value?Ve:He,onClick:()=>n(e.value),children:e.label},e.value))}),(0,u.jsx)(`ul`,{className:`thread-dist-list`,"aria-label":`Worker lanes by metric`,children:i.map(e=>{let n=Zt(e,t),i=a>0?Math.min(100,n/a*100):0,o=an(e,t,r>0?Math.round(e.count/r*1e3)/10:0),s=`${e.threadId}, ${o}`;return(0,u.jsxs)(`li`,{className:`thread-dist-row`,"aria-label":s,children:[(0,u.jsx)(`div`,{className:`thread-dist-row__label`,title:e.threadId,children:e.threadId}),(0,u.jsx)(`div`,{className:`thread-dist-row__track-wrap`,children:(0,u.jsx)(`div`,{className:`thread-dist-row__track`,title:o,role:`presentation`,children:(0,u.jsx)(`div`,{className:`thread-dist-row__fill`,style:{width:`${i}%`}})})}),(0,u.jsx)(`div`,{className:`thread-dist-row__value`,children:Qt(e,t)})]},e.threadId)})})]}):(0,u.jsx)(yt,{icon:`⋯`,headline:`No thread data in slice`,subtext:`No matching executions were found for the current dashboard filters.`})]})}function sn({derived:e,analysis:t,workerThreadCount:n,modelsCount:r,testsCount:i}){let a=t.summary.critical_path?.path.length??0;return(0,u.jsxs)(`section`,{className:`overview-module overview-module--footprint`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Footprint`}),(0,u.jsx)(`p`,{children:`Filtered execution volume, duration, and worker scale.`})]}),(0,u.jsxs)(`div`,{className:`footprint-card`,children:[(0,u.jsxs)(`div`,{className:`footprint-card__stats`,children:[(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Executed`}),(0,u.jsx)(`strong`,{children:e.filteredExecutions.length})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Runtime`}),(0,u.jsx)(`strong`,{children:Ye(e.filteredExecutionTime)})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Worker lanes`}),(0,u.jsx)(`strong`,{children:n})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Models`}),(0,u.jsx)(`strong`,{children:r})]}),(0,u.jsxs)(`div`,{className:`footprint-card__stat`,children:[(0,u.jsx)(`span`,{children:`Tests`}),(0,u.jsx)(`strong`,{children:i})]})]}),(0,u.jsxs)(`p`,{className:`footprint-card__detail`,children:[`Graph totals remain workspace-wide: `,t.graphSummary.totalNodes,` `,`nodes, `,t.graphSummary.totalEdges,` edges, `,a,` `,`critical-path nodes.`]})]})]})}var cn=[`model`,`source`,`seed`,`snapshot`];function ln(e,t){let n={};for(let r of e){if(!ct(r,t))continue;let e=r.resourceType;n[e]=(n[e]??0)+1}return n}function un(e,t){let n=e.resources??[],r=t==null?e.graphSummary.nodesByType:ln(n,t),i={};for(let n of e.executions){if(t!=null&&!ct(n,t))continue;let e=n.resourceType;i[e]=(i[e]??0)+1}let a={};for(let n of e.ganttData){if(!dt(n,t))continue;let e=n.resourceType;a[e]=(a[e]??0)+1}let o=new Set([...cn,...Object.keys(r),...Object.keys(i),...Object.keys(a)]),s=[];for(let e of[...o].sort((e,t)=>e.localeCompare(t)))s.push({resourceType:e,graphCount:r[e]??0,runCount:i[e]??0,timelineCount:a[e]??0});return s.filter(e=>cn.includes(e.resourceType)||e.graphCount>0||e.runCount>0||e.timelineCount>0)}function dn({rows:e}){return e.length===0?null:(0,u.jsxs)(`div`,{className:`invocation-resource-stats`,role:`region`,"aria-label":`Invocation resource counts by type`,children:[(0,u.jsx)(`p`,{className:`invocation-resource-stats__title`,children:`Resource counts (manifest graph vs this run vs timeline rows)`}),(0,u.jsxs)(`table`,{className:`invocation-resource-stats__table`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{scope:`col`,children:`Type`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`Manifest graph`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`This run`}),(0,u.jsx)(`th`,{scope:`col`,className:`invocation-resource-stats__num`,children:`Timeline`})]})}),(0,u.jsx)(`tbody`,{children:e.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{scope:`row`,children:Xe(e.resourceType)}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.graphCount.toLocaleString()}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.runCount.toLocaleString()}),(0,u.jsx)(`td`,{className:`invocation-resource-stats__num`,children:e.timelineCount.toLocaleString()})]},e.resourceType))})]}),(0,u.jsxs)(`p`,{className:`invocation-resource-stats__note`,children:[`When a project package is in scope, manifest graph counts match that package (same scope as this run and timeline). Synthetic source rows are described in ADR-0032 (`,(0,u.jsx)(`code`,{children:`docs/adr/0032-timeline-includes-dbt-sources-via-snapshot-synthesis.md`}),`).`]})]})}function fn({analysis:e}){let t=e.projectName??st(e.executions);return(0,u.jsx)(dn,{rows:(0,c.useMemo)(()=>un(e,t),[e,t])})}function pn(e,t){return e.failingNodes>0?{tone:`danger`,title:`${e.failingNodes} failing node${e.failingNodes===1?``:`s`} require attention`,summary:`Prioritize failing nodes before reviewing downstream impact.`}:e.warningNodes>0?{tone:`warning`,title:`${e.warningNodes} warning node${e.warningNodes===1?``:`s`} need review`,summary:`Warnings surfaced in this run. Review tests and runtime hotspots next.`}:{tone:`positive`,title:`Healthy run`,summary:t?`No failing nodes match the current dashboard filters.`:`No failing nodes surfaced in the latest run.`}}function mn(e,t){let n=Qe(e);return[t??`Workspace`,`${e.graphSummary.totalNodes} graph nodes`,`${e.summary.total_nodes} executions`,e.invocationId==null?null:`invocation ${e.invocationId}`,n==null?null:`invocation started ${Ze(n)}`].filter(e=>!!e)}function hn(e){return e.find(e=>e.label===`Workspace mode`)?.value??`—`}function gn({analysis:e,projectName:t,analysisSource:n,derived:r,filtered:i,workspaceSignals:a}){let{tone:o,title:s,summary:c}=pn(r,i),l=mn(e,t),d=Ye(i?r.filteredExecutionTime:e.summary.total_execution_time),f=A(n),p=hn(a),m=r.failingNodes>0?`${r.failedModels} failed model${r.failedModels===1?``:`s`} may block downstream investigation.`:r.warningNodes>0?`Review tests and runtime hotspots next.`:null;return(0,u.jsxs)(`section`,{className:`health-posture health-posture--${o}`,"aria-label":`Run posture`,children:[(0,u.jsxs)(`div`,{className:`health-posture__top`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Run posture`}),(0,u.jsx)(`span`,{className:`health-posture__source`,children:f})]}),(0,u.jsx)(`p`,{className:`health-posture__meta`,children:l.join(` · `)}),(0,u.jsx)(`h3`,{className:`health-posture__headline`,children:s}),(0,u.jsx)(`p`,{className:`health-posture__summary`,children:c}),m!=null&&(0,u.jsx)(`p`,{className:`health-posture__followup`,children:m}),(0,u.jsxs)(`div`,{className:`health-posture__metrics`,role:`list`,children:[(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Failing`}),(0,u.jsx)(`strong`,{children:r.failingNodes})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Warnings`}),(0,u.jsx)(`strong`,{children:r.warningNodes})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Runtime`}),(0,u.jsx)(`strong`,{children:d})]}),(0,u.jsxs)(`div`,{className:`health-posture__metric`,role:`listitem`,children:[(0,u.jsx)(`span`,{children:`Workspace`}),(0,u.jsx)(`strong`,{children:p})]})]})]})}function _n(e){return z.has(e)?`tests`:e}function vn({analysis:e,projectName:t}){let n=(0,c.useMemo)(()=>{let n=e.resources.filter(e=>ct(e,t)),r=new Map;for(let e of n){let t=_n(e.resourceType);r.set(t,(r.get(t)??0)+1)}let i=[];for(let{key:e,label:t}of Ue){let n=r.get(e)??0;n>0&&i.push({label:t,value:n.toLocaleString()})}let a=e.resources.filter(e=>!!e.description?.trim()).length,o=e.resources.length,s=o>0?Math.round(a/o*100):0;i.push({label:`Coverage`,value:`${s}%`}),i.push({label:`Graph nodes`,value:e.graphSummary.totalNodes.toLocaleString()}),i.push({label:`Edges`,value:e.graphSummary.totalEdges.toLocaleString()});let c=e.adapterTotals;return c!=null&&c.nodesWithAdapterData>0&&i.push({label:`Warehouse nodes`,value:c.nodesWithAdapterData.toLocaleString()}),i},[e,t]);return n.length===0?null:(0,u.jsx)(`div`,{className:`health-metric-row`,role:`region`,"aria-label":`Workspace metrics`,children:n.map((e,t)=>(0,u.jsxs)(`div`,{className:`health-metric-row__item`,children:[(0,u.jsx)(`span`,{className:`health-metric-row__label`,children:e.label}),(0,u.jsx)(`strong`,{className:`health-metric-row__value`,children:e.value})]},`${e.label}-${t}`))})}var yn=[{value:`all`,label:`All`},{value:`positive`,label:`Healthy`},{value:`warning`,label:`Warnings`},{value:`danger`,label:`Errors`}];function bn({filters:e,setFilters:t}){return(0,u.jsx)(`div`,{className:`health-exec-status-pills pill-row`,role:`group`,"aria-label":`Filter executions by status`,children:yn.map(n=>(0,u.jsx)(`button`,{type:`button`,className:e.status===n.value?Ve:He,onClick:()=>t(e=>({...e,status:n.value})),children:n.label},n.value))})}function xn({analysis:e,projectName:t,analysisSource:n,filters:r,setFilters:i,workspaceSignals:a}){let o=(0,c.useMemo)(()=>({status:r.status,query:``,resourceTypes:new Set}),[r.status]),s=(0,c.useMemo)(()=>vt(e,o),[e,o]),l=r.status!==`all`,d=s.threadCount||s.filteredThreadStats.length,f=s.filteredExecutions.filter(e=>e.resourceType===`model`).length,p=s.filteredExecutions.filter(e=>z.has(e.resourceType)).length;return(0,u.jsxs)(`div`,{className:`workspace-view health-view`,children:[(0,u.jsxs)(`div`,{className:`lens-header`,children:[(0,u.jsxs)(`div`,{className:`lens-header__title`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace lens`}),(0,u.jsx)(`h2`,{children:`Health`}),(0,u.jsx)(`p`,{className:`lens-header__desc`,children:`Run posture, critical issues, and dependency pressure at a glance.`})]}),l&&(0,u.jsx)(`span`,{className:`lens-header__badge`,children:`Filtered view`})]}),(0,u.jsxs)(`div`,{className:`health-fold`,children:[(0,u.jsx)(gn,{analysis:e,projectName:t,analysisSource:n,derived:s,filtered:l,workspaceSignals:a}),(0,u.jsx)(vn,{analysis:e,projectName:t}),(0,u.jsx)(`section`,{className:`health-fold__bottlenecks`,"aria-label":`Bottlenecks`,children:(0,u.jsx)(xt,{derived:s})})]}),(0,u.jsxs)(`div`,{className:`health-detail`,children:[(0,u.jsxs)(`section`,{className:`health-section health-detail__execution`,children:[(0,u.jsxs)(`div`,{className:`health-section__header health-section__header--with-inline-controls`,children:[(0,u.jsxs)(`div`,{className:`health-section__header-text`,children:[(0,u.jsx)(`h3`,{children:`Execution breakdown`}),(0,u.jsxs)(`p`,{children:[s.filteredExecutions.length.toLocaleString(),` runs. Status mix by resource type.`]})]}),(0,u.jsx)(bn,{filters:r,setFilters:i})]}),s.filteredExecutions.length>0?(0,u.jsx)(Jt,{executions:s.filteredExecutions,executionsForShareDenominator:s.baselineExecutionsForBreakdown}):(0,u.jsx)(yt,{icon:`◌`,headline:`No matching executions`,subtext:`Set status to All to include every run, or pick another status filter.`})]}),(0,u.jsxs)(`section`,{className:`health-section health-detail__context`,children:[(0,u.jsxs)(`div`,{className:`health-section__header`,children:[(0,u.jsx)(`h3`,{children:`Execution context`}),(0,u.jsx)(`p`,{children:`Worker pressure, footprint, and critical path.`})]}),(0,u.jsxs)(`div`,{className:`health-detail__grid`,children:[(0,u.jsx)(on,{derived:s}),(0,u.jsxs)(`div`,{className:`health-detail__stack`,children:[(0,u.jsx)(St,{analysis:e,filtered:l}),(0,u.jsx)(sn,{derived:s,analysis:e,workerThreadCount:d,modelsCount:f,testsCount:p})]})]})]}),(0,u.jsxs)(`section`,{className:`health-section health-detail__structure`,children:[(0,u.jsxs)(`div`,{className:`health-section__header`,children:[(0,u.jsx)(`h3`,{children:`Structural health`}),(0,u.jsx)(`p`,{children:`Coverage and graph shape across the workspace.`})]}),(0,u.jsxs)(`div`,{className:`health-detail__grid`,children:[(0,u.jsx)(Ct,{analysis:e,filtered:l}),(0,u.jsxs)(`div`,{className:`health-structure-composition`,children:[(0,u.jsxs)(`div`,{className:`overview-module__header`,children:[(0,u.jsx)(`h3`,{children:`Graph composition`}),(0,u.jsx)(`p`,{children:`Node type breakdown in the manifest graph.`})]}),(0,u.jsx)(Yt,{graphSummary:e.graphSummary})]})]})]}),(0,u.jsxs)(`details`,{className:`health-detail__resource-stats`,children:[(0,u.jsx)(`summary`,{className:`health-detail__resource-stats-summary`,children:`Invocation resource counts`}),(0,u.jsx)(fn,{analysis:e})]})]})]})}var Sn=a();function Cn(){return{pass:0,fail:0,error:0,warn:0,skipped:0,notExecuted:0}}function wn(e){return be(e)}function Tn(e,t){let n=t??{},r=e.filter(e=>z.has(e.resourceType)),i=new Map;for(let e of r){let t=n[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];for(let n of t){let t=i.get(n)??Cn();e.statusTone===`positive`?t.pass+=1:e.statusTone===`danger`?t.error+=1:e.statusTone===`warning`?t.warn+=1:e.statusTone===`skipped`?t.skipped+=1:t.notExecuted+=1,i.set(n,t)}}return i}function En(e,t,n){let r=n??{},i=t.filter(e=>z.has(e.resourceType)).filter(t=>(r[t.uniqueId]?.upstream?.map(e=>e.uniqueId)??[]).includes(e)).sort((e,t)=>{let n={danger:0,warning:1,positive:2,skipped:3,neutral:4},r=n[e.statusTone??`neutral`]-n[t.statusTone??`neutral`];if(r!==0)return r;let i=(t.executionTime??-1/0)-(e.executionTime??-1/0);return i===0?e.name.localeCompare(t.name):i}),a=i.filter(e=>e.statusTone===`positive`).length,o=i.filter(e=>e.statusTone===`warning`||e.statusTone===`danger`).length;return{total:i.length,passing:a,attention:o,tests:i}}function Dn(e,t,n){return{id:e,label:t,kind:`branch`,children:[],count:0,parentIds:n}}function On(e,t,n){return{id:e,label:t.name,kind:`resource`,children:[],resource:t,count:1,parentIds:n}}function kn(e){let t=e.split(`/`).map(e=>e.trim()).filter(Boolean);return{directories:t.slice(0,-1),fileName:t[t.length-1]??e}}function An(e){return tt(e.originalFilePath??e.patchPath??e.path)}function jn(e){let t=An(e);return t?kn(t).directories:[]}function Mn(e){let t=An(e);return t?kn(t).fileName:null}function Nn(e){return!e.database||!e.schema?[]:[e.database,e.schema,e.packageName]}function Pn(e,t){let n=[`model`,`seed`,`snapshot`,`source`,`macro`,`operation`,`sql_operation`,`analysis`,`semantic_model`,`metric`,`test`,`unit_test`,`exposure`],r=n.indexOf(e.resourceType),i=n.indexOf(t.resourceType);return r===i?e.name.localeCompare(t.name):r===-1?1:i===-1?-1:r-i}function Fn(e,t){let n={branch:0,resource:1};return e.kind===t.kind?e.kind===`resource`&&t.kind===`resource`&&e.resource&&t.resource?Pn(e.resource,t.resource):e.label.localeCompare(t.label):n[e.kind]-n[t.kind]}function In(e){return e.map(e=>{if(e.kind===`resource`)return e;let t=In(e.children).sort(Fn);return{...e,children:t,count:t.reduce((e,t)=>e+t.count,0)}}).sort(Fn)}function Ln(e){return`project:branch:${e??`Workspace`}`}function Rn(e,t,n,r){let i=r??{},a=e.filter(e=>!z.has(e.resourceType)),o=Tn(e,i),s=e=>{let t=Cn();for(let n of e){let e;n.kind===`resource`?e=n.testStats??Cn():(e=s(n.children),wn(e)&&(n.testStats=e)),t.pass+=e.pass,t.fail+=e.fail,t.error+=e.error,t.warn+=e.warn,t.skipped+=e.skipped}return t},c=[],l=(e,t,n,r)=>{let i=e.find(e=>e.kind===`branch`&&e.id===t);if(i)return i;let a=Dn(t,n,r);return e.push(a),a};if(t===`project`){let e=n??`Workspace`,r=l(c,Ln(n),e,[]);for(let n of a){if(!An(n))continue;let i=jn(n),a=[r.id],s=r.children;for(let n=0;n<i.length;n+=1){let r=i[n],o=`${t}:branch:${[e,...i.slice(0,n+1)].join(`/`)}`,c=l(s,o,r,[...a]);a.push(o),s=c.children}let c=On(`${t}:resource:${n.uniqueId}`,n,a),u=o.get(n.uniqueId);u&&wn(u)&&(c.testStats=u),s.push(c)}return s(c),In(c).filter(e=>e.count>0)}for(let e of a){let n=Nn(e);if(n.length===0)continue;let r=[],i=c;for(let e=0;e<n.length;e+=1){let a=n[e],o=`${t}:branch:${n.slice(0,e+1).join(`/`)}`,s=l(i,o,a,[...r]);r.push(o),i=s.children}let a=On(`${t}:resource:${e.uniqueId}`,e,r),s=o.get(e.uniqueId);s&&wn(s)&&(a.testStats=s),i.push(a)}return s(c),In(c)}function zn(e,t,n=0){let r=[];for(let i of e)r.push({node:i,depth:n}),i.kind===`branch`&&t.has(i.id)&&r.push(...zn(i.children,t,n+1));return r}function Bn(e){let t=new Set,n=[...e];for(;n.length>0;){let e=n.pop();e.kind!==`resource`&&(t.add(e.id),n.push(...e.children))}return t}function Vn(e){let t=[],n=[...e];for(;n.length>0;){let e=n.pop();e.kind===`resource`&&e.resource?t.push(e.resource.uniqueId):n.push(...[...e.children].reverse())}return t}function Hn(e,t){if(!t)return null;let n=[...e];for(;n.length>0;){let e=n.pop();if(e.kind===`resource`&&e.resource?.uniqueId===t)return e;n.push(...e.children)}return null}function Un(e,t){let n=Hn(e,t);return new Set(n?.parentIds??[])}function Wn(e){return Math.max(0,Math.min(10,e))}function Gn(e){return Ke.has(e)}function Kn(e,t,n,r){let i=new Map,a=[t];for(let o=1;o<=n;o+=1){let n=[];for(let s of a){let a=e[s],c=r===`upstream`?a?.upstream?.map(e=>e.uniqueId)??[]:a?.downstream?.map(e=>e.uniqueId)??[];for(let e of c)i.has(e)||e===t||(i.set(e,o),n.push(e))}if(a=n,a.length===0)break}return i}function qn(e){switch(e){case`source`:case`seed`:case`snapshot`:return 0;case`model`:return 1;case`semantic_model`:return 2;case`metric`:case`exposure`:return 3;default:return 4}}function Jn(e,t,n,r){if(e===t)return{side:`selected`,depth:0};let i=n.get(e),a=r.get(e);return i!=null&&a!=null?i<=a?{side:`upstream`,depth:i}:{side:`downstream`,depth:a}:i==null?a==null?{side:`selected`,depth:0}:{side:`downstream`,depth:a}:{side:`upstream`,depth:i}}function Yn(e,t,n,r,i){let a=new Map,o=[...t.keys()].sort((e,n)=>t.get(e)-t.get(n));for(let t of o){let n=r.get(t);if(!n||z.has(n.resourceType))continue;let o=i[t]?.downstream?.map(e=>e.uniqueId)??[],s=0;for(let t of o)if(t===e)s=Math.max(s,0);else{let e=a.get(t);e!==void 0&&(s=Math.max(s,e))}a.set(t,s+1)}let s=new Map,c=[...n.keys()].sort((e,t)=>n.get(e)-n.get(t));for(let t of c){let n=r.get(t);if(!n||z.has(n.resourceType))continue;let a=i[t]?.upstream?.map(e=>e.uniqueId)??[],o=0;for(let t of a)if(t===e)o=Math.max(o,0);else{let e=s.get(t);e!==void 0&&(o=Math.max(o,e))}s.set(t,o+1)}let l=new Map,u=r.get(e);u&&l.set(0,[u]);for(let[e]of t){let t=r.get(e);if(!t||z.has(t.resourceType))continue;let n=-(a.get(e)??1),i=l.get(n)??[];i.push(t),l.set(n,i)}for(let[e]of n){let t=r.get(e);if(!t||z.has(t.resourceType))continue;let n=s.get(e)??1,i=l.get(n)??[];i.push(t),l.set(n,i)}return Array.from(l.entries()).sort((e,t)=>e[0]-t[0]).map(([e,t])=>({column:e,resources:[...new Map(t.map(e=>[e.uniqueId,e])).values()].sort((e,t)=>{let n=qn(e.resourceType)-qn(t.resourceType);return n===0?e.name.localeCompare(t.name):n})}))}function Xn(e,t){let n=new Map;e.forEach(e=>e.resources.forEach((e,t)=>n.set(e.uniqueId,t)));let r=e.map(e=>({...e,resources:[...e.resources]}));for(let e=0;e<4;e+=1){for(let e=1;e<r.length;e+=1){let i=r[e-1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.upstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.upstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}for(let e=r.length-2;e>=0;--e){let i=r[e+1],a=r[e];a.resources.sort((e,r)=>{let a=t[e.uniqueId]?.downstream?.map(e=>e.uniqueId)??[],o=t[r.uniqueId]?.downstream?.map(e=>e.uniqueId)??[];return(a.length>0?a.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/a.length:n.get(e.uniqueId)??0)-(o.length>0?o.reduce((e,t)=>e+(n.get(t)??i.resources.length),0)/o.length:n.get(r.uniqueId)??0)}),a.resources.forEach((e,t)=>n.set(e.uniqueId,t))}}return r}function Zn({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,displayMode:o=`focused`}){let s=Kn(n,e.uniqueId,i,`upstream`),c=Kn(n,e.uniqueId,a,`downstream`),l=Xn(Yn(e.uniqueId,s,c,r,n),n).filter(e=>e.resources.length>0),u=Tn(Array.from(r.values()),n),d=l.length,f=o===`summary`?176:212,p=o===`summary`?64:80,m=o===`summary`?14:18,h=o===`summary`?104:160,g=o===`summary`?24:40,_=o===`summary`?40:56,v=o===`summary`?40:52,y=_*2+d*f+Math.max(0,d-1)*h,b=Math.max(1,...l.map(e=>e.resources.length)),x=v*2+b*p+Math.max(0,b-1)*g,S=new Map;l.forEach((t,n)=>{let r=t.resources.length*p+Math.max(0,t.resources.length-1)*g,i=v+(x-v*2-r)/2,a=_+n*(f+h);t.resources.forEach((n,r)=>{let o=i+r*(p+g),{depth:l,side:d}=Jn(n.uniqueId,e.uniqueId,s,c),f=u.get(n.uniqueId);S.set(n.uniqueId,{resource:n,x:a,y:o,column:t.column,depth:l,side:d,passCount:f?.pass??0,failCount:(f?.error??0)+(f?.warn??0),notExecutedCount:f?.notExecuted??0,skippedCount:f?.skipped??0})})});let C=new Set(S.keys()),w=[];for(let e of C){let t=n[e];if(t)for(let n of t.downstream.map(e=>e.uniqueId))C.has(n)&&w.push({from:e,to:n})}return{upstreamMap:s,downstreamMap:c,columnNodes:l,nodeLayouts:S,graphEdges:w,svgWidth:y,svgHeight:x,hasRelatedNodes:S.size>1&&((t?.upstreamCount??0)>0||(t?.downstreamCount??0)>0),nodeWidth:f,nodeHeight:p,nodeRadius:m,displayMode:o}}function Qn(e,t){if(!e)return new Set;let n=new Set([e]);for(let r of t)r.from===e&&n.add(r.to),r.to===e&&n.add(r.from);return n}function $n(e){return Array.from(new Set(Array.from(e.values()).map(e=>e.resource.resourceType))).sort((e,t)=>{let n=qn(e)-qn(t);return n===0?e.localeCompare(t):n})}var er={positive:`var(--bg-success-soft)`,warning:`var(--bg-warning-soft)`,danger:`var(--bg-danger-soft)`,skipped:`var(--bg-accent-soft)`,neutral:`var(--bg-surface-muted)`},tr=`var(--bg-success-soft)`,nr=`var(--bg-danger-soft)`,rr=`var(--dbt-type-generic-soft)`,ir={model:`var(--dbt-type-model-soft)`,source:`var(--dbt-type-source-soft)`,seed:`var(--dbt-type-seed-soft)`,snapshot:`var(--dbt-type-snapshot-soft)`,test:`var(--dbt-type-test-soft)`,unit_test:`var(--dbt-type-test-soft)`,metric:`var(--dbt-type-metric-soft)`,semantic_model:`var(--dbt-type-semantic-model-soft)`,exposure:`var(--dbt-type-exposure-soft)`,macro:`var(--dbt-type-macro-soft)`,operation:`var(--dbt-type-operation-soft)`,sql_operation:`var(--dbt-type-operation-soft)`},ar={model:`var(--dbt-type-model)`,source:`var(--dbt-type-source)`,seed:`var(--dbt-type-seed)`,snapshot:`var(--dbt-type-snapshot)`,test:`var(--dbt-type-test)`,unit_test:`var(--dbt-type-test)`,metric:`var(--dbt-type-metric)`,semantic_model:`var(--dbt-type-semantic-model)`,exposure:`var(--dbt-type-exposure)`,macro:`var(--dbt-type-macro)`,operation:`var(--dbt-type-operation)`,sql_operation:`var(--dbt-type-operation)`};function or(e,t){switch(t){case`status`:return er[e.statusTone??`neutral`];case`type`:return ir[e.resourceType]??rr;case`coverage`:return e.description?tr:nr}}function sr(e,t){switch(t){case`status`:return e.statusTone??`neutral`;case`type`:return e.resourceType;case`coverage`:return e.description?`documented`:`undocumented`}}function cr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function lr(e){return e.split(`_`).map(e=>cr(e)).join(` `)}function ur(e,t){switch(e){case`status`:{let e=new Set;for(let n of t.values())e.add(n.resource.statusTone??`neutral`);return[`positive`,`warning`,`danger`,`skipped`,`neutral`].map(e=>({key:e,label:cr(e),color:er[e]}))}case`type`:return $n(t).map(e=>({key:e,label:lr(e),color:ir[e]??rr,borderColor:ar[e]??`var(--dbt-type-generic)`}));case`coverage`:return[{key:`documented`,label:`Documented`,color:tr},{key:`undocumented`,label:`No description`,color:nr}]}}function dr(e,t,n){let r=new Map;for(let{from:t,to:i}of e){if(!n.has(t)||!n.has(i))continue;let e=r.get(t);e?e.push(i):r.set(t,[i]);let a=r.get(i);a?a.push(t):r.set(i,[t])}let i=new Set;if(!n.has(t))return i;let a=[t];i.add(t);for(let e=0;e<a.length;e+=1){let t=a[e];for(let e of r.get(t)??[])i.has(e)||(i.add(e),a.push(e))}return i}function fr(e,t,n){if(!e.has(n))return{nodeLayouts:e,graphEdges:t};let r=dr(t,n,new Set(e.keys()));if(r.size===e.size)return{nodeLayouts:e,graphEdges:t};let i=new Map;for(let[t,n]of e.entries())r.has(t)&&i.set(t,n);let a=new Set(i.keys());return{nodeLayouts:i,graphEdges:t.filter(e=>a.has(e.from)&&a.has(e.to))}}function pr(e,t,n,r){if(n.size===0)return fr(e.nodeLayouts,e.graphEdges,r);let i=new Map;for(let[a,o]of e.nodeLayouts.entries())(a===r||n.has(sr(o.resource,t)))&&i.set(a,o);let a=new Set(i.keys());return fr(i,e.graphEdges.filter(e=>a.has(e.from)&&a.has(e.to)),r)}function mr({label:e,value:t,setValue:n,disabled:r=!1}){return(0,u.jsxs)(`div`,{className:`lineage-stepper${r?` lineage-stepper--disabled`:``}`,children:[(0,u.jsx)(`span`,{className:`lineage-stepper__label`,children:e}),(0,u.jsxs)(`div`,{className:`lineage-stepper__controls`,children:[(0,u.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t<=1,onClick:()=>n(e=>Wn(e-1)),children:`−`}),(0,u.jsx)(`span`,{className:`lineage-stepper__value`,children:t}),(0,u.jsx)(`button`,{type:`button`,className:`lineage-stepper__button`,disabled:r||t>=3,onClick:()=>n(e=>Wn(e+1)),children:`+`})]})]})}function hr(e,t,n){return n?`all`:e===t&&e>=1&&e<=3?String(e):`custom`}function gr({upstreamDepth:e,downstreamDepth:t,allDepsMode:n,setUpstreamDepth:r,setDownstreamDepth:i,setAllDepsMode:a}){let o=hr(e,t,n),s=e=>{if(e===`all`){a(!0);return}let t=Number(e);a(!1),r(t),i(t)};return(0,u.jsxs)(`div`,{className:`shared-depth-selector`,children:[(0,u.jsx)(`span`,{className:`shared-depth-selector__label`,children:`Depth`}),[`1`,`2`,`3`,`all`].map(e=>(0,u.jsx)(`button`,{type:`button`,className:o===e?Ve:He,onClick:()=>s(e),children:e===`all`?`All`:e},e)),o===`custom`&&(0,u.jsx)(`span`,{className:`shared-depth-selector__state`,children:`Custom`})]})}function _r({lensMode:e,setLensMode:t}){return(0,u.jsxs)(`div`,{className:`lens-selector`,children:[(0,u.jsx)(`span`,{className:`lens-selector__label`,children:`Lens`}),[{value:`type`,label:`Type`},{value:`status`,label:`Status`},{value:`coverage`,label:`Coverage`}].map(({value:n,label:r})=>(0,u.jsx)(`button`,{type:`button`,className:e===n?Ve:He,onClick:()=>t(n),children:r},n))]})}function vr(e){let{layoutX:t,layoutY:n,nodeWidth:r,nodeHeight:i,zoom:a,viewportClientWidth:o,viewportClientHeight:s,scrollWidth:c,scrollHeight:l}=e;if(o<=0||s<=0||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return{scrollLeft:0,scrollTop:0};let u=(t+r/2)*a,d=(n+i/2)*a,f=Math.max(0,c-o),p=Math.max(0,l-s),m=u-o/2,h=d-s/2;return{scrollLeft:Math.min(f,Math.max(0,m)),scrollTop:Math.min(p,Math.max(0,h))}}var yr={width:248,height:176},br={width:220,height:120},xr={x:10,y:8};function Sr(e){return 16+e.length*6.2}function Cr({anchorX:e,anchorY:t,width:n,height:r,offset:i=6,margin:a=12}){let o=window.innerWidth,s=window.innerHeight,c=e+i,l=t+i;return c+n+a>o&&(c=e-n-i),l+r+a>s&&(l=t-r-i),c=Math.min(Math.max(a,c),Math.max(a,o-n-a)),l=Math.min(Math.max(a,l),Math.max(a,s-r-a)),{x:c,y:l}}function wr({visibleNodeLayouts:e,getEffectivePos:t,svgWidth:n,svgHeight:r,nodeWidth:i,nodeHeight:a,zoom:o,nodeOffsets:s,nodeDragRef:c,onSelectResource:l,setHoveredId:d,setTooltipNodeId:f,setContextMenu:p,setNodeOffsets:m}){return(0,u.jsx)(`div`,{className:`dependency-graph__interactive-layer`,children:Array.from(e.values()).map(e=>{let{x:h,y:g}=t(e.resource.uniqueId,e.x,e.y),_={left:`${h/n*100}%`,top:`${g/r*100}%`,width:`${i/n*100}%`,height:`${a/r*100}%`};return(0,u.jsx)(`button`,{type:`button`,className:`dependency-graph__hotspot dependency-graph__hotspot--${e.side}`,style:_,onClick:()=>{c.current?.hasMoved||l(e.resource.uniqueId)},onContextMenu:t=>{t.preventDefault();let n=Cr({anchorX:t.clientX,anchorY:t.clientY,width:br.width,height:br.height});p({x:n.x,y:n.y,nodeId:e.resource.uniqueId})},onMouseEnter:()=>{d(e.resource.uniqueId),f(e.resource.uniqueId)},onMouseLeave:()=>{d(null),f(null)},title:e.resource.uniqueId,onPointerDown:t=>{t.stopPropagation();let n=s.get(e.resource.uniqueId)??{dx:0,dy:0};c.current={nodeId:e.resource.uniqueId,pointerId:t.pointerId,startClientX:t.clientX,startClientY:t.clientY,initialDx:n.dx,initialDy:n.dy,hasMoved:!1},t.currentTarget.setPointerCapture(t.pointerId)},onPointerMove:t=>{let n=c.current;if(!n||n.pointerId!==t.pointerId||n.nodeId!==e.resource.uniqueId)return;let r=t.clientX-n.startClientX,i=t.clientY-n.startClientY;(Math.abs(r)>4||Math.abs(i)>4)&&(n.hasMoved=!0);let a=n.initialDx+r/o,s=n.initialDy+i/o;m(e=>{let t=new Map(e);return t.set(n.nodeId,{dx:a,dy:s}),t})},onPointerUp:e=>{c.current?.pointerId===e.pointerId&&(e.currentTarget.releasePointerCapture(e.pointerId),setTimeout(()=>{c.current=null},0))},onPointerCancel:()=>{c.current=null}},e.resource.uniqueId)})})}function Tr({lensMode:e,legendItems:t,activeLegendKeys:n,onToggleLegendKey:r}){return(0,u.jsxs)(`div`,{className:`lineage-legend`,children:[(0,u.jsx)(`span`,{className:`lineage-legend__mode-label`,children:e===`status`?`By status`:e===`type`?`By type`:`By coverage`}),t.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`lineage-legend__item${n.size===0||n.has(e.key)?` lineage-legend__item--active`:` lineage-legend__item--inactive`}`,onClick:()=>r(e.key),children:[(0,u.jsx)(`span`,{className:`lineage-legend__swatch`,style:{background:e.color,borderColor:e.borderColor}}),e.label]},e.key)),n.size>0&&(0,u.jsx)(`button`,{type:`button`,className:`lineage-legend__clear`,onClick:()=>n.forEach(e=>{r(e)}),children:`Clear`})]})}function Er({node:e,x:t,badgeY:n,badgeHeight:r,badgeRadius:i,displayMode:a}){let o=String(e.passCount),s=String(e.failCount),c=Sr(o),l=Sr(s),d=e.notExecutedCount>0||e.skippedCount>0,f=a===`summary`&&d?4:6,p=e.notExecutedCount>0?String(e.notExecutedCount):``,m=e.skippedCount>0?String(e.skippedCount):``,h=p?Sr(p):0,g=m?Sr(m):0,_=t+16+c+f+l,v=e.notExecutedCount>0?_+f:0,y=e.skippedCount>0?e.notExecutedCount>0?v+h+f:_+f:0;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`rect`,{x:t+16,y:n,width:c,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--pass`}),(0,u.jsx)(`text`,{x:t+16+c/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--pass`,textAnchor:`middle`,dominantBaseline:`middle`,children:o}),(0,u.jsx)(`rect`,{x:t+16+c+f,y:n,width:l,height:r,rx:i,className:`dependency-graph__node-stat-pill ${e.failCount===0?`dependency-graph__node-stat-pill--neutral`:`dependency-graph__node-stat-pill--fail`}`}),(0,u.jsx)(`text`,{x:t+16+c+f+l/2,y:n+r/2,className:`dependency-graph__node-stat ${e.failCount===0?`dependency-graph__node-stat--neutral`:`dependency-graph__node-stat--fail`}`,textAnchor:`middle`,dominantBaseline:`middle`,children:s}),e.notExecutedCount>0?(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`title`,{children:`Not executed in this run: ${e.notExecutedCount}`}),(0,u.jsx)(`rect`,{x:v,y:n,width:h,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--not-executed`}),(0,u.jsx)(`text`,{x:v+h/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--not-executed`,textAnchor:`middle`,dominantBaseline:`middle`,children:p})]}):null,e.skippedCount>0?(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`title`,{children:`Skipped dbt tests: ${e.skippedCount}`}),(0,u.jsx)(`rect`,{x:y,y:n,width:g,height:r,rx:i,className:`dependency-graph__node-stat-pill dependency-graph__node-stat-pill--skipped`}),(0,u.jsx)(`text`,{x:y+g/2,y:n+r/2,className:`dependency-graph__node-stat dependency-graph__node-stat--skipped`,textAnchor:`middle`,dominantBaseline:`middle`,children:m})]}):null]})}function Dr({node:e,getEffectivePos:t,nodeWidth:n,nodeHeight:r,nodeRadius:i,displayMode:a,lensMode:o,highlightedIds:s,hasHoverFocus:c}){let l=!c||s.has(e.resource.uniqueId),{x:d,y:f}=t(e.resource.uniqueId,e.x,e.y),p=a===`summary`?f+r-20:f+r-23,m=a===`summary`?15:17,h=m/2,g=` dependency-graph__node--tone-${e.resource.statusTone??`neutral`}`;return(0,u.jsxs)(`g`,{children:[(0,u.jsx)(`rect`,{x:d,y:f,width:n,height:r,rx:i,className:`dependency-graph__node${e.side===`selected`?` dependency-graph__node--selected`:``}${l?``:` dependency-graph__node--dimmed`}${g}`,...e.side===`selected`?{stroke:`var(--graph-node-selected-stroke)`,strokeWidth:3}:{},style:{fill:or(e.resource,o)}}),(0,u.jsx)(`foreignObject`,{x:d+16,y:a===`summary`?f+10:f+14,width:n-32,height:24,children:(0,u.jsxs)(`div`,{className:`dependency-graph__node-title-row`,title:`${e.resource.name} (${Xe(e.resource.resourceType)})`,children:[(0,u.jsx)(`span`,{className:`dependency-graph__node-title-icon`,title:Xe(e.resource.resourceType),children:(0,u.jsx)(Vt,{resourceType:e.resource.resourceType})}),(0,u.jsx)(`span`,{className:`dependency-graph__node-title-text`,children:e.resource.name})]})}),Gn(e.resource.resourceType)?(0,u.jsx)(Er,{node:e,x:d,badgeY:p,badgeHeight:m,badgeRadius:h,displayMode:a}):null]})}function Or({visibleEdges:e,visibleNodeLayouts:t,getEffectivePos:n,nodeWidth:r,nodeHeight:i,nodeRadius:a,displayMode:o,lensMode:s,highlightedIds:c,hasHoverFocus:l}){return(0,u.jsxs)(u.Fragment,{children:[e.map(e=>{let a=t.get(e.from),o=t.get(e.to);if(!a||!o)return null;let s=n(e.from,a.x,a.y),d=n(e.to,o.x,o.y),f=s.x+r,p=s.y+i/2,m=d.x,h=d.y+i/2,g=Math.max(28,Math.abs(m-f)*.34);return(0,u.jsx)(`path`,{d:`M ${f} ${p} C ${f+g} ${p}, ${m-g} ${h}, ${m} ${h}`,className:`dependency-graph__edge${!l||c.has(e.from)||c.has(e.to)?``:` dependency-graph__edge--dimmed`}`},`${e.from}->${e.to}`)}),Array.from(t.values()).map(e=>(0,u.jsx)(Dr,{node:e,getEffectivePos:n,nodeWidth:r,nodeHeight:i,nodeRadius:a,displayMode:o,lensMode:s,highlightedIds:c,hasHoverFocus:l},e.resource.uniqueId))]})}function kr({zoom:e,setZoom:t,nodeOffsetsSize:n,onResetLayout:r,visibleNodeCount:i,upstreamCount:a,downstreamCount:o}){return(0,u.jsxs)(`div`,{className:`lineage-graph__viewport-toolbar`,children:[(0,u.jsxs)(`div`,{className:`lineage-graph__zoom-controls`,children:[(0,u.jsx)(`button`,{type:`button`,className:He,onClick:()=>t(e=>Math.max(.4,e-.1)),children:`−`}),(0,u.jsxs)(`button`,{type:`button`,className:He,onClick:()=>t(1),children:[Math.round(e*100),`%`]}),(0,u.jsx)(`button`,{type:`button`,className:He,onClick:()=>t(e=>Math.min(2.5,e+.1)),children:`+`}),n>0&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:r,children:`Reset layout`})]}),(0,u.jsxs)(`p`,{className:`lineage-graph__summary`,children:[i,` nodes · `,a,` upstream · `,o,` `,`downstream`]})]})}function Ar({model:e,displayMode:t,fullscreen:n,lensMode:r,legendItems:i,activeLegendKeys:a,onToggleLegendKey:o,zoom:s,setZoom:c,nodeOffsets:l,setNodeOffsets:d,visibleNodeLayouts:f,visibleEdges:p,highlightedIds:m,hasHoverFocus:h,getEffectivePos:g,svgWidth:_,svgHeight:v,nodeWidth:y,nodeHeight:b,nodeRadius:x,viewportRef:S,panDragRef:C,nodeDragRef:w,onSelectResource:T,setHoveredId:E,setTooltipNodeId:D,setContextMenu:O,setViewportTick:k,tooltipLayout:A,tooltipPosition:ee,contextMenu:j}){return(0,u.jsxs)(`div`,{className:`dependency-graph dependency-graph--${t}${n?` dependency-graph--fullscreen`:``}`,children:[(0,u.jsx)(Tr,{lensMode:r,legendItems:i,activeLegendKeys:a,onToggleLegendKey:o}),(0,u.jsx)(kr,{zoom:s,setZoom:c,nodeOffsetsSize:l.size,onResetLayout:()=>d(new Map),visibleNodeCount:f.size,upstreamCount:e.upstreamMap.size,downstreamCount:e.downstreamMap.size}),(0,u.jsx)(`div`,{ref:S,className:`lineage-graph__viewport${n?` lineage-graph__viewport--fullscreen`:``}`,onPointerDown:e=>{let t=S.current;t&&(C.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop},t.setPointerCapture(e.pointerId))},onPointerMove:e=>{let t=C.current,n=S.current;!t||!n||t.pointerId!==e.pointerId||(n.scrollLeft=t.scrollLeft-(e.clientX-t.startX),n.scrollTop=t.scrollTop-(e.clientY-t.startY))},onPointerUp:e=>{let t=S.current;C.current?.pointerId===e.pointerId&&t&&t.releasePointerCapture(e.pointerId),C.current=null},onPointerCancel:()=>{C.current=null},onScroll:()=>k(e=>e+1),children:(0,u.jsxs)(`div`,{className:`lineage-graph__canvas`,style:{width:`${_*s}px`,height:`${v*s}px`},children:[(0,u.jsxs)(`div`,{className:`lineage-graph__zoom-layer`,style:{width:`${_}px`,height:`${v}px`,transform:`scale(${s})`},children:[(0,u.jsx)(`svg`,{className:`dependency-graph__svg dependency-graph__svg--lens-${r}`,viewBox:`0 0 ${_} ${v}`,preserveAspectRatio:`xMidYMid meet`,"aria-hidden":`true`,children:(0,u.jsx)(Or,{visibleEdges:p,visibleNodeLayouts:f,getEffectivePos:g,nodeWidth:y,nodeHeight:b,nodeRadius:x,displayMode:t,lensMode:r,highlightedIds:m,hasHoverFocus:h})}),(0,u.jsx)(wr,{visibleNodeLayouts:f,getEffectivePos:g,svgWidth:_,svgHeight:v,nodeWidth:y,nodeHeight:b,zoom:s,nodeOffsets:l,nodeDragRef:w,onSelectResource:T,setHoveredId:E,setTooltipNodeId:D,setContextMenu:O,setNodeOffsets:d})]}),A&&ee&&(0,u.jsxs)(`div`,{className:`graph-node-tooltip`,style:{left:ee.left,top:ee.top},"aria-hidden":`true`,children:[(0,u.jsx)(`div`,{className:`graph-node-tooltip__name`,children:A.resource.name}),(0,u.jsxs)(`div`,{className:`graph-node-tooltip__meta`,children:[Xe(A.resource.resourceType),A.resource.packageName?` · ${A.resource.packageName}`:``]}),A.resource.status&&(0,u.jsxs)(`div`,{className:`graph-node-tooltip__status graph-node-tooltip__status--${A.resource.statusTone}`,children:[A.resource.status,A.resource.executionTime==null?``:` · ${Ye(A.resource.executionTime)}`]}),A.resource.description&&(0,u.jsx)(`div`,{className:`graph-node-tooltip__description`,children:A.resource.description})]})]})}),j&&(0,u.jsxs)(`div`,{className:`graph-context-menu`,style:{left:j.x,top:j.y},onPointerDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`button`,{type:`button`,className:`graph-context-menu__item`,onClick:()=>{T(j.nodeId),O(null)},children:`Focus on this node`}),(()=>{let e=f.get(j.nodeId);return e?(0,u.jsx)(`div`,{className:`graph-context-menu__label`,children:e.resource.name}):null})()]})]})}function jr(e,t,n,r,i,a,o,s){(0,c.useLayoutEffect)(()=>{if(!e)return;let i=o.current;if(!i)return;let{x:c,y:l}=a(e.resource.uniqueId,e.x,e.y),u=c*t,d=l*t,f=n*t,p=r*t,m=u+f-yr.width-xr.x,h=d+xr.y;m<i.scrollLeft+12&&(m=u+xr.x),h+yr.height>i.scrollTop+i.clientHeight&&(h=d+p-yr.height-xr.y),m=Math.min(Math.max(i.scrollLeft+12,m),Math.max(i.scrollLeft+12,i.scrollLeft+i.clientWidth-yr.width-12)),h=Math.min(Math.max(i.scrollTop+12,h),Math.max(i.scrollTop+12,i.scrollTop+i.clientHeight-yr.height-12)),s({left:m,top:h})},[e,t,n,r,i,a,o,s])}function Mr({model:e,onSelectResource:t,lensMode:n=`type`,activeLegendKeys:r,onToggleLegendKey:i,fullscreen:a=!1,displayMode:o=`focused`}){let{nodeLayouts:s,svgHeight:l,svgWidth:d,nodeWidth:f,nodeHeight:p,nodeRadius:m}=e,[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(null),[y,b]=(0,c.useState)(1),[x,S]=(0,c.useState)(0),[C,w]=(0,c.useState)(null),[T,E]=(0,c.useState)(new Map),[D,O]=(0,c.useState)(0),[k,A]=(0,c.useState)(null),ee=(0,c.useRef)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(null),te=(0,c.useRef)(null),N=(0,c.useRef)(y),P=(0,c.useMemo)(()=>Array.from(s.values()).find(e=>e.side===`selected`)?.resource.uniqueId??``,[s]),F=(0,c.useMemo)(()=>pr(e,n,r,P),[r,n,e,P]),I=F.nodeLayouts,ne=F.graphEdges;(0,c.useEffect)(()=>{queueMicrotask(()=>{b(1),E(new Map),O(e=>e+1)})},[e]),(0,c.useLayoutEffect)(()=>{N.current=y;let e=te.current,t=M.current;e&&t&&(t.scrollLeft=e.x,t.scrollTop=e.y,te.current=null)},[y]),(0,c.useLayoutEffect)(()=>{if(N.current!==1||T.size>0)return;let e=M.current;if(!e)return;if(!P){e.scrollLeft=0,e.scrollTop=0;return}let t=I.get(P);if(!t){e.scrollLeft=0,e.scrollTop=0;return}let{scrollLeft:n,scrollTop:r}=vr({layoutX:t.x,layoutY:t.y,nodeWidth:f,nodeHeight:p,zoom:1,viewportClientWidth:e.clientWidth,viewportClientHeight:e.clientHeight,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight});e.scrollLeft=n,e.scrollTop=r},[D,e,T,P,I,f,p]),(0,c.useEffect)(()=>{if(!k)return;let e=()=>A(null),t=t=>{t.key===`Escape`&&e()};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[k]),(0,c.useEffect)(()=>{let e=M.current;if(!e)return;let t=t=>{if(t.preventDefault(),t.ctrlKey){let n=e.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top,a=e.scrollLeft,o=e.scrollTop;b(e=>{let n=Math.max(.4,Math.min(2.5,e*(1-t.deltaY*.003)));return te.current={x:(a+r)/e*n-r,y:(o+i)/e*n-i},n})}else e.scrollLeft+=t.deltaX,e.scrollTop+=t.deltaY};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let re=(0,c.useCallback)((e,t,n)=>{let r=T.get(e);return{x:t+(r?.dx??0),y:n+(r?.dy??0)}},[T]),ie=_!==null&&I.has(_)?_:null,ae=ie?I.get(ie)??null:null;if(jr(ae,y,f,p,x,re,M,w),I.size===0)return(0,u.jsx)(`div`,{className:`dependency-graph dependency-graph--empty dependency-graph--${o}${a?` dependency-graph--fullscreen`:``}`,children:(0,u.jsx)(yt,{icon:`↔`,headline:`No lineage available`,subtext:`This resource could not be placed on the lineage canvas.`})});let oe=ur(n,s),se=Qn(h,ne);return(0,u.jsx)(Ar,{model:e,displayMode:o,fullscreen:a,lensMode:n,legendItems:oe,activeLegendKeys:r,onToggleLegendKey:i,zoom:y,setZoom:b,nodeOffsets:T,setNodeOffsets:E,visibleNodeLayouts:I,visibleEdges:ne,highlightedIds:se,hasHoverFocus:se.size>0,getEffectivePos:re,svgWidth:d,svgHeight:l,nodeWidth:f,nodeHeight:p,nodeRadius:m,viewportRef:M,panDragRef:ee,nodeDragRef:j,onSelectResource:t,setHoveredId:g,setTooltipNodeId:v,setContextMenu:A,setViewportTick:S,tooltipLayout:ae,tooltipPosition:C,contextMenu:k})}function Nr({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:i,downstreamDepth:a,allDepsMode:o,lensMode:s,activeLegendKeys:l,setUpstreamDepth:d,setDownstreamDepth:f,setAllDepsMode:p,setLensMode:m,setActiveLegendKeys:h,onSelectResource:g,displayMode:_=`focused`,openFullscreen:v=!1,onFullscreenChange:y,fullscreenScope:b=`viewport`}){let[x,S]=(0,c.useState)(!1);(0,c.useEffect)(()=>{S(v)},[v]);let C=(0,c.useCallback)(e=>{S(e),y?.(e)},[y]);(0,c.useEffect)(()=>{if(!x)return;let e=e=>{e.key===`Escape`&&C(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x,C]),(0,c.useEffect)(()=>{if(!x||typeof document>`u`)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[x]);let w=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},T=(0,c.useMemo)(()=>Zn({resource:e,dependencySummary:t,dependencyIndex:n,resourceById:r,upstreamDepth:o?20:i,downstreamDepth:o?20:a,displayMode:_}),[o,n,t,_,a,e,r,i]),E=()=>(0,u.jsxs)(`div`,{className:`lineage-toolbar`,children:[(0,u.jsx)(_r,{lensMode:s,setLensMode:m}),(0,u.jsx)(gr,{upstreamDepth:i,downstreamDepth:a,allDepsMode:o,setUpstreamDepth:d,setDownstreamDepth:f,setAllDepsMode:p}),(0,u.jsx)(mr,{label:`Upstream`,value:i,setValue:d,disabled:o}),(0,u.jsx)(mr,{label:`Downstream`,value:a,setValue:f,disabled:o}),l.size>0&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>h(new Set),children:`Clear filters`}),_===`focused`&&!x?(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>C(!0),children:`Expand`}):null]}),D=_===`summary`?(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>C(!0),children:`Expand lineage`}):void 0,O=x?(0,u.jsxs)(`div`,{className:`lineage-dialog lineage-dialog--${b}`,role:`dialog`,"aria-modal":`true`,children:[(0,u.jsx)(`button`,{type:`button`,className:`lineage-dialog__backdrop`,"aria-label":`Dismiss lineage overlay`,onClick:()=>C(!1)}),(0,u.jsxs)(`section`,{className:`lineage-dialog__panel`,children:[(0,u.jsxs)(`div`,{className:`lineage-dialog__header`,children:[(0,u.jsxs)(`div`,{className:`lineage-dialog__header-main`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Lineage`}),(0,u.jsx)(`h3`,{children:e.name}),(0,u.jsx)(`p`,{className:`lineage-dialog__subtitle`,children:`Exact dependency graph with staged upstream and downstream columns.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`lineage-dialog__close`,"aria-label":`Close lineage graph`,onClick:()=>C(!1),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`×`})})]}),(0,u.jsx)(`div`,{className:`lineage-dialog__toolbar`,children:E()})]}),(0,u.jsx)(Mr,{model:T,onSelectResource:g,lensMode:s,activeLegendKeys:l,onToggleLegendKey:w,displayMode:`focused`,fullscreen:!0})]})]}):null;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(zt,{title:_===`summary`?`Lineage graph`:`Lineage`,subtitle:_===`summary`?void 0:`Exact upstream and downstream lineage for ${e.name}.`,headerRight:_===`focused`?E():D,children:(0,u.jsxs)(`div`,{className:`lineage-summary lineage-summary--${_}`,children:[(0,u.jsxs)(`div`,{className:`lineage-summary__stats`,children:[(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Selected resource`}),(0,u.jsx)(`strong`,{children:Xe(e.resourceType)})]}),(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Direct upstream`}),(0,u.jsx)(`strong`,{children:t?.upstreamCount??0})]}),(0,u.jsxs)(`div`,{className:`lineage-summary__stat`,children:[(0,u.jsx)(`span`,{children:`Direct downstream`}),(0,u.jsx)(`strong`,{children:t?.downstreamCount??0})]})]}),(0,u.jsx)(Mr,{model:T,onSelectResource:g,lensMode:s,activeLegendKeys:l,onToggleLegendKey:w,displayMode:_})]})}),O&&typeof document<`u`&&(0,Sn.createPortal)(O,document.body)]})}function Pr(e,t){return t===`asc`?e:-e}function Fr(e){return e.statusTone===`danger`||e.statusTone===`warning`?0:e.statusTone===`positive`?1:e.statusTone===`skipped`?2:3}function Ir(e,t,n){return e==null&&t==null?0:e==null?n===`asc`?1:-1:t==null?n===`asc`?-1:1:Pr(e.localeCompare(t),n)}function Lr(e,t){return(t.executionTime??-1/0)-(e.executionTime??-1/0)}function Rr(e,t){return e===0?0:t===`asc`?-e:e}function zr(e,t,n){let r=e.name.localeCompare(t.name);return r===0?e.uniqueId.localeCompare(t.uniqueId):Pr(r,n)}function Br(e,t,n){let r=Lr(e,t);return r===0?e.name.localeCompare(t.name):Rr(r,n)}function Vr(e,t,n){let r=Xe(e.resourceType).localeCompare(Xe(t.resourceType));return r===0?e.name.localeCompare(t.name):Pr(r,n)}function Hr(e,t,n){let r=Ir(et(e),et(t),n);return r===0?e.name.localeCompare(t.name):r}function Ur(e,t,n){let r=Fr(e)-Fr(t);if(r!==0)return-Pr(r,n);let i=Lr(e,t);if(i!==0)return Rr(i,n);let a=e.name.localeCompare(t.name);return a===0?e.uniqueId.localeCompare(t.uniqueId):Pr(a,n)}function Wr(e,t,n,r){switch(n){case`test`:return zr(e,t,r);case`duration`:return Br(e,t,r);case`type`:return Vr(e,t,r);case`location`:return Hr(e,t,r);case`status`:return Ur(e,t,r);default:return n}}function Gr(e,t,n){return[...e].sort((e,r)=>Wr(e,r,t,n))}function Kr(e){return e.total===0?{label:`No attached tests`,tone:`neutral`,detail:`No quality evidence was linked to this asset in the current artifacts.`}:e.attention>0?{label:`Attention needed`,tone:`warning`,detail:`${e.attention} attention item${e.attention===1?``:`s`} across ${e.total} attached tests.`}:{label:`All attached tests passing`,tone:`positive`,detail:`${e.passing} of ${e.total} attached tests passed in the current artifacts.`}}function qr(e,t,n){return e===t?n===`asc`?{indicator:`↑`,ariaSort:`ascending`}:{indicator:`↓`,ariaSort:`descending`}:{indicator:` `,ariaSort:`none`}}function Jr(e,t,n){return e===t?n===`asc`?`desc`:`asc`:t===`status`||t===`duration`?`desc`:`asc`}var Yr=[{key:`test`,label:`Test`,alignEnd:!1,testCell:!0},{key:`status`,label:`Status`,alignEnd:!1,testCell:!1},{key:`type`,label:`Type`,alignEnd:!1,testCell:!1},{key:`duration`,label:`Duration`,alignEnd:!0,testCell:!1},{key:`location`,label:`Location`,alignEnd:!1,testCell:!1}];function Xr({resource:e,analysis:t,onNavigateTo:n}){let[r,i]=(0,c.useState)(`status`),[a,o]=(0,c.useState)(`desc`),s=(0,c.useMemo)(()=>En(e.uniqueId,t.resources,t.dependencyIndex),[t.dependencyIndex,t.resources,e.uniqueId]),l=Kr(s),d=(0,c.useMemo)(()=>Gr(s.tests,r,a),[s.tests,a,r]),f=e=>{o(t=>Jr(r,e,t)),i(e)};return(0,u.jsxs)(zt,{title:`Tests`,subtitle:`Quality evidence and related dependency posture.`,children:[(0,u.jsxs)(`div`,{className:`asset-tests-summary`,children:[(0,u.jsxs)(`div`,{className:`asset-tests-summary__headline`,children:[(0,u.jsx)(`span`,{className:`tone-badge tone-badge--${l.tone}`,children:l.label}),(0,u.jsx)(`p`,{children:l.detail})]}),(0,u.jsxs)(`div`,{className:`asset-tests-summary__metrics`,"aria-label":`Test summary`,children:[(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.total}),(0,u.jsx)(`span`,{children:`Attached tests`})]}),(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.passing}),(0,u.jsx)(`span`,{children:`Passing`})]}),(0,u.jsxs)(`span`,{className:`asset-tests-summary__metric`,children:[(0,u.jsx)(`strong`,{children:s.attention}),(0,u.jsx)(`span`,{children:`Attention items`})]})]})]}),s.tests.length===0?(0,u.jsx)(`p`,{className:`resource-spotlight__description resource-spotlight__description--muted`,children:`No attached tests were found for this asset in the current artifacts.`}):(0,u.jsxs)(`div`,{className:`asset-tests-table`,"aria-label":`Attached tests evidence`,children:[(0,u.jsx)(`div`,{className:`asset-tests-table__toolbar`,children:(0,u.jsx)(`p`,{className:`asset-tests-table__caption`,children:`Compare attached test evidence by status, duration, and source location.`})}),(0,u.jsxs)(`div`,{className:`asset-tests-table__header`,role:`row`,children:[Yr.map(({key:e,label:t,alignEnd:n,testCell:i})=>{let o=qr(r,e,a);return(0,u.jsx)(`div`,{className:`asset-tests-table__cell${i?` asset-tests-table__cell--test`:``}${n?` asset-tests-table__cell--align-end`:``}`,role:`columnheader`,"aria-sort":o.ariaSort,children:(0,u.jsxs)(`button`,{type:`button`,className:`asset-tests-table__sort-button${n?` asset-tests-table__sort-button--align-end`:``}`,onClick:()=>f(e),children:[t,(0,u.jsx)(`span`,{className:`asset-tests-table__sort-indicator`,"aria-hidden":`true`,children:o.indicator})]})},e)}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,role:`columnheader`,children:`Action`})]}),(0,u.jsx)(`div`,{className:`asset-tests-table__body`,children:d.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`asset-tests-table__row`,onClick:()=>n(`runs`,{executionId:e.uniqueId}),children:[(0,u.jsxs)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--test`,children:[(0,u.jsx)(`strong`,{title:e.name,children:e.name}),(0,u.jsx)(`span`,{children:e.packageName||`workspace`})]}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell`,"data-label":`Status`,children:(0,u.jsx)(`span`,{className:$e(e.statusTone),children:e.status??`Not executed`})}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell`,"data-label":`Type`,children:(0,u.jsx)(Bt,{resourceType:e.resourceType})}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,"data-label":`Duration`,children:Ye(e.executionTime)}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--location`,"data-label":`Location`,children:et(e)??`No path captured`}),(0,u.jsx)(`div`,{className:`asset-tests-table__cell asset-tests-table__cell--align-end`,"data-label":`Action`,children:(0,u.jsx)(`span`,{className:`asset-tests-table__link`,children:`Open in Runs`})})]},e.uniqueId))})]})]})}function Zr(e,t){let[n,r]=(0,c.useState)(null),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!1),[l,u]=(0,c.useState)(null),d=(0,c.useRef)(0);return(0,c.useEffect)(()=>{d.current+=1;let t=d.current;if(!e){r(null),a(null),u(null),s(!1);return}let n=!1;return r(null),a(null),s(!0),u(null),w(e).then(e=>{n||d.current!==t||(r(e.compiledCode),a(e.rawCode))}).catch(e=>{n||d.current!==t||(r(null),a(null),u(e instanceof Error?e.message:`Failed to load SQL`))}).finally(()=>{!n&&d.current===t&&s(!1)}),()=>{n=!0}},[t,e]),{compiledCode:n,rawCode:i,loading:o,error:l}}function Qr(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var $r=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ei=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ti={};function ni(e,t){return((t||ti).jsx?ei:$r).test(e)}var ri=/[ \t\n\f\r]/g;function ii(e){return typeof e==`object`?e.type===`text`?ai(e.value):!1:ai(e)}function ai(e){return e.replace(ri,``)===``}var oi=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};oi.prototype.normal={},oi.prototype.property={},oi.prototype.space=void 0;function si(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new oi(n,r,t)}function ci(e){return e.toLowerCase()}var B=class{constructor(e,t){this.attribute=t,this.property=e}};B.prototype.attribute=``,B.prototype.booleanish=!1,B.prototype.boolean=!1,B.prototype.commaOrSpaceSeparated=!1,B.prototype.commaSeparated=!1,B.prototype.defined=!1,B.prototype.mustUseProperty=!1,B.prototype.number=!1,B.prototype.overloadedBoolean=!1,B.prototype.property=``,B.prototype.spaceSeparated=!1,B.prototype.space=void 0;var li=e({boolean:()=>V,booleanish:()=>H,commaOrSpaceSeparated:()=>pi,commaSeparated:()=>fi,number:()=>U,overloadedBoolean:()=>di,spaceSeparated:()=>W}),ui=0,V=mi(),H=mi(),di=mi(),U=mi(),W=mi(),fi=mi(),pi=mi();function mi(){return 2**++ui}var hi=Object.keys(li),gi=class extends B{constructor(e,t,n,r){let i=-1;if(super(e,t),_i(this,`space`,r),typeof n==`number`)for(;++i<hi.length;){let e=hi[i];_i(this,hi[i],(n&li[e])===li[e])}}};gi.prototype.defined=!0;function _i(e,t,n){n&&(e[t]=n)}function vi(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new gi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ci(r)]=r,n[ci(a.attribute)]=r}return new oi(t,n,e.space)}var yi=vi({properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:H,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:W,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:U,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:W,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:H,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function bi(e,t){return t in e?e[t]:t}function xi(e,t){return bi(e,t.toLowerCase())}var Si=vi({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:fi,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:W,autoFocus:V,autoPlay:V,blocking:W,capture:null,charSet:null,checked:V,cite:null,className:W,cols:U,colSpan:null,content:null,contentEditable:H,controls:V,controlsList:W,coords:U|fi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:di,draggable:H,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:W,height:U,hidden:di,high:U,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:W,itemRef:W,itemScope:V,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:V,optimum:U,pattern:null,ping:W,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:W,required:V,reversed:V,rows:U,rowSpan:U,sandbox:W,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:H,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:H,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:H,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:V,disableRemotePlayback:V,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:xi}),Ci=vi({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:pi,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:W,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fi,g2:fi,glyphName:fi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:pi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pi,rev:pi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pi,requiredFeatures:pi,requiredFonts:pi,requiredFormats:pi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:pi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pi,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:bi}),wi=vi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Ti=vi({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:xi}),Ei=vi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Di={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Oi=/[A-Z]/g,ki=/-[a-z]/g,Ai=/^data[-\w.:]+$/i;function ji(e,t){let n=ci(t),r=t,i=B;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ai.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ki,Ni);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ki.test(e)){let n=e.replace(Oi,Mi);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=gi}return new i(r,t)}function Mi(e){return`-`+e.toLowerCase()}function Ni(e){return e.charAt(1).toUpperCase()}var Pi=si([yi,Si,wi,Ti,Ei],`html`),Fi=si([yi,Ci,wi,Ti,Ei],`svg`);function Ii(e){return e.join(` `).trim()}var Li=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
2
|
+
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),Ri=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(Li());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),zi=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Bi=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ri()),r=zi();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Vi=Ui(`end`),Hi=Ui(`start`);function Ui(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Wi(e){let t=Hi(e),n=Vi(e);if(t&&n)return{start:t,end:n}}function Gi(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?qi(e.position):`start`in e||`end`in e?qi(e):`line`in e||`column`in e?Ki(e):``}function Ki(e){return Ji(e&&e.line)+`:`+Ji(e&&e.column)}function qi(e){return Ki(e&&e.start)+`-`+Ki(e&&e.end)}function Ji(e){return e&&typeof e==`number`?e:1}var G=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Gi(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};G.prototype.file=``,G.prototype.name=``,G.prototype.reason=``,G.prototype.message=``,G.prototype.stack=``,G.prototype.column=void 0,G.prototype.line=void 0,G.prototype.ancestors=void 0,G.prototype.cause=void 0,G.prototype.fatal=void 0,G.prototype.place=void 0,G.prototype.ruleId=void 0,G.prototype.source=void 0;var Yi=t(Bi(),1),Xi={}.hasOwnProperty,Zi=new Map,Qi=/[A-Z]/g,$i=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),ea=new Set([`td`,`th`]),ta=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function na(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=pa(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=fa(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Fi:Pi,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ra(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ra(e,t,n){if(t.type===`element`)return ia(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return aa(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return sa(e,t,n);if(t.type===`mdxjsEsm`)return oa(e,t);if(t.type===`root`)return ca(e,t,n);if(t.type===`text`)return la(e,t)}function ia(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Fi,e.schema=i),e.ancestors.push(t);let a=ya(e,t.tagName,!1),o=ma(e,t),s=ga(e,t);return $i.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!ii(e):!0})),ua(e,o,a,t),da(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function aa(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ba(e,t.position)}function oa(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ba(e,t.position)}function sa(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Fi,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ya(e,t.name,!0),o=ha(e,t),s=ga(e,t);return ua(e,o,a,t),da(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ca(e,t,n){let r={};return da(r,ga(e,t)),e.create(t,e.Fragment,r,n)}function la(e,t){return t.value}function ua(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function da(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function fa(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function pa(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Hi(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function ma(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Xi.call(t.properties,i)){let a=_a(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&ea.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ha(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ba(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else ba(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function ga(e,t){let n=[],r=-1,i=e.passKeys?new Map:Zi;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=ra(e,a,o);s!==void 0&&n.push(s)}return n}function _a(e,t,n){let r=ji(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Qr(n):Ii(n)),r.property===`style`){let t=typeof n==`object`?n:va(e,String(n));return e.stylePropertyNameCase===`css`&&(t=xa(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Di[r.property]||r.property:r.attribute,n]}}function va(e,t){try{return(0,Yi.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new G("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=ta+`#cannot-parse-style-attribute`,r}}function ya(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ni(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ni(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Xi.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);ba(e)}function ba(e,t){let n=new G("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=ta+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function xa(e){let t={},n;for(n in e)Xi.call(e,n)&&(t[Sa(n)]=e[n]);return t}function Sa(e){let t=e.replace(Qi,Ca);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ca(e){return`-`+e.toLowerCase()}var wa={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Ta={};function Ea(e,t){let n=t||Ta;return Da(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Da(e,t,n){if(ka(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Oa(e.children,t,n)}return Array.isArray(e)?Oa(e,t,n):``}function Oa(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Da(e[i],t,n);return r.join(``)}function ka(e){return!!(e&&typeof e==`object`)}var Aa=document.createElement(`i`);function ja(e){let t=`&`+e+`;`;Aa.innerHTML=t;let n=Aa.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function Ma(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Na(e,t){return e.length>0?(Ma(e,e.length,0,t),e):t}var Pa={}.hasOwnProperty;function Fa(e){let t={},n=-1;for(;++n<e.length;)Ia(t,e[n]);return t}function Ia(e,t){let n;for(n in t){let r=(Pa.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Pa.call(r,a)||(r[a]=[]);let e=i[a];La(r[a],Array.isArray(e)?e:e?[e]:[])}}}function La(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Ma(e,0,0,r)}function Ra(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function za(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var K=qa(/[A-Za-z]/),q=qa(/[\dA-Za-z]/),Ba=qa(/[#-'*+\--9=?A-Z^-~]/);function Va(e){return e!==null&&(e<32||e===127)}var Ha=qa(/\d/),Ua=qa(/[\dA-Fa-f]/),Wa=qa(/[!-/:-@[-`{-~]/);function J(e){return e!==null&&e<-2}function Y(e){return e!==null&&(e<0||e===32)}function X(e){return e===-2||e===-1||e===32}var Ga=qa(/\p{P}|\p{S}/u),Ka=qa(/\s/);function qa(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ja(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&q(e.charCodeAt(n+1))&&q(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return X(r)?(e.enter(n),s(r)):t(r)}function s(r){return X(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Ya={tokenize:Xa};function Xa(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return J(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Za={tokenize:$a},Qa={tokenize:eo};function $a(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Ma(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Qa,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Qa,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return J(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Ma(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function eo(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function to(e){if(e===null||Y(e)||Ka(e))return 1;if(Ga(e))return 2}function no(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var ro={name:`attention`,resolveAll:io,tokenize:ao};function io(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};oo(d,-c),oo(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Na(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Na(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Na(l,no(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Na(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Na(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Ma(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ao(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=to(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=to(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function oo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var so={name:`autolink`,tokenize:co};function co(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return K(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||q(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||q(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Va(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ba(t)?(e.consume(t),l):n(t)}function u(e){return q(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||q(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var lo={partial:!0,tokenize:uo};function uo(e,t,n){return r;function r(t){return X(t)?Z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||J(e)?t(e):n(e)}}var fo={continuation:{tokenize:mo},exit:ho,name:`blockQuote`,tokenize:po};function po(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return X(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function mo(e,t,n){let r=this;return i;function i(t){return X(t)?Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(fo,t,n)(r)}}function ho(e){e.exit(`blockQuote`)}var go={name:`characterEscape`,tokenize:_o};function _o(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Wa(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var vo={name:`characterReference`,tokenize:yo};function yo(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=q,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Ua,u):(e.enter(`characterReferenceValue`),a=7,o=Ha,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===q&&!ja(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var bo={partial:!0,tokenize:Co},xo={concrete:!0,name:`codeFenced`,tokenize:So};function So(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||J(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(bo,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Z(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||J(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&X(t)?Z(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||J(t)?e.check(bo,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||J(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),X(t)?Z(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||J(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Co(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var wo={name:`codeIndented`,tokenize:Eo},To={partial:!0,tokenize:Do};function Eo(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Z(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):J(t)?e.attempt(To,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||J(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Do(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Z(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):J(e)?i(e):n(e)}}var Oo={name:`codeText`,previous:Ao,resolve:ko,tokenize:jo};function ko(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ao(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function jo(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||J(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Mo=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&No(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),No(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),No(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);No(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);No(this.left,t.reverse())}}};function No(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Po(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Mo(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Fo(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Ma(e,0,1/0,u.slice(0)),!l}function Fo(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Io={resolve:Ro,tokenize:zo},Lo={partial:!0,tokenize:Bo};function Ro(e){return Po(e),e}function zo(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):J(t)?e.check(Lo,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Bo(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,a,`linePrefix`)}function a(i){if(i===null||J(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Vo(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Va(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||J(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Y(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Va(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Ho(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):J(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||J(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!X(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Uo(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||J(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Wo(e,t){let n;return r;function r(i){return J(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):X(i)?Z(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Go={name:`definition`,tokenize:qo},Ko={partial:!0,tokenize:Jo};function qo(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ho.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=za(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Y(t)?Wo(e,l)(t):l(t)}function l(t){return Vo(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ko,d,d)(t)}function d(t){return X(t)?Z(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||J(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Jo(e,t,n){return r;function r(t){return Y(t)?Wo(e,i)(t):n(t)}function i(t){return Uo(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return X(t)?Z(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||J(e)?t(e):n(e)}}var Yo={name:`hardBreakEscape`,tokenize:Xo};function Xo(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return J(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Zo={name:`headingAtx`,resolve:Qo,tokenize:$o};function Qo(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Ma(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function $o(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Y(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||J(n)?(e.exit(`atxHeading`),t(n)):X(n)?Z(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Y(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var es=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),ts=[`pre`,`script`,`style`,`textarea`],ns={concrete:!0,name:`htmlFlow`,resolveTo:as,tokenize:os},rs={partial:!0,tokenize:cs},is={partial:!0,tokenize:ss};function as(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function os(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):K(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):K(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return K(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Y(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ts.includes(l)?(i=1,r.interrupt?t(s):O(s)):es.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||q(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return X(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||K(t)?(e.consume(t),b):X(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):X(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):X(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||J(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Y(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||X(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||J(t)?O(t):X(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):J(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(rs,I,k)(t)):t===null||J(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(is,A,I)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||J(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),P):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return ts.includes(n)?(e.consume(t),F):O(t)}return K(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function N(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||J(t)?(e.exit(`htmlFlowData`),I(t)):(e.consume(t),F)}function I(n){return e.exit(`htmlFlow`),t(n)}}function ss(e,t,n){let r=this;return i;function i(t){return J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function cs(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(lo,t,n)}}var ls={name:`htmlText`,tokenize:us};function us(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):K(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):K(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):J(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):J(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):J(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):J(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return K(t)?(e.consume(t),S):n(t)}function S(t){return t===45||q(t)?(e.consume(t),S):C(t)}function C(t){return J(t)?(o=C,M(t)):X(t)?(e.consume(t),C):j(t)}function w(t){return t===45||q(t)?(e.consume(t),w):t===47||t===62||Y(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||K(t)?(e.consume(t),E):J(t)?(o=T,M(t)):X(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):J(t)?(o=D,M(t)):X(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):J(t)?(o=O,M(t)):X(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):J(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Y(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||Y(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return X(t)?Z(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var ds={name:`labelEnd`,resolveAll:hs,resolveTo:gs,tokenize:_s},fs={tokenize:vs},ps={tokenize:ys},ms={tokenize:bs};function hs(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Ma(e,0,e.length,n),e}function gs(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Na(s,e.slice(a+1,a+r+3)),s=Na(s,[[`enter`,u,t]]),s=Na(s,no(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Na(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Na(s,e.slice(o+1)),s=Na(s,[[`exit`,c,t]]),Ma(e,a,e.length,s),e}function _s(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(za(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(fs,u,o?u:d)(t):t===91?e.attempt(ps,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ms,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function vs(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Y(t)?Wo(e,a)(t):a(t)}function a(t){return t===41?u(t):Vo(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Y(t)?Wo(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Uo(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Y(t)?Wo(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function ys(e,t,n){let r=this;return i;function i(t){return Ho.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(za(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function bs(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var xs={name:`labelStartImage`,resolveAll:ds.resolveAll,tokenize:Ss};function Ss(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Cs={name:`labelStartLink`,resolveAll:ds.resolveAll,tokenize:ws};function ws(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Ts={name:`lineEnding`,tokenize:Es};function Es(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}}var Ds={name:`thematicBreak`,tokenize:Os};function Os(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||J(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),X(t)?Z(e,s,`whitespace`)(t):s(t))}}var Q={continuation:{tokenize:Ms},exit:Ps,name:`list`,tokenize:js},ks={partial:!0,tokenize:Fs},As={partial:!0,tokenize:Ns};function js(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ha(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ds,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ha(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(lo,r.interrupt?n:u,e.attempt(ks,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return X(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Ms(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(lo,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Z(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!X(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(As,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Z(e,e.attempt(Q,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Ns(e,t,n){let r=this;return Z(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Ps(e){e.exit(this.containerState.type)}function Fs(e,t,n){let r=this;return Z(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!X(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Is={name:`setextUnderline`,resolveTo:Ls,tokenize:Rs};function Ls(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Rs(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),X(t)?Z(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||J(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var zs={tokenize:Bs};function Bs(e){let t=this,n=e.attempt(lo,r,e.attempt(this.parser.constructs.flowInitial,i,Z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Io,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Vs={resolveAll:Gs()},Hs=Ws(`string`),Us=Ws(`text`);function Ws(e){return{resolveAll:Gs(e===`text`?Ks:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Gs(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Ks(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var qs=e({attentionMarkers:()=>tc,contentInitial:()=>Ys,disable:()=>nc,document:()=>Js,flow:()=>Zs,flowInitial:()=>Xs,insideSpan:()=>ec,string:()=>Qs,text:()=>$s}),Js={42:Q,43:Q,45:Q,48:Q,49:Q,50:Q,51:Q,52:Q,53:Q,54:Q,55:Q,56:Q,57:Q,62:fo},Ys={91:Go},Xs={[-2]:wo,[-1]:wo,32:wo},Zs={35:Zo,42:Ds,45:[Is,Ds],60:ns,61:Is,95:Ds,96:xo,126:xo},Qs={38:vo,92:go},$s={[-5]:Ts,[-4]:Ts,[-3]:Ts,33:xs,38:vo,42:ro,60:[so,ls],91:Cs,92:[Yo,go],93:ds,95:ro,96:Oo},ec={null:[ro,Vs]},tc={null:[42,95]},nc={null:[]};function rc(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Na(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=no(a,l.events,l),l.events):[]}function f(e,t){return ac(p(e),t)}function p(e){return ic(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){J(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Ma(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ic(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ac(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
3
3
|
`;break;case-3:o=`\r
|
|
4
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function ic(e){let t={constructs:Na([Gs,...(e||{}).extensions||[]]),content:n(qa),defined:[],document:n(Ya),flow:n(Ls),lazy:{},string:n(Bs),text:n(Vs)};return t;function n(e){return n;function n(n){return tc(t,e,n)}}}function ac(e){for(;!Mo(e););return e}var oc=/[\0\t\n\r]/g;function sc(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(oc.lastIndex=u,c=oc.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var cc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lc(e){return e.replace(cc,uc)}function uc(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Ia(n.slice(t?2:1),t?16:10)}return ka(n)||e}var dc={}.hasOwnProperty;function fc(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),pc(n)(ac(ic(n).document().write(sc()(e,t,!0))))}function pc(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(L),reference:ne,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(R),thematicBreak:a(Se)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:N,labelText:te,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:P,resourceTitleString:F,resource:I,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};hc(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];dc.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||_c).call(a,void 0,e[0])}for(r.position={start:mc(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:mc(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:mc(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||_c).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Ui({start:e.start,end:e.end})+`): it’s not open`);n.position.end=mc(e.end)}function u(){return wa(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=La(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=xe(),n.position={start:mc(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=mc(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=mc(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=lc(t),n.identifier=La(t).toLowerCase()}function N(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function I(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=La(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Ia(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ka(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=mc(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function L(){return{type:`paragraph`,children:[]}}function R(){return{type:`strong`,children:[]}}function xe(){return{type:`text`,value:``}}function Se(){return{type:`thematicBreak`}}}function mc(e){return{line:e.line,column:e.column,offset:e.offset}}function hc(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?hc(e,r):gc(e,r)}}function gc(e,t){let n;for(n in t)if(dc.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function _c(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ui({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ui({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ui({start:t.start,end:t.end})+`) is still open`)}function vc(e){let t=this;t.parser=n;function n(n){return fc(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function yc(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function bc(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
5
|
-
`}]}function
|
|
6
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function
|
|
4
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function oc(e){let t={constructs:Fa([qs,...(e||{}).extensions||[]]),content:n(Ya),defined:[],document:n(Za),flow:n(zs),lazy:{},string:n(Hs),text:n(Us)};return t;function n(e){return n;function n(n){return rc(t,e,n)}}}function sc(e){for(;!Po(e););return e}var cc=/[\0\t\n\r]/g;function lc(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(cc.lastIndex=u,c=cc.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var uc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function dc(e){return e.replace(uc,fc)}function fc(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Ra(n.slice(t?2:1),t?16:10)}return ja(n)||e}var pc={}.hasOwnProperty;function mc(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),hc(n)(sc(oc(n).document().write(lc()(e,t,!0))))}function hc(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(L),reference:ne,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(R),thematicBreak:a(Se)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:N,labelText:te,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:P,resourceTitleString:F,resource:I,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};_c(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];pc.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||yc).call(a,void 0,e[0])}for(r.position={start:gc(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:gc(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:gc(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||yc).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Gi({start:e.start,end:e.end})+`): it’s not open`);n.position.end=gc(e.end)}function u(){return Ea(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=za(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=xe(),n.position={start:gc(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=gc(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=gc(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=dc(t),n.identifier=za(t).toLowerCase()}function N(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function I(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=za(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Ra(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ja(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=gc(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function L(){return{type:`paragraph`,children:[]}}function R(){return{type:`strong`,children:[]}}function xe(){return{type:`text`,value:``}}function Se(){return{type:`thematicBreak`}}}function gc(e){return{line:e.line,column:e.column,offset:e.offset}}function _c(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?_c(e,r):vc(e,r)}}function vc(e,t){let n;for(n in t)if(pc.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function yc(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Gi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Gi({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Gi({start:t.start,end:t.end})+`) is still open`)}function bc(e){let t=this;t.parser=n;function n(n){return mc(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function xc(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Sc(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
5
|
+
`}]}function Cc(e,t){let n=t.value?t.value+`
|
|
6
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function wc(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tc(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ec(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Ja(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Dc(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Oc(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function kc(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Ac(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kc(e,t);let i={src:Ja(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function jc(e,t){let n={src:Ja(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Mc(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Nc(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kc(e,t);let i={href:Ja(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Pc(e,t){let n={href:Ja(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Fc(e,t,n){let r=e.all(t),i=n?Ic(n):Lc(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
7
7
|
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
8
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function
|
|
8
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Ic(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Lc(n[r])}return t}function Lc(e){return e.spread??e.children.length>1}function Rc(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function zc(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bc(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Vc(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hc(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Hi(t.children[1]),o=Vi(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Uc(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Wc(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Gc=9,Kc=32;function qc(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Jc(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Jc(t.slice(i),i>0,!1)),a.join(``)}function Jc(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Gc||t===Kc;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Gc||t===Kc;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Yc(e,t){let n={type:`text`,value:qc(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Xc(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Zc={blockquote:xc,break:Sc,code:Cc,delete:wc,emphasis:Tc,footnoteReference:Ec,heading:Dc,html:Oc,imageReference:Ac,image:jc,inlineCode:Mc,linkReference:Nc,link:Pc,listItem:Fc,list:Rc,paragraph:zc,root:Bc,strong:Vc,table:Hc,tableCell:Wc,tableRow:Uc,text:Yc,thematicBreak:Xc,toml:Qc,yaml:Qc,definition:Qc,footnoteDefinition:Qc};function Qc(){}var $c=typeof self==`object`?self:globalThis,el=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new $c[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new $c[a](o),i)};return r},tl=e=>el(new Map,e)(0),nl=``,{toString:rl}={},{keys:il}=Object,al=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=rl.call(e).slice(8,-1);switch(n){case`Array`:return[1,nl];case`Object`:return[2,nl];case`Date`:return[3,nl];case`RegExp`:return[4,nl];case`Map`:return[5,nl];case`Set`:return[6,nl];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},ol=([e,t])=>e===0&&(t===`function`||t===`symbol`),sl=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=al(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of il(r))(e||!ol(al(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(ol(al(n))||ol(al(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!ol(al(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},cl=(e,{json:t,lossy:n}={})=>{let r=[];return sl(!(t||n),!!t,new Map,r)(e),r},ll=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?tl(cl(e,t)):structuredClone(e):(e,t)=>tl(cl(e,t));function ul(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function dl(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function fl(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||ul,r=e.options.footnoteBackLabel||dl,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Ja(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...ll(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
9
9
|
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
10
|
-
`}]}}var
|
|
10
|
+
`}]}}var pl=(function(e){if(e==null)return vl;if(typeof e==`function`)return _l(e);if(typeof e==`object`)return Array.isArray(e)?ml(e):hl(e);if(typeof e==`string`)return gl(e);throw Error(`Expected function, string, or object as test`)});function ml(e){let t=[],n=-1;for(;++n<e.length;)t[n]=pl(e[n]);return _l(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function hl(e){let t=e;return _l(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function gl(e){return _l(t);function t(t){return t&&t.type===e}}function _l(e){return t;function t(t,n,r){return!!(yl(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function vl(){return!0}function yl(e){return typeof e==`object`&&!!e&&`type`in e}function bl(e){return e}var xl=[];function Sl(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=pl(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+bl(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=xl,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Cl(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Cl(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?xl:[e]}function wl(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Sl(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Tl={}.hasOwnProperty,El={};function Dl(e,t){let n=t||El,r=new Map,i=new Map,a={all:s,applyData:kl,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Zc,...n.handlers},one:o,options:n,patch:Ol,wrap:jl};return wl(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Tl.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=ll(n);return r.children=a.all(e),r}return ll(e)}return(a.options.unknownHandler||Al)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Ml(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Ml(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Ol(e,t){e.position&&(t.position=Wi(e))}function kl(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,ll(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Al(e,t){let n=t.data||{},r=`value`in t&&!(Tl.call(n,`hProperties`)||Tl.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function jl(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
11
11
|
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
12
12
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
13
|
-
`}),n}function
|
|
14
|
-
`},i)),a}function Ml(e,t){return e&&`run`in e?async function(n,r){let i=jl(n,{file:r,...t});await e.run(i,r)}:function(n,r){return jl(n,{file:r,...e||t})}}function Nl(e){if(e)throw e}var Pl=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Fl(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Il(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ll(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ll(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Rl={basename:zl,dirname:Bl,extname:Vl,join:Hl,sep:`/`};function zl(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Gl(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Bl(e){if(Gl(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Vl(e){Gl(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Hl(...e){let t=-1,n;for(;++t<e.length;)Gl(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Ul(n)}function Ul(e){Gl(e);let t=e.codePointAt(0)===47,n=Wl(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Wl(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Gl(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Kl={cwd:ql};function ql(){return`/`}function Jl(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Yl(e){if(typeof e==`string`)e=new URL(e);else if(!Jl(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Xl(e)}function Xl(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Zl=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Ql=class{constructor(e){let t;t=e?Jl(e)?{path:e}:typeof e==`string`||nu(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Kl.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Zl.length;){let e=Zl[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Zl.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Rl.basename(this.path):void 0}set basename(e){eu(e,`basename`),$l(e,`basename`),this.path=Rl.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Rl.dirname(this.path):void 0}set dirname(e){tu(this.basename,`dirname`),this.path=Rl.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Rl.extname(this.path):void 0}set extname(e){if($l(e,`extname`),tu(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Rl.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Jl(e)&&(e=Yl(e)),eu(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Rl.basename(this.path,this.extname):void 0}set stem(e){eu(e,`stem`),$l(e,`stem`),this.path=Rl.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new G(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function $l(e,t){if(e&&e.includes(Rl.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Rl.sep+"`")}function eu(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function tu(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function nu(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ru=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),iu=t(Pl(),1),au={}.hasOwnProperty,ou=new class e extends ru{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Il()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,iu.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(lu(`data`,this.frozen),this.namespace[e]=t,this):au.call(this.namespace,e)&&this.namespace[e]||void 0:e?(lu(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=fu(e),n=this.parser||this.Parser;return su(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),su(`process`,this.parser||this.Parser),cu(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=fu(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);mu(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),su(`processSync`,this.parser||this.Parser),cu(`processSync`,this.compiler||this.Compiler),this.process(e,r),du(`processSync`,`process`,t),n;function r(e,r){t=!0,Nl(e),n=r}}run(e,t,n){uu(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=fu(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),du(`runSync`,`run`,n),r;function i(e,t){Nl(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=fu(t),r=this.compiler||this.Compiler;return cu(`stringify`,r),uu(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(lu(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,iu.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Fl(o)&&Fl(r)&&(r=(0,iu.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function su(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function cu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function lu(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function uu(e){if(!Fl(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function du(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function fu(e){return pu(e)?e:new Ql(e)}function pu(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function mu(e){return typeof e==`string`||hu(e)}function hu(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var gu=[],_u={allowDangerousHtml:!0},vu=/^(https?|ircs?|mailto|xmpp)$/i,yu=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function bu(e){let t=xu(e),n=Su(e);return Cu(t.runSync(t.parse(n),n),e)}function xu(e){let t=e.rehypePlugins||gu,n=e.remarkPlugins||gu,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._u}:_u;return ou().use(vc).use(n).use(Ml,r).use(t)}function Su(e){let t=e.children||``,n=new Ql;return typeof t==`string`?n.value=t:``+t,n}function Cu(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||wu;for(let e of yu)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Sl(e,l),ea(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Sa)if(Object.hasOwn(Sa,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Sa[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function wu(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||vu.test(e.slice(0,t))?e:``}function Tu(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Eu(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Du(e,t,n){let r=dl((n||{}).ignore||[]),i=Ou(t),a=-1;for(;++a<i.length;)bl(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Ou(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([ku(e[0]),Au(e[1])])}return t}function ku(e){return typeof e==`string`?new RegExp(Eu(e),`g`):e}function Au(e){return typeof e==`function`?e:function(){return e}}var ju=`phrasing`,Mu=[`autolink`,`link`,`image`,`label`];function Nu(){return{transforms:[Vu],enter:{literalAutolink:Fu,literalAutolinkEmail:Iu,literalAutolinkHttp:Iu,literalAutolinkWww:Iu},exit:{literalAutolink:Bu,literalAutolinkEmail:zu,literalAutolinkHttp:Lu,literalAutolinkWww:Ru}}}function Pu(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:ju,notInConstruct:Mu},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:ju,notInConstruct:Mu},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:ju,notInConstruct:Mu}]}}function Fu(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Iu(e){this.config.enter.autolinkProtocol.call(this,e)}function Lu(e){this.config.exit.autolinkProtocol.call(this,e)}function Ru(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function zu(e){this.config.exit.autolinkEmail.call(this,e)}function Bu(e){this.exit(e)}function Vu(e){Du(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Hu],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Uu]],{ignore:[`link`,`linkReference`]})}function Hu(e,t,n,r,i){let a=``;if(!Ku(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Wu(n)))return!1;let o=Gu(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Uu(e,t,n,r){return!Ku(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Wu(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Gu(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Tu(e,`(`),a=Tu(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Ku(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Wa(n)||Ua(n))&&(!t||n!==47)}nd.peek=td;function qu(){this.buffer()}function Ju(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Yu(){this.buffer()}function Xu(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Zu(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=La(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Qu(e){this.exit(e)}function $u(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=La(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ed(e){this.exit(e)}function td(){return`[`}function nd(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function rd(){return{enter:{gfmFootnoteCallString:qu,gfmFootnoteCall:Ju,gfmFootnoteDefinitionLabelString:Yu,gfmFootnoteDefinition:Xu},exit:{gfmFootnoteCallString:Zu,gfmFootnoteCall:Qu,gfmFootnoteDefinitionLabelString:$u,gfmFootnoteDefinition:ed}}}function id(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:nd},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
15
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?
|
|
16
|
-
`)}function
|
|
17
|
-
`&&
|
|
18
|
-
`}function
|
|
13
|
+
`}),n}function Ml(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Nl(e,t){let n=Dl(e,t),r=n.one(e,void 0),i=fl(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
14
|
+
`},i)),a}function Pl(e,t){return e&&`run`in e?async function(n,r){let i=Nl(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Nl(n,{file:r,...e||t})}}function Fl(e){if(e)throw e}var Il=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Ll(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Rl(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?zl(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function zl(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Bl={basename:Vl,dirname:Hl,extname:Ul,join:Wl,sep:`/`};function Vl(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);ql(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Hl(e){if(ql(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Ul(e){ql(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Wl(...e){let t=-1,n;for(;++t<e.length;)ql(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Gl(n)}function Gl(e){ql(e);let t=e.codePointAt(0)===47,n=Kl(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Kl(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function ql(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Jl={cwd:Yl};function Yl(){return`/`}function Xl(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Zl(e){if(typeof e==`string`)e=new URL(e);else if(!Xl(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Ql(e)}function Ql(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var $l=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],eu=class{constructor(e){let t;t=e?Xl(e)?{path:e}:typeof e==`string`||iu(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Jl.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<$l.length;){let e=$l[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)$l.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Bl.basename(this.path):void 0}set basename(e){nu(e,`basename`),tu(e,`basename`),this.path=Bl.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Bl.dirname(this.path):void 0}set dirname(e){ru(this.basename,`dirname`),this.path=Bl.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Bl.extname(this.path):void 0}set extname(e){if(tu(e,`extname`),ru(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Bl.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Xl(e)&&(e=Zl(e)),nu(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Bl.basename(this.path,this.extname):void 0}set stem(e){nu(e,`stem`),tu(e,`stem`),this.path=Bl.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new G(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function tu(e,t){if(e&&e.includes(Bl.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Bl.sep+"`")}function nu(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function ru(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function iu(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var au=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),ou=t(Il(),1),su={}.hasOwnProperty,cu=new class e extends au{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Rl()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ou.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(du(`data`,this.frozen),this.namespace[e]=t,this):su.call(this.namespace,e)&&this.namespace[e]||void 0:e?(du(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=mu(e),n=this.parser||this.Parser;return lu(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),lu(`process`,this.parser||this.Parser),uu(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=mu(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);gu(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),lu(`processSync`,this.parser||this.Parser),uu(`processSync`,this.compiler||this.Compiler),this.process(e,r),pu(`processSync`,`process`,t),n;function r(e,r){t=!0,Fl(e),n=r}}run(e,t,n){fu(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=mu(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),pu(`runSync`,`run`,n),r;function i(e,t){Fl(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=mu(t),r=this.compiler||this.Compiler;return uu(`stringify`,r),fu(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(du(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,ou.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Ll(o)&&Ll(r)&&(r=(0,ou.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function lu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function uu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function du(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fu(e){if(!Ll(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function pu(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function mu(e){return hu(e)?e:new eu(e)}function hu(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function gu(e){return typeof e==`string`||_u(e)}function _u(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var vu=[],yu={allowDangerousHtml:!0},bu=/^(https?|ircs?|mailto|xmpp)$/i,xu=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Su(e){let t=Cu(e),n=wu(e);return Tu(t.runSync(t.parse(n),n),e)}function Cu(e){let t=e.rehypePlugins||vu,n=e.remarkPlugins||vu,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yu}:yu;return cu().use(bc).use(n).use(Pl,r).use(t)}function wu(e){let t=e.children||``,n=new eu;return typeof t==`string`?n.value=t:``+t,n}function Tu(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Eu;for(let e of xu)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return wl(e,l),na(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in wa)if(Object.hasOwn(wa,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=wa[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Eu(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||bu.test(e.slice(0,t))?e:``}function Du(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Ou(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function ku(e,t,n){let r=pl((n||{}).ignore||[]),i=Au(t),a=-1;for(;++a<i.length;)Sl(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Au(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([ju(e[0]),Mu(e[1])])}return t}function ju(e){return typeof e==`string`?new RegExp(Ou(e),`g`):e}function Mu(e){return typeof e==`function`?e:function(){return e}}var Nu=`phrasing`,Pu=[`autolink`,`link`,`image`,`label`];function Fu(){return{transforms:[Uu],enter:{literalAutolink:Lu,literalAutolinkEmail:Ru,literalAutolinkHttp:Ru,literalAutolinkWww:Ru},exit:{literalAutolink:Hu,literalAutolinkEmail:Vu,literalAutolinkHttp:zu,literalAutolinkWww:Bu}}}function Iu(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Nu,notInConstruct:Pu},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Nu,notInConstruct:Pu},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Nu,notInConstruct:Pu}]}}function Lu(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Ru(e){this.config.enter.autolinkProtocol.call(this,e)}function zu(e){this.config.exit.autolinkProtocol.call(this,e)}function Bu(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Vu(e){this.config.exit.autolinkEmail.call(this,e)}function Hu(e){this.exit(e)}function Uu(e){ku(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Wu],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Gu]],{ignore:[`link`,`linkReference`]})}function Wu(e,t,n,r,i){let a=``;if(!Ju(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Ku(n)))return!1;let o=qu(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Gu(e,t,n,r){return!Ju(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Ku(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function qu(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Du(e,`(`),a=Du(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Ju(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Ka(n)||Ga(n))&&(!t||n!==47)}id.peek=rd;function Yu(){this.buffer()}function Xu(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Zu(){this.buffer()}function Qu(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function $u(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=za(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ed(e){this.exit(e)}function td(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=za(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nd(e){this.exit(e)}function rd(){return`[`}function id(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function ad(){return{enter:{gfmFootnoteCallString:Yu,gfmFootnoteCall:Xu,gfmFootnoteDefinitionLabelString:Zu,gfmFootnoteDefinition:Qu},exit:{gfmFootnoteCallString:$u,gfmFootnoteCall:ed,gfmFootnoteDefinitionLabelString:td,gfmFootnoteDefinition:nd}}}function od(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:id},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
15
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?cd:sd))),s(),o}}function sd(e,t,n){return t===0?e:cd(e,t,n)}function cd(e,t,n){return(n?``:` `)+e}var ld=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];md.peek=hd;function ud(){return{canContainEols:[`delete`],enter:{strikethrough:fd},exit:{strikethrough:pd}}}function dd(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:ld}],handlers:{delete:md}}}function fd(e){this.enter({type:`delete`,children:[]},e)}function pd(e){this.exit(e)}function md(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function hd(){return`~`}function gd(e){return e.length}function _d(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||gd,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=vd(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=yd(r[d]);else{let e=yd(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
16
|
+
`)}function vd(e){return e==null?``:String(e)}function yd(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function bd(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),xd);return i(),o}function xd(e,t,n){return`>`+(n?``:` `)+e}function Sd(e,t){return Cd(e,t.inConstruct,!0)&&!Cd(e,t.notInConstruct,!1)}function Cd(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function wd(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
17
|
+
`&&Sd(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
18
|
+
`}function Td(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ed(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Dd(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Od(e,t,n,r){let i=Dd(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Ed(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,kd);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Td(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
19
19
|
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
20
20
|
`),a&&(u+=s.move(a+`
|
|
21
|
-
`)),u+=s.move(c),l(),u}function
|
|
22
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function
|
|
21
|
+
`)),u+=s.move(c),l(),u}function kd(e,t,n){return(n?``:` `)+e}function Ad(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function jd(e,t,n,r){let i=Ad(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
22
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Md(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Nd(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Pd(e,t,n){let r=to(e),i=to(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Fd.peek=Id;function Fd(e,t,n,r){let i=Md(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Pd(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Nd(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Pd(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Nd(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Id(e,t,n){return n.options.emphasis||`*`}function Ld(e,t){let n=!1;return wl(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ea(e)&&(t.options.setext||n))}function Rd(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Ld(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
23
23
|
`,after:`
|
|
24
24
|
`});return r(),t(),o+`
|
|
25
25
|
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
26
26
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
27
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=
|
|
27
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Nd(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}zd.peek=Bd;function zd(e){return e.value||``}function Bd(){return`<`}Vd.peek=Hd;function Vd(e,t,n,r){let i=Ad(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Hd(){return`!`}Ud.peek=Wd;function Ud(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Wd(){return`!`}Gd.peek=Kd;function Gd(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Kd(){return"`"}function qd(e,t){let n=Ea(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Jd.peek=Yd;function Jd(e,t,n,r){let i=Ad(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(qd(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Yd(e,t,n){return qd(e,n)?`<`:`[`}Xd.peek=Zd;function Xd(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Zd(){return`[`}function Qd(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function $d(e){let t=Qd(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ef(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function tf(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function nf(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?ef(n):Qd(n),s=e.ordered?o===`.`?`)`:`.`:$d(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),tf(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function rf(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function af(e,t,n,r){let i=rf(n),a=n.bulletCurrent||Qd(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function of(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var sf=pl([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function cf(e,t,n,r){return(e.children.some(function(e){return sf(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function lf(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}uf.peek=df;function uf(e,t,n,r){let i=lf(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Pd(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Nd(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Pd(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Nd(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function df(e,t,n){return n.options.strong||`*`}function ff(e,t,n,r){return n.safe(e.value,r)}function pf(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function mf(e,t,n){let r=(tf(n)+(n.options.ruleSpaces?` `:``)).repeat(pf(n));return n.options.ruleSpaces?r.slice(0,-1):r}var hf={blockquote:bd,break:wd,code:Od,definition:jd,emphasis:Fd,hardBreak:wd,heading:Rd,html:zd,image:Vd,imageReference:Ud,inlineCode:Gd,link:Jd,linkReference:Xd,list:nf,listItem:af,paragraph:of,root:cf,strong:uf,text:ff,thematicBreak:mf};function gf(){return{enter:{table:_f,tableData:xf,tableHeader:xf,tableRow:yf},exit:{codeText:Sf,table:vf,tableData:bf,tableHeader:bf,tableRow:bf}}}function _f(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function vf(e){this.exit(e),this.data.inTable=void 0}function yf(e){this.enter({type:`tableRow`,children:[]},e)}function bf(e){this.exit(e)}function xf(e){this.enter({type:`tableCell`,children:[]},e)}function Sf(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Cf));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Cf(e,t){return t===`|`?t:e}function wf(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
28
28
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
29
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return hd(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=pf.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Cf(){return{exit:{taskListCheckValueChecked:Tf,taskListCheckValueUnchecked:Tf,paragraph:Ef}}}function wf(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Df}}}function Tf(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Ef(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Df(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=pf.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Of(){return[Nu(),rd(),cd(),mf(),Cf()]}function kf(e){return{extensions:[Pu(),id(e),ld(),Sf(e),wf()]}}var Af={tokenize:Wf,partial:!0},jf={tokenize:Gf,partial:!0},Mf={tokenize:Kf,partial:!0},Nf={tokenize:qf,partial:!0},Pf={tokenize:Jf,partial:!0},Ff={name:`wwwAutolink`,tokenize:Hf,previous:Yf},If={name:`protocolAutolink`,tokenize:Uf,previous:Xf},Lf={name:`emailAutolink`,tokenize:Vf,previous:Zf},Rf={};function zf(){return{text:Rf}}for(var Bf=48;Bf<123;)Rf[Bf]=Lf,Bf++,Bf===58?Bf=65:Bf===91&&(Bf=97);Rf[43]=Lf,Rf[45]=Lf,Rf[46]=Lf,Rf[95]=Lf,Rf[72]=[Lf,If],Rf[104]=[Lf,If],Rf[87]=[Lf,Ff],Rf[119]=[Lf,Ff];function Vf(e,t,n){let r=this,i,a;return o;function o(t){return!Qf(t)||!Zf.call(r,r.previous)||$f(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Qf(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Pf,u,l)(t):t===45||t===95||q(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&K(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Hf(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Yf.call(r,r.previous)||$f(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Af,e.attempt(jf,e.attempt(Mf,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Uf(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Xf.call(r,r.previous)&&!$f(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(K(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||za(t)||Y(t)||Wa(t)||Ua(t)?n(t):e.attempt(jf,e.attempt(Mf,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Wf(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Gf(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Nf,c,s)(t):t===null||Y(t)||Wa(t)||t!==45&&Ua(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Kf(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Nf,t,a)(o):o===null||Y(o)||Wa(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function qf(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Y(o)||Wa(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Y(e)||Wa(e)?t(e):r(e)}function a(e){return K(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):K(t)?(e.consume(t),o):n(t)}}function Jf(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return q(e)?n(e):t(e)}}function Yf(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Y(e)}function Xf(e){return!K(e)}function Zf(e){return!(e===47||Qf(e))}function Qf(e){return e===43||e===45||e===46||e===95||q(e)}function $f(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var ep={tokenize:cp,partial:!0};function tp(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:ap,continuation:{tokenize:op},exit:sp}},text:{91:{name:`gfmFootnoteCall`,tokenize:ip},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:np,resolveTo:rp}}}}function np(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=La(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function rp(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function ip(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Y(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(La(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Y(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function ap(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Y(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=La(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Y(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Z(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function op(e,t,n){return e.check(so,t,e.attempt(ep,t,n))}function sp(e){e.exit(`gfmFootnoteDefinition`)}function cp(e,t,n){let r=this;return Z(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function lp(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Aa(o,o.length,0,eo(s,e.slice(r+1,n),t)),Aa(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Aa(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=$a(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=$a(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var up=class{constructor(){this.map=[]}add(e,t,n){dp(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function dp(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function fp(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function pp(){return{flow:{null:{name:`table`,tokenize:mp,resolveAll:hp}}}}function mp(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):J(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):X(t)?Z(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Y(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,X(t)?Z(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return X(t)?Z(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||J(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return X(t)?Z(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||J(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||J(n)?(e.exit(`tableRow`),t(n)):X(n)?Z(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Y(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function hp(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new up;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(_p(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=gp(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=gp(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=gp(f,t,o,i,n,d)):(o[0]=o[1],d=gp(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&_p(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=fp(t.events,n))}return e}function gp(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},vp(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=vp(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=vp(t.events,n[2]),a=vp(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},vp(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function _p(e,t,n,r,i){let a=[],o=vp(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function vp(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var yp={name:`tasklistCheck`,tokenize:xp};function bp(){return{text:{91:yp}}}function xp(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Y(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return J(r)?t(r):X(r)?e.check({tokenize:Sp},t,n)(r):n(r)}}function Sp(e,t,n){return Z(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Cp(e){return Na([zf(),tp(),lp(e),pp(),bp()])}var wp={};function Tp(e){let t=this,n=e||wp,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Cp(n)),a.push(Of()),o.push(kf(n))}function Ep({href:e,children:t,...n}){let r=typeof e==`string`&&(e.startsWith(`http://`)||e.startsWith(`https://`));return(0,u.jsx)(`a`,{href:e,...n,...r?{target:`_blank`,rel:`noopener noreferrer`}:{},children:t})}var Dp={a:Ep};function Op({markdown:e,className:t,regionLabel:n=`Asset description`}){let r=(0,c.useRef)(null),[i,a]=(0,c.useState)(!1),[o,s]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let e=r.current;if(e){if(i){s(!1);return}s(e.scrollHeight>e.clientHeight+1)}};t();let n=globalThis.ResizeObserver;if(n===void 0)return;let a=new n(t);return a.observe(e),()=>{a.disconnect()}},[e,i]),(0,u.jsxs)(`div`,{className:[`resource-description-md`,t].filter(Boolean).join(` `),role:`region`,"aria-label":n,children:[(0,u.jsx)(`div`,{ref:r,className:i?`resource-description-md__viewport resource-description-md__viewport--expanded`:`resource-description-md__viewport resource-description-md__viewport--collapsed`,children:(0,u.jsx)(`div`,{className:`resource-description-md__prose`,children:(0,u.jsx)(bu,{remarkPlugins:[Tp],components:Dp,children:e})})}),(0,u.jsxs)(`div`,{className:`resource-description-md__toolbar`,children:[!i&&o?(0,u.jsx)(`button`,{type:`button`,className:`resource-description-md__toggle workspace-pill`,onClick:()=>a(!0),children:`Expand description`}):null,i?(0,u.jsx)(`button`,{type:`button`,className:`resource-description-md__toggle workspace-pill`,onClick:()=>a(!1),children:`Collapse description`}):null]})]})}function kp({resource:e,dependencySummary:t}){return(0,u.jsxs)(Lt,{title:`Asset summary`,subtitle:`Core execution and discovery context for the selected asset.`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Status`}),(0,u.jsx)(`strong`,{children:e.status??`Not executed`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Execution time`}),(0,u.jsx)(`strong`,{children:Ye(e.executionTime)})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Thread`}),(0,u.jsx)(`strong`,{children:e.threadId??`n/a`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Path`}),(0,u.jsx)(`strong`,{children:et(e)??`n/a`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Direct upstream`}),(0,u.jsx)(`strong`,{children:t?.upstreamCount??0})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Direct downstream`}),(0,u.jsx)(`strong`,{children:t?.downstreamCount??0})]})]}),e.description?(0,u.jsx)(Op,{markdown:e.description,className:`resource-spotlight__description`}):(0,u.jsx)(`p`,{className:`resource-spotlight__description resource-spotlight__description--muted`,children:`No description was captured for this asset. Catalog-oriented metadata can surface here when present in the manifest.`})]})}var Ap=new Set(`SELECT FROM WHERE WITH AS JOIN ON GROUP BY ORDER LIMIT HAVING UNION CASE WHEN THEN ELSE END LEFT RIGHT INNER OUTER CROSS DISTINCT NULL AND OR NOT IN IS BETWEEN LIKE EXISTS INSERT INTO UPDATE SET DELETE CREATE TABLE VIEW REPLACE IF ASC DESC USING AT ZONE INTERVAL QUALIFY WINDOW ROWS RANGE UNBOUNDED PRECEDING FOLLOWING CURRENT ROW PARTITION OVER`.split(` `)),jp=new Set(`SUM COUNT AVG MAX MIN COALESCE CAST IFF IF ROW_NUMBER RANK DENSE_RANK NTILE LEAD LAG FIRST_VALUE LAST_VALUE NVL NVL2 NULLIF GREATEST LEAST TRIM LTRIM RTRIM UPPER LOWER LENGTH SUBSTR SUBSTRING REPLACE SPLIT CONCAT DATE YEAR MONTH DAY HOUR MINUTE SECOND DATEDIFF DATEADD CURRENT_DATE CURRENT_TIMESTAMP TO_DATE TO_TIMESTAMP TO_NUMBER TO_VARCHAR TRY_CAST CONVERT FLOOR CEIL ROUND ABS MOD SQRT LOG EXP ARRAY_AGG LISTAGG STRING_AGG GROUP_CONCAT FLATTEN UNNEST GENERATE_SERIES`.split(` `));function Mp(e){let t=[],n=0,r=e.length;for(;n<r;){if(e.startsWith(`/*`,n)){let r=e.indexOf(`*/`,n+2),i=r===-1?e.slice(n):e.slice(n,r+2);t.push({type:`comment`,value:i}),n+=i.length;continue}if(e.startsWith(`--`,n)){let r=e.indexOf(`
|
|
30
|
-
`,n),i=r===-1?e.slice(n):e.slice(n,r+1);t.push({type:`comment`,value:i}),n+=i.length;continue}if(e[n]===`'`){let i=n+1;for(;i<r;){if(e[i]===`'`&&e[i-1]!==`\\`){i++;break}i++}t.push({type:`string`,value:e.slice(n,i)}),n=i;continue}let i=/^[0-9]+(\.[0-9]+)?/.exec(e.slice(n));if(i&&(n===0||!/[a-zA-Z_]/.test(e[n-1]))){t.push({type:`number`,value:i[0]}),n+=i[0].length;continue}let a=/^[a-zA-Z_][a-zA-Z0-9_]*/.exec(e.slice(n));if(a){let e=a[0],r=e.toUpperCase(),i=Ap.has(r)?`keyword`:jp.has(r)?`function`:`identifier`;t.push({type:i,value:e}),n+=e.length;continue}if(/[=<>!|+\-*/%^&~]/.test(e[n])){t.push({type:`operator`,value:e[n]}),n++;continue}if(/[(),;.[\]{}]/.test(e[n])){t.push({type:`punctuation`,value:e[n]}),n++;continue}t.push({type:`plain`,value:e[n]}),n++}return t}function Np({sql:e}){return(0,u.jsx)(`pre`,{className:`sql-panel`,children:(0,u.jsx)(`code`,{children:Mp(e).map((e,t)=>e.type===`plain`||e.type===`identifier`?e.value:(0,u.jsx)(`span`,{className:`sql-token-${e.type}`,children:e.value},t))})})}function Pp({size:e=24,label:t}){return(0,u.jsxs)(`svg`,{className:`spinner`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":t?void 0:`true`,"aria-label":t,role:t?`img`:void 0,children:[(0,u.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`var(--panel-border)`,strokeWidth:`2.5`}),(0,u.jsx)(`path`,{d:`M12 2 A10 10 0 0 1 22 12`,stroke:`var(--accent)`,strokeWidth:`2.5`,strokeLinecap:`round`})]})}function Fp({label:e,values:t}){return t.length===0?null:(0,u.jsxs)(`div`,{className:`definition-list`,children:[(0,u.jsx)(`span`,{children:e}),(0,u.jsx)(`div`,{className:`definition-list__values`,children:t.map(e=>(0,u.jsx)(`span`,{className:`definition-pill`,children:e},e))})]})}function Ip(e){return(0,u.jsxs)(`div`,{className:`definition-panel`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Label`}),(0,u.jsx)(`strong`,{children:e.label??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Metric type`}),(0,u.jsx)(`strong`,{children:e.metricType??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Source`}),(0,u.jsx)(`strong`,{children:e.sourceReference??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Time granularity`}),(0,u.jsx)(`strong`,{children:e.timeGranularity??`Not captured`})]})]}),e.expression&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Expression`}),(0,u.jsx)(`pre`,{children:e.expression})]}),e.description&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Description`}),(0,u.jsx)(`p`,{children:e.description})]}),(0,u.jsx)(Fp,{label:`Measures`,values:e.measures}),(0,u.jsx)(Fp,{label:`Referenced metrics`,values:e.metrics}),(0,u.jsx)(Fp,{label:`Filters`,values:e.filters})]})}function Lp(e){return(0,u.jsxs)(`div`,{className:`definition-panel`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Label`}),(0,u.jsx)(`strong`,{children:e.label??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Source model`}),(0,u.jsx)(`strong`,{children:e.sourceReference??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Default time dimension`}),(0,u.jsx)(`strong`,{children:e.defaultTimeDimension??`Not captured`})]})]}),(0,u.jsx)(Fp,{label:`Entities`,values:e.entities}),(0,u.jsx)(Fp,{label:`Measures`,values:e.measures}),(0,u.jsx)(Fp,{label:`Dimensions`,values:e.dimensions}),e.description&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Description`}),(0,u.jsx)(`p`,{children:e.description})]})]})}function Rp({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i}){return e&&t?t.kind===`metric`?Ip(t):Lp(t):r?(0,u.jsxs)(`div`,{className:`asset-sql-loading`,"aria-busy":`true`,children:[(0,u.jsx)(Pp,{size:28,label:`Loading SQL`}),(0,u.jsx)(`span`,{className:`asset-sql-loading__label`,children:`Loading SQL…`})]}):i?(0,u.jsx)(_t,{icon:`⚠`,headline:`Could not load SQL`,subtext:i}):n?(0,u.jsx)(Np,{sql:n}):(0,u.jsx)(_t,{icon:`⌘`,headline:e?`No definition available`:`No SQL available`,subtext:e?`This resource does not expose enough definition metadata in the current artifacts.`:`This resource does not expose compiled or raw SQL in the current artifacts.`})}function zp({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i,hasCompiledSql:a}){return(0,u.jsx)(Lt,{title:e?`Definition`:`SQL`,subtitle:e?t?.kind===`metric`?`Structured metric definition captured from the manifest.`:`Structured semantic model definition captured from the manifest.`:a?`Compiled SQL for the selected resource.`:`Raw SQL captured from the manifest.`,children:Rp({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i})})}function Bp(e){return e===`runtime`?`summary`:e}function Vp({resource:e,analysis:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:s}){let l=(0,c.useMemo)(()=>new Map(t.resources.map(e=>[e.uniqueId,e])),[t.resources]),d=a.upstreamDepth,f=a.downstreamDepth,p=a.allDepsMode,m=a.lensMode,h=a.activeLegendKeys,g=e=>o(t=>({...t,upstreamDepth:typeof e==`function`?e(t.upstreamDepth):e})),_=e=>o(t=>({...t,downstreamDepth:typeof e==`function`?e(t.downstreamDepth):e})),v=e=>o(t=>({...t,allDepsMode:typeof e==`function`?e(t.allDepsMode):e})),y=e=>o(t=>({...t,lensMode:e,activeLegendKeys:new Set})),b=e=>o(t=>({...t,activeLegendKeys:typeof e==`function`?e(t.activeLegendKeys):e})),x=Bp(r.activeTab),[S,C]=(0,c.useState)(!1),w=(0,c.useRef)({summary:null,lineage:null,sql:null,tests:null});(0,c.useEffect)(()=>{if(!e)return;let t=w.current[x];if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView({block:`start`,behavior:n?`auto`:`smooth`})},[x,e]);let{compiledCode:T,rawCode:E,loading:D,error:O}=Yr(e?.uniqueId??null,t);if(!e)return(0,u.jsx)(`div`,{className:`workspace-card`,children:(0,u.jsx)(_t,{icon:`🔍`,headline:`No resource selected`,subtext:`Adjust the explorer filters or search to find the resource you're looking for.`})});let k=t.dependencyIndex[e.uniqueId],A=T??E??void 0,ee=T!=null&&T!==``,j=e.definition??null,M=j?.kind===`metric`||j?.kind===`semantic_model`,te=(0,u.jsxs)(`div`,{className:`resource-detail__subtitle`,children:[(0,u.jsx)(Rt,{resourceType:e.resourceType}),(0,u.jsx)(`span`,{className:`resource-detail__package`,children:e.packageName||`workspace`})]}),N={resource:e,dependencySummary:k,dependencyIndex:t.dependencyIndex,resourceById:l,upstreamDepth:d,downstreamDepth:f,allDepsMode:p,lensMode:m,activeLegendKeys:h,setUpstreamDepth:g,setDownstreamDepth:_,setAllDepsMode:v,setLensMode:y,setActiveLegendKeys:b,onSelectResource:e=>{n(e),o(t=>({...t,selectedResourceId:e})),i(t=>({...t,selectedResourceId:e,activeTab:`lineage`}))}};return(0,u.jsxs)(`div`,{className:`workspace-view asset-workspace`,children:[(0,u.jsxs)(`section`,{className:`catalog-detail-hero`,children:[(0,u.jsxs)(`div`,{className:`catalog-detail-hero__content`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Selected asset`}),(0,u.jsx)(`h3`,{children:e.name}),te]}),(0,u.jsx)(`div`,{className:`asset-hero__actions`,"aria-label":`Asset actions`,children:(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>s(`timeline`,{resourceId:e.uniqueId,executionId:e.uniqueId}),children:`Open in Timeline`})})]}),(0,u.jsx)(`div`,{className:`asset-workspace__body`,children:(0,u.jsxs)(`div`,{className:`asset-workspace__sections`,children:[(0,u.jsx)(`section`,{id:`asset-section-summary`,ref:e=>{w.current.summary=e},className:`asset-workspace__section`,children:(0,u.jsx)(kp,{resource:e,dependencySummary:k})}),(0,u.jsx)(`section`,{id:`asset-section-lineage`,ref:e=>{w.current.lineage=e},className:`asset-workspace__section`,children:(0,u.jsx)(jr,{...N,displayMode:`summary`,openFullscreen:S,onFullscreenChange:C})}),(0,u.jsx)(`section`,{id:`asset-section-tests`,ref:e=>{w.current.tests=e},className:`asset-workspace__section`,children:(0,u.jsx)(Jr,{resource:e,analysis:t,onNavigateTo:s})}),(0,u.jsx)(`section`,{id:`asset-section-sql`,ref:e=>{w.current.sql=e},className:`asset-workspace__section`,children:(0,u.jsx)(zp,{showsDefinition:M,definition:j,sqlText:A,codeLoading:D,codeError:O,hasCompiledSql:ee})})]})})]})}var Hp=200;function Up({analysis:e,resource:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onInvestigationSelectionChange:s,onNavigateTo:l}){let[d,f]=(0,c.useState)(``),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(!1),[_,v]=(0,c.useState)(``),y=(0,c.useRef)(0);(0,c.useEffect)(()=>{let e=d.trim(),t=e?Hp:0,n=window.setTimeout(()=>{if(!e){y.current+=1,m([]),g(!1);return}y.current+=1;let t=y.current;g(!0),T(e).then(e=>{y.current===t&&m(e)}).catch(()=>{y.current===t&&m([])}).finally(()=>{y.current===t&&g(!1)})},t);return()=>window.clearTimeout(n)},[d]);let b=e=>{e&&(i(t=>({...t,selectedResourceId:e,activeTab:`lineage`})),o(t=>({...t,rootResourceId:e,selectedResourceId:e})),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`})))};return(0,u.jsx)(Vt,{title:`Inventory`,description:`Browse, filter, and inspect all workspace assets.`,className:`inventory-view`,suppressHeader:t!=null,children:t?(0,u.jsx)(Vp,{analysis:e,resource:t,onSelectResource:e=>{n(e),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))},assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:l}):(0,u.jsx)(`div`,{className:`inventory-empty-state`,children:(0,u.jsxs)(`div`,{className:`inventory-empty-state__inner`,children:[(0,u.jsx)(_t,{icon:`◱`,headline:`Select an asset to inspect`,subtext:`Use the browser panel on the left to find and select a model, source, seed, or other asset.`}),(0,u.jsxs)(`div`,{className:`inventory-empty-state__lineage-pick`,role:`group`,"aria-label":`Jump to lineage for an asset`,children:[(0,u.jsx)(`label`,{className:`inventory-empty-state__lineage-label`,htmlFor:`inventory-lineage-search`,children:`Or search for an asset to open its lineage graph`}),(0,u.jsx)(`input`,{id:`inventory-lineage-search`,type:`search`,className:`inventory-empty-state__lineage-search`,value:d,onChange:e=>{f(e.target.value),v(``)},placeholder:`Name, type, package, or unique id…`,autoComplete:`off`,enterKeyHint:`search`}),h&&(0,u.jsx)(`p`,{className:`inventory-empty-state__lineage-hint`,"aria-live":`polite`,children:`Searching…`}),p.length>0&&(0,u.jsx)(`ul`,{className:`inventory-empty-state__lineage-suggestions`,role:`listbox`,"aria-label":`Matching assets`,children:p.map(e=>(0,u.jsx)(`li`,{role:`none`,children:(0,u.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":_===e.uniqueId,className:_===e.uniqueId?`inventory-lineage-suggestion inventory-lineage-suggestion--active`:`inventory-lineage-suggestion`,onClick:()=>{y.current+=1,v(e.uniqueId),f(`${e.name} (${e.resourceType})`),m([]),g(!1)},children:[(0,u.jsx)(`span`,{className:`inventory-lineage-suggestion__name`,children:e.name}),(0,u.jsxs)(`span`,{className:`inventory-lineage-suggestion__meta`,children:[e.resourceType,e.packageName?` · ${e.packageName}`:``]})]})},e.uniqueId))}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!_,onClick:()=>b(_),children:`Open lineage graph`})]})]})})})}function Wp(e){let t=[],n=new Map;for(let r of e)if(z.has(r.resourceType)){if(r.parentId!=null){let e=n.get(r.parentId)??[];e.push(r),n.set(r.parentId,e)}}else t.push(r);return t.sort((e,t)=>{let n=e.start-t.start;return n===0?t.duration-e.duration:n}),t.map(e=>{let t=n.get(e.unique_id)??[],{lanes:r,laneCount:i}=Gp(t);return{item:e,tests:t,lanes:r,laneCount:i}})}function Gp(e){if(e.length===0)return{lanes:[],laneCount:0};let t=[...e].sort((e,t)=>e.start-t.start),n=[],r=[];for(let e of t){let t=-1;for(let r=0;r<n.length;r++)if((n[r]??0)<=e.start){t=r,n[r]=e.end;break}t===-1&&(t=n.length,n.push(e.end)),r.push({item:e,lane:t})}return{lanes:r,laneCount:n.length}}var Kp=`dbt-tools.timelineLabelWidthPx`,qp=.78,Jp={color:`var(--text-soft)`,fontSize:`0.82rem`},Yp=`dbt-tools.timelineTimezone`;function Xp(e){return e>=6e4?`${(e/6e4).toFixed(0)}m`:e>=1e4?`${(e/1e3).toFixed(0)}s`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(0)}ms`}function Zp(e,t){return new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1,timeZone:t}).format(new Date(e))}function Qp(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,t=Intl.supportedValuesOf,n=t?.(`timeZone`)??[];return Array.from(new Set([e,`UTC`,...n]))}function $p(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`;try{return window.localStorage.getItem(`dbt-tools.timelineTimezone`)||e}catch{return e}}function em(e=160){try{let t=window.localStorage.getItem(Kp);if(t==null)return e;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:e}catch{return e}}function tm(e){return[`success`,`pass`,`passed`].includes(e.trim().toLowerCase())}function nm(e){return[`skipped`,`no op`].includes(e.trim().toLowerCase())}function rm(e){let t=e.trim().toLowerCase();return!tm(t)&&!nm(t)}function im(e){if(!Number.isFinite(e)||e<6e4)return 6e4;let t=10**Math.max(0,Math.floor(Math.log10(e))),n=e/t;return Math.max(6e4,(n<=1?1:n<=2?2:n<=5?5:10)*t)}var am=[50,100,200,500,1e3,2e3,5e3,1e4,2e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5,36e5,72e5,144e5,216e5,432e5,864e5],om=8;function sm(e,t){if(t<=e)return[];let n=t-e,r=am.find(e=>n/e<=om)??im(Math.ceil(n/om)),i=[],a=Math.ceil(e/r)*r;e>0&&i.push({ms:e,label:Xp(e)});for(let n=a;n<=t;n+=r)n<=e||n>=t||i.push({ms:n,label:Xp(n)});return i.push({ms:t,label:Xp(t)}),i}function cm(e,t,n,r,i,a,o=10){if(e.length===0||r<=0)return e;let s=Math.max(1,n-t),c=e.map(e=>{let n=(e.ms-t)/s*r,o=a(i(e))/2;return{ms:e.ms,label:e.label,x:n,hw:o}}),l=[],u=null;for(let e of c){if(!u){l.push({ms:e.ms,label:e.label}),u=e;continue}e.x-e.hw>=u.x+u.hw+o&&(l.push({ms:e.ms,label:e.label}),u=e)}let d=c[c.length-1];if(d.ms===n&&l[l.length-1]?.ms!==n){for(;l.length>0;){let e=l[l.length-1],t=c.find(t=>t.ms===e.ms);if(!t||d.x-d.hw>=t.x+t.hw+o)break;l.pop()}l.length===0&&l.push({ms:c[0].ms,label:c[0].label}),l.push({ms:d.ms,label:d.label})}return l}function lm(e,t){let n=t>0?Math.max(120,Math.min(560,t-200)):560;return Math.max(120,Math.min(n,Math.round(e)))}function um(e){let[t,n]=(0,c.useState)(()=>typeof window>`u`?160:em(220));(0,c.useEffect)(()=>{e<=0||n(t=>lm(t,e))},[e]),(0,c.useEffect)(()=>{try{window.localStorage.setItem(Kp,String(t))}catch{}},[t]);let r=(0,c.useMemo)(()=>e<=0?560:Math.max(120,Math.min(560,e-200)),[e]);return{effectiveLabelW:e>0?lm(t,e):t,maxLabelW:r,onLabelColumnWidthDrag:(0,c.useCallback)(t=>{n(lm(t,e>0?e:800))},[e])}}function dm(e,t){return!e||!t||!z.has(t.resourceType)||!z.has(e.resourceType)||t.parentId==null||e.parentId==null?!1:t.parentId===e.parentId}var fm={model:0,source:1,source_freshness:1,snapshot:2,seed:3,exposure:4,metric:5,semantic_model:6,test:7,unit_test:8,macro:9,analysis:10};function pm(e){return e?fm[e]??98:99}function mm(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=dm(i,t)?0:1,s=dm(a,t)?0:1;if(o!==s)return o-s;let c=pm(i?.resourceType),l=pm(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.end??0)-t.start),d=Math.abs((a?.end??0)-t.start);return u===d?e.localeCompare(r):u-d})}function hm(e,t,n){return t||e.length<=n?e:e.slice(0,n)}function gm(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=dm(i,t)?0:1,s=dm(a,t)?0:1;if(o!==s)return o-s;let c=pm(i?.resourceType),l=pm(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.start??0)-t.end),d=Math.abs((a?.start??0)-t.end);return u===d?e.localeCompare(r):u-d})}function _m(e){return`${e.fromId}\t${e.toId}`}function vm(e,t){if(e.hop!==t.hop)return e.hop-t.hop;let n=e.leg===`upstream`?0:1,r=t.leg===`upstream`?0:1;if(n!==r)return n-r;let i=e.fromId.localeCompare(t.fromId);return i===0?e.toId.localeCompare(t.toId):i}function ym(e,t,n,r,i,a){return hm(mm(t.inbound.filter(e=>i(e)),n,r),a.showAllUpstream,a.maxUpstreamEdges).map(t=>({fromId:t,toId:e,tier:dm(r.get(t),n)?`secondary`:`primary`,hop:1,leg:`upstream`}))}function bm(e,t,n,r,i,a){return hm(gm(t.outbound.filter(e=>i(e)),n,r),a.showAllDownstream,a.maxDownstreamEdges).map(t=>({fromId:e,toId:t,tier:`downstream`,hop:1,leg:`downstream`}))}function xm(e,t,n,r,i,a,o){return{upExt:a?Tm(e,t,n,r,i):{edges:[],truncated:!1},downExt:o?Em(e,t,n,r,i):{edges:[],truncated:!1}}}function Sm(e,t,n){let r=new Map;for(let t of e)r.set(_m(t),t);for(let e of t){let t=_m(e);r.has(t)||r.set(t,e)}for(let e of n){let t=_m(e);r.has(t)||r.set(t,e)}return[...r.values()].sort(vm)}function Cm(e,t){let n=t.timelineAdjacency[e];if(!n)return!1;let r=t.direction===`upstream`?n.inbound:n.outbound;for(let n of r){if(!t.inTimeline(n))continue;let r=t.direction===`upstream`?n:e,i=t.direction===`upstream`?e:n,a=_m({fromId:r,toId:i});if(!t.seen.has(a)){if(t.seen.add(a),t.hop>=2&&(t.edges.push({fromId:r,toId:i,tier:t.direction===`upstream`?`primary`:`downstream`,hop:t.hop,leg:t.direction}),t.edges.length>=t.maxEdges))return!0;t.nextFrontier.add(n)}}return!1}function wm(e,t,n,r,i,a){let o=e=>n.has(e),s=new Set,c=[],l=!1,u=new Set([e]);for(let e=1;e<=r&&c.length<i;e++){let n=new Set,r={hop:e,direction:a,timelineAdjacency:t,inTimeline:o,seen:s,edges:c,maxEdges:i,nextFrontier:n};for(let e of u)if(l=Cm(e,r),l)break;if(u=n,l||u.size===0)break}return{edges:c,truncated:l}}function Tm(e,t,n,r,i){return wm(e,t,n,r,i,`upstream`)}function Em(e,t,n,r,i){return wm(e,t,n,r,i,`downstream`)}function Dm(e,t,n,r,i){if(!e||!t)return{edges:[],extendedTruncated:!1};let a=t[e],o=n.get(e);if(!a||!o||!r.has(e))return{edges:[],extendedTruncated:!1};let s=e=>r.has(e),c=i.includeUpstream??!0,l=i.includeDownstream,u=[...c?ym(e,a,o,n,s,i):[],...l?bm(e,a,o,n,s,i):[]],d=i.extendedDeps;if(!d?.enabled)return{edges:[...u].sort(vm),extendedTruncated:!1};let{upExt:f,downExt:p}=xm(e,t,r,d.maxHops??3,d.maxEdgesPerDirection??12,c,l);return{edges:Sm(u,f.edges,p.edges),extendedTruncated:f.truncated||p.truncated}}function Om(e,t,n,r,i,a){let o=n[e];if(!o)return null;let s=32+(r[e]??0)-i;if(o.item.unique_id===t)return s+6+14/2;if(!a)return null;for(let{item:e,lane:n}of o.lanes)if(e.unique_id===t)return s+44+5+n*14+10/2;return null}function km(e){let{edge:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:o,showTests:s,effectiveLabelW:c,rangeStart:l,rangeEnd:u,chartW:d}=e,f=n.get(t.fromId),p=n.get(t.toId),m=r.get(t.fromId),h=r.get(t.toId);if(f==null||p==null||m===void 0||h===void 0)return``;let g=Om(m,t.fromId,i,a,o,s),_=Om(h,t.toId,i,a,o,s);if(g==null||_==null)return``;let v=Math.max(1,u-l),y=c+(f.start+f.duration-l)/v*d,b=c+(p.start-l)/v*d,x=Math.abs(b-y)*.4;return`M${y},${g} C${y+x},${g} ${b-x},${_} ${b},${_}`}var Am=8,jm=8;function Mm(e,t,n){if((e.hop??1)>=2)return e.leg===`upstream`?{stroke:t.slate,strokeWidth:1,strokeDasharray:`3 4`,opacity:.36,markerEnd:`url(#${n.secondary})`}:{stroke:t.accent,strokeWidth:1,strokeDasharray:`4 5`,opacity:.4,markerEnd:`url(#${n.downstream})`};switch(e.tier){case`secondary`:return{stroke:t.slate,strokeWidth:1,strokeDasharray:`4 3`,opacity:.42,markerEnd:`url(#${n.secondary})`};case`downstream`:return{stroke:t.accent,strokeWidth:1.5,strokeDasharray:`5 4`,opacity:.62,markerEnd:`url(#${n.downstream})`};default:return{stroke:t.accent,strokeWidth:2,strokeDasharray:`6 4`,opacity:.88,markerEnd:`url(#${n.primary})`}}}function Nm({id:e,fill:t}){return(0,u.jsx)(`marker`,{id:e,viewBox:`0 0 ${Am} ${jm}`,refX:Am-.5,refY:jm/2,markerWidth:Am,markerHeight:jm,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,u.jsx)(`path`,{d:`M0,0 L${Am},${jm/2} L0,${jm} Z`,fill:t})})}function Pm({edges:e,focusId:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,canvasWidth:o,effectiveLabelW:s,rangeStart:c,rangeEnd:l,scrollTop:d,viewportH:f,theme:p=`light`,showTests:m=!0}){if(t==null||e.length===0)return null;let h=xe(p),g=o-s-24,_=`gantt-edge-mk-primary`,v=`gantt-edge-mk-secondary`,y=`gantt-edge-mk-downstream`,b={primary:_,secondary:v,downstream:y};return(0,u.jsxs)(`svg`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:f,pointerEvents:`none`,overflow:`hidden`,zIndex:5},"aria-hidden":!0,children:[(0,u.jsxs)(`defs`,{children:[(0,u.jsx)(Nm,{id:_,fill:h.accent}),(0,u.jsx)(Nm,{id:v,fill:h.slate}),(0,u.jsx)(Nm,{id:y,fill:h.accent})]}),e.map((e,t)=>{let o=km({edge:e,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:d,showTests:m,effectiveLabelW:s,rangeStart:c,rangeEnd:l,chartW:g});if(!o)return null;let{stroke:f,strokeWidth:p,strokeDasharray:_,opacity:v,markerEnd:y}=Mm(e,h,b);return(0,u.jsx)(`path`,{d:o,stroke:f,strokeWidth:p,strokeDasharray:_,fill:`none`,opacity:v,markerEnd:y},`${e.fromId}-${e.toId}-${e.tier}-${e.hop}-${e.leg}-${t}`)})]})}var Fm=8;function Im({labelColumnW:e,viewportH:t,minW:n,maxW:r,onWidthChange:i}){let a=(0,c.useRef)(null),o=(0,c.useCallback)(e=>Math.max(n,Math.min(r,Math.round(e))),[n,r]),s=(0,c.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),a.current={startX:t.clientX,startW:e},t.currentTarget.setPointerCapture(t.pointerId)},[e]),l=(0,c.useCallback)(e=>{let t=a.current;t&&i(o(t.startW+(e.clientX-t.startX)))},[o,i]),d=(0,c.useCallback)(e=>{a.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),f=Math.max(0,e-Fm/2);return(0,u.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize timeline name column`,className:`gantt-label-resize-handle`,style:{position:`absolute`,left:f,top:0,width:Fm,height:t,cursor:`col-resize`,touchAction:`none`,zIndex:4,background:`transparent`},onPointerDown:s,onPointerMove:l,onPointerUp:d,onPointerCancel:d})}var Lm=16,Rm=0,zm=12;function Bm(e){return e.split(/[\s_-]+/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function Vm({hoverX:e,hoverY:t,frameWidth:n,frameHeight:r,tooltipWidth:i,tooltipHeight:a,offsetX:o=Lm,offsetY:s=Rm,margin:c=zm}){let l=Math.max(n,i+c*2),u=Math.max(r,a+c*2),d=e+o;d+i>l-c&&(d=e-i-o);let f=t+s;return f+a>u-c&&(f=u-a-c),d=Math.min(Math.max(c,d),Math.max(c,l-i-c)),f=Math.min(Math.max(c,f),Math.max(c,u-a-c)),{left:d,top:f}}function Hm({hover:e,frameWidth:t,frameHeight:n,runStartedAt:r,canShowTimestamps:i,timeZone:a,testStats:o}){let s=(0,c.useRef)(null),[l,d]=(0,c.useState)(()=>Vm({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:220,tooltipHeight:160}));return(0,c.useLayoutEffect)(()=>{let r=s.current;if(!r)return;let i=Vm({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:r.offsetWidth,tooltipHeight:r.offsetHeight});d(e=>e.left===i.left&&e.top===i.top?e:i)},[n,t,e.x,e.y,e.item.unique_id]),(0,u.jsxs)(`div`,{ref:s,className:`chart-tooltip`,style:{position:`absolute`,left:l.left,top:l.top,pointerEvents:`none`,zIndex:20,minWidth:180},children:[(0,u.jsx)(`div`,{style:{fontWeight:700,marginBottom:`0.3rem`},children:e.item.name||e.item.unique_id}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`Status: `}),e.item.status]}),e.item.resourceType&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`Type: `}),e.item.resourceType]}),e.item.materialized?(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`Materialization: `}),Bm(e.item.materialized)]}):null,i&&r!=null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`Start: `}),Zp(r+e.item.start,a)]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`End: `}),Zp(r+e.item.end,a)]})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`Start: `}),`+`,Xp(e.item.start)]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`End: `}),`+`,Xp(e.item.end)]})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`Duration: `}),Xp(e.item.duration)]}),e.item.compileStart!=null&&e.item.compileEnd!=null&&e.item.compileEnd>e.item.compileStart&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`Compile: `}),Xp(e.item.compileEnd-e.item.compileStart)]}),e.item.executeStart!=null&&e.item.executeEnd!=null&&e.item.executeEnd>e.item.executeStart&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`Execute: `}),Xp(e.item.executeEnd-e.item.executeStart)]}),o&&o.pass+o.fail+o.error+o.warn+o.skipped>0&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Jp,children:`Tests: `}),[o.pass>0?`✓${o.pass}`:null,o.error>0?`✗${o.error}`:null,o.warn>0?`!${o.warn}`:null,o.skipped>0?`−${o.skipped}`:null].filter(Boolean).join(` · `)]})]})}function Um({canvasRef:e,scrollRef:t,edges:n,edgeFocusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,containerWidth:l,effectiveLabelW:d,rangeStart:f,rangeEnd:p,scrollTop:m,viewportH:h,needsScroll:g,totalScrollH:_,theme:v,showTests:y,hover:b,runStartedAt:x,canShowTimestamps:S,timeZone:C,testStatsById:w,selectedId:T,onSelect:E,onPointer:D,onHoverClear:O,labelColumnResize:k}){let A=(0,c.useRef)(null),[ee,j]=(0,c.useState)(0);return(0,c.useLayoutEffect)(()=>{let e=A.current;if(!e)return;let t=()=>j(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,u.jsxs)(`section`,{ref:A,className:`chart-frame`,style:{position:`relative`,userSelect:`none`},children:[(0,u.jsx)(`canvas`,{ref:e,style:{position:`absolute`,top:0,left:0,width:`100%`,height:h,pointerEvents:`none`,display:`block`}}),(0,u.jsx)(Pm,{edges:n,focusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,canvasWidth:l>0?l:600,effectiveLabelW:d,rangeStart:f,rangeEnd:p,scrollTop:m,viewportH:h,theme:v,showTests:y}),(0,u.jsx)(`div`,{ref:t,className:`chart-frame__viewport`,role:`region`,tabIndex:0,"aria-label":`Timeline chart viewport — use arrow keys to scroll`,style:{position:`relative`,height:h,overflowY:g?`auto`:`hidden`},onMouseMove:e=>D(e,`move`),onClick:e=>D(e,`click`),onKeyDown:e=>{if(e.key!==`Enter`&&e.key!==` `)return;e.preventDefault();let t=b?.item.unique_id??T;t&&E?.(t)},onMouseLeave:O,children:(0,u.jsx)(`div`,{style:{height:_}})}),k?(0,u.jsx)(Im,{labelColumnW:k.width,viewportH:k.viewportH,minW:k.minW,maxW:k.maxW,onWidthChange:k.onChange}):null,b&&(0,u.jsx)(Hm,{hover:b,frameWidth:ee>0?ee:l,frameHeight:h,runStartedAt:x,canShowTimestamps:S,timeZone:C,testStats:w?.get(b.item.unique_id)})]})}function Wm({activeMode:e,onChange:t,activeTimeZone:n,timeZones:r,onTimeZoneChange:i}){return(0,u.jsx)(`div`,{className:`gantt-controls`,children:(0,u.jsxs)(`div`,{className:`gantt-controls__cluster`,children:[e===`timestamps`&&(0,u.jsxs)(`label`,{className:`gantt-timezone-select`,children:[(0,u.jsx)(`span`,{children:`Timezone`}),(0,u.jsx)(`select`,{value:n,onChange:e=>i(e.target.value),children:r.map(e=>(0,u.jsx)(`option`,{value:e,children:e},e))})]}),(0,u.jsxs)(`div`,{className:`gantt-mode-toggle`,children:[(0,u.jsx)(`button`,{type:`button`,className:e===`duration`?`active`:``,onClick:()=>t(`duration`),children:`Duration`}),(0,u.jsx)(`button`,{type:`button`,className:e===`timestamps`?`active`:``,onClick:()=>t(`timestamps`),children:`Timestamps`})]})]})})}var Gm=1e3;function Km(e,t){let n=t?.get(e.item.unique_id);return n&&n.error+n.warn>0?!0:rm(e.item.status)||e.tests.some(e=>rm(e.status))}function qm(e,t,n){return{start:Math.max(0,Math.min(e,n)),end:Math.max(0,Math.min(t,n))}}function Jm({bundles:e,maxEnd:t,timeWindow:n,testStatsById:r,onChange:i}){let a=(0,c.useRef)(null),[o,s]=(0,c.useState)(null),l=(0,c.useRef)(null),d=Math.min(Math.max(Gm,t*.01),t),f=n?.start??0,p=n?.end??t,m=n!=null;function h(e){let n=a.current;if(!n)return 0;let r=n.clientWidth;return r<=0||t<=0?0:(e-n.getBoundingClientRect().left)/r*t}function g(e,r){if(!a.current||a.current.clientWidth<=0||t<=0)return;let i=h(e.clientX);l.current={mode:r,startPx:e.clientX,initialStart:r===`create`?i:f,initialEnd:r===`create`?i:p,currentStart:r===`create`?i:f,currentEnd:r===`create`?i:p},s(r===`create`?{start:i,end:i}:n),a.current.setPointerCapture(e.pointerId)}function _(e){let n=l.current,r=a.current;if(!n||!r||t<=0)return;let i=r.clientWidth;if(i<=0)return;let o=(e.clientX-n.startPx)/i*t,c=n.initialEnd-n.initialStart,u=h(e.clientX);if(n.mode===`create`){let e={start:Math.min(n.initialStart,u),end:Math.max(n.initialStart,u)};l.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}if(n.mode===`pan`){let e=Math.min(Math.max(0,n.initialStart+o),t-c),r={start:e,end:e+c};l.current={...n,currentStart:r.start,currentEnd:r.end},s(r);return}if(n.mode===`start`){let e={start:Math.min(Math.max(0,n.initialStart+o),n.initialEnd-d),end:n.initialEnd};l.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}let f=Math.max(Math.min(t,n.initialEnd+o),n.initialStart+d),p={start:n.initialStart,end:f};l.current={...n,currentStart:p.start,currentEnd:p.end},s(p)}function v(e){let n=l.current;if(n&&a.current?.hasPointerCapture(e.pointerId)&&a.current.releasePointerCapture(e.pointerId),n){let e=qm(n.currentStart,n.currentEnd,t),r=e.end-e.start;(n.mode!==`create`||r>=d)&&(e.start<=0&&e.end>=t?i(null):i(e))}l.current=null,s(null)}let y=o??(m?{start:f,end:p}:{start:0,end:t}),b=y==null?0:Math.max(0,Math.min(100,y.start/t*100)),x=y==null?0:Math.max(0,Math.min(100,y.end/t*100)),S=Math.max(0,x-b);return(0,u.jsxs)(`div`,{className:`gantt-brush-wrap`,children:[(0,u.jsxs)(`div`,{className:`gantt-brush__header`,children:[(0,u.jsx)(`p`,{className:`gantt-brush__title`,children:`Time range`}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!m,onClick:()=>i(null),children:`Reset zoom`})]}),(0,u.jsxs)(`div`,{ref:a,className:`gantt-brush`,onPointerDown:e=>{e.target!==e.currentTarget||e.button!==0||g(e,`create`)},onPointerMove:_,onPointerUp:v,onPointerCancel:v,role:`slider`,"aria-label":`Timeline time range`,"aria-valuemin":0,"aria-valuemax":Math.round(t),"aria-valuenow":Math.round(f),"aria-valuetext":`${Math.round(f)} to ${Math.round(p)} ms`,children:[e.map(e=>{let n=Math.max(0,e.item.start),i=Math.max(n,e.item.end),a=n/t*100,o=Math.max(.2,(i-n)/t*100),s=Km(e,r);return(0,u.jsx)(`span`,{className:s?`gantt-brush__bar gantt-brush__bar--issue`:`gantt-brush__bar`,"data-issue":s?`true`:`false`,style:{left:`${a}%`,width:`${o}%`}},e.item.unique_id)}),y!=null&&(0,u.jsxs)(`div`,{className:m||o!=null?`gantt-brush__selection`:`gantt-brush__selection gantt-brush__selection--default`,"data-default-range":m||o!=null?`false`:`true`,style:{left:`${b}%`,width:`${S}%`},onPointerDown:e=>g(e,`pan`),children:[(0,u.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--start`,onPointerDown:e=>{e.stopPropagation(),g(e,`start`)}}),(0,u.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--end`,onPointerDown:e=>{e.stopPropagation(),g(e,`end`)}})]})]})]})}function Ym(e,t,n,r,i,a,o=2){let s=Math.max(1,t-e),c=i+a,l=i+(n-e)/s*a,u=i+(r-e)/s*a,d=Math.max(i,Math.min(l,u));return{x:d,width:Math.max(o,Math.min(c,Math.max(l,u))-d)}}function Xm(e,t){return t&&e.laneCount>0?49+e.laneCount*14+5:44}function Zm(e,t){let n=[],r=[],i=0;for(let a of e){n.push(i);let e=Xm(a,t);r.push(e),i+=e}return{rowOffsets:n,rowHeights:r,totalHeight:i}}function Qm(e,t,n){if(e.length===0)return-1;let r=0,i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a]??0,s=t[a]??44;if(o>n)i=a-1;else if(o+s<=n)r=a+1;else return a}return-1}function $m(e,t,n,r,i,a,o,s){let{rowOffsets:c,rowHeights:l,showTests:u}=n;if(!s)return null;let d=e.currentTarget.getBoundingClientRect(),f=e.clientX-d.left,p=e.clientY-d.top;if(p<32||f<0)return null;let m=Qm(c,l,p-32+r);if(m<0||m>=t.length)return null;let h=t[m];if(!h)return null;let g=s.getBoundingClientRect().width-o-24,_=32+(c[m]??0)-r;if(f<o)return{item:h.item,x:f,y:p};let v=o,{x:y,width:b}=Ym(i,a,h.item.start,h.item.end,v,g);if(f>=y&&f<=y+b)return{item:h.item,x:f,y:p};if(u&&h.lanes.length>0)for(let{item:e,lane:t}of h.lanes){let{x:n,width:r}=Ym(i,a,e.start,e.end,v,g,4),o=_+44+5+t*14;if(f>=n&&f<=n+r&&p>=o&&p<=o+10)return{item:e,x:f,y:p}}return null}function eh(e,t,n){let{bundles:r,layout:i,scrollTop:a,rangeStart:o,rangeEnd:s,effectiveLabelW:c,canvas:l,setHover:u,onSelect:d}=n,f=$m(e,r,i,a,o,s,c,l);if(!f){t===`move`?u(null):d?.(null);return}if(t===`move`){u({item:f.item,x:f.x,y:f.y});return}d?.(f.item.unique_id)}var th={...Se};function nh(e,t=`light`){return(t===`dark`?Ce:Se)[e.toLowerCase()]??xe(t).textSoft}function rh(e,t=`light`){let n=Pe(t);return(e&&n[e])??xe(t).borderSubtle}var ih=3,ah=2.25;function oh(e){return(e?.error??0)+(e?.warn??0)>0}function sh(e,t,n,r,i,a){r<2*a&&(a=r/2),i<2*a&&(a=i/2),e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+r,n,t+r,n+i,a),e.arcTo(t+r,n+i,t,n+i,a),e.arcTo(t,n+i,t,n,a),e.arcTo(t,n,t+r,n,a),e.closePath()}function ch(e,t,n,r,i,a){sh(e,t,n,r,i,a),e.fill()}function lh(e,t,n,r,i,a){sh(e,t,n,r,i,a),e.stroke()}function uh(e,t){let{rangeStart:n,rangeEnd:r,chartLeft:i,chartW:a,compileStart:o,compileEnd:s,barX:c,barY:l,barW:u,barH:d,radius:f,theme:p}=t;if(o==null||s==null||s<=o)return;let m=Math.max(1,r-n),h=i+(o-n)/m*a,g=i+(s-n)/m*a,_=Math.max(c,h),v=Math.min(c+u,g)-_;v<=.5||(e.save(),sh(e,c,l,u,d,f),e.clip(),e.fillStyle=p===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,e.fillRect(_,l,v,d),e.restore())}function dh(e,t,n,r,i,a,o){t%2==0&&(e.fillStyle=a?o.rowStripeHover:o.rowStripe,e.globalAlpha=i?1:.35,e.fillRect(0,n,r,44),e.globalAlpha=1)}function fh({ctx:e,item:t,rowY:n,labelW:r,xOffset:i,emphasis:a,palette:o}){e.save(),e.globalAlpha=a,e.beginPath(),e.rect(i,n,r-10-i,44),e.clip(),e.textAlign=`left`,e.textBaseline=`middle`,e.font=`12px "IBM Plex Sans", "Avenir Next", sans-serif`,e.fillStyle=o.labelText,e.fillText(t.name||t.unique_id,i+2,n+44/2),e.restore()}function ph({ctx:e,item:t,rowY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,emphasis:s,isHovered:c,attachedTestStats:l,palette:u,theme:d}){let f=n+6,{x:p,width:m}=Ym(r,i,t.start,t.end,o,a),h=oh(l),g=rm(t.status)||h;e.save(),e.globalAlpha=s,e.fillStyle=Ie(t.resourceType,d),ch(e,p,f,m,14,3),uh(e,{rangeStart:r,rangeEnd:i,chartLeft:o,chartW:a,compileStart:t.compileStart,compileEnd:t.compileEnd,barX:p,barY:f,barW:m,barH:14,radius:3,theme:d}),h&&tm(t.status)&&(e.fillStyle=u.testFailStripe,ch(e,p,f+14-4,m,4,2)),e.strokeStyle=g?u.testFailStripe:nh(t.status,d),e.lineWidth=g?ih:2,lh(e,p,f,m,14,3),e.restore(),c&&(e.save(),e.globalAlpha=1,e.strokeStyle=u.barHoverStroke,e.lineWidth=1.5,lh(e,p,f,m,14,3),e.restore())}function mh({ctx:e,test:t,chipY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,palette:s,theme:c,emphasis:l,isHovered:u}){let{x:d,width:f}=Ym(r,i,t.start,t.end,o,a,4),p=rm(t.status);e.save(),e.globalAlpha=l,e.fillStyle=Ie(t.resourceType,c),ch(e,d,n,f,10,2),uh(e,{rangeStart:r,rangeEnd:i,chartLeft:o,chartW:a,compileStart:t.compileStart,compileEnd:t.compileEnd,barX:d,barY:n,barW:f,barH:10,radius:2,theme:c}),e.strokeStyle=p?s.testFailStripe:nh(t.status,c),e.lineWidth=p?ah:1.5,lh(e,d,n,f,10,2),e.restore(),f>=40&&(e.save(),e.globalAlpha=l,e.beginPath(),e.rect(d+2,n,f-4,10),e.clip(),e.font=`9px "IBM Plex Sans", "Avenir Next", sans-serif`,e.fillStyle=s.labelText,e.textAlign=`left`,e.textBaseline=`middle`,e.fillText(t.name,d+2,n+10/2),e.restore()),u&&(e.save(),e.globalAlpha=1,e.strokeStyle=s.barHoverStroke,e.lineWidth=1,lh(e,d,n,f,10,2),e.restore())}function hh(e,t){let n=e.getContext(`2d`);if(!n)return null;let r=e.getBoundingClientRect(),i=window.devicePixelRatio||1,a=r.width,o=r.height;return a===0||o===0?null:(e.width=a*i,e.height=o*i,n.scale(i,i),n.clearRect(0,0,a,o),{ctx:n,w:a,h:o,chartW:a-t-24})}function gh({ctx:e,labelW:t,chartW:n,h:r,rangeStart:i,rangeEnd:a,displayMode:o,runStartedAt:s,timeZone:c,palette:l}){let u=Math.max(1,a-i),d=sm(i,a);e.font=`11px 'IBM Plex Mono', 'Fira Mono', monospace`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=l.axisTick;let f=cm(d,i,a,n,e=>o===`timestamps`&&s!=null?Zp(s+e.ms,c):e.label,t=>e.measureText(t).width);for(let a of f){let d=t+(a.ms-i)/u*n;e.strokeStyle=l.gridLine,e.lineWidth=1,e.beginPath(),e.moveTo(d,32),e.lineTo(d,r),e.stroke();let f=o===`timestamps`&&s!=null?Zp(s+a.ms,c):a.label;e.fillText(f,d,32/2)}}function _h(e){let{ctx:t,bundle:n,rowIndex:r,rowY:i,w:a,labelW:o,chartW:s,rangeStart:c,rangeEnd:l,focusIds:u,hoveredId:d,theme:f,palette:p,testStatsById:m,showTests:h}=e,g=u==null||u.has(n.item.unique_id)||n.lanes.some(e=>u.has(e.item.unique_id)),_=u==null||u.has(n.item.unique_id),v=d===n.item.unique_id,y=_?1:.18;if(dh(t,r,i,a,g,v,p),fh({ctx:t,item:n.item,rowY:i,labelW:o,xOffset:0,emphasis:y,palette:p}),ph({ctx:t,item:n.item,rowY:i,rangeStart:c,rangeEnd:l,chartW:s,labelW:o,emphasis:y,isHovered:v,attachedTestStats:m?.get(n.item.unique_id),palette:p,theme:f}),!(!h||n.lanes.length===0))for(let{item:e,lane:r}of n.lanes){let n=i+44+5+r*14,a=d===e.unique_id;mh({ctx:t,test:e,chipY:n,rangeStart:c,rangeEnd:l,chartW:s,labelW:o,palette:p,theme:f,emphasis:u==null||u.has(e.unique_id)?1:.18,isHovered:a})}}function vh(e,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,focusIds:l,hoveredId:u,labelW:d=160,timeZone:f,testStatsById:p,theme:m=`light`,showTests:h=!1}){let g=hh(e,d);if(!g)return;let{ctx:_,w:v,h:y,chartW:b}=g,x=ze(m);if(gh({ctx:_,labelW:d,chartW:b,h:y,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,timeZone:f,palette:x}),t.length===0)return;let S=y-32,C=yh(n,i),w=bh(n,r,i,S);_.textBaseline=`middle`;for(let e=C;e<=w;e++){let r=t[e];if(!r)continue;let s=32+(n[e]??0)-i;_h({ctx:_,bundle:r,rowIndex:e,rowY:s,w:v,labelW:d,chartW:b,rangeStart:a,rangeEnd:o,focusIds:l,hoveredId:u,theme:m,palette:x,testStatsById:p,showTests:h})}}function yh(e,t){if(e.length===0)return 0;let n=0,r=e.length-1;for(;n<r;){let i=Math.floor((n+r)/2);(e[i]??0)<t?n=i+1:r=i}return Math.max(0,n-1)}function bh(e,t,n,r){let i=n+r,a=0;for(let r=0;r<e.length;r++){let o=e[r]??0;if(!(o+(t[r]??44)<=n)){if(o>=i)break;a=r}}return a}function xh({canvasRef:e,bundles:t,rowOffsets:n,rowHeights:r,scrollTop:i,rangeStart:a,rangeEnd:o,activeMode:s,runStartedAt:l,focusedIds:u,hoveredId:d,effectiveLabelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g,setContainerWidth:_}){(0,c.useEffect)(()=>{if(t.length===0)return;function c(){let c=e.current;c&&vh(c,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:l,focusIds:u,hoveredId:d,labelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g})}let v=e.current;if(!v)return;c();let y=new ResizeObserver(e=>{let t=e[0];t&&_(t.contentRect.width),c()});return y.observe(v),()=>y.disconnect()},[t,n,r,i,a,o,s,l,u,d,f,p,m,h,g,_])}function Sh(e){return Math.max(1,Math.min(3,Math.trunc(e)))}function Ch(e){let t=Sh(e.dependencyDepthHops);return{includeUpstream:e.dependencyDirection!==`downstream`,includeDownstream:e.dependencyDirection!==`upstream`,showAllUpstream:!1,maxUpstreamEdges:8,showAllDownstream:!1,maxDownstreamEdges:8,extendedDeps:t>1?{enabled:!0,maxHops:Sh(t),maxEdgesPerDirection:12}:{enabled:!1}}}function wh({edgeFocusId:e,timelineAdjacency:t,itemById:n,bundleIndexById:r,dependencyDirection:i,dependencyDepthHops:a}){let o=(0,c.useMemo)(()=>Ch({dependencyDirection:i,dependencyDepthHops:a}),[a,i]),{edges:s}=(0,c.useMemo)(()=>Dm(e,t,n,r,o),[e,t,n,r,o]);return{edges:s}}function Th({data:e,runStartedAt:t,timelineAdjacency:n,testStatsById:r,showTests:i=!1,dependencyDirection:a=`both`,dependencyDepthHops:o=2,selectedId:l=null,onSelect:d,timeWindow:f=null,onTimeWindowChange:p}){let m=kt(),h=(0,c.useRef)(null),g=(0,c.useRef)(null),[_,v]=(0,c.useState)(null),[y,b]=(0,c.useState)(`duration`),[x,S]=(0,c.useState)($p),[C,w]=(0,c.useState)(0),[T,E]=(0,c.useState)(()=>typeof window>`u`?900:window.innerHeight),D=(0,c.useMemo)(()=>Qp(),[]),O=t!=null,k=O?y:`duration`;(0,c.useEffect)(()=>{try{window.localStorage.setItem(Yp,x)}catch{}},[x]);let{effectiveLabelW:A,maxLabelW:ee,onLabelColumnWidthDrag:j}=um(C),M=(0,c.useMemo)(()=>Wp(e),[e]),te=(0,c.useMemo)(()=>{let e=1;for(let t of M){e=Math.max(e,t.item.end);for(let n of t.tests)e=Math.max(e,n.end)}return e},[M]),N=(0,c.useMemo)(()=>{if(!f)return M;let{start:t,end:n}=f,r=new Set;for(let e of M)for(let i of e.tests)if(i.end>t&&i.start<n){r.add(e.item.unique_id);break}return Wp(e.filter(e=>e.end>t&&e.start<n?!0:r.has(e.unique_id)))},[e,M,f]),P=f?.start??0,F=f?f.end:te,I=P,ne=F,{rowOffsets:re,rowHeights:ie}=(0,c.useMemo)(()=>Zm(N,i),[N,i]),ae=(0,c.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.unique_id,n);return t},[e]),oe=s({count:N.length,getScrollElement:()=>g.current,estimateSize:e=>N[e]?Xm(N[e],i):44,getItemKey:e=>N[e]?.item.unique_id??e,overscan:10}),se=oe.scrollOffset??0;(0,c.useLayoutEffect)(()=>{oe.measure()},[N,i,oe]);let ce=(0,c.useMemo)(()=>({rowOffsets:re,rowHeights:ie,showTests:i}),[re,ie,i]),le=(0,c.useMemo)(()=>{let e=new Map;for(let t=0;t<N.length;t++){let n=N[t];if(n){e.set(n.item.unique_id,t);for(let r of n.tests)e.set(r.unique_id,t)}}return e},[N]),ue=l??_?.item.unique_id??null,{edges:de}=wh({edgeFocusId:ue,timelineAdjacency:n,itemById:ae,bundleIndexById:le,dependencyDirection:a,dependencyDepthHops:o}),fe=(0,c.useMemo)(()=>{if(!ue)return null;let e=new Set([ue]);for(let t of de)e.add(t.fromId),e.add(t.toId);return e},[ue,de]),pe=32+oe.getTotalSize(),me=Math.max(240,Math.min(T-320,Math.round(T*qp))),he=Math.max(240,Math.min(me,pe)),ge=pe>he;if((0,c.useEffect)(()=>{let e=()=>E(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),xh({canvasRef:h,bundles:N,rowOffsets:re,rowHeights:ie,scrollTop:se,rangeStart:I,rangeEnd:ne,activeMode:k,runStartedAt:t,focusedIds:fe,hoveredId:_?.item.unique_id??null,effectiveLabelW:A,timeZone:x,testStatsById:r,theme:m,showTests:i,setContainerWidth:w}),M.length===0)return(0,u.jsx)(`div`,{className:`empty-state empty-state--chart`,children:`No Gantt data (run_results may lack timing info)`});function _e(e,t){eh(e,t,{bundles:N,layout:ce,scrollTop:se,rangeStart:I,rangeEnd:ne,effectiveLabelW:A,canvas:h.current,setHover:v,onSelect:d})}return(0,u.jsxs)(`div`,{className:`gantt-shell`,role:`region`,"aria-label":`Execution timeline`,children:[O&&(0,u.jsx)(Wm,{activeMode:k,onChange:b,activeTimeZone:x,timeZones:D,onTimeZoneChange:S}),(0,u.jsx)(Jm,{bundles:M,maxEnd:te,timeWindow:f,testStatsById:r,onChange:p??(()=>{})}),(0,u.jsx)(Um,{canvasRef:h,scrollRef:g,edges:de,edgeFocusId:ue,itemById:ae,bundleIndexById:le,bundles:N,rowOffsets:re,containerWidth:C,effectiveLabelW:A,rangeStart:I,rangeEnd:ne,scrollTop:se,viewportH:he,needsScroll:ge,totalScrollH:pe,theme:m,showTests:i,hover:_,runStartedAt:t,canShowTimestamps:O,timeZone:x,testStatsById:r,selectedId:l,onSelect:d,onPointer:_e,onHoverClear:()=>v(null),labelColumnResize:{width:A,viewportH:he,minW:120,maxW:ee,onChange:j}})]})}var Eh={display:`inline-block`,width:10,height:10,borderRadius:2,flexShrink:0},Dh=` gantt-legend__item--active`;function Oh({theme:e,themeHex:t,showCompileExecuteLegend:n}){let r=Ie(`model`,e),i=nh(`success`,e);return(0,u.jsxs)(`div`,{className:`gantt-legend__group gantt-legend__group--bar-key`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Bars`}),(0,u.jsxs)(`div`,{className:`gantt-legend__bar-key-row`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`2px solid ${t.borderDefault}`,borderRadius:3},title:`Bar fill follows resource type`,"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Fill = type`}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:t.bgSoft,border:`2px solid ${i}`,borderRadius:3},title:`Bar outline follows run status`,"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Border = status`})]}),n?(0,u.jsxs)(`div`,{className:`gantt-legend__bar-key-row gantt-legend__bar-key-row--phases`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:e===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Compile (darker)`}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Execute`})]}):null]})}function kh({themeHex:e,showTests:t,onToggleShowTests:n,failuresOnly:r,onToggleFailuresOnly:i}){return n==null&&i==null?null:(0,u.jsxs)(`div`,{className:`gantt-legend__group gantt-legend__group--actions`,children:[n!=null&&(0,u.jsxs)(`button`,{type:`button`,className:`gantt-legend__item${t?Dh:``}`,onClick:n,title:t?`Hide test chips`:`Show test chips`,"aria-pressed":t??!1,children:[(0,u.jsx)(`span`,{style:{...Eh,background:e.mint,borderRadius:50},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:`Tests`})]}),i!=null&&(0,u.jsxs)(`button`,{type:`button`,className:`gantt-legend__item${r?Dh:``}`,onClick:i,title:r?`Show all parent rows`:`Show only parents with errors or failing tests`,"aria-pressed":r??!1,children:[(0,u.jsx)(`span`,{style:{...Eh,background:e.rose,borderRadius:50},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:`Failures only`})]})]})}function Ah({statusCounts:e,typeCounts:t,activeStatuses:n,activeTypes:r,onToggleStatus:i,onToggleType:a,showTests:o,onToggleShowTests:s,failuresOnly:c,onToggleFailuresOnly:l,showBarEncodingKey:d=!0,showCompileExecuteLegend:f=!1}){let p=kt(),m=xe(p),h=Object.keys(th).filter(t=>(e[t]??0)>0),g=[...new Set([...Ge,...Object.keys(t)])].sort((e,t)=>e.localeCompare(t));return h.length>0||g.length>0||s!=null||l!=null?(0,u.jsxs)(`div`,{className:`gantt-legend`,children:[d?(0,u.jsx)(Oh,{theme:p,themeHex:m,showCompileExecuteLegend:f}):null,h.length>0&&(0,u.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Status`}),h.map(t=>{let r=n?.has(t)??!1,a=nh(t,p),o=e[t]??0;return(0,u.jsxs)(`button`,{type:`button`,className:`gantt-legend__item${r?Dh:``}`,onClick:()=>i?.(t),title:`${t} (${o})`,children:[(0,u.jsx)(`span`,{style:{...Eh,background:a}}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:t}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:o})]},t)})]}),g.length>0&&(0,u.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Type`}),g.map(e=>{let n=r?.has(e)??!1,i=rh(e,p),o=t[e]??0;return(0,u.jsxs)(`button`,{type:`button`,className:`gantt-legend__item${n?Dh:``}`,onClick:()=>a?.(e),title:`${e} (${o})`,children:[(0,u.jsx)(`span`,{style:{...Eh,background:m.bgSoft,borderLeft:`3px solid ${i}`,borderRadius:0}}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:e}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:o})]},e)})]}),(0,u.jsx)(kh,{themeHex:m,showTests:o,onToggleShowTests:s,failuresOnly:c,onToggleFailuresOnly:l})]}):null}var jh=[{value:`upstream`,label:`Upstream`,glyph:`←`},{value:`both`,label:`Both`,glyph:`⇄`},{value:`downstream`,label:`Downstream`,glyph:`→`}];function Mh({filters:e,setFilters:t}){let n=Sh(e.dependencyDepthHops),r=e=>t(t=>({...t,dependencyDepthHops:Sh(e)}));return(0,u.jsx)(`div`,{className:`timeline-dependency-controls gantt-legend`,"aria-label":`Dependency visualization controls`,children:(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__top-row`,children:[(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__zone`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Depth`}),(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__stepper`,role:`group`,"aria-label":`Dependency depth`,children:[(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n-1),disabled:n<=1,"aria-label":`Decrease dependency depth`,children:`-`}),(0,u.jsx)(`span`,{className:`timeline-dependency-controls__depth-value`,children:n}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n+1),disabled:n>=3,"aria-label":`Increase dependency depth`,children:`+`})]})]}),(0,u.jsx)(`div`,{className:`timeline-dependency-controls__divider`,"aria-hidden":`true`}),(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__zone timeline-dependency-controls__zone--direction`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Direction`}),(0,u.jsx)(`div`,{className:`workspace-segmented-control`,role:`tablist`,"aria-label":`Dependency direction`,children:jh.map(n=>{let r=e.dependencyDirection===n.value;return(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,className:r?`workspace-segmented-control__button workspace-segmented-control__button--active`:`workspace-segmented-control__button`,onClick:()=>t(e=>({...e,dependencyDirection:n.value})),children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,children:n.glyph}),` `,n.label]},n.value)})}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill timeline-dependency-controls__max-button`,onClick:()=>r(3),children:`Max`})]})]})})}function Nh({filters:e,hasActiveFilters:t,typeFilterHint:n,setFilters:r}){return(0,u.jsxs)(`div`,{className:`timeline-toolbar`,children:[(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact timeline-toolbar__search`,children:[(0,u.jsx)(`span`,{children:`Search nodes`}),(0,u.jsxs)(`div`,{className:`workspace-search__input-row`,children:[(0,u.jsx)(`input`,{value:e.query,onChange:e=>r(t=>({...t,query:e.target.value})),placeholder:`Filter by name or id…`,"aria-label":`Search timeline nodes`}),e.query&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-search__clear`,"aria-label":`Clear search`,onClick:()=>r(e=>({...e,query:``})),children:`✕`})]})]}),(n!=null||t)&&(0,u.jsxs)(`div`,{className:`timeline-toolbar__actions`,children:[n!=null&&(0,u.jsxs)(`p`,{className:`timeline-toolbar__hint`,role:`status`,children:[n.shown.length>0?`Showing types: ${n.shown.join(`, `)}. `:``,`Hidden by type filter:`,` `,n.hidden.map(({type:e,count:t})=>`${e} (${t})`).join(`, `),`.`]}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>{r(e=>({...e,query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:null,dependencyDirection:`both`,dependencyDepthHops:2}))},children:`Clear all filters`})]})]})}function Ph(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Fh(e,t,n){let r=n.get(e.unique_id),i=r?r.error+r.warn>0:t.some(e=>!tm(e.status));return!tm(e.status)||i}function Ih({analysis:e,filters:t,effectiveActiveTypes:n,filteredData:r,bundleRowCount:i,statusCounts:a,typeCounts:o,hasActiveFilters:s,typeFilterHint:l,testStatsById:d,setFilters:f,toggleStatus:p,toggleType:m,onInvestigationSelectionChange:h}){let g=(0,c.useMemo)(()=>e.ganttData.some(e=>e.compileStart!=null&&e.compileEnd!=null&&e.compileEnd>e.compileStart&&e.executeStart!=null&&e.executeEnd!=null&&e.executeEnd>e.executeStart),[e.ganttData]),{timeWindow:_}=t;return(0,u.jsxs)(Lt,{title:`Execution timeline`,subtitle:`Relative start and duration for each executed node.`,children:[(0,u.jsx)(Ah,{statusCounts:a,typeCounts:o,activeStatuses:t.activeStatuses,activeTypes:n,onToggleStatus:p,onToggleType:m,showTests:t.showTests,onToggleShowTests:()=>f(e=>({...e,showTests:!e.showTests})),failuresOnly:t.failuresOnly,onToggleFailuresOnly:()=>f(e=>({...e,failuresOnly:!e.failuresOnly})),showCompileExecuteLegend:g}),(0,u.jsx)(Mh,{filters:t,setFilters:f}),(0,u.jsx)(Nh,{filters:t,hasActiveFilters:s,typeFilterHint:l,setFilters:f}),_!=null&&(0,u.jsxs)(`p`,{className:`timeline-zoom-active`,role:`status`,children:[`Zoomed to `,Xp(_.end-_.start),` window`,` — `,(0,u.jsx)(`button`,{type:`button`,className:`timeline-zoom-clear`,onClick:()=>f(e=>({...e,timeWindow:null})),children:`Clear zoom ×`})]}),i>=2e4?(0,u.jsxs)(`p`,{className:`timeline-large-dataset-hint`,role:`status`,children:[`Showing `,i.toLocaleString(),` timeline rows. Use search or type and status filters to narrow the list.`]}):null,(0,u.jsx)(Th,{data:r,runStartedAt:e.runStartedAt,timelineAdjacency:e.timelineAdjacency,testStatsById:d,showTests:t.showTests,dependencyDirection:t.dependencyDirection,dependencyDepthHops:t.dependencyDepthHops,selectedId:t.selectedExecutionId,timeWindow:_,onTimeWindowChange:e=>f(t=>({...t,timeWindow:e})),onSelect:t=>{f(e=>({...e,selectedExecutionId:t})),h(n=>({...n,selectedExecutionId:t,selectedResourceId:t==null?n.selectedResourceId:e.resources.find(e=>e.uniqueId===t)?.uniqueId??n.selectedResourceId,sourceLens:`timeline`}))}})]})}function Lh({analysis:e,filters:t,setFilters:n,onInvestigationSelectionChange:r}){let i=(0,c.useDeferredValue)(t.query),a=e.projectName??st(e.executions),o=(0,c.useMemo)(()=>Array.from(new Set(e.ganttData.filter(e=>dt(e,a)).map(e=>e.resourceType).filter(e=>!!e))).sort(),[e.ganttData,a]),s=(0,c.useMemo)(()=>ut(o),[o]),l=t.activeTypes.size>0?t.activeTypes:s;function d(e){n(t=>{let n=new Set(t.activeStatuses);return n.has(e)?n.delete(e):n.add(e),{...t,activeStatuses:n}})}function f(e){n(t=>{let n=new Set(t.activeTypes.size>0?t.activeTypes:s);return n.has(e)?n.delete(e):n.add(e),{...t,activeTypes:n}})}let p=(0,c.useMemo)(()=>Cn(e.resources,e.dependencyIndex),[e.dependencyIndex,e.resources]),m=(0,c.useMemo)(()=>{let t=new Map;for(let n of e.ganttData){if(!z.has(n.resourceType)||n.parentId==null)continue;let e=t.get(n.parentId)??[];e.push(n),t.set(n.parentId,e)}return t},[e.ganttData]),h=(0,c.useMemo)(()=>e.ganttData.filter(e=>{if(z.has(e.resourceType)||t.activeTypes.size===0&&!dt(e,a)||t.activeStatuses.size>0&&!t.activeStatuses.has(e.status.toLowerCase())||l.size>0&&!l.has(e.resourceType??``))return!1;if(i){let t=i.trim().toLowerCase();if(t&&!e.name.toLowerCase().includes(t)&&!e.unique_id.toLowerCase().includes(t))return!1}return!(t.failuresOnly&&!Fh(e,m.get(e.unique_id)??[],p))}),[e.ganttData,i,l,t.activeStatuses,t.failuresOnly,t.activeTypes.size,a,p,m]),g=(0,c.useMemo)(()=>new Set(h.map(e=>e.unique_id)),[h]),_=(0,c.useMemo)(()=>t.showTests?e.ganttData.filter(e=>z.has(e.resourceType)&&e.parentId!=null&&g.has(e.parentId)):[],[e.ganttData,t.showTests,g]),v=(0,c.useMemo)(()=>[...h,..._],[h,_]),y=(0,c.useMemo)(()=>{let t={};for(let n of e.ganttData.filter(e=>dt(e,a))){let e=n.status.toLowerCase();t[e]=(t[e]??0)+1}return t},[e.ganttData,a]),b=(0,c.useMemo)(()=>{let t={};for(let n of e.ganttData.filter(e=>dt(e,a)))t[n.resourceType]=(t[n.resourceType]??0)+1;return t},[e.ganttData,a]),x=!Ph(l,s),S=(0,c.useMemo)(()=>{if(!x)return null;let e=[...l].filter(e=>s.has(e)).sort(),t=[...s].filter(e=>!l.has(e)).sort().map(e=>({type:e,count:b[e]??0}));return t.length===0?null:{shown:e,hidden:t}},[s,l,x,b]),C=t.activeStatuses.size>0||x||t.query.length>0;return(0,u.jsx)(Vt,{title:`Timeline`,description:`Runtime timing, concurrency, bottlenecks, and execution order.`,className:`timeline-view`,children:(0,u.jsx)(Ih,{analysis:e,filters:t,effectiveActiveTypes:l,filteredData:v,bundleRowCount:h.length,statusCounts:y,typeCounts:b,hasActiveFilters:C,typeFilterHint:S,testStatsById:p,setFilters:n,toggleStatus:d,toggleType:f,onInvestigationSelectionChange:r})})}var Rh=100;function zh(){return{status:{all:0,positive:0,warning:0,danger:0},facets:{all:0,models:0,tests:0,seeds:0,snapshots:0,operations:0,healthy:0,warnings:0,errors:0,issues:0},resourceTypes:{},threadIds:{}}}function Bh(e,t,n=!0){let r=(0,c.useRef)(null),i=(0,c.useRef)(0),[a,o]=(0,c.useState)(!1),[s,l]=(0,c.useState)(Rh),[u,d]=(0,c.useState)([]),[f,p]=(0,c.useState)(0),[m,h]=(0,c.useState)(zh),[g,_]=(0,c.useState)(!0),[v,y]=(0,c.useState)(!1),[b,x]=(0,c.useState)(null);return(0,c.useEffect)(()=>{l(Rh)},[t.kind,t.status,t.query,t.durationBand,t.sortBy,t.resourceTypes,t.threadIds,e]),(0,c.useEffect)(()=>{if(!n){o(!1),_(!1),y(!1),d([]),p(0),h(zh()),x(null);return}let t=new Worker(new URL(`/assets/resultsQuery.worker-DeSSHvCv.js`,``+import.meta.url),{type:`module`});return r.current=t,o(!1),_(!0),d([]),p(0),h(zh()),x(null),t.onmessage=e=>{let t=e.data;if(t.type===`ready`){o(!0),_(!1),h(t.summary);return}if(t.type===`query-result`){if(t.requestId!==i.current)return;d(t.rows),p(t.totalMatches),h(t.summary),y(!1);return}x(t.message),_(!1),y(!1)},t.postMessage({type:`init`,rows:e}),()=>{t.terminate(),r.current=null}},[e,n]),(0,c.useEffect)(()=>{if(!n||!a||r.current==null)return;let e=i.current+1;i.current=e,y(!0),x(null),r.current.postMessage({type:`query`,requestId:e,kind:t.kind,status:t.status,query:t.query,resourceTypes:Array.from(t.resourceTypes),threadIds:Array.from(t.threadIds),durationBand:t.durationBand,sortBy:t.sortBy,limit:s})},[n,a,s,t]),(0,c.useMemo)(()=>({rows:u,totalMatches:f,totalVisible:u.length,summary:m,hasMore:u.length<f,isIndexing:g,isLoading:v,error:b,loadMore:()=>l(e=>e+Rh)}),[u,f,m,g,v,b])}function Vh(e){return e.isScalar?0:1}function Hh(e){return`adapter:${e}`}function Uh(e){return e.startsWith(`adapter:`)}function Wh(e,t){return e.adapterResponseFields?.find(e=>e.key===t)}function Gh(e){let t=new Map;for(let n of e){let e=new Set;for(let r of n.adapterResponseFields??[]){if(e.has(r.key))continue;e.add(r.key);let n=t.get(r.key);n?n.presenceCount+=1:t.set(r.key,{field:r,presenceCount:1})}}let n=[...t.entries()].map(([e,t])=>({id:Hh(e),key:e,label:t.field.label,kind:t.field.kind,align:t.field.kind===`number`?`end`:`start`,isScalar:t.field.isScalar,presenceCount:t.presenceCount})).sort((e,t)=>{let n=Vh(e),r=Vh(t);return n===r?e.presenceCount===t.presenceCount?e.key.localeCompare(t.key):t.presenceCount-e.presenceCount:n-r});return{allColumns:n,visibleColumns:n.slice(0,6),overflowColumns:n.slice(6)}}function Kh(e,t){return t.map(t=>{let n=Wh(e,t.key);return`${t.label}: ${n?.displayValue??`—`}`}).join(`
|
|
31
|
-
`)}function qh({row:e,visibleColumns:t,overflowColumns:n,onNavigateTo:r}){if(!e)return null;let i=e.adapterResponseFields?.length??0,a=i>0?[...t.length>0?[{label:`Visible adapter fields`,value:Kh(e,t)}]:[],...n.length>0?[{label:`Overflow adapter fields`,value:Kh(e,n)}]:[],...t.length===0&&n.length===0?[{label:`Adapter response`,value:`This row has no adapter_response fields.`}]:[]]:[{label:`Adapter response`,value:`This row has no adapter_response fields.`}];return(0,u.jsx)(Ut,{eyebrow:`Selected run item`,title:e.name,typeLabel:Xe(e.resourceType),stats:[{label:`Status`,value:e.status},{label:`Duration`,value:Ye(e.executionTime)},{label:`Thread`,value:e.threadId??`n/a`},{label:`Adapter fields`,value:String(i)}],sections:a,actions:[{label:`Open in Timeline`,onClick:()=>r(`timeline`,{resourceId:e.uniqueId,executionId:e.uniqueId})},{label:`Open in Inventory`,onClick:()=>r(`inventory`,{resourceId:e.uniqueId,assetTab:`summary`})},{label:`Open in Lineage`,onClick:()=>r(`inventory`,{resourceId:e.uniqueId,assetTab:`lineage`,rootResourceId:e.uniqueId})}]})}function Jh(e){let t=[`minmax(280px, 2.5fr)`,`minmax(108px, 0.85fr)`,`minmax(132px, 0.95fr)`,`minmax(96px, 0.72fr)`],n=e.map(e=>e.align===`end`?`minmax(120px, 0.95fr)`:`minmax(148px, 1.1fr)`);return[...t,...n,`minmax(160px, 1fr)`].join(` `)}function Yh(e,t){return Wh(e,t.key)?.displayValue??`—`}function Xh({analysis:e,runsResults:t,runsViewState:n,resultsBodyRef:r,virtualizer:i,adapterColumns:a,onRunsViewStateChange:o,onInvestigationSelectionChange:s}){return(0,u.jsxs)(`div`,{className:`results-table`,style:{"--results-table-columns":Jh(a)},children:[(0,u.jsxs)(`div`,{className:`results-table__header`,children:[(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--item`,children:`Item`}),(0,u.jsx)(`div`,{className:`results-table__cell`,children:`Type`}),(0,u.jsx)(`div`,{className:`results-table__cell`,children:`Status`}),(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--align-end`,children:`Duration`}),a.map(e=>(0,u.jsx)(`div`,{className:`results-table__cell${e.align===`end`?` results-table__cell--align-end`:``}`,title:e.label,children:e.label},e.id)),(0,u.jsx)(`div`,{className:`results-table__cell`,children:`Thread`})]}),(0,u.jsx)(`div`,{ref:r,className:`results-table__body`,style:{height:Math.min(560,Math.max(120,t.rows.length*76)),overflowY:`auto`,position:`relative`},children:(0,u.jsx)(`div`,{style:{height:i.getTotalSize(),position:`relative`},children:i.getVirtualItems().map(r=>{let i=t.rows[r.index];return i?(0,u.jsxs)(`button`,{type:`button`,className:`results-table__row${i.uniqueId===n.selectedExecutionId?` results-table__row--active`:``}`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${r.start}px)`},onClick:()=>{let t=e.resources.find(e=>e.uniqueId===i.uniqueId)??null;o(e=>({...e,selectedExecutionId:i.uniqueId})),s(e=>({...e,selectedExecutionId:i.uniqueId,selectedResourceId:t?.uniqueId??i.uniqueId,sourceLens:`runs`}))},children:[(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--item`,"data-label":`Item`,title:i.name,children:(0,u.jsx)(`strong`,{children:i.name})}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Type`,title:i.resourceType,children:i.resourceType}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Status`,children:(0,u.jsx)(`span`,{className:$e(i.statusTone),children:i.status})}),(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--align-end`,"data-label":`Duration`,children:Ye(i.executionTime)}),a.map(e=>{let t=Yh(i,e);return(0,u.jsx)(`div`,{className:`results-table__cell${e.align===`end`?` results-table__cell--align-end`:``}`,"data-label":e.label,title:t,children:t},e.id)}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Thread`,title:i.threadId??`n/a`,children:i.threadId??`n/a`})]},i.uniqueId):null})})})]})}var Zh=[{label:`All`,countKey:`all`},{kind:`models`,label:`Models`,countKey:`models`},{kind:`tests`,label:`Tests`,countKey:`tests`},{kind:`seeds`,label:`Seeds`,countKey:`seeds`},{kind:`snapshots`,label:`Snapshots`,countKey:`snapshots`},{kind:`operations`,label:`Operations`,countKey:`operations`},{status:`positive`,label:`Healthy`,countKey:`healthy`},{status:`issues`,label:`Issues`,countKey:`issues`},{status:`warning`,label:`Warnings`,countKey:`warnings`},{status:`danger`,label:`Errors`,countKey:`errors`}];function Qh(e){return e.facets}function $h({runsViewState:e,runsResults:t,adapterColumnLayout:n,adapterMetricsAvailable:r,onRunsViewStateChange:i}){let a=n.visibleColumns.filter(e=>e.isScalar),o=e.showAdapterMetrics&&a.length>0;return(0,u.jsxs)(`div`,{className:`runs-toolbar runs-toolbar--stacked`,children:[(0,u.jsxs)(`div`,{className:`runs-toolbar__controls`,children:[(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact runs-toolbar__search`,children:[(0,u.jsx)(`span`,{children:`Search`}),(0,u.jsx)(`input`,{value:e.query,onChange:e=>i(t=>({...t,query:e.target.value})),placeholder:`Filter by name, type, status, thread…`})]}),(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact runs-toolbar__sort`,children:[(0,u.jsx)(`span`,{children:`Sort`}),(0,u.jsxs)(`select`,{value:e.sortBy,onChange:e=>i(t=>({...t,sortBy:e.target.value})),children:[(0,u.jsx)(`option`,{value:`attention`,children:`Attention`}),(0,u.jsx)(`option`,{value:`duration`,children:`Duration`}),(0,u.jsx)(`option`,{value:`name`,children:`Name`}),(0,u.jsx)(`option`,{value:`status`,children:`Status`}),(0,u.jsx)(`option`,{value:`start`,children:`Start`}),o?a.map(e=>(0,u.jsx)(`option`,{value:e.id,children:e.label},e.id)):null]})]}),(0,u.jsxs)(`label`,{className:`runs-toolbar__toggle`,title:r?`Show raw adapter_response columns derived from the current run`:`No adapter_response fields are available in this run`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.showAdapterMetrics,disabled:!r,onChange:e=>{let t=e.target.checked;i(e=>({...e,showAdapterMetrics:t,sortBy:!t&&Uh(e.sortBy)?`attention`:e.sortBy}))}}),(0,u.jsx)(`span`,{children:`Warehouse response`})]})]}),e.showAdapterMetrics&&n.overflowColumns.length>0?(0,u.jsxs)(`p`,{className:`runs-toolbar__meta`,children:[`Showing `,n.visibleColumns.length,` of`,` `,n.allColumns.length,` adapter fields. Select a row to inspect the remaining `,n.overflowColumns.length,`.`]}):null,(0,u.jsx)(`div`,{className:`runs-toolbar__facets`,children:Zh.map(n=>{let r=Qh(t.summary);return(0,u.jsxs)(`button`,{type:`button`,className:n.kind!=null&&e.kind===n.kind||n.status!=null&&e.status===n.status||n.kind==null&&n.status==null&&e.kind===`all`&&e.status===`all`?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>i(e=>({...e,kind:n.kind??`all`,status:n.status??`all`})),children:[n.label,` (`,r[n.countKey],`)`]},n.label)})})]})}function eg({analysis:e,runsViewState:t,onRunsViewStateChange:n,onInvestigationSelectionChange:r,onNavigateTo:i}){let a=(0,c.useRef)(null),o=(0,c.useMemo)(()=>Gh(e.executions),[e.executions]),l=o.allColumns.length>0,d=(0,c.useMemo)(()=>t.showAdapterMetrics&&l?o.visibleColumns:[],[o.visibleColumns,l,t.showAdapterMetrics]),f=(0,c.useMemo)(()=>t.showAdapterMetrics&&l?o.overflowColumns:[],[o.overflowColumns,l,t.showAdapterMetrics]);(0,c.useEffect)(()=>{let e=t.sortBy;Uh(e)&&!d.some(t=>t.id===e&&t.isScalar)&&n(e=>({...e,sortBy:`attention`}))},[n,t.sortBy,d]);let p=Bh(e.executions,t,!0),m=e.executions.find(e=>e.uniqueId===t.selectedExecutionId)??null,h=s({count:p.rows.length,getScrollElement:()=>a.current,estimateSize:()=>76,overscan:10});return(0,c.useEffect)(()=>{let e=a.current;if(!e)return;let t=()=>{e.scrollHeight-e.scrollTop-e.clientHeight<220&&p.hasMore&&!p.isLoading&&!p.isIndexing&&p.loadMore()};return e.addEventListener(`scroll`,t),t(),()=>e.removeEventListener(`scroll`,t)},[p]),(0,u.jsx)(Vt,{title:`Runs`,description:`Execution and quality evidence across models, tests, seeds, snapshots, and operations.`,toolbar:(0,u.jsx)($h,{runsViewState:t,runsResults:p,adapterColumnLayout:o,adapterMetricsAvailable:l,onRunsViewStateChange:n}),inspector:m?(0,u.jsx)(qh,{row:m,visibleColumns:d,overflowColumns:f,onNavigateTo:i}):null,className:`runs-view`,children:(0,u.jsx)(Xh,{analysis:e,runsResults:p,runsViewState:t,resultsBodyRef:a,virtualizer:h,adapterColumns:d,onRunsViewStateChange:n,onInvestigationSelectionChange:r})})}var $={resourceTypeSummaryAriaLabel:`Run outcomes for executed dbt assets (non-test resources such as models and sources), grouped by resource type. Counts are how many assets succeeded versus had warnings or failures. These are not dbt test pass or fail totals.`,resourceTypeSummaryTitle:`Run outcomes for executed dbt assets by type (excludes tests). Not dbt test pass or fail totals.`,resourceTypeSummaryItemTitle(e){return`${e}: executed asset run outcomes for this type, not dbt test totals.`},treeTestStatsTitle:`Attention-only rollup of executed dbt test outcomes for this folder or row: failed or errored, warning, and dbt-skipped. Passing tests and tests with no run result (not executed) are not shown here. A test that depends on multiple resources may be counted more than once in folder totals.`,treeTestStatsBranchAriaLabel:`Dbt test attention rollup for resources in this folder: failed or error, warning, and skipped counts only. Passing tests and not-executed tests are not shown. Tests with multiple upstream dependencies may be counted more than once when summed at higher folders.`,treeTestStatsLeafAriaLabel:`Dbt test attention outcomes for this resource: failed or error, warning, and skipped only. Passing tests and not-executed tests are not shown.`,treeTestStatErrorTitle(e){return`Failed or errored dbt test attachments: ${e}`},treeTestStatWarnTitle(e){return`Warning dbt test attachments: ${e}`},treeTestStatSkippedTitle(e){return`Dbt skipped or no-op test attachments: ${e}. Folder rollups may count one test multiple times when it depends on several resources.`},treeEmptyHeadline:`No resources found`,treeEmptyDefaultSubtext:`Adjust filters or search to find matching branches or assets.`,treeEmptySearchSubtext:`Try clearing or changing the resource search box.`,treeEmptyResourceTypesSubtext:`One or more dbt resource types are narrowed; add types or reset type filters to see more assets.`,treeEmptyExecutionFilterSubtext(e){switch(e){case`danger`:return`Execution status is Fail: only assets with a failed or errored result in this run are shown. Assets without a run row are treated as Not executed, not Fail. For models whose run succeeded but dbt tests failed, use Issues. Try Execution status All, or confirm run results are loaded for this workspace.`;case`issues`:return`Execution status is Issues: assets with a failed or errored run result, or with failed, warned, or skipped dbt test attachments in this run. Fail shows execution failures only.`;case`neutral`:return`Execution status is Not executed: only assets without a matching run result (or unknown status) are shown. Try All or confirm run results are loaded.`;case`positive`:return`Execution status is Success: only successful runs are shown. Try All or adjust other filters.`;case`warning`:return`Execution status is Warn: only warned runs are shown. Try All or adjust other filters.`;case`skipped`:return`Execution status is Skipped: only skipped runs are shown. Try All or adjust other filters.`;default:return``}},executionStatusSectionTitle:`Filter by run & tests`,executionStatusRunOutcomeSubLabel:`Run outcome`,executionStatusProblemsSubLabel:`Run + dbt tests`};function tg(e){switch(e){case`all`:return`All`;case`positive`:return`Success`;case`warning`:return`Warn`;case`danger`:return`Fail (run)`;case`skipped`:return`Skipped`;case`neutral`:return`Not executed`;case`issues`:return`Issues (run or tests)`;default:return e}}function ng(e){return e===`all`?`Show all assets regardless of run outcome or attached dbt test results.`:$.treeEmptyExecutionFilterSubtext(e)}function rg(e){let t=[];return e.status!==`all`&&t.push($.treeEmptyExecutionFilterSubtext(e.status)),e.resourceQuery.trim()&&t.push($.treeEmptySearchSubtext),e.activeResourceTypeCount>0&&t.push($.treeEmptyResourceTypesSubtext),t.length===0?$.treeEmptyDefaultSubtext:t.join(` `)}var ig=`dbt-tools.explorerFiltersExpanded`;function ag(){try{let e=window.localStorage.getItem(ig);if(e!==null)return e===`true`}catch{}return!1}function og({filtersExpanded:e,setFiltersExpandedPersisted:t,activeFilterCount:n,filterSummary:r,resourceQuery:i,setResourceQuery:a,status:o,setStatus:s,availableResourceTypes:c,activeResourceTypes:l,toggleResourceType:d}){return(0,u.jsxs)(`section`,{className:`explorer-filters`,"aria-label":`Explorer filters`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`explorer-filters__toggle`,"aria-expanded":e,onClick:()=>t(!e),children:[(0,u.jsxs)(`span`,{className:`explorer-filters__toggle-copy`,children:[(0,u.jsx)(`span`,{className:`explorer-filters__toggle-label`,children:`Filters`}),(0,u.jsx)(`span`,{className:`explorer-filters__toggle-summary`,children:r})]}),(0,u.jsxs)(`span`,{className:`explorer-filters__toggle-meta`,children:[n>0&&(0,u.jsx)(`span`,{className:`explorer-filters__badge`,children:n}),(0,u.jsx)(`span`,{className:`explorer-filters__chevron${e?` explorer-filters__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▾`})]})]}),e&&(0,u.jsxs)(`div`,{className:`explorer-filter-stack`,children:[(0,u.jsxs)(`label`,{className:`workspace-search`,children:[(0,u.jsx)(`span`,{children:`Search resources`}),(0,u.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:`Filter tree by name, path, type, or id`})]}),(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:$.executionStatusSectionTitle}),(0,u.jsxs)(`div`,{className:`explorer-status-filters`,children:[(0,u.jsxs)(`div`,{className:`explorer-status-filters__block`,children:[(0,u.jsx)(`span`,{className:`explorer-status-filters__sublabel`,id:`explorer-status-run-outcome-label`,children:$.executionStatusRunOutcomeSubLabel}),(0,u.jsx)(`div`,{className:`pill-row`,role:`group`,"aria-labelledby":`explorer-status-run-outcome-label`,children:[`all`,`positive`,`warning`,`danger`,`skipped`,`neutral`].map(e=>(0,u.jsx)(`button`,{type:`button`,className:o===e?`workspace-pill workspace-pill--active`:`workspace-pill`,title:ng(e),"aria-label":`${tg(e)}. ${ng(e)}`,onClick:()=>s(e),children:tg(e)},e))})]}),(0,u.jsxs)(`div`,{className:`explorer-status-filters__block explorer-status-filters__block--problems`,children:[(0,u.jsx)(`span`,{className:`explorer-status-filters__sublabel`,id:`explorer-status-problems-label`,children:$.executionStatusProblemsSubLabel}),(0,u.jsx)(`div`,{className:`pill-row`,role:`group`,"aria-labelledby":`explorer-status-problems-label`,children:(0,u.jsx)(`button`,{type:`button`,className:o===`issues`?`workspace-pill workspace-pill--active`:`workspace-pill`,title:ng(`issues`),"aria-label":`${tg(`issues`)}. ${ng(`issues`)}`,onClick:()=>s(`issues`),children:tg(`issues`)})})]})]})]}),c.length>0&&(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:`dbt resource type`}),(0,u.jsx)(`div`,{className:`pill-row`,children:c.map(e=>(0,u.jsx)(`button`,{type:`button`,className:l.size===0||l.has(e)?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>d(e),children:Xe(e)},e))})]})]})]})}function sg(e){let t=Xe(e.resourceType),n=An(e);return n?`${e.name}, ${t}, file ${n}`:`${e.name}, ${t}`}function cg({testStats:e,variant:t}){if(!Sn(e))return null;let n=t===`branch`?$.treeTestStatsBranchAriaLabel:$.treeTestStatsLeafAriaLabel;return(0,u.jsxs)(`span`,{className:`explorer-tree__test-stats-wrap`,role:`group`,"aria-label":n,title:$.treeTestStatsTitle,children:[(0,u.jsx)(`span`,{className:`explorer-tree__test-stats-label`,"aria-hidden":`true`,children:`Test issues`}),(0,u.jsxs)(`span`,{className:`explorer-tree__test-stats`,children:[e.error>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--fail`,title:$.treeTestStatErrorTitle(e.error),children:[`✗`,e.error]}),e.warn>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--warn`,title:$.treeTestStatWarnTitle(e.warn),children:[`!`,e.warn]}),e.skipped>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--skipped`,title:$.treeTestStatSkippedTitle(e.skipped),children:[`−`,e.skipped]})]})]})}function lg({virtualRow:e,measureRow:t,children:n}){return(0,u.jsx)(`div`,{"data-index":e.index,ref:t,className:`explorer-tree__virtual-row`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:n})}function ug({treeRows:e,explorerMode:t,expandedNodeIds:n,toggleExpandedNode:r,selectedResourceId:i,setSelectedResourceId:a,treeEmptyDisplay:o}){let l=(0,c.useRef)(null),d=s({count:e.length,getScrollElement:()=>l.current,estimateSize:()=>46,overscan:16}),f=d.measureElement;return e.length===0?(0,u.jsx)(`div`,{ref:l,className:`explorer-tree`,children:(0,u.jsx)(_t,{icon:`🔍`,headline:o?.headline??$.treeEmptyHeadline,subtext:o?.subtext??$.treeEmptyDefaultSubtext})}):(0,u.jsx)(`div`,{ref:l,className:`explorer-tree`,children:(0,u.jsx)(`div`,{className:`explorer-tree__virtual-spacer`,style:{height:d.getTotalSize(),width:`100%`,position:`relative`},children:d.getVirtualItems().map(o=>{let s=e[o.index];if(!s)return null;let{node:c,depth:l}=s;if(c.kind===`branch`){let e=n.has(c.id);return(0,u.jsx)(lg,{virtualRow:o,measureRow:f,children:(0,u.jsxs)(`button`,{type:`button`,className:`explorer-tree__row explorer-tree__row--branch`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>r(c.id),children:[(0,u.jsx)(`span`,{className:`explorer-tree__chevron${e?` explorer-tree__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▸`}),(0,u.jsx)(`span`,{className:`explorer-tree__folder`,"aria-hidden":`true`,children:(0,u.jsx)(Bt,{mode:t,depth:l})}),(0,u.jsx)(`span`,{className:`explorer-tree__label`,children:c.label}),c.testStats&&(0,u.jsx)(cg,{testStats:c.testStats,variant:`branch`})]})},o.key)}let d=c.resource;return(0,u.jsx)(lg,{virtualRow:o,measureRow:f,children:(0,u.jsxs)(`button`,{type:`button`,className:d.uniqueId===i?`explorer-tree__row explorer-tree__row--leaf explorer-tree__row--active`:`explorer-tree__row explorer-tree__row--leaf`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>a(d.uniqueId),title:d.uniqueId,"aria-label":sg(d),children:[(0,u.jsx)(`span`,{className:`explorer-tree__leaf-icon`,"aria-hidden":`true`,children:(0,u.jsx)(zt,{resourceType:d.resourceType})}),(0,u.jsx)(`span`,{className:`explorer-tree__resource-body`,children:(0,u.jsx)(`span`,{className:`explorer-tree__label`,children:d.name})}),c.testStats&&(0,u.jsx)(cg,{testStats:c.testStats,variant:`leaf`})]})},o.key)})})})}function dg({mode:e}){return e===`project`?(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,u.jsx)(`path`,{d:`M3.5 7.5h6l1.8 2h8.7v7.8a1.2 1.2 0 0 1-1.2 1.2H4.7a1.2 1.2 0 0 1-1.2-1.2V8.7a1.2 1.2 0 0 1 1.2-1.2Z`})}):e===`database`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:[(0,u.jsx)(`ellipse`,{cx:`12`,cy:`6.2`,rx:`6.5`,ry:`2.7`}),(0,u.jsx)(`path`,{d:`M5.5 6.2v5.6c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7V6.2`}),(0,u.jsx)(`path`,{d:`M5.5 11.8v5.8c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7v-5.8`})]}):null}function fg({resources:e}){let t=e.filter(e=>!z.has(e.resourceType)&&e.statusTone!==`neutral`);if(t.length===0)return null;let n=new Map;for(let e of t){let t=n.get(e.resourceType)??{pass:0,fail:0};e.statusTone===`positive`?t.pass++:(e.statusTone===`danger`||e.statusTone===`warning`)&&t.fail++,n.set(e.resourceType,t)}let r=Array.from(n.entries()).sort(([e],[t])=>e.localeCompare(t));return(0,u.jsx)(`div`,{className:`resource-type-summary`,"aria-label":$.resourceTypeSummaryAriaLabel,title:$.resourceTypeSummaryTitle,children:r.map(([e,{pass:t,fail:n}])=>{let r=Xe(e);return(0,u.jsxs)(`span`,{className:`resource-type-summary__item`,title:$.resourceTypeSummaryItemTitle(r),children:[(0,u.jsx)(`span`,{className:`resource-type-summary__type`,children:r}),t>0&&(0,u.jsxs)(`span`,{className:`resource-type-summary__pass`,children:[`✓`,t]}),n>0&&(0,u.jsxs)(`span`,{className:`resource-type-summary__fail`,children:[`✗`,n]})]},e)})})}function pg({treeRows:e,filteredResources:t,totalResources:n,matchedResources:r,explorerMode:i,setExplorerMode:a,status:o,setStatus:s,availableResourceTypes:l,activeResourceTypes:d,toggleResourceType:f,resourceQuery:p,setResourceQuery:m,selectedResourceId:h,expandedNodeIds:g,toggleExpandedNode:_,setSelectedResourceId:v}){let[y,b]=(0,c.useState)(ag),x=e=>{b(e);try{window.localStorage.setItem(ig,String(e))}catch{}},S=(p.trim()?1:0)+(o===`all`?0:1)+(d.size>0?1:0),C=S>0?`${S} active`:`Search, status, and type`;return(0,u.jsxs)(`aside`,{className:`explorer-pane`,children:[(0,u.jsxs)(`div`,{className:`explorer-pane__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Asset explorer`}),(0,u.jsx)(`h2`,{children:`Workspace inventory`})]}),(0,u.jsxs)(`div`,{className:`explorer-pane__count`,children:[r,r!==n&&(0,u.jsxs)(`span`,{className:`explorer-pane__count-subtext`,children:[`of `,n]})]})]}),(0,u.jsx)(`div`,{className:`explorer-mode-tabs`,role:`tablist`,"aria-label":`Explorer modes`,children:[`project`,`database`].map(e=>(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":i===e,className:i===e?`explorer-mode-tab explorer-mode-tab--active`:`explorer-mode-tab`,onClick:()=>a(e),children:[(0,u.jsx)(`span`,{className:`explorer-mode-tab__icon`,"aria-hidden":`true`,children:(0,u.jsx)(dg,{mode:e})}),qe[e]]},e))}),(0,u.jsx)(og,{filtersExpanded:y,setFiltersExpandedPersisted:x,activeFilterCount:S,filterSummary:C,resourceQuery:p,setResourceQuery:m,status:o,setStatus:s,availableResourceTypes:l,activeResourceTypes:d,toggleResourceType:f}),(0,u.jsx)(fg,{resources:t}),(0,u.jsx)(ug,{treeRows:e,explorerMode:i,expandedNodeIds:g,toggleExpandedNode:_,selectedResourceId:h,setSelectedResourceId:v,treeEmptyDisplay:e.length===0?{headline:$.treeEmptyHeadline,subtext:rg({status:o,resourceQuery:p,activeResourceTypeCount:d.size})}:void 0})]})}function mg(e,t,n,r,i,a,o){(0,c.useEffect)(()=>{if(e.length===0||a==null)return;let t=Vn(e,a);t.size!==0&&o(e=>[...t].filter(t=>!e.expandedNodeIds.has(t)).length===0?e:{...e,expandedNodeIds:new Set([...e.expandedNodeIds,...t])})},[e,o,a]),(0,c.useEffect)(()=>{if(i!==`project`||a!=null||e.length===0||n.size>0)return;let s=Fn(r);t.has(s)&&o(e=>e.explorerMode!==`project`||e.selectedResourceId!=null||e.expandedNodeIds.has(s)?e:{...e,expandedNodeIds:new Set([...e.expandedNodeIds,s])})},[t,i,n.size,e.length,o,r,a])}function hg(e){return e===`inventory`}function gg({analysis:e,projectName:t,activeView:n,assetViewState:r,onAssetViewStateChange:i,onInvestigationSelectionChange:a}){let o=(0,c.useMemo)(()=>r.explorerMode!==`project`||t==null?e.resources:e.resources.filter(e=>ct(e,t)),[e.resources,r.explorerMode,t]),s=(0,c.useMemo)(()=>Array.from(new Set(o.map(e=>e.resourceType))).sort(),[o]),l=(0,c.useMemo)(()=>Cn(o,e.dependencyIndex),[e.dependencyIndex,o]),d=(0,c.useMemo)(()=>o.filter(e=>rt(e,r.status,l)&&it(e,r.resourceTypes)&&nt(e,r.resourceQuery)),[r.resourceQuery,r.resourceTypes,r.status,l,o]),f=(0,c.useMemo)(()=>In(d,r.explorerMode,t,e.dependencyIndex),[e.dependencyIndex,r.explorerMode,d,t]),p=(0,c.useMemo)(()=>Rn(f),[f]),m=(0,c.useMemo)(()=>new Set([...r.expandedNodeIds].filter(e=>p.has(e))),[p,r.expandedNodeIds]),h=(0,c.useMemo)(()=>Ln(f,m),[m,f]),g=(0,c.useMemo)(()=>zn(f),[f]),_=r.selectedResourceId;return mg(f,p,m,t,r.explorerMode,_,i),{explorerPane:hg(n)?(0,u.jsx)(pg,{treeRows:h,filteredResources:d,totalResources:o.length,matchedResources:g.length,explorerMode:r.explorerMode,setExplorerMode:e=>i(t=>({...t,explorerMode:e})),status:r.status,setStatus:e=>i(t=>({...t,status:e})),availableResourceTypes:s,activeResourceTypes:r.resourceTypes,toggleResourceType:e=>i(t=>{let n=new Set(t.resourceTypes);return n.has(e)?n.delete(e):n.add(e),{...t,resourceTypes:n}}),resourceQuery:r.resourceQuery,setResourceQuery:e=>i(t=>({...t,resourceQuery:e})),selectedResourceId:_,expandedNodeIds:m,toggleExpandedNode:e=>i(t=>{let n=new Set(t.expandedNodeIds);return n.has(e)?n.delete(e):n.add(e),{...t,expandedNodeIds:n}}),setSelectedResourceId:e=>{i(t=>({...t,selectedResourceId:e})),a(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))}}):null}}function _g({analysis:e,activeView:t,analysisSource:n,overviewFilters:r,onOverviewFiltersChange:i,timelineFilters:a,onTimelineFiltersChange:o,assetViewState:s,onAssetViewStateChange:c,runsViewState:l,onRunsViewStateChange:d,lineageViewState:f,onLineageViewStateChange:p,onInvestigationSelectionChange:m,onNavigateTo:h,workspaceSignals:g}){let _=e.projectName??st(e.executions),{explorerPane:v}=gg({analysis:e,projectName:_,activeView:t,assetViewState:s,onAssetViewStateChange:c,onInvestigationSelectionChange:m}),y=s.selectedResourceId,b=e.resources.find(e=>e.uniqueId===y)??null;return(0,u.jsxs)(`div`,{className:`workspace-layout${v?``:` workspace-layout--full`}`,children:[v,(0,u.jsxs)(`div`,{className:`workspace-main-panel`,children:[t===`health`&&(0,u.jsx)(yn,{analysis:e,projectName:_,analysisSource:n,filters:r,setFilters:i,workspaceSignals:g}),t===`inventory`&&(0,u.jsx)(Up,{analysis:e,resource:b,onSelectResource:e=>c(t=>({...t,selectedResourceId:e})),assetViewState:{...s,selectedResourceId:y},onAssetViewStateChange:c,lineageViewState:f,onLineageViewStateChange:p,onInvestigationSelectionChange:m,onNavigateTo:h}),t===`runs`&&(0,u.jsx)(eg,{analysis:e,runsViewState:l,onRunsViewStateChange:d,onInvestigationSelectionChange:m,onNavigateTo:h}),t===`timeline`&&(0,u.jsx)(Lh,{analysis:e,filters:a,setFilters:o,onInvestigationSelectionChange:m})]})]})}var vg=(0,c.createContext)({toast:()=>{}}),yg=0,bg=4e3;function xg({children:e}){let[t,n]=(0,c.useState)([]),r=(0,c.useCallback)((e,t=`neutral`)=>{let r=++yg;n(n=>[...n,{id:r,message:e,tone:t}]),setTimeout(()=>{n(e=>e.filter(e=>e.id!==r))},bg)},[]);function i(e){n(t=>t.filter(t=>t.id!==e))}return(0,u.jsxs)(vg.Provider,{value:{toast:r},children:[e,t.length>0&&(0,u.jsx)(`div`,{className:`toast-portal`,role:`status`,"aria-live":`polite`,children:t.map(e=>(0,u.jsxs)(`div`,{className:`toast toast--${e.tone}`,children:[(0,u.jsx)(`span`,{className:`toast__dot`,"aria-hidden":`true`}),(0,u.jsx)(`span`,{className:`toast__message`,children:e.message}),(0,u.jsx)(`button`,{type:`button`,className:`toast__dismiss`,"aria-label":`Dismiss notification`,onClick:()=>i(e.id),children:`✕`})]},e.id))})]})}function Sg(){return(0,c.useContext)(vg)}function Cg({id:e,label:t,file:n,onFileChange:r}){return(0,u.jsxs)(`div`,{className:`file-input-card`,children:[(0,u.jsx)(`label`,{htmlFor:e,children:t}),(0,u.jsx)(`input`,{id:e,type:`file`,accept:`.json`,onChange:e=>r(e.target.files?.[0]??null)}),n&&(0,u.jsx)(`span`,{className:`file-input-card__filename`,children:n.name})]})}var wg=[{title:`Health-first overview`,body:`Spot failing nodes, long-running bottlenecks, and critical-path pressure before opening individual assets.`},{title:`Catalog-style context`,body:`Browse lineage-adjacent metadata such as descriptions, packages, execution status, and dependency depth in one flow.`},{title:`Timeline investigation`,body:`Shift from summary to execution sequencing without leaving the workspace, inspired by dbt docs and observability tools.`}];function Tg({onAnalysis:e,onError:t}){let{toast:n}=Sg(),[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)(null),[s,l]=(0,c.useState)(!1);async function d(){if(!r||!a){t(`Please select both manifest.json and run_results.json`);return}l(!0),t(null);try{let[t,i]=await Promise.all([r.arrayBuffer(),a.arrayBuffer()]),o=await C(t,i,`upload`);e(o),n(`Analyzed ${o.analysis.summary.total_nodes} executions successfully`,`positive`)}catch(e){let r=e instanceof Error?e.message:`Failed to parse artifacts`;t(r),n(`Parse failed — ${r}`,`danger`)}finally{l(!1)}}let f=r&&a&&!s,p=(0,c.useMemo)(()=>r&&a?`Ready to analyze`:r||a?`Waiting for one more file`:`Add both dbt artifacts to continue`,[r,a]);return(0,u.jsxs)(`section`,{className:`upload-hero`,children:[(0,u.jsxs)(`div`,{className:`upload-hero__copy`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Bring your artifacts`}),(0,u.jsx)(`h2`,{children:`Review dbt runs like a modern control plane, not a raw JSON dump.`}),(0,u.jsxs)(`p`,{children:[`Start from the two artifacts that power `,(0,u.jsx)(`code`,{children:`dbt docs`}),` and most run analysis workflows: a matching `,(0,u.jsx)(`code`,{children:`manifest.json`}),` and`,(0,u.jsx)(`code`,{children:` run_results.json`}),` pair.`]}),(0,u.jsxs)(`div`,{className:`upload-hero__callout`,children:[(0,u.jsx)(`span`,{className:`upload-hero__callout-badge`,children:`Recommended flow`}),(0,u.jsxs)(`strong`,{children:[`Run `,(0,u.jsx)(`code`,{children:`dbt docs generate`}),` after a representative job.`]}),(0,u.jsx)(`p`,{children:`That keeps lineage, metadata, and runtime results aligned so the workspace can feel closer to dbt Docs for discovery and closer to Elementary for health triage.`})]}),(0,u.jsx)(`div`,{className:`upload-feature-grid`,children:wg.map(e=>(0,u.jsxs)(`article`,{className:`upload-feature-card`,children:[(0,u.jsx)(`strong`,{children:e.title}),(0,u.jsx)(`p`,{children:e.body})]},e.title))})]}),(0,u.jsxs)(`div`,{className:`upload-panel`,children:[(0,u.jsxs)(`div`,{className:`upload-panel__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Artifact intake`}),(0,u.jsx)(`h3`,{children:`Open investigation workspace`})]}),(0,u.jsx)(`span`,{className:`upload-panel__status`,children:p})]}),(0,u.jsxs)(`div`,{className:`upload-panel__inputs`,children:[(0,u.jsx)(Cg,{id:`manifest-input`,label:`manifest.json`,file:r,onFileChange:i}),(0,u.jsx)(Cg,{id:`run-results-input`,label:`run_results.json`,file:a,onFileChange:o})]}),(0,u.jsxs)(`div`,{className:`upload-panel__tips`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`Best when files come from the same run.`}),(0,u.jsx)(`span`,{children:`Mismatched manifests and run results usually surface missing nodes or stale timings.`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`Use local outputs or DBT_TOOLS_TARGET_DIR.`}),(0,u.jsx)(`span`,{children:`The app supports both uploaded artifacts and auto-loaded local targets for faster iteration.`})]})]}),(0,u.jsxs)(`button`,{type:`button`,onClick:()=>{d()},disabled:!f,className:`primary-action`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:`0.5rem`},children:[s&&(0,u.jsx)(Pp,{size:16}),s?`Analyzing…`:`Analyze artifacts`]})]})]})}function Eg({className:e,style:t}){return(0,u.jsx)(`div`,{className:[`skeleton`,e].filter(Boolean).join(` `),style:t,"aria-hidden":`true`})}function Dg(){return(0,u.jsxs)(`div`,{className:`loading-card`,children:[(0,u.jsx)(Eg,{className:`loading-card__skeleton-icon`}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(Eg,{className:`loading-card__skeleton-title`}),(0,u.jsx)(Eg,{className:`loading-card__skeleton-body`})]})]})}var Og=`workspace-pill workspace-pill--active`,kg=`workspace-pill`;function Ag(e){return e?Og:kg}function jg({analysisSource:e,executionCount:t}){return(0,u.jsxs)(`section`,{className:`settings-hero`,"aria-label":`Workspace preferences`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace profile`}),(0,u.jsx)(`h3`,{children:`Configure how this console looks and behaves by default.`}),(0,u.jsx)(`p`,{children:`Changes save locally and apply to the current workspace immediately when the relevant view is open.`}),(0,u.jsxs)(`div`,{className:`settings-chip-row`,children:[(0,u.jsx)(`span`,{className:`app-badge`,children:k(e)}),(0,u.jsx)(`span`,{className:`settings-chip`,children:t==null?`No artifacts loaded`:`${t} executions loaded`})]})]})}function Mg({themePreference:e,onThemeChange:t}){return(0,u.jsx)(Lt,{title:`Appearance`,subtitle:`Choose how the workspace chrome should render by default.`,children:(0,u.jsxs)(`div`,{className:`settings-field-group`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Theme`}),(0,u.jsx)(`div`,{className:`settings-segmented`,children:[`system`,`light`,`dark`].map(n=>(0,u.jsx)(`button`,{type:`button`,className:Ag(e===n),onClick:()=>t(n),children:n===`system`?`System`:n.charAt(0).toUpperCase()+n.slice(1)},n))})]})})}function Ng({analysisSource:e,executionCount:t,onLoadDifferent:n,pendingRemoteRun:r,acceptingRemoteRun:i,onAcceptPendingRemoteRun:a}){return(0,u.jsx)(Lt,{title:`Session`,subtitle:`Current artifact source and data-loading controls.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-readout`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Current source`}),(0,u.jsx)(`strong`,{children:k(e)}),(0,u.jsx)(`p`,{children:t==null?`Load artifacts to unlock analysis views.`:`${t} executions are available in this session.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`primary-action settings-primary-action`,onClick:n,children:`Load different artifacts`}),r&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>void a(),disabled:i,children:i?`Switching…`:`Load ${r.label}`})]})})}function Pg({preferences:e,setPreferences:t}){return(0,u.jsx)(Lt,{title:`Shell Defaults`,subtitle:`Control the default shape of the workspace chrome.`,children:(0,u.jsxs)(`div`,{className:`settings-field-group`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Sidebar`}),(0,u.jsxs)(`div`,{className:`settings-segmented`,children:[(0,u.jsx)(`button`,{type:`button`,className:Ag(!e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!1})),children:`Expanded`}),(0,u.jsx)(`button`,{type:`button`,className:Ag(e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!0})),children:`Collapsed`})]})]})})}function Fg({preferences:e,setPreferences:t}){return(0,u.jsx)(Lt,{title:`Timeline Defaults`,subtitle:`Set the default execution timeline filters and dependency focus.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.showTests,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,showTests:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Show tests by default`})]}),(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.failuresOnly,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,failuresOnly:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Start with failures-only emphasis`})]})]}),(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Dependency direction`}),(0,u.jsxs)(`select`,{value:e.timelineDefaults.dependencyDirection,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDirection:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`upstream`,children:`Upstream`}),(0,u.jsx)(`option`,{value:`both`,children:`Both`}),(0,u.jsx)(`option`,{value:`downstream`,children:`Downstream`})]})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Dependency depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.timelineDefaults.dependencyDepthHops,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDepthHops:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]})]})})}function Ig({preferences:e,setPreferences:t}){return(0,u.jsx)(Lt,{title:`Inventory Defaults`,subtitle:`Choose how asset exploration and lineage open by default.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Explorer mode`}),(0,u.jsxs)(`select`,{value:e.inventoryDefaults.explorerMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,explorerMode:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`project`,children:`Project`}),(0,u.jsx)(`option`,{value:`database`,children:`Database`})]})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Lineage lens`}),(0,u.jsxs)(`select`,{value:e.inventoryDefaults.lineageLensMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageLensMode:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`type`,children:`Type`}),(0,u.jsx)(`option`,{value:`status`,children:`Status`}),(0,u.jsx)(`option`,{value:`coverage`,children:`Coverage`})]})]})]}),(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Upstream depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageUpstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageUpstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Downstream depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageDownstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageDownstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]}),(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.inventoryDefaults.allDepsMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,allDepsMode:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Open lineage with all dependencies expanded`})]})]})})}function Lg({preferences:e,setPreferences:t,themePreference:n,setThemePreference:r,analysisSource:i,executionCount:a,onLoadDifferent:o,pendingRemoteRun:s,acceptingRemoteRun:c,onAcceptPendingRemoteRun:l}){return(0,u.jsx)(Vt,{title:`Settings`,description:`Workspace defaults, visual preferences, and session controls.`,className:`settings-view`,children:(0,u.jsxs)(`div`,{className:`settings-grid`,children:[(0,u.jsx)(jg,{analysisSource:i,executionCount:a}),(0,u.jsx)(Mg,{themePreference:n,onThemeChange:e=>{r(e),t(t=>({...t,theme:e}))}}),(0,u.jsx)(Ng,{analysisSource:i,executionCount:a,onLoadDifferent:o,pendingRemoteRun:s,acceptingRemoteRun:c,onAcceptPendingRemoteRun:l}),(0,u.jsx)(Pg,{preferences:e,setPreferences:t}),(0,u.jsx)(Fg,{preferences:e,setPreferences:t}),(0,u.jsx)(Ig,{preferences:e,setPreferences:t})]})})}function Rg({kind:e}){let t={fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`};return e===`invocation`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{...t,d:`M20 12.5V7a2 2 0 0 0-2-2h-6.2a2 2 0 0 0-1.4.58l-4.82 4.82A2 2 0 0 0 5 11.82V17a2 2 0 0 0 2 2h5.5`}),(0,u.jsx)(`path`,{...t,d:`M9 5v4a2 2 0 0 1-2 2H5`}),(0,u.jsx)(`circle`,{...t,cx:`17.5`,cy:`17.5`,r:`3.5`})]}):e===`time`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`circle`,{...t,cx:`12`,cy:`12`,r:`8`}),(0,u.jsx)(`path`,{...t,d:`M12 7.8v4.6l3 1.8`})]}):e===`project`?(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{...t,d:`M3.5 8.5a2 2 0 0 1 2-2h3l1.4 1.7h8.6a2 2 0 0 1 2 2v7.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z`})}):(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{...t,d:`M11.25 4.75 5.5 7.7v4.55c0 3.65 2.7 6.95 6.5 7.95 3.8-1 6.5-4.3 6.5-7.95V7.7z`}),(0,u.jsx)(`path`,{...t,d:`M9.4 12.15 11.2 14l3.35-3.45`})]})}function zg(e,t){let n=e?.projectName??null,r=e?.invocationId??null,i=e?.warehouseType??null,a=e?Qe(e):null,o=a==null?null:Ze(a);return{label:n??`Workspace session`,subtitle:n==null&&r==null&&o==null?`Load artifacts to populate session details.`:null,summaryItems:[r?{key:`invocation`,label:`Invocation ID`,value:r,icon:`invocation`}:null,o?{key:`timestamp`,label:`Timestamp`,value:o,icon:`time`}:null,{key:`source`,label:`Source mode`,value:k(t),icon:`source`},i?{key:`warehouse`,label:`Warehouse type`,value:i.charAt(0).toUpperCase()+i.slice(1),icon:`project`}:null].filter(e=>e!=null)}}function Bg({summaryItems:e}){return(0,u.jsx)(`div`,{className:`app-header__summary-grid`,"aria-label":`Session metadata`,children:e.map(e=>(0,u.jsxs)(`div`,{className:`app-header__summary-item`,children:[(0,u.jsx)(`span`,{className:`app-header__summary-icon`,children:(0,u.jsx)(Rg,{kind:e.icon})}),(0,u.jsxs)(`span`,{className:`app-header__summary-copy`,children:[(0,u.jsx)(`span`,{className:`app-header__summary-label`,children:e.label}),(0,u.jsx)(`strong`,{className:`app-header__summary-value`,children:e.value})]})]},e.key))})}function Vg({header:e}){return(0,u.jsxs)(`div`,{className:`app-header__identity`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,title:e.label,children:e.label}),e.subtitle?(0,u.jsx)(`p`,{className:`app-header__subheadline`,children:e.subtitle}):null,(0,u.jsx)(Bg,{summaryItems:e.summaryItems})]})}function Hg({analysis:e,searchState:t,setSearchState:n,omniboxResults:r,handleNavigateTo:i}){let a=t.query.trim().length>0;return(0,u.jsxs)(`div`,{className:`app-header__omnibox`,children:[(0,u.jsx)(`label`,{className:`app-header__search-control`,children:(0,u.jsxs)(`div`,{className:`app-header__search-shell`,children:[(0,u.jsxs)(`svg`,{className:`workspace-search__icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`circle`,{cx:`11`,cy:`11`,r:`6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,u.jsx)(`path`,{d:`M16 16l4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})]}),(0,u.jsx)(`input`,{value:t.query,onFocus:()=>n(e=>({...e,isOpen:!0})),onChange:e=>n(t=>({...t,query:e.target.value,isOpen:!0})),placeholder:`Search runs, pipelines, assets...`,"aria-label":`Global search`})]})}),t.isOpen&&e&&(0,u.jsx)(`div`,{className:`omnibox-results`,children:r.loading&&a?(0,u.jsx)(`div`,{className:`omnibox-results__empty`,children:`Searching…`}):r.results.length>0?r.results.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`omnibox-results__item`,onClick:()=>{n(t=>({...t,isOpen:!1,recentResourceIds:[e.uniqueId,...t.recentResourceIds.filter(t=>t!==e.uniqueId)].slice(0,8)})),i(`inventory`,{resourceId:e.uniqueId,assetTab:`summary`})},children:[(0,u.jsx)(`strong`,{children:e.name}),(0,u.jsx)(`span`,{children:e.resourceType})]},e.uniqueId)):(0,u.jsx)(`div`,{className:`omnibox-results__empty`,children:a?`No matching resources`:`Recent items will appear here`})})]})}function Ug({activeView:e,analysis:t,analysisSource:n,preloadLoading:r,pendingRemoteRun:i,acceptingRemoteRun:a,preferences:o,setPreferences:s,themePreference:c,setThemePreference:l,onLoadDifferent:d,onAnalysis:f,onError:p,onAcceptPendingRemoteRun:m,workspaceSignals:h,overviewFilters:g,setOverviewFilters:_,timelineFilters:v,setTimelineFilters:y,assetViewState:b,setAssetViewState:x,runsViewState:S,setRunsViewState:C,lineageViewState:w,setLineageViewState:T,setInvestigationSelection:E,handleNavigateTo:D}){return e===`settings`?(0,u.jsx)(Lg,{preferences:o,setPreferences:s,themePreference:c,setThemePreference:l,analysisSource:n,executionCount:t?.summary.total_nodes??null,onLoadDifferent:d,pendingRemoteRun:i,acceptingRemoteRun:a,onAcceptPendingRemoteRun:m}):t?(0,u.jsx)(_g,{analysis:t,activeView:e,analysisSource:n,overviewFilters:g,onOverviewFiltersChange:_,timelineFilters:v,onTimelineFiltersChange:y,assetViewState:b,onAssetViewStateChange:x,runsViewState:S,onRunsViewStateChange:C,lineageViewState:w,onLineageViewStateChange:T,onInvestigationSelectionChange:E,onNavigateTo:D,workspaceSignals:h}):r?(0,u.jsx)(Dg,{}):(0,u.jsx)(Tg,{onAnalysis:f,onError:p})}function Wg({workspace:e,analysis:t,analysisSource:n,error:r,preloadLoading:i,pendingRemoteRun:a,acceptingRemoteRun:o,onLoadDifferent:s,onAnalysis:c,onError:l,onAcceptPendingRemoteRun:f,themePreference:p,setThemePreference:m,preferences:h,setPreferences:g,workspaceSignals:_}){let{activeView:v,sidebarCollapsed:y,setSidebarCollapsed:b,sidebarOpen:x,setSidebarOpen:S,overviewFilters:C,setOverviewFilters:w,timelineFilters:T,setTimelineFilters:E,assetViewState:D,setAssetViewState:k,runsViewState:A,setRunsViewState:ee,lineageViewState:j,setLineageViewState:M,searchState:te,setSearchState:N,setInvestigationSelection:P,setNavigationTarget:F,handleNavigateTo:I,frameClass:ne}=e,re=O(t,te),ie=zg(t,n);return(0,u.jsxs)(`div`,{className:ne,children:[x&&(0,u.jsx)(`div`,{className:`sidebar-backdrop`,role:`presentation`,onClick:()=>S(!1)}),(0,u.jsx)(ve,{activeView:v,setNavigationTarget:F,sidebarCollapsed:y,setSidebarCollapsed:b,onNavigate:()=>S(!1),analysis:t,analysisSource:n}),(0,u.jsxs)(`main`,{className:`app-main`,children:[(0,u.jsxs)(`header`,{className:`app-header app-header--workspace`,children:[(0,u.jsx)(`button`,{type:`button`,className:`hamburger-btn`,"aria-label":`Open navigation`,"aria-expanded":x,"aria-controls":`app-sidebar`,onClick:()=>S(!0),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`☰`})}),(0,u.jsx)(Vg,{header:ie}),(0,u.jsx)(Hg,{analysis:t,searchState:te,setSearchState:N,omniboxResults:re,handleNavigateTo:I})]}),r&&(0,u.jsx)(d,{message:r}),(0,u.jsx)(ye,{pendingRemoteRun:a,acceptingRemoteRun:o,onAcceptPendingRemoteRun:f}),(0,u.jsx)(Ug,{activeView:v,analysis:t,analysisSource:n,preloadLoading:i,pendingRemoteRun:a,acceptingRemoteRun:o,preferences:h,setPreferences:g,themePreference:p,setThemePreference:m,onLoadDifferent:s,onAnalysis:c,onError:l,onAcceptPendingRemoteRun:f,workspaceSignals:_,overviewFilters:C,setOverviewFilters:w,timelineFilters:T,setTimelineFilters:E,assetViewState:D,setAssetViewState:k,runsViewState:A,setRunsViewState:ee,lineageViewState:j,setLineageViewState:M,setInvestigationSelection:P,handleNavigateTo:I})]})]})}function Gg(e,t,n){return t===`preload`?{value:`Live target`,detail:`Synced from DBT_TOOLS_TARGET_DIR with ${e.graphSummary.totalEdges} dependency edges ready for investigation.`}:t===`remote`?{value:`Remote source`,detail:`Managed from remote object storage with ${e.graphSummary.totalEdges} dependency edges ready for investigation.`}:{value:`Artifact upload`,detail:`${e.summary.total_nodes} executions loaded from local artifacts${n>0?`, including ${n} tests`:``}.`}}function Kg(e,t){let n=e.executions.filter(e=>e.statusTone===`danger`).length,r=e.executions.filter(e=>e.statusTone===`warning`).length,i=e.executions.filter(e=>[`test`,`unit_test`].includes(e.resourceType)).length,a=e.resources.filter(e=>!!e.description?.trim()).length,o=e.resources.length>0?Math.round(a/e.resources.length*100):0,s=Gg(e,t,i);return[{label:`Run posture`,value:n>0?`${n} failing`:r>0?`${r} warning`:`Healthy`,detail:n>0?`Prioritize failing nodes before reviewing downstream impact.`:r>0?`Warnings detected; review tests and exposures next.`:`No failing nodes surfaced in this run.`,tone:n>0?`danger`:r>0?`warning`:`positive`},{label:`Metadata coverage`,value:`${o}%`,detail:`${a} of ${e.resources.length} resources include descriptions for catalog-style discovery.`,tone:o>=70?`positive`:o>=35?`warning`:`neutral`},{label:`Workspace mode`,value:s.value,detail:s.detail,tone:`neutral`}]}var qg=[`/api/manifest.json`,`/api/run_results.json`],Jg=[[`/api/artifacts/current/manifest.json`,`/api/artifacts/current/run_results.json`],qg];function Yg(){return{checkedAtMs:Date.now(),remoteProvider:null,remoteLocation:null,pollIntervalMs:null,currentRun:null,pendingRun:null,supportsSwitch:!1}}function Xg(e,t,n){return{mode:e,currentSource:t,label:n,...Yg()}}async function Zg(e){let t=await fetch(e);return t.ok?t.arrayBuffer():null}async function Qg(e,t){let[n,r]=await Promise.all([Zg(e),Zg(t)]);return n==null||r==null?null:{manifestBytes:n,runResultsBytes:r}}async function $g(e=Jg){for(let[t,n]of e){let e=await Qg(t,n);if(e!=null)return e}return null}async function e_(){let e=await $g([qg]);return e==null?null:C(e.manifestBytes,e.runResultsBytes,`preload`)}async function t_(){let e=await e_();return{status:Xg(e==null?`none`:`preload`,e==null?null:`preload`,e==null?`Waiting for artifacts`:`Live target`),result:e}}async function n_(){let e=await fetch(`/api/artifact-source`);if(!e.ok)throw Error(`Failed to load artifact source status`);return await e.json()}async function r_(e=`preload`){let t=await $g();return t==null?null:C(t.manifestBytes,t.runResultsBytes,e)}async function i_(){let e;try{e=await fetch(`/api/artifact-source`)}catch{return t_()}if(e.status===404||!e.ok)return t_();let t;try{t=await e.json()}catch{return t_()}return t.currentSource==null?{status:t,result:null}:{status:t,result:await r_(t.currentSource)}}async function a_(e){let t=await fetch(`/api/artifact-source/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?{runId:e}:{})});if(!t.ok)throw Error(`Failed to switch artifact source run`);return await t.json()}function o_({setPreloadLoading:e,setAnalysis:t,setAnalysisSource:n,setPendingRemoteRun:r,setRemotePollIntervalMs:i,setError:a,pendingMetricsRef:o}){let s=(0,c.useRef)(!1);(0,c.useEffect)(()=>{s.current||(s.current=!0,p(`Preload: fetching current managed artifacts`),i_().then(({result:s,status:c})=>{e(!1),r(c.pendingRun),i(c.pollIntervalMs),s?(p(`Preload: success, analysis loaded`),o.current=s.metrics,t(s.analysis),n(c.currentSource),a(null)):n(c.currentSource)}).catch(t=>{e(!1),p(`Preload: error`,t),a(t instanceof Error?t.message:`Failed to load artifacts from server`)}))},[o,e,t,n,r,i,a])}function s_(e,t,n,r){(0,c.useEffect)(()=>{},[e,r,t,n])}function c_(e,t,n,r){(0,c.useEffect)(()=>{if(e!==`remote`){t(null),n(null);return}let i=!1,a=async()=>{try{let e=await n_();i||(t(e.pendingRun),n(e.pollIntervalMs))}catch(e){p(`Artifact source poll failed`,e)}};a();let o=window.setInterval(()=>{a()},r??3e4);return()=>{i=!0,window.clearInterval(o)}},[e,r,t,n])}function l_(){let[e,t]=(0,c.useState)(null),[n,r]=(0,c.useState)(null),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!0),[l,u]=(0,c.useState)(null),[d,f]=(0,c.useState)(!1),[g,_]=(0,c.useState)(null),v=(0,c.useRef)(null);return o_({setPreloadLoading:s,setAnalysis:t,setAnalysisSource:a,setPendingRemoteRun:u,setRemotePollIntervalMs:_,setError:r,pendingMetricsRef:v}),s_(i,t,r,v),c_(i,u,_,g),(0,c.useEffect)(()=>{if(e==null||v.current==null)return;let t=v.current;v.current=null,requestAnimationFrame(()=>{let e=`analysis-load:${t.requestId}:interactive`,n=`analysis-load:${t.requestId}:first-interactive-frame`;m(e),h(n,t.dispatchMarkName,e),p(`Analysis load metrics`,{requestId:t.requestId,source:t.source,timings:t.timings})})},[e]),{analysis:e,analysisSource:i,error:n,preloadLoading:o,pendingRemoteRun:l,acceptingRemoteRun:d,onLoadDifferent:()=>{t(null),a(null),u(null),_(null),r(null)},onAnalysis:e=>{v.current=e.metrics,a(`upload`),u(null),t(e.analysis)},onError:r,onAcceptPendingRemoteRun:async()=>{if(l!=null){f(!0);try{let e=await a_(l.runId),n=await r_(`remote`);n!=null&&(v.current=n.metrics,t(n.analysis),a(e.currentSource),_(e.pollIntervalMs),r(null)),u(e.pendingRun)}catch(e){r(e instanceof Error?e.message:`Failed to switch remote artifact run`)}finally{f(!1)}}}}}var u_=`dbt-tools.workspacePreferences`,d_={theme:`system`,sidebarCollapsedDefault:!0,timelineDefaults:{showTests:!1,failuresOnly:!1,dependencyDirection:`both`,dependencyDepthHops:2},inventoryDefaults:{explorerMode:`project`,lineageLensMode:`type`,lineageUpstreamDepth:2,lineageDownstreamDepth:2,allDepsMode:!1}};function f_(e,t){return typeof e!=`number`||!Number.isFinite(e)?t:Math.max(1,Math.min(10,Math.round(e)))}function p_(e){return e===`upstream`||e===`both`||e===`downstream`}function m_(e){return e===`project`||e===`database`}function h_(e){return e===`status`||e===`type`||e===`coverage`}function g_(e){return e===`light`||e===`dark`||e===`system`}function __(e){if(!e)return d_;try{let t=JSON.parse(e);return{theme:g_(t.theme)?t.theme:d_.theme,sidebarCollapsedDefault:typeof t.sidebarCollapsedDefault==`boolean`?t.sidebarCollapsedDefault:d_.sidebarCollapsedDefault,timelineDefaults:{showTests:typeof t.timelineDefaults?.showTests==`boolean`?t.timelineDefaults.showTests:d_.timelineDefaults.showTests,failuresOnly:typeof t.timelineDefaults?.failuresOnly==`boolean`?t.timelineDefaults.failuresOnly:d_.timelineDefaults.failuresOnly,dependencyDirection:p_(t.timelineDefaults?.dependencyDirection)?t.timelineDefaults.dependencyDirection:d_.timelineDefaults.dependencyDirection,dependencyDepthHops:f_(t.timelineDefaults?.dependencyDepthHops,d_.timelineDefaults.dependencyDepthHops)},inventoryDefaults:{explorerMode:m_(t.inventoryDefaults?.explorerMode)?t.inventoryDefaults.explorerMode:d_.inventoryDefaults.explorerMode,lineageLensMode:h_(t.inventoryDefaults?.lineageLensMode)?t.inventoryDefaults.lineageLensMode:d_.inventoryDefaults.lineageLensMode,lineageUpstreamDepth:f_(t.inventoryDefaults?.lineageUpstreamDepth,d_.inventoryDefaults.lineageUpstreamDepth),lineageDownstreamDepth:f_(t.inventoryDefaults?.lineageDownstreamDepth,d_.inventoryDefaults.lineageDownstreamDepth),allDepsMode:typeof t.inventoryDefaults?.allDepsMode==`boolean`?t.inventoryDefaults.allDepsMode:d_.inventoryDefaults.allDepsMode}}}catch{return d_}}function v_(){let[e,t]=(0,c.useState)(()=>{try{return __(window.localStorage.getItem(u_))}catch{return d_}});return(0,c.useEffect)(()=>{try{window.localStorage.setItem(u_,JSON.stringify(e))}catch{}},[e]),{preferences:e,setPreferences:t}}var y_=(e,t)=>({activeTab:ie(e),expandedNodeIds:new Set,explorerMode:t?.inventoryDefaults.explorerMode??`project`,status:`all`,resourceTypes:new Set,resourceQuery:``,selectedResourceId:I(e),upstreamDepth:ce(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:le(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:ue(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:se(e)??t?.inventoryDefaults.lineageLensMode??`type`,activeLegendKeys:new Set}),b_=e=>{let t=F(e);return{kind:ae(e)??`all`,status:`all`,query:``,resourceTypes:new Set,threadIds:new Set,durationBand:`all`,sortBy:`attention`,groupBy:`none`,selectedExecutionId:t===`runs`?ne(e):null,showAdapterMetrics:t===`runs`?oe(e):!1}},x_=(e,t)=>{let n=F(e),r=n===`runs`||n===`timeline`?ne(e):null;return{query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:r,showTests:t?.timelineDefaults.showTests??!1,failuresOnly:t?.timelineDefaults.failuresOnly??!1,dependencyDirection:t?.timelineDefaults.dependencyDirection??`both`,dependencyDepthHops:t?.timelineDefaults.dependencyDepthHops??2,timeWindow:null}},S_=e=>{let t=F(e)??`health`,n=I(e),r=ne(e);return{selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:null}};function C_(e,t){return{activeView:F(e)??`health`,assetViewState:y_(e,t),runsViewState:b_(e),timelineFilters:x_(e,t),lineageViewState:{...fe(e),upstreamDepth:ce(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:le(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:ue(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:se(e)??t?.inventoryDefaults.lineageLensMode??`type`},investigationSelection:S_(e)}}function w_(e){let t=F(e),n=I(e),r=ne(e);return{activeView:t??void 0,assetViewState:t=>({...t,selectedResourceId:n,activeTab:ie(e)}),runsViewState:n=>({...n,kind:ae(e)??n.kind,selectedExecutionId:t===`runs`?r:null,showAdapterMetrics:t===`runs`?oe(e):n.showAdapterMetrics}),timelineFilters:e=>({...e,selectedExecutionId:t===`timeline`?r:null}),lineageViewState:fe(e),investigationSelection:e=>({...e,selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:e.sourceLens})}}var T_=[`resource`,`assetTab`,`selected`,`kind`,`adapter`,`up`,`down`,`allDeps`,`lens`];function E_(e,t){for(let n of T_)t?.has(n)||e.searchParams.delete(n)}function D_(e,t,n){t.selectedResourceId?e.searchParams.set(`resource`,t.selectedResourceId):e.searchParams.delete(`resource`),e.searchParams.set(`assetTab`,t.activeTab),e.searchParams.delete(`kind`),t.activeTab===`lineage`?(n.selectedResourceId?e.searchParams.set(`selected`,n.selectedResourceId):e.searchParams.delete(`selected`),e.searchParams.set(`up`,String(n.upstreamDepth)),e.searchParams.set(`down`,String(n.downstreamDepth)),e.searchParams.set(`allDeps`,n.allDepsMode?`1`:`0`),e.searchParams.set(`lens`,n.lensMode)):E_(e,new Set([`resource`,`assetTab`]))}function O_(e,t){e.searchParams.set(`kind`,t.kind),t.selectedExecutionId?e.searchParams.set(`selected`,t.selectedExecutionId):e.searchParams.delete(`selected`),t.showAdapterMetrics?e.searchParams.delete(`adapter`):e.searchParams.set(`adapter`,`0`),E_(e,new Set([`kind`,`selected`,`adapter`]))}function k_(e,t){t?e.searchParams.set(`selected`,t):e.searchParams.delete(`selected`),E_(e,new Set([`selected`]))}function A_(e){let{pathname:t,hash:n,activeView:r,assetViewState:i,runsViewState:a,timelineSelectedExecutionId:o,lineageViewState:s}=e,c=new URL(`http://local.invalid${t}${n}`);return c.searchParams.set(`view`,r),r===`inventory`?D_(c,i,s):r===`runs`?O_(c,a):r===`timeline`?k_(c,o):E_(c),`${t}${c.search}${n}`}function j_(e){let t=(0,c.useRef)(!1),n=C_(window.location.search,e),[r,i]=(0,c.useState)(()=>n.activeView),[a,o]=(0,c.useState)(()=>me(e.sidebarCollapsedDefault)),[s,l]=(0,c.useState)(!1),[u,d]=(0,c.useState)({status:`all`,resourceTypes:new Set,query:``}),[f,p]=(0,c.useState)(()=>n.timelineFilters),[m,h]=(0,c.useState)(()=>n.assetViewState),[g,_]=(0,c.useState)(()=>n.runsViewState),[v,y]=(0,c.useState)(()=>n.lineageViewState),[b,x]=(0,c.useState)({query:``,recentResourceIds:[],isOpen:!1}),[S,C]=(0,c.useState)(()=>n.investigationSelection),w=(0,c.useCallback)(e=>{o(t=>{let n=e(t);try{window.localStorage.setItem(pe,String(n))}catch{}return n})},[]),T=(0,c.useCallback)(e=>{i(e.view===`search`?`inventory`:e.view)},[]),E=(0,c.useCallback)((e,t)=>{i(e),t?.resourceId?(h(e=>({...e,selectedResourceId:t.resourceId??e.selectedResourceId,activeTab:t.assetTab??e.activeTab})),y(e=>({...e,rootResourceId:t.rootResourceId??t.resourceId??e.rootResourceId,selectedResourceId:t.resourceId??e.selectedResourceId}))):t?.assetTab&&e===`inventory`&&h(e=>({...e,activeTab:t.assetTab??e.activeTab})),t?.executionId&&(_(e=>({...e,selectedExecutionId:t.executionId??e.selectedExecutionId})),p(e=>({...e,selectedExecutionId:t.executionId??e.selectedExecutionId}))),e===`runs`&&t?.resourceId&&_(e=>({...e,query:t.resourceId??e.query})),C(n=>({selectedResourceId:t?.resourceId??n.selectedResourceId,selectedExecutionId:t?.executionId??n.selectedExecutionId,sourceLens:e}))},[]);return(0,c.useEffect)(()=>{let e=A_({pathname:window.location.pathname,hash:window.location.hash,activeView:r,assetViewState:m,runsViewState:g,timelineSelectedExecutionId:f.selectedExecutionId,lineageViewState:v});e!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.pushState(null,``,e)},[r,m,g,f.selectedExecutionId,v]),(0,c.useEffect)(()=>{let e=()=>{let e=w_(window.location.search);e.activeView!==void 0&&i(e.activeView),h(t=>e.assetViewState(t)),_(t=>e.runsViewState(t)),p(t=>e.timelineFilters(t)),y(e.lineageViewState),C(t=>e.investigationSelection(t))};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,c.useEffect)(()=>{if(!t.current){t.current=!0;return}p(t=>({...t,showTests:e.timelineDefaults.showTests,failuresOnly:e.timelineDefaults.failuresOnly,dependencyDirection:e.timelineDefaults.dependencyDirection,dependencyDepthHops:e.timelineDefaults.dependencyDepthHops})),h(t=>({...t,explorerMode:e.inventoryDefaults.explorerMode})),y(t=>({...t,upstreamDepth:e.inventoryDefaults.lineageUpstreamDepth,downstreamDepth:e.inventoryDefaults.lineageDownstreamDepth,allDepsMode:e.inventoryDefaults.allDepsMode,lensMode:e.inventoryDefaults.lineageLensMode})),o(e.sidebarCollapsedDefault);try{window.localStorage.setItem(pe,String(e.sidebarCollapsedDefault))}catch{}},[e]),(0,c.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),x(e=>({...e,isOpen:!0}))),e.key===`Escape`&&(l(!1),x(e=>({...e,isOpen:!1})))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),{activeView:r,sidebarCollapsed:a,setSidebarCollapsed:w,sidebarOpen:s,setSidebarOpen:l,overviewFilters:u,setOverviewFilters:d,timelineFilters:f,setTimelineFilters:p,assetViewState:m,setAssetViewState:h,runsViewState:g,setRunsViewState:_,lineageViewState:v,setLineageViewState:y,searchState:b,setSearchState:x,investigationSelection:S,setInvestigationSelection:C,setNavigationTarget:T,handleNavigateTo:E,frameClass:[`app-frame`,a?`app-frame--sidebar-collapsed`:``,s?`app-frame--nav-open`:``].filter(Boolean).join(` `)}}function M_(){let{toast:e}=Sg(),{preferences:t,setPreferences:n}=v_(),r=j_(t),{analysis:i,analysisSource:a,error:o,preloadLoading:s,pendingRemoteRun:l,acceptingRemoteRun:d,onLoadDifferent:f,onAnalysis:p,onError:m,onAcceptPendingRemoteRun:h}=l_(),{themePreference:g,setThemePreference:_}=At();(0,c.useEffect)(()=>{t.theme!==g&&_(t.theme)},[t.theme,_,g]);let v=(0,c.useRef)(null);(0,c.useEffect)(()=>{i&&!v.current&&a===`preload`&&e(`Workspace loaded — ${i.summary.total_nodes} executions`,`positive`),i&&!v.current&&a===`remote`&&e(`Remote workspace loaded — ${i.summary.total_nodes} executions`,`positive`),v.current=i},[i,a,e]);let y=(0,c.useRef)(null);return(0,c.useEffect)(()=>{if(l==null){y.current=null;return}y.current!==l.runId&&(y.current=l.runId,e(`A newer remote run is available: ${l.label}`,`warning`))},[l,e]),(0,u.jsx)(Wg,{workspace:r,analysis:i,analysisSource:a,error:o,preloadLoading:s,pendingRemoteRun:l,acceptingRemoteRun:d,onLoadDifferent:f,onAnalysis:p,onError:m,onAcceptPendingRemoteRun:h,themePreference:g,setPreferences:n,preferences:t,setThemePreference:_,workspaceSignals:i?Kg(i,a):[]})}function N_(){return(0,u.jsx)(xg,{children:(0,u.jsx)(M_,{})})}(0,l.createRoot)(document.getElementById(`root`)).render((0,u.jsx)(c.StrictMode,{children:(0,u.jsx)(N_,{})}));
|
|
29
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return _d(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=hf.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Tf(){return{exit:{taskListCheckValueChecked:Df,taskListCheckValueUnchecked:Df,paragraph:Of}}}function Ef(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:kf}}}function Df(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Of(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function kf(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=hf.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Af(){return[Fu(),ad(),ud(),gf(),Tf()]}function jf(e){return{extensions:[Iu(),od(e),dd(),wf(e),Ef()]}}var Mf={tokenize:Kf,partial:!0},Nf={tokenize:qf,partial:!0},Pf={tokenize:Jf,partial:!0},Ff={tokenize:Yf,partial:!0},If={tokenize:Xf,partial:!0},Lf={name:`wwwAutolink`,tokenize:Wf,previous:Zf},Rf={name:`protocolAutolink`,tokenize:Gf,previous:Qf},zf={name:`emailAutolink`,tokenize:Uf,previous:$f},Bf={};function Vf(){return{text:Bf}}for(var Hf=48;Hf<123;)Bf[Hf]=zf,Hf++,Hf===58?Hf=65:Hf===91&&(Hf=97);Bf[43]=zf,Bf[45]=zf,Bf[46]=zf,Bf[95]=zf,Bf[72]=[zf,Rf],Bf[104]=[zf,Rf],Bf[87]=[zf,Lf],Bf[119]=[zf,Lf];function Uf(e,t,n){let r=this,i,a;return o;function o(t){return!ep(t)||!$f.call(r,r.previous)||tp(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return ep(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(If,u,l)(t):t===45||t===95||q(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&K(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Wf(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Zf.call(r,r.previous)||tp(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Mf,e.attempt(Nf,e.attempt(Pf,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Gf(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Qf.call(r,r.previous)&&!tp(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(K(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Va(t)||Y(t)||Ka(t)||Ga(t)?n(t):e.attempt(Nf,e.attempt(Pf,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Kf(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function qf(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Ff,c,s)(t):t===null||Y(t)||Ka(t)||t!==45&&Ga(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Jf(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Ff,t,a)(o):o===null||Y(o)||Ka(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Yf(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Y(o)||Ka(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Y(e)||Ka(e)?t(e):r(e)}function a(e){return K(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):K(t)?(e.consume(t),o):n(t)}}function Xf(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return q(e)?n(e):t(e)}}function Zf(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Y(e)}function Qf(e){return!K(e)}function $f(e){return!(e===47||ep(e))}function ep(e){return e===43||e===45||e===46||e===95||q(e)}function tp(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var np={tokenize:up,partial:!0};function rp(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:sp,continuation:{tokenize:cp},exit:lp}},text:{91:{name:`gfmFootnoteCall`,tokenize:op},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:ip,resolveTo:ap}}}}function ip(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=za(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function ap(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function op(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Y(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(za(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Y(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function sp(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Y(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=za(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Y(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Z(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function cp(e,t,n){return e.check(lo,t,e.attempt(np,t,n))}function lp(e){e.exit(`gfmFootnoteDefinition`)}function up(e,t,n){let r=this;return Z(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function dp(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Ma(o,o.length,0,no(s,e.slice(r+1,n),t)),Ma(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Ma(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=to(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=to(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var fp=class{constructor(){this.map=[]}add(e,t,n){pp(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function pp(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function mp(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function hp(){return{flow:{null:{name:`table`,tokenize:gp,resolveAll:_p}}}}function gp(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):J(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):X(t)?Z(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Y(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,X(t)?Z(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return X(t)?Z(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||J(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return X(t)?Z(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||J(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||J(n)?(e.exit(`tableRow`),t(n)):X(n)?Z(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Y(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function _p(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new fp;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(yp(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=vp(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=vp(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=vp(f,t,o,i,n,d)):(o[0]=o[1],d=vp(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&yp(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=mp(t.events,n))}return e}function vp(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},bp(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=bp(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=bp(t.events,n[2]),a=bp(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},bp(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function yp(e,t,n,r,i){let a=[],o=bp(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function bp(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var xp={name:`tasklistCheck`,tokenize:Cp};function Sp(){return{text:{91:xp}}}function Cp(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Y(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return J(r)?t(r):X(r)?e.check({tokenize:wp},t,n)(r):n(r)}}function wp(e,t,n){return Z(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Tp(e){return Fa([Vf(),rp(),dp(e),hp(),Sp()])}var Ep={};function Dp(e){let t=this,n=e||Ep,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Tp(n)),a.push(Af()),o.push(jf(n))}function Op({href:e,children:t,...n}){let r=typeof e==`string`&&(e.startsWith(`http://`)||e.startsWith(`https://`));return(0,u.jsx)(`a`,{href:e,...n,...r?{target:`_blank`,rel:`noopener noreferrer`}:{},children:t})}var kp={a:Op};function Ap({markdown:e,className:t,regionLabel:n=`Asset description`}){let r=(0,c.useRef)(null),[i,a]=(0,c.useState)(!1),[o,s]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let e=r.current;if(e){if(i){s(!1);return}s(e.scrollHeight>e.clientHeight+1)}};t();let n=globalThis.ResizeObserver;if(n===void 0)return;let a=new n(t);return a.observe(e),()=>{a.disconnect()}},[e,i]),(0,u.jsxs)(`div`,{className:[`resource-description-md`,t].filter(Boolean).join(` `),role:`region`,"aria-label":n,children:[(0,u.jsx)(`div`,{ref:r,className:i?`resource-description-md__viewport resource-description-md__viewport--expanded`:`resource-description-md__viewport resource-description-md__viewport--collapsed`,children:(0,u.jsx)(`div`,{className:`resource-description-md__prose`,children:(0,u.jsx)(Su,{remarkPlugins:[Dp],components:kp,children:e})})}),(0,u.jsxs)(`div`,{className:`resource-description-md__toolbar`,children:[!i&&o?(0,u.jsx)(`button`,{type:`button`,className:`resource-description-md__toggle workspace-pill`,onClick:()=>a(!0),children:`Expand description`}):null,i?(0,u.jsx)(`button`,{type:`button`,className:`resource-description-md__toggle workspace-pill`,onClick:()=>a(!1),children:`Collapse description`}):null]})]})}function jp({resource:e,dependencySummary:t}){return(0,u.jsxs)(zt,{title:`Asset summary`,subtitle:`Core execution and discovery context for the selected asset.`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Status`}),(0,u.jsx)(`strong`,{children:e.status??`Not executed`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Execution time`}),(0,u.jsx)(`strong`,{children:Ye(e.executionTime)})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Thread`}),(0,u.jsx)(`strong`,{children:e.threadId??`n/a`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Path`}),(0,u.jsx)(`strong`,{children:et(e)??`n/a`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Direct upstream`}),(0,u.jsx)(`strong`,{children:t?.upstreamCount??0})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Direct downstream`}),(0,u.jsx)(`strong`,{children:t?.downstreamCount??0})]})]}),e.description?(0,u.jsx)(Ap,{markdown:e.description,className:`resource-spotlight__description`}):(0,u.jsx)(`p`,{className:`resource-spotlight__description resource-spotlight__description--muted`,children:`No description was captured for this asset. Catalog-oriented metadata can surface here when present in the manifest.`})]})}var Mp=new Set(`SELECT FROM WHERE WITH AS JOIN ON GROUP BY ORDER LIMIT HAVING UNION CASE WHEN THEN ELSE END LEFT RIGHT INNER OUTER CROSS DISTINCT NULL AND OR NOT IN IS BETWEEN LIKE EXISTS INSERT INTO UPDATE SET DELETE CREATE TABLE VIEW REPLACE IF ASC DESC USING AT ZONE INTERVAL QUALIFY WINDOW ROWS RANGE UNBOUNDED PRECEDING FOLLOWING CURRENT ROW PARTITION OVER`.split(` `)),Np=new Set(`SUM COUNT AVG MAX MIN COALESCE CAST IFF IF ROW_NUMBER RANK DENSE_RANK NTILE LEAD LAG FIRST_VALUE LAST_VALUE NVL NVL2 NULLIF GREATEST LEAST TRIM LTRIM RTRIM UPPER LOWER LENGTH SUBSTR SUBSTRING REPLACE SPLIT CONCAT DATE YEAR MONTH DAY HOUR MINUTE SECOND DATEDIFF DATEADD CURRENT_DATE CURRENT_TIMESTAMP TO_DATE TO_TIMESTAMP TO_NUMBER TO_VARCHAR TRY_CAST CONVERT FLOOR CEIL ROUND ABS MOD SQRT LOG EXP ARRAY_AGG LISTAGG STRING_AGG GROUP_CONCAT FLATTEN UNNEST GENERATE_SERIES`.split(` `));function Pp(e){let t=[],n=0,r=e.length;for(;n<r;){if(e.startsWith(`/*`,n)){let r=e.indexOf(`*/`,n+2),i=r===-1?e.slice(n):e.slice(n,r+2);t.push({type:`comment`,value:i}),n+=i.length;continue}if(e.startsWith(`--`,n)){let r=e.indexOf(`
|
|
30
|
+
`,n),i=r===-1?e.slice(n):e.slice(n,r+1);t.push({type:`comment`,value:i}),n+=i.length;continue}if(e[n]===`'`){let i=n+1;for(;i<r;){if(e[i]===`'`&&e[i-1]!==`\\`){i++;break}i++}t.push({type:`string`,value:e.slice(n,i)}),n=i;continue}let i=/^[0-9]+(\.[0-9]+)?/.exec(e.slice(n));if(i&&(n===0||!/[a-zA-Z_]/.test(e[n-1]))){t.push({type:`number`,value:i[0]}),n+=i[0].length;continue}let a=/^[a-zA-Z_][a-zA-Z0-9_]*/.exec(e.slice(n));if(a){let e=a[0],r=e.toUpperCase(),i=Mp.has(r)?`keyword`:Np.has(r)?`function`:`identifier`;t.push({type:i,value:e}),n+=e.length;continue}if(/[=<>!|+\-*/%^&~]/.test(e[n])){t.push({type:`operator`,value:e[n]}),n++;continue}if(/[(),;.[\]{}]/.test(e[n])){t.push({type:`punctuation`,value:e[n]}),n++;continue}t.push({type:`plain`,value:e[n]}),n++}return t}function Fp({sql:e}){return(0,u.jsx)(`pre`,{className:`sql-panel`,children:(0,u.jsx)(`code`,{children:Pp(e).map((e,t)=>e.type===`plain`||e.type===`identifier`?e.value:(0,u.jsx)(`span`,{className:`sql-token-${e.type}`,children:e.value},t))})})}function Ip({size:e=24,label:t}){return(0,u.jsxs)(`svg`,{className:`spinner`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":t?void 0:`true`,"aria-label":t,role:t?`img`:void 0,children:[(0,u.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`var(--panel-border)`,strokeWidth:`2.5`}),(0,u.jsx)(`path`,{d:`M12 2 A10 10 0 0 1 22 12`,stroke:`var(--accent)`,strokeWidth:`2.5`,strokeLinecap:`round`})]})}function Lp({label:e,values:t}){return t.length===0?null:(0,u.jsxs)(`div`,{className:`definition-list`,children:[(0,u.jsx)(`span`,{children:e}),(0,u.jsx)(`div`,{className:`definition-list__values`,children:t.map(e=>(0,u.jsx)(`span`,{className:`definition-pill`,children:e},e))})]})}function Rp(e){return(0,u.jsxs)(`div`,{className:`definition-panel`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Label`}),(0,u.jsx)(`strong`,{children:e.label??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Metric type`}),(0,u.jsx)(`strong`,{children:e.metricType??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Source`}),(0,u.jsx)(`strong`,{children:e.sourceReference??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Time granularity`}),(0,u.jsx)(`strong`,{children:e.timeGranularity??`Not captured`})]})]}),e.expression&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Expression`}),(0,u.jsx)(`pre`,{children:e.expression})]}),e.description&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Description`}),(0,u.jsx)(`p`,{children:e.description})]}),(0,u.jsx)(Lp,{label:`Measures`,values:e.measures}),(0,u.jsx)(Lp,{label:`Referenced metrics`,values:e.metrics}),(0,u.jsx)(Lp,{label:`Filters`,values:e.filters})]})}function zp(e){return(0,u.jsxs)(`div`,{className:`definition-panel`,children:[(0,u.jsxs)(`div`,{className:`detail-grid`,children:[(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Label`}),(0,u.jsx)(`strong`,{children:e.label??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Source model`}),(0,u.jsx)(`strong`,{children:e.sourceReference??`Not captured`})]}),(0,u.jsxs)(`div`,{className:`detail-stat`,children:[(0,u.jsx)(`span`,{children:`Default time dimension`}),(0,u.jsx)(`strong`,{children:e.defaultTimeDimension??`Not captured`})]})]}),(0,u.jsx)(Lp,{label:`Entities`,values:e.entities}),(0,u.jsx)(Lp,{label:`Measures`,values:e.measures}),(0,u.jsx)(Lp,{label:`Dimensions`,values:e.dimensions}),e.description&&(0,u.jsxs)(`div`,{className:`definition-block`,children:[(0,u.jsx)(`span`,{children:`Description`}),(0,u.jsx)(`p`,{children:e.description})]})]})}function Bp({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i}){return e&&t?t.kind===`metric`?Rp(t):zp(t):r?(0,u.jsxs)(`div`,{className:`asset-sql-loading`,"aria-busy":`true`,children:[(0,u.jsx)(Ip,{size:28,label:`Loading SQL`}),(0,u.jsx)(`span`,{className:`asset-sql-loading__label`,children:`Loading SQL…`})]}):i?(0,u.jsx)(yt,{icon:`⚠`,headline:`Could not load SQL`,subtext:i}):n?(0,u.jsx)(Fp,{sql:n}):(0,u.jsx)(yt,{icon:`⌘`,headline:e?`No definition available`:`No SQL available`,subtext:e?`This resource does not expose enough definition metadata in the current artifacts.`:`This resource does not expose compiled or raw SQL in the current artifacts.`})}function Vp({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i,hasCompiledSql:a}){return(0,u.jsx)(zt,{title:e?`Definition`:`SQL`,subtitle:e?t?.kind===`metric`?`Structured metric definition captured from the manifest.`:`Structured semantic model definition captured from the manifest.`:a?`Compiled SQL for the selected resource.`:`Raw SQL captured from the manifest.`,children:Bp({showsDefinition:e,definition:t,sqlText:n,codeLoading:r,codeError:i})})}function Hp(e){return e===`runtime`?`summary`:e}function Up({resource:e,analysis:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:s}){let l=(0,c.useMemo)(()=>new Map(t.resources.map(e=>[e.uniqueId,e])),[t.resources]),d=a.upstreamDepth,f=a.downstreamDepth,p=a.allDepsMode,m=a.lensMode,h=a.activeLegendKeys,g=e=>o(t=>({...t,upstreamDepth:typeof e==`function`?e(t.upstreamDepth):e})),_=e=>o(t=>({...t,downstreamDepth:typeof e==`function`?e(t.downstreamDepth):e})),v=e=>o(t=>({...t,allDepsMode:typeof e==`function`?e(t.allDepsMode):e})),y=e=>o(t=>({...t,lensMode:e,activeLegendKeys:new Set})),b=e=>o(t=>({...t,activeLegendKeys:typeof e==`function`?e(t.activeLegendKeys):e})),x=Hp(r.activeTab),[S,C]=(0,c.useState)(!1),w=(0,c.useRef)({summary:null,lineage:null,sql:null,tests:null});(0,c.useEffect)(()=>{if(!e)return;let t=w.current[x];if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView({block:`start`,behavior:n?`auto`:`smooth`})},[x,e]);let{compiledCode:T,rawCode:E,loading:D,error:O}=Zr(e?.uniqueId??null,t);if(!e)return(0,u.jsx)(`div`,{className:`workspace-card`,children:(0,u.jsx)(yt,{icon:`🔍`,headline:`No resource selected`,subtext:`Adjust the explorer filters or search to find the resource you're looking for.`})});let k=t.dependencyIndex[e.uniqueId],A=T??E??void 0,ee=T!=null&&T!==``,j=e.definition??null,M=j?.kind===`metric`||j?.kind===`semantic_model`,te=(0,u.jsxs)(`div`,{className:`resource-detail__subtitle`,children:[(0,u.jsx)(Bt,{resourceType:e.resourceType}),(0,u.jsx)(`span`,{className:`resource-detail__package`,children:e.packageName||`workspace`})]}),N={resource:e,dependencySummary:k,dependencyIndex:t.dependencyIndex,resourceById:l,upstreamDepth:d,downstreamDepth:f,allDepsMode:p,lensMode:m,activeLegendKeys:h,setUpstreamDepth:g,setDownstreamDepth:_,setAllDepsMode:v,setLensMode:y,setActiveLegendKeys:b,onSelectResource:e=>{n(e),o(t=>({...t,selectedResourceId:e})),i(t=>({...t,selectedResourceId:e,activeTab:`lineage`}))}};return(0,u.jsxs)(`div`,{className:`workspace-view asset-workspace`,children:[(0,u.jsxs)(`section`,{className:`catalog-detail-hero`,children:[(0,u.jsxs)(`div`,{className:`catalog-detail-hero__content`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Selected asset`}),(0,u.jsx)(`h3`,{children:e.name}),te]}),(0,u.jsx)(`div`,{className:`asset-hero__actions`,"aria-label":`Asset actions`,children:(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>s(`timeline`,{resourceId:e.uniqueId,executionId:e.uniqueId}),children:`Open in Timeline`})})]}),(0,u.jsx)(`div`,{className:`asset-workspace__body`,children:(0,u.jsxs)(`div`,{className:`asset-workspace__sections`,children:[(0,u.jsx)(`section`,{id:`asset-section-summary`,ref:e=>{w.current.summary=e},className:`asset-workspace__section`,children:(0,u.jsx)(jp,{resource:e,dependencySummary:k})}),(0,u.jsx)(`section`,{id:`asset-section-lineage`,ref:e=>{w.current.lineage=e},className:`asset-workspace__section`,children:(0,u.jsx)(Nr,{...N,displayMode:`summary`,openFullscreen:S,onFullscreenChange:C})}),(0,u.jsx)(`section`,{id:`asset-section-tests`,ref:e=>{w.current.tests=e},className:`asset-workspace__section`,children:(0,u.jsx)(Xr,{resource:e,analysis:t,onNavigateTo:s})}),(0,u.jsx)(`section`,{id:`asset-section-sql`,ref:e=>{w.current.sql=e},className:`asset-workspace__section`,children:(0,u.jsx)(Vp,{showsDefinition:M,definition:j,sqlText:A,codeLoading:D,codeError:O,hasCompiledSql:ee})})]})})]})}var Wp=200;function Gp({analysis:e,resource:t,onSelectResource:n,assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onInvestigationSelectionChange:s,onNavigateTo:l}){let[d,f]=(0,c.useState)(``),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(!1),[_,v]=(0,c.useState)(``),y=(0,c.useRef)(0);(0,c.useEffect)(()=>{let e=d.trim(),t=e?Wp:0,n=window.setTimeout(()=>{if(!e){y.current+=1,m([]),g(!1);return}y.current+=1;let t=y.current;g(!0),T(e).then(e=>{y.current===t&&m(e)}).catch(()=>{y.current===t&&m([])}).finally(()=>{y.current===t&&g(!1)})},t);return()=>window.clearTimeout(n)},[d]);let b=e=>{e&&(i(t=>({...t,selectedResourceId:e,activeTab:`lineage`})),o(t=>({...t,rootResourceId:e,selectedResourceId:e})),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`})))};return(0,u.jsx)(Ut,{title:`Inventory`,description:`Browse, filter, and inspect all workspace assets.`,className:`inventory-view`,suppressHeader:t!=null,children:t?(0,u.jsx)(Up,{analysis:e,resource:t,onSelectResource:e=>{n(e),s(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))},assetViewState:r,onAssetViewStateChange:i,lineageViewState:a,onLineageViewStateChange:o,onNavigateTo:l}):(0,u.jsx)(`div`,{className:`inventory-empty-state`,children:(0,u.jsxs)(`div`,{className:`inventory-empty-state__inner`,children:[(0,u.jsx)(yt,{icon:`◱`,headline:`Select an asset to inspect`,subtext:`Use the browser panel on the left to find and select a model, source, seed, or other asset.`}),(0,u.jsxs)(`div`,{className:`inventory-empty-state__lineage-pick`,role:`group`,"aria-label":`Jump to lineage for an asset`,children:[(0,u.jsx)(`label`,{className:`inventory-empty-state__lineage-label`,htmlFor:`inventory-lineage-search`,children:`Or search for an asset to open its lineage graph`}),(0,u.jsx)(`input`,{id:`inventory-lineage-search`,type:`search`,className:`inventory-empty-state__lineage-search`,value:d,onChange:e=>{f(e.target.value),v(``)},placeholder:`Name, type, package, or unique id…`,autoComplete:`off`,enterKeyHint:`search`}),h&&(0,u.jsx)(`p`,{className:`inventory-empty-state__lineage-hint`,"aria-live":`polite`,children:`Searching…`}),p.length>0&&(0,u.jsx)(`ul`,{className:`inventory-empty-state__lineage-suggestions`,role:`listbox`,"aria-label":`Matching assets`,children:p.map(e=>(0,u.jsx)(`li`,{role:`none`,children:(0,u.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":_===e.uniqueId,className:_===e.uniqueId?`inventory-lineage-suggestion inventory-lineage-suggestion--active`:`inventory-lineage-suggestion`,onClick:()=>{y.current+=1,v(e.uniqueId),f(`${e.name} (${e.resourceType})`),m([]),g(!1)},children:[(0,u.jsx)(`span`,{className:`inventory-lineage-suggestion__name`,children:e.name}),(0,u.jsxs)(`span`,{className:`inventory-lineage-suggestion__meta`,children:[e.resourceType,e.packageName?` · ${e.packageName}`:``]})]})},e.uniqueId))}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!_,onClick:()=>b(_),children:`Open lineage graph`})]})]})})})}function Kp(e){let t=[],n=new Map;for(let r of e)if(z.has(r.resourceType)){if(r.parentId!=null){let e=n.get(r.parentId)??[];e.push(r),n.set(r.parentId,e)}}else t.push(r);return t.sort((e,t)=>{let n=e.start-t.start;return n===0?t.duration-e.duration:n}),t.map(e=>{let t=n.get(e.unique_id)??[],{lanes:r,laneCount:i}=qp(t);return{item:e,tests:t,lanes:r,laneCount:i}})}function qp(e){if(e.length===0)return{lanes:[],laneCount:0};let t=[...e].sort((e,t)=>e.start-t.start),n=[],r=[];for(let e of t){let t=-1;for(let r=0;r<n.length;r++)if((n[r]??0)<=e.start){t=r,n[r]=e.end;break}t===-1&&(t=n.length,n.push(e.end)),r.push({item:e,lane:t})}return{lanes:r,laneCount:n.length}}var Jp=`dbt-tools.timelineLabelWidthPx`,Yp=.78,Xp={color:`var(--text-soft)`,fontSize:`0.82rem`},Zp=`dbt-tools.timelineTimezone`;function Qp(e){return e>=6e4?`${(e/6e4).toFixed(0)}m`:e>=1e4?`${(e/1e3).toFixed(0)}s`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(0)}ms`}function $p(e,t){return new Intl.DateTimeFormat(`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1,timeZone:t}).format(new Date(e))}function em(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,t=Intl.supportedValuesOf,n=t?.(`timeZone`)??[];return Array.from(new Set([e,`UTC`,...n]))}function tm(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`;try{return window.localStorage.getItem(`dbt-tools.timelineTimezone`)||e}catch{return e}}function nm(e=160){try{let t=window.localStorage.getItem(Jp);if(t==null)return e;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:e}catch{return e}}function rm(e){return[`success`,`pass`,`passed`].includes(e.trim().toLowerCase())}function im(e){return[`skipped`,`no op`].includes(e.trim().toLowerCase())}function am(e){let t=e.trim().toLowerCase();return!rm(t)&&!im(t)}function om(e){if(!Number.isFinite(e)||e<6e4)return 6e4;let t=10**Math.max(0,Math.floor(Math.log10(e))),n=e/t;return Math.max(6e4,(n<=1?1:n<=2?2:n<=5?5:10)*t)}var sm=[50,100,200,500,1e3,2e3,5e3,1e4,2e4,3e4,6e4,12e4,3e5,6e5,9e5,18e5,36e5,72e5,144e5,216e5,432e5,864e5],cm=8;function lm(e,t){if(t<=e)return[];let n=t-e,r=sm.find(e=>n/e<=cm)??om(Math.ceil(n/cm)),i=[],a=Math.ceil(e/r)*r;e>0&&i.push({ms:e,label:Qp(e)});for(let n=a;n<=t;n+=r)n<=e||n>=t||i.push({ms:n,label:Qp(n)});return i.push({ms:t,label:Qp(t)}),i}function um(e,t,n,r,i,a,o=10){if(e.length===0||r<=0)return e;let s=Math.max(1,n-t),c=e.map(e=>{let n=(e.ms-t)/s*r,o=a(i(e))/2;return{ms:e.ms,label:e.label,x:n,hw:o}}),l=[],u=null;for(let e of c){if(!u){l.push({ms:e.ms,label:e.label}),u=e;continue}e.x-e.hw>=u.x+u.hw+o&&(l.push({ms:e.ms,label:e.label}),u=e)}let d=c[c.length-1];if(d.ms===n&&l[l.length-1]?.ms!==n){for(;l.length>0;){let e=l[l.length-1],t=c.find(t=>t.ms===e.ms);if(!t||d.x-d.hw>=t.x+t.hw+o)break;l.pop()}l.length===0&&l.push({ms:c[0].ms,label:c[0].label}),l.push({ms:d.ms,label:d.label})}return l}function dm(e,t){let n=t>0?Math.max(120,Math.min(560,t-200)):560;return Math.max(120,Math.min(n,Math.round(e)))}function fm(e){let[t,n]=(0,c.useState)(()=>typeof window>`u`?160:nm(220));(0,c.useEffect)(()=>{e<=0||n(t=>dm(t,e))},[e]),(0,c.useEffect)(()=>{try{window.localStorage.setItem(Jp,String(t))}catch{}},[t]);let r=(0,c.useMemo)(()=>e<=0?560:Math.max(120,Math.min(560,e-200)),[e]);return{effectiveLabelW:e>0?dm(t,e):t,maxLabelW:r,onLabelColumnWidthDrag:(0,c.useCallback)(t=>{n(dm(t,e>0?e:800))},[e])}}function pm(e,t){return!e||!t||!z.has(t.resourceType)||!z.has(e.resourceType)||t.parentId==null||e.parentId==null?!1:t.parentId===e.parentId}var mm={model:0,source:1,source_freshness:1,snapshot:2,seed:3,exposure:4,metric:5,semantic_model:6,test:7,unit_test:8,macro:9,analysis:10};function hm(e){return e?mm[e]??98:99}function gm(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=pm(i,t)?0:1,s=pm(a,t)?0:1;if(o!==s)return o-s;let c=hm(i?.resourceType),l=hm(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.end??0)-t.start),d=Math.abs((a?.end??0)-t.start);return u===d?e.localeCompare(r):u-d})}function _m(e,t,n){return t||e.length<=n?e:e.slice(0,n)}function vm(e,t,n){return[...e].sort((e,r)=>{let i=n.get(e),a=n.get(r),o=pm(i,t)?0:1,s=pm(a,t)?0:1;if(o!==s)return o-s;let c=hm(i?.resourceType),l=hm(a?.resourceType);if(c!==l)return c-l;let u=Math.abs((i?.start??0)-t.end),d=Math.abs((a?.start??0)-t.end);return u===d?e.localeCompare(r):u-d})}function ym(e){return`${e.fromId}\t${e.toId}`}function bm(e,t){if(e.hop!==t.hop)return e.hop-t.hop;let n=e.leg===`upstream`?0:1,r=t.leg===`upstream`?0:1;if(n!==r)return n-r;let i=e.fromId.localeCompare(t.fromId);return i===0?e.toId.localeCompare(t.toId):i}function xm(e,t,n,r,i,a){return _m(gm(t.inbound.filter(e=>i(e)),n,r),a.showAllUpstream,a.maxUpstreamEdges).map(t=>({fromId:t,toId:e,tier:pm(r.get(t),n)?`secondary`:`primary`,hop:1,leg:`upstream`}))}function Sm(e,t,n,r,i,a){return _m(vm(t.outbound.filter(e=>i(e)),n,r),a.showAllDownstream,a.maxDownstreamEdges).map(t=>({fromId:e,toId:t,tier:`downstream`,hop:1,leg:`downstream`}))}function Cm(e,t,n,r,i,a,o){return{upExt:a?Dm(e,t,n,r,i):{edges:[],truncated:!1},downExt:o?Om(e,t,n,r,i):{edges:[],truncated:!1}}}function wm(e,t,n){let r=new Map;for(let t of e)r.set(ym(t),t);for(let e of t){let t=ym(e);r.has(t)||r.set(t,e)}for(let e of n){let t=ym(e);r.has(t)||r.set(t,e)}return[...r.values()].sort(bm)}function Tm(e,t){let n=t.timelineAdjacency[e];if(!n)return!1;let r=t.direction===`upstream`?n.inbound:n.outbound;for(let n of r){if(!t.inTimeline(n))continue;let r=t.direction===`upstream`?n:e,i=t.direction===`upstream`?e:n,a=ym({fromId:r,toId:i});if(!t.seen.has(a)){if(t.seen.add(a),t.hop>=2&&(t.edges.push({fromId:r,toId:i,tier:t.direction===`upstream`?`primary`:`downstream`,hop:t.hop,leg:t.direction}),t.edges.length>=t.maxEdges))return!0;t.nextFrontier.add(n)}}return!1}function Em(e,t,n,r,i,a){let o=e=>n.has(e),s=new Set,c=[],l=!1,u=new Set([e]);for(let e=1;e<=r&&c.length<i;e++){let n=new Set,r={hop:e,direction:a,timelineAdjacency:t,inTimeline:o,seen:s,edges:c,maxEdges:i,nextFrontier:n};for(let e of u)if(l=Tm(e,r),l)break;if(u=n,l||u.size===0)break}return{edges:c,truncated:l}}function Dm(e,t,n,r,i){return Em(e,t,n,r,i,`upstream`)}function Om(e,t,n,r,i){return Em(e,t,n,r,i,`downstream`)}function km(e,t,n,r,i){if(!e||!t)return{edges:[],extendedTruncated:!1};let a=t[e],o=n.get(e);if(!a||!o||!r.has(e))return{edges:[],extendedTruncated:!1};let s=e=>r.has(e),c=i.includeUpstream??!0,l=i.includeDownstream,u=[...c?xm(e,a,o,n,s,i):[],...l?Sm(e,a,o,n,s,i):[]],d=i.extendedDeps;if(!d?.enabled)return{edges:[...u].sort(bm),extendedTruncated:!1};let{upExt:f,downExt:p}=Cm(e,t,r,d.maxHops??3,d.maxEdgesPerDirection??12,c,l);return{edges:wm(u,f.edges,p.edges),extendedTruncated:f.truncated||p.truncated}}function Am(e,t,n,r,i,a){let o=n[e];if(!o)return null;let s=32+(r[e]??0)-i;if(o.item.unique_id===t)return s+6+14/2;if(!a)return null;for(let{item:e,lane:n}of o.lanes)if(e.unique_id===t)return s+44+5+n*14+10/2;return null}function jm(e){let{edge:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:o,showTests:s,effectiveLabelW:c,rangeStart:l,rangeEnd:u,chartW:d}=e,f=n.get(t.fromId),p=n.get(t.toId),m=r.get(t.fromId),h=r.get(t.toId);if(f==null||p==null||m===void 0||h===void 0)return``;let g=Am(m,t.fromId,i,a,o,s),_=Am(h,t.toId,i,a,o,s);if(g==null||_==null)return``;let v=Math.max(1,u-l),y=c+(f.start+f.duration-l)/v*d,b=c+(p.start-l)/v*d,x=Math.abs(b-y)*.4;return`M${y},${g} C${y+x},${g} ${b-x},${_} ${b},${_}`}var Mm=8,Nm=8;function Pm(e,t,n){if((e.hop??1)>=2)return e.leg===`upstream`?{stroke:t.slate,strokeWidth:1,strokeDasharray:`3 4`,opacity:.36,markerEnd:`url(#${n.secondary})`}:{stroke:t.accent,strokeWidth:1,strokeDasharray:`4 5`,opacity:.4,markerEnd:`url(#${n.downstream})`};switch(e.tier){case`secondary`:return{stroke:t.slate,strokeWidth:1,strokeDasharray:`4 3`,opacity:.42,markerEnd:`url(#${n.secondary})`};case`downstream`:return{stroke:t.accent,strokeWidth:1.5,strokeDasharray:`5 4`,opacity:.62,markerEnd:`url(#${n.downstream})`};default:return{stroke:t.accent,strokeWidth:2,strokeDasharray:`6 4`,opacity:.88,markerEnd:`url(#${n.primary})`}}}function Fm({id:e,fill:t}){return(0,u.jsx)(`marker`,{id:e,viewBox:`0 0 ${Mm} ${Nm}`,refX:Mm-.5,refY:Nm/2,markerWidth:Mm,markerHeight:Nm,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,u.jsx)(`path`,{d:`M0,0 L${Mm},${Nm/2} L0,${Nm} Z`,fill:t})})}function Im({edges:e,focusId:t,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,canvasWidth:o,effectiveLabelW:s,rangeStart:c,rangeEnd:l,scrollTop:d,viewportH:f,theme:p=`light`,showTests:m=!0}){if(t==null||e.length===0)return null;let h=xe(p),g=o-s-24,_=`gantt-edge-mk-primary`,v=`gantt-edge-mk-secondary`,y=`gantt-edge-mk-downstream`,b={primary:_,secondary:v,downstream:y};return(0,u.jsxs)(`svg`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:f,pointerEvents:`none`,overflow:`hidden`,zIndex:5},"aria-hidden":!0,children:[(0,u.jsxs)(`defs`,{children:[(0,u.jsx)(Fm,{id:_,fill:h.accent}),(0,u.jsx)(Fm,{id:v,fill:h.slate}),(0,u.jsx)(Fm,{id:y,fill:h.accent})]}),e.map((e,t)=>{let o=jm({edge:e,itemById:n,bundleIndexById:r,bundles:i,rowOffsets:a,scrollTop:d,showTests:m,effectiveLabelW:s,rangeStart:c,rangeEnd:l,chartW:g});if(!o)return null;let{stroke:f,strokeWidth:p,strokeDasharray:_,opacity:v,markerEnd:y}=Pm(e,h,b);return(0,u.jsx)(`path`,{d:o,stroke:f,strokeWidth:p,strokeDasharray:_,fill:`none`,opacity:v,markerEnd:y},`${e.fromId}-${e.toId}-${e.tier}-${e.hop}-${e.leg}-${t}`)})]})}var Lm=8;function Rm({labelColumnW:e,viewportH:t,minW:n,maxW:r,onWidthChange:i}){let a=(0,c.useRef)(null),o=(0,c.useCallback)(e=>Math.max(n,Math.min(r,Math.round(e))),[n,r]),s=(0,c.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),a.current={startX:t.clientX,startW:e},t.currentTarget.setPointerCapture(t.pointerId)},[e]),l=(0,c.useCallback)(e=>{let t=a.current;t&&i(o(t.startW+(e.clientX-t.startX)))},[o,i]),d=(0,c.useCallback)(e=>{a.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),f=Math.max(0,e-Lm/2);return(0,u.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize timeline name column`,className:`gantt-label-resize-handle`,style:{position:`absolute`,left:f,top:0,width:Lm,height:t,cursor:`col-resize`,touchAction:`none`,zIndex:4,background:`transparent`},onPointerDown:s,onPointerMove:l,onPointerUp:d,onPointerCancel:d})}var zm=16,Bm=0,Vm=12;function Hm(e){return e.split(/[\s_-]+/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function Um({hoverX:e,hoverY:t,frameWidth:n,frameHeight:r,tooltipWidth:i,tooltipHeight:a,offsetX:o=zm,offsetY:s=Bm,margin:c=Vm}){let l=Math.max(n,i+c*2),u=Math.max(r,a+c*2),d=e+o;d+i>l-c&&(d=e-i-o);let f=t+s;return f+a>u-c&&(f=u-a-c),d=Math.min(Math.max(c,d),Math.max(c,l-i-c)),f=Math.min(Math.max(c,f),Math.max(c,u-a-c)),{left:d,top:f}}function Wm({hover:e,frameWidth:t,frameHeight:n,runStartedAt:r,canShowTimestamps:i,timeZone:a,testStats:o}){let s=(0,c.useRef)(null),[l,d]=(0,c.useState)(()=>Um({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:220,tooltipHeight:160}));return(0,c.useLayoutEffect)(()=>{let r=s.current;if(!r)return;let i=Um({hoverX:e.x,hoverY:e.y,frameWidth:t,frameHeight:n,tooltipWidth:r.offsetWidth,tooltipHeight:r.offsetHeight});d(e=>e.left===i.left&&e.top===i.top?e:i)},[n,t,e.x,e.y,e.item.unique_id]),(0,u.jsxs)(`div`,{ref:s,className:`chart-tooltip`,style:{position:`absolute`,left:l.left,top:l.top,pointerEvents:`none`,zIndex:20,minWidth:180},children:[(0,u.jsx)(`div`,{style:{fontWeight:700,marginBottom:`0.3rem`},children:e.item.name||e.item.unique_id}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`Status: `}),e.item.status]}),e.item.resourceType&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`Type: `}),e.item.resourceType]}),e.item.materialized?(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`Materialization: `}),Hm(e.item.materialized)]}):null,i&&r!=null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`Start: `}),$p(r+e.item.start,a)]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`End: `}),$p(r+e.item.end,a)]})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`Start: `}),`+`,Qp(e.item.start)]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`End: `}),`+`,Qp(e.item.end)]})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`Duration: `}),Qp(e.item.duration)]}),e.item.compileStart!=null&&e.item.compileEnd!=null&&e.item.compileEnd>e.item.compileStart&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`Compile: `}),Qp(e.item.compileEnd-e.item.compileStart)]}),e.item.executeStart!=null&&e.item.executeEnd!=null&&e.item.executeEnd>e.item.executeStart&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`Execute: `}),Qp(e.item.executeEnd-e.item.executeStart)]}),o&&o.pass+o.fail+o.error+o.warn+o.skipped>0&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:Xp,children:`Tests: `}),[o.pass>0?`✓${o.pass}`:null,o.error>0?`✗${o.error}`:null,o.warn>0?`!${o.warn}`:null,o.skipped>0?`−${o.skipped}`:null].filter(Boolean).join(` · `)]})]})}function Gm({canvasRef:e,scrollRef:t,edges:n,edgeFocusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,containerWidth:l,effectiveLabelW:d,rangeStart:f,rangeEnd:p,scrollTop:m,viewportH:h,needsScroll:g,totalScrollH:_,theme:v,showTests:y,hover:b,runStartedAt:x,canShowTimestamps:S,timeZone:C,testStatsById:w,selectedId:T,onSelect:E,onPointer:D,onHoverClear:O,labelColumnResize:k}){let A=(0,c.useRef)(null),[ee,j]=(0,c.useState)(0);return(0,c.useLayoutEffect)(()=>{let e=A.current;if(!e)return;let t=()=>j(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,u.jsxs)(`section`,{ref:A,className:`chart-frame`,style:{position:`relative`,userSelect:`none`},children:[(0,u.jsx)(`canvas`,{ref:e,style:{position:`absolute`,top:0,left:0,width:`100%`,height:h,pointerEvents:`none`,display:`block`}}),(0,u.jsx)(Im,{edges:n,focusId:r,itemById:i,bundleIndexById:a,bundles:o,rowOffsets:s,canvasWidth:l>0?l:600,effectiveLabelW:d,rangeStart:f,rangeEnd:p,scrollTop:m,viewportH:h,theme:v,showTests:y}),(0,u.jsx)(`div`,{ref:t,className:`chart-frame__viewport`,role:`region`,tabIndex:0,"aria-label":`Timeline chart viewport — use arrow keys to scroll`,style:{position:`relative`,height:h,overflowY:g?`auto`:`hidden`},onMouseMove:e=>D(e,`move`),onClick:e=>D(e,`click`),onKeyDown:e=>{if(e.key!==`Enter`&&e.key!==` `)return;e.preventDefault();let t=b?.item.unique_id??T;t&&E?.(t)},onMouseLeave:O,children:(0,u.jsx)(`div`,{style:{height:_}})}),k?(0,u.jsx)(Rm,{labelColumnW:k.width,viewportH:k.viewportH,minW:k.minW,maxW:k.maxW,onWidthChange:k.onChange}):null,b&&(0,u.jsx)(Wm,{hover:b,frameWidth:ee>0?ee:l,frameHeight:h,runStartedAt:x,canShowTimestamps:S,timeZone:C,testStats:w?.get(b.item.unique_id)})]})}function Km({activeMode:e,onChange:t,activeTimeZone:n,timeZones:r,onTimeZoneChange:i}){return(0,u.jsx)(`div`,{className:`gantt-controls`,children:(0,u.jsxs)(`div`,{className:`gantt-controls__cluster`,children:[e===`timestamps`&&(0,u.jsxs)(`label`,{className:`gantt-timezone-select`,children:[(0,u.jsx)(`span`,{children:`Timezone`}),(0,u.jsx)(`select`,{value:n,onChange:e=>i(e.target.value),children:r.map(e=>(0,u.jsx)(`option`,{value:e,children:e},e))})]}),(0,u.jsxs)(`div`,{className:`gantt-mode-toggle`,children:[(0,u.jsx)(`button`,{type:`button`,className:e===`duration`?`active`:``,onClick:()=>t(`duration`),children:`Duration`}),(0,u.jsx)(`button`,{type:`button`,className:e===`timestamps`?`active`:``,onClick:()=>t(`timestamps`),children:`Timestamps`})]})]})})}var qm=1e3;function Jm(e,t){let n=t?.get(e.item.unique_id);return n&&n.error+n.warn>0?!0:am(e.item.status)||e.tests.some(e=>am(e.status))}function Ym(e,t,n){return{start:Math.max(0,Math.min(e,n)),end:Math.max(0,Math.min(t,n))}}function Xm({bundles:e,maxEnd:t,timeWindow:n,testStatsById:r,onChange:i}){let a=(0,c.useRef)(null),[o,s]=(0,c.useState)(null),l=(0,c.useRef)(null),d=Math.min(Math.max(qm,t*.01),t),f=n?.start??0,p=n?.end??t,m=n!=null;function h(e){let n=a.current;if(!n)return 0;let r=n.clientWidth;return r<=0||t<=0?0:(e-n.getBoundingClientRect().left)/r*t}function g(e,r){if(!a.current||a.current.clientWidth<=0||t<=0)return;let i=h(e.clientX);l.current={mode:r,startPx:e.clientX,initialStart:r===`create`?i:f,initialEnd:r===`create`?i:p,currentStart:r===`create`?i:f,currentEnd:r===`create`?i:p},s(r===`create`?{start:i,end:i}:n),a.current.setPointerCapture(e.pointerId)}function _(e){let n=l.current,r=a.current;if(!n||!r||t<=0)return;let i=r.clientWidth;if(i<=0)return;let o=(e.clientX-n.startPx)/i*t,c=n.initialEnd-n.initialStart,u=h(e.clientX);if(n.mode===`create`){let e={start:Math.min(n.initialStart,u),end:Math.max(n.initialStart,u)};l.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}if(n.mode===`pan`){let e=Math.min(Math.max(0,n.initialStart+o),t-c),r={start:e,end:e+c};l.current={...n,currentStart:r.start,currentEnd:r.end},s(r);return}if(n.mode===`start`){let e={start:Math.min(Math.max(0,n.initialStart+o),n.initialEnd-d),end:n.initialEnd};l.current={...n,currentStart:e.start,currentEnd:e.end},s(e);return}let f=Math.max(Math.min(t,n.initialEnd+o),n.initialStart+d),p={start:n.initialStart,end:f};l.current={...n,currentStart:p.start,currentEnd:p.end},s(p)}function v(e){let n=l.current;if(n&&a.current?.hasPointerCapture(e.pointerId)&&a.current.releasePointerCapture(e.pointerId),n){let e=Ym(n.currentStart,n.currentEnd,t),r=e.end-e.start;(n.mode!==`create`||r>=d)&&(e.start<=0&&e.end>=t?i(null):i(e))}l.current=null,s(null)}let y=o??(m?{start:f,end:p}:{start:0,end:t}),b=y==null?0:Math.max(0,Math.min(100,y.start/t*100)),x=y==null?0:Math.max(0,Math.min(100,y.end/t*100)),S=Math.max(0,x-b);return(0,u.jsxs)(`div`,{className:`gantt-brush-wrap`,children:[(0,u.jsxs)(`div`,{className:`gantt-brush__header`,children:[(0,u.jsx)(`p`,{className:`gantt-brush__title`,children:`Time range`}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,disabled:!m,onClick:()=>i(null),children:`Reset zoom`})]}),(0,u.jsxs)(`div`,{ref:a,className:`gantt-brush`,onPointerDown:e=>{e.target!==e.currentTarget||e.button!==0||g(e,`create`)},onPointerMove:_,onPointerUp:v,onPointerCancel:v,role:`slider`,"aria-label":`Timeline time range`,"aria-valuemin":0,"aria-valuemax":Math.round(t),"aria-valuenow":Math.round(f),"aria-valuetext":`${Math.round(f)} to ${Math.round(p)} ms`,children:[e.map(e=>{let n=Math.max(0,e.item.start),i=Math.max(n,e.item.end),a=n/t*100,o=Math.max(.2,(i-n)/t*100),s=Jm(e,r);return(0,u.jsx)(`span`,{className:s?`gantt-brush__bar gantt-brush__bar--issue`:`gantt-brush__bar`,"data-issue":s?`true`:`false`,style:{left:`${a}%`,width:`${o}%`}},e.item.unique_id)}),y!=null&&(0,u.jsxs)(`div`,{className:m||o!=null?`gantt-brush__selection`:`gantt-brush__selection gantt-brush__selection--default`,"data-default-range":m||o!=null?`false`:`true`,style:{left:`${b}%`,width:`${S}%`},onPointerDown:e=>g(e,`pan`),children:[(0,u.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--start`,onPointerDown:e=>{e.stopPropagation(),g(e,`start`)}}),(0,u.jsx)(`span`,{className:`gantt-brush__handle gantt-brush__handle--end`,onPointerDown:e=>{e.stopPropagation(),g(e,`end`)}})]})]})]})}function Zm(e,t,n,r,i,a,o=2){let s=Math.max(1,t-e),c=i+a,l=i+(n-e)/s*a,u=i+(r-e)/s*a,d=Math.max(i,Math.min(l,u));return{x:d,width:Math.max(o,Math.min(c,Math.max(l,u))-d)}}function Qm(e,t){return t&&e.laneCount>0?49+e.laneCount*14+5:44}function $m(e,t){let n=[],r=[],i=0;for(let a of e){n.push(i);let e=Qm(a,t);r.push(e),i+=e}return{rowOffsets:n,rowHeights:r,totalHeight:i}}function eh(e,t,n){if(e.length===0)return-1;let r=0,i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a]??0,s=t[a]??44;if(o>n)i=a-1;else if(o+s<=n)r=a+1;else return a}return-1}function th(e,t,n,r,i,a,o,s){let{rowOffsets:c,rowHeights:l,showTests:u}=n;if(!s)return null;let d=e.currentTarget.getBoundingClientRect(),f=e.clientX-d.left,p=e.clientY-d.top;if(p<32||f<0)return null;let m=eh(c,l,p-32+r);if(m<0||m>=t.length)return null;let h=t[m];if(!h)return null;let g=s.getBoundingClientRect().width-o-24,_=32+(c[m]??0)-r;if(f<o)return{item:h.item,x:f,y:p};let v=o,{x:y,width:b}=Zm(i,a,h.item.start,h.item.end,v,g);if(f>=y&&f<=y+b)return{item:h.item,x:f,y:p};if(u&&h.lanes.length>0)for(let{item:e,lane:t}of h.lanes){let{x:n,width:r}=Zm(i,a,e.start,e.end,v,g,4),o=_+44+5+t*14;if(f>=n&&f<=n+r&&p>=o&&p<=o+10)return{item:e,x:f,y:p}}return null}function nh(e,t,n){let{bundles:r,layout:i,scrollTop:a,rangeStart:o,rangeEnd:s,effectiveLabelW:c,canvas:l,setHover:u,onSelect:d}=n,f=th(e,r,i,a,o,s,c,l);if(!f){t===`move`?u(null):d?.(null);return}if(t===`move`){u({item:f.item,x:f.x,y:f.y});return}d?.(f.item.unique_id)}var rh={...Se};function ih(e,t=`light`){return(t===`dark`?Ce:Se)[e.toLowerCase()]??xe(t).textSoft}function ah(e,t=`light`){let n=Pe(t);return(e&&n[e])??xe(t).borderSubtle}var oh=3,sh=2.25;function ch(e){return(e?.error??0)+(e?.warn??0)>0}function lh(e,t,n,r,i,a){r<2*a&&(a=r/2),i<2*a&&(a=i/2),e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+r,n,t+r,n+i,a),e.arcTo(t+r,n+i,t,n+i,a),e.arcTo(t,n+i,t,n,a),e.arcTo(t,n,t+r,n,a),e.closePath()}function uh(e,t,n,r,i,a){lh(e,t,n,r,i,a),e.fill()}function dh(e,t,n,r,i,a){lh(e,t,n,r,i,a),e.stroke()}function fh(e,t){let{rangeStart:n,rangeEnd:r,chartLeft:i,chartW:a,compileStart:o,compileEnd:s,barX:c,barY:l,barW:u,barH:d,radius:f,theme:p}=t;if(o==null||s==null||s<=o)return;let m=Math.max(1,r-n),h=i+(o-n)/m*a,g=i+(s-n)/m*a,_=Math.max(c,h),v=Math.min(c+u,g)-_;v<=.5||(e.save(),lh(e,c,l,u,d,f),e.clip(),e.fillStyle=p===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,e.fillRect(_,l,v,d),e.restore())}function ph(e,t,n,r,i,a,o,s){t%2==0&&(e.fillStyle=o?s.rowStripeHover:s.rowStripe,e.globalAlpha=a?1:.35,e.fillRect(0,n,r,i),e.globalAlpha=1)}function mh({ctx:e,item:t,rowY:n,labelW:r,xOffset:i,emphasis:a,palette:o}){e.save(),e.globalAlpha=a,e.beginPath(),e.rect(i,n,r-10-i,44),e.clip(),e.textAlign=`left`,e.textBaseline=`middle`,e.font=`12px "IBM Plex Sans", "Avenir Next", sans-serif`,e.fillStyle=o.labelText,e.fillText(t.name||t.unique_id,i+2,n+44/2),e.restore()}function hh({ctx:e,item:t,rowY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,emphasis:s,isHovered:c,attachedTestStats:l,palette:u,theme:d}){let f=n+6,{x:p,width:m}=Zm(r,i,t.start,t.end,o,a),h=ch(l),g=am(t.status)||h;e.save(),e.globalAlpha=s,e.fillStyle=Ie(t.resourceType,d),uh(e,p,f,m,14,3),fh(e,{rangeStart:r,rangeEnd:i,chartLeft:o,chartW:a,compileStart:t.compileStart,compileEnd:t.compileEnd,barX:p,barY:f,barW:m,barH:14,radius:3,theme:d}),h&&rm(t.status)&&(e.fillStyle=u.testFailStripe,uh(e,p,f+14-4,m,4,2)),e.strokeStyle=g?u.testFailStripe:ih(t.status,d),e.lineWidth=g?oh:2,dh(e,p,f,m,14,3),e.restore(),c&&(e.save(),e.globalAlpha=1,e.strokeStyle=u.barHoverStroke,e.lineWidth=1.5,dh(e,p,f,m,14,3),e.restore())}function gh({ctx:e,test:t,chipY:n,rangeStart:r,rangeEnd:i,chartW:a,labelW:o,palette:s,theme:c,emphasis:l,isHovered:u}){let{x:d,width:f}=Zm(r,i,t.start,t.end,o,a,4),p=am(t.status);e.save(),e.globalAlpha=l,e.fillStyle=Ie(t.resourceType,c),uh(e,d,n,f,10,2),fh(e,{rangeStart:r,rangeEnd:i,chartLeft:o,chartW:a,compileStart:t.compileStart,compileEnd:t.compileEnd,barX:d,barY:n,barW:f,barH:10,radius:2,theme:c}),e.strokeStyle=p?s.testFailStripe:ih(t.status,c),e.lineWidth=p?sh:1.5,dh(e,d,n,f,10,2),e.restore(),u&&(e.save(),e.globalAlpha=1,e.strokeStyle=s.barHoverStroke,e.lineWidth=1,dh(e,d,n,f,10,2),e.restore())}function _h(e,t){let n=e.getContext(`2d`);if(!n)return null;let r=e.getBoundingClientRect(),i=window.devicePixelRatio||1,a=r.width,o=r.height;return a===0||o===0?null:(e.width=a*i,e.height=o*i,n.scale(i,i),n.clearRect(0,0,a,o),{ctx:n,w:a,h:o,chartW:a-t-24})}function vh({ctx:e,labelW:t,chartW:n,h:r,rangeStart:i,rangeEnd:a,displayMode:o,runStartedAt:s,timeZone:c,palette:l}){let u=Math.max(1,a-i),d=lm(i,a);e.font=`11px 'IBM Plex Mono', 'Fira Mono', monospace`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=l.axisTick;let f=e=>o===`timestamps`&&s!=null?$p(s+e.ms,c):e.label,p=um(d,i,a,n,f,t=>e.measureText(t).width);for(let a of p){let o=t+(a.ms-i)/u*n;e.strokeStyle=l.gridLine,e.lineWidth=1,e.beginPath(),e.moveTo(o,32),e.lineTo(o,r),e.stroke(),e.fillText(f(a),o,32/2)}}function yh(e){let{ctx:t,bundle:n,rowIndex:r,rowY:i,bundleRowHeightPx:a,w:o,labelW:s,chartW:c,rangeStart:l,rangeEnd:u,focusIds:d,hoveredId:f,theme:p,palette:m,testStatsById:h,showTests:g}=e,_=d==null||d.has(n.item.unique_id)||n.lanes.some(e=>d.has(e.item.unique_id)),v=d==null||d.has(n.item.unique_id),y=f===n.item.unique_id,b=v?1:.18;if(ph(t,r,i,o,a,_,y,m),mh({ctx:t,item:n.item,rowY:i,labelW:s,xOffset:0,emphasis:b,palette:m}),hh({ctx:t,item:n.item,rowY:i,rangeStart:l,rangeEnd:u,chartW:c,labelW:s,emphasis:b,isHovered:y,attachedTestStats:h?.get(n.item.unique_id),palette:m,theme:p}),!(!g||n.lanes.length===0))for(let{item:e,lane:r}of n.lanes){let n=i+44+5+r*14,a=f===e.unique_id;gh({ctx:t,test:e,chipY:n,rangeStart:l,rangeEnd:u,chartW:c,labelW:s,palette:m,theme:p,emphasis:d==null||d.has(e.unique_id)?1:.18,isHovered:a})}}function bh(e,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,focusIds:l,hoveredId:u,labelW:d=160,timeZone:f,testStatsById:p,theme:m=`light`,showTests:h=!1}){let g=_h(e,d);if(!g)return;let{ctx:_,w:v,h:y,chartW:b}=g,x=ze(m);if(vh({ctx:_,labelW:d,chartW:b,h:y,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:c,timeZone:f,palette:x}),t.length===0)return;let S=y-32,C=xh(n,i),w=Sh(n,r,i,S);_.textBaseline=`middle`;for(let e=C;e<=w;e++){let s=t[e];if(!s)continue;let c=32+(n[e]??0)-i;yh({ctx:_,bundle:s,rowIndex:e,rowY:c,bundleRowHeightPx:r[e]??44,w:v,labelW:d,chartW:b,rangeStart:a,rangeEnd:o,focusIds:l,hoveredId:u,theme:m,palette:x,testStatsById:p,showTests:h})}}function xh(e,t){if(e.length===0)return 0;let n=0,r=e.length-1;for(;n<r;){let i=Math.floor((n+r)/2);(e[i]??0)<t?n=i+1:r=i}return Math.max(0,n-1)}function Sh(e,t,n,r){let i=n+r,a=0;for(let r=0;r<e.length;r++){let o=e[r]??0;if(!(o+(t[r]??44)<=n)){if(o>=i)break;a=r}}return a}function Ch({canvasRef:e,bundles:t,rowOffsets:n,rowHeights:r,scrollTop:i,rangeStart:a,rangeEnd:o,activeMode:s,runStartedAt:l,focusedIds:u,hoveredId:d,effectiveLabelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g,setContainerWidth:_}){(0,c.useEffect)(()=>{if(t.length===0)return;function c(){let c=e.current;c&&bh(c,t,n,r,{scrollTop:i,rangeStart:a,rangeEnd:o,displayMode:s,runStartedAt:l,focusIds:u,hoveredId:d,labelW:f,timeZone:p,testStatsById:m,theme:h,showTests:g})}let v=e.current;if(!v)return;c();let y=new ResizeObserver(e=>{let t=e[0];t&&_(t.contentRect.width),c()});return y.observe(v),()=>y.disconnect()},[t,n,r,i,a,o,s,l,u,d,f,p,m,h,g,_])}function wh(e){return Math.max(1,Math.min(3,Math.trunc(e)))}function Th(e){let t=wh(e.dependencyDepthHops);return{includeUpstream:e.dependencyDirection!==`downstream`,includeDownstream:e.dependencyDirection!==`upstream`,showAllUpstream:!1,maxUpstreamEdges:8,showAllDownstream:!1,maxDownstreamEdges:8,extendedDeps:t>1?{enabled:!0,maxHops:wh(t),maxEdgesPerDirection:12}:{enabled:!1}}}function Eh({edgeFocusId:e,timelineAdjacency:t,itemById:n,bundleIndexById:r,dependencyDirection:i,dependencyDepthHops:a}){let o=(0,c.useMemo)(()=>Th({dependencyDirection:i,dependencyDepthHops:a}),[a,i]),{edges:s}=(0,c.useMemo)(()=>km(e,t,n,r,o),[e,t,n,r,o]);return{edges:s}}function Dh({data:e,runStartedAt:t,timelineAdjacency:n,testStatsById:r,showTests:i=!1,dependencyDirection:a=`both`,dependencyDepthHops:o=2,selectedId:l=null,onSelect:d,timeWindow:f=null,onTimeWindowChange:p}){let m=jt(),h=(0,c.useRef)(null),g=(0,c.useRef)(null),[_,v]=(0,c.useState)(null),[y,b]=(0,c.useState)(`duration`),[x,S]=(0,c.useState)(tm),[C,w]=(0,c.useState)(0),[T,E]=(0,c.useState)(()=>typeof window>`u`?900:window.innerHeight),D=(0,c.useMemo)(()=>em(),[]),O=t!=null,k=O?y:`duration`;(0,c.useEffect)(()=>{try{window.localStorage.setItem(Zp,x)}catch{}},[x]);let{effectiveLabelW:A,maxLabelW:ee,onLabelColumnWidthDrag:j}=fm(C),M=(0,c.useMemo)(()=>Kp(e),[e]),te=(0,c.useMemo)(()=>{let e=1;for(let t of M){e=Math.max(e,t.item.end);for(let n of t.tests)e=Math.max(e,n.end)}return e},[M]),N=(0,c.useMemo)(()=>{if(!f)return M;let{start:t,end:n}=f,r=new Set;for(let e of M)for(let i of e.tests)if(i.end>t&&i.start<n){r.add(e.item.unique_id);break}return Kp(e.filter(e=>e.end>t&&e.start<n?!0:r.has(e.unique_id)))},[e,M,f]),P=f?.start??0,F=f?f.end:te,I=P,ne=F,{rowOffsets:re,rowHeights:ie}=(0,c.useMemo)(()=>$m(N,i),[N,i]),ae=(0,c.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.unique_id,n);return t},[e]),oe=s({count:N.length,getScrollElement:()=>g.current,estimateSize:e=>N[e]?Qm(N[e],i):44,getItemKey:e=>N[e]?.item.unique_id??e,overscan:10}),se=oe.scrollOffset??0;(0,c.useLayoutEffect)(()=>{oe.measure()},[N,i,oe]);let ce=(0,c.useMemo)(()=>({rowOffsets:re,rowHeights:ie,showTests:i}),[re,ie,i]),le=(0,c.useMemo)(()=>{let e=new Map;for(let t=0;t<N.length;t++){let n=N[t];if(n){e.set(n.item.unique_id,t);for(let r of n.tests)e.set(r.unique_id,t)}}return e},[N]),ue=l??_?.item.unique_id??null,{edges:de}=Eh({edgeFocusId:ue,timelineAdjacency:n,itemById:ae,bundleIndexById:le,dependencyDirection:a,dependencyDepthHops:o}),fe=(0,c.useMemo)(()=>{if(!ue)return null;let e=new Set([ue]);for(let t of de)e.add(t.fromId),e.add(t.toId);return e},[ue,de]),pe=32+oe.getTotalSize(),me=Math.max(240,Math.min(T-320,Math.round(T*Yp))),he=Math.max(240,Math.min(me,pe)),ge=pe>he;if((0,c.useEffect)(()=>{let e=()=>E(window.innerHeight);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),Ch({canvasRef:h,bundles:N,rowOffsets:re,rowHeights:ie,scrollTop:se,rangeStart:I,rangeEnd:ne,activeMode:k,runStartedAt:t,focusedIds:fe,hoveredId:_?.item.unique_id??null,effectiveLabelW:A,timeZone:x,testStatsById:r,theme:m,showTests:i,setContainerWidth:w}),M.length===0)return(0,u.jsx)(`div`,{className:`empty-state empty-state--chart`,children:`No Gantt data (run_results may lack timing info)`});function _e(e,t){nh(e,t,{bundles:N,layout:ce,scrollTop:se,rangeStart:I,rangeEnd:ne,effectiveLabelW:A,canvas:h.current,setHover:v,onSelect:d})}return(0,u.jsxs)(`div`,{className:`gantt-shell`,role:`region`,"aria-label":`Execution timeline`,children:[O&&(0,u.jsx)(Km,{activeMode:k,onChange:b,activeTimeZone:x,timeZones:D,onTimeZoneChange:S}),(0,u.jsx)(Xm,{bundles:M,maxEnd:te,timeWindow:f,testStatsById:r,onChange:p??(()=>{})}),(0,u.jsx)(Gm,{canvasRef:h,scrollRef:g,edges:de,edgeFocusId:ue,itemById:ae,bundleIndexById:le,bundles:N,rowOffsets:re,containerWidth:C,effectiveLabelW:A,rangeStart:I,rangeEnd:ne,scrollTop:se,viewportH:he,needsScroll:ge,totalScrollH:pe,theme:m,showTests:i,hover:_,runStartedAt:t,canShowTimestamps:O,timeZone:x,testStatsById:r,selectedId:l,onSelect:d,onPointer:_e,onHoverClear:()=>v(null),labelColumnResize:{width:A,viewportH:he,minW:120,maxW:ee,onChange:j}})]})}var Oh={display:`inline-block`,width:10,height:10,borderRadius:2,flexShrink:0},kh=` gantt-legend__item--active`;function Ah(e){return`gantt-legend__item${e?kh:``}`}function jh(e,t){return{...Oh,background:e.bgSoft,borderLeft:`3px solid ${t}`,borderRadius:0}}function Mh({theme:e,themeHex:t,showCompileExecuteLegend:n}){let r=Ie(`model`,e),i=ih(`success`,e);return(0,u.jsxs)(`div`,{className:`gantt-legend__group gantt-legend__group--bar-key`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Bars`}),(0,u.jsxs)(`div`,{className:`gantt-legend__bar-key-row`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`2px solid ${t.borderDefault}`,borderRadius:3},title:`Bar fill follows resource type`,"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Fill = type`}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:t.bgSoft,border:`2px solid ${i}`,borderRadius:3},title:`Bar outline follows run status`,"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Border = status`})]}),n?(0,u.jsxs)(`div`,{className:`gantt-legend__bar-key-row gantt-legend__bar-key-row--phases`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:e===`dark`?`rgba(0, 0, 0, 0.24)`:`rgba(0, 0, 0, 0.12)`,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Compile (darker)`}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-swatch`,style:{background:r,border:`1px solid ${t.borderDefault}`,borderRadius:2},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__bar-key-caption`,children:`Execute`})]}):null]})}function Nh({statusCounts:e,typeCounts:t,activeStatuses:n,activeTypes:r,onToggleStatus:i,onToggleType:a,showTests:o,onToggleShowTests:s,testsLegendCount:c=0,failuresOnly:l,onToggleFailuresOnly:d,showBarEncodingKey:f=!0,showCompileExecuteLegend:p=!1}){let m=jt(),h=xe(m),g=Object.keys(rh).filter(t=>(e[t]??0)>0),_=[...new Set([...Ge,...Object.keys(t)])].sort((e,t)=>e.localeCompare(t));return g.length>0||_.length>0||s!=null||d!=null?(0,u.jsxs)(`div`,{className:`gantt-legend`,children:[f?(0,u.jsx)(Mh,{theme:m,themeHex:h,showCompileExecuteLegend:p}):null,(g.length>0||d!=null)&&(0,u.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Status`}),g.map(t=>{let r=n?.has(t)??!1,a=ih(t,m),o=e[t]??0;return(0,u.jsxs)(`button`,{type:`button`,className:Ah(r),onClick:()=>i?.(t),title:`${t} (${o})`,children:[(0,u.jsx)(`span`,{style:{...Oh,background:a}}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:t}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:o})]},t)}),d!=null&&(0,u.jsxs)(`button`,{type:`button`,className:Ah(!!l),onClick:d,title:l?`Show all parent rows`:`Show only parents with errors or failing tests`,"aria-pressed":l??!1,children:[(0,u.jsx)(`span`,{style:{...Oh,background:ih(`fail`,m)},"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:`failures only`})]})]}),(_.length>0||s!=null)&&(0,u.jsxs)(`div`,{className:`gantt-legend__group`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Type`}),_.map(e=>{let n=r?.has(e)??!1,i=ah(e,m),o=t[e]??0;return(0,u.jsxs)(`button`,{type:`button`,className:Ah(n),onClick:()=>a?.(e),title:`${e} (${o})`,children:[(0,u.jsx)(`span`,{style:jh(h,i)}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:e}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:o})]},e)}),s!=null&&(0,u.jsxs)(`button`,{type:`button`,className:Ah(!!o),onClick:s,title:o?`Hide test chips`:`Show test chips`,"aria-pressed":o??!1,children:[(0,u.jsx)(`span`,{style:jh(h,ah(`test`,m)),"aria-hidden":!0}),(0,u.jsx)(`span`,{className:`gantt-legend__name`,children:`tests`}),(0,u.jsx)(`span`,{className:`gantt-legend__count`,children:c})]})]})]}):null}var Ph=[{value:`upstream`,label:`Upstream`,glyph:`←`},{value:`both`,label:`Both`,glyph:`⇄`},{value:`downstream`,label:`Downstream`,glyph:`→`}];function Fh({filters:e,setFilters:t}){let n=wh(e.dependencyDepthHops),r=e=>t(t=>({...t,dependencyDepthHops:wh(e)}));return(0,u.jsx)(`div`,{className:`timeline-dependency-controls gantt-legend`,"aria-label":`Dependency visualization controls`,children:(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__top-row`,children:[(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__zone`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Depth`}),(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__stepper`,role:`group`,"aria-label":`Dependency depth`,children:[(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n-1),disabled:n<=1,"aria-label":`Decrease dependency depth`,children:`-`}),(0,u.jsx)(`span`,{className:`timeline-dependency-controls__depth-value`,children:n}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>r(n+1),disabled:n>=3,"aria-label":`Increase dependency depth`,children:`+`})]})]}),(0,u.jsx)(`div`,{className:`timeline-dependency-controls__divider`,"aria-hidden":`true`}),(0,u.jsxs)(`div`,{className:`timeline-dependency-controls__zone timeline-dependency-controls__zone--direction`,children:[(0,u.jsx)(`span`,{className:`gantt-legend__label`,children:`Direction`}),(0,u.jsx)(`div`,{className:`workspace-segmented-control`,role:`tablist`,"aria-label":`Dependency direction`,children:Ph.map(n=>{let r=e.dependencyDirection===n.value;return(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,className:r?`workspace-segmented-control__button workspace-segmented-control__button--active`:`workspace-segmented-control__button`,onClick:()=>t(e=>({...e,dependencyDirection:n.value})),children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,children:n.glyph}),` `,n.label]},n.value)})}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill timeline-dependency-controls__max-button`,onClick:()=>r(3),children:`Max`})]})]})})}function Ih({filters:e,hasActiveFilters:t,typeFilterHint:n,setFilters:r}){return(0,u.jsxs)(`div`,{className:`timeline-toolbar`,children:[(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact timeline-toolbar__search`,children:[(0,u.jsx)(`span`,{children:`Search nodes`}),(0,u.jsxs)(`div`,{className:`workspace-search__input-row`,children:[(0,u.jsx)(`input`,{value:e.query,onChange:e=>r(t=>({...t,query:e.target.value})),placeholder:`Filter by name or id…`,"aria-label":`Search timeline nodes`}),e.query&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-search__clear`,"aria-label":`Clear search`,onClick:()=>r(e=>({...e,query:``})),children:`✕`})]})]}),(n!=null||t)&&(0,u.jsxs)(`div`,{className:`timeline-toolbar__actions`,children:[n!=null&&(0,u.jsxs)(`p`,{className:`timeline-toolbar__hint`,role:`status`,children:[n.shown.length>0?`Showing types: ${n.shown.join(`, `)}. `:``,`Hidden by type filter:`,` `,n.hidden.map(({type:e,count:t})=>`${e} (${t})`).join(`, `),`.`]}),(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>{r(e=>({...e,query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:null,dependencyDirection:`both`,dependencyDepthHops:2}))},children:`Clear all filters`})]})]})}function Lh(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Rh(e,t,n){let r=n.get(e.unique_id),i=r?r.error+r.warn>0:t.some(e=>!rm(e.status));return!rm(e.status)||i}function zh({analysis:e,filters:t,effectiveActiveTypes:n,filteredData:r,bundleRowCount:i,statusCounts:a,typeCounts:o,testsLegendCount:s,hasActiveFilters:l,typeFilterHint:d,testStatsById:f,setFilters:p,toggleStatus:m,toggleType:h,onInvestigationSelectionChange:g}){let _=(0,c.useMemo)(()=>ft(e.ganttData),[e.ganttData]),{timeWindow:v}=t;return(0,u.jsxs)(zt,{title:`Execution timeline`,subtitle:`Relative start and duration for each executed node.`,children:[(0,u.jsx)(Nh,{statusCounts:a,typeCounts:o,testsLegendCount:s,activeStatuses:t.activeStatuses,activeTypes:n,onToggleStatus:m,onToggleType:h,showTests:t.showTests,onToggleShowTests:()=>p(e=>({...e,showTests:!e.showTests})),failuresOnly:t.failuresOnly,onToggleFailuresOnly:()=>p(e=>({...e,failuresOnly:!e.failuresOnly})),showCompileExecuteLegend:_}),(0,u.jsx)(Fh,{filters:t,setFilters:p}),(0,u.jsx)(Ih,{filters:t,hasActiveFilters:l,typeFilterHint:d,setFilters:p}),v!=null&&(0,u.jsxs)(`p`,{className:`timeline-zoom-active`,role:`status`,children:[`Zoomed to `,Qp(v.end-v.start),` window`,` — `,(0,u.jsx)(`button`,{type:`button`,className:`timeline-zoom-clear`,onClick:()=>p(e=>({...e,timeWindow:null})),children:`Clear zoom ×`})]}),i>=2e4?(0,u.jsxs)(`p`,{className:`timeline-large-dataset-hint`,role:`status`,children:[`Showing `,i.toLocaleString(),` timeline rows. Use search or type and status filters to narrow the list.`]}):null,(0,u.jsx)(Dh,{data:r,runStartedAt:e.runStartedAt,timelineAdjacency:e.timelineAdjacency,testStatsById:f,showTests:t.showTests,dependencyDirection:t.dependencyDirection,dependencyDepthHops:t.dependencyDepthHops,selectedId:t.selectedExecutionId,timeWindow:v,onTimeWindowChange:e=>p(t=>({...t,timeWindow:e})),onSelect:t=>{p(e=>({...e,selectedExecutionId:t})),g(n=>({...n,selectedExecutionId:t,selectedResourceId:t==null?n.selectedResourceId:e.resources.find(e=>e.uniqueId===t)?.uniqueId??n.selectedResourceId,sourceLens:`timeline`}))}})]})}function Bh({analysis:e,filters:t,setFilters:n,onInvestigationSelectionChange:r}){let i=(0,c.useDeferredValue)(t.query),a=e.projectName??st(e.executions),o=(0,c.useMemo)(()=>Array.from(new Set(e.ganttData.filter(e=>dt(e,a)).map(e=>e.resourceType).filter(e=>!!e))).sort(),[e.ganttData,a]),s=(0,c.useMemo)(()=>ut(o),[o]),l=t.activeTypes.size>0?t.activeTypes:s;function d(e){n(t=>{let n=new Set(t.activeStatuses);return n.has(e)?n.delete(e):n.add(e),{...t,activeStatuses:n}})}function f(e){n(t=>{let n=new Set(t.activeTypes.size>0?t.activeTypes:s);return n.has(e)?n.delete(e):n.add(e),{...t,activeTypes:n}})}let p=(0,c.useMemo)(()=>Tn(e.resources,e.dependencyIndex),[e.dependencyIndex,e.resources]),m=(0,c.useMemo)(()=>{let t=new Map;for(let n of e.ganttData){if(!z.has(n.resourceType)||n.parentId==null)continue;let e=t.get(n.parentId)??[];e.push(n),t.set(n.parentId,e)}return t},[e.ganttData]),h=(0,c.useMemo)(()=>e.ganttData.filter(e=>{if(z.has(e.resourceType)||t.activeTypes.size===0&&!dt(e,a)||t.activeStatuses.size>0&&!t.activeStatuses.has(e.status.toLowerCase())||l.size>0&&!l.has(e.resourceType??``))return!1;if(i){let t=i.trim().toLowerCase();if(t&&!e.name.toLowerCase().includes(t)&&!e.unique_id.toLowerCase().includes(t))return!1}return!(t.failuresOnly&&!Rh(e,m.get(e.unique_id)??[],p))}),[e.ganttData,i,l,t.activeStatuses,t.failuresOnly,t.activeTypes.size,a,p,m]),g=(0,c.useMemo)(()=>new Set(h.map(e=>e.unique_id)),[h]),_=(0,c.useMemo)(()=>t.showTests?e.ganttData.filter(e=>z.has(e.resourceType)&&e.parentId!=null&&g.has(e.parentId)):[],[e.ganttData,t.showTests,g]),v=(0,c.useMemo)(()=>[...h,..._],[h,_]),{statusCounts:y,typeCounts:b}=(0,c.useMemo)(()=>{let t={},n={};for(let r of e.ganttData){if(!dt(r,a))continue;let e=r.status.toLowerCase();t[e]=(t[e]??0)+1;let i=r.resourceType;n[i]=(n[i]??0)+1}return{statusCounts:t,typeCounts:n}},[e.ganttData,a]),x=(0,c.useMemo)(()=>pt(e.ganttData,a),[e.ganttData,a]),S=!Lh(l,s),C=(0,c.useMemo)(()=>{if(!S)return null;let e=[...l].filter(e=>s.has(e)).sort(),t=[...s].filter(e=>!l.has(e)).sort().map(e=>({type:e,count:b[e]??0}));return t.length===0?null:{shown:e,hidden:t}},[s,l,S,b]),w=t.activeStatuses.size>0||S||t.query.length>0;return(0,u.jsx)(Ut,{title:`Timeline`,description:`Runtime timing, concurrency, bottlenecks, and execution order.`,className:`timeline-view`,children:(0,u.jsx)(zh,{analysis:e,filters:t,effectiveActiveTypes:l,filteredData:v,bundleRowCount:h.length,statusCounts:y,typeCounts:b,testsLegendCount:x,hasActiveFilters:w,typeFilterHint:C,testStatsById:p,setFilters:n,toggleStatus:d,toggleType:f,onInvestigationSelectionChange:r})})}var Vh=100;function Hh(){return{status:{all:0,positive:0,warning:0,danger:0},facets:{all:0,models:0,tests:0,seeds:0,snapshots:0,operations:0,healthy:0,warnings:0,errors:0,issues:0},resourceTypes:{},threadIds:{}}}function Uh(e,t,n=!0){let r=(0,c.useRef)(null),i=(0,c.useRef)(0),[a,o]=(0,c.useState)(!1),[s,l]=(0,c.useState)(Vh),[u,d]=(0,c.useState)([]),[f,p]=(0,c.useState)(0),[m,h]=(0,c.useState)(Hh),[g,_]=(0,c.useState)(!0),[v,y]=(0,c.useState)(!1),[b,x]=(0,c.useState)(null);return(0,c.useEffect)(()=>{l(Vh)},[t.kind,t.status,t.query,t.durationBand,t.sortBy,t.resourceTypes,t.threadIds,e]),(0,c.useEffect)(()=>{if(!n){o(!1),_(!1),y(!1),d([]),p(0),h(Hh()),x(null);return}let t=new Worker(new URL(`/assets/resultsQuery.worker-DeSSHvCv.js`,``+import.meta.url),{type:`module`});return r.current=t,o(!1),_(!0),d([]),p(0),h(Hh()),x(null),t.onmessage=e=>{let t=e.data;if(t.type===`ready`){o(!0),_(!1),h(t.summary);return}if(t.type===`query-result`){if(t.requestId!==i.current)return;d(t.rows),p(t.totalMatches),h(t.summary),y(!1);return}x(t.message),_(!1),y(!1)},t.postMessage({type:`init`,rows:e}),()=>{t.terminate(),r.current=null}},[e,n]),(0,c.useEffect)(()=>{if(!n||!a||r.current==null)return;let e=i.current+1;i.current=e,y(!0),x(null),r.current.postMessage({type:`query`,requestId:e,kind:t.kind,status:t.status,query:t.query,resourceTypes:Array.from(t.resourceTypes),threadIds:Array.from(t.threadIds),durationBand:t.durationBand,sortBy:t.sortBy,limit:s})},[n,a,s,t]),(0,c.useMemo)(()=>({rows:u,totalMatches:f,totalVisible:u.length,summary:m,hasMore:u.length<f,isIndexing:g,isLoading:v,error:b,loadMore:()=>l(e=>e+Vh)}),[u,f,m,g,v,b])}function Wh(e){return e.isScalar?0:1}function Gh(e){return`adapter:${e}`}function Kh(e){return e.startsWith(`adapter:`)}function qh(e,t){return e.adapterResponseFields?.find(e=>e.key===t)}function Jh(e){let t=new Map;for(let n of e){let e=new Set;for(let r of n.adapterResponseFields??[]){if(e.has(r.key))continue;e.add(r.key);let n=t.get(r.key);n?n.presenceCount+=1:t.set(r.key,{field:r,presenceCount:1})}}let n=[...t.entries()].map(([e,t])=>({id:Gh(e),key:e,label:t.field.label,kind:t.field.kind,align:t.field.kind===`number`?`end`:`start`,isScalar:t.field.isScalar,presenceCount:t.presenceCount})).sort((e,t)=>{let n=Wh(e),r=Wh(t);return n===r?e.presenceCount===t.presenceCount?e.key.localeCompare(t.key):t.presenceCount-e.presenceCount:n-r});return{allColumns:n,visibleColumns:n.slice(0,6),overflowColumns:n.slice(6)}}function Yh(e,t){return t.map(t=>{let n=qh(e,t.key);return`${t.label}: ${n?.displayValue??`—`}`}).join(`
|
|
31
|
+
`)}function Xh({row:e,visibleColumns:t,overflowColumns:n,onNavigateTo:r}){if(!e)return null;let i=e.adapterResponseFields?.length??0,a=i>0?[...t.length>0?[{label:`Visible adapter fields`,value:Yh(e,t)}]:[],...n.length>0?[{label:`Overflow adapter fields`,value:Yh(e,n)}]:[],...t.length===0&&n.length===0?[{label:`Adapter response`,value:`This row has no adapter_response fields.`}]:[]]:[{label:`Adapter response`,value:`This row has no adapter_response fields.`}];return(0,u.jsx)(Gt,{eyebrow:`Selected run item`,title:e.name,typeLabel:Xe(e.resourceType),stats:[{label:`Status`,value:e.status},{label:`Duration`,value:Ye(e.executionTime)},{label:`Thread`,value:e.threadId??`n/a`},{label:`Adapter fields`,value:String(i)}],sections:a,actions:[{label:`Open in Timeline`,onClick:()=>r(`timeline`,{resourceId:e.uniqueId,executionId:e.uniqueId})},{label:`Open in Inventory`,onClick:()=>r(`inventory`,{resourceId:e.uniqueId,assetTab:`summary`})},{label:`Open in Lineage`,onClick:()=>r(`inventory`,{resourceId:e.uniqueId,assetTab:`lineage`,rootResourceId:e.uniqueId})}]})}function Zh(e){let t=[`minmax(280px, 2.5fr)`,`minmax(108px, 0.85fr)`,`minmax(132px, 0.95fr)`,`minmax(96px, 0.72fr)`],n=e.map(e=>e.align===`end`?`minmax(120px, 0.95fr)`:`minmax(148px, 1.1fr)`);return[...t,...n,`minmax(160px, 1fr)`].join(` `)}function Qh(e,t){return qh(e,t.key)?.displayValue??`—`}function $h({analysis:e,runsResults:t,runsViewState:n,resultsBodyRef:r,virtualizer:i,adapterColumns:a,onRunsViewStateChange:o,onInvestigationSelectionChange:s}){return(0,u.jsxs)(`div`,{className:`results-table`,style:{"--results-table-columns":Zh(a)},children:[(0,u.jsxs)(`div`,{className:`results-table__header`,children:[(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--item`,children:`Item`}),(0,u.jsx)(`div`,{className:`results-table__cell`,children:`Type`}),(0,u.jsx)(`div`,{className:`results-table__cell`,children:`Status`}),(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--align-end`,children:`Duration`}),a.map(e=>(0,u.jsx)(`div`,{className:`results-table__cell${e.align===`end`?` results-table__cell--align-end`:``}`,title:e.label,children:e.label},e.id)),(0,u.jsx)(`div`,{className:`results-table__cell`,children:`Thread`})]}),(0,u.jsx)(`div`,{ref:r,className:`results-table__body`,style:{height:Math.min(560,Math.max(120,t.rows.length*76)),overflowY:`auto`,position:`relative`},children:(0,u.jsx)(`div`,{style:{height:i.getTotalSize(),position:`relative`},children:i.getVirtualItems().map(r=>{let i=t.rows[r.index];return i?(0,u.jsxs)(`button`,{type:`button`,className:`results-table__row${i.uniqueId===n.selectedExecutionId?` results-table__row--active`:``}`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${r.start}px)`},onClick:()=>{let t=e.resources.find(e=>e.uniqueId===i.uniqueId)??null;o(e=>({...e,selectedExecutionId:i.uniqueId})),s(e=>({...e,selectedExecutionId:i.uniqueId,selectedResourceId:t?.uniqueId??i.uniqueId,sourceLens:`runs`}))},children:[(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--item`,"data-label":`Item`,title:i.name,children:(0,u.jsx)(`strong`,{children:i.name})}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Type`,title:i.resourceType,children:i.resourceType}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Status`,children:(0,u.jsx)(`span`,{className:$e(i.statusTone),children:i.status})}),(0,u.jsx)(`div`,{className:`results-table__cell results-table__cell--align-end`,"data-label":`Duration`,children:Ye(i.executionTime)}),a.map(e=>{let t=Qh(i,e);return(0,u.jsx)(`div`,{className:`results-table__cell${e.align===`end`?` results-table__cell--align-end`:``}`,"data-label":e.label,title:t,children:t},e.id)}),(0,u.jsx)(`div`,{className:`results-table__cell`,"data-label":`Thread`,title:i.threadId??`n/a`,children:i.threadId??`n/a`})]},i.uniqueId):null})})})]})}var eg=[{label:`All`,countKey:`all`},{kind:`models`,label:`Models`,countKey:`models`},{kind:`tests`,label:`Tests`,countKey:`tests`},{kind:`seeds`,label:`Seeds`,countKey:`seeds`},{kind:`snapshots`,label:`Snapshots`,countKey:`snapshots`},{kind:`operations`,label:`Operations`,countKey:`operations`},{status:`positive`,label:`Healthy`,countKey:`healthy`},{status:`issues`,label:`Issues`,countKey:`issues`},{status:`warning`,label:`Warnings`,countKey:`warnings`},{status:`danger`,label:`Errors`,countKey:`errors`}];function tg(e){return e.facets}function ng({runsViewState:e,runsResults:t,adapterColumnLayout:n,adapterMetricsAvailable:r,onRunsViewStateChange:i}){let a=n.visibleColumns.filter(e=>e.isScalar),o=e.showAdapterMetrics&&a.length>0;return(0,u.jsxs)(`div`,{className:`runs-toolbar runs-toolbar--stacked`,children:[(0,u.jsxs)(`div`,{className:`runs-toolbar__controls`,children:[(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact runs-toolbar__search`,children:[(0,u.jsx)(`span`,{children:`Search`}),(0,u.jsx)(`input`,{value:e.query,onChange:e=>i(t=>({...t,query:e.target.value})),placeholder:`Filter by name, type, status, thread…`})]}),(0,u.jsxs)(`label`,{className:`workspace-search workspace-search--compact runs-toolbar__sort`,children:[(0,u.jsx)(`span`,{children:`Sort`}),(0,u.jsxs)(`select`,{value:e.sortBy,onChange:e=>i(t=>({...t,sortBy:e.target.value})),children:[(0,u.jsx)(`option`,{value:`attention`,children:`Attention`}),(0,u.jsx)(`option`,{value:`duration`,children:`Duration`}),(0,u.jsx)(`option`,{value:`name`,children:`Name`}),(0,u.jsx)(`option`,{value:`status`,children:`Status`}),(0,u.jsx)(`option`,{value:`start`,children:`Start`}),o?a.map(e=>(0,u.jsx)(`option`,{value:e.id,children:e.label},e.id)):null]})]}),(0,u.jsxs)(`label`,{className:`runs-toolbar__toggle`,title:r?`Show raw adapter_response columns derived from the current run`:`No adapter_response fields are available in this run`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.showAdapterMetrics,disabled:!r,onChange:e=>{let t=e.target.checked;i(e=>({...e,showAdapterMetrics:t,sortBy:!t&&Kh(e.sortBy)?`attention`:e.sortBy}))}}),(0,u.jsx)(`span`,{children:`Warehouse response`})]})]}),e.showAdapterMetrics&&n.overflowColumns.length>0?(0,u.jsxs)(`p`,{className:`runs-toolbar__meta`,children:[`Showing `,n.visibleColumns.length,` of`,` `,n.allColumns.length,` adapter fields. Select a row to inspect the remaining `,n.overflowColumns.length,`.`]}):null,(0,u.jsx)(`div`,{className:`runs-toolbar__facets`,children:eg.map(n=>{let r=tg(t.summary);return(0,u.jsxs)(`button`,{type:`button`,className:n.kind!=null&&e.kind===n.kind||n.status!=null&&e.status===n.status||n.kind==null&&n.status==null&&e.kind===`all`&&e.status===`all`?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>i(e=>({...e,kind:n.kind??`all`,status:n.status??`all`})),children:[n.label,` (`,r[n.countKey],`)`]},n.label)})})]})}function rg({analysis:e,runsViewState:t,onRunsViewStateChange:n,onInvestigationSelectionChange:r,onNavigateTo:i}){let a=(0,c.useRef)(null),o=(0,c.useMemo)(()=>Jh(e.executions),[e.executions]),l=o.allColumns.length>0,d=(0,c.useMemo)(()=>t.showAdapterMetrics&&l?o.visibleColumns:[],[o.visibleColumns,l,t.showAdapterMetrics]),f=(0,c.useMemo)(()=>t.showAdapterMetrics&&l?o.overflowColumns:[],[o.overflowColumns,l,t.showAdapterMetrics]);(0,c.useEffect)(()=>{let e=t.sortBy;Kh(e)&&!d.some(t=>t.id===e&&t.isScalar)&&n(e=>({...e,sortBy:`attention`}))},[n,t.sortBy,d]);let p=Uh(e.executions,t,!0),m=e.executions.find(e=>e.uniqueId===t.selectedExecutionId)??null,h=s({count:p.rows.length,getScrollElement:()=>a.current,estimateSize:()=>76,overscan:10});return(0,c.useEffect)(()=>{let e=a.current;if(!e)return;let t=()=>{e.scrollHeight-e.scrollTop-e.clientHeight<220&&p.hasMore&&!p.isLoading&&!p.isIndexing&&p.loadMore()};return e.addEventListener(`scroll`,t),t(),()=>e.removeEventListener(`scroll`,t)},[p]),(0,u.jsx)(Ut,{title:`Runs`,description:`Execution and quality evidence across models, tests, seeds, snapshots, and operations.`,toolbar:(0,u.jsx)(ng,{runsViewState:t,runsResults:p,adapterColumnLayout:o,adapterMetricsAvailable:l,onRunsViewStateChange:n}),inspector:m?(0,u.jsx)(Xh,{row:m,visibleColumns:d,overflowColumns:f,onNavigateTo:i}):null,className:`runs-view`,children:(0,u.jsx)($h,{analysis:e,runsResults:p,runsViewState:t,resultsBodyRef:a,virtualizer:h,adapterColumns:d,onRunsViewStateChange:n,onInvestigationSelectionChange:r})})}var $={resourceTypeSummaryAriaLabel:`Run outcomes for executed dbt assets (non-test resources such as models and sources), grouped by resource type. Counts are how many assets succeeded versus had warnings or failures. These are not dbt test pass or fail totals.`,resourceTypeSummaryTitle:`Run outcomes for executed dbt assets by type (excludes tests). Not dbt test pass or fail totals.`,resourceTypeSummaryItemTitle(e){return`${e}: executed asset run outcomes for this type, not dbt test totals.`},treeTestStatsTitle:`Attention-only rollup of executed dbt test outcomes for this folder or row: failed or errored, warning, and dbt-skipped. Passing tests and tests with no run result (not executed) are not shown here. A test that depends on multiple resources may be counted more than once in folder totals.`,treeTestStatsBranchAriaLabel:`Dbt test attention rollup for resources in this folder: failed or error, warning, and skipped counts only. Passing tests and not-executed tests are not shown. Tests with multiple upstream dependencies may be counted more than once when summed at higher folders.`,treeTestStatsLeafAriaLabel:`Dbt test attention outcomes for this resource: failed or error, warning, and skipped only. Passing tests and not-executed tests are not shown.`,treeTestStatErrorTitle(e){return`Failed or errored dbt test attachments: ${e}`},treeTestStatWarnTitle(e){return`Warning dbt test attachments: ${e}`},treeTestStatSkippedTitle(e){return`Dbt skipped or no-op test attachments: ${e}. Folder rollups may count one test multiple times when it depends on several resources.`},treeEmptyHeadline:`No resources found`,treeEmptyDefaultSubtext:`Adjust filters or search to find matching branches or assets.`,treeEmptySearchSubtext:`Try clearing or changing the resource search box.`,treeEmptyResourceTypesSubtext:`One or more dbt resource types are narrowed; add types or reset type filters to see more assets.`,treeEmptyExecutionFilterSubtext(e){switch(e){case`danger`:return`Execution status is Fail: only assets with a failed or errored result in this run are shown. Assets without a run row are treated as Not executed, not Fail. For models whose run succeeded but dbt tests failed, use Issues. Try Execution status All, or confirm run results are loaded for this workspace.`;case`issues`:return`Execution status is Issues: assets with a failed or errored run result, or with failed, warned, or skipped dbt test attachments in this run. Fail shows execution failures only.`;case`neutral`:return`Execution status is Not executed: only assets without a matching run result (or unknown status) are shown. Try All or confirm run results are loaded.`;case`positive`:return`Execution status is Success: only successful runs are shown. Try All or adjust other filters.`;case`warning`:return`Execution status is Warn: only warned runs are shown. Try All or adjust other filters.`;case`skipped`:return`Execution status is Skipped: only skipped runs are shown. Try All or adjust other filters.`;default:return``}},executionStatusSectionTitle:`Filter by run & tests`,executionStatusRunOutcomeSubLabel:`Run outcome`,executionStatusProblemsSubLabel:`Run + dbt tests`};function ig(e){switch(e){case`all`:return`All`;case`positive`:return`Success`;case`warning`:return`Warn`;case`danger`:return`Fail (run)`;case`skipped`:return`Skipped`;case`neutral`:return`Not executed`;case`issues`:return`Issues (run or tests)`;default:return e}}function ag(e){return e===`all`?`Show all assets regardless of run outcome or attached dbt test results.`:$.treeEmptyExecutionFilterSubtext(e)}function og(e){let t=[];return e.status!==`all`&&t.push($.treeEmptyExecutionFilterSubtext(e.status)),e.resourceQuery.trim()&&t.push($.treeEmptySearchSubtext),e.activeResourceTypeCount>0&&t.push($.treeEmptyResourceTypesSubtext),t.length===0?$.treeEmptyDefaultSubtext:t.join(` `)}var sg=`dbt-tools.explorerFiltersExpanded`;function cg(){try{let e=window.localStorage.getItem(sg);if(e!==null)return e===`true`}catch{}return!1}function lg({filtersExpanded:e,setFiltersExpandedPersisted:t,activeFilterCount:n,filterSummary:r,resourceQuery:i,setResourceQuery:a,status:o,setStatus:s,availableResourceTypes:c,activeResourceTypes:l,toggleResourceType:d}){return(0,u.jsxs)(`section`,{className:`explorer-filters`,"aria-label":`Explorer filters`,children:[(0,u.jsxs)(`button`,{type:`button`,className:`explorer-filters__toggle`,"aria-expanded":e,onClick:()=>t(!e),children:[(0,u.jsxs)(`span`,{className:`explorer-filters__toggle-copy`,children:[(0,u.jsx)(`span`,{className:`explorer-filters__toggle-label`,children:`Filters`}),(0,u.jsx)(`span`,{className:`explorer-filters__toggle-summary`,children:r})]}),(0,u.jsxs)(`span`,{className:`explorer-filters__toggle-meta`,children:[n>0&&(0,u.jsx)(`span`,{className:`explorer-filters__badge`,children:n}),(0,u.jsx)(`span`,{className:`explorer-filters__chevron${e?` explorer-filters__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▾`})]})]}),e&&(0,u.jsxs)(`div`,{className:`explorer-filter-stack`,children:[(0,u.jsxs)(`label`,{className:`workspace-search`,children:[(0,u.jsx)(`span`,{children:`Search resources`}),(0,u.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:`Filter tree by name, path, type, or id`})]}),(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:$.executionStatusSectionTitle}),(0,u.jsxs)(`div`,{className:`explorer-status-filters`,children:[(0,u.jsxs)(`div`,{className:`explorer-status-filters__block`,children:[(0,u.jsx)(`span`,{className:`explorer-status-filters__sublabel`,id:`explorer-status-run-outcome-label`,children:$.executionStatusRunOutcomeSubLabel}),(0,u.jsx)(`div`,{className:`pill-row`,role:`group`,"aria-labelledby":`explorer-status-run-outcome-label`,children:[`all`,`positive`,`warning`,`danger`,`skipped`,`neutral`].map(e=>(0,u.jsx)(`button`,{type:`button`,className:o===e?`workspace-pill workspace-pill--active`:`workspace-pill`,title:ag(e),"aria-label":`${ig(e)}. ${ag(e)}`,onClick:()=>s(e),children:ig(e)},e))})]}),(0,u.jsxs)(`div`,{className:`explorer-status-filters__block explorer-status-filters__block--problems`,children:[(0,u.jsx)(`span`,{className:`explorer-status-filters__sublabel`,id:`explorer-status-problems-label`,children:$.executionStatusProblemsSubLabel}),(0,u.jsx)(`div`,{className:`pill-row`,role:`group`,"aria-labelledby":`explorer-status-problems-label`,children:(0,u.jsx)(`button`,{type:`button`,className:o===`issues`?`workspace-pill workspace-pill--active`:`workspace-pill`,title:ag(`issues`),"aria-label":`${ig(`issues`)}. ${ag(`issues`)}`,onClick:()=>s(`issues`),children:ig(`issues`)})})]})]})]}),c.length>0&&(0,u.jsxs)(`div`,{className:`explorer-filter-group`,children:[(0,u.jsx)(`span`,{className:`explorer-filter-group__label`,children:`dbt resource type`}),(0,u.jsx)(`div`,{className:`pill-row`,children:c.map(e=>(0,u.jsx)(`button`,{type:`button`,className:l.size===0||l.has(e)?`workspace-pill workspace-pill--active`:`workspace-pill`,onClick:()=>d(e),children:Xe(e)},e))})]})]})]})}function ug(e){let t=Xe(e.resourceType),n=Mn(e);return n?`${e.name}, ${t}, file ${n}`:`${e.name}, ${t}`}function dg({testStats:e,variant:t}){if(!wn(e))return null;let n=t===`branch`?$.treeTestStatsBranchAriaLabel:$.treeTestStatsLeafAriaLabel;return(0,u.jsxs)(`span`,{className:`explorer-tree__test-stats-wrap`,role:`group`,"aria-label":n,title:$.treeTestStatsTitle,children:[(0,u.jsx)(`span`,{className:`explorer-tree__test-stats-label`,"aria-hidden":`true`,children:`Test issues`}),(0,u.jsxs)(`span`,{className:`explorer-tree__test-stats`,children:[e.error>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--fail`,title:$.treeTestStatErrorTitle(e.error),children:[`✗`,e.error]}),e.warn>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--warn`,title:$.treeTestStatWarnTitle(e.warn),children:[`!`,e.warn]}),e.skipped>0&&(0,u.jsxs)(`span`,{className:`explorer-tree__test-stat explorer-tree__test-stat--skipped`,title:$.treeTestStatSkippedTitle(e.skipped),children:[`−`,e.skipped]})]})]})}function fg({virtualRow:e,measureRow:t,children:n}){return(0,u.jsx)(`div`,{"data-index":e.index,ref:t,className:`explorer-tree__virtual-row`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:n})}function pg({treeRows:e,explorerMode:t,expandedNodeIds:n,toggleExpandedNode:r,selectedResourceId:i,setSelectedResourceId:a,treeEmptyDisplay:o}){let l=(0,c.useRef)(null),d=s({count:e.length,getScrollElement:()=>l.current,estimateSize:()=>46,overscan:16}),f=d.measureElement;return e.length===0?(0,u.jsx)(`div`,{ref:l,className:`explorer-tree`,children:(0,u.jsx)(yt,{icon:`🔍`,headline:o?.headline??$.treeEmptyHeadline,subtext:o?.subtext??$.treeEmptyDefaultSubtext})}):(0,u.jsx)(`div`,{ref:l,className:`explorer-tree`,children:(0,u.jsx)(`div`,{className:`explorer-tree__virtual-spacer`,style:{height:d.getTotalSize(),width:`100%`,position:`relative`},children:d.getVirtualItems().map(o=>{let s=e[o.index];if(!s)return null;let{node:c,depth:l}=s;if(c.kind===`branch`){let e=n.has(c.id);return(0,u.jsx)(fg,{virtualRow:o,measureRow:f,children:(0,u.jsxs)(`button`,{type:`button`,className:`explorer-tree__row explorer-tree__row--branch`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>r(c.id),children:[(0,u.jsx)(`span`,{className:`explorer-tree__chevron${e?` explorer-tree__chevron--expanded`:``}`,"aria-hidden":`true`,children:`▸`}),(0,u.jsx)(`span`,{className:`explorer-tree__folder`,"aria-hidden":`true`,children:(0,u.jsx)(Ht,{mode:t,depth:l})}),(0,u.jsx)(`span`,{className:`explorer-tree__label`,children:c.label}),c.testStats&&(0,u.jsx)(dg,{testStats:c.testStats,variant:`branch`})]})},o.key)}let d=c.resource;return(0,u.jsx)(fg,{virtualRow:o,measureRow:f,children:(0,u.jsxs)(`button`,{type:`button`,className:d.uniqueId===i?`explorer-tree__row explorer-tree__row--leaf explorer-tree__row--active`:`explorer-tree__row explorer-tree__row--leaf`,style:{paddingLeft:`${.9+l*1.05}rem`},onClick:()=>a(d.uniqueId),title:d.uniqueId,"aria-label":ug(d),children:[(0,u.jsx)(`span`,{className:`explorer-tree__leaf-icon`,"aria-hidden":`true`,children:(0,u.jsx)(Vt,{resourceType:d.resourceType})}),(0,u.jsx)(`span`,{className:`explorer-tree__resource-body`,children:(0,u.jsx)(`span`,{className:`explorer-tree__label`,children:d.name})}),c.testStats&&(0,u.jsx)(dg,{testStats:c.testStats,variant:`leaf`})]})},o.key)})})})}function mg({mode:e}){return e===`project`?(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,u.jsx)(`path`,{d:`M3.5 7.5h6l1.8 2h8.7v7.8a1.2 1.2 0 0 1-1.2 1.2H4.7a1.2 1.2 0 0 1-1.2-1.2V8.7a1.2 1.2 0 0 1 1.2-1.2Z`})}):e===`database`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:[(0,u.jsx)(`ellipse`,{cx:`12`,cy:`6.2`,rx:`6.5`,ry:`2.7`}),(0,u.jsx)(`path`,{d:`M5.5 6.2v5.6c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7V6.2`}),(0,u.jsx)(`path`,{d:`M5.5 11.8v5.8c0 1.5 2.9 2.7 6.5 2.7s6.5-1.2 6.5-2.7v-5.8`})]}):null}function hg({resources:e}){let t=e.filter(e=>!z.has(e.resourceType)&&e.statusTone!==`neutral`);if(t.length===0)return null;let n=new Map;for(let e of t){let t=n.get(e.resourceType)??{pass:0,fail:0};e.statusTone===`positive`?t.pass++:(e.statusTone===`danger`||e.statusTone===`warning`)&&t.fail++,n.set(e.resourceType,t)}let r=Array.from(n.entries()).sort(([e],[t])=>e.localeCompare(t));return(0,u.jsx)(`div`,{className:`resource-type-summary`,"aria-label":$.resourceTypeSummaryAriaLabel,title:$.resourceTypeSummaryTitle,children:r.map(([e,{pass:t,fail:n}])=>{let r=Xe(e);return(0,u.jsxs)(`span`,{className:`resource-type-summary__item`,title:$.resourceTypeSummaryItemTitle(r),children:[(0,u.jsx)(`span`,{className:`resource-type-summary__type`,children:r}),t>0&&(0,u.jsxs)(`span`,{className:`resource-type-summary__pass`,children:[`✓`,t]}),n>0&&(0,u.jsxs)(`span`,{className:`resource-type-summary__fail`,children:[`✗`,n]})]},e)})})}function gg({treeRows:e,filteredResources:t,totalResources:n,matchedResources:r,explorerMode:i,setExplorerMode:a,status:o,setStatus:s,availableResourceTypes:l,activeResourceTypes:d,toggleResourceType:f,resourceQuery:p,setResourceQuery:m,selectedResourceId:h,expandedNodeIds:g,toggleExpandedNode:_,setSelectedResourceId:v}){let[y,b]=(0,c.useState)(cg),x=e=>{b(e);try{window.localStorage.setItem(sg,String(e))}catch{}},S=(p.trim()?1:0)+(o===`all`?0:1)+(d.size>0?1:0),C=S>0?`${S} active`:`Search, status, and type`;return(0,u.jsxs)(`aside`,{className:`explorer-pane`,children:[(0,u.jsxs)(`div`,{className:`explorer-pane__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Asset explorer`}),(0,u.jsx)(`h2`,{children:`Workspace inventory`})]}),(0,u.jsxs)(`div`,{className:`explorer-pane__count`,children:[r,r!==n&&(0,u.jsxs)(`span`,{className:`explorer-pane__count-subtext`,children:[`of `,n]})]})]}),(0,u.jsx)(`div`,{className:`explorer-mode-tabs`,role:`tablist`,"aria-label":`Explorer modes`,children:[`project`,`database`].map(e=>(0,u.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":i===e,className:i===e?`explorer-mode-tab explorer-mode-tab--active`:`explorer-mode-tab`,onClick:()=>a(e),children:[(0,u.jsx)(`span`,{className:`explorer-mode-tab__icon`,"aria-hidden":`true`,children:(0,u.jsx)(mg,{mode:e})}),qe[e]]},e))}),(0,u.jsx)(lg,{filtersExpanded:y,setFiltersExpandedPersisted:x,activeFilterCount:S,filterSummary:C,resourceQuery:p,setResourceQuery:m,status:o,setStatus:s,availableResourceTypes:l,activeResourceTypes:d,toggleResourceType:f}),(0,u.jsx)(hg,{resources:t}),(0,u.jsx)(pg,{treeRows:e,explorerMode:i,expandedNodeIds:g,toggleExpandedNode:_,selectedResourceId:h,setSelectedResourceId:v,treeEmptyDisplay:e.length===0?{headline:$.treeEmptyHeadline,subtext:og({status:o,resourceQuery:p,activeResourceTypeCount:d.size})}:void 0})]})}function _g(e,t,n,r,i,a,o){(0,c.useEffect)(()=>{if(e.length===0||a==null)return;let t=Un(e,a);t.size!==0&&o(e=>[...t].filter(t=>!e.expandedNodeIds.has(t)).length===0?e:{...e,expandedNodeIds:new Set([...e.expandedNodeIds,...t])})},[e,o,a]),(0,c.useEffect)(()=>{if(i!==`project`||a!=null||e.length===0||n.size>0)return;let s=Ln(r);t.has(s)&&o(e=>e.explorerMode!==`project`||e.selectedResourceId!=null||e.expandedNodeIds.has(s)?e:{...e,expandedNodeIds:new Set([...e.expandedNodeIds,s])})},[t,i,n.size,e.length,o,r,a])}function vg(e){return e===`inventory`}function yg({analysis:e,projectName:t,activeView:n,assetViewState:r,onAssetViewStateChange:i,onInvestigationSelectionChange:a}){let o=(0,c.useMemo)(()=>r.explorerMode!==`project`||t==null?e.resources:e.resources.filter(e=>ct(e,t)),[e.resources,r.explorerMode,t]),s=(0,c.useMemo)(()=>Array.from(new Set(o.map(e=>e.resourceType))).sort(),[o]),l=(0,c.useMemo)(()=>Tn(o,e.dependencyIndex),[e.dependencyIndex,o]),d=(0,c.useMemo)(()=>o.filter(e=>rt(e,r.status,l)&&it(e,r.resourceTypes)&&nt(e,r.resourceQuery)),[r.resourceQuery,r.resourceTypes,r.status,l,o]),f=(0,c.useMemo)(()=>Rn(d,r.explorerMode,t,e.dependencyIndex),[e.dependencyIndex,r.explorerMode,d,t]),p=(0,c.useMemo)(()=>Bn(f),[f]),m=(0,c.useMemo)(()=>new Set([...r.expandedNodeIds].filter(e=>p.has(e))),[p,r.expandedNodeIds]),h=(0,c.useMemo)(()=>zn(f,m),[m,f]),g=(0,c.useMemo)(()=>Vn(f),[f]),_=r.selectedResourceId;return _g(f,p,m,t,r.explorerMode,_,i),{explorerPane:vg(n)?(0,u.jsx)(gg,{treeRows:h,filteredResources:d,totalResources:o.length,matchedResources:g.length,explorerMode:r.explorerMode,setExplorerMode:e=>i(t=>({...t,explorerMode:e})),status:r.status,setStatus:e=>i(t=>({...t,status:e})),availableResourceTypes:s,activeResourceTypes:r.resourceTypes,toggleResourceType:e=>i(t=>{let n=new Set(t.resourceTypes);return n.has(e)?n.delete(e):n.add(e),{...t,resourceTypes:n}}),resourceQuery:r.resourceQuery,setResourceQuery:e=>i(t=>({...t,resourceQuery:e})),selectedResourceId:_,expandedNodeIds:m,toggleExpandedNode:e=>i(t=>{let n=new Set(t.expandedNodeIds);return n.has(e)?n.delete(e):n.add(e),{...t,expandedNodeIds:n}}),setSelectedResourceId:e=>{i(t=>({...t,selectedResourceId:e})),a(t=>({...t,selectedResourceId:e,sourceLens:`inventory`}))}}):null}}function bg({analysis:e,activeView:t,analysisSource:n,overviewFilters:r,onOverviewFiltersChange:i,timelineFilters:a,onTimelineFiltersChange:o,assetViewState:s,onAssetViewStateChange:c,runsViewState:l,onRunsViewStateChange:d,lineageViewState:f,onLineageViewStateChange:p,onInvestigationSelectionChange:m,onNavigateTo:h,workspaceSignals:g}){let _=e.projectName??st(e.executions),{explorerPane:v}=yg({analysis:e,projectName:_,activeView:t,assetViewState:s,onAssetViewStateChange:c,onInvestigationSelectionChange:m}),y=s.selectedResourceId,b=e.resources.find(e=>e.uniqueId===y)??null;return(0,u.jsxs)(`div`,{className:`workspace-layout${v?``:` workspace-layout--full`}`,children:[v,(0,u.jsxs)(`div`,{className:`workspace-main-panel`,children:[t===`health`&&(0,u.jsx)(xn,{analysis:e,projectName:_,analysisSource:n,filters:r,setFilters:i,workspaceSignals:g}),t===`inventory`&&(0,u.jsx)(Gp,{analysis:e,resource:b,onSelectResource:e=>c(t=>({...t,selectedResourceId:e})),assetViewState:{...s,selectedResourceId:y},onAssetViewStateChange:c,lineageViewState:f,onLineageViewStateChange:p,onInvestigationSelectionChange:m,onNavigateTo:h}),t===`runs`&&(0,u.jsx)(rg,{analysis:e,runsViewState:l,onRunsViewStateChange:d,onInvestigationSelectionChange:m,onNavigateTo:h}),t===`timeline`&&(0,u.jsx)(Bh,{analysis:e,filters:a,setFilters:o,onInvestigationSelectionChange:m})]})]})}var xg=(0,c.createContext)({toast:()=>{}}),Sg=0,Cg=4e3;function wg({children:e}){let[t,n]=(0,c.useState)([]),r=(0,c.useCallback)((e,t=`neutral`)=>{let r=++Sg;n(n=>[...n,{id:r,message:e,tone:t}]),setTimeout(()=>{n(e=>e.filter(e=>e.id!==r))},Cg)},[]);function i(e){n(t=>t.filter(t=>t.id!==e))}return(0,u.jsxs)(xg.Provider,{value:{toast:r},children:[e,t.length>0&&(0,u.jsx)(`div`,{className:`toast-portal`,role:`status`,"aria-live":`polite`,children:t.map(e=>(0,u.jsxs)(`div`,{className:`toast toast--${e.tone}`,children:[(0,u.jsx)(`span`,{className:`toast__dot`,"aria-hidden":`true`}),(0,u.jsx)(`span`,{className:`toast__message`,children:e.message}),(0,u.jsx)(`button`,{type:`button`,className:`toast__dismiss`,"aria-label":`Dismiss notification`,onClick:()=>i(e.id),children:`✕`})]},e.id))})]})}function Tg(){return(0,c.useContext)(xg)}function Eg({id:e,label:t,file:n,onFileChange:r}){return(0,u.jsxs)(`div`,{className:`file-input-card`,children:[(0,u.jsx)(`label`,{htmlFor:e,children:t}),(0,u.jsx)(`input`,{id:e,type:`file`,accept:`.json`,onChange:e=>r(e.target.files?.[0]??null)}),n&&(0,u.jsx)(`span`,{className:`file-input-card__filename`,children:n.name})]})}var Dg=[{title:`Health-first overview`,body:`Spot failing nodes, long-running bottlenecks, and critical-path pressure before opening individual assets.`},{title:`Catalog-style context`,body:`Browse lineage-adjacent metadata such as descriptions, packages, execution status, and dependency depth in one flow.`},{title:`Timeline investigation`,body:`Shift from summary to execution sequencing without leaving the workspace, inspired by dbt docs and observability tools.`}];function Og({onAnalysis:e,onError:t}){let{toast:n}=Tg(),[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)(null),[s,l]=(0,c.useState)(!1);async function d(){if(!r||!a){t(`Please select both manifest.json and run_results.json`);return}l(!0),t(null);try{let[t,i]=await Promise.all([r.arrayBuffer(),a.arrayBuffer()]),o=await C(t,i,`upload`);e(o),n(`Analyzed ${o.analysis.summary.total_nodes} executions successfully`,`positive`)}catch(e){let r=e instanceof Error?e.message:`Failed to parse artifacts`;t(r),n(`Parse failed — ${r}`,`danger`)}finally{l(!1)}}let f=r&&a&&!s,p=(0,c.useMemo)(()=>r&&a?`Ready to analyze`:r||a?`Waiting for one more file`:`Add both dbt artifacts to continue`,[r,a]);return(0,u.jsxs)(`section`,{className:`upload-hero`,children:[(0,u.jsxs)(`div`,{className:`upload-hero__copy`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Bring your artifacts`}),(0,u.jsx)(`h2`,{children:`Review dbt runs like a modern control plane, not a raw JSON dump.`}),(0,u.jsxs)(`p`,{children:[`Start from the two artifacts that power `,(0,u.jsx)(`code`,{children:`dbt docs`}),` and most run analysis workflows: a matching `,(0,u.jsx)(`code`,{children:`manifest.json`}),` and`,(0,u.jsx)(`code`,{children:` run_results.json`}),` pair.`]}),(0,u.jsxs)(`div`,{className:`upload-hero__callout`,children:[(0,u.jsx)(`span`,{className:`upload-hero__callout-badge`,children:`Recommended flow`}),(0,u.jsxs)(`strong`,{children:[`Run `,(0,u.jsx)(`code`,{children:`dbt docs generate`}),` after a representative job.`]}),(0,u.jsx)(`p`,{children:`That keeps lineage, metadata, and runtime results aligned so the workspace can feel closer to dbt Docs for discovery and closer to Elementary for health triage.`})]}),(0,u.jsx)(`div`,{className:`upload-feature-grid`,children:Dg.map(e=>(0,u.jsxs)(`article`,{className:`upload-feature-card`,children:[(0,u.jsx)(`strong`,{children:e.title}),(0,u.jsx)(`p`,{children:e.body})]},e.title))})]}),(0,u.jsxs)(`div`,{className:`upload-panel`,children:[(0,u.jsxs)(`div`,{className:`upload-panel__header`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Artifact intake`}),(0,u.jsx)(`h3`,{children:`Open investigation workspace`})]}),(0,u.jsx)(`span`,{className:`upload-panel__status`,children:p})]}),(0,u.jsxs)(`div`,{className:`upload-panel__inputs`,children:[(0,u.jsx)(Eg,{id:`manifest-input`,label:`manifest.json`,file:r,onFileChange:i}),(0,u.jsx)(Eg,{id:`run-results-input`,label:`run_results.json`,file:a,onFileChange:o})]}),(0,u.jsxs)(`div`,{className:`upload-panel__tips`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`Best when files come from the same run.`}),(0,u.jsx)(`span`,{children:`Mismatched manifests and run results usually surface missing nodes or stale timings.`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:`Use local outputs or DBT_TOOLS_TARGET_DIR.`}),(0,u.jsx)(`span`,{children:`The app supports both uploaded artifacts and auto-loaded local targets for faster iteration.`})]})]}),(0,u.jsxs)(`button`,{type:`button`,onClick:()=>{d()},disabled:!f,className:`primary-action`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:`0.5rem`},children:[s&&(0,u.jsx)(Ip,{size:16}),s?`Analyzing…`:`Analyze artifacts`]})]})]})}function kg({className:e,style:t}){return(0,u.jsx)(`div`,{className:[`skeleton`,e].filter(Boolean).join(` `),style:t,"aria-hidden":`true`})}function Ag(){return(0,u.jsxs)(`div`,{className:`loading-card`,children:[(0,u.jsx)(kg,{className:`loading-card__skeleton-icon`}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(kg,{className:`loading-card__skeleton-title`}),(0,u.jsx)(kg,{className:`loading-card__skeleton-body`})]})]})}var jg=`workspace-pill workspace-pill--active`,Mg=`workspace-pill`;function Ng(e){return e?jg:Mg}function Pg({analysisSource:e,executionCount:t}){return(0,u.jsxs)(`section`,{className:`settings-hero`,"aria-label":`Workspace preferences`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,children:`Workspace profile`}),(0,u.jsx)(`h3`,{children:`Configure how this console looks and behaves by default.`}),(0,u.jsx)(`p`,{children:`Changes save locally and apply to the current workspace immediately when the relevant view is open.`}),(0,u.jsxs)(`div`,{className:`settings-chip-row`,children:[(0,u.jsx)(`span`,{className:`app-badge`,children:k(e)}),(0,u.jsx)(`span`,{className:`settings-chip`,children:t==null?`No artifacts loaded`:`${t} executions loaded`})]})]})}function Fg({themePreference:e,onThemeChange:t}){return(0,u.jsx)(zt,{title:`Appearance`,subtitle:`Choose how the workspace chrome should render by default.`,children:(0,u.jsxs)(`div`,{className:`settings-field-group`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Theme`}),(0,u.jsx)(`div`,{className:`settings-segmented`,children:[`system`,`light`,`dark`].map(n=>(0,u.jsx)(`button`,{type:`button`,className:Ng(e===n),onClick:()=>t(n),children:n===`system`?`System`:n.charAt(0).toUpperCase()+n.slice(1)},n))})]})})}function Ig({analysisSource:e,executionCount:t,onLoadDifferent:n,pendingRemoteRun:r,acceptingRemoteRun:i,onAcceptPendingRemoteRun:a}){return(0,u.jsx)(zt,{title:`Session`,subtitle:`Current artifact source and data-loading controls.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-readout`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Current source`}),(0,u.jsx)(`strong`,{children:k(e)}),(0,u.jsx)(`p`,{children:t==null?`Load artifacts to unlock analysis views.`:`${t} executions are available in this session.`})]}),(0,u.jsx)(`button`,{type:`button`,className:`primary-action settings-primary-action`,onClick:n,children:`Load different artifacts`}),r&&(0,u.jsx)(`button`,{type:`button`,className:`workspace-pill`,onClick:()=>void a(),disabled:i,children:i?`Switching…`:`Load ${r.label}`})]})})}function Lg({preferences:e,setPreferences:t}){return(0,u.jsx)(zt,{title:`Shell Defaults`,subtitle:`Control the default shape of the workspace chrome.`,children:(0,u.jsxs)(`div`,{className:`settings-field-group`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Sidebar`}),(0,u.jsxs)(`div`,{className:`settings-segmented`,children:[(0,u.jsx)(`button`,{type:`button`,className:Ng(!e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!1})),children:`Expanded`}),(0,u.jsx)(`button`,{type:`button`,className:Ng(e.sidebarCollapsedDefault),onClick:()=>t(e=>({...e,sidebarCollapsedDefault:!0})),children:`Collapsed`})]})]})})}function Rg({preferences:e,setPreferences:t}){return(0,u.jsx)(zt,{title:`Timeline Defaults`,subtitle:`Set the default execution timeline filters and dependency focus.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.showTests,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,showTests:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Show tests by default`})]}),(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.timelineDefaults.failuresOnly,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,failuresOnly:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Start with failures-only emphasis`})]})]}),(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Dependency direction`}),(0,u.jsxs)(`select`,{value:e.timelineDefaults.dependencyDirection,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDirection:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`upstream`,children:`Upstream`}),(0,u.jsx)(`option`,{value:`both`,children:`Both`}),(0,u.jsx)(`option`,{value:`downstream`,children:`Downstream`})]})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Dependency depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.timelineDefaults.dependencyDepthHops,onChange:e=>t(t=>({...t,timelineDefaults:{...t.timelineDefaults,dependencyDepthHops:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]})]})})}function zg({preferences:e,setPreferences:t}){return(0,u.jsx)(zt,{title:`Inventory Defaults`,subtitle:`Choose how asset exploration and lineage open by default.`,children:(0,u.jsxs)(`div`,{className:`settings-stack`,children:[(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Explorer mode`}),(0,u.jsxs)(`select`,{value:e.inventoryDefaults.explorerMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,explorerMode:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`project`,children:`Project`}),(0,u.jsx)(`option`,{value:`database`,children:`Database`})]})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Lineage lens`}),(0,u.jsxs)(`select`,{value:e.inventoryDefaults.lineageLensMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageLensMode:e.target.value}})),children:[(0,u.jsx)(`option`,{value:`type`,children:`Type`}),(0,u.jsx)(`option`,{value:`status`,children:`Status`}),(0,u.jsx)(`option`,{value:`coverage`,children:`Coverage`})]})]})]}),(0,u.jsxs)(`div`,{className:`settings-inline-grid`,children:[(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Upstream depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageUpstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageUpstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]}),(0,u.jsxs)(`label`,{className:`settings-field`,children:[(0,u.jsx)(`span`,{className:`settings-field-label`,children:`Downstream depth`}),(0,u.jsx)(`input`,{type:`number`,min:`1`,max:`10`,value:e.inventoryDefaults.lineageDownstreamDepth,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,lineageDownstreamDepth:Math.max(1,Math.min(10,Number(e.target.value)||1))}}))})]})]}),(0,u.jsxs)(`label`,{className:`settings-toggle`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:e.inventoryDefaults.allDepsMode,onChange:e=>t(t=>({...t,inventoryDefaults:{...t.inventoryDefaults,allDepsMode:e.target.checked}}))}),(0,u.jsx)(`span`,{children:`Open lineage with all dependencies expanded`})]})]})})}function Bg({preferences:e,setPreferences:t,themePreference:n,setThemePreference:r,analysisSource:i,executionCount:a,onLoadDifferent:o,pendingRemoteRun:s,acceptingRemoteRun:c,onAcceptPendingRemoteRun:l}){return(0,u.jsx)(Ut,{title:`Settings`,description:`Workspace defaults, visual preferences, and session controls.`,className:`settings-view`,children:(0,u.jsxs)(`div`,{className:`settings-grid`,children:[(0,u.jsx)(Pg,{analysisSource:i,executionCount:a}),(0,u.jsx)(Fg,{themePreference:n,onThemeChange:e=>{r(e),t(t=>({...t,theme:e}))}}),(0,u.jsx)(Ig,{analysisSource:i,executionCount:a,onLoadDifferent:o,pendingRemoteRun:s,acceptingRemoteRun:c,onAcceptPendingRemoteRun:l}),(0,u.jsx)(Lg,{preferences:e,setPreferences:t}),(0,u.jsx)(Rg,{preferences:e,setPreferences:t}),(0,u.jsx)(zg,{preferences:e,setPreferences:t})]})})}function Vg({kind:e}){let t={fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`};return e===`invocation`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{...t,d:`M20 12.5V7a2 2 0 0 0-2-2h-6.2a2 2 0 0 0-1.4.58l-4.82 4.82A2 2 0 0 0 5 11.82V17a2 2 0 0 0 2 2h5.5`}),(0,u.jsx)(`path`,{...t,d:`M9 5v4a2 2 0 0 1-2 2H5`}),(0,u.jsx)(`circle`,{...t,cx:`17.5`,cy:`17.5`,r:`3.5`})]}):e===`time`?(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`circle`,{...t,cx:`12`,cy:`12`,r:`8`}),(0,u.jsx)(`path`,{...t,d:`M12 7.8v4.6l3 1.8`})]}):e===`project`?(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{...t,d:`M3.5 8.5a2 2 0 0 1 2-2h3l1.4 1.7h8.6a2 2 0 0 1 2 2v7.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z`})}):(0,u.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{...t,d:`M11.25 4.75 5.5 7.7v4.55c0 3.65 2.7 6.95 6.5 7.95 3.8-1 6.5-4.3 6.5-7.95V7.7z`}),(0,u.jsx)(`path`,{...t,d:`M9.4 12.15 11.2 14l3.35-3.45`})]})}function Hg(e,t){let n=e?.projectName??null,r=e?.invocationId??null,i=e?.warehouseType??null,a=e?Qe(e):null,o=a==null?null:Ze(a);return{label:n??`Workspace session`,subtitle:n==null&&r==null&&o==null?`Load artifacts to populate session details.`:null,summaryItems:[r?{key:`invocation`,label:`Invocation ID`,value:r,icon:`invocation`}:null,o?{key:`timestamp`,label:`Timestamp`,value:o,icon:`time`}:null,{key:`source`,label:`Source mode`,value:k(t),icon:`source`},i?{key:`warehouse`,label:`Warehouse type`,value:i.charAt(0).toUpperCase()+i.slice(1),icon:`project`}:null].filter(e=>e!=null)}}function Ug({summaryItems:e}){return(0,u.jsx)(`div`,{className:`app-header__summary-grid`,"aria-label":`Session metadata`,children:e.map(e=>(0,u.jsxs)(`div`,{className:`app-header__summary-item`,children:[(0,u.jsx)(`span`,{className:`app-header__summary-icon`,children:(0,u.jsx)(Vg,{kind:e.icon})}),(0,u.jsxs)(`span`,{className:`app-header__summary-copy`,children:[(0,u.jsx)(`span`,{className:`app-header__summary-label`,children:e.label}),(0,u.jsx)(`strong`,{className:`app-header__summary-value`,children:e.value})]})]},e.key))})}function Wg({header:e}){return(0,u.jsxs)(`div`,{className:`app-header__identity`,children:[(0,u.jsx)(`p`,{className:`eyebrow`,title:e.label,children:e.label}),e.subtitle?(0,u.jsx)(`p`,{className:`app-header__subheadline`,children:e.subtitle}):null,(0,u.jsx)(Ug,{summaryItems:e.summaryItems})]})}function Gg({analysis:e,searchState:t,setSearchState:n,omniboxResults:r,handleNavigateTo:i}){let a=t.query.trim().length>0;return(0,u.jsxs)(`div`,{className:`app-header__omnibox`,children:[(0,u.jsx)(`label`,{className:`app-header__search-control`,children:(0,u.jsxs)(`div`,{className:`app-header__search-shell`,children:[(0,u.jsxs)(`svg`,{className:`workspace-search__icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,u.jsx)(`circle`,{cx:`11`,cy:`11`,r:`6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,u.jsx)(`path`,{d:`M16 16l4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})]}),(0,u.jsx)(`input`,{value:t.query,onFocus:()=>n(e=>({...e,isOpen:!0})),onChange:e=>n(t=>({...t,query:e.target.value,isOpen:!0})),placeholder:`Search runs, pipelines, assets...`,"aria-label":`Global search`})]})}),t.isOpen&&e&&(0,u.jsx)(`div`,{className:`omnibox-results`,children:r.loading&&a?(0,u.jsx)(`div`,{className:`omnibox-results__empty`,children:`Searching…`}):r.results.length>0?r.results.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`omnibox-results__item`,onClick:()=>{n(t=>({...t,isOpen:!1,recentResourceIds:[e.uniqueId,...t.recentResourceIds.filter(t=>t!==e.uniqueId)].slice(0,8)})),i(`inventory`,{resourceId:e.uniqueId,assetTab:`summary`})},children:[(0,u.jsx)(`strong`,{children:e.name}),(0,u.jsx)(`span`,{children:e.resourceType})]},e.uniqueId)):(0,u.jsx)(`div`,{className:`omnibox-results__empty`,children:a?`No matching resources`:`Recent items will appear here`})})]})}function Kg({activeView:e,analysis:t,analysisSource:n,preloadLoading:r,pendingRemoteRun:i,acceptingRemoteRun:a,preferences:o,setPreferences:s,themePreference:c,setThemePreference:l,onLoadDifferent:d,onAnalysis:f,onError:p,onAcceptPendingRemoteRun:m,workspaceSignals:h,overviewFilters:g,setOverviewFilters:_,timelineFilters:v,setTimelineFilters:y,assetViewState:b,setAssetViewState:x,runsViewState:S,setRunsViewState:C,lineageViewState:w,setLineageViewState:T,setInvestigationSelection:E,handleNavigateTo:D}){return e===`settings`?(0,u.jsx)(Bg,{preferences:o,setPreferences:s,themePreference:c,setThemePreference:l,analysisSource:n,executionCount:t?.summary.total_nodes??null,onLoadDifferent:d,pendingRemoteRun:i,acceptingRemoteRun:a,onAcceptPendingRemoteRun:m}):t?(0,u.jsx)(bg,{analysis:t,activeView:e,analysisSource:n,overviewFilters:g,onOverviewFiltersChange:_,timelineFilters:v,onTimelineFiltersChange:y,assetViewState:b,onAssetViewStateChange:x,runsViewState:S,onRunsViewStateChange:C,lineageViewState:w,onLineageViewStateChange:T,onInvestigationSelectionChange:E,onNavigateTo:D,workspaceSignals:h}):r?(0,u.jsx)(Ag,{}):(0,u.jsx)(Og,{onAnalysis:f,onError:p})}function qg({workspace:e,analysis:t,analysisSource:n,error:r,preloadLoading:i,pendingRemoteRun:a,acceptingRemoteRun:o,onLoadDifferent:s,onAnalysis:c,onError:l,onAcceptPendingRemoteRun:f,themePreference:p,setThemePreference:m,preferences:h,setPreferences:g,workspaceSignals:_}){let{activeView:v,sidebarCollapsed:y,setSidebarCollapsed:b,sidebarOpen:x,setSidebarOpen:S,overviewFilters:C,setOverviewFilters:w,timelineFilters:T,setTimelineFilters:E,assetViewState:D,setAssetViewState:k,runsViewState:A,setRunsViewState:ee,lineageViewState:j,setLineageViewState:M,searchState:te,setSearchState:N,setInvestigationSelection:P,setNavigationTarget:F,handleNavigateTo:I,frameClass:ne}=e,re=O(t,te),ie=Hg(t,n);return(0,u.jsxs)(`div`,{className:ne,children:[x&&(0,u.jsx)(`div`,{className:`sidebar-backdrop`,role:`presentation`,onClick:()=>S(!1)}),(0,u.jsx)(ve,{activeView:v,setNavigationTarget:F,sidebarCollapsed:y,setSidebarCollapsed:b,onNavigate:()=>S(!1),analysis:t,analysisSource:n}),(0,u.jsxs)(`main`,{className:`app-main`,children:[(0,u.jsxs)(`header`,{className:`app-header app-header--workspace`,children:[(0,u.jsx)(`button`,{type:`button`,className:`hamburger-btn`,"aria-label":`Open navigation`,"aria-expanded":x,"aria-controls":`app-sidebar`,onClick:()=>S(!0),children:(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`☰`})}),(0,u.jsx)(Wg,{header:ie}),(0,u.jsx)(Gg,{analysis:t,searchState:te,setSearchState:N,omniboxResults:re,handleNavigateTo:I})]}),r&&(0,u.jsx)(d,{message:r}),(0,u.jsx)(ye,{pendingRemoteRun:a,acceptingRemoteRun:o,onAcceptPendingRemoteRun:f}),(0,u.jsx)(Kg,{activeView:v,analysis:t,analysisSource:n,preloadLoading:i,pendingRemoteRun:a,acceptingRemoteRun:o,preferences:h,setPreferences:g,themePreference:p,setThemePreference:m,onLoadDifferent:s,onAnalysis:c,onError:l,onAcceptPendingRemoteRun:f,workspaceSignals:_,overviewFilters:C,setOverviewFilters:w,timelineFilters:T,setTimelineFilters:E,assetViewState:D,setAssetViewState:k,runsViewState:A,setRunsViewState:ee,lineageViewState:j,setLineageViewState:M,setInvestigationSelection:P,handleNavigateTo:I})]})]})}function Jg(e,t,n){return t===`preload`?{value:`Live target`,detail:`Synced from DBT_TOOLS_TARGET_DIR with ${e.graphSummary.totalEdges} dependency edges ready for investigation.`}:t===`remote`?{value:`Remote source`,detail:`Managed from remote object storage with ${e.graphSummary.totalEdges} dependency edges ready for investigation.`}:{value:`Artifact upload`,detail:`${e.summary.total_nodes} executions loaded from local artifacts${n>0?`, including ${n} tests`:``}.`}}function Yg(e,t){let n=e.executions.filter(e=>e.statusTone===`danger`).length,r=e.executions.filter(e=>e.statusTone===`warning`).length,i=e.executions.filter(e=>[`test`,`unit_test`].includes(e.resourceType)).length,a=e.resources.filter(e=>!!e.description?.trim()).length,o=e.resources.length>0?Math.round(a/e.resources.length*100):0,s=Jg(e,t,i);return[{label:`Run posture`,value:n>0?`${n} failing`:r>0?`${r} warning`:`Healthy`,detail:n>0?`Prioritize failing nodes before reviewing downstream impact.`:r>0?`Warnings detected; review tests and exposures next.`:`No failing nodes surfaced in this run.`,tone:n>0?`danger`:r>0?`warning`:`positive`},{label:`Metadata coverage`,value:`${o}%`,detail:`${a} of ${e.resources.length} resources include descriptions for catalog-style discovery.`,tone:o>=70?`positive`:o>=35?`warning`:`neutral`},{label:`Workspace mode`,value:s.value,detail:s.detail,tone:`neutral`}]}var Xg=[`/api/manifest.json`,`/api/run_results.json`],Zg=[[`/api/artifacts/current/manifest.json`,`/api/artifacts/current/run_results.json`],Xg];function Qg(){return{checkedAtMs:Date.now(),remoteProvider:null,remoteLocation:null,pollIntervalMs:null,currentRun:null,pendingRun:null,supportsSwitch:!1}}function $g(e,t,n){return{mode:e,currentSource:t,label:n,...Qg()}}async function e_(e){let t=await fetch(e);return t.ok?t.arrayBuffer():null}async function t_(e,t){let[n,r]=await Promise.all([e_(e),e_(t)]);return n==null||r==null?null:{manifestBytes:n,runResultsBytes:r}}async function n_(e=Zg){for(let[t,n]of e){let e=await t_(t,n);if(e!=null)return e}return null}async function r_(){let e=await n_([Xg]);return e==null?null:C(e.manifestBytes,e.runResultsBytes,`preload`)}async function i_(){let e=await r_();return{status:$g(e==null?`none`:`preload`,e==null?null:`preload`,e==null?`Waiting for artifacts`:`Live target`),result:e}}async function a_(){let e=await fetch(`/api/artifact-source`);if(!e.ok)throw Error(`Failed to load artifact source status`);return await e.json()}async function o_(e=`preload`){let t=await n_();return t==null?null:C(t.manifestBytes,t.runResultsBytes,e)}async function s_(){let e;try{e=await fetch(`/api/artifact-source`)}catch{return i_()}if(e.status===404||!e.ok)return i_();let t;try{t=await e.json()}catch{return i_()}return t.currentSource==null?{status:t,result:null}:{status:t,result:await o_(t.currentSource)}}async function c_(e){let t=await fetch(`/api/artifact-source/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?{runId:e}:{})});if(!t.ok)throw Error(`Failed to switch artifact source run`);return await t.json()}function l_({setPreloadLoading:e,setAnalysis:t,setAnalysisSource:n,setPendingRemoteRun:r,setRemotePollIntervalMs:i,setError:a,pendingMetricsRef:o}){let s=(0,c.useRef)(!1);(0,c.useEffect)(()=>{s.current||(s.current=!0,p(`Preload: fetching current managed artifacts`),s_().then(({result:s,status:c})=>{e(!1),r(c.pendingRun),i(c.pollIntervalMs),s?(p(`Preload: success, analysis loaded`),o.current=s.metrics,t(s.analysis),n(c.currentSource),a(null)):n(c.currentSource)}).catch(t=>{e(!1),p(`Preload: error`,t),a(t instanceof Error?t.message:`Failed to load artifacts from server`)}))},[o,e,t,n,r,i,a])}function u_(e,t,n,r){(0,c.useEffect)(()=>{},[e,r,t,n])}function d_(e,t,n,r){(0,c.useEffect)(()=>{if(e!==`remote`){t(null),n(null);return}let i=!1,a=async()=>{try{let e=await a_();i||(t(e.pendingRun),n(e.pollIntervalMs))}catch(e){p(`Artifact source poll failed`,e)}};a();let o=window.setInterval(()=>{a()},r??3e4);return()=>{i=!0,window.clearInterval(o)}},[e,r,t,n])}function f_(){let[e,t]=(0,c.useState)(null),[n,r]=(0,c.useState)(null),[i,a]=(0,c.useState)(null),[o,s]=(0,c.useState)(!0),[l,u]=(0,c.useState)(null),[d,f]=(0,c.useState)(!1),[g,_]=(0,c.useState)(null),v=(0,c.useRef)(null);return l_({setPreloadLoading:s,setAnalysis:t,setAnalysisSource:a,setPendingRemoteRun:u,setRemotePollIntervalMs:_,setError:r,pendingMetricsRef:v}),u_(i,t,r,v),d_(i,u,_,g),(0,c.useEffect)(()=>{if(e==null||v.current==null)return;let t=v.current;v.current=null,requestAnimationFrame(()=>{let e=`analysis-load:${t.requestId}:interactive`,n=`analysis-load:${t.requestId}:first-interactive-frame`;m(e),h(n,t.dispatchMarkName,e),p(`Analysis load metrics`,{requestId:t.requestId,source:t.source,timings:t.timings})})},[e]),{analysis:e,analysisSource:i,error:n,preloadLoading:o,pendingRemoteRun:l,acceptingRemoteRun:d,onLoadDifferent:()=>{t(null),a(null),u(null),_(null),r(null)},onAnalysis:e=>{v.current=e.metrics,a(`upload`),u(null),t(e.analysis)},onError:r,onAcceptPendingRemoteRun:async()=>{if(l!=null){f(!0);try{let e=await c_(l.runId),n=await o_(`remote`);n!=null&&(v.current=n.metrics,t(n.analysis),a(e.currentSource),_(e.pollIntervalMs),r(null)),u(e.pendingRun)}catch(e){r(e instanceof Error?e.message:`Failed to switch remote artifact run`)}finally{f(!1)}}}}}var p_=`dbt-tools.workspacePreferences`,m_={theme:`system`,sidebarCollapsedDefault:!0,timelineDefaults:{showTests:!1,failuresOnly:!1,dependencyDirection:`both`,dependencyDepthHops:2},inventoryDefaults:{explorerMode:`project`,lineageLensMode:`type`,lineageUpstreamDepth:2,lineageDownstreamDepth:2,allDepsMode:!1}};function h_(e,t){return typeof e!=`number`||!Number.isFinite(e)?t:Math.max(1,Math.min(10,Math.round(e)))}function g_(e){return e===`upstream`||e===`both`||e===`downstream`}function __(e){return e===`project`||e===`database`}function v_(e){return e===`status`||e===`type`||e===`coverage`}function y_(e){return e===`light`||e===`dark`||e===`system`}function b_(e){if(!e)return m_;try{let t=JSON.parse(e);return{theme:y_(t.theme)?t.theme:m_.theme,sidebarCollapsedDefault:typeof t.sidebarCollapsedDefault==`boolean`?t.sidebarCollapsedDefault:m_.sidebarCollapsedDefault,timelineDefaults:{showTests:typeof t.timelineDefaults?.showTests==`boolean`?t.timelineDefaults.showTests:m_.timelineDefaults.showTests,failuresOnly:typeof t.timelineDefaults?.failuresOnly==`boolean`?t.timelineDefaults.failuresOnly:m_.timelineDefaults.failuresOnly,dependencyDirection:g_(t.timelineDefaults?.dependencyDirection)?t.timelineDefaults.dependencyDirection:m_.timelineDefaults.dependencyDirection,dependencyDepthHops:h_(t.timelineDefaults?.dependencyDepthHops,m_.timelineDefaults.dependencyDepthHops)},inventoryDefaults:{explorerMode:__(t.inventoryDefaults?.explorerMode)?t.inventoryDefaults.explorerMode:m_.inventoryDefaults.explorerMode,lineageLensMode:v_(t.inventoryDefaults?.lineageLensMode)?t.inventoryDefaults.lineageLensMode:m_.inventoryDefaults.lineageLensMode,lineageUpstreamDepth:h_(t.inventoryDefaults?.lineageUpstreamDepth,m_.inventoryDefaults.lineageUpstreamDepth),lineageDownstreamDepth:h_(t.inventoryDefaults?.lineageDownstreamDepth,m_.inventoryDefaults.lineageDownstreamDepth),allDepsMode:typeof t.inventoryDefaults?.allDepsMode==`boolean`?t.inventoryDefaults.allDepsMode:m_.inventoryDefaults.allDepsMode}}}catch{return m_}}function x_(){let[e,t]=(0,c.useState)(()=>{try{return b_(window.localStorage.getItem(p_))}catch{return m_}});return(0,c.useEffect)(()=>{try{window.localStorage.setItem(p_,JSON.stringify(e))}catch{}},[e]),{preferences:e,setPreferences:t}}var S_=(e,t)=>({activeTab:ie(e),expandedNodeIds:new Set,explorerMode:t?.inventoryDefaults.explorerMode??`project`,status:`all`,resourceTypes:new Set,resourceQuery:``,selectedResourceId:I(e),upstreamDepth:ce(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:le(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:ue(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:se(e)??t?.inventoryDefaults.lineageLensMode??`type`,activeLegendKeys:new Set}),C_=e=>{let t=F(e);return{kind:ae(e)??`all`,status:`all`,query:``,resourceTypes:new Set,threadIds:new Set,durationBand:`all`,sortBy:`attention`,groupBy:`none`,selectedExecutionId:t===`runs`?ne(e):null,showAdapterMetrics:t===`runs`?oe(e):!1}},w_=(e,t)=>{let n=F(e),r=n===`runs`||n===`timeline`?ne(e):null;return{query:``,activeStatuses:new Set,activeTypes:new Set,selectedExecutionId:r,showTests:t?.timelineDefaults.showTests??!1,failuresOnly:t?.timelineDefaults.failuresOnly??!1,dependencyDirection:t?.timelineDefaults.dependencyDirection??`both`,dependencyDepthHops:t?.timelineDefaults.dependencyDepthHops??2,timeWindow:null}},T_=e=>{let t=F(e)??`health`,n=I(e),r=ne(e);return{selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:null}};function E_(e,t){return{activeView:F(e)??`health`,assetViewState:S_(e,t),runsViewState:C_(e),timelineFilters:w_(e,t),lineageViewState:{...fe(e),upstreamDepth:ce(e)??t?.inventoryDefaults.lineageUpstreamDepth??2,downstreamDepth:le(e)??t?.inventoryDefaults.lineageDownstreamDepth??2,allDepsMode:ue(e)??t?.inventoryDefaults.allDepsMode??!1,lensMode:se(e)??t?.inventoryDefaults.lineageLensMode??`type`},investigationSelection:T_(e)}}function D_(e){let t=F(e),n=I(e),r=ne(e);return{activeView:t??void 0,assetViewState:t=>({...t,selectedResourceId:n,activeTab:ie(e)}),runsViewState:n=>({...n,kind:ae(e)??n.kind,selectedExecutionId:t===`runs`?r:null,showAdapterMetrics:t===`runs`?oe(e):n.showAdapterMetrics}),timelineFilters:e=>({...e,selectedExecutionId:t===`timeline`?r:null}),lineageViewState:fe(e),investigationSelection:e=>({...e,selectedResourceId:n,selectedExecutionId:t===`runs`||t===`timeline`?r:null,sourceLens:e.sourceLens})}}var O_=[`resource`,`assetTab`,`selected`,`kind`,`adapter`,`up`,`down`,`allDeps`,`lens`];function k_(e,t){for(let n of O_)t?.has(n)||e.searchParams.delete(n)}function A_(e,t,n){t.selectedResourceId?e.searchParams.set(`resource`,t.selectedResourceId):e.searchParams.delete(`resource`),e.searchParams.set(`assetTab`,t.activeTab),e.searchParams.delete(`kind`),t.activeTab===`lineage`?(n.selectedResourceId?e.searchParams.set(`selected`,n.selectedResourceId):e.searchParams.delete(`selected`),e.searchParams.set(`up`,String(n.upstreamDepth)),e.searchParams.set(`down`,String(n.downstreamDepth)),e.searchParams.set(`allDeps`,n.allDepsMode?`1`:`0`),e.searchParams.set(`lens`,n.lensMode)):k_(e,new Set([`resource`,`assetTab`]))}function j_(e,t){e.searchParams.set(`kind`,t.kind),t.selectedExecutionId?e.searchParams.set(`selected`,t.selectedExecutionId):e.searchParams.delete(`selected`),t.showAdapterMetrics?e.searchParams.delete(`adapter`):e.searchParams.set(`adapter`,`0`),k_(e,new Set([`kind`,`selected`,`adapter`]))}function M_(e,t){t?e.searchParams.set(`selected`,t):e.searchParams.delete(`selected`),k_(e,new Set([`selected`]))}function N_(e){let{pathname:t,hash:n,activeView:r,assetViewState:i,runsViewState:a,timelineSelectedExecutionId:o,lineageViewState:s}=e,c=new URL(`http://local.invalid${t}${n}`);return c.searchParams.set(`view`,r),r===`inventory`?A_(c,i,s):r===`runs`?j_(c,a):r===`timeline`?M_(c,o):k_(c),`${t}${c.search}${n}`}function P_(e){let t=(0,c.useRef)(!1),n=E_(window.location.search,e),[r,i]=(0,c.useState)(()=>n.activeView),[a,o]=(0,c.useState)(()=>me(e.sidebarCollapsedDefault)),[s,l]=(0,c.useState)(!1),[u,d]=(0,c.useState)({status:`all`,resourceTypes:new Set,query:``}),[f,p]=(0,c.useState)(()=>n.timelineFilters),[m,h]=(0,c.useState)(()=>n.assetViewState),[g,_]=(0,c.useState)(()=>n.runsViewState),[v,y]=(0,c.useState)(()=>n.lineageViewState),[b,x]=(0,c.useState)({query:``,recentResourceIds:[],isOpen:!1}),[S,C]=(0,c.useState)(()=>n.investigationSelection),w=(0,c.useCallback)(e=>{o(t=>{let n=e(t);try{window.localStorage.setItem(pe,String(n))}catch{}return n})},[]),T=(0,c.useCallback)(e=>{i(e.view===`search`?`inventory`:e.view)},[]),E=(0,c.useCallback)((e,t)=>{i(e),t?.resourceId?(h(e=>({...e,selectedResourceId:t.resourceId??e.selectedResourceId,activeTab:t.assetTab??e.activeTab})),y(e=>({...e,rootResourceId:t.rootResourceId??t.resourceId??e.rootResourceId,selectedResourceId:t.resourceId??e.selectedResourceId}))):t?.assetTab&&e===`inventory`&&h(e=>({...e,activeTab:t.assetTab??e.activeTab})),t?.executionId&&(_(e=>({...e,selectedExecutionId:t.executionId??e.selectedExecutionId})),p(e=>({...e,selectedExecutionId:t.executionId??e.selectedExecutionId}))),e===`runs`&&t?.resourceId&&_(e=>({...e,query:t.resourceId??e.query})),C(n=>({selectedResourceId:t?.resourceId??n.selectedResourceId,selectedExecutionId:t?.executionId??n.selectedExecutionId,sourceLens:e}))},[]);return(0,c.useEffect)(()=>{let e=N_({pathname:window.location.pathname,hash:window.location.hash,activeView:r,assetViewState:m,runsViewState:g,timelineSelectedExecutionId:f.selectedExecutionId,lineageViewState:v});e!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&window.history.pushState(null,``,e)},[r,m,g,f.selectedExecutionId,v]),(0,c.useEffect)(()=>{let e=()=>{let e=D_(window.location.search);e.activeView!==void 0&&i(e.activeView),h(t=>e.assetViewState(t)),_(t=>e.runsViewState(t)),p(t=>e.timelineFilters(t)),y(e.lineageViewState),C(t=>e.investigationSelection(t))};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,c.useEffect)(()=>{if(!t.current){t.current=!0;return}p(t=>({...t,showTests:e.timelineDefaults.showTests,failuresOnly:e.timelineDefaults.failuresOnly,dependencyDirection:e.timelineDefaults.dependencyDirection,dependencyDepthHops:e.timelineDefaults.dependencyDepthHops})),h(t=>({...t,explorerMode:e.inventoryDefaults.explorerMode})),y(t=>({...t,upstreamDepth:e.inventoryDefaults.lineageUpstreamDepth,downstreamDepth:e.inventoryDefaults.lineageDownstreamDepth,allDepsMode:e.inventoryDefaults.allDepsMode,lensMode:e.inventoryDefaults.lineageLensMode})),o(e.sidebarCollapsedDefault);try{window.localStorage.setItem(pe,String(e.sidebarCollapsedDefault))}catch{}},[e]),(0,c.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),x(e=>({...e,isOpen:!0}))),e.key===`Escape`&&(l(!1),x(e=>({...e,isOpen:!1})))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),{activeView:r,sidebarCollapsed:a,setSidebarCollapsed:w,sidebarOpen:s,setSidebarOpen:l,overviewFilters:u,setOverviewFilters:d,timelineFilters:f,setTimelineFilters:p,assetViewState:m,setAssetViewState:h,runsViewState:g,setRunsViewState:_,lineageViewState:v,setLineageViewState:y,searchState:b,setSearchState:x,investigationSelection:S,setInvestigationSelection:C,setNavigationTarget:T,handleNavigateTo:E,frameClass:[`app-frame`,a?`app-frame--sidebar-collapsed`:``,s?`app-frame--nav-open`:``].filter(Boolean).join(` `)}}function F_(){let{toast:e}=Tg(),{preferences:t,setPreferences:n}=x_(),r=P_(t),{analysis:i,analysisSource:a,error:o,preloadLoading:s,pendingRemoteRun:l,acceptingRemoteRun:d,onLoadDifferent:f,onAnalysis:p,onError:m,onAcceptPendingRemoteRun:h}=f_(),{themePreference:g,setThemePreference:_}=Mt();(0,c.useEffect)(()=>{t.theme!==g&&_(t.theme)},[t.theme,_,g]);let v=(0,c.useRef)(null);(0,c.useEffect)(()=>{i&&!v.current&&a===`preload`&&e(`Workspace loaded — ${i.summary.total_nodes} executions`,`positive`),i&&!v.current&&a===`remote`&&e(`Remote workspace loaded — ${i.summary.total_nodes} executions`,`positive`),v.current=i},[i,a,e]);let y=(0,c.useRef)(null);return(0,c.useEffect)(()=>{if(l==null){y.current=null;return}y.current!==l.runId&&(y.current=l.runId,e(`A newer remote run is available: ${l.label}`,`warning`))},[l,e]),(0,u.jsx)(qg,{workspace:r,analysis:i,analysisSource:a,error:o,preloadLoading:s,pendingRemoteRun:l,acceptingRemoteRun:d,onLoadDifferent:f,onAnalysis:p,onError:m,onAcceptPendingRemoteRun:h,themePreference:g,setPreferences:n,preferences:t,setThemePreference:_,workspaceSignals:i?Yg(i,a):[]})}function I_(){return(0,u.jsx)(wg,{children:(0,u.jsx)(F_,{})})}(0,l.createRoot)(document.getElementById(`root`)).render((0,u.jsx)(c.StrictMode,{children:(0,u.jsx)(I_,{})}));
|