@preventive/triage 1.0.0-alpha.23 → 1.0.0-alpha.25

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,57 +1,57 @@
1
- var ae=globalThis,le=ae.ShadowRoot&&(ae.ShadyCSS===void 0||ae.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),ft=new WeakMap,ce=class{constructor(e,n,i){if(this._$cssResult$=!0,i!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o,n=this.t;if(le&&e===void 0){let i=n!==void 0&&n.length===1;i&&(e=ft.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ft.set(n,e))}return e}toString(){return this.cssText}},V=t=>new ce(typeof t=="string"?t:t+"",void 0,ht);var mt=(t,e)=>{if(le)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of e){let i=document.createElement("style"),r=ae.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=n.cssText,t.appendChild(i)}},Re=le?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(let i of e.cssRules)n+=i.cssText;return V(n)})(t):t;var{is:Wn,defineProperty:Kn,getOwnPropertyDescriptor:Xn,getOwnPropertyNames:qn,getOwnPropertySymbols:Jn,getPrototypeOf:Yn}=Object,ue=globalThis,gt=ue.trustedTypes,Zn=gt?gt.emptyScript:"",Qn=ue.reactiveElementPolyfillSupport,G=(t,e)=>t,Te={toAttribute(t,e){switch(e){case Boolean:t=t?Zn:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},bt=(t,e)=>!Wn(t,e),yt={attribute:!0,type:String,converter:Te,reflect:!1,useDefault:!1,hasChanged:bt};Symbol.metadata??=Symbol("metadata"),ue.litPropertyMetadata??=new WeakMap;var v=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=yt){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,n);r!==void 0&&Kn(this.prototype,e,r)}}static getPropertyDescriptor(e,n,i){let{get:r,set:o}=Xn(this.prototype,e)??{get(){return this[n]},set(s){this[n]=s}};return{get:r,set(s){let a=r?.call(this);o?.call(this,s),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??yt}static _$Ei(){if(this.hasOwnProperty(G("elementProperties")))return;let e=Yn(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(G("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(G("properties"))){let n=this.properties,i=[...qn(n),...Jn(n)];for(let r of i)this.createProperty(r,n[r])}let e=this[Symbol.metadata];if(e!==null){let n=litPropertyMetadata.get(e);if(n!==void 0)for(let[i,r]of n)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[n,i]of this.elementProperties){let r=this._$Eu(n,i);r!==void 0&&this._$Eh.set(r,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let n=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let r of i)n.unshift(Re(r))}else e!==void 0&&n.push(Re(e));return n}static _$Eu(e,n){let i=n.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,n=this.constructor.elementProperties;for(let i of n.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return mt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,i){this._$AK(e,i)}_$ET(e,n){let i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute!==void 0?i.converter:Te).toAttribute(n,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,n){let i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let o=i.getPropertyOptions(r),s=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:Te;this._$Em=r;let a=s.fromAttribute(n,o.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,n,i,r=!1,o){if(e!==void 0){let s=this.constructor;if(r===!1&&(o=this[e]),i??=s.getPropertyOptions(e),!((i.hasChanged??bt)(o,n)||i.useDefault&&i.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:i,reflect:r,wrapped:o},s){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??n??this[e]),o!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(n=void 0),this._$AL.set(e,n)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,o]of i){let{wrapped:s}=o,a=this[r];s!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,o,a)}}let e=!1,n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(n)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[G("elementProperties")]=new Map,v[G("finalized")]=new Map,Qn?.({ReactiveElement:v}),(ue.reactiveElementVersions??=[]).push("2.1.2");var De=globalThis,wt=t=>t,de=De.trustedTypes,_t=de?de.createPolicy("lit-html",{createHTML:t=>t}):void 0,St="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,kt="?"+S,er=`<${kt}>`,T=document,K=()=>T.createComment(""),X=t=>t===null||typeof t!="object"&&typeof t!="function",He=Array.isArray,tr=t=>He(t)||typeof t?.[Symbol.iterator]=="function",Le=`[
2
- \f\r]`,W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xt=/-->/g,vt=/>/g,C=RegExp(`>|${Le}(?:([^\\s"'>=/]+)(${Le}*=${Le}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),$t=/'/g,Et=/"/g,It=/^(?:script|style|textarea|title)$/i,Pe=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),w=Pe(1),yo=Pe(2),bo=Pe(3),$=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),At=new WeakMap,R=T.createTreeWalker(T,129);function Ct(t,e){if(!He(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return _t!==void 0?_t.createHTML(e):e}var nr=(t,e)=>{let n=t.length-1,i=[],r,o=e===2?"<svg>":e===3?"<math>":"",s=W;for(let a=0;a<n;a++){let c=t[a],l,d,u=-1,p=0;for(;p<c.length&&(s.lastIndex=p,d=s.exec(c),d!==null);)p=s.lastIndex,s===W?d[1]==="!--"?s=xt:d[1]!==void 0?s=vt:d[2]!==void 0?(It.test(d[2])&&(r=RegExp("</"+d[2],"g")),s=C):d[3]!==void 0&&(s=C):s===C?d[0]===">"?(s=r??W,u=-1):d[1]===void 0?u=-2:(u=s.lastIndex-d[2].length,l=d[1],s=d[3]===void 0?C:d[3]==='"'?Et:$t):s===Et||s===$t?s=C:s===xt||s===vt?s=W:(s=C,r=void 0);let h=s===C&&t[a+1].startsWith("/>")?" ":"";o+=s===W?c+er:u>=0?(i.push(l),c.slice(0,u)+St+c.slice(u)+S+h):c+S+(u===-2?a:h)}return[Ct(t,o+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},q=class t{constructor({strings:e,_$litType$:n},i){let r;this.parts=[];let o=0,s=0,a=e.length-1,c=this.parts,[l,d]=nr(e,n);if(this.el=t.createElement(l,i),R.currentNode=this.el.content,n===2||n===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=R.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let u of r.getAttributeNames())if(u.endsWith(St)){let p=d[s++],h=r.getAttribute(u).split(S),f=/([.?@])?(.*)/.exec(p);c.push({type:1,index:o,name:f[2],strings:h,ctor:f[1]==="."?Oe:f[1]==="?"?Ne:f[1]==="@"?Be:H}),r.removeAttribute(u)}else u.startsWith(S)&&(c.push({type:6,index:o}),r.removeAttribute(u));if(It.test(r.tagName)){let u=r.textContent.split(S),p=u.length-1;if(p>0){r.textContent=de?de.emptyScript:"";for(let h=0;h<p;h++)r.append(u[h],K()),R.nextNode(),c.push({type:2,index:++o});r.append(u[p],K())}}}else if(r.nodeType===8)if(r.data===kt)c.push({type:2,index:o});else{let u=-1;for(;(u=r.data.indexOf(S,u+1))!==-1;)c.push({type:7,index:o}),u+=S.length-1}o++}}static createElement(e,n){let i=T.createElement("template");return i.innerHTML=e,i}};function D(t,e,n=t,i){if(e===$)return e;let r=i!==void 0?n._$Co?.[i]:n._$Cl,o=X(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(t),r._$AT(t,n,i)),i!==void 0?(n._$Co??=[])[i]=r:n._$Cl=r),r!==void 0&&(e=D(t,r._$AS(t,e.values),r,i)),e}var Me=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:n},parts:i}=this._$AD,r=(e?.creationScope??T).importNode(n,!0);R.currentNode=r;let o=R.nextNode(),s=0,a=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new J(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new Ue(o,this,e)),this._$AV.push(l),c=i[++a]}s!==c?.index&&(o=R.nextNode(),s++)}return R.currentNode=T,r}p(e){let n=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,n),n+=i.strings.length-2):i._$AI(e[n])),n++}},J=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,i,r){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=D(this,e,n),X(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==$&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):tr(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==m&&X(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){let{values:n,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=q.createElement(Ct(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(n);else{let o=new Me(r,this),s=o.u(this.options);o.p(n),this.T(s),this._$AH=o}}_$AC(e){let n=At.get(e.strings);return n===void 0&&At.set(e.strings,n=new q(e)),n}k(e){He(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,i,r=0;for(let o of e)r===n.length?n.push(i=new t(this.O(K()),this.O(K()),this,this.options)):i=n[r],i._$AI(o),r++;r<n.length&&(this._$AR(i&&i._$AB.nextSibling,r),n.length=r)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let i=wt(e).nextSibling;wt(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},H=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,i,r,o){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=n,this._$AM=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=m}_$AI(e,n=this,i,r){let o=this.strings,s=!1;if(o===void 0)e=D(this,e,n,0),s=!X(e)||e!==this._$AH&&e!==$,s&&(this._$AH=e);else{let a=e,c,l;for(e=o[0],c=0;c<o.length-1;c++)l=D(this,a[i+c],n,c),l===$&&(l=this._$AH[c]),s||=!X(l)||l!==this._$AH[c],l===m?e=m:e!==m&&(e+=(l??"")+o[c+1]),this._$AH[c]=l}s&&!r&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Oe=class extends H{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}},Ne=class extends H{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}},Be=class extends H{constructor(e,n,i,r,o){super(e,n,i,r,o),this.type=5}_$AI(e,n=this){if((e=D(this,e,n,0)??m)===$)return;let i=this._$AH,r=e===m&&i!==m||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==m&&(i===m||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Ue=class{constructor(e,n,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){D(this,e)}};var rr=De.litHtmlPolyfillSupport;rr?.(q,J),(De.litHtmlVersions??=[]).push("3.3.3");var Rt=(t,e,n)=>{let i=n?.renderBefore??e,r=i._$litPart$;if(r===void 0){let o=n?.renderBefore??null;i._$litPart$=r=new J(e.insertBefore(K(),o),o,void 0,n??{})}return r._$AI(t),r};var Fe=globalThis,P=class extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Rt(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return $}};P._$litElement$=!0,P.finalized=!0,Fe.litElementHydrateSupport?.({LitElement:P});var ir=Fe.litElementPolyfillSupport;ir?.({LitElement:P});(Fe.litElementVersions??=[]).push("4.2.2");var Tt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Lt=t=>(...e)=>({_$litDirective$:t,values:e}),pe=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,i){this._$Ct=e,this._$AM=n,this._$Ci=i}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};var Y=class extends pe{constructor(e){if(super(e),this.it=m,e.type!==Tt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===m||e==null)return this._t=void 0,this.it=e;if(e===$)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};Y.directiveName="unsafeHTML",Y.resultType=1;var or=Lt(Y);var sr=[["manage","Overview"],["manage-bundles","Bundles"],["manage-scans","Scans"],["manage-reports","Reports"],["manage-repos","Repositories","admin"],["admin-users","Users","admin"],["manage-teams","Teams","admin"],["manage-import","Import","admin"],["manage-links","Links"],["manage-history","History"]];function Mt(t,e,n=!1){return w`<nav class="manage-nav" aria-label="Management pages">${sr.filter(([i,,r])=>(r==null||r===e)&&(i!=="manage-links"||n)).map(([i,r])=>w`<button type="button" aria-current="${t===i?"page":m}" @click="${()=>{document.dispatchEvent(new CustomEvent("managed-admin-navigate",{detail:{view:i},bubbles:!0,composed:!0}))}}">${r}</button>`)}</nav>`}var Ot=`:host{display:block;position:relative;padding:0 clamp(1rem,3vw,3rem) 3rem;color:var(--text);container-type:inline-size;font-family:var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);font-size:.875rem;line-height:1.5;--panel:color-mix(in srgb, var(--bg) 50%, var(--surface));--panel-hover:color-mix(in srgb, var(--text) 3%, var(--panel))}*,*:before,*:after{box-sizing:border-box}.wrap{width:100%;max-width:76rem;margin:0 auto}.manage-nav button{flex:0 0 auto;position:relative;min-height:3.7rem;padding:.9rem 0;border:0;border-radius:0;color:var(--muted);background:none;font-size:.8rem;font-weight:500;white-space:nowrap}.manage-nav button:hover,.manage-nav button[aria-current=page]{color:var(--text)}.manage-nav button[aria-current=page]:after{content:"";position:absolute;bottom:0;inset-inline:0;height:2px;background:var(--accent);border-radius:2px}.manage-nav button:focus-visible{outline-offset:-3px}.head{display:flex;align-items:center;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem}h1,.head h1{margin:0;font-size:1.9rem;font-weight:600;letter-spacing:-.045em;line-height:1.2}.count{display:inline-flex;align-items:center;justify-content:center;min-width:1.6rem;padding:.12rem .5rem;border:1px solid var(--border);border-radius:6px;color:var(--muted);background:var(--surface);font-size:.73rem;font-weight:500;font-variant-numeric:tabular-nums}button,input,select{font:inherit}button,select,input[type=checkbox]{cursor:default}button,a,input,select{-webkit-app-region:no-drag}button,a{transition:background .15s,color .15s,border-color .15s}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button:disabled,select:disabled{opacity:.45}input:not([type=checkbox]),select{min-width:0;min-height:2.25rem;padding:.45rem .65rem;border:1px solid var(--border);border-radius:7px;background:var(--bg);color:var(--text);font-size:.8rem}input::placeholder{color:var(--muted)}input[type=checkbox]{accent-color:var(--accent)}.btn,.drop-browse{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:2.25rem;height:auto;padding:.45rem .8rem;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--text);font-size:.8rem;font-weight:500;text-decoration:none;white-space:nowrap}.btn:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--surface-active);border-color:var(--muted)}.btn.primary,.drop-browse{color:var(--bg);background:var(--accent);border-color:var(--accent)}.btn.primary:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--accent);filter:brightness(1.08)}.btn svg,.icon-btn svg{width:1rem;height:1rem}.icon-btn{width:2rem;height:2rem}.avatar{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,var(--bg));border:1px solid color-mix(in srgb,var(--accent) 16%,var(--border))}.breadcrumb{display:flex;align-items:center;flex-basis:100%;gap:.4rem;margin-bottom:.8rem}.breadcrumb-manage{padding:.1rem 0;border:0;background:transparent;color:var(--muted);font-size:.78rem}.breadcrumb-manage:hover{color:var(--text)}.breadcrumb-separator{color:var(--muted)}.msg{margin:1rem 0;padding:1.1rem 1.25rem;border:1px solid var(--border);border-radius:9px;color:var(--muted);font-size:.85rem}.msg.error{color:var(--critical);border-color:color-mix(in srgb,var(--critical) 35%,var(--border))}.empty{padding:3.5rem 1.5rem;border:1px dashed var(--border);border-radius:10px;color:var(--muted);text-align:center}.empty strong{display:block;margin-bottom:.4rem;color:var(--text);font-size:.95rem;font-weight:500}.empty p{margin:0;font-size:.85rem}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@container (max-width: 35rem){.manage-nav{gap:1.2rem;margin-bottom:1.75rem}.manage-nav button{min-height:3.25rem}h1,.head h1{font-size:1.65rem}.intro{margin-bottom:1.5rem}}@media(prefers-reduced-motion:reduce){button,a{transition:none}}.collection-toolbar input{flex:1;max-width:26rem;min-width:10rem}.collection-toolbar select{min-width:10rem}.result-count{min-width:8rem;text-align:right;white-space:nowrap;margin-left:auto;color:var(--muted);font-size:.75rem;font-variant-numeric:tabular-nums}@container (max-width: 35rem){.collection-toolbar input{flex-basis:100%;max-width:none}}.manage-nav{display:flex;gap:1.35rem;align-items:stretch;overflow-x:auto;scrollbar-width:thin;border-bottom:1px solid var(--border);margin-bottom:1.5rem;padding:0 .1rem}.intro{margin:0 0 1.25rem;max-width:46rem;color:var(--muted);font-size:.875rem;line-height:1.65}.collection-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-bottom:.85rem}.page-intro{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem 1rem;margin-bottom:1.25rem}.page-intro .intro{margin:0}a{cursor:default}.loading-rows{border:1px solid var(--border);border-radius:10px;overflow:hidden}.loading-row{display:grid;align-content:center;gap:.6rem;min-height:4.25rem;padding:.85rem 1rem}.loading-row+.loading-row{border-top:1px solid var(--border)}.loading-row span{width:40%;height:.65rem;border-radius:3px;background:color-mix(in srgb,var(--muted) 15%,transparent)}.loading-row span+span{width:65%;height:.5rem}.drop-browse{min-width:7rem}
4
- `;var Nt=`h1{font-size:1.35rem;margin-bottom:.5rem}.workspace-drop{display:grid;gap:.8rem;padding:2rem;margin:1.5rem 0;border:1px dashed var(--border);border-radius:8px}.workspace-drop.dragging{border-color:var(--accent);background:rgb(from var(--accent) r g b / .08)}.workspace-drop span,p,li span{color:var(--muted);line-height:1.5}.actions,.local-choice{display:flex;gap:.8rem;flex-wrap:wrap;align-items:center}.local-choice{margin-bottom:1.5rem}.import-preview{display:grid;gap:.8rem}input:not([type=radio]),select{padding:.55rem;border:1px solid var(--border);border-radius:5px;color:var(--text);background:var(--bg);font:inherit}.import-preview input:not([type=radio]),.import-preview select{width:100%;box-sizing:border-box}fieldset{display:grid;gap:.8rem;padding:1rem;border:1px solid var(--border);border-radius:5px}fieldset label{display:flex;gap:.5rem;align-items:center}li{padding:.4rem 0;overflow-wrap:anywhere}li span{display:block;font-size:.8rem}ul{padding-left:1.2rem}.primary{justify-self:start;color:var(--accent)}.error{color:var(--critical)}button:disabled{opacity:.5}input:focus-visible,select:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
5
- `;var lr=new TextEncoder,ur=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function fe(t){if(typeof t!="string")throw new TypeError(`encodeUtf8 expects a string, got ${typeof t}`);if(!t.isWellFormed())throw new TypeError("encodeUtf8: input contains lone surrogates");return lr.encode(t)}function Bt(t){if(!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer))throw new TypeError(`decodeUtf8 expects a BufferSource, got ${t===null?"null":typeof t}`);return ur.decode(t)}async function dr(t,{maxBytes:e}={}){let n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));if(e==null)return new Uint8Array(await new Response(n).arrayBuffer());let i=n.getReader(),r=[],o=0;for(;;){let{value:c,done:l}=await i.read();if(l)break;if(o+=c.length,o>e){try{await i.cancel()}catch{}throw new Error(`gunzipBytes: decompressed size exceeds ${e}-byte cap`)}r.push(c)}let s=new Uint8Array(o),a=0;for(let c of r)s.set(c,a),a+=c.length;return s}async function ze(t){return Bt(await dr(t))}var Ut=1,he=16,Dt=12,Ht=1+he+Dt+16,je=1+he+Dt;async function fr(t,e){let n=await crypto.subtle.importKey("raw",fe(t),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",hash:"SHA-256",salt:e,iterations:3e6},n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function Pt(t){return!(t instanceof Uint8Array)||t.length<Ht?!1:t[0]===Ut}async function hr(t,e){if(typeof e!="string"||!e)throw new TypeError("tryDecryptWithPassword: password required");if(!(t instanceof Uint8Array)||t.length<Ht)return{ok:!1,reason:"malformed"};if(t[0]!==Ut)return{ok:!1,reason:"malformed"};let n=t.subarray(1,1+he),i=t.subarray(1+he,je),r=t.subarray(je),o=await fr(e,n),s;try{s=new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:i,additionalData:t.subarray(0,je)},o,r))}catch{return{ok:!1,reason:"wrong-password"}}return{ok:!0,plaintext:s}}async function Ft(t,e,n){if(!n||typeof n.malformedMsg!="string"||typeof n.wrongPasswordMsg!="string")throw new TypeError("decryptWithPasswordOrThrow: { malformedMsg, wrongPasswordMsg } strings required");let i=await hr(t,e);if(i.ok)return i.plaintext;throw i.reason==="wrong-password"?new Error(n.wrongPasswordMsg):new Error(n.malformedMsg)}var me=Pt;function zt(t,e){return Ft(t,e,{malformedMsg:"malformed encrypted bundle",wrongPasswordMsg:"wrong password or corrupt bundle"})}var mr=1,jt=1024,Vt=1024,ge=200,Kt=100*1024*1024,gr=Math.ceil(Kt*4/3)+16,Gt=512,Wt=64;function yr(t){if(!t||typeof t!="object")return"payload is not an object";if(t.version!==mr)return`unsupported export version: ${t.version}`;if(!t.workspace||typeof t.workspace!="object")return"workspace metadata missing";if(typeof t.workspace.id!="string")return"workspace.id must be a string";if(typeof t.workspace.name!="string")return"workspace.name must be a string";if(typeof t.workspace.privateKey!="string")return"workspace.privateKey must be a string";if(t.workspace.createdAt!==void 0&&!Number.isFinite(t.workspace.createdAt))return"workspace.createdAt must be a finite number or omitted";if(!Array.isArray(t.reports))return"reports field must be an array";if(t.reports.length>Vt)return`reports count (${t.reports.length}) exceeds cap (${Vt})`;if(t.bundles!==void 0){if(!Array.isArray(t.bundles))return"bundles field must be an array when present";if(t.bundles.length>jt)return`bundles count (${t.bundles.length}) exceeds cap (${jt})`;for(let e of t.bundles){if(typeof e!="string")return"bundles entries must be strings";if(e.length>ge)return`bundle integrity exceeds per-entry length cap (${ge})`}}if(t.bundleBlobs!==void 0){if(!Array.isArray(t.bundleBlobs))return"bundleBlobs field must be an array when present";if(t.bundleBlobs.length>Wt)return`bundleBlobs count (${t.bundleBlobs.length}) exceeds cap (${Wt})`;for(let e of t.bundleBlobs){if(!e||typeof e!="object"||Array.isArray(e))return"bundleBlobs entries must be objects";if(typeof e.integrity!="string"||e.integrity.length===0)return"bundleBlobs.integrity must be a non-empty string";if(e.integrity.length>ge)return`bundleBlobs.integrity exceeds per-entry length cap (${ge})`;if(typeof e.name!="string"||e.name.length===0)return"bundleBlobs.name must be a non-empty string";if(e.name.length>Gt)return`bundleBlobs.name exceeds per-entry length cap (${Gt})`;if(e.name.includes("\0"))return"bundleBlobs.name cannot contain NUL";if(typeof e.data!="string")return"bundleBlobs.data must be a base64 string";if(e.data.length>gr)return`bundleBlobs.data exceeds per-blob size cap (${Kt} bytes raw)`}}return null}async function Ve(t,e){if(me(t)){if(typeof e!="string"||!e)throw new TypeError("parseWorkspaceBundleBytes: password required for encrypted bundle");let i=await zt(t,e);try{return ye(await ze(i))}catch(r){throw new Error("wrong password or corrupt bundle",{cause:r})}}let n;try{n=await ze(t)}catch(i){throw new Error(`gzip decompression failed: ${i.message}`,{cause:i})}return ye(n)}function ye(t){let e;try{e=JSON.parse(t)}catch(r){throw new Error(`payload is not JSON: ${r.message}`,{cause:r})}let n=yr(e);if(n===null)return e;let i=n.includes("exceeds cap");throw new Error(i?n:`not a deepview workspace export: ${n}`)}var br=/^\d+$/u;function wr(t){for(let e=0;e<t.length;e++){let n=t.codePointAt(e);if(n<32||n===127)return!0}return!1}var Ge=512;function _r(t){return typeof t=="string"&&t.length>0&&t.length<=Ge&&!wr(t)}function Z(t){return _r(t)&&!br.test(t)}var ds=Object.freeze({manage:"/manage","manage-bundles":"/manage/bundle","manage-scans":"/manage/scans","manage-reports":"/manage/report","manage-repos":"/manage/repositories","admin-users":"/manage/users","manage-teams":"/manage/team","manage-import":"/manage/import","manage-links":"/manage/links","manage-history":"/manage/history"});function xr(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let{id:e}=t;return typeof e=="string"&&e.length>0?e:null}function Xt(t){let e;try{e=JSON.parse(t)}catch{return null}if(!Array.isArray(e)||e.length===0)return null;let n=[],i=0;for(let r of e){if(!Array.isArray(r))return null;let o=new Set;for(let s of r){let a=xr(s);if(a===null)return null;Z(a)?o.add(a):i++}o.size>1&&n.push([...o])}return{groups:n,skipped:i}}var vr=/^( *)(```|~~~)/u,F=/^( *)(?:[-*+]|\d{1,9}[.)]) +(?=\S)/u;function L(t){let e=[],n=-1,i="",r=0,o=0,s=0;for(let a of t.split(`
6
- `)){let c=s;s+=a.length+1;let l=vr.exec(a);if(n!==-1){l&&l[2]===i&&l[1].length<=r+3&&(e.push([n,c+a.length]),n=-1);continue}if(l&&l[1].length<=o+3){n=c,i=l[2],r=l[1].length;continue}if(!a.trim())continue;let d=F.exec(a),u=/^ */u.exec(a)[0].length;d&&d[1].length<=o+3?o=d[0].length:u<o&&(o=0)}return n!==-1&&e.push([n,t.length]),e}function M(t,e){return t.some(([n,i])=>e>=n&&e<i)}function E(t){return String(t??"").replaceAll(/\r\n?/gu,`
7
- `)}var Q=/^## +(.*)$/gmu,ee=/^### +(.*)$/gmu,O=/^#### +(.*)$/gmu,We=/^(.+):(\d+(?:-\d+)?)$/u;function be(t){return/^[0-9a-f]{7,64}$/iu.test(t)}function A(t,e){let n=L(t),i=[...t.matchAll(e)].filter(r=>!M(n,r.index));return i.map((r,o)=>({heading:r[1],body:t.slice(r.index+r[0].length+1,i[o+1]?.index)}))}function N(t,e){let n=L(t),i=[...t.matchAll(e)].find(r=>!M(n,r.index));return i?{head:t.slice(0,i.index),subs:A(t,e)}:{head:t,subs:[]}}function te(t){let e=t.indexOf(`
8
- `);return e===-1?{title:t.trim(),body:""}:{title:t.slice(0,e).trim(),body:t.slice(e+1)}}function $r(t){let e=[];for(let n of t.split(`
9
- `)){let i=n.trim();if(!i.startsWith("|")||/^[\s:|-]+$/u.test(i)&&i.includes("-"))continue;let r=i.replace(/^\|/u,"").replace(/\|$/u,"").split("|").map(o=>o.trim());e.push(r)}return e}function ne(t){let e=$r(t);if(e.length<2)return[];let n=e[0].map(r=>r.toLowerCase()),i=[];for(let r of e.slice(1)){if(r.length===n.length&&r.every((s,a)=>s.toLowerCase()===n[a]))continue;let o={};n.forEach((s,a)=>{s&&(o[s]=r[a]??"")}),i.push(o)}return i}function qt(t){let e=Object.create(null),n=Object.create(null),i=[],r=null,o="",s=[],a="",c=(u,p,h)=>{!u||u in e||(e[u]=h.trim(),n[u]=p)},l=()=>{r&&c(r,o,s.join(`
1
+ var ue=globalThis,pe=ue.ShadowRoot&&(ue.ShadyCSS===void 0||ue.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$t=Symbol(),xt=new WeakMap,de=class{constructor(e,n,i){if(this._$cssResult$=!0,i!==$t)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o,n=this.t;if(pe&&e===void 0){let i=n!==void 0&&n.length===1;i&&(e=xt.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&xt.set(n,e))}return e}toString(){return this.cssText}},G=t=>new de(typeof t=="string"?t:t+"",void 0,$t);var Et=(t,e)=>{if(pe)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of e){let i=document.createElement("style"),r=ue.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=n.cssText,t.appendChild(i)}},Be=pe?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(let i of e.cssRules)n+=i.cssText;return G(n)})(t):t;var{is:tr,defineProperty:nr,getOwnPropertyDescriptor:rr,getOwnPropertyNames:ir,getOwnPropertySymbols:or,getPrototypeOf:sr}=Object,fe=globalThis,At=fe.trustedTypes,ar=At?At.emptyScript:"",cr=fe.reactiveElementPolyfillSupport,W=(t,e)=>t,Ue={toAttribute(t,e){switch(e){case Boolean:t=t?ar:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},kt=(t,e)=>!tr(t,e),St={attribute:!0,type:String,converter:Ue,reflect:!1,useDefault:!1,hasChanged:kt};Symbol.metadata??=Symbol("metadata"),fe.litPropertyMetadata??=new WeakMap;var E=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=St){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,n);r!==void 0&&nr(this.prototype,e,r)}}static getPropertyDescriptor(e,n,i){let{get:r,set:o}=rr(this.prototype,e)??{get(){return this[n]},set(s){this[n]=s}};return{get:r,set(s){let a=r?.call(this);o?.call(this,s),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??St}static _$Ei(){if(this.hasOwnProperty(W("elementProperties")))return;let e=sr(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(W("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W("properties"))){let n=this.properties,i=[...ir(n),...or(n)];for(let r of i)this.createProperty(r,n[r])}let e=this[Symbol.metadata];if(e!==null){let n=litPropertyMetadata.get(e);if(n!==void 0)for(let[i,r]of n)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[n,i]of this.elementProperties){let r=this._$Eu(n,i);r!==void 0&&this._$Eh.set(r,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let n=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let r of i)n.unshift(Be(r))}else e!==void 0&&n.push(Be(e));return n}static _$Eu(e,n){let i=n.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,n=this.constructor.elementProperties;for(let i of n.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Et(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,i){this._$AK(e,i)}_$ET(e,n){let i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute!==void 0?i.converter:Ue).toAttribute(n,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,n){let i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let o=i.getPropertyOptions(r),s=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:Ue;this._$Em=r;let a=s.fromAttribute(n,o.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,n,i,r=!1,o){if(e!==void 0){let s=this.constructor;if(r===!1&&(o=this[e]),i??=s.getPropertyOptions(e),!((i.hasChanged??kt)(o,n)||i.useDefault&&i.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:i,reflect:r,wrapped:o},s){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??n??this[e]),o!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(n=void 0),this._$AL.set(e,n)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,o]of i){let{wrapped:s}=o,a=this[r];s!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,o,a)}}let e=!1,n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(n)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[W("elementProperties")]=new Map,E[W("finalized")]=new Map,cr?.({ReactiveElement:E}),(fe.reactiveElementVersions??=[]).push("2.1.2");var Ve=globalThis,It=t=>t,he=Ve.trustedTypes,Ct=he?he.createPolicy("lit-html",{createHTML:t=>t}):void 0,Nt="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,Bt="?"+I,lr=`<${Bt}>`,L=document,X=()=>L.createComment(""),q=t=>t===null||typeof t!="object"&&typeof t!="function",Ge=Array.isArray,ur=t=>Ge(t)||typeof t?.[Symbol.iterator]=="function",De=`[
2
+ \f\r]`,K=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Tt=/-->/g,Rt=/>/g,T=RegExp(`>|${De}(?:([^\\s"'>=/]+)(${De}*=${De}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Lt=/'/g,Mt=/"/g,Ut=/^(?:script|style|textarea|title)$/i,We=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),b=We(1),$o=We(2),Eo=We(3),A=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),Ot=new WeakMap,R=L.createTreeWalker(L,129);function Dt(t,e){if(!Ge(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ct!==void 0?Ct.createHTML(e):e}var dr=(t,e)=>{let n=t.length-1,i=[],r,o=e===2?"<svg>":e===3?"<math>":"",s=K;for(let a=0;a<n;a++){let c=t[a],l,d,u=-1,p=0;for(;p<c.length&&(s.lastIndex=p,d=s.exec(c),d!==null);)p=s.lastIndex,s===K?d[1]==="!--"?s=Tt:d[1]!==void 0?s=Rt:d[2]!==void 0?(Ut.test(d[2])&&(r=RegExp("</"+d[2],"g")),s=T):d[3]!==void 0&&(s=T):s===T?d[0]===">"?(s=r??K,u=-1):d[1]===void 0?u=-2:(u=s.lastIndex-d[2].length,l=d[1],s=d[3]===void 0?T:d[3]==='"'?Mt:Lt):s===Mt||s===Lt?s=T:s===Tt||s===Rt?s=K:(s=T,r=void 0);let h=s===T&&t[a+1].startsWith("/>")?" ":"";o+=s===K?c+lr:u>=0?(i.push(l),c.slice(0,u)+Nt+c.slice(u)+I+h):c+I+(u===-2?a:h)}return[Dt(t,o+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},J=class t{constructor({strings:e,_$litType$:n},i){let r;this.parts=[];let o=0,s=0,a=e.length-1,c=this.parts,[l,d]=dr(e,n);if(this.el=t.createElement(l,i),R.currentNode=this.el.content,n===2||n===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=R.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let u of r.getAttributeNames())if(u.endsWith(Nt)){let p=d[s++],h=r.getAttribute(u).split(I),f=/([.?@])?(.*)/.exec(p);c.push({type:1,index:o,name:f[2],strings:h,ctor:f[1]==="."?He:f[1]==="?"?Pe:f[1]==="@"?ze:H}),r.removeAttribute(u)}else u.startsWith(I)&&(c.push({type:6,index:o}),r.removeAttribute(u));if(Ut.test(r.tagName)){let u=r.textContent.split(I),p=u.length-1;if(p>0){r.textContent=he?he.emptyScript:"";for(let h=0;h<p;h++)r.append(u[h],X()),R.nextNode(),c.push({type:2,index:++o});r.append(u[p],X())}}}else if(r.nodeType===8)if(r.data===Bt)c.push({type:2,index:o});else{let u=-1;for(;(u=r.data.indexOf(I,u+1))!==-1;)c.push({type:7,index:o}),u+=I.length-1}o++}}static createElement(e,n){let i=L.createElement("template");return i.innerHTML=e,i}};function F(t,e,n=t,i){if(e===A)return e;let r=i!==void 0?n._$Co?.[i]:n._$Cl,o=q(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(t),r._$AT(t,n,i)),i!==void 0?(n._$Co??=[])[i]=r:n._$Cl=r),r!==void 0&&(e=F(t,r._$AS(t,e.values),r,i)),e}var Fe=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:n},parts:i}=this._$AD,r=(e?.creationScope??L).importNode(n,!0);R.currentNode=r;let o=R.nextNode(),s=0,a=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new Y(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new je(o,this,e)),this._$AV.push(l),c=i[++a]}s!==c?.index&&(o=R.nextNode(),s++)}return R.currentNode=L,r}p(e){let n=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,n),n+=i.strings.length-2):i._$AI(e[n])),n++}},Y=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,i,r){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=F(this,e,n),q(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==A&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ur(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==m&&q(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){let{values:n,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=J.createElement(Dt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(n);else{let o=new Fe(r,this),s=o.u(this.options);o.p(n),this.T(s),this._$AH=o}}_$AC(e){let n=Ot.get(e.strings);return n===void 0&&Ot.set(e.strings,n=new J(e)),n}k(e){Ge(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,i,r=0;for(let o of e)r===n.length?n.push(i=new t(this.O(X()),this.O(X()),this,this.options)):i=n[r],i._$AI(o),r++;r<n.length&&(this._$AR(i&&i._$AB.nextSibling,r),n.length=r)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let i=It(e).nextSibling;It(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},H=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,i,r,o){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=n,this._$AM=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=m}_$AI(e,n=this,i,r){let o=this.strings,s=!1;if(o===void 0)e=F(this,e,n,0),s=!q(e)||e!==this._$AH&&e!==A,s&&(this._$AH=e);else{let a=e,c,l;for(e=o[0],c=0;c<o.length-1;c++)l=F(this,a[i+c],n,c),l===A&&(l=this._$AH[c]),s||=!q(l)||l!==this._$AH[c],l===m?e=m:e!==m&&(e+=(l??"")+o[c+1]),this._$AH[c]=l}s&&!r&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},He=class extends H{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}},Pe=class extends H{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}},ze=class extends H{constructor(e,n,i,r,o){super(e,n,i,r,o),this.type=5}_$AI(e,n=this){if((e=F(this,e,n,0)??m)===A)return;let i=this._$AH,r=e===m&&i!==m||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==m&&(i===m||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},je=class{constructor(e,n,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){F(this,e)}};var pr=Ve.litHtmlPolyfillSupport;pr?.(J,Y),(Ve.litHtmlVersions??=[]).push("3.3.3");var Ft=(t,e,n)=>{let i=n?.renderBefore??e,r=i._$litPart$;if(r===void 0){let o=n?.renderBefore??null;i._$litPart$=r=new Y(e.insertBefore(X(),o),o,void 0,n??{})}return r._$AI(t),r};var Ke=globalThis,P=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ft(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return A}};P._$litElement$=!0,P.finalized=!0,Ke.litElementHydrateSupport?.({LitElement:P});var fr=Ke.litElementPolyfillSupport;fr?.({LitElement:P});(Ke.litElementVersions??=[]).push("4.2.2");var Ht={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Pt=t=>(...e)=>({_$litDirective$:t,values:e}),me=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,i){this._$Ct=e,this._$AM=n,this._$Ci=i}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};var Z=class extends me{constructor(e){if(super(e),this.it=m,e.type!==Ht.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===m||e==null)return this._t=void 0,this.it=e;if(e===A)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};Z.directiveName="unsafeHTML",Z.resultType=1;var hr=Pt(Z);var mr=[["manage","Overview"],["manage-bundles","Bundles"],["manage-scans","Scans"],["manage-reports","Reports"],["manage-repos","Repositories","admin"],["admin-users","Users","admin"],["manage-teams","Teams","admin"],["manage-import","Import","admin"],["manage-links","Links"],["manage-history","History"]];function zt(t,e,n=!1){return b`<nav class="manage-nav" aria-label="Management pages">${mr.filter(([i,,r])=>(r==null||r===e)&&(i!=="manage-links"||n)).map(([i,r])=>b`<button type="button" aria-current="${t===i?"page":m}" @click="${()=>{document.dispatchEvent(new CustomEvent("managed-admin-navigate",{detail:{view:i},bubbles:!0,composed:!0}))}}">${r}</button>`)}</nav>`}var jt=`:host{display:block;position:relative;padding:0 clamp(1rem,3vw,3rem) 3rem;color:var(--text);container-type:inline-size;font-family:var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);font-size:.875rem;line-height:1.5;--panel:color-mix(in srgb, var(--bg) 50%, var(--surface));--panel-hover:color-mix(in srgb, var(--text) 3%, var(--panel))}*,*:before,*:after{box-sizing:border-box}.wrap{width:100%;max-width:76rem;margin:0 auto}.manage-nav button{flex:0 0 auto;position:relative;min-height:3.7rem;padding:.9rem 0;border:0;border-radius:0;color:var(--muted);background:none;font-size:.8rem;font-weight:500;white-space:nowrap}.manage-nav button:hover,.manage-nav button[aria-current=page]{color:var(--text)}.manage-nav button[aria-current=page]:after{content:"";position:absolute;bottom:0;inset-inline:0;height:2px;background:var(--accent);border-radius:2px}.manage-nav button:focus-visible{outline-offset:-3px}.head{display:flex;align-items:center;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem}h1,.head h1{margin:0;font-size:1.9rem;font-weight:600;letter-spacing:-.045em;line-height:1.2}.count{display:inline-flex;align-items:center;justify-content:center;min-width:1.6rem;padding:.12rem .5rem;border:1px solid var(--border);border-radius:6px;color:var(--muted);background:var(--surface);font-size:.73rem;font-weight:500;font-variant-numeric:tabular-nums}button,input,select{font:inherit}button,select,input[type=checkbox]{cursor:default}button,a,input,select{-webkit-app-region:no-drag}button,a{transition:background .15s,color .15s,border-color .15s}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button:disabled,select:disabled{opacity:.45}input:not([type=checkbox]),select{min-width:0;min-height:2.25rem;padding:.45rem .65rem;border:1px solid var(--border);border-radius:7px;background:var(--bg);color:var(--text);font-size:.8rem}input::placeholder{color:var(--muted)}input[type=checkbox]{accent-color:var(--accent)}.btn,.drop-browse{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:2.25rem;height:auto;padding:.45rem .8rem;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--text);font-size:.8rem;font-weight:500;text-decoration:none;white-space:nowrap}.btn:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--surface-active);border-color:var(--muted)}.btn.primary,.drop-browse{color:var(--bg);background:var(--accent);border-color:var(--accent)}.btn.primary:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--accent);filter:brightness(1.08)}.btn svg,.icon-btn svg{width:1rem;height:1rem}.icon-btn{width:2rem;height:2rem}.avatar{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,var(--bg));border:1px solid color-mix(in srgb,var(--accent) 16%,var(--border))}.breadcrumb{display:flex;align-items:center;flex-basis:100%;gap:.4rem;margin-bottom:.8rem}.breadcrumb-manage{padding:.1rem 0;border:0;background:transparent;color:var(--muted);font-size:.78rem}.breadcrumb-manage:hover{color:var(--text)}.breadcrumb-separator{color:var(--muted)}.msg{margin:1rem 0;padding:1.1rem 1.25rem;border:1px solid var(--border);border-radius:9px;color:var(--muted);font-size:.85rem}.msg.error{color:var(--critical);border-color:color-mix(in srgb,var(--critical) 35%,var(--border))}.empty{padding:3.5rem 1.5rem;border:1px dashed var(--border);border-radius:10px;color:var(--muted);text-align:center}.empty strong{display:block;margin-bottom:.4rem;color:var(--text);font-size:.95rem;font-weight:500}.empty p{margin:0;font-size:.85rem}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@container (max-width: 35rem){.manage-nav{gap:1.2rem;margin-bottom:1.75rem}.manage-nav button{min-height:3.25rem}h1,.head h1{font-size:1.65rem}.intro{margin-bottom:1.5rem}}@media(prefers-reduced-motion:reduce){button,a{transition:none}}.collection-toolbar input{flex:1;max-width:26rem;min-width:10rem}.collection-toolbar select{min-width:10rem}.result-count{min-width:8rem;text-align:right;white-space:nowrap;margin-left:auto;color:var(--muted);font-size:.75rem;font-variant-numeric:tabular-nums}@container (max-width: 35rem){.collection-toolbar input{flex-basis:100%;max-width:none}}.manage-nav{display:flex;gap:1.35rem;align-items:stretch;overflow-x:auto;scrollbar-width:thin;border-bottom:1px solid var(--border);margin-bottom:1.5rem;padding:0 .1rem}.intro{margin:0 0 1.25rem;max-width:46rem;color:var(--muted);font-size:.875rem;line-height:1.65}.collection-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-bottom:.85rem}.page-intro{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem 1rem;margin-bottom:1.25rem}.page-intro .intro{margin:0}a{cursor:default}.loading-rows{border:1px solid var(--border);border-radius:10px;overflow:hidden}.loading-row{display:grid;align-content:center;gap:.6rem;min-height:4.25rem;padding:.85rem 1rem}.loading-row+.loading-row{border-top:1px solid var(--border)}.loading-row span{width:40%;height:.65rem;border-radius:3px;background:color-mix(in srgb,var(--muted) 15%,transparent)}.loading-row span+span{width:65%;height:.5rem}.drop-browse{min-width:7rem}
4
+ `;var Vt=`h1{font-size:1.35rem;margin-bottom:.5rem}h2{font-size:1.1rem;margin-bottom:.5rem}.triage-import{display:flex;gap:1rem;align-items:center;margin:1.5rem 0 2rem}.triage-import .btn{flex-shrink:0}.triage-import p{margin:0}.workspace-drop{display:grid;gap:.8rem;padding:2rem;margin:1.5rem 0;border:1px dashed var(--border);border-radius:8px}.workspace-drop.dragging{border-color:var(--accent);background:rgb(from var(--accent) r g b / .08)}.workspace-drop span,p,li span{color:var(--muted);line-height:1.5}.actions,.local-choice{display:flex;gap:.8rem;flex-wrap:wrap;align-items:center}.local-choice{margin-bottom:1.5rem}.import-preview{display:grid;gap:.8rem}input:not([type=radio]),select{padding:.55rem;border:1px solid var(--border);border-radius:5px;color:var(--text);background:var(--bg);font:inherit}.import-preview input:not([type=radio]),.import-preview select{width:100%;box-sizing:border-box}fieldset{display:grid;gap:.8rem;padding:1rem;border:1px solid var(--border);border-radius:5px}fieldset label{display:flex;gap:.5rem;align-items:center}li{padding:.4rem 0;overflow-wrap:anywhere}li span{display:block;font-size:.8rem}ul{padding-left:1.2rem}.primary{justify-self:start;color:var(--accent)}.error{color:var(--critical)}button:disabled{opacity:.5}input:focus-visible,select:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
5
+ `;var br=new TextEncoder,wr=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});function ge(t){if(typeof t!="string")throw new TypeError(`encodeUtf8 expects a string, got ${typeof t}`);if(!t.isWellFormed())throw new TypeError("encodeUtf8: input contains lone surrogates");return br.encode(t)}function Gt(t){if(!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer))throw new TypeError(`decodeUtf8 expects a BufferSource, got ${t===null?"null":typeof t}`);return wr.decode(t)}async function _r(t,{maxBytes:e}={}){let n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));if(e==null)return new Uint8Array(await new Response(n).arrayBuffer());let i=n.getReader(),r=[],o=0;for(;;){let{value:c,done:l}=await i.read();if(l)break;if(o+=c.length,o>e){try{await i.cancel()}catch{}throw new Error(`gunzipBytes: decompressed size exceeds ${e}-byte cap`)}r.push(c)}let s=new Uint8Array(o),a=0;for(let c of r)s.set(c,a),a+=c.length;return s}async function Xe(t){return Gt(await _r(t))}var Wt=1,ye=16,Kt=12,Xt=1+ye+Kt+16,qe=1+ye+Kt;async function xr(t,e){let n=await crypto.subtle.importKey("raw",ge(t),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",hash:"SHA-256",salt:e,iterations:3e6},n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function qt(t){return!(t instanceof Uint8Array)||t.length<Xt?!1:t[0]===Wt}async function $r(t,e){if(typeof e!="string"||!e)throw new TypeError("tryDecryptWithPassword: password required");if(!(t instanceof Uint8Array)||t.length<Xt)return{ok:!1,reason:"malformed"};if(t[0]!==Wt)return{ok:!1,reason:"malformed"};let n=t.subarray(1,1+ye),i=t.subarray(1+ye,qe),r=t.subarray(qe),o=await xr(e,n),s;try{s=new Uint8Array(await crypto.subtle.decrypt({name:"AES-GCM",iv:i,additionalData:t.subarray(0,qe)},o,r))}catch{return{ok:!1,reason:"wrong-password"}}return{ok:!0,plaintext:s}}async function Jt(t,e,n){if(!n||typeof n.malformedMsg!="string"||typeof n.wrongPasswordMsg!="string")throw new TypeError("decryptWithPasswordOrThrow: { malformedMsg, wrongPasswordMsg } strings required");let i=await $r(t,e);if(i.ok)return i.plaintext;throw i.reason==="wrong-password"?new Error(n.wrongPasswordMsg):new Error(n.malformedMsg)}var be=qt;function Yt(t,e){return Jt(t,e,{malformedMsg:"malformed encrypted bundle",wrongPasswordMsg:"wrong password or corrupt bundle"})}var Er=1,Zt=1024,Qt=1024,we=200,nn=100*1024*1024,Ar=Math.ceil(nn*4/3)+16,en=512,tn=64;function Sr(t){if(!t||typeof t!="object")return"payload is not an object";if(t.version!==Er)return`unsupported export version: ${t.version}`;if(!t.workspace||typeof t.workspace!="object")return"workspace metadata missing";if(typeof t.workspace.id!="string")return"workspace.id must be a string";if(typeof t.workspace.name!="string")return"workspace.name must be a string";if(typeof t.workspace.privateKey!="string")return"workspace.privateKey must be a string";if(t.workspace.createdAt!==void 0&&!Number.isFinite(t.workspace.createdAt))return"workspace.createdAt must be a finite number or omitted";if(!Array.isArray(t.reports))return"reports field must be an array";if(t.reports.length>Qt)return`reports count (${t.reports.length}) exceeds cap (${Qt})`;if(t.bundles!==void 0){if(!Array.isArray(t.bundles))return"bundles field must be an array when present";if(t.bundles.length>Zt)return`bundles count (${t.bundles.length}) exceeds cap (${Zt})`;for(let e of t.bundles){if(typeof e!="string")return"bundles entries must be strings";if(e.length>we)return`bundle integrity exceeds per-entry length cap (${we})`}}if(t.bundleBlobs!==void 0){if(!Array.isArray(t.bundleBlobs))return"bundleBlobs field must be an array when present";if(t.bundleBlobs.length>tn)return`bundleBlobs count (${t.bundleBlobs.length}) exceeds cap (${tn})`;for(let e of t.bundleBlobs){if(!e||typeof e!="object"||Array.isArray(e))return"bundleBlobs entries must be objects";if(typeof e.integrity!="string"||e.integrity.length===0)return"bundleBlobs.integrity must be a non-empty string";if(e.integrity.length>we)return`bundleBlobs.integrity exceeds per-entry length cap (${we})`;if(typeof e.name!="string"||e.name.length===0)return"bundleBlobs.name must be a non-empty string";if(e.name.length>en)return`bundleBlobs.name exceeds per-entry length cap (${en})`;if(e.name.includes("\0"))return"bundleBlobs.name cannot contain NUL";if(typeof e.data!="string")return"bundleBlobs.data must be a base64 string";if(e.data.length>Ar)return`bundleBlobs.data exceeds per-blob size cap (${nn} bytes raw)`}}return null}async function Je(t,e){if(be(t)){if(typeof e!="string"||!e)throw new TypeError("parseWorkspaceBundleBytes: password required for encrypted bundle");let i=await Yt(t,e);try{return _e(await Xe(i))}catch(r){throw new Error("wrong password or corrupt bundle",{cause:r})}}let n;try{n=await Xe(t)}catch(i){throw new Error(`gzip decompression failed: ${i.message}`,{cause:i})}return _e(n)}function _e(t){let e;try{e=JSON.parse(t)}catch(r){throw new Error(`payload is not JSON: ${r.message}`,{cause:r})}let n=Sr(e);if(n===null)return e;let i=n.includes("exceeds cap");throw new Error(i?n:`not a deepview workspace export: ${n}`)}var kr=/^\d+$/u;function Ir(t){for(let e=0;e<t.length;e++){let n=t.codePointAt(e);if(n<32||n===127)return!0}return!1}var Ye=512;function Cr(t){return typeof t=="string"&&t.length>0&&t.length<=Ye&&!Ir(t)}function Q(t){return Cr(t)&&!kr.test(t)}var ys=Object.freeze({manage:"/manage","manage-bundles":"/manage/bundle","manage-scans":"/manage/scans","manage-reports":"/manage/report","manage-repos":"/manage/repositories","admin-users":"/manage/users","manage-teams":"/manage/team","manage-import":"/manage/import","manage-links":"/manage/links","manage-history":"/manage/history"});function Tr(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let{id:e}=t;return typeof e=="string"&&e.length>0?e:null}function rn(t){let e;try{e=JSON.parse(t)}catch{return null}if(!Array.isArray(e)||e.length===0)return null;let n=[],i=0;for(let r of e){if(!Array.isArray(r))return null;let o=new Set;for(let s of r){let a=Tr(s);if(a===null)return null;Q(a)?o.add(a):i++}o.size>1&&n.push([...o])}return{groups:n,skipped:i}}var Rr=/^( *)(```|~~~)/u,z=/^( *)(?:[-*+]|\d{1,9}[.)]) +(?=\S)/u;function M(t){let e=[],n=-1,i="",r=0,o=0,s=0;for(let a of t.split(`
6
+ `)){let c=s;s+=a.length+1;let l=Rr.exec(a);if(n!==-1){l&&l[2]===i&&l[1].length<=r+3&&(e.push([n,c+a.length]),n=-1);continue}if(l&&l[1].length<=o+3){n=c,i=l[2],r=l[1].length;continue}if(!a.trim())continue;let d=z.exec(a),u=/^ */u.exec(a)[0].length;d&&d[1].length<=o+3?o=d[0].length:u<o&&(o=0)}return n!==-1&&e.push([n,t.length]),e}function O(t,e){return t.some(([n,i])=>e>=n&&e<i)}function S(t){return String(t??"").replaceAll(/\r\n?/gu,`
7
+ `)}var ee=/^## +(.*)$/gmu,te=/^### +(.*)$/gmu,N=/^#### +(.*)$/gmu,Ze=/^(.+):(\d+(?:-\d+)?)$/u;function ve(t){return/^[0-9a-f]{7,64}$/iu.test(t)}function k(t,e){let n=M(t),i=[...t.matchAll(e)].filter(r=>!O(n,r.index));return i.map((r,o)=>({heading:r[1],body:t.slice(r.index+r[0].length+1,i[o+1]?.index)}))}function B(t,e){let n=M(t),i=[...t.matchAll(e)].find(r=>!O(n,r.index));return i?{head:t.slice(0,i.index),subs:k(t,e)}:{head:t,subs:[]}}function ne(t){let e=t.indexOf(`
8
+ `);return e===-1?{title:t.trim(),body:""}:{title:t.slice(0,e).trim(),body:t.slice(e+1)}}function Lr(t){let e=[];for(let n of t.split(`
9
+ `)){let i=n.trim();if(!i.startsWith("|")||/^[\s:|-]+$/u.test(i)&&i.includes("-"))continue;let r=i.replace(/^\|/u,"").replace(/\|$/u,"").split("|").map(o=>o.trim());e.push(r)}return e}function re(t){let e=Lr(t);if(e.length<2)return[];let n=e[0].map(r=>r.toLowerCase()),i=[];for(let r of e.slice(1)){if(r.length===n.length&&r.every((s,a)=>s.toLowerCase()===n[a]))continue;let o={};n.forEach((s,a)=>{s&&(o[s]=r[a]??"")}),i.push(o)}return i}function on(t){let e=Object.create(null),n=Object.create(null),i=[],r=null,o="",s=[],a="",c=(u,p,h)=>{!u||u in e||(e[u]=h.trim(),n[u]=p)},l=()=>{r&&c(r,o,s.join(`
10
10
  `)),r=null,o="",s=[]},d=u=>{(r?s:i).push(u)};for(let u of t.split(`
