@preventive/triage 1.0.0-alpha.44 → 1.0.0-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/linked-findings.js +3 -0
- package/common/bundle-metadata.d.ts +1 -0
- package/common/bundle-metadata.js +1 -1
- package/common/bundle-sources.js +25 -2
- package/common/default-scan-models.ts +1 -1
- package/common/dependency-reviews.d.ts +0 -5
- package/common/dependency-reviews.js +0 -17
- package/common/line-diff.js +5 -4
- package/common/managed/agent-tasks.ts +292 -0
- package/common/managed/github-agents.ts +92 -0
- package/common/managed/github-logins.ts +49 -0
- package/common/managed/roles.ts +7 -0
- package/common/managed/routes.js +88 -7
- package/common/managed/team-app.d.ts +5 -2
- package/common/managed/team-app.js +2 -2
- package/common/server-info.ts +3 -0
- package/common/workspace-app.js +6 -3
- package/out/brotli-fallback.js +3 -3
- package/out/chunk-2XUEZHIP.js +18 -18
- package/out/chunk-2ZDZWLFY.js +1 -0
- package/out/chunk-3PS4KWD2.js +10 -0
- package/out/chunk-4HI2MSAV.js +17 -0
- package/out/chunk-4UFAMJAX.js +1 -0
- package/out/chunk-7C7DWL7I.js +1 -0
- package/out/chunk-7XRR4OFU.js +1 -0
- package/out/chunk-BC2UCLFJ.js +1 -0
- package/out/chunk-BOIXMUU5.js +3 -0
- package/out/chunk-C4Z6ZBXV.js +6 -6
- package/out/chunk-CC4OM6TZ.js +3 -0
- package/out/chunk-G24A42V6.js +2 -0
- package/out/chunk-GDPCLSOS.js +2 -0
- package/out/chunk-GO7FT4OD.js +1 -0
- package/out/chunk-I2MDGSQX.js +3 -0
- package/out/chunk-IYPY47MC.js +1 -0
- package/out/chunk-IZ7POWI3.js +18 -0
- package/out/chunk-JCIIBLKR.js +1 -1
- package/out/chunk-JKGQ3O7O.js +6 -0
- package/out/chunk-LE5ZWLG4.js +235 -0
- package/out/chunk-MSION3G4.js +36 -0
- package/out/chunk-NRPC74AM.js +1 -1
- package/out/chunk-OKRLLE5I.js +17 -0
- package/out/chunk-OOJM4CTU.js +1 -1
- package/out/chunk-PNHBZGDD.js +1 -1
- package/out/chunk-PXK7EU4V.js +1 -0
- package/out/chunk-QB4CBOX2.js +1 -0
- package/out/chunk-R3NZFXVR.js +1 -0
- package/out/chunk-R5O6FAW4.js +1 -1
- package/out/chunk-S6GIXWQW.js +52 -0
- package/out/chunk-SXV2T5C4.js +80 -0
- package/out/chunk-TUII34K2.js +1 -1
- package/out/chunk-V3KWNNMY.js +1 -0
- package/out/chunk-VFWMQ3LG.js +2 -0
- package/out/chunk-VH4XMZIW.js +2 -0
- package/out/chunk-WFYLMF6Z.js +10 -0
- package/out/chunk-WQ74ZBZF.js +7 -0
- package/out/client-managed-import.js +3 -3
- package/out/client-managed.js +31 -35
- package/out/client-sync.js +11 -11
- package/out/compare.js +35 -0
- package/out/dialogs.js +51 -0
- package/out/github-issue-authorized.html +1 -1
- package/out/github-issue-authorized.js +1 -1
- package/out/graph.js +17 -17
- package/out/index.html +30 -34
- package/out/prism.js +14 -14
- package/out/scan.js +2 -0
- package/out/terminal.js +294 -293
- package/out/view.css +1 -1
- package/out/view.js +16 -107
- package/package.json +53 -6
- package/risk/actions/findings.js +161 -0
- package/risk/actions/resolve.js +219 -0
- package/risk/actions/scripts/commands.js +182 -0
- package/risk/actions/scripts/grade.js +113 -0
- package/risk/actions/scripts/packages.js +123 -0
- package/risk/actions/scripts/shell.js +169 -0
- package/risk/actions/uses.js +76 -0
- package/risk/actions/workflow.js +110 -0
- package/risk/files/hosts.js +6 -6
- package/risk/files/readability.js +23 -17
- package/risk/files/runs-code.js +18 -6
- package/risk/files/script.js +7 -3
- package/risk/files/stamps.js +8 -7
- package/risk/index.d.ts +71 -1
- package/risk/index.js +6 -2
- package/risk/npm/assess.js +1 -1
- package/risk/npm/compare.js +34 -10
- package/risk/npm/files.js +413 -2
- package/risk/npm/tarball.js +56 -73
- package/server-e2e/app.ts +5 -4
- package/server-e2e/http.ts +5 -2
- package/server-managed/agent-merges.ts +198 -0
- package/server-managed/app-agents.ts +30 -0
- package/server-managed/avatar-store.ts +1 -0
- package/server-managed/bundle-cache.ts +7 -1
- package/server-managed/combined.ts +3 -2
- package/server-managed/commit-coauthors.ts +83 -0
- package/server-managed/commit-lockfiles.ts +72 -0
- package/server-managed/config.ts +6 -0
- package/server-managed/db-methods.ts +66 -19
- package/server-managed/db-neon.ts +89 -21
- package/server-managed/db-schema.ts +13 -2
- package/server-managed/db.ts +9 -1
- package/server-managed/dependabot-access.ts +60 -0
- package/server-managed/dependabot-alerts.ts +185 -0
- package/server-managed/dependency-review-comments.ts +97 -0
- package/server-managed/dependency-reviews.ts +78 -18
- package/server-managed/github-accounts.ts +33 -0
- package/server-managed/github-actions.ts +71 -0
- package/server-managed/github-app.ts +33 -13
- package/server-managed/github-errors.ts +2 -0
- package/server-managed/github-issue-links.ts +11 -5
- package/server-managed/github-link-oauth.ts +69 -0
- package/server-managed/github-links.ts +204 -0
- package/server-managed/github-oauth.ts +5 -2
- package/server-managed/github-pulls.ts +2 -2
- package/server-managed/github-requests.ts +39 -0
- package/server-managed/github-users.ts +30 -0
- package/server-managed/http-response.ts +10 -2
- package/server-managed/http.ts +1251 -97
- package/server-managed/index.ts +13 -8
- package/server-managed/kept-briefly.ts +37 -0
- package/server-managed/locked-packages.ts +37 -16
- package/server-managed/lockfile-scope.ts +49 -0
- package/server-managed/npm-delta-worker.js +23 -0
- package/server-managed/npm-delta.ts +178 -0
- package/server-managed/npm-insights.ts +20 -11
- package/server-managed/npm-kept.ts +83 -6
- package/server-managed/npm-loads.ts +114 -37
- package/server-managed/npm-packages.ts +110 -64
- package/server-managed/npm-risk.ts +4 -1
- package/server-managed/pretty-print.ts +67 -23
- package/server-managed/pull-comment-reviews.ts +161 -0
- package/server-managed/pull-dependencies.ts +300 -0
- package/server-managed/pull-dependency-reviews.ts +318 -0
- package/server-managed/pull-reviews.ts +205 -0
- package/server-managed/queue.ts +16 -0
- package/server-managed/release-commits.ts +84 -0
- package/server-managed/rename-diff.ts +22 -13
- package/server-managed/report-sources.ts +1 -1
- package/server-managed/report-store.ts +42 -9
- package/server-managed/repository-actions.ts +218 -0
- package/server-managed/repository-agents.ts +220 -0
- package/server-managed/repository-browser.ts +166 -37
- package/server-managed/repository-changes.ts +284 -0
- package/server-managed/repository-code.ts +52 -0
- package/server-managed/repository-dependency-reviews.ts +157 -0
- package/server-managed/repository-history.ts +461 -0
- package/server-managed/repository-issues.ts +181 -0
- package/server-managed/repository-pulse.ts +439 -0
- package/server-managed/repository-risk-audit.ts +13 -0
- package/server-managed/repository-risk-read.ts +170 -0
- package/server-managed/repository-risk.ts +133 -118
- package/server-managed/reviewed-dependencies.ts +149 -0
- package/server-managed/session.ts +27 -9
- package/server-managed/sql.ts +6 -3
- package/server-managed/storage-stores.ts +5 -0
- package/server-managed/storage.ts +4 -2
- package/server-managed/team-app.ts +19 -3
- package/server-managed/team-reports.ts +24 -12
- package/server-managed/upstream-cache.ts +12 -0
- package/server-managed/workspace-shares.ts +4 -1
- package/server.ts +25 -5
- package/out/chunk-2ABLKCOY.js +0 -46
- package/out/chunk-2KBF5TZ7.js +0 -2
- package/out/chunk-35VE6CDH.js +0 -2
- package/out/chunk-3BZ7JERB.js +0 -1
- package/out/chunk-4XCDFGDP.js +0 -10
- package/out/chunk-5LSXOLUS.js +0 -1
- package/out/chunk-5RCM2J63.js +0 -1
- package/out/chunk-7B6HB4D7.js +0 -1
- package/out/chunk-AJ4GTATZ.js +0 -3
- package/out/chunk-CH4UN6WK.js +0 -225
- package/out/chunk-CMQA4DM6.js +0 -1
- package/out/chunk-CVVJAXVY.js +0 -2
- package/out/chunk-DIJJNTRH.js +0 -10
- package/out/chunk-EDKLBQQN.js +0 -17
- package/out/chunk-F47DXCEV.js +0 -33
- package/out/chunk-FK3DZEKL.js +0 -1
- package/out/chunk-G6AJWENO.js +0 -1
- package/out/chunk-GJ4IUCNS.js +0 -1
- package/out/chunk-GNXOKIGP.js +0 -80
- package/out/chunk-GZ4MS3TE.js +0 -13
- package/out/chunk-GZWM7UQM.js +0 -2
- package/out/chunk-IU3CCINR.js +0 -3
- package/out/chunk-K3X5EJBQ.js +0 -2
- package/out/chunk-KEX2ATEW.js +0 -2
- package/out/chunk-KYCNJVB7.js +0 -1
- package/out/chunk-LPCTJYNA.js +0 -7
- package/out/chunk-O4RJY5TP.js +0 -2
- package/out/chunk-OD4LPN3H.js +0 -1
- package/out/chunk-QWDWTBM7.js +0 -1
- package/out/chunk-QYWKC557.js +0 -1
- package/out/chunk-R75XOKUP.js +0 -1
- package/out/chunk-SWTLADW5.js +0 -1
- package/out/chunk-T7OKH4VW.js +0 -1
- package/out/chunk-TZ5KB2Y5.js +0 -10
- package/out/chunk-UNTRGE26.js +0 -2
- package/out/chunk-UTR2LVME.js +0 -2
- package/out/chunk-UYAXVRVL.js +0 -1
- package/out/chunk-V3ME6FI5.js +0 -2
- package/out/chunk-V5O7M2YT.js +0 -1
- package/out/chunk-VIHGO77Y.js +0 -1
- package/out/chunk-W4J3MGLB.js +0 -1
- package/out/chunk-WGG7KQUH.js +0 -1
- package/out/chunk-XYFXXB2G.js +0 -10
- package/out/chunk-ZESLQCTF.js +0 -6
package/out/chunk-CMQA4DM6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as W}from"./chunk-3BZ7JERB.js";import{i as B}from"./chunk-2XUEZHIP.js";import{c as k,p as R,q as I,r as $}from"./chunk-V5O7M2YT.js";var X={commit:I},O=8;function nt(t){let n;try{n=t?JSON.parse(t):null}catch{return null}let e=s=>typeof s=="string"&&s?s:null;return n&&{tags:Array.isArray(n.tags)?n.tags.filter(e):[],details:typeof n.title=="string"?{title:n.title,authorName:e(n.authorName),authorLogin:e(n.authorLogin),date:Number.isSafeInteger(n.date)?n.date:null}:null}}function ot({title:t,authorName:n,authorLogin:e,date:s}){let d=document.createElement("div");d.className="tooltip-commit-details";let f=document.createElement("span");f.className="tooltip-commit-message",f.textContent=t;let p=document.createElement("span");p.className="tooltip-commit-meta";let u=n&&e&&n!==e?`${n} (@${e})`:n??(e&&`@${e}`);return p.textContent=[u,s===null?"":new Date(s).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})].filter(Boolean).join(" \xB7 "),d.append(...t?[f]:[],p),d}var c;function st(){return c||(c=document.createElement("div"),c.id="styled-tooltip",c.setAttribute("popover","manual"),document.body.append(c),c)}function at(t){typeof t.showPopover=="function"&&(t.matches(":popover-open")&&t.hidePopover(),t.showPopover())}var m=null,V="",E=null,h=null,q=0,z=0,j=!1;function w(){if(!j){j=!0,document.addEventListener("mousemove",t=>{q=t.clientX,z=t.clientY},{passive:!0});for(let t of["pointerdown","wheel","scroll"])document.addEventListener(t,()=>l(),{capture:!0,passive:!0});document.addEventListener("keydown",t=>{t.key==="Escape"&&l()}),window.addEventListener("blur",()=>l())}}var it=100,ct=14,lt=8,b=8;function rt(t,{placement:n="cursor"}={}){w(),clearTimeout(E),E=null,h=null,t.prepareTooltip?.(t),n=t.dataset.tooltipPlacement??n;let e=st(),s=t.dataset.tooltip??"",d=Object.hasOwn(X,t.dataset.tooltipIcon??"")?t.dataset.tooltipIcon:"",f=t.dataset.tooltipRepo??"",p=W(t.dataset.tooltipCommit),u=nt(t.dataset.tooltipCommitInfo),v=["stasis","sourcemap"].includes(t.dataset.tooltipBundle)?t.dataset.tooltipBundle:"",C=t.dataset.tooltipStats??"",L=t.dataset.tooltipBuilt==="true",x=t.dataset.tooltipPackage??"",F=t.dataset.tooltipEcosystem??"",_=t.dataset.tooltipVersion??"",N=t.dataset.tooltipFiles??"",M=t.dataset.tooltipLoc??"",P=t.dataset.tooltipSize??"",T=t.tooltipContent??null,H=T??JSON.stringify([s,d,f,p,u,v,C,L,x,F,_,N,M,P]);if(!s){l();return}if(m===t&&V===H)return;if(e.textContent=d||T?"":s,T){let o=document.createElement("div");o.className="tooltip-rich",B(T,o),e.append(o)}if(d){let o=document.createElement("span");o.className="tooltip-text",o.innerHTML=X[d];let a=document.createElement("span");a.textContent=s,o.append(a),e.append(o)}if(x){let o=document.createElement("div");o.className="tooltip-package";let a=(t.querySelector("[data-tooltip-package-icon] svg")??t.querySelector("svg"))?.cloneNode(!0);a&&o.append(a);let i=document.createElement("span");i.className="tooltip-package-details";let r=(g,y)=>/^\d+$/u.test(g)?`${Number(g).toLocaleString()} ${y}`:"";for(let g of[x,_,r(N,N==="1"?"file":"files"),r(M,"LoC"),P].filter(Boolean)){let y=document.createElement("span");y.textContent=g,i.append(y)}o.append(i),e.append(o)}if(f||p){let o=document.createElement("div");if(o.className="tooltip-repo",f){o.innerHTML=R;let a=document.createElement("span");a.textContent=f,o.append(a)}if(p){let a=document.createElement("span");a.className="tooltip-commit",a.innerHTML=I;let i=document.createElement("span");i.textContent=p.slice(0,7),a.append(i),o.append(a)}if(e.append(o),p&&u?.tags.length){let a=document.createElement("div");a.className="tooltip-tags";for(let i of u.tags.slice(0,O)){let r=document.createElement("span");r.className="tooltip-tag",r.innerHTML=$;let g=document.createElement("span");g.textContent=i,r.append(g),a.append(r)}if(u.tags.length>O){let i=document.createElement("span");i.className="tooltip-tag-more",i.textContent=`+${(u.tags.length-O).toLocaleString()} more`,a.append(i)}e.append(a)}}if(u?.details&&e.append(ot(u.details)),v||C||L){let o=document.createElement("div");if(o.className="tooltip-bundle",v==="stasis"){let r=document.createElement("img");r.src="./stasis.svg",r.alt="",o.append(r)}else o.innerHTML=k;let a=document.createElement("span"),i=v==="stasis"?"Stasis":v==="sourcemap"?"Sourcemap":"";a.textContent=[i,L?"Built on server":"",C].filter(Boolean).join(" \xB7 "),o.append(a),e.append(o)}at(e),e.style.left="0px",e.style.top="0px",e.style.transform="none",e.classList.add("visible");let G=q,S=z+ct;if(n==="right"||n==="right-start"){let o=t.getBoundingClientRect();G=o.right+lt,S=o.top+(n==="right"?o.height/2:0)}let K=window.innerWidth-e.offsetWidth-b,Q=Math.max(b,Math.min(G,K));e.style.left=`${Math.round(Q)}px`;let A=e.offsetHeight,Z=n==="right"?S-A/2:S,tt=window.innerHeight-A-b,et=Math.max(b,Math.min(Z,tt));e.style.top=`${Math.round(et)}px`,m=t,V=H}function l(t){t&&!t.contains(m)&&!t.contains(h)||(clearTimeout(E),E=null,h=null,c&&(c.classList.remove("visible"),typeof c.hidePopover=="function"&&c.matches(":popover-open")&&c.hidePopover()),m=null)}function J(t,{gate:n,placement:e}={}){w();let s=()=>t.isConnected!==!1&&(!Object.hasOwn(t.dataset,"tooltipTruncated")||t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)&&(!n||n(t));if(!s()){l();return}t===m||t===h||(l(),h=t,E=setTimeout(()=>{E=null,h=null,s()&&rt(t,{placement:e})},it))}var D=new WeakSet;function U(t,n){for(let e of t.composedPath()){if(e===n)break;if(e.nodeType===1&&Object.hasOwn(e.dataset,"tooltip"))return e}return null}function dt(t,n){!t||D.has(t)||(D.add(t),t.ownerDocument&&w(),t.addEventListener("mouseover",e=>{if(e.buttons){l();return}let s=U(e,t);if(!s){l();return}s!==m&&J(s,n)}),t.addEventListener("mouseout",e=>{let s=U(e,t),d=e.relatedTarget?.closest?.("[data-tooltip]")??null;s&&s===d||l()}),t.addEventListener("scroll",()=>l(t),{capture:!0,passive:!0}))}var Y=!1;function ft(){Y||(Y=!0,w(),document.addEventListener("tooltip-root-connected",t=>{dt(t.composedPath()[0]?.shadowRoot)}),document.body.addEventListener("mouseover",t=>{if(t.target.closest("[data-tooltip-managed]"))return;if(t.buttons){l();return}let n=t.target.closest("[data-tooltip]");!n||n===m||J(n)}),document.body.addEventListener("mouseout",t=>{t.target.closest("[data-tooltip-managed]")||t.relatedTarget?.closest?.("[data-tooltip-managed]")||!m&&!E||(m??h)?.contains(t.relatedTarget)||l()}))}export{rt as a,l as b,J as c,dt as d,ft as e};
|
package/out/chunk-CVVJAXVY.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as p}from"./chunk-CMQA4DM6.js";import{a as l,c as s,i as c,j as u}from"./chunk-2XUEZHIP.js";var v=document.querySelector("#drop-zone"),x=document.querySelector("#report"),y=document.querySelector("app-sidebar");function w(o,e){let t=URL.createObjectURL(o),r=document.createElement("span");r.style.display="none",c(s`<a href="${t}" download="${e}"></a>`,r),document.body.append(r),r.firstElementChild.click(),r.remove(),URL.revokeObjectURL(t)}function m(o){return new Error("Another dialog is already open. Close it and try again.",{cause:o})}function d(o=document){if(o.querySelector(":modal"))return!0;for(let e of o.querySelectorAll("*"))if(e.shadowRoot&&d(e.shadowRoot))return!0;return!1}var b=`a{cursor:default}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}button,summary,select,label,legend,header h3,.section-title,.ui-hint,.hint,.note,.lwd-note,.lwd-empty,.empty:not(.error,[role=alert]),.empty-discussion,.history-state[role=status],.history-summary{cursor:default;user-select:none;-webkit-user-select:none}input:not([type=checkbox],[type=radio]),textarea,[contenteditable],pre,code,.mono{cursor:text;user-select:text;-webkit-user-select:text}dialog{margin-top:5rem;margin-inline:auto;border:1px solid var(--border);border-radius:var(--ui-radius, 10px);background:var(--surface);color:var(--text);padding:1.1rem 1.25rem 1rem;max-width:480px;width:min(94vw,480px);box-shadow:0 20px 60px #00000059;&::backdrop{background:rgb(from var(--theme-bar) r g b / .55);backdrop-filter:blur(2px)}}header h3{margin:0 0 .6rem;font-size:1rem;font-weight:600}.nwd-input{display:block;width:100%;box-sizing:border-box;padding:.5rem .65rem;border:1px solid var(--border);border-radius:var(--ui-radius, 6px);background:var(--bg, var(--surface));color:var(--text);font:inherit;font-size:.88rem;&:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgb(from var(--accent) r g b / .18)}&::placeholder{color:var(--muted)}}.nwd-note{margin:.55rem 0 0;color:var(--muted);font-size:.74rem;line-height:1.45}.nwd-intro{margin:0 0 .8rem;color:var(--muted);font-size:.82rem;line-height:1.5}.nwd-actions{display:flex;align-items:center;gap:.4rem;margin-top:.8rem;padding-top:.7rem;border-top:1px solid var(--border)}.nwd-spacer{flex:1}.nwd-actions button{background:transparent;border:1px solid var(--border);color:var(--text);border-radius:var(--ui-radius, 5px);padding:.35rem .9rem;font:inherit;font-size:.8rem;&:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}&.primary{background:var(--accent);color:var(--surface);border-color:var(--accent);&:hover:not(:disabled){color:var(--surface);filter:brightness(1.08)}}&.quiet{border-color:transparent;color:var(--muted);&:hover:not(:disabled){border-color:transparent}}&.danger{color:var(--critical, #f87171);border-color:var(--border);&:hover:not(:disabled){border-color:var(--critical, #f87171);color:var(--critical, #f87171)}}&:disabled{opacity:.5}}@media(display-mode:window-controls-overlay){dialog{-webkit-app-region:no-drag;app-region:no-drag}}
|
|
2
|
-
`;var f=class extends u{static styles=[l(b)];exclusive=!1;firstUpdated(){p(this.renderRoot),this.beforeOpen();let e=this.renderRoot.querySelector("dialog");if(e){if(this.exclusive&&d()){this._conflict(new DOMException("Another modal dialog is already open","InvalidStateError"));return}try{e.showModal()}catch(t){this._conflict(t);return}this.focusInitial()}}_conflict(e){this._settled=!0,this.dispatchEvent(new CustomEvent("modal-conflict",{detail:{cause:e}}))}beforeOpen(){}focusInitial(){(this.renderRoot.querySelector("input, textarea")??this.renderRoot.querySelector("button.primary")??this.renderRoot.querySelector("button"))?.focus()}_finish(e){this._settled||(this._settled=!0,this.renderRoot.querySelector("dialog")?.close(),this.dispatchEvent(new CustomEvent("resolve",{detail:e})))}_onClose=()=>this._finish(null);_onBackdrop=e=>{if(e.target!==e.currentTarget)return;let{left:t,right:r,top:a,bottom:n}=e.currentTarget.getBoundingClientRect();(e.clientX<t||e.clientX>r||e.clientY<a||e.clientY>n)&&this._onClose()}};function L(o,e={}){return new Promise(t=>{let r=document.createElement(o);Object.assign(r,e),r.addEventListener("resolve",a=>{r.remove(),t(a.detail)}),document.body.append(r)})}function z(o,e,t){return new Promise((r,a)=>{let n=document.createElement(o);Object.assign(n,e),n.exclusive=!0,n.addEventListener("resolve",i=>{n.remove(),r(i.detail)}),n.addEventListener("modal-conflict",i=>{t(n),n.remove(),a(m(i.detail?.cause))}),document.body.append(n)})}export{v as a,x as b,y as c,w as d,m as e,d as f,f as g,L as h,z as i};
|
package/out/chunk-DIJJNTRH.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as n,b as o,c as a}from"./chunk-C4Z6ZBXV.js";import{f as r,g as s}from"./chunk-2XUEZHIP.js";var i=class extends a{constructor(t){if(super(t),this.it=s,t.type!==n.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===s||t==null)return this._t=void 0,this.it=t;if(t===r)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};i.directiveName="unsafeHTML",i.resultType=1;var f=o(i);export{f as a};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
lit-html/directives/unsafe-html.js:
|
|
5
|
-
(**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2017 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*)
|
|
10
|
-
*/
|
package/out/chunk-EDKLBQQN.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var{Buffer:ne}=globalThis,re=ne&&!ne.TYPED_ARRAY_SUPPORT;var Te=new Uint8Array(Uint16Array.of(258).buffer)[0]===2,oe=e=>e&&(re||`${e}`.includes("[native code]"));!re&&oe(()=>{})&&(oe=()=>!1);function _(e,t,n,r){let f="",o=t;for(let i=n-3;o<i;o+=4){let s=e[o],l=e[o+1],c=e[o+2],a=e[o+3];f+=r[s],f+=r[l],f+=r[c],f+=r[a]}for(;o<n;)f+=r[e[o++]];return f}function Ce(e,t){let n=e.length;for(let r=0;r<n;r++)t[r]=e.charCodeAt(r);return t}var et=null,tt=!1,nt=!1,v=new TextEncoder,L=new TextDecoder("utf-8",{ignoreBOM:!0}),ot=new TextDecoder("latin1",{ignoreBOM:!0});function rt(e,t,n,r){if(n-t>3e4){let f=[];for(let i=t;i<n;){let s=i+500,l=s>n?n:s;f.push(_(e,i,l,r)),i=l}let o=f.join("");return f.length=0,o}return _(e,t,n,r)}var P=globalThis.Buffer;function ie(e){if(!(e&&e instanceof Uint8Array))throw new TypeError("Expected an Uint8Array")}var fe="Input is not a string",B="Input is not well-formed Unicode";function j(e,t){switch(t){case"uint8":if(e.constructor!==Uint8Array)throw new Error("Unexpected");return e;case"arraybuffer":if(e.byteLength!==e.buffer.byteLength)throw new Error("Unexpected");return e.buffer;case"buffer":return e.length<=64?P.from(e):P.from(e.buffer,e.byteOffset,e.byteLength)}throw new TypeError("Unexpected format")}function st(e,t){switch(t){case"uint8":return e.length<=64||e.byteOffset!==0||e.byteLength!==e.buffer.byteLength?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);case"arraybuffer":return e.buffer.byteLength===e.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);case"buffer":if(e.constructor!==P)throw new Error("Unexpected");return e}throw new TypeError("Unexpected format")}var Me=L,Fe=L?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):null,{isWellFormed:le}=String.prototype;function Oe(e,t,n){if(t||e.length===n.length)return n;if(le){if(le.call(e))return n;throw new TypeError(B)}let r=0,f=n.length-3;for(;r<=f;){let o=n.indexOf(239,r);if(o===-1||o>f)break;if(r=o+1,n[o+1]===191&&n[o+2]===189){if(null)try{if(encodeURI(e)!==null)return n}catch{}else if(e===H(n))return n;throw new TypeError(B)}}return n}function ce(e,t=!1){if(typeof e!="string")throw new TypeError(fe);return e.length===0?new Uint8Array:v||!null?Oe(e,t,v.encode(e)):null(e,t)}function H(e,t=!1){return ie(e),e.byteLength===0?"":L||!null?t?Me.decode(e):Fe.decode(e):null(e,t)}var ht=(e,t="uint8")=>j(ce(e,!1),t),dt=(e,t="uint8")=>j(ce(e,!0),t),mt=e=>H(e,!1),pt=e=>H(e,!0);var W=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: ?(.*?))?\n?$/u,k=/^\*{15,}(?: (.*?))?\n?$/u,D=/^\*{3} (\d+)(?:,(\d+))? \*{4}\n?$/u,U=/^--- (\d+)(?:,(\d+))? ----\n?$/u,X=/^(\d+)(?:,(\d+))?([acd])(\d+)(?:,(\d+))?[ \t]*\r?\n?$/u;var Ae=/[ \t\n\v\f\r]/gu,Le=/[ \t\n\v\f\r]+/gu,ue=/[ \t\n\v\f\r]+$/u,ae=e=>e.replace(/[A-Z]/gu,t=>t.toLowerCase());function R({ignoreCase:e=!1,whitespace:t="none"}={}){let n=null;return t==="all"?n=r=>r.replace(Ae,""):t==="change"?n=r=>r.replace(ue,"").replace(Le," "):t==="trailing"&&(n=r=>r.replace(ue,"")),e?n?r=>ae(n(r)):ae:n}function N(e){let t=[];for(let n=0;n<e.length;){let r=e.indexOf(`
|
|
2
|
-
`,n),f=r<0?e.length:r+1;t.push(e.slice(n,f)),n=f}return t}var T=class extends Error{constructor(t,n){super(n===void 0?t:`${t} at line ${n+1}`),this.name="PatchError",this.line=n}},I=(e,t)=>t===0?Number(e):Number(e)-1,z=e=>e!==void 0&&e.startsWith("\\"),K=e=>e.replace(/\n$/u,"");function q(e){let t=N(e),n=[],r={old:null,new:null},f=!1;for(let o=0;o<t.length;){let i=t[o],s=he(i,f);if(f=i.startsWith("***************")?!1:i.startsWith("*** "),s){r=s.names??{...r,[s.slot]:s.name},o++;continue}let l=W.test(i)?"unified":k.test(i)?"context":X.test(i)?"normal":null;if(l===null){o++;continue}let c=[],a=_e[l];for(let u=a(t,o);u!==null&&(c.push(u.hunk),o=u.next,!(o>=t.length||he(t[o],!1)));u=a(t,o));n.push({old:r.old,new:r.new,format:l,hunks:c,blocks:Ue(c)}),r={old:null,new:null}}return n}function he(e,t){let n=/^diff --git (\S+) (\S+)\n?$/u.exec(e);if(n)return{names:{old:n[1],new:n[2]}};if(D.test(e)||U.test(e))return null;let r=/^(\*\*\* |--- |\+\+\+ )(.*?)(?:\t.*)?\n?$/u.exec(e);return r?r[1]==="--- "?{slot:t?"new":"old",name:r[2]}:{slot:r[1]==="*** "?"old":"new",name:r[2]}:null}function Ue(e){let t=[];for(let n of e){let r=n.oldStart,f=n.newStart,o=null,i=()=>{o&&(t.push(o),r=o.a1,f=o.b1,o=null)};for(let{tag:s,text:l}of n.lines){if(s===" "){i(),r++,f++;continue}s==="-"&&o?.insert.length&&i(),o??={a0:r,a1:r,b0:f,b1:f,remove:[],insert:[]},s==="-"?(o.a1++,o.remove.push(l)):(o.b1++,o.insert.push(l))}i()}return t}function Re(e,t){let n=W.exec(e[t]??"");if(!n)return null;let r=n[2]===void 0?1:Number(n[2]),f=n[4]===void 0?1:Number(n[4]),o={oldStart:I(n[1],r),newStart:I(n[3],f),label:n[5]||null,lines:[]},i=0,s=t+1,l=0;for(;l<r||i<f;s++){let c=e[s];if(c===void 0)throw new T("the patch ends inside a hunk",s);let a=c===`
|
|
3
|
-
`?" ":c[0];if(a!==" "&&a!=="-"&&a!=="+")throw new T(`a hunk line begins with ${JSON.stringify(a)}`,s);let u=c===`
|
|
4
|
-
`?c:c.slice(1);if(z(e[s+1])&&(u=K(u),s++),a!=="+"&&l++,a!=="-"&&i++,l>r||i>f)throw new T("a hunk has more lines than its header says",s);o.lines.push({tag:a,text:u})}return{hunk:o,next:s}}function ke(e,t){let n=X.exec(e[t]??"");if(!n)return null;let[,r,f,o,i,s]=n,l=o==="a"?0:Number(f??r)-Number(r)+1,c=o==="d"?0:Number(s??i)-Number(i)+1;if(l<0||c<0)throw new T("a change command counts backwards",t);let a={oldStart:o==="a"?Number(r):Number(r)-1,newStart:o==="d"?Number(i):Number(i)-1,label:null,lines:[]},u=t+1,h=(g,d,m)=>{for(let b=0;b<g;b++,u++){let E=e[u];if(E===void 0)throw new T("the patch ends inside a hunk",u);if(E[0]!==d)throw new T(`${JSON.stringify(d)} expected`,u);let p=E.slice(2);z(e[u+1])&&(p=K(p),u++),a.lines.push({tag:m,text:p})}};if(h(l,"<","-"),o==="c"){if(e[u]!==`---
|
|
5
|
-
`)throw new T("'---' expected",u);u++}return h(c,">","+"),{hunk:a,next:u}}function De(e,t){let n=k.exec(e[t]??"");if(!n)return null;let r=D.exec(e[t+1]??"");if(!r)throw new T("'*** ' range expected",t+1);let f=t+2,o=de(e,f,U,"-");f=o.next;let i=U.exec(e[f]??"");if(!i)throw new T("'--- ' range expected",f);let s=de(e,f+1,null,"+"),l=o.lines.length===0?s.lines.filter(h=>h.tag===" "):o.lines,c=s.lines.length===0?o.lines.filter(h=>h.tag===" "):s.lines,a=I(r[1],l.length),u=I(i[1],c.length);return{hunk:{oldStart:a,newStart:u,label:n[1]||null,lines:Ie(l,c)},next:s.next}}function de(e,t,n,r){let f=[],o=t;for(;o<e.length;o++){let i=e[o];if(n&&n.test(i)||k.test(i)||D.test(i)||!n&&U.test(i))break;if(z(i)){f[f.length-1].text=K(f.at(-1).text);continue}let s=i===`
|
|
6
|
-
`?" ":i[0];if(s!==" "&&s!=="!"&&s!=="-"&&s!=="+")break;f.push({tag:s===" "?" ":r,text:i===`
|
|
7
|
-
`?i:i.slice(2)})}return{lines:f,next:o}}function Ie(e,t){let n=[],r=0,f=0;for(;r<e.length||f<t.length;){if(e[r]?.tag===" "&&t[f]?.tag===" "){n.push(e[r]),r++,f++;continue}for(;r<e.length&&e[r].tag!==" ";)n.push(e[r]),r++;for(;f<t.length&&t[f].tag!==" ";)n.push(t[f]),f++;e[r]?.tag===" "&&t[f]===void 0?(n.push(e[r]),r++):t[f]?.tag===" "&&e[r]===void 0&&(n.push(t[f]),f++)}return n}var _e={unified:Re,context:De,normal:ke};var M=class extends Error{constructor(t){super(`the rendered diff does not say what the change set says (${t})`),this.name="FormatError"}};function we(e,t,n,r){if(n.length===0){if(r!=="")throw new M("there was nothing to print, and something was printed");return}let f;try{f=q(r)}catch(i){throw new M(`it does not read back (${i.message})`)}if(f.length!==1)throw new M(`${f.length} files read back, not one`);let o=f[0].blocks;if(o.length!==n.length)throw new M(`${o.length} blocks read back, not ${n.length}`);for(let[i,s]of o.entries()){let l=n[i];if(s.a0!==l.a0||s.a1!==l.a1||s.b0!==l.b0||s.b1!==l.b1)throw new M(`block ${i+1} reads back somewhere else`)}for(let i of f[0].hunks){let s=i.oldStart,l=i.newStart;for(let{tag:c,text:a}of i.lines){let u=c==="+"?t[l]:e[s];if(a!==u)throw new M(`a ${c==="+"?"added":c==="-"?"removed":"kept"} line is not the line it stands for`);c!=="+"&&s++,c!=="-"&&l++}}}function ve(e,t,n,r){let f=[],o=0;for(;o<e.length;){let i=o;for(;i+1<e.length&&e[i+1].a0-e[i].a1<=2*t;)i++;let s=e[o],l=e[i];f.push({blocks:e.slice(o,i+1),a0:Math.max(0,s.a0-t),a1:Math.min(n,l.a1+t),b0:Math.max(0,s.b0-t),b1:Math.min(r,l.b1+t)}),o=i+1}return f}var be=e=>(t,n,r,{context:f,label:o=null})=>{let i="";for(let s of ve(r,f,t.length,n.length))i+=e(t,n,s,o?o(s.a0):null);return we(t,n,r,i),i},Pe=`
|
|
8
|
-
\
|
|
9
|
-
`,F=(e,t)=>e+t+(t.endsWith(`
|
|
10
|
-
`)?"":Pe);function me(e,t){return t>e+1?`${e+1},${t}`:`${t>e?e+1:e}`}function ye(e,t,n){let r="";for(let{a0:f,a1:o,b0:i,b1:s}of n){let l=f===o?"a":i===s?"d":"c";r+=me(f,o)+l+me(i,s)+`
|
|
11
|
-
`;for(let c=f;c<o;c++)r+=F("< ",e[c]);l==="c"&&(r+=`---
|
|
12
|
-
`);for(let c=i;c<s;c++)r+=F("> ",t[c])}return we(e,t,n,r),r}function pe(e,t){return t<=e?`${e},0`:t===e+1?`${e+1}`:`${e+1},${t-e}`}var Ee=be((e,t,n,r)=>{let f=`@@ -${pe(n.a0,n.a1)} +${pe(n.b0,n.b1)} @@${r===null?"":" "+r}
|
|
13
|
-
`,o=n.a0,i=n.b0;for(let{a0:s,a1:l,b1:c}of n.blocks){for(;o<s;o++,i++)f+=F(" ",e[o]);for(;o<l;o++)f+=F("-",e[o]);for(;i<c;i++)f+=F("+",t[i])}for(;o<n.a1;o++,i++)f+=F(" ",e[o]);return f});function xe(e,t){return t<=e?`${e}`:t===e+1?`${e+1}`:`${e+1},${t}`}var $e=be((e,t,n,r)=>{let f=`***************${r===null?"":" "+r}
|
|
14
|
-
`;return f+=`*** ${xe(n.a0,n.a1)} ****
|
|
15
|
-
`,n.blocks.some(o=>o.a0<o.a1)&&(f+=ge(e,n.a0,n.a1,n.blocks,"a")),f+=`--- ${xe(n.b0,n.b1)} ----
|
|
16
|
-
`,n.blocks.some(o=>o.b0<o.b1)&&(f+=ge(t,n.b0,n.b1,n.blocks,"b")),f});function ge(e,t,n,r,f){let o=f+"1",i=f+"0",s=f==="a"?"b":"a",l="",c=t;for(let a of r){for(;c<a[i];c++)l+=F(" ",e[c]);let u=a[s+"0"]<a[s+"1"]?"! ":f==="a"?"- ":"+ ";for(;c<a[o];c++)l+=F(u,e[c])}for(;c<n;c++)l+=F(" ",e[c]);return l}function Be(e){let t=[];for(let n=0;;){let r=n;for(;n<e.length&&e[n];)n++;if(t.push(n>r),n===e.length)return t;n++}}function G(e,t,n){let r=t.length,f=Be(n),o=0,i=0,s=0,l=()=>{if(o===r||e[s]!==e[o])return!1;for(t[s++]=0,t[o++]=1,i++;o<r&&t[o];)o++;return!0},c=()=>{if(s===0||e[s-1]!==e[o-1])return!1;for(t[--s]=1,t[--o]=0,i--;s>0&&t[s-1];)s--;return!0};for(let a=0;a<r;a++){if(!t[a]){i++;continue}for(s=a,o=a;o<r&&t[o];o++);let u=-1;for(let h=-1;h!==o-s;){for(h=o-s;c(););for(u=f[i]?o:-1;l();)f[i]&&(u=o)}if(u!==-1)for(let h=o-u;h>0;h--)c();a=o-1}}function je(e){let t=1;for(let n=e;n!==0;n>>=2)t<<=1;return Math.max(256,t)}function Y(e,t,{ignoreCase:n=!1,whitespace:r="none",minimal:f=!1,slide:o=!0,horizon:i=1/0}={}){let s=R({ignoreCase:n,whitespace:r});if(s===null&&J(e,t,null))return[];let{A:l,B:c}=We(e,t,s),a=new Uint8Array(l.length),u=new Uint8Array(c.length),h=He(e,t,i);if(Xe(l,c,a,u,f,h),o){let{lo:d,hiA:m,hiB:b}=h;G(l.subarray(d,m),a.subarray(d,m),u.subarray(d,b)),G(c.subarray(d,b),u.subarray(d,b),a.subarray(d,m))}let g=qe(a,u);return V(e,t,g,s),g}function He(e,t,n){let r=Math.min(e.length,t.length),f=0;for(;f<r&&e[f]===t[f];)f++;let o=Math.max(0,f-n),i=0;for(;i<r-o&&e[e.length-1-i]===t[t.length-1-i];)i++;let s=Math.max(0,i-n);return{lo:o,hiA:e.length-s,hiB:t.length-s}}function J(e,t,n=null){if(e.length!==t.length)return!1;let r=n?(f,o)=>n(f)===n(o):(f,o)=>f===o;for(let f=0;f<e.length;f++)if(!r(e[f],t[f]))return!1;return!0}function We(e,t,n){let r=new Map,f=i=>{let s=n?n(i):i,l=r.get(s);return l===void 0&&(l=r.size,r.set(s,l)),l};return{A:Int32Array.from(e,f),B:Int32Array.from(t,f)}}function Xe(e,t,n,r,f,{lo:o,hiA:i,hiB:s}){let l=e.length+t.length+3,c={A:e,B:t,fd:new Int32Array(l),bd:new Int32Array(l),base:t.length+1,limit:je(e.length+t.length)},a=[{xoff:o,xlim:i,yoff:o,ylim:s,minimal:f}],u={xmid:0,ymid:0,loMinimal:!1,hiMinimal:!1};for(;a.length;){let{xoff:h,xlim:g,yoff:d,ylim:m,minimal:b}=a.pop();for(;h<g&&d<m&&e[h]===t[d];)h++,d++;for(;h<g&&d<m&&e[g-1]===t[m-1];)g--,m--;if(h===g){for(;d<m;d++)r[d]=1;continue}if(d===m){for(;h<g;h++)n[h]=1;continue}ze(c,h,g,d,m,b,u),a.push({xoff:u.xmid,xlim:g,yoff:u.ymid,ylim:m,minimal:u.hiMinimal}),a.push({xoff:h,xlim:u.xmid,yoff:d,ylim:u.ymid,minimal:u.loMinimal})}}function ze(e,t,n,r,f,o,i){let{A:s,B:l,fd:c,bd:a,base:u,limit:h}=e,g=n-r,d=t-f,m=n-f,b=t-r,E=m,p=m,w=b,y=b,ee=(b-m&1)!==0;c[u+b]=t,a[u+m]=n;for(let te=1;;te++){y>d?c[u+--y-1]=-1:++y,w<g?c[u+ ++w+1]=-1:--w;for(let x=w;x>=y;x-=2){let O=c[u+x+1],A=c[u+x-1],$=A<O?O:A+1,S=$-x;for(;$<n&&S<f&&s[$]===l[S];)$++,S++;if(c[u+x]=$,ee&&p<=x&&x<=E&&a[u+x]<=$){i.xmid=$,i.ymid=S,i.loMinimal=i.hiMinimal=!0;return}}p>d?a[u+--p-1]=2147483647:++p,E<g?a[u+ ++E+1]=2147483647:--E;for(let x=E;x>=p;x-=2){let O=a[u+x+1],A=a[u+x-1],$=A<O?A:O-1,S=$-x;for(;t<$&&r<S&&s[$-1]===l[S-1];)$--,S--;if(a[u+x]=$,!ee&&y<=x&&x<=w&&$<=c[u+x]){i.xmid=$,i.ymid=S,i.loMinimal=i.hiMinimal=!0;return}}if(!(o||te<h)){Ke(e,{xoff:t,xlim:n,yoff:r,ylim:f,fmin:y,fmax:w,bmin:p,bmax:E},i);return}}}function Ke(e,t,n){let{fd:r,bd:f,base:o}=e,{xoff:i,xlim:s,yoff:l,ylim:c,fmin:a,fmax:u,bmin:h,bmax:g}=t,d=0,m=-1;for(let p=u;p>=a;p-=2){let w=Math.min(r[o+p],s),y=w-p;c<y&&(w=c+p,y=c),m<w+y&&(m=w+y,d=w)}let b=0,E=2147483647;for(let p=g;p>=h;p-=2){let w=Math.max(i,f[o+p]),y=w-p;y<l&&(w=l+p,y=l),w+y<E&&(E=w+y,b=w)}s+c-E<m-(i+l)?(n.xmid=d,n.ymid=m-d,n.loMinimal=!0,n.hiMinimal=!1):(n.xmid=b,n.ymid=E-b,n.loMinimal=!1,n.hiMinimal=!0)}function qe(e,t){let n=[],r=t.length,f=e.length,o=0,i=0;for(;o<f||i<r;){if(o<f&&i<r&&!e[o]&&!t[i]){o++,i++;continue}let s=o,l=i;for(;o<f&&e[o];)o++;for(;i<r&&t[i];)i++;if(s===o&&l===i)throw new C("a kept line has no counterpart");n.push({a0:s,a1:o,b0:l,b1:i})}return n}function V(e,t,n,r=null){let f=r?(s,l)=>r(s)===r(l):(s,l)=>s===l,o=0,i=0;for(let{a0:s,a1:l,b0:c,b1:a}of n){if(s<o||c<i||l<s||a<c||l>e.length||a>t.length)throw new C("a block is out of order or out of range");if(s===l&&c===a)throw new C("a block changes nothing");if(s-o!==c-i)throw new C("the kept lines before a block differ in count");for(;o<s;o++,i++)if(!f(e[o],t[i]))throw new C(`kept line ${o+1} does not match`);o=l,i=a}if(e.length-o!==t.length-i)throw new C("the kept lines after the last block differ in count");for(;o<e.length;o++,i++)if(!f(e[o],t[i]))throw new C(`kept line ${o+1} does not match`)}var C=class extends Error{constructor(t){super(`the computed change set does not reconstruct the second file (${t})`),this.name="DiffError"}};var Z={unified:Ee,context:$e,normal:ye},Ne=`Files differ
|
|
17
|
-
`;function Ge(e,t,n){if(e===t)return"";let r=R(n);return r===null?Ne:J(N(e),N(t),r)?"":Ne}function Q(e,t){if(!(Number.isInteger(e)&&e>=0)&&e!==1/0)throw new RangeError(`${t} is a number of lines, not ${e}`);return e}function Ye(e,t,{slide:n=!0,horizon:r=3,...f}={}){let o=N(e),i=N(t);return Y(o,i,{...f,slide:n,horizon:Q(r,"horizon")}).map(({a0:s,a1:l,b0:c,b1:a})=>({a0:s,a1:l,b0:c,b1:a,remove:o.slice(s,l),insert:i.slice(c,a)}))}function Je(e,t,n,{format:r="unified",context:f=3,label:o=null,...i}={}){if(!Object.hasOwn(Z,r))throw new RangeError(`a change set prints as unified, context or normal, not ${r}`);let s=N(e),l=N(t);return V(s,l,n,R(i)),n.length===0?"":Z[r](s,l,n,{context:f,label:o})}function Ve(e,t,{format:n="unified",context:r=3,label:f=null,...o}={}){if(n==="brief")return Ge(e,t,o);let i=N(e),s=N(t),{slide:l=!0,horizon:c=0,...a}=o,u=Q(c,"horizon"),h=Y(i,s,{...a,slide:l,horizon:n==="normal"?u:Math.max(u,Q(r,"context"))});return h.length===0?"":Z[n](i,s,h,{context:r,label:f})}export{Te as a,Ce as b,et as c,tt as d,nt as e,v as f,L as g,ot as h,rt as i,ie as j,fe as k,j as l,st as m,ht as n,dt as o,mt as p,pt as q,W as r,k as s,X as t,q as u,M as v,C as w,Ye as x,Je as y,Ve as z};
|
package/out/chunk-F47DXCEV.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{b as _e,h as Ee}from"./chunk-AJ4GTATZ.js";import{a as Le}from"./chunk-R75XOKUP.js";import{a as Ce,d as Ie}from"./chunk-OD4LPN3H.js";import{A as Re,B as z,E as Se,b as G,c as ee,d as ye,j as L,m as C,p as I,s as xe,t as $e,w as ke,z as te}from"./chunk-GNXOKIGP.js";import{a as P,b as U,c as B}from"./chunk-C4Z6ZBXV.js";import{c as Q,f as N,g as ve}from"./chunk-2XUEZHIP.js";var tn=U(class extends B{constructor(e){if(super(e),e.type!==P.ATTRIBUTE||e.name!=="class"||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(let o in t)t[o]&&!this.nt?.has(o)&&this.st.add(o);return this.render(t)}let n=e.element.classList;for(let o of this.st)o in t||(n.remove(o),this.st.delete(o));for(let o in t){let i=!!t[o];i===this.st.has(o)||this.nt?.has(o)||(i?(n.add(o),this.st.add(o)):(n.remove(o),this.st.delete(o)))}return N}});var Me="important",ut=" !"+Me,ln=U(class extends B{constructor(e){if(super(e),e.type!==P.ATTRIBUTE||e.name!=="style"||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let o=e[n];return o==null?t:t+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(e,[t]){let{style:n}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let o of this.ft)t[o]==null&&(this.ft.delete(o),o.includes("-")?n.removeProperty(o):n[o]=null);for(let o in t){let i=t[o];if(i!=null){this.ft.add(o);let r=typeof i=="string"&&i.endsWith(ut);o.includes("-")||r?n.setProperty(o,r?i.slice(0,-11):i,r?Me:""):n[o]=i}}return N}});function H(e){return e.id??String(e._id)}function ne(e){let t=I(e);return t!==""&&t!=="revalidation"}var K=[{value:"confirmed",label:"Confirmed",kinds:["confirmed","partial","revalidation"]},{value:"unreachable",label:"Unreachable",kinds:["unreachable"]},{value:"refuted",label:"Refuted",kinds:["refuted"]}];function Ae(e){return K.find(t=>t.value===e)?.kinds??null}var ft=["","exclude","only"];function oe(e,t){let n=Ae(e);return n?.includes("partial")?t==="only"?["partial"]:t==="exclude"?["confirmed"]:n:n}function V(e){if(e.confidence!==void 0)return e.confidence;if(e.critical===!0||e._source)return 10}var pt=e=>e.confidence!==void 0||e.critical===!0;function dt(e){return e.every(t=>t.every(n=>V(n)!==void 0))&&e.some(t=>t.some(pt))}function Te(e,t,n){return e.some(o=>{let i=["refuted","unreachable"].includes(n(o))?0:V(o);return i===void 0?t===0:i>=t})}function gt(e,t){let n=e.map(t).filter(r=>r.length>0);if(!n.some(r=>r.some(s=>V(s)!==void 0)))return 0;let o=r=>n.reduce((s,l)=>s+(l.some(a=>(V(a)??-1)>=r)?1:0),0),i;for(o(6)<=25?i=6:o(7)<=25?i=7:i=8;i>0&&o(i-1)===o(i);)i--;return i}function je(e,t){return dt(e)?t:0}function ht(e,t,n){let o=new Set(e.ruledOutIds??[]);for(let i of e)for(let r of i)["refuted","unreachable"].includes(n(r))&&o.add(H(r));for(let i of e){let r=t(i);if(r.length!==0&&r.some(s=>oe("confirmed","").includes(n(s)||(s._source&&!s._sourcePass?"revalidation":"")))){for(let s of i)if(o.add(H(s)),s.isApp&&Array.isArray(s.revalidateInputs))for(let l of s.revalidateInputs)l&&o.add(l)}}return o}function mt(e,t,n,o){let i=je(e,t),r=e.filter(l=>Te(l,i,o));if(r.length===0)return!1;let s=new Set(oe("confirmed",""));return e.some(l=>l.some(a=>s.has(o(a))))?r.every(l=>l.every(a=>n.has(H(a)))):!1}function hn(e,{tabs:t,kindOf:n,severityMode:o}){let i=e.map(t).filter(l=>l.length>0),r=ht(e,t,n);if(!mt(i,gt(e,t),r,n))return!1;let s=je(i,6);return i.every(l=>!Te(l,s,n)||!l.some(a=>C(a,o)!=="low")||l.every(a=>r.has(H(a))))}var S=!0;function jn(e,t=!1){S=e!==!1&&!t}function Fn(){return S}function A(e){return S?I(e):""}function Dn(e){return I(e)!==""}function On(e){return e.some(t=>(t.groups??[]).some(n=>n.some(ne)))}function bt(e){let t=A(e);return t&&t!=="revalidation"?t:null}function Nn(e){return A(e)==="revalidation"}var Ve=new Set(["refuted","unreachable"]);function Pn(e){return Ve.has(A(e))}function Un(e){return Ve.has(A(e))}function Bn(e){let t=new Set(e);return K.filter(n=>n.kinds.some(o=>t.has(o)))}function Z(e){return new RegExp(`(^|/)${e}/`,"u")}function Ke(e){return new RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,"u")}var wt=Z("node_modules"),vt=Z("vendor"),M="node_modules",ae=Z(M),We=Ke(M);function yt(e){e!==M&&(M=e,ae=Z(e),We=Ke(e))}function Gn(e){yt(_e(e))}function Ze(){return M}function q(e){return ae.test(e)}var ie=new WeakSet;function zn(e){let t=!1;for(let n of e??[])for(let o of n.groups??[])for(let i of o){if(i.isApp!==!1)continue;let r=ie.has(i);"isUpstream"in i&&!r||(q(i.file)?(i.isUpstream!==!0&&(t=!0),i.isUpstream=!0,ie.add(i)):r&&(t=!0,delete i.isUpstream,ie.delete(i)))}return t}function Fe(e){let t=typeof e=="string"?e:"";return wt.test(t)||vt.test(t)||ae.test(t)}var xt=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function De(e){return xt.exec(typeof e=="string"?e:"")?.[1]??null}function Hn(e){return typeof e!="number"||!Number.isFinite(e)?null:Le(e)}function Vn(e){if(e.length<=1)return{prefix:"",stripped:[...e]};let t=e.map(s=>s.split("/")),n=Math.min(...t.map(s=>s.length)),o=0;for(let s=0;s<n-1&&t.every(l=>l[s]===t[0][s]);s++)o=s+1;if(o>0&&t[0][o-1].startsWith("@")&&o--,o>0&&t[0][o-1]==="node_modules"&&o--,o===0)return{prefix:"",stripped:[...e]};let i=`${t[0].slice(0,o).join("/")}/`,r=t.map(s=>s.slice(o).join("/"));return{prefix:i,stripped:r}}function $t(e){return e.match(We)?.[1]??e}function Kn(e){let t=S?[bt(e),e.revalidateVerdict,e.revalidateRecommendation]:[];return[e.file,e.title,e.description,e.impact,e.reproduction,Ft(e),e.recommendation,e.confidenceReason,...t,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
|
|
2
|
-
`).toLowerCase()}function Wn(e){return[typeof e?.category=="string"?e.category.trim():"",xe(e,S)].filter(Boolean).join(" \xB7 ")}function Zn(e){if(e.length===0)return"";let t=e[0];for(let n=1;n<e.length;n++){for(;t&&!e[n].startsWith(t);)t=t.slice(0,-1);if(!t)return""}return t}function qn(e){if(!e)return"";let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function qe(e){if(!e)return null;let t=e.trim().replace(/\/$/u,"");return t?/^https?:\/\//iu.test(t)?t:/^github\.com\//iu.test(t)?`https://${t}`:`https://github.com/${t}`:null}var kt=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function Rt(e){return kt.test(e||"")}function Oe(e){if(e==null||typeof e=="string")return{id:e??"",prefix:""};let t=Se(e);return{id:typeof e.github=="string"?e.github:"",prefix:t?`${t}/`:""}}function St(e,t,n){if(Rt(e))return null;let o=Oe(t);if(o.id)return`https://github.com/${o.id}/blob/HEAD/${o.prefix}${$t(e)}`;if(q(e))return null;let i=Oe(n),r=qe(i.id);return r?`${r}/blob/HEAD/${i.prefix}${e}`:null}function Yn(e,t){let n=e?.file??"",o=W(e,t);return o?Q`<a href="${_t(o)}" target="_blank" rel="noopener">${n}</a>`:n}function _t(e){return e.replace(/#L\d+(?:-L?\d+)?$/u,"")}function W(e,t){if(!e)return null;if(z(e.location))return e.location;let n=St(e.file,e.repo,t);if(!n)return null;let o=parseInt(e.line,10);return Number.isFinite(o)?`${n}#L${o}`:n}var Et=/^https?:\/\/(?:www\.)?github\.com\/([^/\s]+\/[^/\s]+)\/(?:blob|tree|blame)\/[^/\s]+\/(\S+)$/u,Lt=/#L(\d+)(?:-L?(\d+))?$/u;function Jn(e){let t=typeof e=="string"?Et.exec(e):null;if(!t)return"";let n=t[2],o=Lt.exec(n);if(!o)return`${t[1]}/${n}`;n=n.slice(0,o.index);let i=o[2]?`${o[1]}-${o[2]}`:o[1];return`${t[1]}/${n}:${i}`}var Ct=/^(?:\s+\S|[-*+] |\d+[.)] |>|#{1,6} |\||`{3}|~{3})/u;function Ye(e){return e.split(/(\n{2,})/u).map(t=>{if(/^\n+$/u.test(t))return t;let n=t.split(`
|
|
3
|
-
`);return n.some(o=>Ct.test(o))?t:n.map(o=>o.trim()).filter(Boolean).join(" ")}).join("")}function Ne(e,t,n){let o=t?/^\n*/u.exec(e)[0]:"",i=e.slice(o.length),r=n?/\n*$/u.exec(i)[0]:"";return o+Ye(i.slice(0,i.length-r.length))+r}function Xn(e){if(!e)return e;let t=G(e);if(t.length===0)return Ye(e);let n=[],o=0;for(let[i,r]of t)i>o&&n.push(Ne(e.slice(o,i),o>0,!0)),n.push(e.slice(i,r)),o=r;return o<e.length&&n.push(Ne(e.slice(o),!0,!1)),n.join("")}var Pe=/^( *)(`{3,}|~{3,})(.*)$/u,It=/^[a-z0-9+#._-]{1,20}$/u;function Je(e,t){let n=0;for(;n<t&&e[n]===" ";)n++;return e.slice(n)}function Mt(e){let t=e.split(`
|
|
4
|
-
`),n=Pe.exec(t[0]),o=(n?.[2]??"```").slice(0,3),i=(n?.[3]??"").trim().split(/\s+/u)[0].toLowerCase(),s=!!(t.length>1?Pe.exec(t.at(-1)):null)?.[2].startsWith(o),l=n?.[1].length??0,a=t.slice(1,s?-1:void 0);return{lang:It.test(i)?i:"",code:(l>0?a.map(u=>Je(u,l)):a).join(`
|
|
5
|
-
`)}}function Qn(e){let t=G(e||"");if(t.length===0)return[e];let n=[],o=0,i=(r,s)=>{let l=(s?r.replace(/^\n+/u,""):r).replace(/\n+$/u,"");l&&n.push(l)};for(let[r,s]of t)r>o&&i(e.slice(o,r),o>0),n.push(Mt(e.slice(r,s))),o=s;return o<e.length&&i(e.slice(o),!0),n}var re=/^( *)(?:[-*+]|(\d{1,9})[.)]) +(?=\S)/u,Ue=/^ {0,3}([-*_])(?: *\1){2,} *$/u;function At(e){return/^ */u.exec(e)[0].length}function Be(e){let t=e.length;for(;t>0&&!e[t-1].trim();)t--;return e.slice(0,t).join(`
|
|
6
|
-
`)}function eo(e){let t=typeof e=="string"?e:"";if(!t)return[e];let n=G(t),o=t.split(`
|
|
7
|
-
`),i=[],r=0;for(let g of o)i.push(r),r+=g.length+1;let s=g=>!ee(n,i[g])&&!Ue.test(o[g])&&re.test(o[g]),l=[],a=0,u=0,p=g=>{let h=o.slice(a,g).join(`
|
|
8
|
-
`).replace(/^\n+/u,"").replace(/\n+$/u,"");h.trim()&&l.push(h)};for(;u<o.length;){if(!s(u)){u++;continue}p(u);let g=re.exec(o[u]),h=!!g[2],y=[],w=null,m=!1;for(;u<o.length;){let x=o[u];if(!ee(n,i[u])){if(!x.trim()){w.lines.push(""),m=!0,u++;continue}let $=At(x),R=Ue.test(x)?null:re.exec(x);if(R&&(!w||$<w.column)){if(!!R[2]!==h)break;w&&y.push(Be(w.lines)),w={column:R[0].length,lines:[x.slice(R[0].length)]},m=!1,u++;continue}if($<w.column&&m)break}w.lines.push(Je(x,w.column)),m=!1,u++}w&&y.push(Be(w.lines)),l.push({ordered:h,start:h?Number(g[2]):null,items:y}),a=u}return l.length===0?[e]:(p(o.length),l)}var Tt=/^(\d+)(?:\s*-\s*(\d+))?$/u;function se(e){if(typeof e=="number")return Number.isFinite(e)&&e>=1?{start:Math.floor(e),end:Math.floor(e)}:null;let t=Tt.exec(String(e??"").trim());if(!t)return null;let n=parseInt(t[1],10),o=t[2]===void 0?n:parseInt(t[2],10);return!Number.isFinite(n)||n<1||!Number.isFinite(o)||o<1?null:{start:Math.min(n,o),end:Math.max(n,o)}}function to(e){return e?e.start===e.end?String(e.start):`${e.start}-${e.end}`:""}function jt(e){if(e&&typeof e=="object"){let t=se(e.start);if(!t)return null;let n=se(e.end)??t;return{start:t.start,end:Math.max(t.start,n.end)}}return se(e)}function no(e,t,n=4){let o=typeof e=="string"&&e!==""?e.split(`
|
|
9
|
-
`):[];if(o.length===0)return{text:"",startLine:1,lines:[]};let i=jt(t),r=i&&{start:Math.min(i.start,o.length),end:Math.min(i.end,o.length)},s=r?Math.max(1,r.start-n):1,l=r?Math.min(o.length,r.end+n):Math.min(o.length,n*2+1),a=o.slice(s-1,l);return{text:a.join(`
|
|
10
|
-
`),startLine:s,lines:a}}function oo(e,t,n,o){if(z(e?.url))return e.url;let i=e?.file;if(typeof i!="string"||i==="")return null;let r=t?.file??"",s=t?.repo?.github,l=()=>s?W({file:i,line:e?.line,repo:t.repo},null):null;if(o===0&&i===r)return l();let a=De(i);return a!==null&&a===De(r)?l():Fe(i)?null:s&&!Fe(r)?l():W({file:i,line:e?.line},n)}function Xe(e,{spaced:t=!1}={}){let n=Array.isArray(e?.evidence)?e.evidence:[];return n.length===0?"":n.map((o,i)=>{let r=te(o),s=[`${i+1}. ${o.url?`[${r}](${o.url})`:r}`],l=Re(o);if(l)for(let a of l.split(`
|
|
11
|
-
`))s.push(` ${a}`);return s.join(`
|
|
12
|
-
`)}).join(t?`
|
|
13
|
-
|
|
14
|
-
`:`
|
|
15
|
-
`)}function Ft(e){let t=Xe(e);return t?`**Evidence:**
|
|
16
|
-
${t}`:""}function io(e){let t=/^\[([^\]]+)\]\(([^)\s]+)\)$/u.exec(e);return!t||!z(t[2])?null:{label:ye(t[1].trim())||t[2],url:t[2]}}function ro(e,t){let n=parseInt(e?.line,10);if(!Number.isFinite(n))return ve;let o=W(e,t),i=`line ${n}`;return o?Q`<a href="${o}" target="_blank" rel="noopener">${i}</a>`:i}function so(e,t){return!e||!t?null:`${/^https?:/iu.test(e)?e.replace(/\/$/u,""):`https://github.com/${e}`}/commit/${t}`}var Dt=[["Impact","impact"],["Reproduction","reproduction"],["Recommendation","recommendation"],["Confidence reason","confidenceReason"],["Revalidation verdict","revalidateVerdict"],["Revalidation recommendation","revalidateRecommendation"]];function co(e,t){let n=[];t&&n.push(`Repo: ${t}`);let o=te(e);o&&n.push(`Location: ${o}`),e?.confidence!=null&&n.push(`Confidence: ${e.confidence}/10`);let i=A(e);i&&n.push(`Revalidation: ${i}`);let r=[];n.length>0&&r.push(n.join(`
|
|
17
|
-
`));let{title:s,body:l}=ke(e);s&&r.push(`# ${s}`),l&&r.push(l.trim());let a=Xe(e,{spaced:!0});a&&r.push(`# Evidence
|
|
18
|
-
|
|
19
|
-
${a}`);for(let[u,p]of Dt){if(!S&&p.startsWith("revalidate"))continue;let g=$e(e?.[p],e)?.trim();g&&r.push(`# ${u}
|
|
20
|
-
|
|
21
|
-
${g}`)}return r.join(`
|
|
22
|
-
|
|
23
|
-
`)}function ao(e,{title:t,body:n,labels:o=[]}={}){let i=qe(e);if(!i)return null;let r;try{r=new URL(i).host.toLowerCase()}catch{return null}if(r!=="github.com")return null;let s=new URLSearchParams;t&&s.set("title",t),n&&s.set("body",n),o.length>0&&s.set("labels",o.join(","));let l=s.toString();return l?`${i}/issues/new?${l}`:`${i}/issues/new`}var Ot=/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u,Nt=/^[a-zA-Z\d._-]+$/u,Pt=/^[1-9]\d{0,9}$/u,Ut=/^[a-fA-F\d]{7,40}$/u,Bt=/^#[\w-]+$/u,Ge=/^GHSA(?:-[0-9a-z]{4}){3}$/u;function ze(e){return e.length<=39&&Ot.test(e)}function He(e){return e.length<=100&&e!=="."&&e!==".."&&Nt.test(e)}function Gt(e){let t;try{t=new URL(e)}catch{return null}if(t.href!==e||t.protocol!=="https:"||t.hostname.toLowerCase()!=="github.com"||t.port||t.username||t.password)return null;let n=t.pathname.split("/");if(n.at(-1)===""&&n.pop(),n.length===3&&n[1]==="advisories"){let p=n[2];return Ge.test(p)?{url:`https://github.com/advisories/${p}`,label:p}:null}if(n.length===6&&n[3]==="security"&&n[4]==="advisories"){let[,p,g,,,h]=n;return!ze(p)||!He(g)||!Ge.test(h)?null:{url:`https://github.com/${p}/${g}/security/advisories/${h}`,label:h}}if(n.length!==5)return null;let[,o,i,r,s]=n;if(!ze(o)||!He(i))return null;let l;if(r==="issues"||r==="pull"){if(!Pt.test(s))return null;l=`${o}/${i}#${s}`}else if(r==="commit"){if(!Ut.test(s))return null;l=`${o}/${i}@${s.slice(0,7)}`}else return null;let a=Bt.test(t.hash)?t.hash:"";return{url:`https://github.com/${o}/${i}/${r}/${s}${a}`,label:l}}var zt=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/u;function Ht(e){if(typeof e!="string")return null;let t=Vt(e);return t!==e||zt.test(e)?t.slice(0,8):null}function Vt(e){let t=String(e),n="https://chatgpt.com/codex/cloud/security/findings/";return t.startsWith(n)?t.slice(n.length):t}function Kt(e,t){let n=Ee(e,{managed:t});if(!n)return null;let o=Ht(n.id);return{url:t?n.path:`#${n.fragment}`,label:o?`finding ${o}`:"finding",self:!0}}var ce=/https?:\/\/[^\s<>"'`(){}[\]|\\^]+/giu,Wt=new Set([")",".",",","!","?",";",":","'",'"',"*","]","}",">"]);function Zt(e){let t=e.length;for(;t>0&&Wt.has(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function lo(e,{managed:t=!1}={}){if(typeof e!="string"||e.length===0)return[];let n=[],o=0;ce.lastIndex=0;let i;for(;(i=ce.exec(e))!==null;){let r=Zt(i[0]),s=r?Gt(r)??Kt(r,t):null;s&&(i.index>o&&n.push(e.slice(o,i.index)),n.push(s),o=i.index+r.length,ce.lastIndex=o)}return o<e.length&&n.push(e.slice(o)),n}var Y={showAll:!1,packagesView:!1,dependencyPackagesView:!1,flowPackagesView:!1,bundleIssues:!1,bundleLayout:"graph",bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:"issues",edgeOpacity:.22,nodeSize:1,showLabels:!1,selectedSeverities:new Set,selectedColors:new Set,pathFilter:"",hidden:new Set,solo:null,graphState:null,layoutCache:null,keptViewport:null};function po({keepViewport:e=!1}={}){Y.graphState?._cleanup?Y.graphState._cleanup({keepViewport:e}):e||(Y.keptViewport=null),Y.graphState=null}function mo(e){if(!e)return null;let t=Ze(),n=new RegExp(`^(?:.*/)?${t}/(@[^/]+/[^/]+|[^/]+)`,"u"),o=e.match(n);return o?o[1]:"__own__"}function bo(e){return new Set(e.filter(t=>!q(t)))}var Qe=["#4e9af1","#f28e2b","#59a14f","#e15759","#76b7b2","#edc948","#b07aa1","#ff9da7","#9c755f","#5cd1e5","#f1ce63","#d37295","#a0cbe8","#86bcb6","#8cd17d","#b6992d","#499894","#e15759","#e879c7","#d4a6c8"],et=["#2f8aef","#d2691e","#2ea043","#e63946","#2e9a92","#b88817","#9560e8","#d24a9c","#8a5d40","#0891b2","#a07a14","#c14e8e","#1f7ad0","#549b94","#3fb95f","#a07a14","#2a8278","#cb2c40","#c026d3","#965f93"];function ue(){if(typeof document>"u")return!1;let e=document.body?.classList;return!!e&&(e.contains("theme-light")||e.contains("theme-pink")||e.contains("theme-paper"))}var le=new Map;function wo(e){let t=ue()?et:Qe;return t[e%t.length]}var vo=()=>ue()?"#8c959f":"#6e7681";function yo(e){let t=ue(),n=t?et:Qe,o=e??"__own__",i=`${t?"l":"d"}:${o}`;if(le.has(i))return le.get(i);let r=0;for(let u of o)r=r*37+u.codePointAt(0)|0;let l=((r%n.length+n.length)%n.length*7+3)%n.length,a=n[l];return le.set(i,a),a}function ko(e){return"tree-"+e.replaceAll(/[^\w-]+/gu,"_")}var nt=()=>Object.fromEntries(L.map(e=>[e,0]));function Ro(e,t){let n=new Map;for(let o of e)for(let i of o){n.has(i.file)||n.set(i.file,nt());let r=n.get(i.file),s=C(i,t);r[s]!==void 0&&r[s]++}return n}function So(e){let t=null;for(let n of e)if(n?.tree){t||(t={});for(let o of Object.keys(n.tree)){let i=n.tree[o];if(!t[o]){t[o]={...i,imports:[...i.imports??[]]};continue}let r=new Set(t[o].imports);for(let s of i.imports??[])r.has(s)||(r.add(s),t[o].imports.push(s));t[o].size==null&&i.size!=null&&(t[o].size=i.size)}}return t}function _o(e,t){let n=Object.keys(e),o=new Map(n.map((a,u)=>[a,u])),i=n.map(()=>nt()),r=n.map(()=>[]);for(let[a,u]of n.entries())for(let p of e[u].imports??[]){let g=o.get(p);g!==void 0&&r[g].push(a)}let s=new Uint32Array(n.length),l=0;for(let[a,u]of t){let p=o.get(a);if(p===void 0||!u)continue;let g=L.map(m=>[m,u[m]??0]).filter(([,m])=>m!==0);if(g.length===0)continue;let h=++l,y=[],w=m=>{s[m]!==h&&(s[m]=h,y.push(m))};for(let m of r[p])w(m);for(;y.length>0;){let m=y.pop();for(let[x,$]of g)i[m][x]+=$;for(let x of r[m])w(x)}}return new Map(n.map((a,u)=>[a,i[u]]))}function Eo(e,t,n){let o=t.get(e),i=n.get(e);return tt(o)>0||tt(i)>0}function tt(e){if(!e)return 0;let t=0;for(let n of L)t+=e[n]??0;return t}var ot={package:"@babel/core",path:/^lib\/config\//u},fe={package:"@babel/core",path:/^lib\/config\/files\/(?:module-types|plugins)\.js$/u},st=Object.freeze([{id:"react-native-codegen-discovery",reason:"Codegen discovers package metadata and React Native configuration.",from:{package:"react-native",path:/^scripts\/codegen\/generate-artifacts-executor\.js$/u},to:{path:/(?:^|\/)(?:package\.json|react-native\.config\.js)$/u}},{id:"react-native-release-version",reason:"The CLI release checker reads the installed React Native version.",from:{package:"@react-native-community/cli-tools",path:/^build\/releaseChecker\/index\.js$/u},to:{package:"react-native",path:/^package\.json$/u}},{id:"react-native-platform-config",reason:"React Native configuration loads platform CLIs supplied by the host project.",from:{package:"react-native",path:/^react-native\.config\.js$/u},to:{package:/^@react-native-community\/cli-platform-(?:android|ios)$/u,path:/^build\/index\.js$/u}},{id:"babel-project-config",reason:"Babel discovers project configuration.",from:ot,to:{path:/(?:^|\/)babel\.config\.js$/u}},{id:"babel-typescript-preset",reason:"Babel configuration loads the TypeScript preset.",from:ot,to:{package:"@babel/preset-typescript",path:/./u}},{id:"babel-react-native-preset",reason:"Babel config loaders load the configured React Native preset.",from:fe,to:{package:"@react-native/babel-preset",path:/^(?:src\/)?index\.js$/u}},{id:"babel-reanimated-plugin",reason:"Babel config loaders load the configured Reanimated plugin, including scoped copies.",from:fe,to:{package:/^(?:@[^/]+\/)?react-native-reanimated$/u,path:/^plugin\/index\.js$/u}},{id:"babel-transform-plugin",reason:"Babel config loaders load configured transform plugins.",from:fe,to:{package:/^@babel\/plugin-transform-[^/]+$/u,path:/^lib\/index\.js$/u}},{id:"cosmiconfig-config",reason:"Cosmiconfig loads discovered configuration, including dependency configuration.",from:{package:"cosmiconfig",path:/^dist\/loaders\.js$/u},to:{path:/\.config\.js$/u}},{id:"import-fresh-own-config",reason:"import-fresh loads host-project configuration.",from:{package:"import-fresh",path:/./u},to:{path:/\.config\.js$/u},ownSourceOnly:!0}].map(e=>Object.freeze({...e,from:Object.freeze(e.from),to:Object.freeze(e.to)})));function it(e){return typeof e=="string"&&!e.includes("\\")&&!e.includes(":")&&e.split("/").every(t=>t!==""&&t!=="."&&t!==".."&&t!=="node_modules")}function rt(e,t){let n=e.package;return n!==void 0&&t.ownSource===!0?!1:(n===void 0||(typeof n=="string"?n===t.package:n.test(t.package??"")))&&e.path.test(t.path)}function pe(e,t){if(!(e?.ownSource===!0||!it(e?.path)||!it(t?.path)))return st.find(n=>(!n.ownSourceOnly||t.ownSource===!0)&&rt(n.from,e)&&rt(n.to,t))}function ct(e,t){let o=e.split(/(?:^|\/)node_modules\//u).slice(1).at(-1)?.match(/^(@[^/]+\/[^/]+|[^/]+)\/(.+)$/u);return{package:o?.[1],path:o?.[2]??e.replace(/^\/+/u,""),ownSource:t??Ce(e)==="__own__"}}function de(e,t,n,o){return!pe(ct(e,o),ct(t,n))}function jo(e,t=n=>n.file){let n=new Map(e.nodes.map(i=>[i.file,i])),o=new Map(e.nodes.map(i=>[t(i),new Set]));for(let[i,r]of e.importsOf){let s=n.get(i);if(s)for(let l of r){let a=n.get(l);a&&de(s.origFile??i,a.origFile??l,e.ownSourceFiles?.has(l),e.ownSourceFiles?.has(i))&&o.get(t(s)).add(t(a))}}return o}var ge=class{constructor(t){this.nodes=[...t];for(let[n,o]of this.nodes.entries())o.position=n;for(let n=(this.nodes.length>>1)-1;n>=0;n--)this.down(n)}before(t,n){return Math.abs(t.balance)>Math.abs(n.balance)||Math.abs(t.balance)===Math.abs(n.balance)&&(t.balance>n.balance||t.balance===n.balance&&t.tie<n.tie)}swap(t,n){let o=this.nodes,i=o[t];o[t]=o[n],o[n]=i,o[t].position=t,o[n].position=n}down(t){let n=this.nodes;for(;2*t+1<n.length;){let o=2*t+1;if(o+1<n.length&&this.before(n[o+1],n[o])&&o++,!this.before(n[o],n[t]))break;this.swap(t,o),t=o}}update(t){if(t.position<0)return;let n=t.position;for(;n>0;){let o=n-1>>1;if(!this.before(t,this.nodes[o]))break;this.swap(n,o),n=o}this.down(n)}take(){let t=this.nodes[0],n=this.nodes.pop();return t.position=-1,this.nodes.length>0&&(this.nodes[0]=n,n.position=0,this.down(0)),t}};function qt(e,t){for(let n=0;n<8;n++){let o=!1;for(let i=0;i<e.length-1;i++){let r=n%2?e.length-2-i:i,s=e[r],l=e[r+1];(t.get(l)?.get(s)?.cycleCount??0)<=(t.get(s)?.get(l)?.cycleCount??0)||(e[r]=l,e[r+1]=s,o=!0)}if(!o)break}return e}function Yt(e){let t=[],n=new Set;for(let o of e.values())o.outgoing.sort((i,r)=>r[1]-i[1]||i[0].tie-r[0].tie);for(let o of e.values()){if(n.has(o))continue;let i=[{node:o,next:0}];for(n.add(o);i.length>0;){let r=i.at(-1);if(r.next===r.node.outgoing.length){t.push(r.node.id),i.pop();continue}let s=r.node.outgoing[r.next++][0];n.has(s)||(n.add(s),i.push({node:s,next:0}))}}return t.toReversed()}function he(e,t){let n=new Map(e.map((i,r)=>[i,r])),o=0;for(let i of t.values())for(let[r,s]of i.outgoing)n.get(i.id)<n.get(r.id)&&(o+=s);return o}function Jt(e,t){let n=he(e,t),o=n,i=0;for(let r=0;r<e.length-1;r++)n-=t.get(e[r]).originalBalance,n>o&&(o=n,i=r+1);return[...e.slice(i),...e.slice(0,i)]}function at(e,t){if(e.length<2)return e;let n=new Map(e.map((a,u)=>[a,{id:a,tie:u,balance:0,incoming:[],outgoing:[]}]));for(let a of n.values())for(let u of t.get(a.id)?.values()??[]){let p=n.get(u.to);!p||p===a||!u.cycleCount||(a.outgoing.push([p,u.cycleCount]),p.incoming.push([a,u.cycleCount]),a.balance+=u.cycleCount,p.balance-=u.cycleCount)}for(let a of n.values())a.originalBalance=a.balance;let o=[],i=new ge(n.values()),r=[];for(;i.nodes.length>0;){let a=i.take();a.balance>=0?o.push(a.id):r.push(a.id);for(let[u,p]of a.outgoing)u.position<0||(u.balance+=p,i.update(u));for(let[u,p]of a.incoming)u.position<0||(u.balance-=p,i.update(u))}let s=e,l=he(e,n);for(let a of[[...o,...r.toReversed()],Yt(n),e,e.toReversed()]){let u=qt(Jt(a,n),t),p=he(u,n);p>l&&(s=u,l=p)}return s}function Xt(e,t){let n=new Set(e),o=new Map(e.map(a=>[a,[]]));for(let[a,u]of t)for(let p of u)n.has(a)&&n.has(p)&&o.get(p).push(a);let i=[],r=new Set;for(let a of e){if(r.has(a))continue;r.add(a);let u=[[a,(t.get(a)??[])[Symbol.iterator]()]];for(;u.length>0;){let[p,g]=u.at(-1),h=g.next();if(h.done){i.push(p),u.pop();continue}n.has(h.value)&&!r.has(h.value)&&(r.add(h.value),u.push([h.value,(t.get(h.value)??[])[Symbol.iterator]()]))}}let s=new Map,l=[];for(let a of i.toReversed()){if(s.has(a))continue;let u=[],p=l.length,g=[a];for(s.set(a,p);g.length>0;){let h=g.pop();u.push(h);for(let y of o.get(h))s.has(y)||(s.set(y,p),g.push(y))}l.push(u.toSorted())}return{groups:l,componentOf:s}}function Uo(e,{expanded:t=new Set,order:n="structure",query:o="",neighborhood:i=null,cyclesOnly:r=!1}={}){let s=new Map,l=new Map,a=new Map;for(let c of e.nodes){let d=t.has(c.pkg),f=`${d?"f":"p"}:${d?c.file:c.pkg}`;s.has(f)||s.set(f,{id:f,pkg:c.pkg,file:d?c.file:null,label:d?c.file:Ie(c.pkg),files:[],size:0,issues:0,incoming:0,outgoing:0,importers:0,dependencies:0});let v=s.get(f);v.files.push(c.file),v.size+=c.size??0,v.issues+=c.totalIssues??0,l.set(c.file,f),a.set(c.file,c.origFile??c.file)}let u=new Map,p=new Set,g=new Set,h=new Map([...s.keys()].map(c=>[c,new Set])),y=0;for(let[c,d]of e.importsOf){let f=l.get(c);if(f)for(let v of new Set(d)){let b=l.get(v);if(!b)continue;u.has(f)||u.set(f,new Map),u.get(f).has(b)||u.get(f).set(b,{from:f,to:b,count:0,cycleCount:0,examples:[]});let k=u.get(f).get(b);k.count++;let E=de(a.get(c),a.get(v),e.ownSourceFiles?.has(v),e.ownSourceFiles?.has(c));k.examples.length<80&&(!r||E)&&k.examples.push([c,v]),y++,s.get(f).outgoing++,s.get(b).incoming++,f!==b&&(g.add(f),p.add(b)),E&&(k.cycleCount++,(f!==b||s.get(f).file)&&h.get(f).add(b))}}let w=[...s.keys()].toSorted(),{groups:m,componentOf:x}=Xt(w,h),$=new Set(m.flatMap(c=>c.length>1||h.get(c[0]).has(c[0])?c:[]));for(let c of s.values())c.cyclic=$.has(c.id),c.component=x.get(c.id);let R=e.ownSourcePackages??new Set(e.layerRoots?.roots??[]),T=c=>c.pkg==="__own__"?0:R.has(c.pkg)?1:2,j=c=>p.has(c.id)&&g.has(c.id)?0:1,me=new Map(m.map((c,d)=>[d,c.reduce((f,v)=>Math.min(f,T(s.get(v))),2)])),F=(c,d)=>c.pkg.localeCompare(d.pkg)||c.label.localeCompare(d.label),J=new Map;if(n==="structure"){for(let c of m)if(!(c.length<2))for(let d of Map.groupBy(c,f=>T(s.get(f))).values()){let f=d.toSorted((v,b)=>F(s.get(v),s.get(b)));at(f,u).forEach((v,b)=>J.set(v,b))}}if(r){y=0,p.clear(),g.clear();for(let c of s.values())c.incoming=0,c.outgoing=0}for(let[c,d]of u){for(let f of d.values())if(f.cyclic=f.cycleCount>0&&$.has(c)&&x.get(c)===x.get(f.to)&&(c!==f.to||s.get(c).file!==null),!!r){if(!f.cyclic){d.delete(f.to);continue}f.count=f.cycleCount,y+=f.count,s.get(c).outgoing+=f.count,s.get(f.to).incoming+=f.count,c!==f.to&&(g.add(c),p.add(f.to))}d.size===0&&u.delete(c)}for(let[c,d]of u)for(let f of d.keys())c!==f&&(s.get(c).dependencies++,s.get(f).importers++);let D=o.trim().toLowerCase(),O=new Set(w.filter(c=>!D||s.get(c).files.some(d=>d.toLowerCase().includes(D))||s.get(c).label.toLowerCase().includes(D))),X=new Set(i?[i]:O);if(D||i)for(let[c,d]of u)for(let f of d.keys())(i?c===i:O.has(c))&&X.add(f),(i?f===i:O.has(f))&&X.add(c);let lt=(c,d)=>{if(n==="structure"){let b=me.get(c.component)-me.get(d.component);if(b)return b;let k=j(c)-j(d);if(k)return k;let E=c.component-d.component;if(E)return E}let f=T(c)-T(d);if(f)return f;if(n==="importers")return d.importers-c.importers||F(c,d);if(n==="imports")return d.dependencies-c.dependencies||F(c,d);let v=j(c)-j(d);if(v)return v;if(n==="structure"&&c.component===d.component){let b=(J.get(c.id)??0)-(J.get(d.id)??0);if(b)return b}return F(c,d)},be=[...s.values()].filter(c=>X.has(c.id)&&(!r||c.cyclic)).toSorted(lt),_=new Map(be.map((c,d)=>[c.id,d])),we=[];for(let[c,d]of u)if(_.has(c))for(let f of d.values())_.has(f.to)&&we.push({...f,row:_.get(c),col:_.get(f.to)});return{rows:be,byId:s,cells:u,visibleCells:we,index:_,matches:O,importCount:y,totalRows:s.size,cycleCount:m.filter(c=>$.has(c[0])).length}}export{tn as a,ln as b,H as c,ne as d,K as e,Ae as f,ft as g,oe as h,V as i,dt as j,gt as k,ht as l,mt as m,hn as n,jn as o,Fn as p,A as q,Dn as r,On as s,bt as t,Nn as u,Pn as v,Un as w,Bn as x,Gn as y,Ze as z,q as A,zn as B,Hn as C,Vn as D,Kn as E,Wn as F,Zn as G,qn as H,Yn as I,W as J,Jn as K,Xn as L,Qn as M,eo as N,se as O,to as P,no as Q,oo as R,Ft as S,io as T,ro as U,so as V,co as W,ao as X,Ht as Y,Vt as Z,lo as _,Y as $,po as aa,mo as ba,bo as ca,wo as da,vo as ea,yo as fa,ko as ga,Ro as ha,So as ia,_o as ja,Eo as ka,tt as la,de as ma,jo as na,at as oa,Xt as pa,Uo as qa};
|
|
24
|
-
/*! Bundled license information:
|
|
25
|
-
|
|
26
|
-
lit-html/directives/class-map.js:
|
|
27
|
-
lit-html/directives/style-map.js:
|
|
28
|
-
(**
|
|
29
|
-
* @license
|
|
30
|
-
* Copyright 2018 Google LLC
|
|
31
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
-
*)
|
|
33
|
-
*/
|
package/out/chunk-FK3DZEKL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,d as x,j as y}from"./chunk-EDKLBQQN.js";function d(){let t=new(x?Uint32Array:Int32Array)(4096);for(let r=0;r<256;r++){let f=r;for(let o=0;o<8;o++)f=f&1?3988292384^f>>>1:f>>>1;t[r]=f}for(let r=0;r<256;r++){let f=t[r];for(let o=256+r;o<t.length;o+=256)f=t[o]=f>>>8^t[f&255]}return t}var e=d(),[a,u,A,g,h,w,U,H,I,O,j,v,E,L,W,k]=Array.from({length:16},(t,r)=>e.subarray(r*256,r*256+256));function F(t){y(t);let r=-1,f=0,o=t.length;if(b&&o>1024){let n=4-(t.byteOffset&3)&3;for(;f<n;f++)r=a[(r^t[f])&255]^r>>>8;let m=o-f>>>2,s=new(x?Uint32Array:Int32Array)(t.buffer,t.byteOffset+f,m),c=0;for(let p=m-3;c<p;c+=4){let T=s[c]^r,_=s[c+1],l=s[c+2],i=s[c+3];r=e[3840+(T&255)]^e[3584+(T>>>8&255)]^e[3328+(T>>>16&255)]^e[3072+(T>>>24)]^e[2816+(_&255)]^e[2560+(_>>>8&255)]^e[2304+(_>>>16&255)]^e[2048+(_>>>24)]^e[1792+(l&255)]^e[1536+(l>>>8&255)]^e[1280+(l>>>16&255)]^e[1024+(l>>>24)]^e[768+(i&255)]^e[512+(i>>>8&255)]^e[256+(i>>>16&255)]^e[i>>>24]}f+=c*4}else for(let n=o-15;f<n;f+=16)r=k[(t[f]^r)&255]^W[(t[f+1]^r>>>8)&255]^L[(t[f+2]^r>>>16)&255]^E[t[f+3]^r>>>24]^v[t[f+4]]^j[t[f+5]]^O[t[f+6]]^I[t[f+7]]^H[t[f+8]]^U[t[f+9]]^w[t[f+10]]^h[t[f+11]]^g[t[f+12]]^A[t[f+13]]^u[t[f+14]]^a[t[f+15]];for(let n=f;n<o;n++)r=a[(r^t[n])&255]^r>>>8;return~r>>>0}export{F as a};
|
package/out/chunk-G6AJWENO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as a,d as b}from"./chunk-QWDWTBM7.js";import"./chunk-CH4UN6WK.js";import"./chunk-JCIIBLKR.js";import"./chunk-K3X5EJBQ.js";import"./chunk-CVVJAXVY.js";import"./chunk-VIHGO77Y.js";import"./chunk-SWTLADW5.js";import"./chunk-2ABLKCOY.js";import"./chunk-ZESLQCTF.js";import"./chunk-UYAXVRVL.js";import"./chunk-NRPC74AM.js";import"./chunk-LPCTJYNA.js";import"./chunk-W4J3MGLB.js";import"./chunk-GJ4IUCNS.js";import"./chunk-PNHBZGDD.js";import"./chunk-F47DXCEV.js";import"./chunk-R5O6FAW4.js";import"./chunk-CMQA4DM6.js";import"./chunk-AJ4GTATZ.js";import"./chunk-R75XOKUP.js";import"./chunk-OD4LPN3H.js";import"./chunk-4XCDFGDP.js";import"./chunk-3BZ7JERB.js";import"./chunk-TZ5KB2Y5.js";import"./chunk-XYFXXB2G.js";import"./chunk-DIJJNTRH.js";import"./chunk-QYWKC557.js";import"./chunk-GNXOKIGP.js";import"./chunk-C4Z6ZBXV.js";import"./chunk-2XUEZHIP.js";import"./chunk-TUII34K2.js";import"./chunk-V5O7M2YT.js";import"./chunk-OOJM4CTU.js";export{a as revealFinding,b as revealFindingInReport};
|
package/out/chunk-GJ4IUCNS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
async function e(t){let a=await crypto.subtle.digest("SHA-512",t);return`sha512-${new Uint8Array(a).toBase64()}`}export{e as a};
|
package/out/chunk-GNXOKIGP.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
var yn=new TextEncoder;function Oe(e){if(typeof e!="string")throw new TypeError(`encodeUtf8 expects a string, got ${typeof e}`);if(!e.isWellFormed())throw new TypeError("encodeUtf8: input contains lone surrogates");return yn.encode(e)}async function xn(e){let t=typeof e=="string"?Oe(e):e,n=new Uint8Array(await crypto.subtle.digest("SHA-512",t));return`sha512-${btoa(String.fromCodePoint(...n))}`}async function Sn(e){let t=Oe(JSON.stringify(e)),n=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(n,0,16);r[6]=r[6]&15|64,r[8]=r[8]&63|128;let i=Array.from(r,o=>o.toString(16).padStart(2,"0")).join("");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20,32)}`}async function Fe(e){if(typeof crypto?.subtle?.digest!="function")return null;let t=ne(e);try{return await Sn(t)}catch{return null}}function ne(e){if(e._idBasis)return e._idBasis;let{severity:t,description:n}=e;return e.fileHash?{severity:t,description:n,fileHash:e.fileHash}:e.location?{severity:t,description:n,location:e.location}:{severity:t,description:n,file:e.file,line:e.line}}var pe=new Map([["CRITICAL","critical"],["HIGH","high"],["MEDIUM","medium"],["LOW","low"],["INFO","informational"],["INFORMATIONAL","informational"],["INFORMATIVE","informative"]]);function C(e){return typeof e=="string"&&e.trim().toLowerCase()==="informative"?"informational":e}function E(e,t=e.severity){let n=C(e.severity);return n!==e.severity&&(!e.id&&!e._idBasis&&(e._idBasis=ne({...e,severity:t})),e.severity=n),e.correctedSeverity!==void 0&&(e.correctedSeverity=C(e.correctedSeverity)),e}var de={critical:"Critical",high:"High",medium:"Medium",low:"Low",high_bug:"High bug",bug:"Bug",informational:"Informational"},me={inprogress:"In progress",fixed:"Fixed",invalid:"Invalid",deleted:"Deleted",ignored:"Ignored"},Be={red:"Red",blue:"Blue",green:"Green",gray:"Gray",none:"Unmarked"},_={"claude-security":"Claude Security","codex-security":"Codex Security",deepsec:"DeepSec",piolium:"Piolium","markdown-generic":"Markdown (generic)"};function k(e){return de[C(e)]??String(e??"")}var gt=/^( *)(`{3,}|~{3,})(.*)$/u,vn=/^ {0,3}(?:#{1,6}(?:[ \t]|$)|>|([-*_])(?:[ \t]*\1){2,}[ \t]*$)/u,mt=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u,wn=/^ {0,3}(?:=+|-+)[ \t]*$/u,j=/^( *)(?:[-*+]|\d{1,9}[.)]) +(?=\S)/u,bn=/^ *(?:[-*+]|\d{1,9}[.)])[ \t]*$/u,ht=/^\s*$/u,En=[[/^<(script|pre|textarea|style)(?:\s|>|$)/iu,/<\/(?:script|pre|textarea|style)>/iu,e=>`</${e[1].toLowerCase()}>`],[/^<!--/u,/-->/u,"-->"],[/^<\?/u,/\?>/u,"?>"],[/^<![A-Za-z]/u,/>/u,"<!-- -->"],[/^<!\[CDATA\[/u,/\]\]>/u,"]]>"],[/^<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|search|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/iu,ht,null]],$n=/^(?:<[A-Za-z][\dA-Za-z-]*(?:\s+[:A-Z_a-z][\w.:-]*(?:\s*=\s*(?:[^\s"'<=>`]+|'[^']*'|"[^"]*"))?)*\s*\/?>|<\/[A-Za-z][\dA-Za-z-]*\s*>)\s*$/u;function ge(e,t,n=t){let r=/^ */u.exec(e)[0].length;if(r>3)return null;if(t&&n&&wn.test(e))return!0;let i=gt.exec(e);if(i&&!(i[2][0]==="`"&&i[3].includes("`")))return{fence:i[2]};let o=e.slice(r);for(let[l,a,u]of En){let p=l.exec(o);if(p)return{html:a,close:typeof u=="function"?u(p):u}}if(!t&&$n.test(o))return{html:ht,close:null};let s=mt.test(e)?null:j.exec(e);if(s&&!(t&&n&&/^ *(?:\d*[02-9]|\d+\d)[.)]/u.test(s[0]))){let l=/ +$/u.exec(s[0])[0].length;return{item:l>4?s[0].length-l+1:s[0].length}}let c=mt.test(e)||t&&n?null:bn.exec(e);return c?{item:c[0].trimEnd().length+1}:vn.test(e)||null}function I(e){return he(e).ranges}function Rn(e,t){let n=e.replace(/^(?: {0,3}> ?)+/u,""),r=ge(n,t);for(;r?.item;)n=n.slice(r.item),r=ge(n,!1);return n.trim()!==""&&!r&&/^ */u.exec(n)[0].length<4}function he(e){let t=[],n=-1,r="",i=null,o=0,s=[],c=!1,l=!1,a=!1,u=0;for(let f of e.split(`
|
|
2
|
-
`)){let m=u;u+=f.length+1;let h=/^ */u.exec(f)[0].length;if(n!==-1||i){let $=o>0&&f.trim()!==""&&h<o,w=!$&&(i?i.ends.test(f):h<=o+3&&yt(r,f));if(($||w)&&(n!==-1&&t.push([n,$?m-1:m+f.length]),n=-1,i=null),!$)continue}if(!f.trim()){a&&s.pop(),a=!1,c=!1;continue}let d=s.length;for(;d>0&&h<s[d-1];)d--;let g=d>0?s[d-1]:0,y=f.slice(g),S=ge(y,c,d===s.length&&!l);if(c&&!S)continue;for(s.length=d;S?.item;)g+=S.item,y=y.slice(S.item),s.push(g),S=ge(y,!1);a=y.trim()==="",S?.fence?[n,r,o]=[m,S.fence,g]:S?.html&&([i,o]=[S.html.test(y)?null:{ends:S.html,close:S.close},g]);let x=c&&l;l=/^ {0,3}>/u.test(y),c=l?Rn(y,x):!S&&!a&&/^ */u.exec(y)[0].length<4}n!==-1&&t.push([n,e.length]);let p=n===-1?i?.close:r;return{ranges:t,closer:p?" ".repeat(o)+p:null}}function yt(e,t){let n=gt.exec(t);return n!==null&&n[2][0]===e[0]&&n[2].length>=e.length&&!n[3].trim()}function F(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i][1]<=t?n=i+1:r=i}return n<e.length&&t>=e[n][0]}function R(e){return String(e??"").replaceAll(/\r\n?/gu,`
|
|
3
|
-
`)}var ye=/^## +(.*)$/gmu,ie=/^### +(.*)$/gmu,B=/^#### +(.*)$/gmu,xt=/^##### +(.*)$/gmu,De=/^(.+):(\d+(?:-\d+)?)$/u;function W(e){return/^[0-9a-f]{7,64}$/iu.test(e)}function St(e,t){let n=I(e);return[...e.matchAll(t)].filter(r=>!F(n,r.index))}function K(e,t){let n=St(e,t);return[e.slice(0,n[0]?.index),...n.map((r,i)=>e.slice(r.index+r[0].length,n[i+1]?.index))]}function D(e,t){let n=St(e,t);return{head:e.slice(0,n[0]?.index),subs:n.map((r,i)=>({heading:r[1],body:e.slice(r.index+r[0].length+1,n[i+1]?.index)}))}}function N(e,t){return D(e,t).subs}function H(e){let t=e.indexOf(`
|
|
4
|
-
`);return t===-1?{title:e.trim(),body:""}:{title:e.slice(0,t).trim(),body:e.slice(t+1)}}function re(e){let t=e.split(`
|
|
5
|
-
`).map(r=>r.trim()).filter(r=>r.startsWith("|")&&!(/^[\s:|-]+$/u.test(r)&&r.includes("-"))).map(r=>r.replace(/^\|/u,"").replace(/\|$/u,"").split("|").map(i=>i.trim()));if(t.length<2)return[];let n=t[0].map(r=>r.toLowerCase());return t.slice(1).filter(r=>r.length!==n.length||r.some((i,o)=>i.toLowerCase()!==n[o])).map(r=>Object.fromEntries(n.flatMap((i,o)=>i?[[i,r[o]??""]]:[])))}function vt(e){let t=Object.create(null),n=Object.create(null),r=[],i=null,o="",s=[],c="",l=(p,f,m)=>{!p||p in t||(t[p]=m.trim(),n[p]=f)},a=()=>{i&&l(i,o,s.join(`
|
|
6
|
-
`)),i=null,o="",s=[]},u=p=>{(i?s:r).push(p)};for(let p of e.split(`
|
|
7
|
-
`)){let f=/^ {0,3}(```|~~~)/u.exec(p),m=f!==null&&(!c||f[1]===c);if(m&&(c=c?"":f[1]),m||c){u(p);continue}if(!p.trim()){i?a():r.push(p);continue}let h=/^\s*(?:[-*] +)?\*\*([^:*]+):\*\*\s*(.*)$/u.exec(p);if(h){a();let d=h[1].trim(),g=h[2],y;for(;(y=/\s+[·•]\s+\*\*([^:*]+):\*\*\s*/u.exec(g))!==null;)l(d.toLowerCase(),d,g.slice(0,y.index)),d=y[1].trim(),g=g.slice(y.index+y[0].length);i=d.toLowerCase(),o=d,s=[g];continue}if(/^\s*(?:#{1,6} |\||[-=*_]{3,}\s*$)/u.test(p)){a();continue}u(p)}return a(),{fields:t,labels:n,prose:r.join(`
|
|
8
|
-
`).trim()}}function wt(e){let t=(e||"").trim(),n="",r=Y(t);r&&(t=r.label.trim(),n=r.url.trim());let i=/#L(\d+)/u.exec(n)?.[1]??"",c=[...t.matchAll(/`([^`]+)`/gu)].map(u=>u[1].trim()).find(u=>!u.includes("(")&&(u.includes("/")||/\.\w/u.test(u)))??(t.replaceAll("`","").trim().split(/[\s,]+/u).find(Boolean)||""),l=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(c);l&&(c=l[1],i||(i=l[2]));let a=De.exec(c);return a?(i||(i=a[2]),{file:a[1],line:i,locationLink:n}):{file:c,line:i||"?",locationLink:n}}function Ne(e){return e.replaceAll("**","")}function Y(e){let t=String(e??""),n=Ln(t,An(t)),r=Cn(t),i=t.indexOf("]");for(let o=t.indexOf("[");o!==-1;o=t.indexOf("[",o+1)){for(;i!==-1&&i<=o;)i=t.indexOf("]",i+1);for(let s of[i,n.get(o)??-1]){if(s===-1||s===o+1||t[s+1]!=="(")continue;let c=_n(t,s+1,r);if(c!==null)return{label:t.slice(o+1,s),url:c,index:o}}}return null}function Ln(e,t){let n=new Map,r=[];for(let i=0;i<e.length;i++){let o=e[i];bt(e,i)?i++:o==="`"?i=t.get(i)??i:o==="["?r.push(i):o==="]"&&r.length>0&&n.set(r.pop(),i)}return n}function An(e){let t=[];for(let i=e.indexOf("`");i!==-1;i=e.indexOf("`",i)){let o=1;for(;e[i+o]==="`";)o++;t.push([i,o]),i+=o}let n=new Map,r=new Map;for(let i=t.length-1;i>=0;i--){let[o,s]=t[i],c=r.get(s);c!==void 0&&n.set(o,c+s-1),r.set(s,o)}return n}function Cn(e){let t=e.length,n=new Int32Array(t+1).fill(-1),r=new Int32Array(t+1).fill(-1),i=new Int32Array(t+1).fill(-1),o=new Int32Array(t+1).fill(-1);for(let l=t-1;l>=0;l--)n[l]=e[l]===")"?l:n[l+1],r[l]=/\s/u.test(e[l])?l:r[l+1],i[l]=e[l]===">"?l:i[l+1],o[l]=e[l]===`
|
|
9
|
-
`?l:o[l+1];let s=new Map,c=[];for(let l=0;l<t;l++){let a=e[l];bt(e,l)?l++:r[l]===l?c.length=0:a==="("?c.push(l):a===")"&&c.length>0&&s.set(c.pop(),l)}return{balanced:s,nextClose:n,nextSpace:r,nextAngle:i,nextLine:o}}function _n(e,t,n){let r=kn(e,t,n);if(r)return r;let i=n.balanced.get(t);if(i!==void 0)return i>t+1?e.slice(t+1,i):null;let o=n.nextClose[t+1],s=n.nextSpace[t+1];return o===-1||o===t+1||s!==-1&&s<o?null:e.slice(t+1,o)}function kn(e,t,n){if(e[t+1]!=="<")return"";let r=n.nextAngle[t+2],i=n.nextLine[t+2];return r===-1||i!==-1&&i<r||e[r+1]!==")"?"":e.slice(t+2,r)}var In=/\\([!-/:-@[-`{-~])/gu,Tn=/[!-/:-@[-`{-~]/u;function bt(e,t){return e[t]==="\\"&&Tn.test(e[t+1]??"")}function ze(e){return typeof e=="string"?e.replace(In,"$1"):e}function Et(e){let t=/^\[(.+)\]$/u.exec(e.trim());return t?t[1].trim():e.trim()}function U(e){let t=(e||"").trim();return/^[-–—]+$/u.test(t)?"":t}var $t={critical:6,high:5,medium:4,low:3,high_bug:2,bug:1,informational:0},Z=["critical","high","medium","low","high_bug","bug","informational"];function Rt(e){return e=C(e),e!=null&&e in $t?e:null}function xe(e){return Rt(e?.correctedSeverity)??C(e?.severity)}function Se(e){let t=Rt(e?.correctedSeverity);return t!=null&&t!==C(e?.severity)}function oe(e,t){return t==="original"?C(e?.severity):xe(e)}function je(e){let t=e?._correctedByReport;return t&&new Set(Object.values(t).map(r=>C(r?.severity))).size>1?t:null}var ve=["revalidation","refuted","unreachable","confirmed","partial","unknown"],Mn=new Set(ve);function se(e){return Mn.has(e?.revalidate)?e.revalidate:""}function On(e,t=e?.source){return Object.hasOwn(_,t)||se(e)==="revalidation"}function He(e,t=e?._source??e?.source){let n=typeof t=="string"&&t!==""&&t!=="deepview",r=n?t:e?.analyzer??e?.type??e?._analyzer;return e?.security===!0||(r==="security"||r==="dependencies")&&e?.security!==!1||n&&["critical","high","medium","low"].includes(e?.severity)}function Lt(e){return e&&e.replace(/^[^/]+\//u,"").replace(/^claude-/u,"").replaceAll("-"," ")}function Ue(e,t=!0){let n=t&&se(e)==="revalidation"?"revalidate":"";return[e?.type,n,Lt(e?.model),e?.effort,e?.exportsMode].filter(Boolean).join(" \xB7 ")}function q(e,t){if(!e)return e;let n=e;t?.exportsMode==="isolate"&&(n=n.replace(/^\((?:[^()]|\([^()]*\))*\): \[export:\s*\w+\] /u,""),n=n.replace(/^\[export:\s*\w+\] /u,""));let r=[t?.exportName,t?.methodName].filter(Boolean).map(i=>i.replaceAll(/[.*+?^${}()|[\]\\]/gu,"\\$&"));for(let i of r)n=n.replaceAll(new RegExp(`\\[export:\\s*${i}\\]\\s*`,"gu"),"");for(let i of r)n=n.replace(new RegExp(`^\\(\`?${i}\`?\\): `,"u"),"");return n}function Ve(e){let t=e?.exportName,n=e?.methodName;return t&&n&&t!==n?`${t}.${n}`:t||n||""}function J(e){return e?e.split(`
|
|
10
|
-
`).find(t=>t.trim())?.trim()??"":""}function Pe(e){return typeof e?.title=="string"?e.title.trim():""}function Q(e){return Pe(e)||J(q(e?.description,e))}function we(e){let t=q(e?.description,e)||"",n=Pe(e);if(n){let o=t.trim(),s=H(o);return{title:n,body:s.title===n?s.body.replace(/^\s+/u,""):o}}let r=t.indexOf(`
|
|
11
|
-
`);if(r<0)return{title:"",body:t};if(I(t.slice(0,r))[0]?.[0]===0)return{title:"",body:t};let i=t.slice(r+1).replace(/^\s+/u,"");return i?{title:t.slice(0,r).trim(),body:i}:{title:"",body:t}}function Fn(e){let t=Pe(e);if(!t)return q(e?.description,e)||"";let{body:n}=we(e);return n?`${t}
|
|
12
|
-
|
|
13
|
-
${n}`:t}var Bn=/^\*\*([^*\n]+):\*\*[ \t]*/u;function Ge(e){let t=[];for(let n of K(e||"",/\n{2,}/gu)){if(!n.trim())continue;let r=Bn.exec(n);if(r){t.push({label:r[1].trim(),body:n.slice(r[0].length).trim()});continue}let i=t.at(-1);i&&i.label===null?i.body+=`
|
|
14
|
-
|
|
15
|
-
${n}`:t.push({label:null,body:n})}return t}function T(e){return Number.isFinite(parseInt(e?.line,10))?`${e.file}:${e.line}`:e?.file??""}function We(e){let t=n=>typeof n=="string"?n:"";return`${t(e?.observation)}
|
|
16
|
-
${t(e?.text)}`.trim()}function A(e){if(typeof e!="string"||e.length===0)return!1;try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function Ke(e){return String(e??"").replaceAll(/\s*\n\s*/gu," ").replaceAll("|","\\|").trim()}function b(e){let t=String(e??"");if(t==="")return"";let n=Math.max(0,...[...t.matchAll(/`+/gu)].map(o=>o[0].length)),r="`".repeat(n+1),i=t.startsWith("`")||t.endsWith("`")?" ":"";return`${r}${i}${t}${i}${r}`}function At(e){return String(e??"").replaceAll(/[[\]]/gu,"\\$&")}function V(e,t){let n=/[\s()<>]/u.test(t)?`<${t.replaceAll(">","%3E")}>`:t;return`[${e}](${n})`}function be(e){return A(e)?`<${e}>`:String(e??"")}function Ct(e,t){let n=String(e??"").toLowerCase().replaceAll(/[^\p{L}\p{N}\p{M}\s_-]/gu,"").replaceAll(/\s/gu,"-"),r=n;for(let i=1;t.has(r);i++)r=`${n}-${i}`;return t.add(r),r}function M(e,t){return`${"#".repeat(Math.min(6,Math.max(1,e)))} ${t}`}function Ye(e,t,n=[]){let r=e.map((i,o)=>n[o]==="right"?"---:":"---");return[e,r,...t].map(i=>`| ${i.join(" | ")} |`).join(`
|
|
17
|
-
`)}function _t(e){let t=e instanceof Date?e:new Date(e);if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getUTCFullYear()}-${n(t.getUTCMonth()+1)}-${n(t.getUTCDate())} ${n(t.getUTCHours())}:${n(t.getUTCMinutes())} UTC`}function X(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function ce(e){return e.filter(t=>typeof t=="string"&&t.trim()).map(t=>t.replace(/\s+$/u,"")).join(`
|
|
18
|
-
|
|
19
|
-
`)}var Dn=/^( {0,3})(\\*#)/u;function ee(e){let t=R(e).trim();if(!t)return"";let n=kt(t,i=>i.replace(Dn,"$1\\$2")),{closer:r}=he(n);return r===null?n:`${n}
|
|
20
|
-
${r}`}function kt(e,t){let n=I(e),r=0;return e.split(`
|
|
21
|
-
`).map(i=>{let o=r;return r+=i.length+1,F(n,o)?i:t(i)}).join(`
|
|
22
|
-
`)}function P(e){return kt(String(e??""),t=>t.replace(/^( {0,3})\\(\\*#)/u,"$1$2"))}function It(e,t){let n=" ".repeat(e.length);return t.split(`
|
|
23
|
-
`).map(r=>r?n+r:"").join(`
|
|
24
|
-
`)}var Nn=/^## ([A-Z][A-Z_]*)\s*\(\d+\)\s*\n/mu,zn=new Map([...pe,["HIGH_BUG","high_bug"],["BUG","bug"]]),Ot=e=>String(e??"").toLowerCase().replaceAll(/[^a-z]+/gu,""),Tt=new Map([["high",8],["medium",6],["low",4]]);function jn(e){if(e!==void 0)return Tt.get(Ot(e))??Tt.get("medium")}var Hn=new Map([["confirmed","confirmed"],["falsepositive","refuted"],["uncertain","unknown"]]);function Ft(e){let n=R(e).trim().split(Nn);if(n.length===1)return null;let r=[];for(let i=1;i<n.length;i+=2){let o=zn.get(n[i].toUpperCase())??"medium";for(let s of K(n[i+1],/^### /gmu).slice(1)){let c=Mt(s,o);if(!c)continue;let l=s.indexOf(`
|
|
25
|
-
### `);l!==-1&&(c._idBasis=ne(Mt(s.slice(0,l+1),o))),r.push(c)}}return r.length===0?null:{type:"security",source:"deepsec",findings:r}}function Mt(e,t){let{title:n,body:r}=H(e);if(!n)return null;let i=r.replace(/\n---\s*$/u,"").trim(),o=Object.fromEntries([...i.matchAll(/^- \*\*([^:*]+):\*\*\s*(.+)$/gmu)].map(g=>[g[1].trim().toLowerCase(),g[2].trim()])),s=/^\*\*Recommendation:\*\*\s*/mu.exec(i),c=s?i.slice(0,s.index):i,l=s?i.slice(s.index+s[0].length).trim():"",a=c.split(`
|
|
26
|
-
`).filter(g=>!/^\s*- \*\*/u.test(g)).join(`
|
|
27
|
-
`).replaceAll("**","").trim(),u=[n,a].filter(Boolean).join(`
|
|
28
|
-
|
|
29
|
-
`),p=(o.file||"unknown").replace(/^`(.*)`$/u,"$1"),f=(o.lines||"").split(",").map(g=>g.trim()).find(Boolean)||"?",m={file:p,line:f,severity:t,description:u};l&&(m.recommendation=l.replaceAll("**",""));let h=jn(o.confidence);h!==void 0&&(m.confidence=h);let d=Hn.get(Ot(o.revalidation));return d&&(m.revalidate=d,m.revalidateSource="deepsec",o.reasoning&&(m.revalidateVerdict=o.reasoning.replaceAll("**",""))),o.slug&&(m.slug=o.slug),E(m,t==="informative"?"medium":t)}var Bt=["type","model","think","effort","exportsMode"];function Un(e,t){if(!t.source)for(let n of Bt)e[n]==null&&t[n]!=null&&(e[n]=t[n])}var Vn=/^(?:https?:\/\/)?(?:www\.)?github\.com\/([^/?#]+)\/([^/?#]+?)(?:\.git)?(?:[/?#].*)?$/iu,Pn=/^[\w.-]+\/[\w.-]+$/u;function le(e){return Pn.test(e)}function Gn(e){let t=e?.repo?.github;if(typeof t!="string")return null;let n=t.trim().replace(/\/+$/u,"");if(!n)return null;let r=Vn.exec(n),i=(r?`${r[1]}/${r[2]}`:n).replace(/\.git$/u,"");return le(i)?i:null}function Wn(e){let n=(typeof e?.directory=="string"?e.directory.trim():"").replace(/^(?:\.\/)+/u,"").replaceAll(/^\/+|\/+$/gu,"").replaceAll(/\/{2,}/gu,"/");return!n||n==="."||/[?#]/u.test(n)||n.split("/").includes("..")?"":n}var Ze=120;function zt(e){let t=Q(e)||T(e)||"Untitled finding";return t.length>Ze?`${t.slice(0,Ze-1).trimEnd()}\u2026`:t}function qe(e){let t=String(e??"").trim();return A(t)?be(t):le(t)?V(t,`https://github.com/${t}`):t}function jt(e,t,n){return t?_[t]??String(t):Ue(e,n)}var Je=[["Impact","impact",!1],["Reproduction","reproduction",!1],["Recommendation","recommendation",!1],["Confidence reasoning","confidenceReason",!1],["Revalidation verdict","revalidateVerdict",!0],["Revalidation recommendation","revalidateRecommendation",!0]],Qe=[["Status","status"],["Branch","branch"],["Date created","dateCreated"],["Detected at","detectedAt"],["Committed at","committedAt"],["PoC status","pocStatus"],["Variant of","parent"],["Slug","slug"],["Priority","priority"]],Xe=[["Detailed report","reportPath"],["Commit audited","auditedCommit"],["ID","id"]];function O(e){return typeof e=="number"?Number.isFinite(e)?String(e):"":typeof e=="string"?e.replaceAll(/\s*\n\s*/gu," ").trim():""}function Dt(e){return typeof e=="string"?e.trim():""}function Kn(e,t){let n=t.severityMode==="original",r=k(oe(e,t.severityMode));Se(e)&&(r+=n?` \u2014 corrected to ${k(xe(e))}`:` \u2014 corrected from ${k(e.severity)}`);let i=je(e);if(i){let o=Object.entries(i).map(([s,c])=>`${s||"this report"}: ${k(c?.severity)}`);r+=` (varies across reports \u2014 ${o.join("; ")})`}return e.critical===!0&&(r+=" \xB7 flagged critical by the analyzer"),r}function Yn(e,t){let n=T(e);if(!n)return"";let r=t.hooks.location(e),i=A(r)?V(b(n),r):b(n),o=Ve(e);return o?`${i} \xB7 ${b(o)}`:i}function Zn(e){if(!e)return"";let t=[],n=me[e.triage]??(e.ignored?me.ignored:"");return n&&t.push(n),e.color&&t.push(`${Be[e.color]??e.color} mark`),e.flagged===!0&&t.push("Flagged"),t.join(" \xB7 ")}function qn(e,t){let n=O(e.commitHash);if(!n)return"";let r=t.hooks.commit(e);return A(r)?V(b(n.slice(0,7)),r):b(n)}function Jn(e,t,n){let r=[],i=(p,f)=>{f&&r.push(`- **${p}:** ${f}`)};i("Location",Yn(e,t)),i("Severity",Kn(e,t)),e.confidence!==void 0&&e.confidence!==null&&i("Confidence",`${e.confidence}/10`),t.showAnalyzer&&i("Analyzer",t.analyzerOf(e)),i("Category",O(e.category));let o=t.revalidation?se(e):"";o&&i("Revalidation",o==="revalidation"?"the revalidation pass itself":o);let s=O(e.revalidateSource);o&&i("Revalidated by",_[s]??s),i("Triage",Zn(n)),n?.fix&&i("Fix",be(String(n.fix).trim())),t.showReport&&i("Report",b(t.hooks.report(e)??""));let c=O(e.repo?.github);c&&c!==t.repo&&i("Repository",qe(c)),i("Introduced in",qn(e,t));let l=O(e.discoveredIn);l&&l!==String(e.file??"").trim()&&i("Found while analyzing",b(l));let a=e.package?.npm,u=O(a?.name);u&&i("Package",b(O(a.version)?`${u}@${O(a.version)}`:u));for(let[p,f]of Qe)i(p,O(e[f]));for(let[p,f]of Xe)i(p,b(O(e[f])));return r.join(`
|
|
30
|
-
`)}function Ee(e,t,n){let r=ee(n);return r?`${M(e,t)}
|
|
31
|
-
|
|
32
|
-
${r}`:M(e,t)}function Qn(e,t){return(Array.isArray(e.evidence)?e.evidence:[]).map((r,i)=>{let o=`${i+1}. `,s=T(r),c=t.hooks.evidence(r,e,i),l="";s?l=A(c)?V(b(s),c):b(s):A(c)&&(l=be(c));let a=ee(We(r)),u=o+(l||"(no reference)");return a?`${u}
|
|
33
|
-
|
|
34
|
-
${It(o,a)}`:u}).join(`
|
|
35
|
-
|
|
36
|
-
`)}function Xn(e,t,n){let r=we(e),i=R(r.body),o=Q(e),s=o.length>Ze,c=!s&&!r.title&&i.trim()===o,l=s&&J(i)!==o?`${o}
|
|
37
|
-
|
|
38
|
-
${i}`:i,a=Ge(c?"":l),u=a.findIndex(d=>d.label!==null),p=u===-1?a:a.slice(0,u),f=u===-1?[]:a.slice(u),m=p.map(d=>ee(d.body)),h=Qn(e,t);h&&m.push(`${M(n,"Evidence")}
|
|
39
|
-
|
|
40
|
-
${h}`);for(let d of f)m.push(d.label===null?ee(d.body):Ee(n,d.label,d.body));return m}function Nt(e,t,n){let r=t.hooks.annotation(e),i=[Jn(e,t,r),...Xn(e,t,n)];for(let[s,c,l]of Je){if(l&&!t.revalidation)continue;let a=e[c],u=typeof a=="string"?q(a,e):"";u.trim()&&i.push(Ee(n,s,u))}Se(e)&&Dt(e.correctedSeverityReason)&&i.push(Ee(n,"Severity correction",e.correctedSeverityReason));let o=Dt(r?.comment);return o&&i.push(Ee(n,"Comment",o)),i}function Ht(e,t,{headingText:n,depth:r}){let i=[M(r,n)];if(e.length===1)return ce([...i,...Nt(e[0],t,r+1)]);let o=[...new Set(e.map(l=>t.hooks.report(l)).filter(Boolean))],s=o.length>1?` \u2014 reported in ${o.map(l=>b(l)).join(", ")}`:"";i.push(`${X(e.length,"case")} of this finding${s}.`);let c=Q(e[0]);return e.forEach((l,a)=>{let u=T(l);i.push(M(r+1,`Case ${a+1} of ${e.length}${u?` \u2014 ${b(u)}`:""}`));let p=Q(l);p&&p!==c&&i.push(ee(p)),i.push(...Nt(l,t,r+2))}),ce(i)}var ei=new Map(Object.entries(de).map(([e,t])=>[t.toLowerCase(),e])),Vt=new Map(Object.entries(_).map(([e,t])=>[t.toLowerCase(),e]));function G(e){let t=/(`+)(.+?)\1(?!`)/u.exec(String(e??""));if(!t)return null;let n=t[2];if(n.length>2&&n.startsWith(" ")&&n.endsWith(" ")){let r=n.slice(1,-1);if(r.startsWith("`")||r.endsWith("`"))return r}return n}function Re(e){let t=Y(String(e??""));return t?.index===0?{label:t.label,url:t.url}:null}function Pt(e){let t=/^<(https?:[^>\s]*)>$/u.exec(e.trim());return t?t[1]:null}function Gt(e){let t=De.exec(e);return t?{file:t[1],line:t[2]}:{file:e,line:"?"}}function ti(e){let t=e.indexOf(".");return t>0?{exportName:e.slice(0,t),methodName:e.slice(t+1)}:{exportName:e}}function $e(e){let t=String(e??"").trim();return ei.get(t.toLowerCase())??t}function ni(e){let t={},n=e.trim(),r=/ · (`+)(.+?)\1$/u.exec(n);r&&(Object.assign(t,ti(G(r[0]))),n=n.slice(0,r.index));let i=Re(n),o=G(i?i.label:n);return o!==null&&Object.assign(t,Gt(o)),i&&A(i.url)&&(t.location=i.url),t}var Ut=" \xB7 flagged critical by the analyzer",ii=" (varies across reports \u2014 ";function ri(e){let t={},n=e.trim();n.endsWith(Ut)&&(t.critical=!0,n=n.slice(0,-Ut.length));let r=n.indexOf(ii);r!==-1&&(n=n.slice(0,r));let i=/^(.*?) — corrected (from|to) (.*)$/u.exec(n);return i?[t.severity,t.correctedSeverity]=(i[2]==="from"?[i[3],i[1]]:[i[1],i[3]]).map($e):t.severity=$e(n),t}var oi=new Set(["max","xhigh","high","medium","low","minimal"]),si=new Set(["list","isolate"]);function ci(e){return/\d/u.test(e)||/^(?:opus|sonnet|haiku|gpt|gemini|fable|mythos|llama|mistral)\b/iu.test(e)}function Le(e){let t=e.trim(),n=Vt.get(t.toLowerCase());if(n)return{source:n};let r={},i=[];for(let o of t.split(" \xB7 ").map(s=>s.trim()).filter(Boolean))o==="revalidate"&&!r.revalidate?r.revalidate="revalidation":si.has(o)&&!r.exportsMode?r.exportsMode=o:oi.has(o)&&!r.effort?r.effort=o:i.push(o);return i.length>1?[r.type,r.model]=i:i.length===1&&(r[ci(i[0])?"model":"type"]=i[0]),{run:r}}function et(e){let t=e.trim(),n=Re(t);return n?n.label.trim():Pt(t)??t}function li(e){let t=Re(e.trim());if(t){let n=t.url.split("/").at(-1)??"";return W(n)?n:G(t.label)??n}return G(e)??e.trim()}function ai(e){let t=G(e)??e.trim(),n=t.lastIndexOf("@");return{npm:n>0?{name:t.slice(0,n),version:t.slice(n+1)}:{name:t}}}function ui(e){let t=e.trim().toLowerCase();return t==="the revalidation pass itself"?"revalidation":ve.includes(t)?t:void 0}var fi=new Map([...[["Category","category"],...Qe].map(([e,t])=>[e.toLowerCase(),(n,r)=>{n[t]=r}]),...[...Xe,["Found while analyzing","discoveredIn"]].map(([e,t])=>[e.toLowerCase(),(n,r)=>{n[t]=G(r)??r}]),["location",(e,t)=>Object.assign(e,ni(t))],["severity",(e,t)=>Object.assign(e,ri(t))],["confidence",(e,t)=>{let n=/^(\d+(?:\.\d+)?)\/10$/u.exec(t);n&&(e.confidence=Number(n[1]))}],["revalidation",(e,t)=>{let n=ui(t);n&&(e.revalidate=n)}],["revalidated by",(e,t)=>{let n=t.trim();n&&(e.revalidateSource=Vt.get(n.toLowerCase())??n)}],["repository",(e,t)=>{e.repo={github:et(t)}}],["introduced in",(e,t)=>{e.commitHash=li(t)}],["package",(e,t)=>{e.package=ai(t)}],["priority",(e,t)=>{e.priority=/^-?\d+(?:\.\d+)?$/u.test(t)?Number(t):t}]]);function Wt(e,t,n){let r=fi.get(t.trim().toLowerCase());r&&r(e,n.trim())}var pi=/^- \*\*([^*\n]+?):\*\* ?(.*)$/u;function Kt(e){let t=e.split(`
|
|
41
|
-
`),n=0,r=()=>{for(;n<t.length&&!t[n].trim();)n++},i=()=>{let c=[];for(let l;(l=pi.exec(t[n]??""))!==null;n++)c.push([l[1].trim(),l[2].trim()]);return c};r();let o=i();if(o.length>0)return{title:"",facts:o,rest:t.slice(n).join(`
|
|
42
|
-
`)};let s=[];for(;n<t.length&&t[n].trim();)s.push(t[n++]);return r(),o=i(),o.length===0?{title:"",facts:o,rest:e}:{title:P(s.join(`
|
|
43
|
-
`).trim()),facts:o,rest:t.slice(n).join(`
|
|
44
|
-
`)}}var di=/^(\d+)\. (.*)$/u;function Yt(e){let t=[],n=I(e),r=0;for(let i of e.split(`
|
|
45
|
-
`)){let o=F(n,r)?null:di.exec(i);r+=i.length+1,o?t.push({ref:o[2].trim(),indent:o[1].length+2,note:[]}):t.length>0&&t.at(-1).note.push(i)}return t.map(i=>mi(i))}function mi({ref:e,indent:t,note:n}){let r={},i=Re(e),o=Pt(e),s=o===null?G(i?i.label:e):null;s!==null&&Object.assign(r,Gt(s));let c=i?i.url:o;A(c)&&(r.url=c);let l=P(n.map(a=>a.slice(Math.min(t,/^ */u.exec(a)[0].length))).join(`
|
|
46
|
-
`).trim());return l&&(r.text=l),r}var Zt=new Map(Je.map(([e,t])=>[e.toLowerCase(),t])),gi=[...Zt.keys()];function qt(e){let t=e.length,n=1/0;for(let r=e.length-1;r>=0;r--){let i=gi.indexOf(e[r].label.toLowerCase());if(i===-1||i>=n)break;n=i,t=r}return{paragraphs:e.slice(0,t),fields:e.slice(t).map(r=>[Zt.get(r.label.toLowerCase()),r.body])}}function Jt(e,t,n){let r=[],i=J(t),o=e.endsWith("\u2026")?e.slice(0,-1).trimEnd():"";!e||i===e||o&&i.startsWith(o)?r.push(t):r.push(e,t);for(let{label:s,body:c}of n)r.push(c?`**${s}:** ${c}`:`**${s}:**`);return r.filter(Boolean).join(`
|
|
47
|
-
|
|
48
|
-
`)}var hi=/^<!--\s*DeepView findings export\b[^>]*-->/u,yi=/^Case \d+ of \d+(?:\s|$)/u,xi=/^- \*\*([^*\n]+?):\*\* ?(.*)$/gmu,Si=new Set(["evidence","severity correction","comment"]);function Xt(e){let t=R(e).trim();if(!hi.test(t))return null;let{head:n,subs:r}=D(t,ye),i=[];for(let{heading:o,body:s}of r){if(o.trim().toLowerCase()==="summary")continue;let c=vi(o);for(let l of N(s,ie))i.push(bi(l,c))}return $i(wi(n),i)}function vi(e){let t=/^(.*?)\s*\(\d+\)\s*$/u.exec(e.trim());return $e(t?t[1]:e)}function wi(e){let t=new Map;for(let n of e.matchAll(xi)){let r=n[1].trim().toLowerCase();t.has(r)||t.set(r,n[2].trim())}return{sources:(t.get("source")??"").split(",").map(n=>Le(n).source).filter(Boolean),analyzers:(t.get("analyzer")??t.get("analyzers")??"").split(";").map(n=>n.trim()).filter(Boolean),repo:t.has("repository")?et(t.get("repository")):""}}function bi({heading:e,body:t},n){let r=e.trim().replace(/^\d+\.\s+/u,""),i=N(t,B).filter(o=>yi.test(o.heading.trim()));return i.length===0?[Qt(t,B,r,n)]:i.map(o=>Qt(o.body,xt,r,n))}function Qt(e,t,n,r){let{title:i,facts:o,rest:s}=Kt(e),{head:c,subs:l}=D(s,t),a=l.map(x=>({label:x.heading.trim(),body:x.body.trim()})),u={file:"unknown",line:"?"},p=null;for(let[x,$]of o)x.trim().toLowerCase()==="analyzer"?p=Le($):Wt(u,x,$);u.severity||(u.severity=r||"medium");let f=i||n,m=f!=="Untitled finding"&&f!==T(u),h=a.filter(x=>!Si.has(x.label.toLowerCase())).map(x=>({label:x.label,body:P(x.body)})),{paragraphs:d,fields:g}=qt(h);u.description=Jt(m?f:"",P(c.trim()),d);let y=a.filter(x=>x.label.toLowerCase()==="evidence").flatMap(x=>Yt(x.body));y.length>0&&(u.evidence=y);for(let[x,$]of g)u[x]=$;let S=a.find(x=>x.label.toLowerCase()==="severity correction");return S?.body&&(u.correctedSeverityReason=P(S.body)),{finding:E(u),analyzer:p}}function Ei(e,t){let n={source:null,run:{}};if(t.some(i=>i.analyzer!==null)){let i=new Set(t.map(o=>o.analyzer?.source??null));i.size===1&&!i.has(null)&&([n.source]=i);for(let o of t)o.analyzer?.run?Object.assign(o.finding,o.analyzer.run):o.analyzer?.source&&!n.source&&(o.finding.source=o.analyzer.source);return n}let r=e.analyzers.length===1?Le(e.analyzers[0]):null;return r?.source?n.source=r.source:r?.run?n.run=r.run:e.analyzers.length===0&&e.sources.length===1&&([n.source]=e.sources),n}function $i(e,t){let n=t.flat(),{source:r,run:i}=Ei(e,n),o={},s=new Set(n.map(a=>a.finding.type).filter(Boolean)),c=i.type??(s.size===1?[...s][0]:null)??(r?"security":null);c&&(o.type=c),r&&(o.source=r);for(let a of["model","effort","exportsMode"])i[a]&&(o[a]=i[a]);e.repo&&(o.repo={github:e.repo});let l=t.map(a=>a.map(u=>u.finding));return l.every(a=>a.length===1)?o.findings=l.flat():o.groups=l,o}var tt="markdown-generic",Ri=["#","id","product","priority","vulnerability"],Li=["title","description","root cause","code references","attack scenario","steps to reproduce","impact","patch"],Ai=/^(?:#{3,6}[ \t]+)?(?:\*\*)?(Title|Description|Root Cause|Code references|Attack Scenario|Steps to Reproduce(?:[ \t]+.*?)?|Impact|Patch):?(?:\*\*)?(?:[ \t]+#+)?[ \t]*$/gimu,en={P0:"critical",P1:"high",P2:"medium",P3:"low",P4:"informational"},te=e=>e.trim().slice(1,-1).split("|").map(t=>t.trim());function v(e,t){if(!e)throw new Error(`Markdown (generic): unsupported ${t}`)}function Ci(e){return[...new Set(e.split(`
|
|
49
|
-
`).map(t=>t.trim()).filter(Boolean))].map(t=>{v(/^https?:\/\/[^\s()[\]{}"'<>`\\]+$/iu.test(t)&&!/[.,;!?]$/u.test(t),"link syntax; use bare URLs on separate lines");let n;try{n=new URL(t)}catch{v(!1,"URL")}let[r,i,o,s,...c]=n.pathname.slice(1).split("/");v(["github.com","www.github.com"].includes(n.hostname)&&!n.username&&!n.password&&!n.port&&[r,i].every(p=>p&&/^[\w-][\w.-]*$/u.test(p)),"repository URL"),v(c.every(Boolean),"repository path; empty components");let l=`${r}/${i.replace(/\.git$/iu,"")}`.toLowerCase(),a=/^#L(\d+)(?:-L?(\d+))?$/u.exec(n.hash),u=o==="blob"?c.slice(0,-1):o==="tree"?c:[];try{u=u.map(decodeURIComponent)}catch{v(!1,"repository directory encoding")}return v(u.every(p=>p===p.trim()&&!/[\\/:?#\p{Cc}]/u.test(p)),"repository directory"),{repo:l,ref:s,directory:u,...o==="blob"&&c.length&&{evidence:{file:c.join("/"),line:a?a.slice(1).filter(Boolean).join("-"):"?",url:t}}}})}function _i(e,t,n,r){let i=Ci(n),o=i[0]?.repo;v(o&&i.every(l=>l.repo===o),`repository set for finding ${e.id}; expected exactly one repository`),v(!e.group.github||e.group.github===o,`repository set for product ${e.product}; expected exactly one repository`);let s=r.get(o);v(s===void 0||s===e.prefix,`repository ID prefixes for ${o}; expected ${s}, got ${e.prefix} (${e.id})`),r.set(o,e.prefix),e.group.github=o,e.group.directories.push(...i.map(l=>l.directory));let c=i.flatMap(l=>l.evidence??[]);if(c.length){Object.assign(t,{file:c[0].file,line:c[0].line,location:c[0].url,evidence:c});let l=i.find(a=>a.evidence).ref;W(l)&&(t.commitHash=l)}}function ki(e){let t=e[0];for(let n of e.slice(1)){let r=0;for(;r<t.length&&t[r]===n[r];)r++;t=t.slice(0,r)}return t.join("/")}function tn(e){let t=R(e).trim(),n=[...t.matchAll(/^## +(.*)$/gmu)];if(!n.some(u=>/^\d+\.\s+\S+/u.test(u[1]))&&(n.length||t.startsWith("# ")))return null;let r=[...t.matchAll(/^\|[^\n]*\|$/gmu)].find(([u])=>te(u).map(p=>p.toLowerCase()).join()===Ri.join());if(!r)return null;let i=t.slice(0,r.index).trim();v(!i||/^# [^\n]+$/u.test(i),"summary preamble"),v(r.index<(n[0]?.index??t.length),"summary position");let o=t.slice(r.index,n[0]?.index).trim().split(`
|
|
50
|
-
`),s=new Set(te(o[0]).map(u=>u.toLowerCase()));v(o[1]&&te(o[1]).length===5&&te(o[1]).every(u=>/^:?-{3,}:?$/u.test(u)),"summary separator");let c=new Map,l=new Map,a=new Map;for(let u of o.slice(2).filter(p=>p.trim())){v(/^\|.*\|$/u.test(u)&&te(u).length===5,"summary row");let[p,f,m,h]=te(u),d=/^(.+-)\d+$/u.exec(f)?.[1];v(/^\d+$/u.test(p)&&d&&m&&Object.hasOwn(en,h)&&!a.has(f),`summary values for ${f}`);let g=c.get(m)??{directories:[],rows:[]},y={raw:u,id:f,prefix:d,product:m,priority:h,group:g};a.set(f,y),g.rows.push(y),c.set(m,g)}v(a.size,"empty summary");for(let[u,p]of n.entries()){let f=/^\d+\.\s+(\S+)\s*$/u.exec(p[1])?.[1],m=a.get(f);v(m&&!m.finding,`finding section ${p[1]}`);let h=t.slice(p.index,n[u+1]?.index),d=h.slice(p[0].length+1),g=new Map,y=[...d.matchAll(Ai)];for(let[w,L]of y.entries()){let Me=L[1],dt=Me.toLowerCase().replace(/^steps to reproduce\b.*$/u,"steps to reproduce");v(!g.has(dt),`duplicate section ${Me}`),g.set(dt,{heading:Me,body:d.slice(L.index+L[0].length,y[w+1]?.index).trim()})}v(Li.every(w=>g.has(w)),`missing required headers for ${f}`),v(!d.slice(0,y[0].index).trim(),`text before field headers for ${f}`);let S=g.get("title")?.body;v(S,`missing Title for ${f}`);let x={sourceId:f,_idBasis:{source:tt,row:m.raw.trim(),section:h.trim()},product:m.product,priority:m.priority,severity:en[m.priority],file:"unknown",line:"?"};s.has("vulnerability")&&(x.security=!0);let $=[S];for(let[w,L]of g)w==="title"||w==="code references"||(w==="steps to reproduce"?x.reproduction=L.body:w==="patch"?x.recommendation=L.body:$.push(w==="description"?L.body:`**${L.heading}:**
|
|
51
|
-
${L.body}`));x.description=$.join(`
|
|
52
|
-
|
|
53
|
-
`),_i(m,x,g.get("code references").body,l),m.finding=x}return v([...a.values()].every(u=>u.finding),"missing finding sections"),[...c].map(([u,p])=>{let f={github:p.github,directory:ki(p.directories)},m=p.rows.map(({finding:h})=>({...h,repo:{github:p.github}}));return{displayName:u,data:{type:"security",source:tt,product:u,repo:f,findings:m}}})}function nn(e){let t=tn(e);return t===null?null:t.length===1?t[0].data:{type:"security",source:tt,findings:t.flatMap(({data:n})=>n.findings)}}var Ii=new Set(["critical","high","medium","low","high_bug","bug","informational"]);function rn(e){let t=Ti(e);if(!t)return null;let{severity:n,description:r,location:i,file:o,line:s}=t;return i?{severity:n,description:r,location:i}:{severity:n,description:r,file:o,line:s}}function Ti(e){let t=e.indexOf(`
|
|
54
|
-
`),n=(t===-1?e:e.slice(0,t)).trim();if(!n)return null;let r=t===-1?"":e.slice(t+1),{sectionsText:i,metaText:o}=Mi(r),s=Oi(i),c=Fi(o),{file:l,line:a,locationLink:u}=Bi(s.location||""),p=(c.severity||"").toLowerCase();return{severity:Ii.has(p)?p:"medium",description:Di(n,s),location:u,file:l||"unknown",line:a}}function Mi(e){let t=/^---\s*$/mu,n=t.exec(e);if(!n)return{sectionsText:e,metaText:""};let r=e.slice(0,n.index).trim(),i=e.slice(n.index+n[0].length).replace(/^\n/u,""),o=t.exec(i),s=o?i.slice(0,o.index):i;return{sectionsText:r,metaText:s}}function Oi(e){let t={},n=e.split(/^## /mu);for(let r=1;r<n.length;r++){let i=n[r],o=i.indexOf(`
|
|
55
|
-
`),s=(o===-1?i:i.slice(0,o)).trim().toLowerCase(),c=(o===-1?"":i.slice(o+1)).trim();s&&(t[s]=c)}return t}function Fi(e){let t={};for(let n of e.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu))t[n[1].trim().toLowerCase()]=n[2].trim();return t}function Bi(e){let t="",n="?",r="",i=e.match(/\[([^\]]+)\]\(([^)]+)\)/u);if(i){t=i[1].trim(),r=i[2];let s=i[2].match(/#L(\d+)/u);s&&(n=s[1])}else t=e.trim(),r=e.trim();let o=t.match(/^(.+):(\d+)$/u);return o&&(t=o[1],n==="?"&&(n=o[2])),{file:t,line:n,locationLink:r}}function Di(e,t){let n=[e];return t.details&&n.push(t.details),t.impact&&n.push(`Impact: ${t.impact}`),t["reproduction steps"]&&n.push(`Reproduction: ${t["reproduction steps"]}`),Ni(n.join(`
|
|
56
|
-
|
|
57
|
-
`))}function Ni(e){return e.replaceAll("**","")}var zi=new Set([...Z,"informative"]);function cn(e){let t=R(e).trim();if(!t.startsWith("# "))return null;let r=K(t,/^# /gmu).slice(1).filter(i=>i.trim().length>0).map(i=>ji(i)).filter(Boolean);return r.length===0?null:{type:"security",source:"claude-security",findings:r}}function ji(e){let{title:t,body:n}=H(e);if(!t)return null;let{sectionsText:r,metaText:i}=Hi(n),o=Ui(r),s=Object.fromEntries([...i.matchAll(/\*\*([^:]+):\*\*\s*(.+)/gu)].map(y=>[y[1].trim().toLowerCase(),y[2].trim()])),c=Wi(o.evidence||""),{file:l,line:a,locationLink:u}=ln(o.location||c[0]?.ref||""),p=(s.severity||"").toLowerCase(),f=zi.has(p)?p:"medium",m=Yi(t,o,c.length>0),h={file:l||"unknown",line:a,severity:f,description:m};u&&(h.location=u),c.length>0&&(h.evidence=c.map(Ki)),o["reproduction steps"]&&(h.reproduction=Vi(o["reproduction steps"])),o["recommended fix"]&&(h.recommendation=o["recommended fix"]),s.repository&&(h.repo={github:s.repository}),s.branch&&(h.branch=s.branch),s["date created"]&&(h.dateCreated=s["date created"]),s.status&&(h.status=s.status),s.category&&(h.category=s.category);let d=e.indexOf(`
|
|
58
|
-
# `),g=rn(d===-1?e:e.slice(0,d+1));return g&&(h._idBasis=g),E(h)}function Hi(e){let t=/^---\s*$/mu,n=t.exec(e);if(!n)return{sectionsText:e,metaText:""};let r=e.slice(0,n.index).trim(),i=e.slice(n.index+n[0].length).replace(/^\n/u,""),o=t.exec(i),s=o?i.slice(0,o.index):i;return{sectionsText:r,metaText:s}}function Ui(e){let t=e.split(/^## /mu).slice(1).map(n=>H(n));return Object.fromEntries(t.filter(n=>n.title).map(n=>[n.title.toLowerCase(),n.body.trim()]))}function ln(e){let t="",n="?",r="",i=Y(e);if(i){t=i.label.trim(),r=i.url.trim();let s=r.match(/#L(\d+)(?:-L?(\d+))?/u);s&&(n=s[2]?`${s[1]}-${s[2]}`:s[1])}else t=e.trim(),r=e.trim();t=ze(t.replaceAll("`","")).trim();let o=t.match(/^(.+):(\d+)(?:\s*[-–—]\s*L?(\d+))?$/u);return o&&(t=o[1],n==="?"&&(n=o[3]?`${o[2]}-${o[3]}`:o[2])),{file:t,line:n,locationLink:r,linked:i!==null}}function Vi(e){let t=e.split(`
|
|
59
|
-
`),n=t.findIndex(c=>c.trim());if(n===-1||!j.test(t[n])||t.some((c,l)=>l!==n&&j.test(c)))return e;let r=t[n].replace(/^ */u,""),i=r.replace(j,"");if(!i.trim())return e;let o=on(i)??on(r);if(o===null&&(j.test(i)||Gi.test(r)))return e;let s=o===null?[i]:o.length===1?[o[0].step]:o.map(({number:c,step:l})=>`${c}. ${l}`);return t.splice(n,1,...s),t.join(`
|
|
60
|
-
`)}var Pi=/(?:^|[ \t])(\d{1,9})\)(?=[ \t]|$)/gu,Gi=/^\d{1,9}\)(?=[ \t]|$)/u;function on(e){let t=[...e.matchAll(Pi)];if(t.length===0||t[0].index!==0)return null;let n=[];for(let[r,i]of t.entries()){let o=Number(i[1]);if(r>0&&o<=n[r-1].number)return null;let s=e.slice(i.index+i[0].length,t[r+1]?.index).trim();if(!s)return null;n.push({number:o,step:s})}return n}var sn=/^[ \t]*(?:\d+[.)]|[-*+])\s+/u;function Wi(e){let t=[];for(let n of e.split(`
|
|
61
|
-
`))sn.test(n)?t.push({ref:n.replace(sn,"").trim(),note:[]}):t.length>0&&n.trim()&&t.at(-1).note.push(n.trim());if(t.length===0){let n=e.split(`
|
|
62
|
-
`).map(o=>o.trim()).filter(Boolean),r=n.findIndex(o=>Y(o)!==null);if(r===-1&&n.length!==1)return[];let i=r===-1?0:r;t.push({ref:n[i],note:n.filter((o,s)=>s!==i)})}return t.filter(n=>n.ref)}function Ki({ref:e,note:t}){let{file:n,line:r,locationLink:i,linked:o}=ln(e),s={file:n||"unknown",line:r};i&&o&&(s.url=i);let c=t.join(`
|
|
63
|
-
`);return c&&(s.text=c),s}function Yi(e,t,n){let r=[e];return t.details&&r.push(t.details),t.evidence&&!n&&r.push(`**Evidence:**
|
|
64
|
-
${t.evidence}`),t.impact&&r.push(`**Impact:** ${t.impact}`),r.join(`
|
|
65
|
-
|
|
66
|
-
`)}function Zi(e){let t=(e||"").trim(),n="",r=/\[([^\]]+)\]\(([^)]+)\)/u.exec(t);r&&(t=r[1].trim(),n=r[2].trim());let i="",o=/#L(\d+)/u.exec(n);o&&(i=o[1]);let l=[...t.matchAll(/`([^`]+)`/gu)].map(p=>p[1].trim()).find(p=>!p.includes("(")&&(p.includes("/")||/\.\w/u.test(p)))??(t.replaceAll("`","").trim().split(/[\s,]+/u).find(Boolean)||""),a=/^(.*?)#L(\d+)(?:-L?\d+)?$/u.exec(l);a&&(l=a[1],i||(i=a[2]));let u=/^(.+):(\d+(?:-\d+)?)$/u.exec(l);return u?(i||(i=u[2]),{file:u[1],line:i,locationLink:n}):{file:l,line:i||"?",locationLink:n}}function an({severity:e,description:t,ref:n,lineBullet:r="",id:i=""}){let o=Zi(n),s=o.file||"unknown",c=o.line==="?"&&r?r:o.line,l=o.locationLink||(s==="unknown"&&i?`piolium:${i}`:"");return l?{severity:e,description:t,location:l}:{severity:e,description:t,file:s,line:c}}function z(e){let t=((e||"").trim().split(/\s+/u)[0]||"").replaceAll(/[`*]+/gu,"");return pe.get(t.toUpperCase())??""}function ae(...e){return{severity:e.find(Boolean)||"medium",identitySeverity:e.find(t=>t&&t!=="informative")||"medium"}}function ue(e){let t=/^([CHML])-?\d+$/iu.exec((e||"").trim());return t?{C:"critical",H:"high",M:"medium",L:"low"}[t[1].toUpperCase()]:""}function nt(e){return z(/^(critical|high|medium|low|informational|informative|info)(?:[ -](?:severity|risk))?(?:[ -]findings?)?(?:\s*\(\d+\))?$/iu.exec((e||"").trim())?.[1])}function un(e){return z(/^(critical|high|medium|low|informational|informative|info)\b/iu.exec((e||"").trim())?.[1])}function Ce(e){return/^variants?\s*(?:\(\d+\))?\s*:?$/iu.test((e||"").trim())}function _e(e){let t=/^([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(e||"");return t?{id:t[1].toUpperCase(),slug:t[2]||""}:null}function Ae(e){return(e||"").replaceAll("-"," ")}function fe(e){let t=(e||"").trim(),n=/^\[([^\]]+)\]\([^)]*\)$/u.exec(t);return Et(n?n[1]:t).toUpperCase()}function it(e){let t=/^\[([^\]]+)\]\(([^)]+)\)\s*[:—–-]*\s*(.*)$/u.exec(e);return t?{text:t[3]?`${t[1].trim()} ${t[3].trim()}`:t[1].trim(),link:t[2].trim()}:null}function rt(e){let t=e.search(/\s/u),n=(t===-1?e:e.slice(0,t)).replace(/[:.,—–-]+$/u,""),r=_e(n);if(!r)return null;let i=(t===-1?"":e.slice(t+1)).replace(/^[:—–-]+\s*/u,"").trim();return{id:r.id,slug:r.slug,rest:i}}function ot(e){let{text:t,link:n}=it(e)??{text:e,link:""},r=/^\[([^\]]+)\] *(.*)$/u.exec(t);if(r){let o=_e(r[1].trim());return o?{id:o.id,title:r[2].trim()||Ae(o.slug)||o.id,link:n}:{id:r[1].trim().toUpperCase(),title:r[2].trim(),link:n}}let i=rt(t);return i?{id:i.id,title:i.rest||Ae(i.slug)||i.id,link:n}:{id:"",title:t.trim(),link:n}}function fn(e){let t={},n=o=>{let s=o.exec(e||"")?.[1];return s===void 0?"":(/`([^`]+)`/u.exec(s)?.[1]??s.split(/\s+/u)[0]??"").trim()},r=n(/^\s*(?:[-*] +)?\*\*Target:?\*\*\s*(.*)$/imu);le(r)&&(t.repo=r);let i=n(/^\s*(?:[-*] +)?\*\*Commit[^:*]*:?\*\*\s*(.*)$/imu);return W(i)&&(t.commitHash=i),t}var st=["key code reference","key code","code reference","location","affected file","file","path"];function ke(e){return{id:fe(e.id||""),title:U(e.title),severity:U(e.severity),pocStatus:U(e["poc status"]||e.poc),status:U(e.status),parent:fe(U(e.parent||"")),location:U(e.location)}}function Ie(e,t=""){let{severity:n,identitySeverity:r}=ae(z(e.severity),t,ue(e.id)),i=ct({ref:e.location||"",id:e.id,severity:n,identitySeverity:r,description:Ne(e.title||e.id)});for(let o of["pocStatus","status","parent"])e[o]&&(i[o]=e[o]);return E(i)}function ct({ref:e,lineBullet:t="",id:n,severity:r,identitySeverity:i,description:o}){let{file:s,line:c,locationLink:l}=wt(e),a={file:s||"unknown",line:c==="?"&&t?t:c,severity:r,description:o};return l?a.location=l:a.file==="unknown"&&n&&(a.location=`piolium:${n}`),a._idBasis=an({severity:i,description:o,ref:e,lineBullet:t,id:n}),a}function lt(e,t,n){let r=[];for(let i of e.split(`
|
|
67
|
-
`)){let o=/^\s{0,3}(?:[-*+]|\d{1,3}[.)])\s+(.+)$/u.exec(i);if(!o)continue;let s=o[1].trim();if(/^\*\*[^:*]+:\*\*/u.test(s))continue;let c=it(s),l=c?.link??"";if(c)s=c.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 a=rt(s),u=a?.id??"",p=s;if(a){let g=Ae(a.slug);p=g&&a.rest?`${g}
|
|
68
|
-
|
|
69
|
-
${a.rest}`:a.rest||g||a.id}let f=n.get(u),{severity:m,identitySeverity:h}=ae(z(f?.severity),t,ue(u)),d={file:"unknown",line:"?",severity:m,description:Ne(p)};u?d.location=`piolium:${u}`:l&&(d.location=l),l.endsWith("report.md")&&(d.reportPath=l);for(let g of["pocStatus","status","parent"])f?.[g]&&(d[g]=f[g]);r.push({id:u,finding:E(d,h)})}return r}function at(e,t,n,r=""){let i=[];for(let s of re(e)){let c=ke(s);!c.id&&!c.title||(!c.parent&&n&&(c.parent=n),c.id&&!t.has(c.id)&&t.set(c.id,c),i.push({id:c.id,finding:Ie(c,r)}))}if(i.length>0)return i;let o=lt(e,r,t);for(let s of o)n&&!s.finding.parent&&(s.finding.parent=n);return o}var qi=new Set(["technical findings detail","technical findings","detailed findings","findings detail","findings"]),Ji=/^(?:summary of findings\b|deferred|methodolog|executive|conclusion|attack surface|coverage|discoveries|scope\b|table of contents|contents\b|appendix|recommendation|remediation)/u;function pn(e){let{id:t}=ot(e);return!!(t&&_e(t))}function Qi(e){let t=N(e,ie);return(t.length>0?t:N(e,B)).some(({heading:r})=>pn(r))}function dn(e){let t=R(e).trim();if(!/^# +Security Audit Report\b/mu.test(t)&&!/^## +Technical Findings Detail\s*$/imu.test(t)&&!/^## +Findings by Severity\b/imu.test(t))return null;let{head:n,subs:r}=D(t,ye),i=nr(r),o=new Map(re(i["summary of findings"]||"").map(ke).filter(f=>f.id).map(f=>[f.id,f])),s=fn(n),c=[],l=new Set,a=[],u=({id:f,finding:m})=>{c.push(m),f&&l.add(f)},p=f=>{for(let m of f)u(m)};for(let[f,m]of Object.entries(i)){let h=nt(f);h||qi.has(f)||f.startsWith("findings by severity")?p(ut(m,h,o,a)):!Ji.test(f)&&Qi(m)&&p(ut(m,un(f),o,a))}for(let f of a)(!f.id||!l.has(f.id))&&u(f);for(let f of o.values())l.has(f.id)||u({id:f.id,finding:Ie(f)});if(c.length===0)return null;for(let f of c)s.repo&&(f.repo={github:s.repo}),s.commitHash&&!f.auditedCommit&&(f.auditedCommit=s.commitHash);return{type:"security",source:"piolium",findings:c}}function Xi(e,t,n,r){let i=[],o="";for(let{heading:s,body:c}of e){let l=nt(s);if(l)i.push(...ut(c,l,t,n)),o="";else if(Ce(s))i.push(...tr(c,t,o,n,r));else{let a=er(s,c,t,n,r);i.push(...a),o=a[0]?.id||o}}return i}function er(e,t,n,r,i){let{head:o,subs:s}=D(t,B),c=mn(e,o,n,i),l=c!==null&&!c.id&&s.some(u=>!Ce(u.heading)&&pn(u.heading)),a=c&&!l?[c]:[];return a.push(...ft(s,n,r,i,c?.id||"")),a}function tr(e,t,n,r,i){let{head:o,subs:s}=D(e,B);return r.push(...at(o,t,n,i)),ft(s,t,r,i,"")}function ft(e,t,n,r,i){let o=[],s="";for(let{heading:c,body:l}of e){if(Ce(c)){n.push(...at(l,t,i??s,r));continue}let a=mn(c,l,t,r);a&&(o.push(a),s=a.id||s)}return o}function ut(e,t,n,r){let i=N(e,ie);if(i.length>0)return Xi(i,n,r,t);let o=ft(N(e,B),n,r,t,null);if(o.length>0)return o;let s=re(e).map(ke).filter(c=>c.id||c.title);for(let c of s)!c.severity&&t&&(c.severity=t),c.id&&!n.has(c.id)?n.set(c.id,c):c.id||r.push({id:"",finding:Ie(c,t)});return s.length===0&&r.push(...lt(e,t,n)),[]}function mn(e,t,n,r=""){let i=e.trim();if(!i)return null;let{id:o,title:s,link:c}=ot(i),l=n.get(o);if(!o&&s){let w=s.toLowerCase();l=[...n.values()].find(L=>L.title.toLowerCase()===w),o=l?.id??""}let{fields:a,labels:u,prose:p}=vt(t),{severity:f,identitySeverity:m}=ae(z(a.severity),z(l?.severity),r,ue(o)),h=/\d+/u.exec(a.line||a.lines||"")?.[0]??"",d=/\*\*Variant of:?\*\*\s*\[?([^\]\s)]+)/iu.exec(t),g=p.split(`
|
|
70
|
-
`).filter(w=>!/^\s*<a\s[^>]*>\s*<\/a>\s*$/iu.test(w)&&!/\*\*Variant of:?\*\*/iu.test(w)).join(`
|
|
71
|
-
`).trim(),y=ct({ref:st.map(w=>a[w]).find(Boolean)??"",lineBullet:h,id:o,severity:f,identitySeverity:m,description:rr(s||o,a,u,g)}),S=a["poc status"]||a.poc||l?.pocStatus;S&&(y.pocStatus=S);let x=a["detailed report"]||(c.endsWith("report.md")?c:"");x&&(y.reportPath=x),l?.status&&(y.status=l.status);let $=l?.parent||(d?fe(d[1]):"");return $&&(y.parent=$),{id:o,finding:E(y)}}function nr(e){let t=Object.create(null);for(let{heading:n,body:r}of e){let i=n.trim().toLowerCase();i&&(t[i]=i in t?`${t[i]}
|
|
72
|
-
${r}`:r)}return t}var ir=new Set([...st,"severity","summary","files","poc","poc status","line","lines","detailed report","proof of concept","evidence","variant of","pattern","status","id","title"]);function rr(e,t,n,r){let i=[e];t.summary&&i.push(t.summary),r&&i.push(r);for(let[o,s]of Object.entries(t))!s||ir.has(o)||i.push(`**${n[o]||o}:** ${s}`);return i.filter(Boolean).join(`
|
|
73
|
-
|
|
74
|
-
`)}var or=["finding_url","repository","title","description","severity","configured_scan_id","relevant_paths"];function sr(e){let t=[],n=[],r="",i=!1;for(let o=0;o<e.length;o++){let s=e[o];i?s==='"'?e[o+1]==='"'?(r+='"',o++):i=!1:r+=s:s==='"'?i=!0:s===","?(n.push(r),r=""):s===`
|
|
75
|
-
`||s==="\r"?(n.push(r),t.push(n),n=[],r="",s==="\r"&&e[o+1]===`
|
|
76
|
-
`&&o++):r+=s}for((r!==""||n.length>0)&&(n.push(r),t.push(n));t.length>0&&t.at(-1).length===1&&t.at(-1)[0]==="";)t.pop();return t}function cr(e,t){return t.map(n=>{let r=Object.create(null);return e.forEach((i,o)=>{r[i]=n[o]??""}),r})}function lr(e){let t=sr(e);if(t.length<2)throw new Error("Codex CSV: empty or missing header row");let[n,...r]=t;for(let s of or)if(!n.includes(s))throw new Error(`Codex CSV: missing required column "${s}"`);let i=Map.groupBy(cr(n,r).filter(s=>s.configured_scan_id),s=>s.configured_scan_id);if(i.size===0)throw new Error("Codex CSV: no rows with a configured_scan_id");let o=[];for(let[s,c]of i){let l=new Set(c.map(p=>p.repository).filter(Boolean));if(l.size>1)throw new Error(`Codex CSV: scan ${s} contains multiple repositories: ${[...l].join(", ")}`);let u=`${[...l][0]||"unknown-repo"}:${s.replace(/^[^:]+:/u,"")}`;o.push({displayName:u,data:{type:"security",source:"codex-security",findings:c.map(ar)}})}return o}function ar(e){let t=e.relevant_paths.split(" | ").map(i=>i.trim()).find(Boolean)||"unknown",n=[e.title,e.description].filter(Boolean).join(`
|
|
77
|
-
|
|
78
|
-
`),r={id:e.finding_url,file:t,line:"?",severity:(e.severity||"medium").toLowerCase(),description:n,repo:{github:e.repository}};return e.commit_hash&&(r.commitHash=e.commit_hash),e.detected_at&&(r.detectedAt=e.detected_at),e.committed_at&&(r.committedAt=e.committed_at),E(r)}function ur(){let e=[],t=new Map,n=o=>{if(!t.has(o)){let s={security:!1};s.parent=s,t.set(o,s),typeof o=="string"&&e.push(o)}return t.get(o)},r=o=>{let s=o;for(;s.parent!==s;)s=s.parent;for(;o.parent!==o;){let c=o.parent;o.parent=s,o=c}return s};return{nodeFor:n,root:r,join:(o,s)=>{o=r(o),s=r(s),o!==s&&(s.parent=o,o.security||=s.security)},ids:e}}function fr(e,{source:t,linkedIds:n=()=>[],knownRows:r=()=>[]}={}){let{nodeFor:i,root:o,join:s,ids:c}=ur(),l=[],a=(f,m=!1)=>{let h;for(let d of f){if(!d||typeof d!="object")continue;let g=i(d.id||d);o(g).security||=m?d.isSecurity===!0:He(d,d._source??d.source??t),h?s(h,g):h=g,m||l.push([d,g])}};for(let f of e)a(f);let u=new Set;for(let f=0;f<c.length;f++){let m=c[f],h=i(m);for(let d of n(m))s(h,i(d));for(let d of r([m]))u.has(d)||(u.add(d),a(d.members,!0))}let p=!1;for(let[f,m]of l){let h=o(m).security;f.isSecurity!==h&&(f.isSecurity=h,p=!0)}return p}var pr="<!-- DeepView findings export -->",dr={annotation:()=>null,location:e=>typeof e?.location=="string"?e.location:null,evidence:e=>typeof e?.url=="string"?e.url:null,commit:()=>null,report:()=>null};function mr(e,t){let n=i=>typeof i?.source=="string"&&i.source?i.source:null;if(e.length===1)return i=>n(i)??e[0].source??null;let r=new Map(e.map(i=>[i.name,i.source??null]));return i=>n(i)??r.get(t.report(i))??null}function gr(e,t,n){let r=e.view?.revalidation!==!1,i=(Array.isArray(e.reports)?e.reports:[]).filter(a=>a&&typeof a=="object"),o=mr(i,t),s=a=>jt(a,o(a),r),c=new Set(n.map(s)),l=new Set(n.map(a=>t.report(a)).filter(Boolean));return{hooks:t,analyzerOf:s,severityMode:e.view?.severityMode==="original"?"original":"corrected",revalidation:r,showAnalyzer:c.size>1,showReport:l.size>1||i.length>1,repo:typeof e.repo=="string"&&e.repo?e.repo:null}}function hr(e){if(!e)return"";let t=[e.bucket?`${e.bucket} findings`:"Live findings"];return e.severityMode==="original"?t.push("original analyzer severities"):e.severityMode==="corrected"&&t.push("corrected severities"),e.revalidation===!1?t.push("code view \u2014 the revalidation pass is not applied"):e.revalidation===!0&&(e.revalidationDetail===!0?t.push("detailed app view \u2014 the revalidation pass is applied, with the rows it re-rated"):e.revalidationDetail===!1?t.push("app view \u2014 the revalidation pass is applied, standing in for the rows it re-rated"):t.push("app view \u2014 the revalidation pass is applied")),t.join(" \xB7 ")}function yr(e){if(!e)return"";let t=Number(e.included)||0,n=Number(e.total)||0;return n===0?"no findings":t>=n?`all ${X(n,"finding")}`:`${t} of ${X(n,"finding")} (${n-t} filtered out)`}function xr(e,t,n){let r=[],i=(u,p)=>{p&&r.push(`- **${u}:** ${p}`)},o=Array.isArray(e.reports)?e.reports:[],s=[...new Set(o.map(u=>_[u?.source]??"").filter(Boolean))];i("Source",s.join(", "));let c=o.map(u=>u?.name).filter(Boolean);i(c.length===1?"Report":"Reports",c.map(u=>b(u)).join(", ")),i("Workspace",typeof e.workspace=="string"?e.workspace.trim():""),t.repo&&i("Repository",qe(t.repo));let l=[...new Set(n.map(t.analyzerOf).filter(Boolean))],a=l.length===s.length&&l.every(u=>s.includes(u));return l.length>0&&!a&&i(l.length===1?"Analyzer":"Analyzers",l.join("; ")),e.generatedAt&&i("Exported",_t(e.generatedAt)),i("View",hr(e.view)),Array.isArray(e.filters)&&i("Filters",e.filters.length>0?e.filters.map(u=>`${u.label}: ${u.value}`).join(" \xB7 "):"none"),i("Included",yr(e.counts)),r.join(`
|
|
79
|
-
`)}function Sr(e,t){let n=Map.groupBy(e,s=>oe(s[0],t.severityMode)??"informational"),r=[...Z,...[...n.keys()].filter(s=>!Z.includes(s))],i=new Set,o=[];for(let s of r)for(let c of n.get(s)??[]){let l=o.length+1,a=zt(c[0]),u=`${l}. ${a}`;o.push({group:c,number:l,severity:s,title:a,headingText:u,slug:Ct(u,i)})}return o}function gn(e){let t=new Map;for(let n of e)t.set(n.severity,(t.get(n.severity)??0)+1);return t}var vr=[["flagged",e=>e.flagged===!0],["colour-marked",e=>e.color],["commented",e=>e.comment],["with a fix link",e=>e.fix]];function wr(e,t){let n=e.flatMap(({group:i})=>i.map(o=>t.hooks.annotation(o))).filter(Boolean),r=vr.map(([i,o])=>[n.filter(o).length,i]).filter(([i])=>i>0).map(([i,o])=>`${i} ${o}`);return r.length>0?`Annotations: ${r.join(", ")}.`:""}function br(e){let t=e.some(({group:i})=>i.some(o=>o.confidence!==void 0&&o.confidence!==null)),n=["#","Severity","Finding","Location"];t&&n.push("Confidence");let r=e.map(i=>{let o=i.group[0],s=i.group.length>1?` (${X(i.group.length,"case")})`:"",c=T(o),l=[String(i.number),k(i.severity),V(Ke(At(i.title)),`#${i.slug}`)+s,c?Ke(b(c)):""];return t&&l.push(o.confidence===void 0||o.confidence===null?"":`${o.confidence}/10`),l});return Ye(n,r,["right"])}function Er(e,t){let n=[M(2,"Summary")];if(e.length===0)return[...n,"No findings are included."];let r=[...gn(e)].map(([o,s])=>[k(o),String(s)]);r.push(["**Total**",`**${e.length}**`]),n.push(Ye(["Severity","Findings"],r,["left","right"]));let i=wr(e,t);return i&&n.push(i),n.push(br(e)),n}function $r(e,t){let n=gn(e),r=[],i=null;for(let o of e)o.severity!==i&&(i=o.severity,r.push(M(2,`${k(i)} (${n.get(i)})`))),r.push(Ht(o.group,t,{headingText:o.headingText,depth:3}));return r}function Rr(e={},t={}){let n=Object.fromEntries(Object.entries(dr).map(([l,a])=>[l,typeof t?.[l]=="function"?t[l]:a])),r=(Array.isArray(e.groups)?e.groups:[]).map(l=>Array.isArray(l)?l:[l]).map(l=>l.filter(a=>a&&typeof a=="object")).filter(l=>l.length>0),i=r.flat(),o=gr(e,n,i),s=Sr(r,o),c=[pr,M(1,typeof e.title=="string"&&e.title.trim()?e.title.trim():"Findings"),xr(e,o,i),...Er(s,o),...$r(s,o)];return`${ce(c)}
|
|
80
|
-
`}var Lr=[["deepview-md",Xt],["markdown-generic",nn],["deepsec",Ft],["piolium",dn],["claude-security",cn]];function Te(e){return Array.isArray(e?.findings)?e.findings:Array.isArray(e?.groups)?e.groups:null}function ts(e,t){return typeof t=="string"&&/\.csv$/iu.test(t)?"codex":pt(e).format}function pt(e){let t;try{let n=JSON.parse(e);if(Te(n)){for(let r of hn(Te(n)))E(r);return{data:n,format:"json",reason:null}}return{data:null,format:null,reason:"JSON, but not a report: no findings array"}}catch(n){t=n}for(let[n,r]of Lr)try{let i=r(e);if(i)return{data:i,format:n,reason:null}}catch(i){if(n!=="markdown-generic")throw i;return{data:null,format:n,reason:i.message}}return{data:null,format:null,reason:`Not JSON, and not a recognized markdown format. (JSON error: ${t.message})`}}function ns(e){let{data:t}=pt(e);return t?{count:Te(t).length,source:t.source,recognized:!0}:{count:0,recognized:!1}}function hn(e){return e.flat().filter(t=>t&&typeof t=="object")}async function Ar(e){for(let r of e)E(r);let t=e.filter(r=>!r.id);if(t.length===0)return;let n=await Promise.all(t.map(Fe));t.forEach((r,i)=>{n[i]&&(r.id=n[i])})}async function is(e){let{data:t,format:n}=pt(e);if(!t)return null;let r=hn(Te(t));return await Ar(r),{format:n,data:t,findings:r}}export{xn as a,I as b,F as c,ze as d,de as e,me as f,Be as g,_ as h,$t as i,Z as j,xe as k,Se as l,oe as m,je as n,ve as o,se as p,On as q,Lt as r,Ue as s,q as t,Ve as u,Q as v,we as w,Fn as x,Ge as y,T as z,We as A,A as B,Un as C,Gn as D,Wn as E,tn as F,lr as G,fr as H,Rr as I,Te as J,ts as K,pt as L,ns as M,Ar as N,is as O};
|
package/out/chunk-GZ4MS3TE.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{g as x,h as R}from"./chunk-CVVJAXVY.js";import{d as S}from"./chunk-IU3CCINR.js";import"./chunk-UYAXVRVL.js";import"./chunk-PNHBZGDD.js";import"./chunk-CMQA4DM6.js";import"./chunk-3BZ7JERB.js";import{t as y,y as U,z as I}from"./chunk-GNXOKIGP.js";import{a as C,c as o,g as u}from"./chunk-2XUEZHIP.js";import"./chunk-TUII34K2.js";import"./chunk-V5O7M2YT.js";import"./chunk-OOJM4CTU.js";var G=new Set(["github-unavailable","unavailable","shutting-down","github-create-failed"]);async function w(a,e,s,i=null){let c=`/api/teams/${encodeURIComponent(a)}/issues`,n,l;try{n=await S(i?c:`${c}?${new URLSearchParams(e)}`,{method:i?"POST":"GET",credentials:"same-origin",headers:{accept:"application/json",...i?{"content-type":"application/json","x-csrf-token":s}:{}},...i?{body:JSON.stringify({...e,...i})}:{}}),l=await n.json()}catch{throw new Error(i?"github-create-uncertain":"github-unavailable")}if(!n.ok){let p=typeof l?.error=="string"&&l.error?l.error:null;throw new Error(i&&n.status>=500&&!G.has(p)?"github-create-uncertain":p??(i?"github-create-uncertain":"github-unavailable"))}return l}var f=[["impact","Impact"],["evidence","Evidence"],["reproduction","Reproduction"],["recommendation","Recommendation"],["confidenceReason","Confidence reason"],["revalidateVerdict","Revalidation verdict"],["revalidateRecommendation","Revalidation recommendation"]],z=a=>a.toLowerCase().replaceAll(/[^\p{L}\p{N}]/gu,""),T=new Map([...f.map(([a,e])=>[z(e),a]),["reproductionsteps","reproduction"],["recommendedfix","recommendation"]]);function D(a,{sourceUrl:e,evidence:s="",showRevalidation:i=!0}={}){let c=[],n=new Map,l=(t,d,h)=>{if(!h?.trim())return;let b=n.get(t)??{id:t,label:d,parts:[]};b.parts.includes(h.trim())||b.parts.push(h.trim()),n.set(t,b)},p=I(a);a.file&&c.push(`File: ${e?`[${p}](${e})`:p}`);let r=null;for(let t of U(y(a.description,a))){if(t.label!==null){let d=z(t.label);r=["description","details","summary"].includes(d)?null:{id:T.get(d)??d,label:t.label}}r?l(r.id,r.label,t.body):c.push(t.label?`**${t.label}:** ${t.body}`:t.body)}a.confidence!=null&&c.push(`Confidence: ${a.confidence}/10`);for(let[t,d]of f){if(t.startsWith("revalidate")&&!i){n.delete(t);continue}let h=t==="evidence"?s.replace(/^\*\*Evidence:\*\*\n/u,""):y(a[t],a);l(t,d,h)}let m=[...f.map(([t])=>n.get(t)).filter(Boolean),...[...n.values()].filter(t=>!f.some(([d])=>d===t.id))],g={body:c.join(`
|
|
2
|
-
|
|
3
|
-
`),sections:m.map(({id:t,label:d,parts:h})=>({id:t,label:d,text:`**${d}:**
|
|
4
|
-
${h.join(`
|
|
5
|
-
|
|
6
|
-
`)}`,selected:!1,start:0,end:0}))};return n.has("impact")&&(g=v(g,"impact",!0)),g}function E(a,e){let s=a.body;if(e===s)return a;let i=s.length,c=e.length,n=0;for(;n<i&&n<c&&s[n]===e[n];)n++;for(;i>n&&c>n&&s[i-1]===e[c-1];)i--,c--;let l=e.length-s.length,p=a.sections.map(r=>r.selected?n>=r.start&&i<=r.end?{...r,end:r.end+l}:i<=r.start?{...r,start:r.start+l,end:r.end+l}:n>=r.end?r:{...r,text:s.slice(r.start,r.end),selected:!1,start:0,end:0}:r);return{body:e,sections:p}}function v(a,e,s){let i=a.sections.find(t=>t.id===e);if(!i||i.selected===s)return a;if(s){let t=!a.body||a.body.endsWith(`
|
|
7
|
-
|
|
8
|
-
`)?"":a.body.endsWith(`
|
|
9
|
-
`)?`
|
|
10
|
-
`:`
|
|
11
|
-
|
|
12
|
-
`,d=a.body+t+i.text,h=a.body.length+t.length;return{body:d,sections:a.sections.map(b=>b===i?{...b,selected:s,separator:t,start:h,end:d.length}:b)}}let c=a.body.slice(i.start,i.end),n=i.separator??"",l=i.start-n.length,r=a.body.slice(l,i.start)===n&&!a.sections.some(t=>t!==i&&t.selected&&t.start<i.start&&t.end>l)?l:i.start,m=a.body.slice(0,r)+a.body.slice(i.end),g=r-i.end;return{body:m,sections:a.sections.map(t=>t===i?{...t,text:c,selected:s,start:0,end:0}:t.selected&&t.start>=i.end?{...t,start:t.start+g,end:t.end+g}:t)}}var _=`dialog{max-width:1040px;width:min(1040px,calc(100vw - 32px));margin-top:2rem;max-height:calc(100dvh - 4rem);overflow:hidden}dialog[open]{display:flex;flex-direction:column}header,.nwd-actions{flex-shrink:0}.dialog-content{min-height:0;overflow:auto;scrollbar-gutter:stable;padding:3px}.nwd-intro{overflow-wrap:anywhere}label{display:flex;flex-direction:column;gap:6px;margin:12px 0}textarea{min-height:clamp(240px,45dvh,540px);resize:vertical;line-height:1.55}.description-heading{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;margin:16px 0 6px}.description-heading label{margin:0}.description-sections{display:flex;flex:1;flex-wrap:wrap;justify-content:flex-end;gap:6px}.description-sections label{flex-direction:row;align-items:center;font-size:.8rem;line-height:1.3;cursor:default;padding:5px 8px;border:1px solid var(--border);border-radius:var(--ui-radius, 6px);color:var(--muted);background:var(--surface)}.description-sections label:has(input:checked){color:var(--text);border-color:color-mix(in srgb,var(--accent) 65%,var(--border));background:color-mix(in srgb,var(--accent) 10%,var(--surface))}.description-sections label:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}.description-sections label:has(input:disabled){opacity:.55}.description-sections input{accent-color:var(--accent);flex-shrink:0}.description-help{margin:0 0 8px}.nwd-actions{flex-wrap:wrap}.nwd-actions a{font-size:.8rem}@media(width<=600px){dialog{margin-top:1rem;max-height:calc(100dvh - 2rem)}.description-sections{flex-basis:100%;justify-content:flex-start}}a{color:var(--accent)}.created-issue{padding:16px;border:1px solid var(--border);border-radius:var(--ui-radius, 8px)}.issue-heading{display:flex;align-items:center;gap:8px;margin-bottom:12px}.issue-status{padding:3px 10px;border-radius:20px;background:#238636;color:#fff;font-size:.8rem}.issue-status.closed{background:#8250df}.issue-status.not_planned,.issue-status.duplicate,.issue-status.unknown{background:#656d76}.issue-number{color:var(--muted)}h4{font-size:1.15rem;line-height:1.4;overflow-wrap:anywhere}.issue-description{margin-top:16px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:40vh;overflow:auto;line-height:1.5;font-size:.9rem}.issue-labels{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.issue-labels span{border:1px solid var(--border);border-radius:12px;padding:2px 8px;font-size:.75rem}.para+.para,.md-list{margin-top:.75em}.md-list{padding-left:1.5em}.inline-code,.code-block{font-family:monospace;background:var(--bg, var(--surface));border-radius:4px}.inline-code{padding:1px 4px}.code-block{white-space:pre;overflow:auto;padding:10px;margin:10px 0}
|
|
13
|
-
`;var $={"github-unavailable":"GitHub could not be reached. Try checking again.","github-issue-forbidden":"GitHub did not permit issue creation. Check your repository access and authorization.","github-create-uncertain":"GitHub may have created this issue. Check the repository before trying again.","github-create-failed":"GitHub could not create the issue. Check the title and description before trying again.",unauthenticated:"Your session expired. Sign in again before creating an issue.","workspace-changed":"Your workspace access changed. Reopen the finding before creating an issue.","bad-issue-repository":"The finding\u2019s repository changed. Reopen the finding before creating an issue.","no-finding":"This finding is no longer available in this workspace."},k=class extends x{static styles=[...x.styles,C(_)];static properties={teamId:{attribute:!1},context:{attribute:!1},session:{attribute:!1},formUrl:{attribute:!1},title:{state:!0},body:{state:!0},prepared:{state:!0},busy:{state:!0},creating:{state:!0},message:{state:!0},uncertain:{state:!0},createdUrl:{state:!0},createdIssue:{state:!0},detailsUnavailable:{state:!0},sections:{state:!0}};constructor(){super(),this.title="",this.body="",this.prepared=null,this.busy=!1,this.creating=!1,this.message="",this.uncertain=!1,this.createdUrl="",this.createdIssue=null,this.detailsUnavailable=!1,this.sections=[]}beforeOpen(){this.finding&&Object.assign(this,D(this.finding,this.draftOptions)),this.check(!0)}editBody(e){Object.assign(this,E(this,e))}toggleSection(e,s){Object.assign(this,v(this,e,s))}current(){return!this._settled&&this.isCurrent()}fallbackUrl(){let e=new URL(this.formUrl);return e.searchParams.set("title",this.title),e.searchParams.set("body",this.body),this.prepared?.labels&&e.searchParams.set("labels",this.prepared.labels.join(",")),e.href}async check(e=!1){if(!(this.busy||!this.current())){this.busy=!0,this.message="";try{let s=await w(this.teamId,this.context,this.session.csrfToken);if(!this.current())return;this.prepared=s,this.uncertain=!1,s.mode==="existing"&&(this.onCreated?.(s.url),window.location.assign(s.url)),e&&s.mode==="form"&&window.location.assign(this.fallbackUrl())}catch(s){!this.uncertain&&!["pending","created-unavailable"].includes(this.prepared?.mode)&&(this.prepared=null),this.message=$[s.message]??"Unable to check this issue. Please retry."}finally{this.busy=!1}}}async create(){if(!(this.busy||this.uncertain||this.createdUrl||this.prepared?.mode!=="api")){if(!this.current()){this.message=$["workspace-changed"],this.prepared=null;return}this.busy=!0,this.creating=!0,this.message="";try{let e=await w(this.teamId,this.context,this.session.csrfToken,{title:this.title,body:this.body});if(!this.current())return;e.mode==="existing"?(this.onCreated?.(e.url),window.location.assign(e.url)):e.url?(this.createdUrl=e.url,this.createdIssue=e.issue,this.detailsUnavailable=e.detailsUnavailable===!0,this.onCreated?.(e.url)):this.prepared=e}catch(e){e.message==="github-authorization-required"?this.prepared={mode:"authorize",authorizationPath:"/api/oauth/github/issues/login"}:(this.uncertain=e.message==="github-create-uncertain",["workspace-changed","bad-issue-repository","no-team","no-report","no-finding","unauthenticated","forbidden"].includes(e.message)&&(this.prepared=null),this.message=$[e.message]??"Could not create this issue. Check the title, description, and repository access.")}finally{this.busy=!1,this.creating=!1}}}render(){let e=this.createdIssue,s=this.prepared,i=s?.mode==="created-unavailable",c=this.createdUrl||i,n=this.uncertain||s?.mode==="pending",l=this.creating||n,p=!this.busy&&!n&&s?.mode==="form";return o`<dialog aria-labelledby="issue-dialog-title" @close="${this._onClose}" @cancel="${r=>{this.creating&&r.preventDefault()}}"><header><h3 id="issue-dialog-title">${c?"Issue created":"Create a GitHub issue"}</h3></header><div class="dialog-content"><p class="nwd-intro">${c?"Created":"Create"} in <strong>${this.context?.repository}</strong> as <strong>@${this.session?.login}</strong>.</p>${this.createdUrl?o`<section class="created-issue" aria-label="Created GitHub issue"><div class="issue-heading"><span class="${`issue-status ${e?.status??"open"} ${e?.stateReason??""}`}">${e?.status==="closed"?e.stateReason==="not_planned"?"Not planned":e.stateReason==="duplicate"?"Duplicate":e.stateReason==="completed"?"Completed":"Closed":"Open"}</span> <span class="issue-number">${e?.number?`#${e.number}`:""}</span></div><h4><a href="${this.createdUrl}" target="_blank" rel="noopener">${e?.title??this.title}</a></h4><p class="nwd-note">Opened by @${e?.author??this.session?.login}</p>${e?.labels?.length?o`<div class="issue-labels">${e.labels.map(r=>o`<span>${r}</span>`)}</div>`:u}<div class="issue-description">${this.renderBody?this.renderBody(e?.description??this.body):e?.description??this.body}</div><p class="nwd-note ui-hint">Linked permanently to this finding. The Issue button will open this issue next time.</p>${this.detailsUnavailable?o`<p class="nwd-note">GitHub’s latest details could not be loaded. The issue was created and its link is saved.</p>`:u}</section>`:i?o`<p role="status">The issue was created and linked permanently to this finding. Its details cannot be shown because workspace access could not be confirmed. Check its status again once workspace access is available.</p>`:o`<label>Title<input class="nwd-input" maxlength="256" .value="${this.title}" ?disabled="${l}" @input="${r=>{this.title=r.target.value}}"></label><div class="description-heading"><label for="issue-description">Description</label> ${this.sections.length>0?o`<div class="description-sections" role="group" aria-label="Include in description">${this.sections.map(r=>o`<label><input type="checkbox" .checked="${r.selected}" ?disabled="${l}" @change="${m=>this.toggleSection(r.id,m.target.checked)}">${r.label}</label>`)}</div>`:u}</div><p id="description-help" class="nwd-note description-help ui-hint">${this.sections.length>0?"Add or remove sections above. Your edits are kept when toggling them.":"Edit the description before creating the issue."}</p><textarea id="issue-description" class="nwd-input" maxlength="65536" .value="${this.body}" aria-describedby="description-help" ?disabled="${l}" @input="${r=>this.editBody(r.target.value)}"></textarea> ${s?.labels?.length?o`<p class="nwd-note">Labels: ${s.labels.join(", ")}</p>`:u} ${s?.mode==="permissions"?o`<p>Ask a repository owner to approve the app’s Issues read and write permission. ${s.authorizationPath?o`<a href="${s.authorizationPath}" target="_blank" rel="noopener">Review repository permissions</a>`:u}</p>`:u} ${s?.mode==="authorize"?o`<p><a href="${s.authorizationPath}" target="_blank" rel="noopener">Authorize GitHub</a>, then check authorization here.</p>`:u} ${s?.mode==="pending"?o`<p role="status">An issue is being created, or its creation could not be confirmed. Check its status before continuing; another issue will not be created.</p>`:u} ${s?.mode==="unavailable"?o`<p role="status">This finding already has a managed issue in a repository outside this workspace.</p>`:u}`} ${!this.createdUrl&&this.message?o`<p class="nwd-note" role="status">${this.message}</p>`:u} ${!this.createdUrl&&this.busy?o`<p role="status">${this.creating?"Creating issue\u2026":"Checking repository access\u2026"}</p>`:u}</div><footer class="nwd-actions">${this.createdUrl?o`<a href="${this.createdUrl}" target="_blank" rel="noopener">Open issue on GitHub</a>`:!this.busy&&n?o`<a href="${s?.repositoryUrl??`https://github.com/${this.context?.repository}/issues`}" target="_blank" rel="noopener">Check repository issues</a>`:p?o`<a href="${this.fallbackUrl()}" target="_blank" rel="noopener">Use GitHub form</a>`:u} <span class="nwd-spacer"></span> ${!this.createdUrl&&s?.mode!=="unavailable"?s?.mode==="api"&&!this.uncertain?o`<button class="primary" ?disabled="${this.busy||!this.title.trim()}" @click="${this.create}">Create issue</button>`:o`<button ?disabled="${this.busy}" @click="${()=>this.check()}">${n||i?"Check issue status":"Check authorization"}</button>`:u} <button ?disabled="${this.creating}" @click="${()=>this._finish(null)}">${c?"Close":"Cancel"}</button></footer></dialog>`}};customElements.define("managed-issue-dialog",k);function M(a){return R("managed-issue-dialog",a)}export{M as openManagedIssueDialog};
|
package/out/chunk-GZWM7UQM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p as E,w as x,x as b,y as A}from"./chunk-EDKLBQQN.js";import{j as w}from"./chunk-ZESLQCTF.js";function K(t,n){return t?t.base===""?`${t.other}${n}`:n.startsWith(t.base)?n.slice(t.base.length):null:n}var W=(t,n)=>`${"../".repeat(t.base.split("/").length-1)}${n}`;function ct({root:t,paths:n},e,r){if(!t||e===".")return e;for(let s of r){let l=n.get(`${e}/${s}`);if(l?.endsWith(`/${s}`))return l.slice(0,-s.length-1)}let o=K(t,`${e}/`);return o===null?W(t,e):o.slice(0,-1)||"."}function ft(t,n){if(!t)return{prefix:n,from:null,to:null};let e=n.startsWith(t.other)?n:"";return{prefix:e,from:`./${t.base}${e.slice(t.other.length)}`,to:`./${e||t.other}`}}function ht(...t){let n=new Set;for(let r of t){let o=w(r);for(let[s,l]of Object.entries(r?.bundle?.reason??{}))Array.isArray(l)&&l.some(i=>o.has(i))&&n.add(s)}let e=r=>t.some(o=>{if(o?.kind!=="stasis")return!1;let s=w(o),l=o?.bundle?.reason?.[r];return new Set(Array.isArray(l)?l.filter(i=>s.has(i)):[]).size<s.size});return[...n].some(e)?[...n].toSorted().map(r=>({id:`reason:${r}`,label:r})):[]}function F(t,n=""){let e=w(t);if(!n||t?.kind!=="stasis")return e;let r=t?.bundle?.reason?.[n.replace(/^reason:/u,"")],o=new Set(Array.isArray(r)?r:[]);return new Map([...e].filter(([s])=>o.has(s)))}function P(t,n,e,r){return JSON.stringify([t,n,e,r])}function gt(t,n=""){let e=new Map;if(t?.kind!=="stasis"||!t.bundle)return e;let r=n?w(t):null,o=n?F(t,n):null;for(let[s,l]of t.bundle.imports)for(let[i,c]of l)for(let[p,u]of c){let f=typeof u=="string"?[[null,u]]:u;for(let[a,h]of f){if(o&&!o.has(i)&&(r.has(i)||!o.has(h)))continue;let g=P(i,p,s,a);e.set(g,{key:g,parent:i,specifier:p,conditions:s,platform:a,target:h})}}return e}var S=(t,{lo:n,start:e},r)=>t[e+(r-n)/2];function N(t,n,{low:e,high:r},o,s){return t===-n||t-1<e||t!==n&&t+1<=r&&S(o,s,t-1)<S(o,s,t+1)?t+1:t-1}function j(t,n,e,{first:r,n:o,m:s,d:l,...i}){t.a.fill(1,0,r).fill(1,o),t.b.fill(1,0,r).fill(1,s);let c=o,p=s;for(let u=l;u>0;u--){let f=c-p,a=N(f,u,i,n,e[u]),h=S(n,e[u],a);for(let g=a>f?h:h+1;g<c;g++)t.a[g]=t.b[g-f]=1;c=h,p=c-a}for(let u=r;u<c;u++)t.a[u]=t.b[u]=1}function O(t,n,e){let r=0,o=n.length,s=t.length,l=2*(s+o);for(;r<s&&r<o&&t[r]===n[r];)r++;for(;s>r&&o>r&&t[s-1]===n[o-1];)s--,o--;let i={high:s-r,low:r-o},c=[r],p=[{lo:1,start:0}];for(let u=0;u<=i.high-i.low;u++){let f=p[u],a=Math.min(u,i.high),h=Math.max(-u,i.low+(i.low+u&1));p.push({lo:h,start:c.length});for(let g=h;g<=a;g+=2){let m=N(g,u,i,c,f),y=S(c,f,m),d=m>g?y:y+1,B=d;for(;d<s&&d-g<o&&t[d]===n[d-g];)d++;if(l+=2+d-B,c.push(d),d>=s&&d-g>=o)return j(e,c,p,{first:r,n:s,m:o,d:u,...i}),l}}throw new Error("no edit script between two lines")}var z=/[\p{L}\p{N}_$]+|\s+|[^\p{L}\p{N}_$\s]/gu,G=2e3,V=800,I=.6;function M(t,n){if(t.length>G)return null;let e=t.match(z)??[];return e.length>V?null:{line:t,tokens:e,words:e.map(r=>(n.has(r)||n.set(r,n.size),n.get(r)))}}function _({tokens:t,line:n},e){let r=[];for(let o=0,s=0;s<t.length;o+=t[s++].length){if(e[s])continue;let l=r.at(-1);l&&/^\s*$/u.test(n.slice(l[1],o))?l[1]=o+t[s].length:r.push([o,o+t[s].length])}return r}var L=(t,n)=>t.reduce((e,[r,o])=>e+o-r,0)/Math.max(1,n.length);function C(t,n){let e={a:t.words.map(()=>0),b:n.words.map(()=>0)},r=O(t.words,n.words,e),o={a:_(t,e.a),b:_(n,e.b)};return{ranges:o,share:e.a.includes(1)?Math.min(L(o.a,t.line),L(o.b,n.line)):1,steps:r}}function wt(t,n){if(t===n)return{a:[],b:[]};let e=new Map,r=M(t,e),o=M(n,e);if(r===null||o===null)return null;let{ranges:s,share:l}=C(r,o);return l<=I?s:null}var R=200,J=5e6,U=6,Y=60,q=3;function Q(t){let n=new Map;for(let e of t?.tokens??[])n.set(e,(n.get(e)??0)+1);return n}function Z(t,n){let e=new Map,r=[t,n].map(f=>f.map(a=>M(a,e))),o=r.map(f=>f.map(Q)),s=0,l=(f,a,h)=>{let g=0;for(let[m,y]of f)if(s+=q,(g+=m.length*Math.max(0,y-(a.get(m)??0)))>I*h.length)return 1/0;return g/Math.max(1,h.length)},i=(f,a)=>r[0][f]===null||r[1][a]===null?1/0:Math.min(l(o[0][f],o[1][a],t[f]),l(o[1][a],o[0][f],n[a])),c=(f,a)=>{if(s+=Y,i(f,a)===1/0)return 1/0;let{share:h,steps:g}=C(r[0][f],r[1][a]);return s+=g,h<=I?h:1/0},p=new Float64Array(t.length*n.length).fill(Number.NaN);return{share:(f,a)=>{let h=f*n.length+a;return Number.isNaN(p[h])&&(p[h]=t[f]===n[a]?0:c(f,a)),p[h]},floor:i,spent:()=>s}}function tt(t,n,{share:e,spent:r}){let o=Array.from({length:t+1},()=>new Float64Array(n+1)),s=(i,c)=>e(i,c)===1/0?-1/0:1e3-e(i,c)+o[i][c];for(let i=0;i<t;i++)for(let c=0;c<n;c++)if(o[i+1][c+1]=Math.max(o[i][c+1],o[i+1][c],s(i,c)),r()>J)return null;let l=[];for(let i=t,c=n;i>0&&c>0;)o[i][c]===o[i][c-1]?c--:o[i][c]===o[i-1][c]?i--:l.push([--i,--c]);return l.toReversed()}function nt(t,n,{share:e,floor:r}){let o=[];for(let s=0,l=0;s<t&&l<n;s++){let i=null,c=1/0,p=Array.from({length:Math.min(n,l+U)-l},(u,f)=>[l+f,r(s,l+f)]);for(let[u,f]of p.toSorted((a,h)=>a[1]-h[1]||a[0]-h[0])){if(f>c)break;(e(s,u)<c||e(s,u)===c&&u<i)&&([i,c]=[u,e(s,u)])}i!==null&&(o.push([s,i]),l=i+1)}return o}function bt(t,n){if(t.length>R||n.length>R)return[];let e=Z(t,n);return tt(t.length,n.length,e)??nt(t.length,n.length,e)}function T(t){if(t===null)return"";let n=t.type==="symlink"?t.target:t.data;if(typeof n=="string")return n.includes("\0")?void 0:n;if(!n.includes(0))try{return E(n)}catch{return}}var et=new Set(["none","all","change","trailing"]);function H({horizon:t=1/0,whitespace:n="none",ignoreCase:e=!1}={}){if(t!==1/0&&!(Number.isSafeInteger(t)&&t>=0))throw new RangeError(`horizon must be a whole number or Infinity, not ${t}`);if(!et.has(n))throw new RangeError(`whitespace must be 'none', 'all', 'change' or 'trailing', not ${n}`);if(typeof e!="boolean")throw new TypeError(`ignoreCase must be a boolean, not ${typeof e}`);return{horizon:t,whitespace:n,ignoreCase:e}}var $=t=>t.reduce((n,{a0:e,a1:r,b0:o,b1:s})=>n+r-e+s-o,0),k=t=>t===""?[]:t.split(/(?<=\n)/u),rt=t=>({...t,ignoreCase:!1,whitespace:"none"}),ot=t=>(t.whitespace??"none")!=="none"||!!t.ignoreCase;function st(t,n,e,r,o){let s=k(t),l=k(n),i=(f,a,h,g)=>({a0:f,a1:a,b0:h,b1:g,remove:s.slice(f,a),insert:l.slice(h,g)}),c=o.flatMap(({a0:f,a1:a,b0:h,b1:g})=>f===a||h===g?[i(f,a,h,g)]:b(s.slice(f,a).join(""),l.slice(h,g).join(""),e).map(m=>i(f+m.a0,f+m.a1,h+m.b0,h+m.b1))),p=f=>{try{return A(t,n,f,{format:"normal",ignoreCase:e.ignoreCase,whitespace:e.whitespace}),!0}catch(a){if(a instanceof x)return!1;throw a}},u=$(c)<$(r)&&p(c)?c:r;return $(u)<$(o)?u:o}function it(t,n,e){let r=b(t,n,e);return ot(e)?st(t,n,e,r,b(t,n,rt(e))):r}function It(t,n,e){let r=T(t),o=T(n);if(r===void 0||o===void 0)return{binary:!0,blocks:[],insertions:null,deletions:null};let s=r===o?[]:it(r,o,e),l=(i,c)=>s.reduce((p,u)=>p+u[c]-u[i],0);return{binary:!1,blocks:s,insertions:l("b0","b1"),deletions:l("a0","a1")}}function D(t,n,e,r){let{whitespace:o,ignoreCase:s}=H(r);try{return A(t,n,e,{format:"normal",whitespace:o,ignoreCase:s}),!0}catch(l){if(l instanceof x)return!1;throw l}}var X=/[ \t\n\v\f\r]/u,v=t=>{let n=t.split(`
|
|
2
|
-
`);return n.at(-1)===""&&n.pop(),n};function lt(t,n){for(let e=0,r=0;;e++,r++){let o="",s="";for(;e<t.length&&X.test(t[e]);)o+=t[e++];for(;r<n.length&&X.test(n[r]);)s+=n[r++];if(o!==s&&new Set(o+s).size>1)return!0;if(e>=t.length||r>=n.length)return!1}}function _t(t,n,e){try{if(!D(t,n,e,{whitespace:"all"}))return!0}catch{return!0}let r=v(t),o=v(n),s=0,l=0;for(let i=0;i<=e.length;i++){let c=i<e.length?e[i].a0:r.length;for(;s<c;s++,l++)if(r[s]!==o[l]&<(r[s],o[l]))return!0;i<e.length&&({a1:s,b1:l}=e[i])}return!1}function Rt(t,n,{extension:e=!0}={}){let r=t.split("/"),o=n.split("/"),s=0;for(;s<r.length-1&&s<o.length-1&&r[s]===o[s];)s++;let l=0;for(;l<r.length-s-1&&l<o.length-s-1&&r.at(-1-l)===o.at(-1-l);)l++;let i={head:s?`${r.slice(0,s).join("/")}/`:"",from:r.slice(s,r.length-l).join("/"),to:o.slice(s,o.length-l).join("/"),tail:l?`/${r.slice(-l).join("/")}`:""},c=i.from.lastIndexOf(".");return e&&!i.from.includes("/")&&!i.to.includes("/")&&c>0&&i.to.lastIndexOf(".")===c&&i.from.slice(0,c)===i.to.slice(0,c)?{...i,head:i.head+i.from.slice(0,c),from:i.from.slice(c),to:i.to.slice(c)}:i}export{wt as a,bt as b,T as c,H as d,It as e,_t as f,Rt as g,K as h,W as i,ct as j,ft as k,ht as l,F as m,P as n,gt as o};
|
package/out/chunk-IU3CCINR.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as U,b as v,c as T,d as R,f as _}from"./chunk-UYAXVRVL.js";import{a as S}from"./chunk-TUII34K2.js";var B=["dependencies","security"],X={dependencies:"Dependencies",security:"Security"};var P=R(),M=Object.freeze(P.models),x=P.defaultModel;var D="x-upload-encryption",L=1,O=1,I={name:"X25519"},C=34;var A=1024*1024,K=64*1024,N="deepview-managed-upload.v1.content-key";function j(e,r){let t=new Uint8Array(12);return new DataView(t.buffer).setUint32(7,e),t[11]=r?1:0,t}async function G(e,r,t){let n=await crypto.subtle.importKey("raw",e,"HKDF",!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:r,info:S(N)},n,{name:"AES-GCM",length:256},!1,[t])}async function H(e){let r=new Uint8Array(await e.slice(0,K).arrayBuffer());if(r.includes(0))return!1;try{return new TextDecoder("utf-8",{fatal:!0}).decode(r,{stream:!0}),!0}catch{return!1}}async function k(e,r,t){let n=await H(e),[a,s]=await Promise.all([crypto.subtle.importKey("raw",r,I,!1,[]),crypto.subtle.generateKey(I,!1,["deriveBits"])]),o=new Uint8Array(C);o[0]=L,o[1]=n?O:0,o.set(new Uint8Array(await crypto.subtle.exportKey("raw",s.publicKey)),2);let i=await G(await crypto.subtle.deriveBits({name:"X25519",public:a},s.privateKey,256),o,"encrypt"),c=[new Blob([o])],d=new Uint8Array(A),p=0,u=0,w=async l=>{c.push(new Blob([await crypto.subtle.encrypt({name:"AES-GCM",iv:j(u++,l)},i,d.subarray(0,p))])),p=0},y=(n?e.stream().pipeThrough(new CompressionStream("gzip")):e.stream()).getReader();try{for(let l=await y.read();!l.done;l=await y.read()){t?.throwIfAborted();for(let h=0;h<l.value.length;){p===A&&await w(!1);let g=Math.min(A-p,l.value.length-h);d.set(l.value.subarray(h,h+g),p),p+=g,h+=g}}}catch(l){throw await y.cancel(l).catch(()=>{}),l}return await w(!0),new Blob(c)}var m=null,b=0;function ce(){return m?.user.role??null}function le(e){if(e!==null&&!v(e))throw new TypeError(`Unknown managed preview role: ${e}. Expected ${U.join(", ")}.`);b++,m=e===null?null:{user:{id:`preview:${e}`,login:e,name:e[0].toUpperCase()+e.slice(1),role:e,avatarUrl:null,lastSeenAt:Date.now(),lastActivityAt:null},csrfToken:null}}function z(e,r){let t=new URL(e,"http://managed-preview.invalid").pathname,n=(r?.method??"GET").toUpperCase();if(n==="POST"&&t==="/api/auth/logout")return Response.json({ok:!0});if(n!=="GET")throw new Error("Changes are not saved in the managed UI preview");if(t==="/api/auth/session")return Response.json(m);if(t==="/api/teams")return Response.json({teams:[]});if(t.startsWith("/api/admin/")&&!T(m.user.role,"manage"))return Response.json({error:"forbidden"},{status:403});if(["/api/admin/users","/api/admin/teams","/api/admin/repositories","/api/admin/repositories/aliases","/api/admin/repositories/risk"].includes(t)&&m.user.role!=="admin")return Response.json({error:"forbidden"},{status:403});if(t==="/api/admin/repositories/risk")return new Response(`{"type":"repos","repos":[]}
|
|
2
|
-
{"type":"done"}
|
|
3
|
-
`,{headers:{"content-type":"application/x-ndjson"}});let a={"/api/admin/users":{users:[m.user]},"/api/admin/teams":{teams:[],users:[m.user],repos:[],permissions:B},"/api/admin/links":{shares:[]},"/api/admin/repositories":{repositories:[],total:0,connectedCount:0,installUrl:null,tokenMissing:!1},"/api/admin/repositories/aliases":{aliases:[],repos:[]},"/api/admin/repositories/resolve":{location:null},"/api/admin/reports":{reports:[],repos:[],maxBytes:26214400},"/api/admin/bundles":{bundles:[],repos:[],maxBytes:209715200},"/api/admin/history":{history:[],total:0,page:1,limit:100,filters:{repos:[],users:[]}},"/api/admin/scan/models":{models:M,defaultModel:x},"/api/admin/scan-results":{bundles:[],results:[]}};return Object.hasOwn(a,t)?Response.json(a[t]):Response.json({error:"not-found"},{status:404})}var E=3*1024*1024,F=new Set(["/api/admin/reports","/api/admin/bundles","/api/admin/deduplication"]);async function V(e,r){let t=await r("/api/admin/uploads/key",{credentials:"same-origin",signal:e.signal});if(t.status===404||t.status===405)return e;if(!t.ok)return t;let n=(await t.json())?.key;if(typeof n!="string")throw new Error("The server sent an invalid upload key");let a=new Headers(e.headers);return a.set(D,"1"),{...e,headers:a,body:await k(e.body,Uint8Array.fromBase64(n,{alphabet:"base64url"}),e.signal)}}async function Y(e,r,t){let n=null;if(e!=="/api/admin/deduplication"&&r.body.size>E){let s=await t("/api/config",{credentials:"same-origin",signal:r.signal});if(!s.ok)return s;let o=(await s.json()).managed,i=o?.uploadMaxBytes?.[e.endsWith("/reports")?"reports":"bundles"];if(Number.isSafeInteger(i)&&i>0&&r.body.size>i)return Response.json({error:"too-large"},{status:413});let c=o?.uploadChunkBytes;Number.isSafeInteger(c)&&c>0&&c<=E&&(n=c)}let a=await V(r,t);return a instanceof Response?a:n==null||a.body.size<=E?await t(e,a):await $(e,a,t,n)}async function $(e,r,t,n){let a=r.body,s=crypto.randomUUID(),o=e.endsWith("/reports")?"reports":"bundles",i=Math.ceil(a.size/n),c=new Headers(r.headers);c.set("content-type","application/octet-stream");let d=0,p=!1;try{for(let f=0;f<i;f++){d=f+1;let y=await t(`/api/admin/uploads/${o}/${s}/${f}`,{...r,headers:c,body:a.slice(f*n,(f+1)*n)});if(!y.ok)return y}let u=new Headers(r.headers);u.set("x-upload-id",s),u.set("x-upload-parts",String(i)),u.set("x-upload-size",String(a.size));let w=await t(e,{...r,headers:u,body:""});return p=w.ok,w}finally{if(!p&&d>0){let u=new Headers(r.headers);u.set("x-upload-parts",String(d)),await t(`/api/admin/uploads/${o}/${s}`,{...r,method:"DELETE",headers:u,body:void 0,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}}}async function W(e){await e.json().then(t=>t?.error,()=>null)==="view-only"&&globalThis.document?.dispatchEvent(new CustomEvent("managed-view-only"))}async function de(e,r){if(r?.signal?.throwIfAborted(),m)return z(e,r);let t=b;async function n(a,s){if(t!==b)throw new DOMException("Managed session changed","AbortError");let o=_();if(o){if(new URL(a,globalThis.location.origin).origin!==globalThis.location.origin)throw new Error("Public workspace requests must be same-origin");let d=new Headers(s?.headers);d.set("x-deepview-share",o.token),s={...s,headers:d,credentials:"omit",redirect:"error"}}let i=await fetch(a,{...s,cache:"no-store"});if(t!==b)throw new DOMException("Managed session changed","AbortError");return i.status===403&&!["GET","HEAD"].includes((s?.method??"GET").toUpperCase())&&W(i.clone()),i}return r?.method==="POST"&&F.has(e)&&r.body instanceof Blob?await Y(e,r,n):await n(e,r)}export{X as a,ce as b,le as c,de as d};
|
package/out/chunk-K3X5EJBQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{f as o}from"./chunk-UYAXVRVL.js";import{a as i}from"./chunk-4XCDFGDP.js";import{c as a,g as e}from"./chunk-2XUEZHIP.js";function s(t,r){return t?i(t,a`<span class="managed-comment-avatar" aria-hidden="true"><span>${(r?.[0]??"?").toUpperCase()}</span> ${o()?e:a`<img alt="" src="${`/api/avatar/${encodeURIComponent(t)}`}" loading="lazy" @error="${n=>{n.currentTarget.hidden=!0}}">`}</span>`):e}function u(t){let r=t.version>1&&t.updatedAt!=null,n=t.createdAt??(r?t.updatedAt:null);if(n==null)return e;let d=new Date(n),l=[t.createdAt==null?"":`Posted ${new Date(t.createdAt).toLocaleString()}`,r?`Edited ${new Date(t.updatedAt).toLocaleString()}`:""].filter(Boolean).join(`
|
|
2
|
-
`);return a`<time class="managed-comment-time" datetime="${d.toISOString()}" data-tooltip="${l}">${t.createdAt==null?"edited ":""}${d.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}${r&&t.createdAt!=null?" (edited)":""}</time>`}function p(t,r,n=e){let d=u(t);return a`<div class="managed-comment"><div class="managed-comment-row">${t.authorId||t.authorLogin?a`<span class="managed-comment-author">${s(t.authorId,t.authorLogin)} ${t.authorLogin?a`<strong>${t.authorLogin}</strong>`:e}</span>`:e}<div class="managed-comment-body">${r}</div>${d===e&&n===e?e:a`<div class="managed-comment-meta">${n===e?e:a`<div class="managed-comment-actions">${n}</div>`} ${d}</div>`}</div></div>`}export{s as a,p as b};
|
package/out/chunk-KEX2ATEW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var o=`dialog{max-width:640px;width:min(94vw,640px)}header h3{margin:0 0 .4rem}.finding{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.35rem}.loc{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.76rem;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.desc{font-size:.78rem;color:var(--muted);margin:0 0 .7rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}textarea{display:block;width:100%;box-sizing:border-box;min-height:9rem;max-height:50vh;resize:vertical;padding:.55rem .65rem;border:1px solid var(--border);border-radius:var(--ui-radius, 6px);background:var(--bg, var(--surface));color:var(--text);font:inherit;font-size:.88rem;line-height:1.4;&:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgb(from var(--accent) r g b / .18)}&::placeholder{color:var(--muted)}}
|
|
2
|
-
`;export{o as a};
|
package/out/chunk-KYCNJVB7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var f=class{constructor(s=()=>{}){this.resources=new Map,this.session=null,this.teamCatalog=null,this.reportCatalog=null,this.bundleCatalog=null,this.generation=0,this.sessionController=new AbortController,this.notify=s}setSession(s){(this.session?.id!==s?.id||this.session?.role!==s?.role)&&this.reset(),this.session=s}reset(){this.generation++,this.sessionController.abort(),this.sessionController=new AbortController,this.invalidate(),this.session=null,this.teamCatalog=null,this.reportCatalog=null,this.bundleCatalog=null}setReportCatalog(s){let l=new Set,r=new Map(s.map(t=>[t.id,JSON.stringify([t.cacheKey??null,t.reports.map(e=>[e.id,e.cacheKey??null,e.visible!==!1]).toSorted(),(t.bundles??[]).map(e=>[e.id,e.filename,e.repoFullName,e.repoDirectory??""]).toSorted()])]));for(let t of new Set([...this.teamCatalog?.keys()??[],...r.keys()]))this.teamCatalog?.get(t)!==r.get(t)&&l.add(`team:${t}`);for(let t of this.resources.keys()){let e="reports:content:team:";if(t.startsWith(e)){let[h]=t.slice(e.length).split(":");(!r.has(h)||this.teamCatalog?.get(h)!==r.get(h))&&this.invalidate([t])}}this.teamCatalog=r;let n=new Map;for(let t of s)for(let e of t.reports){let h=n.get(e.id)??[];h.push(JSON.stringify([t.id,e.cacheKey??null])),n.set(e.id,h)}let a=new Map([...n].map(([t,e])=>[t,JSON.stringify(e.toSorted())])),u=this.reportCatalog;this.reportCatalog=a;let d=new Set(l);for(let t of new Set([...u?.keys()??[],...a.keys()]))u?.get(t)!==a.get(t)&&d.add(t);for(let t of this.resources.keys()){if(!t.startsWith("reports:content:")||t.startsWith("reports:content:team:"))continue;let e=t.slice(16);(!a.has(e)||d.has(e))&&(this.invalidate([t]),d.add(e))}let o=new Map;for(let t of s)for(let e of t.bundles??[]){let h=o.get(e.id)??[];h.push(JSON.stringify([t.id,t.cacheKey??null,e.filename,e.repoFullName,e.repoDirectory??""])),o.set(e.id,h)}let i=!1,c=new Map([...o].map(([t,e])=>[t,JSON.stringify(e.toSorted())]));for(let t of new Set([...this.bundleCatalog?.keys()??[],...c.keys()]))this.bundleCatalog?.get(t)!==c.get(t)&&(i=!0,d.add(`bundle:${t}`),this.invalidate([`bundle-metadata:${t}`]));this.bundleCatalog=c;for(let t of this.resources.keys()){if(!t.startsWith("report-sources:")&&!t.startsWith("finding-history:"))continue;let[,e,h]=t.split(":");(e?l.has(`team:${e}`):i||d.has(h))&&this.invalidate([t])}return d}read(s){return this.resources.get(s)?.data}invalidate(s){for(let[l,r]of this.resources)s&&!s.some(n=>l===n||l.startsWith(`${n}:`))||(r.controller?.abort(),this.resources.delete(l))}async mutate(s,l){let r=this.generation,n;try{n=await s()}catch(a){throw r===this.generation&&a?.name!=="AbortError"&&this.notify(`Couldn't save changes: ${a?.message??a}`),a}if(r!==this.generation)throw new DOMException("Managed session changed","AbortError");return this.invalidate(l),n}async load(s,l,r,{signal:n,apply:a=()=>{},retryInvalidated:u=!1}={}){let d=this.generation;for(;;){n?.throwIfAborted();let o=this.resources.get(s);if(o||(o={},this.resources.set(s,o)),o.data!==void 0&&a(o.data),!o.pending){let i=o.controller=new AbortController;o.pending=(async()=>{try{let c=await r(i.signal);return i.signal.throwIfAborted(),o.data=c,c}catch(c){throw!i.signal.aborted&&c?.name!=="AbortError"&&this.notify(`Couldn't refresh ${l}: ${c?.message??c}`),c}})().finally(()=>{o.pending=null})}try{let i=await o.pending;if(n?.throwIfAborted(),this.resources.get(s)!==o)throw new DOMException("Managed data changed","AbortError");return a(i),i}catch(i){if(!u||i?.name!=="AbortError"||n?.aborted||d!==this.generation||this.resources.get(s)===o)throw i}}}},p=new f(g=>{document.dispatchEvent(new CustomEvent("managed-notice",{detail:{message:g}}))});function y(g){p.setSession(g)}function m(g){return p.setReportCatalog(g)}function w(){p.reset()}export{p as a,y as b,m as c,w as d};
|