11
- `)){let p=/^ {0,3}(```|~~~)/u.exec(u),h=p!==null&&(!a||p[1]===a);if(h&&(a=a?"":p[1]),h||a){d(u);continue}if(!u.trim()){r?l():i.push(u);continue}let f=/^\s*(?:[-*] +)?\*\*([^:*]+):\*\*\s*(.*)$/u.exec(u);if(f){l();let g=f[1].trim(),b=f[2],_;for(;(_=/\s+[·•]\s+\*\*([^:*]+):\*\*\s*/u.exec(b))!==null;)c(g.toLowerCase(),g,b.slice(0,_.index)),g=_[1].trim(),b=b.slice(_.index+_[0].length);r=g.toLowerCase(),o=g,s=[b];continue}if(/^\s*(?:#{1,6} |\||[-=*_]{3,}\s*$)/u.test(u)){l();continue}d(u)}return l(),{fields:e,labels:n,prose:i.join(`
12
- `).trim()}}function we(t){let e=(t||"").trim(),n="",i=z(e);i&&(e=i.label.trim(),n=i.url.trim());let r="",o=/#L(\d+)/u.exec(n);o&&(r=o[1]);let c=[...e.matchAll(/`([^`]+)`/gu)].map(u=>u[1].trim()).find(u=>!u.includes("(")&&(u.includes("/")||/\.\w/u.test(u)))??(e.replaceAll("`","").trim().split(/[\s,]+/u).find(Boolean)||""),l=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(c);l&&(c=l[1],r||(r=l[2]));let d=We.exec(c);return d?(r||(r=d[2]),{file:d[1],line:r,locationLink:n}):{file:c,line:r||"?",locationLink:n}}function Ke(t){return t.replaceAll("**","")}function z(t){let e=String(t??""),n=Er(e,Ar(e)),i=Sr(e),r=e.indexOf("]");for(let o=e.indexOf("[");o!==-1;o=e.indexOf("[",o+1)){for(;r!==-1&&r<=o;)r=e.indexOf("]",r+1);for(let s of[r,n.get(o)??-1]){if(s===-1||s===o+1||e[s+1]!=="(")continue;let a=kr(e,s+1,i);if(a!==null)return{label:e.slice(o+1,s),url:a,index:o}}}return null}function Er(t,e){let n=new Map,i=[];for(let r=0;r<t.length;r++){let o=t[r];Jt(t,r)?r++:o==="`"?r=e.get(r)??r:o==="["?i.push(r):o==="]"&&i.length>0&&n.set(i.pop(),r)}return n}function Ar(t){let e=[];for(let r=t.indexOf("`");r!==-1;r=t.indexOf("`",r)){let o=1;for(;t[r+o]==="`";)o++;e.push([r,o]),r+=o}let n=new Map,i=new Map;for(let r=e.length-1;r>=0;r--){let[o,s]=e[r],a=i.get(s);a!==void 0&&n.set(o,a+s-1),i.set(s,o)}return n}function Sr(t){let e=t.length,n=new Int32Array(e+1).fill(-1),i=new Int32Array(e+1).fill(-1),r=new Int32Array(e+1).fill(-1),o=new Int32Array(e+1).fill(-1);for(let c=e-1;c>=0;c--)n[c]=t[c]===")"?c:n[c+1],i[c]=/\s/u.test(t[c])?c:i[c+1],r[c]=t[c]===">"?c:r[c+1],o[c]=t[c]===`
13
- `?c:o[c+1];let s=new Map,a=[];for(let c=0;c<e;c++){let l=t[c];Jt(t,c)?c++:i[c]===c?a.length=0:l==="("?a.push(c):l===")"&&a.length>0&&s.set(a.pop(),c)}return{balanced:s,nextClose:n,nextSpace:i,nextAngle:r,nextLine:o}}function kr(t,e,n){let i=Ir(t,e,n);if(i)return i;let r=n.balanced.get(e);if(r!==void 0)return r>e+1?t.slice(e+1,r):null;let o=n.nextClose[e+1],s=n.nextSpace[e+1];return o===-1||o===e+1||s!==-1&&s<o?null:t.slice(e+1,o)}function Ir(t,e,n){if(t[e+1]!=="<")return"";let i=n.nextAngle[e+2],r=n.nextLine[e+2];return i===-1||r!==-1&&r<i||t[i+1]!==")"?"":t.slice(e+2,i)}var Cr=/\\([!-/:-@[-`{-~])/gu,Rr=/[!-/:-@[-`{-~]/u;function Jt(t,e){return t[e]==="\\"&&Rr.test(t[e+1]??"")}function Yt(t){return typeof t=="string"?t.replace(Cr,"$1"):t}function Zt(t){let e=/^\[(.+)\]$/u.exec(t.trim());return e?e[1].trim():t.trim()}function B(t){let e=(t||"").trim();return/^[-–—]+$/u.test(e)?"":e}var Tr=/^## ([A-Z][A-Z_]*)\s*\(\d+\)\s*\n/mu;function Lr(t){switch(t.toUpperCase()){case"CRITICAL":return"critical";case"HIGH":return"high";case"MEDIUM":return"medium";case"LOW":return"low";case"HIGH_BUG":return"high_bug";case"BUG":return"bug";case"INFO":case"INFORMATIONAL":return"informational";default:return"medium"}}var en=t=>String(t??"").toLowerCase().replaceAll(/[^a-z]+/gu,""),Qt=new Map([["high",8],["medium",6],["low",4]]);function Mr(t){if(t!==void 0)return Qt.get(en(t))??Qt.get("medium")}var Or=new Map([["confirmed","confirmed"],["falsepositive","refuted"],["uncertain","unknown"]]);function tn(t){let n=E(t).trim().split(Tr);if(n.length===1)return null;let i=[];for(let r=1;r<n.length;r+=2){let o=Lr(n[r]);for(let s of n[r+1].split(/^### /mu).slice(1)){let a=Nr(s,o);a&&i.push(a)}}return i.length===0?null:{type:"security",source:"deepsec",findings:i}}function Nr(t,e){let{title:n,body:i}=te(t);if(!n)return null;let r=i.replace(/\n---\s*$/u,"").trim(),o={};for(let b of r.matchAll(/^- \*\*([^:*]+):\*\*\s*(.+)$/gmu))o[b[1].trim().toLowerCase()]=b[2].trim();let s=/^\*\*Recommendation:\*\*\s*/mu.exec(r),a=r,c="";s&&(a=r.slice(0,s.index),c=r.slice(s.index+s[0].length).trim());let l=a.split(`
14
- `).filter(b=>!/^\s*- \*\*/u.test(b)).join(`
11
+ `)){let p=/^ {0,3}(```|~~~)/u.exec(u),h=p!==null&&(!a||p[1]===a);if(h&&(a=a?"":p[1]),h||a){d(u);continue}if(!u.trim()){r?l():i.push(u);continue}let f=/^\s*(?:[-*] +)?\*\*([^:*]+):\*\*\s*(.*)$/u.exec(u);if(f){l();let g=f[1].trim(),y=f[2],x;for(;(x=/\s+[·•]\s+\*\*([^:*]+):\*\*\s*/u.exec(y))!==null;)c(g.toLowerCase(),g,y.slice(0,x.index)),g=x[1].trim(),y=y.slice(x.index+x[0].length);r=g.toLowerCase(),o=g,s=[y];continue}if(/^\s*(?:#{1,6} |\||[-=*_]{3,}\s*$)/u.test(u)){l();continue}d(u)}return l(),{fields:e,labels:n,prose:i.join(`
12
+ `).trim()}}function xe(t){let e=(t||"").trim(),n="",i=j(e);i&&(e=i.label.trim(),n=i.url.trim());let r="",o=/#L(\d+)/u.exec(n);o&&(r=o[1]);let c=[...e.matchAll(/`([^`]+)`/gu)].map(u=>u[1].trim()).find(u=>!u.includes("(")&&(u.includes("/")||/\.\w/u.test(u)))??(e.replaceAll("`","").trim().split(/[\s,]+/u).find(Boolean)||""),l=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(c);l&&(c=l[1],r||(r=l[2]));let d=Ze.exec(c);return d?(r||(r=d[2]),{file:d[1],line:r,locationLink:n}):{file:c,line:r||"?",locationLink:n}}function Qe(t){return t.replaceAll("**","")}function j(t){let e=String(t??""),n=Mr(e,Or(e)),i=Nr(e),r=e.indexOf("]");for(let o=e.indexOf("[");o!==-1;o=e.indexOf("[",o+1)){for(;r!==-1&&r<=o;)r=e.indexOf("]",r+1);for(let s of[r,n.get(o)??-1]){if(s===-1||s===o+1||e[s+1]!=="(")continue;let a=Br(e,s+1,i);if(a!==null)return{label:e.slice(o+1,s),url:a,index:o}}}return null}function Mr(t,e){let n=new Map,i=[];for(let r=0;r<t.length;r++){let o=t[r];sn(t,r)?r++:o==="`"?r=e.get(r)??r:o==="["?i.push(r):o==="]"&&i.length>0&&n.set(i.pop(),r)}return n}function Or(t){let e=[];for(let r=t.indexOf("`");r!==-1;r=t.indexOf("`",r)){let o=1;for(;t[r+o]==="`";)o++;e.push([r,o]),r+=o}let n=new Map,i=new Map;for(let r=e.length-1;r>=0;r--){let[o,s]=e[r],a=i.get(s);a!==void 0&&n.set(o,a+s-1),i.set(s,o)}return n}function Nr(t){let e=t.length,n=new Int32Array(e+1).fill(-1),i=new Int32Array(e+1).fill(-1),r=new Int32Array(e+1).fill(-1),o=new Int32Array(e+1).fill(-1);for(let c=e-1;c>=0;c--)n[c]=t[c]===")"?c:n[c+1],i[c]=/\s/u.test(t[c])?c:i[c+1],r[c]=t[c]===">"?c:r[c+1],o[c]=t[c]===`
13
+ `?c:o[c+1];let s=new Map,a=[];for(let c=0;c<e;c++){let l=t[c];sn(t,c)?c++:i[c]===c?a.length=0:l==="("?a.push(c):l===")"&&a.length>0&&s.set(a.pop(),c)}return{balanced:s,nextClose:n,nextSpace:i,nextAngle:r,nextLine:o}}function Br(t,e,n){let i=Ur(t,e,n);if(i)return i;let r=n.balanced.get(e);if(r!==void 0)return r>e+1?t.slice(e+1,r):null;let o=n.nextClose[e+1],s=n.nextSpace[e+1];return o===-1||o===e+1||s!==-1&&s<o?null:t.slice(e+1,o)}function Ur(t,e,n){if(t[e+1]!=="<")return"";let i=n.nextAngle[e+2],r=n.nextLine[e+2];return i===-1||r!==-1&&r<i||t[i+1]!==")"?"":t.slice(e+2,i)}var Dr=/\\([!-/:-@[-`{-~])/gu,Fr=/[!-/:-@[-`{-~]/u;function sn(t,e){return t[e]==="\\"&&Fr.test(t[e+1]??"")}function an(t){return typeof t=="string"?t.replace(Dr,"$1"):t}function cn(t){let e=/^\[(.+)\]$/u.exec(t.trim());return e?e[1].trim():t.trim()}function U(t){let e=(t||"").trim();return/^[-–—]+$/u.test(e)?"":e}var Hr=new TextEncoder;function ln(t){if(typeof t!="string")throw new TypeError(`encodeUtf8 expects a string, got ${typeof t}`);if(!t.isWellFormed())throw new TypeError("encodeUtf8: input contains lone surrogates");return Hr.encode(t)}function Pr(t){return Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}async function zr(t){let e=ln(JSON.stringify(t)),n=await crypto.subtle.digest("SHA-256",e),i=new Uint8Array(n,0,16);i[6]=i[6]&15|64,i[8]=i[8]&63|128;let r=Pr(i);return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20,32)}`}async function un(t){if(typeof crypto?.subtle?.digest!="function")return null;let e=et(t);try{return await zr(e)}catch{return null}}function et(t){if(t._idBasis)return t._idBasis;let{severity:e,description:n}=t;return t.fileHash?{severity:e,description:n,fileHash:t.fileHash}:t.location?{severity:e,description:n,location:t.location}:{severity:e,description:n,file:t.file,line:t.line}}function dn(t){return typeof t=="string"&&t.trim().toLowerCase()==="informative"?"informational":t}function _(t,e=t.severity){let n=dn(t.severity);return n!==t.severity&&(!t.id&&!t._idBasis&&(t._idBasis=et({...t,severity:e})),t.severity=n),t.correctedSeverity!==void 0&&(t.correctedSeverity=dn(t.correctedSeverity)),t}var jr=/^## ([A-Z][A-Z_]*)\s*\(\d+\)\s*\n/mu;function Vr(t){switch(t.toUpperCase()){case"CRITICAL":return"critical";case"HIGH":return"high";case"MEDIUM":return"medium";case"LOW":return"low";case"HIGH_BUG":return"high_bug";case"BUG":return"bug";case"INFO":case"INFORMATIONAL":return"informational";case"INFORMATIVE":return"informative";default:return"medium"}}var fn=t=>String(t??"").toLowerCase().replaceAll(/[^a-z]+/gu,""),pn=new Map([["high",8],["medium",6],["low",4]]);function Gr(t){if(t!==void 0)return pn.get(fn(t))??pn.get("medium")}var Wr=new Map([["confirmed","confirmed"],["falsepositive","refuted"],["uncertain","unknown"]]);function hn(t){let n=S(t).trim().split(jr);if(n.length===1)return null;let i=[];for(let r=1;r<n.length;r+=2){let o=Vr(n[r]);for(let s of n[r+1].split(/^### /mu).slice(1)){let a=Kr(s,o);a&&i.push(a)}}return i.length===0?null:{type:"security",source:"deepsec",findings:i}}function Kr(t,e){let{title:n,body:i}=ne(t);if(!n)return null;let r=i.replace(/\n---\s*$/u,"").trim(),o={};for(let y of r.matchAll(/^- \*\*([^:*]+):\*\*\s*(.+)$/gmu))o[y[1].trim().toLowerCase()]=y[2].trim();let s=/^\*\*Recommendation:\*\*\s*/mu.exec(r),a=r,c="";s&&(a=r.slice(0,s.index),c=r.slice(s.index+s[0].length).trim());let l=a.split(`
14
+ `).filter(y=>!/^\s*- \*\*/u.test(y)).join(`
15
15
  `).replaceAll("**","").trim(),d=[n,l].filter(Boolean).join(`
16
16
 
17
- `),u=(o.file||"unknown").replace(/^`(.*)`$/u,"$1"),p=(o.lines||"").split(",").map(b=>b.trim()).find(Boolean)||"?",h={file:u,line:p,severity:e,description:d};c&&(h.recommendation=c.replaceAll("**",""));let f=Mr(o.confidence);f!==void 0&&(h.confidence=f);let g=Or.get(en(o.revalidation));return g&&(h.revalidate=g,h.revalidateSource="deepsec",o.reasoning&&(h.revalidateVerdict=o.reasoning.replaceAll("**",""))),o.slug&&(h.slug=o.slug),h}var nn={critical:"Critical",high:"High",medium:"Medium",low:"Low",high_bug:"High bug",bug:"Bug",informational:"Informational"};var rn={"claude-security":"Claude Security","codex-security":"Codex Security",deepsec:"DeepSec",piolium:"Piolium"};var Xe=["revalidation","refuted","unreachable","confirmed","partial","unknown"],Ss=new Set(Xe);function on(t){if(!t)return"";for(let e of t.split(`
18
- `))if(e.trim())return e.trim();return""}function sn(t){return Number.isFinite(parseInt(t?.line,10))?`${t.file}:${t.line}`:t?.file??""}function qe(t){if(typeof t!="string"||t.length===0)return!1;try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function Br(t,e){let n=L(t),i=0;return t.split(`
19
- `).map(r=>{let o=i;return i+=r.length+1,M(n,o)?r:e(r)}).join(`
20
- `)}function an(t){return Br(String(t??""),e=>e.replace(/^( {0,3})\\(\\*#)/u,"$1$2"))}var Ur=new Map(Object.entries(nn).map(([t,e])=>[e.toLowerCase(),t])),ln=new Map(Object.entries(rn).map(([t,e])=>[e.toLowerCase(),t])),Dr=new Set(Xe);function x(t){let e=/(`+)(.+?)\1(?!`)/u.exec(String(t??""));if(!e)return null;let n=e[2];if(n.length>2&&n.startsWith(" ")&&n.endsWith(" ")){let i=n.slice(1,-1);if(i.startsWith("`")||i.endsWith("`"))return i}return n}function _e(t){let e=z(String(t??""));return e?.index===0?{label:e.label,url:e.url}:null}function un(t){let e=/^<(https?:[^>\s]*)>$/u.exec(t.trim());return e?e[1]:null}function dn(t){let e=We.exec(t);return e?{file:e[1],line:e[2]}:{file:t,line:"?"}}function Hr(t){let e=t.indexOf(".");return e>0?{exportName:t.slice(0,e),methodName:t.slice(e+1)}:{exportName:t}}function U(t){let e=String(t??"").trim();return Ur.get(e.toLowerCase())??e}function Pr(t){let e={},n=t.trim(),i=/ · (`+)(.+?)\1$/u.exec(n);i&&(Object.assign(e,Hr(x(i[0]))),n=n.slice(0,i.index));let r=_e(n),o=x(r?r.label:n);return o!==null&&Object.assign(e,dn(o)),r&&qe(r.url)&&(e.location=r.url),e}var cn=" \xB7 flagged critical by the analyzer",Fr=" (varies across reports \u2014 ";function zr(t){let e={},n=t.trim();n.endsWith(cn)&&(e.critical=!0,n=n.slice(0,-cn.length));let i=n.indexOf(Fr);i!==-1&&(n=n.slice(0,i));let r=/^(.*?) — corrected (from|to) (.*)$/u.exec(n);return r?r[2]==="from"?(e.severity=U(r[3]),e.correctedSeverity=U(r[1])):(e.severity=U(r[1]),e.correctedSeverity=U(r[3])):e.severity=U(n),e}var jr=new Set(["max","xhigh","high","medium","low","minimal"]),Vr=new Set(["list","isolate"]);function Gr(t){return/\d/u.test(t)||/^(?:opus|sonnet|haiku|gpt|gemini|fable|mythos|llama|mistral)\b/iu.test(t)}function xe(t){let e=t.trim(),n=ln.get(e.toLowerCase());if(n)return{source:n};let i={},r=[];for(let o of e.split(" \xB7 ").map(s=>s.trim()).filter(Boolean))o==="revalidate"&&!i.revalidate?i.revalidate="revalidation":Vr.has(o)&&!i.exportsMode?i.exportsMode=o:jr.has(o)&&!i.effort?i.effort=o:r.push(o);return r.length>1?[i.type,i.model]=r:r.length===1&&(i[Gr(r[0])?"model":"type"]=r[0]),{run:i}}function Je(t){let e=t.trim(),n=_e(e);return n?n.label.trim():un(e)??e}function Wr(t){let e=_e(t.trim());if(e){let n=e.url.split("/").at(-1)??"";return be(n)?n:x(e.label)??n}return x(t)??t.trim()}function Kr(t){let e=x(t)??t.trim(),n=e.lastIndexOf("@");return{npm:n>0?{name:e.slice(0,n),version:e.slice(n+1)}:{name:e}}}function Xr(t){let e=t.trim().toLowerCase();return e==="the revalidation pass itself"?"revalidation":Dr.has(e)?e:void 0}var qr=new Map([["location",(t,e)=>Object.assign(t,Pr(e))],["severity",(t,e)=>Object.assign(t,zr(e))],["confidence",(t,e)=>{let n=/^(\d+(?:\.\d+)?)\/10$/u.exec(e);n&&(t.confidence=Number(n[1]))}],["revalidation",(t,e)=>{let n=Xr(e);n&&(t.revalidate=n)}],["revalidated by",(t,e)=>{let n=e.trim();n&&(t.revalidateSource=ln.get(n.toLowerCase())??n)}],["repository",(t,e)=>{t.repo={github:Je(e)}}],["introduced in",(t,e)=>{t.commitHash=Wr(e)}],["package",(t,e)=>{t.package=Kr(e)}],["priority",(t,e)=>{t.priority=/^-?\d+(?:\.\d+)?$/u.test(e)?Number(e):e}],["found while analyzing",(t,e)=>{t.discoveredIn=x(e)??e}],["detailed report",(t,e)=>{t.reportPath=x(e)??e}],["commit audited",(t,e)=>{t.auditedCommit=x(e)??e}],["id",(t,e)=>{t.id=x(e)??e}],...[["category","category"],["status","status"],["branch","branch"],["date created","dateCreated"],["detected at","detectedAt"],["committed at","committedAt"],["poc status","pocStatus"],["variant of","parent"],["slug","slug"]].map(([t,e])=>[t,(n,i)=>{n[e]=i}])]);function pn(t,e,n){let i=qr.get(e.trim().toLowerCase());i&&i(t,n.trim())}var Jr=/^- \*\*([^*\n]+?):\*\* ?(.*)$/u;function fn(t){let e=t.split(`
21
- `),n=0,i=()=>{for(;n<e.length&&!e[n].trim();)n++},r=()=>{let a=[];for(;n<e.length;){let c=Jr.exec(e[n]);if(!c)break;a.push([c[1].trim(),c[2].trim()]),n++}return a};i();let o=r();if(o.length>0)return{title:"",facts:o,rest:e.slice(n).join(`
22
- `)};let s=[];for(;n<e.length&&e[n].trim();)s.push(e[n++]);return i(),o=r(),o.length===0?{title:"",facts:o,rest:t}:{title:j(s.join(`
17
+ `),u=(o.file||"unknown").replace(/^`(.*)`$/u,"$1"),p=(o.lines||"").split(",").map(y=>y.trim()).find(Boolean)||"?",h={file:u,line:p,severity:e,description:d};c&&(h.recommendation=c.replaceAll("**",""));let f=Gr(o.confidence);f!==void 0&&(h.confidence=f);let g=Wr.get(fn(o.revalidation));return g&&(h.revalidate=g,h.revalidateSource="deepsec",o.reasoning&&(h.revalidateVerdict=o.reasoning.replaceAll("**",""))),o.slug&&(h.slug=o.slug),_(h,e==="informative"?"medium":e)}var mn={critical:"Critical",high:"High",medium:"Medium",low:"Low",high_bug:"High bug",bug:"Bug",informational:"Informational"};var gn={"claude-security":"Claude Security","codex-security":"Codex Security",deepsec:"DeepSec",piolium:"Piolium"};var tt=["revalidation","refuted","unreachable","confirmed","partial","unknown"],Ds=new Set(tt);function yn(t){if(!t)return"";for(let e of t.split(`
18
+ `))if(e.trim())return e.trim();return""}function bn(t){return Number.isFinite(parseInt(t?.line,10))?`${t.file}:${t.line}`:t?.file??""}function nt(t){if(typeof t!="string"||t.length===0)return!1;try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function Xr(t,e){let n=M(t),i=0;return t.split(`
19
+ `).map(r=>{let o=i;return i+=r.length+1,O(n,o)?r:e(r)}).join(`
20
+ `)}function wn(t){return Xr(String(t??""),e=>e.replace(/^( {0,3})\\(\\*#)/u,"$1$2"))}var qr=new Map(Object.entries(mn).map(([t,e])=>[e.toLowerCase(),t])),vn=new Map(Object.entries(gn).map(([t,e])=>[e.toLowerCase(),t])),Jr=new Set(tt);function $(t){let e=/(`+)(.+?)\1(?!`)/u.exec(String(t??""));if(!e)return null;let n=e[2];if(n.length>2&&n.startsWith(" ")&&n.endsWith(" ")){let i=n.slice(1,-1);if(i.startsWith("`")||i.endsWith("`"))return i}return n}function $e(t){let e=j(String(t??""));return e?.index===0?{label:e.label,url:e.url}:null}function xn(t){let e=/^<(https?:[^>\s]*)>$/u.exec(t.trim());return e?e[1]:null}function $n(t){let e=Ze.exec(t);return e?{file:e[1],line:e[2]}:{file:t,line:"?"}}function Yr(t){let e=t.indexOf(".");return e>0?{exportName:t.slice(0,e),methodName:t.slice(e+1)}:{exportName:t}}function D(t){let e=String(t??"").trim();return qr.get(e.toLowerCase())??e}function Zr(t){let e={},n=t.trim(),i=/ · (`+)(.+?)\1$/u.exec(n);i&&(Object.assign(e,Yr($(i[0]))),n=n.slice(0,i.index));let r=$e(n),o=$(r?r.label:n);return o!==null&&Object.assign(e,$n(o)),r&&nt(r.url)&&(e.location=r.url),e}var _n=" \xB7 flagged critical by the analyzer",Qr=" (varies across reports \u2014 ";function ei(t){let e={},n=t.trim();n.endsWith(_n)&&(e.critical=!0,n=n.slice(0,-_n.length));let i=n.indexOf(Qr);i!==-1&&(n=n.slice(0,i));let r=/^(.*?) — corrected (from|to) (.*)$/u.exec(n);return r?r[2]==="from"?(e.severity=D(r[3]),e.correctedSeverity=D(r[1])):(e.severity=D(r[1]),e.correctedSeverity=D(r[3])):e.severity=D(n),e}var ti=new Set(["max","xhigh","high","medium","low","minimal"]),ni=new Set(["list","isolate"]);function ri(t){return/\d/u.test(t)||/^(?:opus|sonnet|haiku|gpt|gemini|fable|mythos|llama|mistral)\b/iu.test(t)}function Ee(t){let e=t.trim(),n=vn.get(e.toLowerCase());if(n)return{source:n};let i={},r=[];for(let o of e.split(" \xB7 ").map(s=>s.trim()).filter(Boolean))o==="revalidate"&&!i.revalidate?i.revalidate="revalidation":ni.has(o)&&!i.exportsMode?i.exportsMode=o:ti.has(o)&&!i.effort?i.effort=o:r.push(o);return r.length>1?[i.type,i.model]=r:r.length===1&&(i[ri(r[0])?"model":"type"]=r[0]),{run:i}}function rt(t){let e=t.trim(),n=$e(e);return n?n.label.trim():xn(e)??e}function ii(t){let e=$e(t.trim());if(e){let n=e.url.split("/").at(-1)??"";return ve(n)?n:$(e.label)??n}return $(t)??t.trim()}function oi(t){let e=$(t)??t.trim(),n=e.lastIndexOf("@");return{npm:n>0?{name:e.slice(0,n),version:e.slice(n+1)}:{name:e}}}function si(t){let e=t.trim().toLowerCase();return e==="the revalidation pass itself"?"revalidation":Jr.has(e)?e:void 0}var ai=new Map([["location",(t,e)=>Object.assign(t,Zr(e))],["severity",(t,e)=>Object.assign(t,ei(e))],["confidence",(t,e)=>{let n=/^(\d+(?:\.\d+)?)\/10$/u.exec(e);n&&(t.confidence=Number(n[1]))}],["revalidation",(t,e)=>{let n=si(e);n&&(t.revalidate=n)}],["revalidated by",(t,e)=>{let n=e.trim();n&&(t.revalidateSource=vn.get(n.toLowerCase())??n)}],["repository",(t,e)=>{t.repo={github:rt(e)}}],["introduced in",(t,e)=>{t.commitHash=ii(e)}],["package",(t,e)=>{t.package=oi(e)}],["priority",(t,e)=>{t.priority=/^-?\d+(?:\.\d+)?$/u.test(e)?Number(e):e}],["found while analyzing",(t,e)=>{t.discoveredIn=$(e)??e}],["detailed report",(t,e)=>{t.reportPath=$(e)??e}],["commit audited",(t,e)=>{t.auditedCommit=$(e)??e}],["id",(t,e)=>{t.id=$(e)??e}],...[["category","category"],["status","status"],["branch","branch"],["date created","dateCreated"],["detected at","detectedAt"],["committed at","committedAt"],["poc status","pocStatus"],["variant of","parent"],["slug","slug"]].map(([t,e])=>[t,(n,i)=>{n[e]=i}])]);function En(t,e,n){let i=ai.get(e.trim().toLowerCase());i&&i(t,n.trim())}var ci=/^- \*\*([^*\n]+?):\*\* ?(.*)$/u;function An(t){let e=t.split(`
21
+ `),n=0,i=()=>{for(;n<e.length&&!e[n].trim();)n++},r=()=>{let a=[];for(;n<e.length;){let c=ci.exec(e[n]);if(!c)break;a.push([c[1].trim(),c[2].trim()]),n++}return a};i();let o=r();if(o.length>0)return{title:"",facts:o,rest:e.slice(n).join(`
22
+ `)};let s=[];for(;n<e.length&&e[n].trim();)s.push(e[n++]);return i(),o=r(),o.length===0?{title:"",facts:o,rest:t}:{title:V(s.join(`
23
23
  `).trim()),facts:o,rest:e.slice(n).join(`
24
- `)}}function j(t){return an(t)}function hn(t,e){let n=new RegExp(`^#{${e}} +(.*)$`,"gmu"),i=L(t),r=[...t.matchAll(n)].filter(a=>!M(i,a.index)),o=t.slice(0,r[0]?.index??t.length).trim(),s=r.map((a,c)=>({label:a[1].trim(),body:t.slice(a.index+a[0].length,r[c+1]?.index).trim()}));return{lead:o,sections:s}}var Yr=/^(\d+)\. (.*)$/u;function mn(t){let e=[],n=L(t),i=0;for(let r of t.split(`
25
- `)){let o=M(n,i)?null:Yr.exec(r);i+=r.length+1,o?e.push({ref:o[2].trim(),indent:o[1].length+2,note:[]}):e.length>0&&e.at(-1).note.push(r)}return e.map(r=>Zr(r))}function Zr({ref:t,indent:e,note:n}){let i={},r=_e(t),o=un(t),s=o===null?x(r?r.label:t):null;s!==null&&Object.assign(i,dn(s));let a=r?r.url:o;qe(a)&&(i.url=a);let c=j(n.map(l=>l.slice(Math.min(e,/^ */u.exec(l)[0].length))).join(`
26
- `).trim());return c&&(i.text=c),i}var gn=new Map([["impact","impact"],["reproduction","reproduction"],["recommendation","recommendation"],["confidence reasoning","confidenceReason"],["revalidation verdict","revalidateVerdict"],["revalidation recommendation","revalidateRecommendation"]]),Qr=[...gn.keys()];function yn(t){let e=t.length,n=1/0;for(let i=t.length-1;i>=0;i--){let r=Qr.indexOf(t[i].label.toLowerCase());if(r===-1||r>=n)break;n=r,e=i}return{paragraphs:t.slice(0,e),fields:t.slice(e).map(i=>[gn.get(i.label.toLowerCase()),i.body])}}function bn(t,e,n){let i=[],r=on(e),o=t.endsWith("\u2026")?t.slice(0,-1).trimEnd():"";!t||r===t||o&&r.startsWith(o)?i.push(e):i.push(t,e);for(let{label:s,body:a}of n)i.push(a?`**${s}:** ${a}`:`**${s}:**`);return i.filter(Boolean).join(`
24
+ `)}}function V(t){return wn(t)}function Sn(t,e){let n=new RegExp(`^#{${e}} +(.*)$`,"gmu"),i=M(t),r=[...t.matchAll(n)].filter(a=>!O(i,a.index)),o=t.slice(0,r[0]?.index??t.length).trim(),s=r.map((a,c)=>({label:a[1].trim(),body:t.slice(a.index+a[0].length,r[c+1]?.index).trim()}));return{lead:o,sections:s}}var li=/^(\d+)\. (.*)$/u;function kn(t){let e=[],n=M(t),i=0;for(let r of t.split(`
25
+ `)){let o=O(n,i)?null:li.exec(r);i+=r.length+1,o?e.push({ref:o[2].trim(),indent:o[1].length+2,note:[]}):e.length>0&&e.at(-1).note.push(r)}return e.map(r=>ui(r))}function ui({ref:t,indent:e,note:n}){let i={},r=$e(t),o=xn(t),s=o===null?$(r?r.label:t):null;s!==null&&Object.assign(i,$n(s));let a=r?r.url:o;nt(a)&&(i.url=a);let c=V(n.map(l=>l.slice(Math.min(e,/^ */u.exec(l)[0].length))).join(`
26
+ `).trim());return c&&(i.text=c),i}var In=new Map([["impact","impact"],["reproduction","reproduction"],["recommendation","recommendation"],["confidence reasoning","confidenceReason"],["revalidation verdict","revalidateVerdict"],["revalidation recommendation","revalidateRecommendation"]]),di=[...In.keys()];function Cn(t){let e=t.length,n=1/0;for(let i=t.length-1;i>=0;i--){let r=di.indexOf(t[i].label.toLowerCase());if(r===-1||r>=n)break;n=r,e=i}return{paragraphs:t.slice(0,e),fields:t.slice(e).map(i=>[In.get(i.label.toLowerCase()),i.body])}}function Tn(t,e,n){let i=[],r=yn(e),o=t.endsWith("\u2026")?t.slice(0,-1).trimEnd():"";!t||r===t||o&&r.startsWith(o)?i.push(e):i.push(t,e);for(let{label:s,body:a}of n)i.push(a?`**${s}:** ${a}`:`**${s}:**`);return i.filter(Boolean).join(`
27
27
 
28
- `)}var ei=/^<!--\s*DeepView findings export\b[^>]*-->/u,ti=/^Case \d+ of \d+(?:\s|$)/u,ni=/^- \*\*([^*\n]+?):\*\* ?(.*)$/gmu,ri=new Set(["evidence","severity correction","comment"]);function _n(t){let e=E(t).trim();if(!ei.test(e))return null;let{head:n,subs:i}=N(e,Q),r=[];for(let{heading:o,body:s}of i){if(o.trim().toLowerCase()==="summary")continue;let a=ii(o);for(let c of A(s,ee))r.push(si(c,a))}return ci(oi(n),r)}function ii(t){let e=/^(.*?)\s*\(\d+\)\s*$/u.exec(t.trim());return U(e?e[1]:t)}function oi(t){let e=new Map;for(let n of t.matchAll(ni)){let i=n[1].trim().toLowerCase();e.has(i)||e.set(i,n[2].trim())}return{sources:(e.get("source")??"").split(",").map(n=>xe(n).source).filter(Boolean),analyzers:(e.get("analyzer")??e.get("analyzers")??"").split(";").map(n=>n.trim()).filter(Boolean),repo:e.has("repository")?Je(e.get("repository")):""}}function si({heading:t,body:e},n){let i=t.trim().replace(/^\d+\.\s+/u,""),r=N(e,O).subs.filter(o=>ti.test(o.heading.trim()));return r.length===0?[wn(e,4,i,n)]:r.map(o=>wn(o.body,5,i,n))}function wn(t,e,n,i){let{title:r,facts:o,rest:s}=fn(t),{lead:a,sections:c}=hn(s,e),l={file:"unknown",line:"?"},d=null;for(let[y,I]of o)y.trim().toLowerCase()==="analyzer"?d=xe(I):pn(l,y,I);l.severity||(l.severity=i||"medium");let u=r||n,p=u!=="Untitled finding"&&u!==sn(l),h=c.filter(y=>!ri.has(y.label.toLowerCase())).map(y=>({label:y.label,body:j(y.body)})),{paragraphs:f,fields:g}=yn(h);l.description=bn(p?u:"",j(a),f);let b=c.filter(y=>y.label.toLowerCase()==="evidence").flatMap(y=>mn(y.body));b.length>0&&(l.evidence=b);for(let[y,I]of g)l[y]=I;let _=c.find(y=>y.label.toLowerCase()==="severity correction");return _?.body&&(l.correctedSeverityReason=j(_.body)),{finding:l,analyzer:d}}function ai(t,e){let n={source:null,run:{}};if(e.some(r=>r.analyzer!==null)){let r=new Set(e.map(o=>o.analyzer?.source??null));r.size===1&&!r.has(null)&&([n.source]=r);for(let o of e)o.analyzer?.run?Object.assign(o.finding,o.analyzer.run):o.analyzer?.source&&!n.source&&(o.finding.source=o.analyzer.source);return n}let i=t.analyzers.length===1?xe(t.analyzers[0]):null;return i?.source?n.source=i.source:i?.run?n.run=i.run:t.analyzers.length===0&&t.sources.length===1&&([n.source]=t.sources),n}function ci(t,e){let n=e.flat(),{source:i,run:r}=ai(t,n),o={},s=new Set(n.map(l=>l.finding.type).filter(Boolean)),a=r.type??(s.size===1?[...s][0]:null)??(i?"security":null);a&&(o.type=a),i&&(o.source=i);for(let l of["model","effort","exportsMode"])r[l]&&(o[l]=r[l]);t.repo&&(o.repo={github:t.repo});let c=e.map(l=>l.map(d=>d.finding));return c.every(l=>l.length===1)?o.findings=c.flat():o.groups=c,o}var li=new Set(["critical","high","medium","low","high_bug","bug","informational"]);function xn(t){let e=ui(t);if(!e)return null;let{severity:n,description:i,location:r,file:o,line:s}=e;return r?{severity:n,description:i,location:r}:{severity:n,description:i,file:o,line:s}}function ui(t){let e=t.indexOf(`
29
- `),n=(e===-1?t:t.slice(0,e)).trim();if(!n)return null;let i=e===-1?"":t.slice(e+1),{sectionsText:r,metaText:o}=di(i),s=pi(r),a=fi(o),{file:c,line:l,locationLink:d}=hi(s.location||""),u=(a.severity||"").toLowerCase();return{severity:li.has(u)?u:"medium",description:mi(n,s),location:d,file:c||"unknown",line:l}}function di(t){let e=/^---\s*$/mu,n=e.exec(t);if(!n)return{sectionsText:t,metaText:""};let i=t.slice(0,n.index).trim(),r=t.slice(n.index+n[0].length).replace(/^\n/u,""),o=e.exec(r),s=o?r.slice(0,o.index):r;return{sectionsText:i,metaText:s}}function pi(t){let e={},n=t.split(/^## /mu);for(let i=1;i<n.length;i++){let r=n[i],o=r.indexOf(`
30
- `),s=(o===-1?r:r.slice(0,o)).trim().toLowerCase(),a=(o===-1?"":r.slice(o+1)).trim();s&&(e[s]=a)}return e}function fi(t){let e={};for(let n of t.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu))e[n[1].trim().toLowerCase()]=n[2].trim();return e}function hi(t){let e="",n="?",i="",r=t.match(/\[([^\]]+)\]\(([^)]+)\)/u);if(r){e=r[1].trim(),i=r[2];let s=r[2].match(/#L(\d+)/u);s&&(n=s[1])}else e=t.trim(),i=t.trim();let o=e.match(/^(.+):(\d+)$/u);return o&&(e=o[1],n==="?"&&(n=o[2])),{file:e,line:n,locationLink:i}}function mi(t,e){let n=[t];return e.details&&n.push(e.details),e.impact&&n.push(`Impact: ${e.impact}`),e["reproduction steps"]&&n.push(`Reproduction: ${e["reproduction steps"]}`),gi(n.join(`
28
+ `)}var pi=/^<!--\s*DeepView findings export\b[^>]*-->/u,fi=/^Case \d+ of \d+(?:\s|$)/u,hi=/^- \*\*([^*\n]+?):\*\* ?(.*)$/gmu,mi=new Set(["evidence","severity correction","comment"]);function Ln(t){let e=S(t).trim();if(!pi.test(e))return null;let{head:n,subs:i}=B(e,ee),r=[];for(let{heading:o,body:s}of i){if(o.trim().toLowerCase()==="summary")continue;let a=gi(o);for(let c of k(s,te))r.push(bi(c,a))}return _i(yi(n),r)}function gi(t){let e=/^(.*?)\s*\(\d+\)\s*$/u.exec(t.trim());return D(e?e[1]:t)}function yi(t){let e=new Map;for(let n of t.matchAll(hi)){let i=n[1].trim().toLowerCase();e.has(i)||e.set(i,n[2].trim())}return{sources:(e.get("source")??"").split(",").map(n=>Ee(n).source).filter(Boolean),analyzers:(e.get("analyzer")??e.get("analyzers")??"").split(";").map(n=>n.trim()).filter(Boolean),repo:e.has("repository")?rt(e.get("repository")):""}}function bi({heading:t,body:e},n){let i=t.trim().replace(/^\d+\.\s+/u,""),r=B(e,N).subs.filter(o=>fi.test(o.heading.trim()));return r.length===0?[Rn(e,4,i,n)]:r.map(o=>Rn(o.body,5,i,n))}function Rn(t,e,n,i){let{title:r,facts:o,rest:s}=An(t),{lead:a,sections:c}=Sn(s,e),l={file:"unknown",line:"?"},d=null;for(let[w,v]of o)w.trim().toLowerCase()==="analyzer"?d=Ee(v):En(l,w,v);l.severity||(l.severity=i||"medium");let u=r||n,p=u!=="Untitled finding"&&u!==bn(l),h=c.filter(w=>!mi.has(w.label.toLowerCase())).map(w=>({label:w.label,body:V(w.body)})),{paragraphs:f,fields:g}=Cn(h);l.description=Tn(p?u:"",V(a),f);let y=c.filter(w=>w.label.toLowerCase()==="evidence").flatMap(w=>kn(w.body));y.length>0&&(l.evidence=y);for(let[w,v]of g)l[w]=v;let x=c.find(w=>w.label.toLowerCase()==="severity correction");return x?.body&&(l.correctedSeverityReason=V(x.body)),{finding:_(l),analyzer:d}}function wi(t,e){let n={source:null,run:{}};if(e.some(r=>r.analyzer!==null)){let r=new Set(e.map(o=>o.analyzer?.source??null));r.size===1&&!r.has(null)&&([n.source]=r);for(let o of e)o.analyzer?.run?Object.assign(o.finding,o.analyzer.run):o.analyzer?.source&&!n.source&&(o.finding.source=o.analyzer.source);return n}let i=t.analyzers.length===1?Ee(t.analyzers[0]):null;return i?.source?n.source=i.source:i?.run?n.run=i.run:t.analyzers.length===0&&t.sources.length===1&&([n.source]=t.sources),n}function _i(t,e){let n=e.flat(),{source:i,run:r}=wi(t,n),o={},s=new Set(n.map(l=>l.finding.type).filter(Boolean)),a=r.type??(s.size===1?[...s][0]:null)??(i?"security":null);a&&(o.type=a),i&&(o.source=i);for(let l of["model","effort","exportsMode"])r[l]&&(o[l]=r[l]);t.repo&&(o.repo={github:t.repo});let c=e.map(l=>l.map(d=>d.finding));return c.every(l=>l.length===1)?o.findings=c.flat():o.groups=c,o}var vi=new Set(["critical","high","medium","low","high_bug","bug","informational"]);function Mn(t){let e=xi(t);if(!e)return null;let{severity:n,description:i,location:r,file:o,line:s}=e;return r?{severity:n,description:i,location:r}:{severity:n,description:i,file:o,line:s}}function xi(t){let e=t.indexOf(`
29
+ `),n=(e===-1?t:t.slice(0,e)).trim();if(!n)return null;let i=e===-1?"":t.slice(e+1),{sectionsText:r,metaText:o}=$i(i),s=Ei(r),a=Ai(o),{file:c,line:l,locationLink:d}=Si(s.location||""),u=(a.severity||"").toLowerCase();return{severity:vi.has(u)?u:"medium",description:ki(n,s),location:d,file:c||"unknown",line:l}}function $i(t){let e=/^---\s*$/mu,n=e.exec(t);if(!n)return{sectionsText:t,metaText:""};let i=t.slice(0,n.index).trim(),r=t.slice(n.index+n[0].length).replace(/^\n/u,""),o=e.exec(r),s=o?r.slice(0,o.index):r;return{sectionsText:i,metaText:s}}function Ei(t){let e={},n=t.split(/^## /mu);for(let i=1;i<n.length;i++){let r=n[i],o=r.indexOf(`
30
+ `),s=(o===-1?r:r.slice(0,o)).trim().toLowerCase(),a=(o===-1?"":r.slice(o+1)).trim();s&&(e[s]=a)}return e}function Ai(t){let e={};for(let n of t.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu))e[n[1].trim().toLowerCase()]=n[2].trim();return e}function Si(t){let e="",n="?",i="",r=t.match(/\[([^\]]+)\]\(([^)]+)\)/u);if(r){e=r[1].trim(),i=r[2];let s=r[2].match(/#L(\d+)/u);s&&(n=s[1])}else e=t.trim(),i=t.trim();let o=e.match(/^(.+):(\d+)$/u);return o&&(e=o[1],n==="?"&&(n=o[2])),{file:e,line:n,locationLink:i}}function ki(t,e){let n=[t];return e.details&&n.push(e.details),e.impact&&n.push(`Impact: ${e.impact}`),e["reproduction steps"]&&n.push(`Reproduction: ${e["reproduction steps"]}`),Ii(n.join(`
31
31
 
32
- `))}function gi(t){return t.replaceAll("**","")}var yi=new Set(["critical","high","medium","low","high_bug","bug","informational"]);function En(t){let e=E(t).trim();if(!e.startsWith("# "))return null;let n=e.split(/^# /mu).filter(r=>r.trim().length>0),i=[];for(let r of n){let o=bi(r);o&&i.push(o)}return i.length===0?null:{type:"security",source:"claude-security",findings:i}}function bi(t){let{title:e,body:n}=te(t);if(!e)return null;let{sectionsText:i,metaText:r}=wi(n),o=_i(i),s=xi(r),a=Ai(o.evidence||""),{file:c,line:l,locationLink:d}=An(o.location||a[0]?.ref||""),u=(s.severity||"").toLowerCase(),p=yi.has(u)?u:"medium",h=ki(e,o,a.length>0),f={file:c||"unknown",line:l,severity:p,description:h};d&&(f.location=d),a.length>0&&(f.evidence=a.map(Si)),o["reproduction steps"]&&(f.reproduction=vi(o["reproduction steps"])),o["recommended fix"]&&(f.recommendation=o["recommended fix"]),s.repository&&(f.repo={github:s.repository}),s.branch&&(f.branch=s.branch),s["date created"]&&(f.dateCreated=s["date created"]),s.status&&(f.status=s.status),s.category&&(f.category=s.category);let g=xn(t);return g&&(f._idBasis=g),f}function wi(t){let e=/^---\s*$/mu,n=e.exec(t);if(!n)return{sectionsText:t,metaText:""};let i=t.slice(0,n.index).trim(),r=t.slice(n.index+n[0].length).replace(/^\n/u,""),o=e.exec(r),s=o?r.slice(0,o.index):r;return{sectionsText:i,metaText:s}}function _i(t){let e={};for(let n of t.split(/^## /mu).slice(1)){let{title:i,body:r}=te(n),o=i.toLowerCase();o&&(e[o]=r.trim())}return e}function xi(t){let e={};for(let n of t.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu))e[n[1].trim().toLowerCase()]=n[2].trim();return e}function An(t){let e="",n="?",i="",r=z(t);if(r){e=r.label.trim(),i=r.url.trim();let s=i.match(/#L(\d+)(?:-L?(\d+))?/u);s&&(n=s[2]?`${s[1]}-${s[2]}`:s[1])}else e=t.trim(),i=t.trim();e=Yt(e.replaceAll("`","")).trim();let o=e.match(/^(.+):(\d+)(?:\s*[-–—]\s*L?(\d+))?$/u);return o&&(e=o[1],n==="?"&&(n=o[3]?`${o[2]}-${o[3]}`:o[2])),{file:e,line:n,locationLink:i,linked:r!==null}}function vi(t){let e=t.split(`
33
- `),n=e.findIndex(a=>a.trim());if(n===-1||!F.test(e[n])||e.some((a,c)=>c!==n&&F.test(a)))return t;let i=e[n].replace(/^ */u,""),r=i.replace(F,"");if(!r.trim())return t;let o=vn(r)??vn(i);if(o===null&&(F.test(r)||Ei.test(i)))return t;let s=o===null?[r]:o.length===1?[o[0].step]:o.map(({number:a,step:c})=>`${a}. ${c}`);return e.splice(n,1,...s),e.join(`
34
- `)}var $i=/(?:^|[ \t])(\d{1,9})\)(?=[ \t]|$)/gu,Ei=/^\d{1,9}\)(?=[ \t]|$)/u;function vn(t){let e=[...t.matchAll($i)];if(e.length===0||e[0].index!==0)return null;let n=[];for(let[i,r]of e.entries()){let o=Number(r[1]);if(i>0&&o<=n[i-1].number)return null;let s=t.slice(r.index+r[0].length,e[i+1]?.index).trim();if(!s)return null;n.push({number:o,step:s})}return n}var $n=/^[ \t]*(?:\d+[.)]|[-*+])\s+/u;function Ai(t){let e=[];for(let n of t.split(`
35
- `))$n.test(n)?e.push({ref:n.replace($n,"").trim(),note:[]}):e.length>0&&n.trim()&&e.at(-1).note.push(n.trim());if(e.length===0){let n=t.split(`
36
- `).map(o=>o.trim()).filter(Boolean),i=n.findIndex(o=>z(o)!==null);if(i===-1&&n.length!==1)return[];let r=i===-1?0:i;e.push({ref:n[r],note:n.filter((o,s)=>s!==r)})}return e.filter(n=>n.ref)}function Si({ref:t,note:e}){let{file:n,line:i,locationLink:r,linked:o}=An(t),s={file:n||"unknown",line:i};r&&o&&(s.url=r);let a=e.join(`
37
- `);return a&&(s.text=a),s}function ki(t,e,n){let i=[t];return e.details&&i.push(e.details),e.evidence&&!n&&i.push(`**Evidence:**
32
+ `))}function Ii(t){return t.replaceAll("**","")}var Ci=new Set(["critical","high","medium","low","high_bug","bug","informational","informative"]);function Bn(t){let e=S(t).trim();if(!e.startsWith("# "))return null;let n=e.split(/^# /mu).filter(r=>r.trim().length>0),i=[];for(let r of n){let o=Ti(r);o&&i.push(o)}return i.length===0?null:{type:"security",source:"claude-security",findings:i}}function Ti(t){let{title:e,body:n}=ne(t);if(!e)return null;let{sectionsText:i,metaText:r}=Ri(n),o=Li(i),s=Mi(r),a=Ui(o.evidence||""),{file:c,line:l,locationLink:d}=Un(o.location||a[0]?.ref||""),u=(s.severity||"").toLowerCase(),p=Ci.has(u)?u:"medium",h=Fi(e,o,a.length>0),f={file:c||"unknown",line:l,severity:p,description:h};d&&(f.location=d),a.length>0&&(f.evidence=a.map(Di)),o["reproduction steps"]&&(f.reproduction=Oi(o["reproduction steps"])),o["recommended fix"]&&(f.recommendation=o["recommended fix"]),s.repository&&(f.repo={github:s.repository}),s.branch&&(f.branch=s.branch),s["date created"]&&(f.dateCreated=s["date created"]),s.status&&(f.status=s.status),s.category&&(f.category=s.category);let g=Mn(t);return g&&(f._idBasis=g),_(f)}function Ri(t){let e=/^---\s*$/mu,n=e.exec(t);if(!n)return{sectionsText:t,metaText:""};let i=t.slice(0,n.index).trim(),r=t.slice(n.index+n[0].length).replace(/^\n/u,""),o=e.exec(r),s=o?r.slice(0,o.index):r;return{sectionsText:i,metaText:s}}function Li(t){let e={};for(let n of t.split(/^## /mu).slice(1)){let{title:i,body:r}=ne(n),o=i.toLowerCase();o&&(e[o]=r.trim())}return e}function Mi(t){let e={};for(let n of t.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu))e[n[1].trim().toLowerCase()]=n[2].trim();return e}function Un(t){let e="",n="?",i="",r=j(t);if(r){e=r.label.trim(),i=r.url.trim();let s=i.match(/#L(\d+)(?:-L?(\d+))?/u);s&&(n=s[2]?`${s[1]}-${s[2]}`:s[1])}else e=t.trim(),i=t.trim();e=an(e.replaceAll("`","")).trim();let o=e.match(/^(.+):(\d+)(?:\s*[-–—]\s*L?(\d+))?$/u);return o&&(e=o[1],n==="?"&&(n=o[3]?`${o[2]}-${o[3]}`:o[2])),{file:e,line:n,locationLink:i,linked:r!==null}}function Oi(t){let e=t.split(`
33
+ `),n=e.findIndex(a=>a.trim());if(n===-1||!z.test(e[n])||e.some((a,c)=>c!==n&&z.test(a)))return t;let i=e[n].replace(/^ */u,""),r=i.replace(z,"");if(!r.trim())return t;let o=On(r)??On(i);if(o===null&&(z.test(r)||Bi.test(i)))return t;let s=o===null?[r]:o.length===1?[o[0].step]:o.map(({number:a,step:c})=>`${a}. ${c}`);return e.splice(n,1,...s),e.join(`
34
+ `)}var Ni=/(?:^|[ \t])(\d{1,9})\)(?=[ \t]|$)/gu,Bi=/^\d{1,9}\)(?=[ \t]|$)/u;function On(t){let e=[...t.matchAll(Ni)];if(e.length===0||e[0].index!==0)return null;let n=[];for(let[i,r]of e.entries()){let o=Number(r[1]);if(i>0&&o<=n[i-1].number)return null;let s=t.slice(r.index+r[0].length,e[i+1]?.index).trim();if(!s)return null;n.push({number:o,step:s})}return n}var Nn=/^[ \t]*(?:\d+[.)]|[-*+])\s+/u;function Ui(t){let e=[];for(let n of t.split(`
35
+ `))Nn.test(n)?e.push({ref:n.replace(Nn,"").trim(),note:[]}):e.length>0&&n.trim()&&e.at(-1).note.push(n.trim());if(e.length===0){let n=t.split(`
36
+ `).map(o=>o.trim()).filter(Boolean),i=n.findIndex(o=>j(o)!==null);if(i===-1&&n.length!==1)return[];let r=i===-1?0:i;e.push({ref:n[r],note:n.filter((o,s)=>s!==r)})}return e.filter(n=>n.ref)}function Di({ref:t,note:e}){let{file:n,line:i,locationLink:r,linked:o}=Un(t),s={file:n||"unknown",line:i};r&&o&&(s.url=r);let a=e.join(`
37
+ `);return a&&(s.text=a),s}function Fi(t,e,n){let i=[t];return e.details&&i.push(e.details),e.evidence&&!n&&i.push(`**Evidence:**
38
38
  ${e.evidence}`),e.impact&&i.push(`**Impact:** ${e.impact}`),i.join(`
39
39
 
40
- `)}function Ii(t){let e=(t||"").trim(),n="",i=/\[([^\]]+)\]\(([^)]+)\)/u.exec(e);i&&(e=i[1].trim(),n=i[2].trim());let r="",o=/#L(\d+)/u.exec(n);o&&(r=o[1]);let c=[...e.matchAll(/`([^`]+)`/gu)].map(u=>u[1].trim()).find(u=>!u.includes("(")&&(u.includes("/")||/\.\w/u.test(u)))??(e.replaceAll("`","").trim().split(/[\s,]+/u).find(Boolean)||""),l=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(c);l&&(c=l[1],r||(r=l[2]));let d=/^(.+):(\d+(?:-\d+)?)$/u.exec(c);return d?(r||(r=d[2]),{file:d[1],line:r,locationLink:n}):{file:c,line:r||"?",locationLink:n}}function ve({severity:t,description:e,ref:n,lineBullet:i="",id:r=""}){let o=Ii(n),s=o.file||"unknown",a=o.line==="?"&&i?i:o.line,c=o.locationLink||(s==="unknown"&&r?`piolium:${r}`:"");return c?{severity:t,description:e,location:c}:{severity:t,description:e,file:s,line:a}}var Ci=/^(?:https?:\/\/)?(?:www\.)?github\.com\/([^/?#]+)\/([^/?#]+?)(?:\.git)?(?:[/?#].*)?$/iu,Ri=/^[\w.-]+\/[\w.-]+$/u;function Ye(t){return Ri.test(t)}function re(t){let e=t?.repo?.github;if(typeof e!="string")return null;let n=e.trim().replace(/\/+$/u,"");if(!n)return null;let i=Ci.exec(n),r=(i?`${i[1]}/${i[2]}`:n).replace(/\.git$/u,"");return Ye(r)?r:null}function k(t){switch(((t||"").trim().split(/\s+/u)[0]||"").replaceAll(/[`*]+/gu,"").toUpperCase()){case"CRITICAL":return"critical";case"HIGH":return"high";case"MEDIUM":return"medium";case"LOW":return"low";case"INFO":case"INFORMATIONAL":return"informational";default:return""}}function ie(t){let e=/^([CHML])-?\d+$/iu.exec((t||"").trim());return e?{C:"critical",H:"high",M:"medium",L:"low"}[e[1].toUpperCase()]:""}function Ze(t){let e=/^(critical|high|medium|low|informational|info)(?:[ -](?:severity|risk))?(?:[ -]findings?)?(?:\s*\(\d+\))?$/iu.exec((t||"").trim());return e?k(e[1]):""}function Sn(t){let e=/^(critical|high|medium|low|informational|info)\b/iu.exec((t||"").trim());return e?k(e[1]):""}function Ee(t){return/^variants?\s*(?:\(\d+\))?\s*:?$/iu.test((t||"").trim())}function Ae(t){let e=/^([CHML]-?\d{1,4}|(?:p|q|b|r|m|l|x|diff)\d{0,4}-\d{2,4})(?:-([A-Za-z0-9][\w-]*))?$/iu.exec(t||"");return e?{id:e[1].toUpperCase(),slug:e[2]||""}:null}function $e(t){return(t||"").replaceAll("-"," ")}function oe(t){let e=(t||"").trim(),n=/^\[([^\]]+)\]\([^)]*\)$/u.exec(e);return Zt(n?n[1]:e).toUpperCase()}function Qe(t){let e=/^\[([^\]]+)\]\(([^)]+)\)\s*[:—–-]*\s*(.*)$/u.exec(t);return e?{text:e[3]?`${e[1].trim()} ${e[3].trim()}`:e[1].trim(),link:e[2].trim()}:null}function et(t){let e=t.search(/\s/u),n=(e===-1?t:t.slice(0,e)).replace(/[:.,—–-]+$/u,""),i=Ae(n);if(!i)return null;let r=(e===-1?"":t.slice(e+1)).replace(/^[:—–-]+\s*/u,"").trim();return{id:i.id,slug:i.slug,rest:r}}function tt(t){let{text:e,link:n}=Qe(t)??{text:t,link:""},i=/^\[([^\]]+)\] *(.*)$/u.exec(e);if(i){let o=Ae(i[1].trim());return o?{id:o.id,title:i[2].trim()||$e(o.slug)||o.id,link:n}:{id:i[1].trim().toUpperCase(),title:i[2].trim(),link:n}}let r=et(e);return r?{id:r.id,title:r.rest||$e(r.slug)||r.id,link:n}:{id:"",title:e.trim(),link:n}}function kn(t){let e={},n=o=>(/`([^`]+)`/u.exec(o)?.[1]??o.split(/\s+/u)[0]??"").trim(),i=/^\s*(?:[-*] +)?\*\*Target:?\*\*\s*(.*)$/imu.exec(t||"");if(i){let o=n(i[1]);Ye(o)&&(e.repo=o)}let r=/^\s*(?:[-*] +)?\*\*Commit[^:*]*:?\*\*\s*(.*)$/imu.exec(t||"");if(r){let o=n(r[1]);be(o)&&(e.commitHash=o)}return e}var nt=["key code reference","key code","code reference","location","affected file","file","path"];function rt(t){for(let e of nt)if(t[e])return t[e];return""}function Se(t){return{id:oe(t.id||""),title:B(t.title),severity:B(t.severity),pocStatus:B(t["poc status"]||t.poc),status:B(t.status),parent:oe(B(t.parent||"")),location:B(t.location)}}function ke(t,e=""){let n=k(t.severity)||e||ie(t.id)||"medium",{file:i,line:r,locationLink:o}=we(t.location||""),s={file:i||"unknown",line:r,severity:n,description:Ke(t.title||t.id)};return o?s.location=o:s.file==="unknown"&&t.id&&(s.location=`piolium:${t.id}`),s._idBasis=ve({severity:n,description:s.description,ref:t.location||"",id:t.id}),t.pocStatus&&(s.pocStatus=t.pocStatus),t.status&&(s.status=t.status),t.parent&&(s.parent=t.parent),s}function it(t,e,n){let i=[];for(let r of t.split(`
41
- `)){let o=/^\s{0,3}(?:[-*+]|\d{1,3}[.)])\s+(.+)$/u.exec(r);if(!o)continue;let s=o[1].trim();if(/^\*\*[^:*]+:\*\*/u.test(s))continue;let a=Qe(s),c=a?.link??"";if(a)s=a.text;else{let g=/^\*\*([^*]+)\*\*\s*[:—–-]*\s*(.*)$/u.exec(s);g&&(s=g[2]?`${g[1].trim()} ${g[2].trim()}`:g[1].trim())}if(/^(?:none\b|no |n\/a\b)/iu.test(s))continue;let l=et(s),d=l?.id??"",u=s;if(l){let g=$e(l.slug);u=g&&l.rest?`${g}
40
+ `)}function Hi(t){let e=(t||"").trim(),n="",i=/\[([^\]]+)\]\(([^)]+)\)/u.exec(e);i&&(e=i[1].trim(),n=i[2].trim());let r="",o=/#L(\d+)/u.exec(n);o&&(r=o[1]);let c=[...e.matchAll(/`([^`]+)`/gu)].map(u=>u[1].trim()).find(u=>!u.includes("(")&&(u.includes("/")||/\.\w/u.test(u)))??(e.replaceAll("`","").trim().split(/[\s,]+/u).find(Boolean)||""),l=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(c);l&&(c=l[1],r||(r=l[2]));let d=/^(.+):(\d+(?:-\d+)?)$/u.exec(c);return d?(r||(r=d[2]),{file:d[1],line:r,locationLink:n}):{file:c,line:r||"?",locationLink:n}}function Ae({severity:t,description:e,ref:n,lineBullet:i="",id:r=""}){let o=Hi(n),s=o.file||"unknown",a=o.line==="?"&&i?i:o.line,c=o.locationLink||(s==="unknown"&&r?`piolium:${r}`:"");return c?{severity:t,description:e,location:c}:{severity:t,description:e,file:s,line:a}}var Pi=/^(?:https?:\/\/)?(?:www\.)?github\.com\/([^/?#]+)\/([^/?#]+?)(?:\.git)?(?:[/?#].*)?$/iu,zi=/^[\w.-]+\/[\w.-]+$/u;function it(t){return zi.test(t)}function ie(t){let e=t?.repo?.github;if(typeof e!="string")return null;let n=e.trim().replace(/\/+$/u,"");if(!n)return null;let i=Pi.exec(n),r=(i?`${i[1]}/${i[2]}`:n).replace(/\.git$/u,"");return it(r)?r:null}function C(t){switch(((t||"").trim().split(/\s+/u)[0]||"").replaceAll(/[`*]+/gu,"").toUpperCase()){case"CRITICAL":return"critical";case"HIGH":return"high";case"MEDIUM":return"medium";case"LOW":return"low";case"INFO":case"INFORMATIONAL":return"informational";case"INFORMATIVE":return"informative";default:return""}}function oe(...t){return{severity:t.find(Boolean)||"medium",identitySeverity:t.find(e=>e&&e!=="informative")||"medium"}}function se(t){let e=/^([CHML])-?\d+$/iu.exec((t||"").trim());return e?{C:"critical",H:"high",M:"medium",L:"low"}[e[1].toUpperCase()]:""}function ot(t){let e=/^(critical|high|medium|low|informational|informative|info)(?:[ -](?:severity|risk))?(?:[ -]findings?)?(?:\s*\(\d+\))?$/iu.exec((t||"").trim());return e?C(e[1]):""}function Dn(t){let e=/^(critical|high|medium|low|informational|informative|info)\b/iu.exec((t||"").trim());return e?C(e[1]):""}function ke(t){return/^variants?\s*(?:\(\d+\))?\s*:?$/iu.test((t||"").trim())}function Ie(t){let e=/^([CHML]-?\d{1,4}|(?:p|q|b|r|m|l|x|diff)\d{0,4}-\d{2,4})(?:-([A-Za-z0-9][\w-]*))?$/iu.exec(t||"");return e?{id:e[1].toUpperCase(),slug:e[2]||""}:null}function Se(t){return(t||"").replaceAll("-"," ")}function ae(t){let e=(t||"").trim(),n=/^\[([^\]]+)\]\([^)]*\)$/u.exec(e);return cn(n?n[1]:e).toUpperCase()}function st(t){let e=/^\[([^\]]+)\]\(([^)]+)\)\s*[:—–-]*\s*(.*)$/u.exec(t);return e?{text:e[3]?`${e[1].trim()} ${e[3].trim()}`:e[1].trim(),link:e[2].trim()}:null}function at(t){let e=t.search(/\s/u),n=(e===-1?t:t.slice(0,e)).replace(/[:.,—–-]+$/u,""),i=Ie(n);if(!i)return null;let r=(e===-1?"":t.slice(e+1)).replace(/^[:—–-]+\s*/u,"").trim();return{id:i.id,slug:i.slug,rest:r}}function ct(t){let{text:e,link:n}=st(t)??{text:t,link:""},i=/^\[([^\]]+)\] *(.*)$/u.exec(e);if(i){let o=Ie(i[1].trim());return o?{id:o.id,title:i[2].trim()||Se(o.slug)||o.id,link:n}:{id:i[1].trim().toUpperCase(),title:i[2].trim(),link:n}}let r=at(e);return r?{id:r.id,title:r.rest||Se(r.slug)||r.id,link:n}:{id:"",title:e.trim(),link:n}}function Fn(t){let e={},n=o=>(/`([^`]+)`/u.exec(o)?.[1]??o.split(/\s+/u)[0]??"").trim(),i=/^\s*(?:[-*] +)?\*\*Target:?\*\*\s*(.*)$/imu.exec(t||"");if(i){let o=n(i[1]);it(o)&&(e.repo=o)}let r=/^\s*(?:[-*] +)?\*\*Commit[^:*]*:?\*\*\s*(.*)$/imu.exec(t||"");if(r){let o=n(r[1]);ve(o)&&(e.commitHash=o)}return e}var lt=["key code reference","key code","code reference","location","affected file","file","path"];function ut(t){for(let e of lt)if(t[e])return t[e];return""}function Ce(t){return{id:ae(t.id||""),title:U(t.title),severity:U(t.severity),pocStatus:U(t["poc status"]||t.poc),status:U(t.status),parent:ae(U(t.parent||"")),location:U(t.location)}}function Te(t,e=""){let{severity:n,identitySeverity:i}=oe(C(t.severity),e,se(t.id)),{file:r,line:o,locationLink:s}=xe(t.location||""),a={file:r||"unknown",line:o,severity:n,description:Qe(t.title||t.id)};return s?a.location=s:a.file==="unknown"&&t.id&&(a.location=`piolium:${t.id}`),a._idBasis=Ae({severity:i,description:a.description,ref:t.location||"",id:t.id}),t.pocStatus&&(a.pocStatus=t.pocStatus),t.status&&(a.status=t.status),t.parent&&(a.parent=t.parent),_(a)}function dt(t,e,n){let i=[];for(let r of t.split(`
41
+ `)){let o=/^\s{0,3}(?:[-*+]|\d{1,3}[.)])\s+(.+)$/u.exec(r);if(!o)continue;let s=o[1].trim();if(/^\*\*[^:*]+:\*\*/u.test(s))continue;let a=st(s),c=a?.link??"";if(a)s=a.text;else{let y=/^\*\*([^*]+)\*\*\s*[:—–-]*\s*(.*)$/u.exec(s);y&&(s=y[2]?`${y[1].trim()} ${y[2].trim()}`:y[1].trim())}if(/^(?:none\b|no |n\/a\b)/iu.test(s))continue;let l=at(s),d=l?.id??"",u=s;if(l){let y=Se(l.slug);u=y&&l.rest?`${y}
42
42
 
43
- ${l.rest}`:l.rest||g||l.id}let p=n.get(d),f={file:"unknown",line:"?",severity:k(p?.severity)||e||ie(d)||"medium",description:Ke(u)};d?f.location=`piolium:${d}`:c&&(f.location=c),c.endsWith("report.md")&&(f.reportPath=c),p?.pocStatus&&(f.pocStatus=p.pocStatus),p?.status&&(f.status=p.status),p?.parent&&(f.parent=p.parent),i.push({id:d,finding:f})}return i}function ot(t,e,n,i=""){let r=[];for(let s of ne(t)){let a=Se(s);!a.id&&!a.title||(!a.parent&&n&&(a.parent=n),a.id&&!e.has(a.id)&&e.set(a.id,a),r.push({id:a.id,finding:ke(a,i)}))}if(r.length>0)return r;let o=it(t,i,e);for(let s of o)n&&!s.finding.parent&&(s.finding.parent=n);return o}var Ti=new Set(["technical findings detail","technical findings","detailed findings","findings detail","findings"]);function Li(t){return Ti.has(t)||t.startsWith("findings by severity")}var Mi=/^(?:summary of findings|deferred|methodolog|executive|conclusion|attack surface|coverage|discoveries|scope|table of contents|contents|appendix|recommendation|remediation)/u;function Oi(t){return Mi.test(t)}function In(t){let{id:e}=tt(t);return!!(e&&Ae(e))}function Ni(t){let e=A(t,ee);return(e.length>0?e:A(t,O)).some(({heading:i})=>In(i))}function Cn(t){let e=E(t).trim();if(!/^# +Security Audit Report\b/mu.test(e)&&!/^## +Technical Findings Detail\s*$/imu.test(e)&&!/^## +Findings by Severity\b/imu.test(e))return null;let n=Hi(e),i=Pi(n["summary of findings"]||""),r=kn(N(e,Q).head),o=[],s=new Set,a=[],c=({id:d,finding:u})=>{o.push(u),d&&s.add(d)},l=d=>{for(let u of d)c(u)};for(let[d,u]of Object.entries(n)){let p=Ze(d);p||Li(d)?l(st(u,p,i,a)):!Oi(d)&&Ni(u)&&l(st(u,Sn(d),i,a))}for(let d of a)(!d.id||!s.has(d.id))&&c(d);for(let d of i.values())s.has(d.id)||c({id:d.id,finding:ke(d)});if(o.length===0)return null;for(let d of o)r.repo&&(d.repo={github:r.repo}),r.commitHash&&!d.auditedCommit&&(d.auditedCommit=r.commitHash);return{type:"security",source:"piolium",findings:o}}function Bi(t,e,n,i){let r=[],o="";for(let{heading:s,body:a}of t){let c=Ze(s);if(c)r.push(...st(a,c,e,n)),o="";else if(Ee(s))r.push(...Di(a,e,o,n,i));else{let l=Ui(s,a,e,n,i);r.push(...l),o=l[0]?.id||o}}return r}function Ui(t,e,n,i,r){let{head:o,subs:s}=N(e,O),a=Rn(t,o,n,r),c=a!==null&&!a.id&&s.some(d=>!Ee(d.heading)&&In(d.heading)),l=a&&!c?[a]:[];return l.push(...at(s,n,i,r,a?.id||"")),l}function Di(t,e,n,i,r){let{head:o,subs:s}=N(t,O);return i.push(...ot(o,e,n,r)),at(s,e,i,r,"")}function at(t,e,n,i,r){let o=[],s="";for(let{heading:a,body:c}of t){if(Ee(a)){n.push(...ot(c,e,r??s,i));continue}let l=Rn(a,c,e,i);l&&(o.push(l),s=l.id||s)}return o}function st(t,e,n,i){let r=A(t,ee);if(r.length>0)return Bi(r,n,i,e);let o=at(A(t,O),n,i,e,null);if(o.length>0)return o;let s=ne(t).map(Se).filter(a=>a.id||a.title);if(s.length>0){for(let a of s)!a.severity&&e&&(a.severity=e),a.id&&!n.has(a.id)?n.set(a.id,a):a.id||i.push({id:"",finding:ke(a,e)});return[]}return i.push(...it(t,e,n)),[]}function Rn(t,e,n,i=""){let r=t.trim();if(!r)return null;let{id:o,title:s,link:a}=tt(r),c=n.get(o);!o&&s&&(c=[...n.values()].find(se=>se.title.toLowerCase()===s.toLowerCase()),o=c?.id??"");let{fields:l,labels:d,prose:u}=qt(e),p=k(l.severity)||k(c?.severity)||i||ie(o)||"medium",h=we(rt(l)),f=/\d+/u.exec(l.line||l.lines||"")?.[0]??"",g=h.line==="?"&&f?f:h.line,b=/\*\*Variant of:?\*\*\s*\[?([^\]\s)]+)/iu.exec(e),_=u.split(`
44
- `).filter(se=>!/^\s*<a\s[^>]*>\s*<\/a>\s*$/iu.test(se)&&!/\*\*Variant of:?\*\*/iu.test(se)).join(`
45
- `).trim(),y={file:h.file||"unknown",line:g,severity:p,description:zi(s||o,l,d,_)};h.locationLink?y.location=h.locationLink:y.file==="unknown"&&o&&(y.location=`piolium:${o}`),y._idBasis=ve({severity:p,description:y.description,ref:rt(l),lineBullet:f,id:o});let I=l["poc status"]||l.poc||c?.pocStatus;I&&(y.pocStatus=I);let dt=l["detailed report"]||(a.endsWith("report.md")?a:"");dt&&(y.reportPath=dt),c?.status&&(y.status=c.status);let pt=c?.parent||(b?oe(b[1]):"");return pt&&(y.parent=pt),{id:o,finding:y}}function Hi(t){let e=Object.create(null);for(let{heading:n,body:i}of A(t,Q)){let r=n.trim().toLowerCase();r&&(e[r]=r in e?`${e[r]}
46
- ${i}`:i)}return e}function Pi(t){let e=new Map;for(let n of ne(t)){let i=Se(n);i.id&&e.set(i.id,i)}return e}var Fi=new Set([...nt,"severity","summary","files","poc","poc status","line","lines","detailed report","proof of concept","evidence","variant of","pattern","status","id","title"]);function zi(t,e,n,i){let r=[t];e.summary&&r.push(e.summary),i&&r.push(i);for(let[o,s]of Object.entries(e))!s||Fi.has(o)||r.push(`**${n[o]||o}:** ${s}`);return r.filter(Boolean).join(`
43
+ ${l.rest}`:l.rest||y||l.id}let p=n.get(d),{severity:h,identitySeverity:f}=oe(C(p?.severity),e,se(d)),g={file:"unknown",line:"?",severity:h,description:Qe(u)};d?g.location=`piolium:${d}`:c&&(g.location=c),c.endsWith("report.md")&&(g.reportPath=c),p?.pocStatus&&(g.pocStatus=p.pocStatus),p?.status&&(g.status=p.status),p?.parent&&(g.parent=p.parent),i.push({id:d,finding:_(g,f)})}return i}function pt(t,e,n,i=""){let r=[];for(let s of re(t)){let a=Ce(s);!a.id&&!a.title||(!a.parent&&n&&(a.parent=n),a.id&&!e.has(a.id)&&e.set(a.id,a),r.push({id:a.id,finding:Te(a,i)}))}if(r.length>0)return r;let o=dt(t,i,e);for(let s of o)n&&!s.finding.parent&&(s.finding.parent=n);return o}var ji=new Set(["technical findings detail","technical findings","detailed findings","findings detail","findings"]);function Vi(t){return ji.has(t)||t.startsWith("findings by severity")}var Gi=/^(?:summary of findings|deferred|methodolog|executive|conclusion|attack surface|coverage|discoveries|scope|table of contents|contents|appendix|recommendation|remediation)/u;function Wi(t){return Gi.test(t)}function Hn(t){let{id:e}=ct(t);return!!(e&&Ie(e))}function Ki(t){let e=k(t,te);return(e.length>0?e:k(t,N)).some(({heading:i})=>Hn(i))}function Pn(t){let e=S(t).trim();if(!/^# +Security Audit Report\b/mu.test(e)&&!/^## +Technical Findings Detail\s*$/imu.test(e)&&!/^## +Findings by Severity\b/imu.test(e))return null;let n=Yi(e),i=Zi(n["summary of findings"]||""),r=Fn(B(e,ee).head),o=[],s=new Set,a=[],c=({id:d,finding:u})=>{o.push(u),d&&s.add(d)},l=d=>{for(let u of d)c(u)};for(let[d,u]of Object.entries(n)){let p=ot(d);p||Vi(d)?l(ft(u,p,i,a)):!Wi(d)&&Ki(u)&&l(ft(u,Dn(d),i,a))}for(let d of a)(!d.id||!s.has(d.id))&&c(d);for(let d of i.values())s.has(d.id)||c({id:d.id,finding:Te(d)});if(o.length===0)return null;for(let d of o)r.repo&&(d.repo={github:r.repo}),r.commitHash&&!d.auditedCommit&&(d.auditedCommit=r.commitHash);return{type:"security",source:"piolium",findings:o}}function Xi(t,e,n,i){let r=[],o="";for(let{heading:s,body:a}of t){let c=ot(s);if(c)r.push(...ft(a,c,e,n)),o="";else if(ke(s))r.push(...Ji(a,e,o,n,i));else{let l=qi(s,a,e,n,i);r.push(...l),o=l[0]?.id||o}}return r}function qi(t,e,n,i,r){let{head:o,subs:s}=B(e,N),a=zn(t,o,n,r),c=a!==null&&!a.id&&s.some(d=>!ke(d.heading)&&Hn(d.heading)),l=a&&!c?[a]:[];return l.push(...ht(s,n,i,r,a?.id||"")),l}function Ji(t,e,n,i,r){let{head:o,subs:s}=B(t,N);return i.push(...pt(o,e,n,r)),ht(s,e,i,r,"")}function ht(t,e,n,i,r){let o=[],s="";for(let{heading:a,body:c}of t){if(ke(a)){n.push(...pt(c,e,r??s,i));continue}let l=zn(a,c,e,i);l&&(o.push(l),s=l.id||s)}return o}function ft(t,e,n,i){let r=k(t,te);if(r.length>0)return Xi(r,n,i,e);let o=ht(k(t,N),n,i,e,null);if(o.length>0)return o;let s=re(t).map(Ce).filter(a=>a.id||a.title);if(s.length>0){for(let a of s)!a.severity&&e&&(a.severity=e),a.id&&!n.has(a.id)?n.set(a.id,a):a.id||i.push({id:"",finding:Te(a,e)});return[]}return i.push(...dt(t,e,n)),[]}function zn(t,e,n,i=""){let r=t.trim();if(!r)return null;let{id:o,title:s,link:a}=ct(r),c=n.get(o);!o&&s&&(c=[...n.values()].find(le=>le.title.toLowerCase()===s.toLowerCase()),o=c?.id??"");let{fields:l,labels:d,prose:u}=on(e),{severity:p,identitySeverity:h}=oe(C(l.severity),C(c?.severity),i,se(o)),f=xe(ut(l)),g=/\d+/u.exec(l.line||l.lines||"")?.[0]??"",y=f.line==="?"&&g?g:f.line,x=/\*\*Variant of:?\*\*\s*\[?([^\]\s)]+)/iu.exec(e),w=u.split(`
44
+ `).filter(le=>!/^\s*<a\s[^>]*>\s*<\/a>\s*$/iu.test(le)&&!/\*\*Variant of:?\*\*/iu.test(le)).join(`
45
+ `).trim(),v={file:f.file||"unknown",line:y,severity:p,description:eo(s||o,l,d,w)};f.locationLink?v.location=f.locationLink:v.file==="unknown"&&o&&(v.location=`piolium:${o}`),v._idBasis=Ae({severity:h,description:v.description,ref:ut(l),lineBullet:g,id:o});let wt=l["poc status"]||l.poc||c?.pocStatus;wt&&(v.pocStatus=wt);let _t=l["detailed report"]||(a.endsWith("report.md")?a:"");_t&&(v.reportPath=_t),c?.status&&(v.status=c.status);let vt=c?.parent||(x?ae(x[1]):"");return vt&&(v.parent=vt),{id:o,finding:_(v)}}function Yi(t){let e=Object.create(null);for(let{heading:n,body:i}of k(t,ee)){let r=n.trim().toLowerCase();r&&(e[r]=r in e?`${e[r]}
46
+ ${i}`:i)}return e}function Zi(t){let e=new Map;for(let n of re(t)){let i=Ce(n);i.id&&e.set(i.id,i)}return e}var Qi=new Set([...lt,"severity","summary","files","poc","poc status","line","lines","detailed report","proof of concept","evidence","variant of","pattern","status","id","title"]);function eo(t,e,n,i){let r=[t];e.summary&&r.push(e.summary),i&&r.push(i);for(let[o,s]of Object.entries(e))!s||Qi.has(o)||r.push(`**${n[o]||o}:** ${s}`);return r.filter(Boolean).join(`
47
47
 
48
- `)}var ji=new TextEncoder;function Tn(t){if(typeof t!="string")throw new TypeError(`encodeUtf8 expects a string, got ${typeof t}`);if(!t.isWellFormed())throw new TypeError("encodeUtf8: input contains lone surrogates");return ji.encode(t)}function Vi(t){return Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}async function Gi(t){let e=Tn(JSON.stringify(t)),n=await crypto.subtle.digest("SHA-256",e),i=new Uint8Array(n,0,16);i[6]=i[6]&15|64,i[8]=i[8]&63|128;let r=Vi(i);return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20,32)}`}async function Ln(t){if(typeof crypto?.subtle?.digest!="function")return null;let e=Wi(t);try{return await Gi(e)}catch{return null}}function Wi(t){if(t._idBasis)return t._idBasis;let{severity:e,description:n}=t;return t.fileHash?{severity:e,description:n,fileHash:t.fileHash}:t.location?{severity:e,description:n,location:t.location}:{severity:e,description:n,file:t.file,line:t.line}}var Ki=["finding_url","repository","title","description","severity","configured_scan_id","relevant_paths"];function Xi(t){let e=[],n=[],i="",r=!1,o=t.length;for(let s=0;s<o;s++){let a=t[s];r?a==='"'?t[s+1]==='"'?(i+='"',s++):r=!1:i+=a:a==='"'?r=!0:a===","?(n.push(i),i=""):a===`
48
+ `)}var to=["finding_url","repository","title","description","severity","configured_scan_id","relevant_paths"];function no(t){let e=[],n=[],i="",r=!1,o=t.length;for(let s=0;s<o;s++){let a=t[s];r?a==='"'?t[s+1]==='"'?(i+='"',s++):r=!1:i+=a:a==='"'?r=!0:a===","?(n.push(i),i=""):a===`
49
49
  `||a==="\r"?(n.push(i),e.push(n),n=[],i="",a==="\r"&&t[s+1]===`
50
- `&&s++):i+=a}for((i!==""||n.length>0)&&(n.push(i),e.push(n));e.length>0&&e.at(-1).length===1&&e.at(-1)[0]==="";)e.pop();return e}function qi(t,e){return e.map(n=>{let i=Object.create(null);return t.forEach((r,o)=>{i[r]=n[o]??""}),i})}function ct(t){let e=Xi(t);if(e.length<2)throw new Error("Codex CSV: empty or missing header row");let[n,...i]=e;for(let s of Ki)if(!n.includes(s))throw new Error(`Codex CSV: missing required column "${s}"`);let r=new Map;for(let s of qi(n,i)){let a=s.configured_scan_id;a&&(r.has(a)||r.set(a,[]),r.get(a).push(s))}if(r.size===0)throw new Error("Codex CSV: no rows with a configured_scan_id");let o=[];for(let[s,a]of r){let c=new Set(a.map(u=>u.repository).filter(Boolean));if(c.size>1)throw new Error(`Codex CSV: scan ${s} contains multiple repositories: ${[...c].join(", ")}`);let d=`${[...c][0]||"unknown-repo"}:${s.replace(/^[^:]+:/u,"")}`;o.push({displayName:d,data:{type:"security",source:"codex-security",findings:a.map(Ji)}})}return o}function Ji(t){let e=t.relevant_paths.split(" | ").map(r=>r.trim()).find(Boolean)||"unknown",n=[t.title,t.description].filter(Boolean).join(`
50
+ `&&s++):i+=a}for((i!==""||n.length>0)&&(n.push(i),e.push(n));e.length>0&&e.at(-1).length===1&&e.at(-1)[0]==="";)e.pop();return e}function ro(t,e){return e.map(n=>{let i=Object.create(null);return t.forEach((r,o)=>{i[r]=n[o]??""}),i})}function mt(t){let e=no(t);if(e.length<2)throw new Error("Codex CSV: empty or missing header row");let[n,...i]=e;for(let s of to)if(!n.includes(s))throw new Error(`Codex CSV: missing required column "${s}"`);let r=new Map;for(let s of ro(n,i)){let a=s.configured_scan_id;a&&(r.has(a)||r.set(a,[]),r.get(a).push(s))}if(r.size===0)throw new Error("Codex CSV: no rows with a configured_scan_id");let o=[];for(let[s,a]of r){let c=new Set(a.map(u=>u.repository).filter(Boolean));if(c.size>1)throw new Error(`Codex CSV: scan ${s} contains multiple repositories: ${[...c].join(", ")}`);let d=`${[...c][0]||"unknown-repo"}:${s.replace(/^[^:]+:/u,"")}`;o.push({displayName:d,data:{type:"security",source:"codex-security",findings:a.map(io)}})}return o}function io(t){let e=t.relevant_paths.split(" | ").map(r=>r.trim()).find(Boolean)||"unknown",n=[t.title,t.description].filter(Boolean).join(`
51
51
 
52
- `),i={id:t.finding_url,file:e,line:"?",severity:(t.severity||"medium").toLowerCase(),description:n,repo:{github:t.repository}};return t.commit_hash&&(i.commitHash=t.commit_hash),t.detected_at&&(i.detectedAt=t.detected_at),t.committed_at&&(i.committedAt=t.committed_at),i}var Yi=[["deepview-md",_n],["deepsec",tn],["piolium",Cn],["claude-security",En]];function Mn(t){return Array.isArray(t?.findings)?t.findings:Array.isArray(t?.groups)?t.groups:null}function On(t,e){return typeof e=="string"&&/\.csv$/iu.test(e)?"codex":Ie(t).format}function Ie(t){let e;try{let n=JSON.parse(t);return Mn(n)?{data:n,format:"json",reason:null}:{data:null,format:null,reason:"JSON, but not a report: no findings array"}}catch(n){e=n}for(let[n,i]of Yi){let r=i(t);if(r)return{data:r,format:n,reason:null}}return{data:null,format:null,reason:`Not JSON, and not a recognized markdown format. (JSON error: ${e.message})`}}function Zi(t){return t.flat().filter(e=>e&&typeof e=="object")}async function Qi(t){let e=t.filter(i=>!i.id);if(e.length===0)return;let n=await Promise.all(e.map(Ln));e.forEach((i,r)=>{n[r]&&(i.id=n[r])})}async function Nn(t){let{data:e,format:n}=Ie(t);if(!e)return null;let i=Zi(Mn(e));return await Qi(i),{format:n,data:e,findings:i}}function lt(t,e){let n=t.trimStart().startsWith("[")?Xt(t):null;if(n)return{data:{source:"links",findings:[],links:n.groups},format:"links",reason:null};let i=Ie(t);if(i.data!=null||On(t,e)!=="codex")return i;try{return{data:{type:"security",source:"codex-security",findings:ct(t).flatMap(o=>o.data.findings)},format:"codex",reason:null}}catch(r){return{data:null,format:null,reason:r instanceof Error?r.message:"Invalid Codex CSV"}}}function Bn(t,e){let n=lt(t,e);return n.data==null?Promise.resolve(null):Nn(JSON.stringify(n.data))}function Un(t){return t==="inprogress"||t==="fixed"||t==="invalid"||t==="deleted"?t:void 0}function eo(t){if(t)return Un(t.triage)??(t.deleted?"deleted":void 0)}function to(t){return t?!t.color&&!eo(t)&&!t.comment&&!t.fix&&!(t.ignoredReports&&t.ignoredReports.length>0)&&t.flagged===void 0:!0}function Dn(t){if(!t||typeof t!="object")return;let e=t,n={};typeof e.color=="string"&&e.color&&(n.color=e.color);let i=Un(e.triage)??(e.deleted?"deleted":void 0);if(i&&(n.triage=i),typeof e.comment=="string"&&e.comment&&(n.comment=e.comment),typeof e.fix=="string"&&e.fix&&(n.fix=e.fix),typeof e.flagged=="boolean"&&(n.flagged=e.flagged),Array.isArray(e.ignoredReports)){let r=e.ignoredReports.filter(o=>typeof o=="string"&&o.length>0);r.length>0&&(n.ignoredReports=r)}return to(n)?void 0:n}var no=["inprogress","fixed","invalid","deleted"];function ro(t){return typeof t=="string"&&no.includes(t)}function Hn(t){if(t===null)return null;if(typeof t!="object"||Array.isArray(t))return"invalid";let e=t,n={},i=e.color;if(i!=null){if(typeof i!="string"||i.length>50)return"invalid";i!==""&&(n.color=i)}let r=e.triage;if(r!=null){if(!ro(r))return"invalid";n.triage=r}for(let s of["comment","fix"]){let a=e[s];if(a!=null){if(typeof a!="string"||a.length>1e4)return"invalid";a!==""&&(n[s]=a)}}let o=e.flagged;if(o!=null){if(typeof o!="boolean")return"invalid";n.flagged=o}return n}function Pn(t){if(typeof t!="string")return{ok:!0,path:null};if(/\p{Cc}/u.test(t)||t.includes("\\")||t!==t.trim())return{ok:!1};let e=[];for(let i of t.split("/"))if(!(i===""||i===".")){if(i===".."||i!==i.trim())return{ok:!1};e.push(i)}let n=e.join("/");return n.length>500?{ok:!1}:{ok:!0,path:n===""?null:n}}async function jn(t,e){let n=new Uint8Array(await t.arrayBuffer());return me(n)?e({tryPassword:i=>Ve(n,i)}):n[0]===31&&n[1]===139?Ve(n):ye(new TextDecoder("utf-8",{fatal:!0}).decode(n))}async function Vn(t,e){let n=new Map,i=[];for(let s of t.reports){if(typeof s?.name!="string"||!s.name||typeof s.content!="string")throw new Error("Every report must have a name and content.");let a=lt(s.content,s.name);if(!a.data)throw new Error(`${s.name}: ${a.reason??"Unsupported report"}`);let c=re(a.data),l=c??re(s)??re({repo:{github:t.repoUrls?.[s.name]}}),d=e.find(h=>h.fullName.toLowerCase()===l?.toLowerCase())?.repoId??null,u=Pn(a.data.repo?.directory);if(!u.ok)throw new Error(`${s.name}: invalid repository directory`);let p=a.format==="links"?[]:(await Bn(s.content,s.name))?.findings??[];for(let h of p)h.id&&n.set(h.id,h);i.push({...s,repoId:d,directory:u.path??"",github:l,embedded:c,ids:[...new Set(p.map(h=>h.id).filter(Boolean))],uploaded:null})}let r=Object.create(null);if(t.triage!=null&&(typeof t.triage!="object"||Array.isArray(t.triage)))throw new Error("Invalid workspace triage.");for(let[s,a]of Object.entries(t.triage??{})){if(!n.has(s))continue;let c=Dn(a);if(!c)continue;let{ignoredReports:l,...d}=c;Object.keys(d).length!==0&&(r[s]=d)}let o=[];for(let s of t.bundleBlobs??[]){let a=Uint8Array.fromBase64(s.data),c=`sha512-${new Uint8Array(await crypto.subtle.digest("SHA-512",a)).toBase64()}`;if(c!==s.integrity)throw new Error(`${s.name}: bundle integrity mismatch`);o.push({name:s.name,integrity:c,bytes:a,uploaded:null})}return{name:t.workspace.name.slice(0,100),reports:i,bundles:o,triage:r,lookup:n,references:t.bundles??[],team:null,completed:new Set,importedIds:new Set}}function oo(t,e){let n=[],i=Object.create(null);for(let[r,o]of Object.entries(t)){let s=e[r];if(!s)throw new Error("The server did not return the requested triage snapshot.");let a=s.entry??{},c=i[r]={...a};delete c.comment;for(let[l,d]of Object.entries(o))if(l==="comment"){if(s.comments.some(u=>u.body===d))continue;s.comments.length>0?n.push({id:r,property:l,local:s.comments.map(u=>u.body).join(`
52
+ `),i={id:t.finding_url,file:e,line:"?",severity:(t.severity||"medium").toLowerCase(),description:n,repo:{github:t.repository}};return t.commit_hash&&(i.commitHash=t.commit_hash),t.detected_at&&(i.detectedAt=t.detected_at),t.committed_at&&(i.committedAt=t.committed_at),_(i)}var oo=[["deepview-md",Ln],["deepsec",hn],["piolium",Pn],["claude-security",Bn]];function gt(t){return Array.isArray(t?.findings)?t.findings:Array.isArray(t?.groups)?t.groups:null}function jn(t,e){return typeof e=="string"&&/\.csv$/iu.test(e)?"codex":Re(t).format}function Re(t){let e;try{let n=JSON.parse(t);if(gt(n)){for(let i of Vn(gt(n)))_(i);return{data:n,format:"json",reason:null}}return{data:null,format:null,reason:"JSON, but not a report: no findings array"}}catch(n){e=n}for(let[n,i]of oo){let r=i(t);if(r)return{data:r,format:n,reason:null}}return{data:null,format:null,reason:`Not JSON, and not a recognized markdown format. (JSON error: ${e.message})`}}function Vn(t){return t.flat().filter(e=>e&&typeof e=="object")}async function so(t){for(let i of t)_(i);let e=t.filter(i=>!i.id);if(e.length===0)return;let n=await Promise.all(e.map(un));e.forEach((i,r)=>{n[r]&&(i.id=n[r])})}async function Gn(t){let{data:e,format:n}=Re(t);if(!e)return null;let i=Vn(gt(e));return await so(i),{format:n,data:e,findings:i}}function yt(t,e){let n=t.trimStart().startsWith("[")?rn(t):null;if(n)return{data:{source:"links",findings:[],links:n.groups},format:"links",reason:null};let i=Re(t);if(i.data!=null||jn(t,e)!=="codex")return i;try{return{data:{type:"security",source:"codex-security",findings:mt(t).flatMap(o=>o.data.findings)},format:"codex",reason:null}}catch(r){return{data:null,format:null,reason:r instanceof Error?r.message:"Invalid Codex CSV"}}}function Wn(t,e){let n=yt(t,e);return n.data==null?Promise.resolve(null):Gn(JSON.stringify(n.data))}function Kn(t){return t==="inprogress"||t==="fixed"||t==="invalid"||t==="deleted"?t:void 0}function ao(t){if(t)return Kn(t.triage)??(t.deleted?"deleted":void 0)}function co(t){return t?!t.color&&!ao(t)&&!t.comment&&!t.fix&&!(t.ignoredReports&&t.ignoredReports.length>0)&&t.flagged===void 0:!0}function Le(t){if(!t||typeof t!="object")return;let e=t,n={};typeof e.color=="string"&&e.color&&(n.color=e.color);let i=Kn(e.triage)??(e.deleted?"deleted":void 0);if(i&&(n.triage=i),typeof e.comment=="string"&&e.comment&&(n.comment=e.comment),typeof e.fix=="string"&&e.fix&&(n.fix=e.fix),typeof e.flagged=="boolean"&&(n.flagged=e.flagged),Array.isArray(e.ignoredReports)){let r=e.ignoredReports.filter(o=>typeof o=="string"&&o.length>0);r.length>0&&(n.ignoredReports=r)}return co(n)?void 0:n}var lo=["inprogress","fixed","invalid","deleted"];function uo(t){return typeof t=="string"&&lo.includes(t)}function Me(t){if(t===null)return null;if(typeof t!="object"||Array.isArray(t))return"invalid";let e=t,n={},i=e.color;if(i!=null){if(typeof i!="string"||i.length>50)return"invalid";i!==""&&(n.color=i)}let r=e.triage;if(r!=null){if(!uo(r))return"invalid";n.triage=r}for(let s of["comment","fix"]){let a=e[s];if(a!=null){if(typeof a!="string"||a.length>1e4)return"invalid";a!==""&&(n[s]=a)}}let o=e.flagged;if(o!=null){if(typeof o!="boolean")return"invalid";n.flagged=o}return n}async function qn(t,{session:e,...n}){if(e?.role!=="admin"||!e.csrfToken)throw new Error("An administrator session is required.");if(t!=null&&(typeof t!="object"||Array.isArray(t)))throw new Error("Invalid local triage.");let i=Object.create(null);for(let[r,o]of Object.entries(t??{})){let{ignoredReports:s,...a}=Le(o)??{};if(Object.keys(a).length!==0){if(!r||r.length>100)throw new Error(`Triage finding IDs must be between 1 and ${100} characters.`);if(Me(a)==="invalid")throw new Error(`Triage for ${r} exceeds the managed server limits.`);i[r]=a}}return await bt(i,{...n,path:"/api/admin/import-triage"}),Object.keys(i).length}function fo(t,e){let n=[],i=Object.create(null);for(let[r,o]of Object.entries(t)){let s=e[r];if(!s)throw new Error("The server did not return the requested triage snapshot.");let a=s.entry??{},c=i[r]={...a};delete c.comment;for(let[l,d]of Object.entries(o))if(l==="comment"){if(s.comments.some(u=>u.body===d))continue;s.comments.length>0?n.push({id:r,property:l,local:s.comments.map(u=>u.body).join(`
53
53
 
54
- `),imported:d}):c.comment=d}else if(a[l]!==void 0&&a[l]!==d){let u=p=>l==="flagged"?p?"flagged":"not flagged":p;n.push({id:r,property:l,local:u(a[l]),imported:u(d)})}else c[l]=d}return{entries:i,conflicts:n}}function ut(t,e,n){async function i(r,o,s={}){n?.throwIfAborted();let a=await t(r,{credentials:"same-origin",signal:n,...o===void 0?{}:{method:"POST",body:o instanceof File?o:JSON.stringify(o)},headers:{...o instanceof File?{}:{"content-type":"application/json"},"x-csrf-token":e.csrfToken,...s}});if(n?.throwIfAborted(),a.status===409)return{conflict:!0};if(!a.ok)throw new Error(`Import request failed (HTTP ${a.status}). You can retry the remaining steps.`);let c=await a.json();return n?.throwIfAborted(),c}return{send:i}}async function so(t,e,n,i,r){r?.throwIfAborted();let{entries:o,conflicts:s}=oo(t,e);if(s.length===0)return o;let a=await i(s,n,{title:"Triage conflicts on import",intro:"disagree with stored triage on",trailingNote:"Imported comments are added alongside existing comments. Other choices apply to these finding IDs across all teams.",importedSideLabel:"Apply imported"});if(r?.throwIfAborted(),!a)throw new Error("Triage conflict resolution was cancelled.");for(let c of s){let l=a[`${c.id}:${c.property}`];if(!["local","imported"].includes(l))throw new Error("Resolve every triage conflict before importing.");l==="imported"&&(o[c.id][c.property]=t[c.id][c.property])}return o}function ao(t,e){let n=[],i={entries:{},expected:{}};for(let[r,o]of Object.entries(t)){let s={entries:{...i.entries,[r]:o},expected:{...i.expected,[r]:e[r].version}};if(new TextEncoder().encode(JSON.stringify(s)).length<=262144){i=s;continue}if(Object.keys(i.entries).length===0)throw new Error("This triage entry is too large to import.");n.push(i),i={entries:{[r]:o},expected:{[r]:e[r].version}}}return Object.keys(i.entries).length>0&&n.push(i),n}async function co(t,e,{api:n,resolveConflicts:i,signal:r}){let o=e.ids.filter(a=>Object.hasOwn(t.triage,a)&&!t.importedIds.has(a)),s=`/api/admin/reports/${encodeURIComponent(e.uploaded.id)}/import-triage`;for(let a=0;a<o.length;a+=200){let c=o.slice(a,a+200);for(let l=0;l<5&&c.length>0;l++){r?.throwIfAborted();let{snapshots:d}=await n.send(s,{findingIds:c}),u=Object.fromEntries(c.map(h=>[h,t.triage[h]])),p=await so(u,d,t.lookup,i,r);for(let h of ao(p,d)){if(r?.throwIfAborted(),(await n.send(s,h)).conflict)break;Object.keys(h.entries).forEach(f=>t.importedIds.add(f))}c=c.filter(h=>!t.importedIds.has(h))}if(c.length>0)throw new Error("Stored triage keeps changing. Retry to resolve it against the latest values.")}}async function lo(t,e,n,i,r,o){if(t.bundles.length===0&&t.references.length===0)return;let s=r??(await n.send("/api/admin/bundles")).bundles,a=new Set(t.bundles.map(l=>l.uploaded.id));if([...a].some(l=>!s.some(d=>d.id===l)))throw new Error("Could not verify the uploaded source bundles. Retry the import.");let c=new Set(t.references);for(let l of s){if(!a.has(l.id)&&!c.has(l.integrity))continue;let d=!o.has(l.repoId),u=d?e:l.repoId;d&&await i(`bundle-repo:${l.id}:${u}`,()=>n.send("/api/admin/bundles/set-repo",{bundleId:l.id,repoId:u}));let p=d?"":l.repoDirectory??"";await i(`repo:${u}:${p}`,()=>n.send("/api/admin/teams/set-repo",{teamId:t.team.id,repoId:u,path:p}))}}async function Gn(t,{api:e,session:n,defaultRepo:i,includeTriage:r,resolveConflicts:o,signal:s,progress:a=()=>{}}){if(n?.role!=="admin"||!n.csrfToken)throw new Error("An administrator session is required.");if(!t.name.trim()||t.name.trim().length>100)throw new Error("Enter a team name of up to 100 characters.");if(r)for(let[p,h]of Object.entries(t.triage)){if(!p||p.length>100)throw new Error(`Triage finding IDs must be between 1 and ${100} characters. Choose Skip triage to import the files without it.`);if(Hn(h)==="invalid")throw new Error(`Triage for ${p} exceeds the managed server limits. Choose Skip triage to import the files without it.`)}s?.throwIfAborted();let c=null;if(t.bundles.length===0){let p=new Set(t.references);c=p.size>0?(await e.send("/api/admin/bundles")).bundles.filter(h=>p.has(h.integrity)):[]}if(t.reports.length===0&&t.bundles.length===0&&c.length===0)throw new Error(t.references.length>0?"None of the referenced source bundles are available on the server. Export with bundle bytes included and try again.":"This workspace contains no report or bundle files.");let l=new Set((await e.send("/api/admin/repositories/browsable")).repos.map(p=>p.repoId));for(let p of t.reports){if(p.embedded&&!l.has(p.repoId))throw new Error(`Connect ${p.embedded} in Repositories before importing ${p.name}.`);if(!l.has(p.repoId)&&!l.has(i))throw new Error(`Choose an active repository for ${p.name}.`)}if((t.bundles.length>0||c.some(p=>!l.has(p.repoId)))&&!l.has(i))throw new Error("Choose an active repository for the source bundles.");let d=()=>s?.throwIfAborted(),u=async(p,h)=>{d(),t.completed.has(p)||(await h(),t.completed.add(p))};if(d(),!t.team){let p=await e.send("/api/admin/teams",{name:t.name.trim()});if(p.conflict)throw new Error("A team already has this name. Choose another name.");t.team=p}await u("member",()=>e.send("/api/admin/teams/set-member",{teamId:t.team.id,userId:n.id,security:!0,dependencies:!0}));for(let p of t.bundles)d(),a(`Importing ${p.name}\u2026`),p.uploaded||(p.uploaded=await e.send("/api/admin/bundles",new File([p.bytes],p.name),{"x-bundle-filename":encodeURIComponent(p.name),"x-repo-id":String(i)}));await lo(t,i,e,u,c,l);for(let p of t.reports){d(),a(`Importing ${p.name}\u2026`);let h=l.has(p.repoId)?p.repoId:i;if(!p.uploaded){let b=await e.send("/api/admin/reports",new File([p.content],p.name),{"x-report-filename":encodeURIComponent(p.name),"x-repo-id":String(h),"x-repo-directory":encodeURIComponent(p.directory)});if(b.conflict)throw new Error(`Could not reuse the stored report ${p.name}. Retry the import.`);p.uploaded=b}let f=p.uploaded;l.has(f.repoId)||await u(`report-repo:${f.id}:${h}:${p.directory}`,async()=>{if((await e.send("/api/admin/reports/set-repo",{reportId:f.id,repoId:h,directory:p.directory})).conflict)throw new Error(`Could not assign the stored report ${p.name} to its repository.`);f.repoId=h,f.repoDirectory=p.directory});let g=f.repoDirectory??"";await u(`repo:${f.repoId}:${g}`,()=>e.send("/api/admin/teams/set-repo",{teamId:t.team.id,repoId:f.repoId,path:g})),r&&await co(t,p,{api:e,resolveConflicts:o,signal:s}),await u(`publish:${p.uploaded.id}`,()=>e.send("/api/admin/reports/set-visible",{reportId:p.uploaded.id,visible:!0}))}return t.team}function Ce(t){let e=()=>t.isEncryptionEnabled()&&!t.isUnlocked();async function n(){let r=JSON.parse(await t.hydrateKey("deepview.workspaces")||"[]");return(Array.isArray(r)?r:r.workspaces??[]).filter(o=>typeof o.id=="string"&&typeof o.name=="string")}async function i(r,o){let s=!1,a=[t.onVaultStateChange,t.onFileMutated,t.onBundleMutated].map(l=>l(()=>{s=!0})),c=()=>{if(o?.throwIfAborted(),e()||s)throw new Error("Local data was locked or changed. Unlock it and select the workspace again.")};try{c();let l=await r(c);return c(),l}finally{a.forEach(l=>l())}}return{get locked(){return e()},unlock:r=>t.unlockEncryption(r),list:({signal:r}={})=>i(async()=>(await n()).map(o=>({id:o.id,name:o.name})),r),read:(r,{signal:o}={})=>i(async s=>{let a=(await n()).find(f=>f.id===r);if(!a)throw new Error("This local workspace no longer exists.");let c=JSON.stringify(a),l=JSON.parse(await t.hydrateKey("deepview.repoUrls")||"{}"),d=[];for(let f of a.reports??[]){s();let g=await t.withStoredItem("report",f,()=>t.readFile(f));s(),d.push({name:f,content:g,...l[f]?{repo:{github:l[f]}}:{}})}let u=await t.listBundles(),p=[];for(let f of a.bundles??[]){s();let g=u.find(_=>_.integrity===f);if(!g)continue;let b=await t.withStoredItem("bundle",f,()=>t.readBundle(f));s(),p.push({integrity:f,name:g.name,data:b.toBase64()})}let h=await t.readTriageBlob()??{};if(JSON.stringify((await n()).find(f=>f.id===r))!==c)throw new Error("The local workspace changed. Select it again.");return{version:1,workspace:{id:r,name:a.name,privateKey:""},reports:d,bundles:a.bundles??[],bundleBlobs:p,triage:h,repoUrls:l}},o)}}function uo(t,e){if(customElements.get("managed-admin-import"))return;class n extends t{static styles=[V(Ot),V(Nt)];static properties={localDeps:{attribute:!1},_busy:{state:!0},_error:{state:!0},_message:{state:!0},_plan:{state:!0},_catalog:{state:!0},_localOpen:{state:!0},_workspaces:{state:!0},_localId:{state:!0},_triage:{state:!0},_repo:{state:!0},_drag:{state:!0}};constructor(){super(),this._busy=!1,this._error="",this._message="",this._plan=null,this._catalog=null,this._workspaces=[],this._localOpen=!1,this._localId="",this._triage="",this._repo=null,this._files=[],this._drag=!1,this._local=!1,this._over=r=>{r.dataTransfer?.types?.includes("Files")&&(r.preventDefault(),this._drag=!0)},this._drop=r=>{r.dataTransfer?.types?.includes("Files")&&(r.preventDefault(),r.stopPropagation(),this._drag=!1,this._busy||(this._files.push(...r.dataTransfer.files),this._nextFile()))},this._localChanged=()=>{this._workspaces=[],this._localId="",this._local&&!this._unlocking&&(this._operation?.abort(),this._plan=null,this._message="",this._error="Local data changed or was locked. Choose the workspace again.")},this._blur=()=>{this._readingLocal&&this._localChanged()}}connectedCallback(){super.connectedCallback(),this.addEventListener("dragover",this._over),this.addEventListener("drop",this._drop),globalThis.addEventListener("blur",this._blur),globalThis.addEventListener("storage",this._localChanged),this._offVault=this.localDeps?.onVaultStateChange(this._localChanged),this._loadCatalog()}disconnectedCallback(){this._operation?.abort(),this._offVault?.(),this._plan=null,this._files=[],this.removeEventListener("dragover",this._over),this.removeEventListener("drop",this._drop),globalThis.removeEventListener("blur",this._blur),globalThis.removeEventListener("storage",this._localChanged),super.disconnectedCallback()}updated(r){r.has("session")&&(this._role!=="admin"||r.get("session")?.id!==this.session?.id)&&(this._operation?.abort(),this._plan=null,this._files=[])}async _action(r){if(this._busy||this._role!=="admin")return;let o=this._operation=new AbortController,s=AbortSignal.any([o.signal,this.appState.sessionController.signal]);this._busy=!0,this._error="";try{await r(s),s.throwIfAborted()}catch(a){s.aborted||(this._error=String(a?.message??a))}finally{this._operation===o&&(this._busy=!1)}}async _loadCatalog(){if(this._role==="admin")try{await this._loadCollection("workspace-import:catalog","import options",async r=>{let o=ut(e,this.session,r),[s,a,c]=await Promise.all([o.send("/api/admin/reports"),o.send("/api/admin/teams"),o.send("/api/admin/bundles")]);return{repos:s.repos,teams:a.teams,bundles:c.bundles}},r=>{this._catalog=r})}catch(r){this._error=String(r?.message??r)}}_browse(){let r=document.createElement("input");r.type="file",r.multiple=!0,r.accept=".enc,.gz,.json",r.addEventListener("change",()=>{this._files.push(...r.files),this._nextFile()},{once:!0}),r.click()}async _prepare(r,o){if(!r)return;if(this._catalog||await this._loadCatalog(),o.throwIfAborted(),!this._catalog)throw new Error("Could not load repositories. Try again.");let s=await Vn(r,this._catalog.repos);o.throwIfAborted();let a=new Set(this._catalog.teams.map(u=>u.name)),c=s.name||"Imported workspace",l=2;for(;a.has(s.name);){let u=` (${l++})`;s.name=c.slice(0,100-u.length)+u}let d=new Set(s.reports.map(u=>u.repoId).filter(u=>u!=null));this._repo=d.size===1?[...d][0]:null,this._triage=Object.keys(s.triage).length>0?"":"skip",this._plan=s,this._message=""}async _nextFile(){if(this._files.length===0||this._busy)return;let r=this._files.shift();this._local=!1,this._plan=null,await this._action(async o=>{let s=await jn(r,this.promptPassword);o.throwIfAborted(),await this._prepare(s,o)})}async _unlock(r,o){this._unlocking=!0;try{return!r.locked||await r.unlock({signal:o})}finally{this._unlocking=!1}}async _chooseLocal(){this._localOpen=!0,await this._action(async r=>{let o=Ce(this.localDeps);await this._unlock(o,r)&&(r.throwIfAborted(),this._workspaces=await o.list({signal:r}))})}async _readLocal(){if(!this._localId)return;let r=this._localId;this._local=!0,this._plan=null,await this._action(async o=>{let s=Ce(this.localDeps);if(await this._unlock(s,o)){this._readingLocal=!0;try{await this._prepare(await s.read(r,{signal:o}),o)}finally{this._readingLocal=!1}}})}async _import(){!this._plan||!this._triage||!this._csrf||(await this._action(async r=>{if(this._local&&Ce(this.localDeps).locked)throw new Error("Unlock local data and choose the workspace again.");let o=this._plan,s=["teams","reports","bundles","history","workspace-import","scan-sources","repo-impact"];try{let a=await this.appState.mutate(()=>Gn(o,{api:ut(e,this.session,r),session:this.session,defaultRepo:this._repo,includeTriage:this._triage==="include",resolveConflicts:this.resolveConflicts,signal:r,progress:c=>{this._message=c}}),s);this._catalog.teams.push(a),this._message=`Imported into ${a.name}.`,this._plan=null}finally{this.appState.invalidate(s),o.team&&this.dispatchEvent(new CustomEvent("managed-import-complete",{bubbles:!0,composed:!0}))}}),!this._plan&&!this._error&&await this._nextFile())}render(){if(this._role!=="admin")return m;let r=this._plan,o=r?Object.keys(r.triage).length:0,s=new Set([...r?.references??[],...r?.bundles.map(l=>l.integrity)??[]]),a=(this._catalog?.bundles??[]).filter(l=>s.has(l.integrity)),c=r?.references.filter(l=>!r.bundles.some(d=>d.integrity===l)).length??0;return w`<div class="wrap" @dragleave="${()=>{this._drag=!1}}">${Mt("manage-import",this._role,this.allowShare)}<h1>Import workspace</h1><p class="intro">Create a new team from a workspace export or a workspace stored in this browser.</p><section class="${`workspace-drop ${this._drag?"dragging":""}`}" aria-label="Workspace files"><strong>Drop workspace files here</strong><span>Encrypted exports, JSON, or compressed JSON. Encrypted files prompt for a password.</span><div class="actions"><button type="button" class="btn" ?disabled="${this._busy||!this._catalog}" @click="${()=>this._browse()}">Choose files</button> <button type="button" class="btn" ?disabled="${this._busy}" @click="${()=>this._chooseLocal()}">Choose local workspace</button></div></section>${this._localOpen?w`<section class="local-choice"><label for="local-workspace">Local workspace</label> <select id="local-workspace" .value="${this._localId}" ?disabled="${this._busy}" @change="${l=>{this._localId=l.target.value}}"><option value="">Choose a workspace…</option>${this._workspaces.map(l=>w`<option value="${l.id}">${l.name}</option>`)}</select> <button type="button" class="btn" ?disabled="${this._busy||!this._localId}" @click="${()=>this._readLocal()}">Select workspace</button> ${!this._busy&&this._workspaces.length===0?w`<p>No unlocked local workspaces. Choose local workspace to unlock or refresh.</p>`:m}</section>`:m} ${r?w`<section class="import-preview" aria-label="Import options">${r.team?w`<p>Team ${r.team.name} has been created. Retry continues its remaining import steps.</p>`:m} <label for="import-team">New team name</label><input id="import-team" maxlength="100" .value="${r.name}" ?disabled="${this._busy||!!r.team}" @input="${l=>{r.name=l.target.value,this.requestUpdate()}}"><p>${r.reports.length} reports / links · ${s.size} source bundles · ${o} triaged findings</p><label for="import-repo">Repository for files and source bundles without an active repository</label> <select id="import-repo" .value="${String(this._repo??"")}" ?disabled="${this._busy||!!r.team}" @change="${l=>{this._repo=l.target.value?Number(l.target.value):null}}"><option value="" ?selected="${this._repo==null}">Choose a repository…</option>${(this._catalog?.repos??[]).map(l=>w`<option value="${String(l.repoId)}" ?selected="${this._repo===l.repoId}">${l.fullName}</option>`)}</select><p>Declared report repositories and directories are preserved. Stored reports without an active repository use the selected repository. The new team receives those repository paths; other published reports in the same paths are also visible to that team.</p><ul>${r.reports.map(l=>w`<li>${l.name}<span>${l.github??"Uses selected repository"}${l.embedded&&l.repoId==null?" \u2014 connect this repository first":""}</span></li>`)}</ul>${a.length>0?w`<p>Existing source bundles in active repositories keep their locations. The new team also receives access to those directories. Unassigned bundles and bundles in inactive repositories use the selected repository.</p><ul>${a.map(l=>w`<li>${l.filename}<span>${l.repoFullName?`${l.repoFullName}${l.repoDirectory?`/${l.repoDirectory}`:""}`:"Uses selected repository"}</span></li>`)}</ul>`:m} ${c?w`<p>${c} referenced source bundles have no bytes in this export. Reports can use matching bundles already on the server.</p>`:m} ${o?w`<fieldset ?disabled="${this._busy||!!r.team}"><legend>Import triage?</legend><label><input type="radio" name="import-triage" value="include" ?checked="${this._triage==="include"}" @change="${()=>{this._triage="include"}}"> Include triage and comments</label> <label><input type="radio" name="import-triage" value="skip" ?checked="${this._triage==="skip"}" @change="${()=>{this._triage="skip"}}"> Skip triage</label><p>Conflicting values prompt for resolution. Triage stays shared by finding ID across teams. Per-report local ignores are not imported.</p></fieldset>`:m} <button type="button" class="btn primary" ?disabled="${this._busy||!this._triage||!this._csrf}" @click="${()=>this._import()}">${this._busy?"Importing\u2026":r.team?"Retry remaining import":"Import workspace"}</button></section>`:m} ${this._message?w`<p role="status">${this._message}</p>`:m} ${this._error?w`<p class="error" role="alert">${this._error}${this._catalog?m:w`<button class="btn" @click="${()=>this._loadCatalog()}">Retry</button>`}</p>`:m} ${this._files.length>0&&!this._busy?w`<button class="btn" @click="${()=>this._nextFile()}">Next workspace file (${this._files.length} waiting)</button>`:m}</div>`}}customElements.define("managed-admin-import",n)}export{uo as registerWorkspaceImport};
54
+ `),imported:d}):c.comment=d}else if(a[l]!==void 0&&a[l]!==d){let u=p=>l==="flagged"?p?"flagged":"not flagged":p;n.push({id:r,property:l,local:u(a[l]),imported:u(d)})}else c[l]=d}return{entries:i,conflicts:n}}async function ho(t,e,n,i,r){r?.throwIfAborted();let{entries:o,conflicts:s}=fo(t,e);if(s.length===0)return o;let a=await i(s,n,{title:"Triage conflicts on import",intro:"disagree with stored triage on",trailingNote:"Imported comments are added alongside existing comments. Other choices apply to these finding IDs across all teams.",importedSideLabel:"Apply imported"});if(r?.throwIfAborted(),!a)throw new Error("Triage conflict resolution was cancelled.");for(let c of s){let l=a[`${c.id}:${c.property}`];if(!["local","imported"].includes(l))throw new Error("Resolve every triage conflict before importing.");l==="imported"&&(o[c.id][c.property]=t[c.id][c.property])}return o}function mo(t,e){let n=[],i={entries:{},expected:{}};for(let[r,o]of Object.entries(t)){let s={entries:{...i.entries,[r]:o},expected:{...i.expected,[r]:e[r].version}};if(new TextEncoder().encode(JSON.stringify(s)).length<=262144){i=s;continue}if(Object.keys(i.entries).length===0)throw new Error("This triage entry is too large to import.");n.push(i),i={entries:{[r]:o},expected:{[r]:e[r].version}}}return Object.keys(i.entries).length>0&&n.push(i),n}async function bt(t,{api:e,path:n,ids:i=Object.keys(t),importedIds:r=new Set,lookup:o=new Map,resolveConflicts:s,signal:a}){i=i.filter(c=>Object.hasOwn(t,c)&&!r.has(c));for(let c=0;c<i.length;c+=200){let l=i.slice(c,c+200);for(let d=0;d<5&&l.length>0;d++){a?.throwIfAborted();let{snapshots:u}=await e.send(n,{findingIds:l}),p=Object.fromEntries(l.map(f=>[f,t[f]])),h=await ho(p,u,o,s,a);for(let f of mo(h,u)){if(a?.throwIfAborted(),(await e.send(n,f)).conflict)break;Object.keys(f.entries).forEach(g=>r.add(g))}l=l.filter(f=>!r.has(f))}if(l.length>0)throw new Error("Stored triage keeps changing. Retry to resolve it against the latest values.")}}function Jn(t){if(typeof t!="string")return{ok:!0,path:null};if(/\p{Cc}/u.test(t)||t.includes("\\")||t!==t.trim())return{ok:!1};let e=[];for(let i of t.split("/"))if(!(i===""||i===".")){if(i===".."||i!==i.trim())return{ok:!1};e.push(i)}let n=e.join("/");return n.length>500?{ok:!1}:{ok:!0,path:n===""?null:n}}async function Yn(t,e){let n=new Uint8Array(await t.arrayBuffer());return be(n)?e({tryPassword:i=>Je(n,i)}):n[0]===31&&n[1]===139?Je(n):_e(new TextDecoder("utf-8",{fatal:!0}).decode(n))}async function Zn(t,e){let n=new Map,i=[];for(let s of t.reports){if(typeof s?.name!="string"||!s.name||typeof s.content!="string")throw new Error("Every report must have a name and content.");let a=yt(s.content,s.name);if(!a.data)throw new Error(`${s.name}: ${a.reason??"Unsupported report"}`);let c=ie(a.data),l=c??ie(s)??ie({repo:{github:t.repoUrls?.[s.name]}}),d=e.find(h=>h.fullName.toLowerCase()===l?.toLowerCase())?.repoId??null,u=Jn(a.data.repo?.directory);if(!u.ok)throw new Error(`${s.name}: invalid repository directory`);let p=a.format==="links"?[]:(await Wn(s.content,s.name))?.findings??[];for(let h of p)h.id&&n.set(h.id,h);i.push({...s,repoId:d,directory:u.path??"",github:l,embedded:c,ids:[...new Set(p.map(h=>h.id).filter(Boolean))],uploaded:null})}let r=Object.create(null);if(t.triage!=null&&(typeof t.triage!="object"||Array.isArray(t.triage)))throw new Error("Invalid workspace triage.");for(let[s,a]of Object.entries(t.triage??{})){if(!n.has(s))continue;let c=Le(a);if(!c)continue;let{ignoredReports:l,...d}=c;Object.keys(d).length!==0&&(r[s]=d)}let o=[];for(let s of t.bundleBlobs??[]){let a=Uint8Array.fromBase64(s.data),c=`sha512-${new Uint8Array(await crypto.subtle.digest("SHA-512",a)).toBase64()}`;if(c!==s.integrity)throw new Error(`${s.name}: bundle integrity mismatch`);o.push({name:s.name,integrity:c,bytes:a,uploaded:null})}return{name:t.workspace.name.slice(0,100),reports:i,bundles:o,triage:r,lookup:n,references:t.bundles??[],team:null,completed:new Set,importedIds:new Set}}function Oe(t,e,n){async function i(r,o,s={}){n?.throwIfAborted();let a=await t(r,{credentials:"same-origin",signal:n,...o===void 0?{}:{method:"POST",body:o instanceof File?o:JSON.stringify(o)},headers:{...o instanceof File?{}:{"content-type":"application/json"},"x-csrf-token":e.csrfToken,...s}});if(n?.throwIfAborted(),a.status===409)return{conflict:!0};if(!a.ok)throw new Error(`Import request failed (HTTP ${a.status}). You can retry the remaining steps.`);let c=await a.json();return n?.throwIfAborted(),c}return{send:i}}async function go(t,e,n,i,r,o){if(t.bundles.length===0&&t.references.length===0)return;let s=r??(await n.send("/api/admin/bundles")).bundles,a=new Set(t.bundles.map(l=>l.uploaded.id));if([...a].some(l=>!s.some(d=>d.id===l)))throw new Error("Could not verify the uploaded source bundles. Retry the import.");let c=new Set(t.references);for(let l of s){if(!a.has(l.id)&&!c.has(l.integrity))continue;let d=!o.has(l.repoId),u=d?e:l.repoId;d&&await i(`bundle-repo:${l.id}:${u}`,()=>n.send("/api/admin/bundles/set-repo",{bundleId:l.id,repoId:u}));let p=d?"":l.repoDirectory??"";await i(`repo:${u}:${p}`,()=>n.send("/api/admin/teams/set-repo",{teamId:t.team.id,repoId:u,path:p}))}}async function Qn(t,{api:e,session:n,defaultRepo:i,includeTriage:r,resolveConflicts:o,signal:s,progress:a=()=>{}}){if(n?.role!=="admin"||!n.csrfToken)throw new Error("An administrator session is required.");if(!t.name.trim()||t.name.trim().length>100)throw new Error("Enter a team name of up to 100 characters.");if(r)for(let[p,h]of Object.entries(t.triage)){if(!p||p.length>100)throw new Error(`Triage finding IDs must be between 1 and ${100} characters. Choose Skip triage to import the files without it.`);if(Me(h)==="invalid")throw new Error(`Triage for ${p} exceeds the managed server limits. Choose Skip triage to import the files without it.`)}s?.throwIfAborted();let c=null;if(t.bundles.length===0){let p=new Set(t.references);c=p.size>0?(await e.send("/api/admin/bundles")).bundles.filter(h=>p.has(h.integrity)):[]}if(t.reports.length===0&&t.bundles.length===0&&c.length===0)throw new Error(t.references.length>0?"None of the referenced source bundles are available on the server. Export with bundle bytes included and try again.":"This workspace contains no report or bundle files.");let l=new Set((await e.send("/api/admin/repositories/browsable")).repos.map(p=>p.repoId));for(let p of t.reports){if(p.embedded&&!l.has(p.repoId))throw new Error(`Connect ${p.embedded} in Repositories before importing ${p.name}.`);if(!l.has(p.repoId)&&!l.has(i))throw new Error(`Choose an active repository for ${p.name}.`)}if((t.bundles.length>0||c.some(p=>!l.has(p.repoId)))&&!l.has(i))throw new Error("Choose an active repository for the source bundles.");let d=()=>s?.throwIfAborted(),u=async(p,h)=>{d(),t.completed.has(p)||(await h(),t.completed.add(p))};if(d(),!t.team){let p=await e.send("/api/admin/teams",{name:t.name.trim()});if(p.conflict)throw new Error("A team already has this name. Choose another name.");t.team=p}await u("member",()=>e.send("/api/admin/teams/set-member",{teamId:t.team.id,userId:n.id,security:!0,dependencies:!0}));for(let p of t.bundles)d(),a(`Importing ${p.name}\u2026`),p.uploaded||(p.uploaded=await e.send("/api/admin/bundles",new File([p.bytes],p.name),{"x-bundle-filename":encodeURIComponent(p.name),"x-repo-id":String(i)}));await go(t,i,e,u,c,l);for(let p of t.reports){d(),a(`Importing ${p.name}\u2026`);let h=l.has(p.repoId)?p.repoId:i;if(!p.uploaded){let y=await e.send("/api/admin/reports",new File([p.content],p.name),{"x-report-filename":encodeURIComponent(p.name),"x-repo-id":String(h),"x-repo-directory":encodeURIComponent(p.directory)});if(y.conflict)throw new Error(`Could not reuse the stored report ${p.name}. Retry the import.`);p.uploaded=y}let f=p.uploaded;l.has(f.repoId)||await u(`report-repo:${f.id}:${h}:${p.directory}`,async()=>{if((await e.send("/api/admin/reports/set-repo",{reportId:f.id,repoId:h,directory:p.directory})).conflict)throw new Error(`Could not assign the stored report ${p.name} to its repository.`);f.repoId=h,f.repoDirectory=p.directory});let g=f.repoDirectory??"";await u(`repo:${f.repoId}:${g}`,()=>e.send("/api/admin/teams/set-repo",{teamId:t.team.id,repoId:f.repoId,path:g})),r&&await bt(t.triage,{api:e,resolveConflicts:o,signal:s,ids:p.ids,importedIds:t.importedIds,lookup:t.lookup,path:`/api/admin/reports/${encodeURIComponent(p.uploaded.id)}/import-triage`}),await u(`publish:${p.uploaded.id}`,()=>e.send("/api/admin/reports/set-visible",{reportId:p.uploaded.id,visible:!0}))}return t.team}function er(t){let e=()=>t.isEncryptionEnabled()&&!t.isUnlocked();return{get locked(){return e()},unlock:n=>t.unlockEncryption(n),async read({signal:n}={}){let i=!1,r=t.onVaultStateChange(()=>{i=!0}),o=()=>{if(n?.throwIfAborted(),e()||i)throw new Error("Local data was locked or changed. Unlock it and import triage again.")};try{o();let s=await t.readTriageBlob();return o(),s}finally{r()}}}}function Ne(t){let e=()=>t.isEncryptionEnabled()&&!t.isUnlocked();async function n(){let r=JSON.parse(await t.hydrateKey("deepview.workspaces")||"[]");return(Array.isArray(r)?r:r.workspaces??[]).filter(o=>typeof o.id=="string"&&typeof o.name=="string")}async function i(r,o){let s=!1,a=[t.onVaultStateChange,t.onFileMutated,t.onBundleMutated].map(l=>l(()=>{s=!0})),c=()=>{if(o?.throwIfAborted(),e()||s)throw new Error("Local data was locked or changed. Unlock it and select the workspace again.")};try{c();let l=await r(c);return c(),l}finally{a.forEach(l=>l())}}return{get locked(){return e()},unlock:r=>t.unlockEncryption(r),list:({signal:r}={})=>i(async()=>(await n()).map(o=>({id:o.id,name:o.name})),r),read:(r,{signal:o}={})=>i(async s=>{let a=(await n()).find(f=>f.id===r);if(!a)throw new Error("This local workspace no longer exists.");let c=JSON.stringify(a),l=JSON.parse(await t.hydrateKey("deepview.repoUrls")||"{}"),d=[];for(let f of a.reports??[]){s();let g=await t.withStoredItem("report",f,()=>t.readFile(f));s(),d.push({name:f,content:g,...l[f]?{repo:{github:l[f]}}:{}})}let u=await t.listBundles(),p=[];for(let f of a.bundles??[]){s();let g=u.find(x=>x.integrity===f);if(!g)continue;let y=await t.withStoredItem("bundle",f,()=>t.readBundle(f));s(),p.push({integrity:f,name:g.name,data:y.toBase64()})}let h=await t.readTriageBlob()??{};if(JSON.stringify((await n()).find(f=>f.id===r))!==c)throw new Error("The local workspace changed. Select it again.");return{version:1,workspace:{id:r,name:a.name,privateKey:""},reports:d,bundles:a.bundles??[],bundleBlobs:p,triage:h,repoUrls:l}},o)}}function yo(t,e){if(customElements.get("managed-admin-import"))return;class n extends t{static styles=[G(jt),G(Vt)];static properties={localDeps:{attribute:!1},_busy:{state:!0},_error:{state:!0},_message:{state:!0},_plan:{state:!0},_catalog:{state:!0},_localOpen:{state:!0},_workspaces:{state:!0},_localId:{state:!0},_triage:{state:!0},_repo:{state:!0},_drag:{state:!0}};constructor(){super(),this._busy=!1,this._error="",this._message="",this._plan=null,this._catalog=null,this._workspaces=[],this._localOpen=!1,this._localId="",this._triage="",this._repo=null,this._files=[],this._drag=!1,this._local=!1,this._over=r=>{r.dataTransfer?.types?.includes("Files")&&(r.preventDefault(),this._drag=!0)},this._drop=r=>{r.dataTransfer?.types?.includes("Files")&&(r.preventDefault(),r.stopPropagation(),this._drag=!1,this._busy||(this._files.push(...r.dataTransfer.files),this._nextFile()))},this._localChanged=()=>{this._workspaces=[],this._localId="",!this._unlocking&&(this._local&&(this._plan=null),(this._local||this._importingTriage)&&(this._operation?.abort(),this._message="",this._error=this._importingTriage?"Local data changed or was locked. Import triage again to continue.":"Local data changed or was locked. Choose the workspace again."))},this._blur=()=>{this._readingLocal&&this._localChanged()}}connectedCallback(){super.connectedCallback(),this.addEventListener("dragover",this._over),this.addEventListener("drop",this._drop),globalThis.addEventListener("blur",this._blur),globalThis.addEventListener("storage",this._localChanged),this._offVault=this.localDeps?.onVaultStateChange(this._localChanged),this._loadCatalog()}disconnectedCallback(){this._operation?.abort(),this._offVault?.(),this._plan=null,this._files=[],this.removeEventListener("dragover",this._over),this.removeEventListener("drop",this._drop),globalThis.removeEventListener("blur",this._blur),globalThis.removeEventListener("storage",this._localChanged),super.disconnectedCallback()}updated(r){r.has("session")&&(this._role!=="admin"||r.get("session")?.id!==this.session?.id)&&(this._operation?.abort(),this._plan=null,this._files=[])}async _action(r){if(this._busy||this._role!=="admin")return;let o=this._operation=new AbortController,s=AbortSignal.any([o.signal,this.appState.sessionController.signal]);this._busy=!0,this._error="";try{await r(s),s.throwIfAborted()}catch(a){s.aborted||(this._error=String(a?.message??a))}finally{this._operation===o&&(this._busy=!1)}}async _loadCatalog(){if(this._role==="admin")try{await this._loadCollection("workspace-import:catalog","import options",async r=>{let o=Oe(e,this.session,r),[s,a,c]=await Promise.all([o.send("/api/admin/reports"),o.send("/api/admin/teams"),o.send("/api/admin/bundles")]);return{repos:s.repos,teams:a.teams,bundles:c.bundles}},r=>{this._catalog=r})}catch(r){this._error=String(r?.message??r)}}_browse(){let r=document.createElement("input");r.type="file",r.multiple=!0,r.accept=".enc,.gz,.json",r.addEventListener("change",()=>{this._files.push(...r.files),this._nextFile()},{once:!0}),r.click()}async _prepare(r,o){if(!r)return;if(this._catalog||await this._loadCatalog(),o.throwIfAborted(),!this._catalog)throw new Error("Could not load repositories. Try again.");let s=await Zn(r,this._catalog.repos);o.throwIfAborted();let a=new Set(this._catalog.teams.map(u=>u.name)),c=s.name||"Imported workspace",l=2;for(;a.has(s.name);){let u=` (${l++})`;s.name=c.slice(0,100-u.length)+u}let d=new Set(s.reports.map(u=>u.repoId).filter(u=>u!=null));this._repo=d.size===1?[...d][0]:null,this._triage=Object.keys(s.triage).length>0?"":"skip",this._plan=s,this._message=""}async _nextFile(){if(this._files.length===0||this._busy)return;let r=this._files.shift();this._local=!1,this._plan=null,await this._action(async o=>{let s=await Yn(r,this.promptPassword);o.throwIfAborted(),await this._prepare(s,o)})}async _unlock(r,o){this._unlocking=!0;try{return!r.locked||await r.unlock({signal:o})}finally{this._unlocking=!1}}async _chooseLocal(){this._localOpen=!0,await this._action(async r=>{let o=Ne(this.localDeps);await this._unlock(o,r)&&(r.throwIfAborted(),this._workspaces=await o.list({signal:r}))})}async _readLocal(){if(!this._localId)return;let r=this._localId;this._local=!0,this._plan=null,await this._action(async o=>{let s=Ne(this.localDeps);if(await this._unlock(s,o)){this._readingLocal=!0;try{await this._prepare(await s.read(r,{signal:o}),o)}finally{this._readingLocal=!1}}})}async _import(){!this._plan||!this._triage||!this._csrf||(await this._action(async r=>{if(this._local&&Ne(this.localDeps).locked)throw new Error("Unlock local data and choose the workspace again.");let o=this._plan,s=["teams","reports","bundles","history","workspace-import","scan-sources","repo-impact"];try{let a=await this.appState.mutate(()=>Qn(o,{api:Oe(e,this.session,r),session:this.session,defaultRepo:this._repo,includeTriage:this._triage==="include",resolveConflicts:this.resolveConflicts,signal:r,progress:c=>{this._message=c}}),s);this._catalog.teams.push(a),this._message=`Imported into ${a.name}.`,this._plan=null}finally{this.appState.invalidate(s),o.team&&this.dispatchEvent(new CustomEvent("managed-import-complete",{bubbles:!0,composed:!0}))}}),!this._plan&&!this._error&&await this._nextFile())}async _importLocalTriage(){this._csrf&&await this._action(async r=>{this._importingTriage=!0,this._message="";let o=new Set,s=["reports","history"];try{let a=er(this.localDeps);if(!await this._unlock(a,r))return;this._readingLocal=!0;let c;try{c=await a.read({signal:r})}finally{this._readingLocal=!1}let l=await qn(c,{api:Oe(e,this.session,r),session:this.session,resolveConflicts:this.resolveConflicts,signal:r,importedIds:o});r.throwIfAborted(),this._message=l?`Imported triage for ${l} finding${l===1?"":"s"}.`:"No local triage to import."}finally{this._importingTriage=!1,this.appState.invalidate(s),o.size>0&&this.dispatchEvent(new CustomEvent("managed-import-complete",{bubbles:!0,composed:!0}))}})}render(){if(this._role!=="admin")return m;let r=this._plan,o=r?Object.keys(r.triage).length:0,s=new Set([...r?.references??[],...r?.bundles.map(l=>l.integrity)??[]]),a=(this._catalog?.bundles??[]).filter(l=>s.has(l.integrity)),c=r?.references.filter(l=>!r.bundles.some(d=>d.integrity===l)).length??0;return b`<div class="wrap" @dragleave="${()=>{this._drag=!1}}">${zt("manage-import",this._role,this.allowShare)}<h1>Import</h1><section class="triage-import" aria-label="Local triage"><button type="button" class="btn" ?disabled="${this._busy||!this._csrf}" @click="${()=>this._importLocalTriage()}">Import triage</button><p>Import saved triage and comments from this browser by finding ID. Conflicting values prompt for resolution. Per-report ignores are skipped.</p></section><h2>Import workspace</h2><p class="intro">Create a new team from a workspace export or a workspace stored in this browser.</p><section class="${`workspace-drop ${this._drag?"dragging":""}`}" aria-label="Workspace files"><strong>Drop workspace files here</strong><span>Encrypted exports, JSON, or compressed JSON. Encrypted files prompt for a password.</span><div class="actions"><button type="button" class="btn" ?disabled="${this._busy||!this._catalog}" @click="${()=>this._browse()}">Choose files</button> <button type="button" class="btn" ?disabled="${this._busy}" @click="${()=>this._chooseLocal()}">Choose local workspace</button></div></section>${this._localOpen?b`<section class="local-choice"><label for="local-workspace">Local workspace</label> <select id="local-workspace" .value="${this._localId}" ?disabled="${this._busy}" @change="${l=>{this._localId=l.target.value}}"><option value="">Choose a workspace…</option>${this._workspaces.map(l=>b`<option value="${l.id}">${l.name}</option>`)}</select> <button type="button" class="btn" ?disabled="${this._busy||!this._localId}" @click="${()=>this._readLocal()}">Select workspace</button> ${!this._busy&&this._workspaces.length===0?b`<p>No unlocked local workspaces. Choose local workspace to unlock or refresh.</p>`:m}</section>`:m} ${r?b`<section class="import-preview" aria-label="Import options">${r.team?b`<p>Team ${r.team.name} has been created. Retry continues its remaining import steps.</p>`:m} <label for="import-team">New team name</label><input id="import-team" maxlength="100" .value="${r.name}" ?disabled="${this._busy||!!r.team}" @input="${l=>{r.name=l.target.value,this.requestUpdate()}}"><p>${r.reports.length} reports / links · ${s.size} source bundles · ${o} triaged findings</p><label for="import-repo">Repository for files and source bundles without an active repository</label> <select id="import-repo" .value="${String(this._repo??"")}" ?disabled="${this._busy||!!r.team}" @change="${l=>{this._repo=l.target.value?Number(l.target.value):null}}"><option value="" ?selected="${this._repo==null}">Choose a repository…</option>${(this._catalog?.repos??[]).map(l=>b`<option value="${String(l.repoId)}" ?selected="${this._repo===l.repoId}">${l.fullName}</option>`)}</select><p>Declared report repositories and directories are preserved. Stored reports without an active repository use the selected repository. The new team receives those repository paths; other published reports in the same paths are also visible to that team.</p><ul>${r.reports.map(l=>b`<li>${l.name}<span>${l.github??"Uses selected repository"}${l.embedded&&l.repoId==null?" \u2014 connect this repository first":""}</span></li>`)}</ul>${a.length>0?b`<p>Existing source bundles in active repositories keep their locations. The new team also receives access to those directories. Unassigned bundles and bundles in inactive repositories use the selected repository.</p><ul>${a.map(l=>b`<li>${l.filename}<span>${l.repoFullName?`${l.repoFullName}${l.repoDirectory?`/${l.repoDirectory}`:""}`:"Uses selected repository"}</span></li>`)}</ul>`:m} ${c?b`<p>${c} referenced source bundles have no bytes in this export. Reports can use matching bundles already on the server.</p>`:m} ${o?b`<fieldset ?disabled="${this._busy||!!r.team}"><legend>Import triage?</legend><label><input type="radio" name="import-triage" value="include" ?checked="${this._triage==="include"}" @change="${()=>{this._triage="include"}}"> Include triage and comments</label> <label><input type="radio" name="import-triage" value="skip" ?checked="${this._triage==="skip"}" @change="${()=>{this._triage="skip"}}"> Skip triage</label><p>Conflicting values prompt for resolution. Triage stays shared by finding ID across teams. Per-report local ignores are not imported.</p></fieldset>`:m} <button type="button" class="btn primary" ?disabled="${this._busy||!this._triage||!this._csrf}" @click="${()=>this._import()}">${this._busy?"Importing\u2026":r.team?"Retry remaining import":"Import workspace"}</button></section>`:m} ${this._message?b`<p role="status">${this._message}</p>`:m} ${this._error?b`<p class="error" role="alert">${this._error}${this._catalog?m:b`<button class="btn" @click="${()=>this._loadCatalog()}">Retry</button>`}</p>`:m} ${this._files.length>0&&!this._busy?b`<button class="btn" @click="${()=>this._nextFile()}">Next workspace file (${this._files.length} waiting)</button>`:m}</div>`}}customElements.define("managed-admin-import",n)}export{yo as registerWorkspaceImport};
55
55
  /*! Bundled license information:
56
56
 
57
57
  @lit/reactive-element/css-tag.js: