@sourcegraph/code-host-integration 0.0.74 → 0.0.75
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.
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
`,variables:{repoName:t},mightContainPrivateInfo:!0})).pipe(H(pr),H((({repository:e})=>{if(!e)throw new So(t);if(!e.mirrorInfo.cloned)throw new _o(t);return e.uri})))),(({repoName:e})=>e));var Bo=n(93234),Uo=n.n(Bo);const qo=["group","id"];function Vo(e,t){var n;if(!e.actions)return[];const r=[],o=null===(n=e.menus)||void 0===n?void 0:n[t];if(o)for(const{action:t,alt:n,when:i,disabledWhen:a}of Uo()(o,qo)){const o=e.actions.find((e=>e.id===t)),s=e.actions.find((e=>e.id===n));o&&r.push({action:o,altAction:s,active:void 0===i||!!i,disabledWhen:!!a})}return r}var $o=n(26705),zo=n.n($o);const Ho=["Assembly","Bash","C","C++","C#","CSS","Dart","Elixir","Erlang","Go","GraphQL","Groovy","Haskell","HTML","Java","JavaScript","Kotlin","JSON","Julia","Lua","Markdown","Objective-C","OCaml","PHP","PowerShell","Python","R","Ruby","Rust","Sass","Scala","SQL","Swift","Terraform","TypeScript","VBA","XML","YAML","Zig"],Go=zo()(Ho.concat(["1C Enterprise","4D","ABAP","ABNF","ActionScript","Ada","Adobe Font Metrics","Agda","AGS Script","AL","Alloy","Alpine Abuild","Altium Designer","AMPL","AngelScript","Ant Build System","ANTLR","ApacheConf","Apex","API Blueprint","APL","Apollo Guidance Computer","AppleScript","Arc","AsciiDoc","ASL","ASN.1","AspectJ","ASP.NET","Assembly","Asymptote","ATS","Augeas","AutoHotkey","AutoIt","Avro IDL","Awk","Ballerina","Batchfile","Befunge","BibTeX","Bison","BitBake","Blade","BlitzBasic","BlitzMax","Bluespec","Boo","Brainfuck","Brightscript","C","C#","C++","C2hs Haskell","Cabal Config","Cap'n Proto","CartoCSS","Ceylon","Chapel","Charity","ChucK","Cirru","Clarion","Classic ASP","Clean","Click","CLIPS","Clojure","Closure Templates","Cloud Firestore Security Rules","CMake","C-ObjDump","COBOL","CodeQL","CoffeeScript","ColdFusion","ColdFusion CFC","COLLADA","Common Lisp","Common Workflow Language","Component Pascal","CoNLL-U","Cool","Coq","Cpp-ObjDump","Creole","Crystal","CSON","Csound","Csound Document","Csound Score","CSS","CSV","Cuda","cURL Config","CWeb","Cycript","Cython","D","Dafny","Darcs Patch","Dart","DataWeave","desktop","Dhall","Diff","DIGITAL Command Language","dircolors","DirectX 3D File","DM","DNS Zone","D-ObjDump","Dockerfile","Dogescript","DTrace","Dylan","E","Eagle","Easybuild","EBNF","eC","Ecere Projects","ECL","ECLiPSe","EditorConfig","Edje Data Collection","edn","Eiffel","EJS","Elixir","Elm","Emacs Lisp","EmberScript","EML","EQ","Erlang","F#","F*","Factor","Fancy","Fantom","Faust","FIGlet Font","Filebench WML","Filterscript","fish","FLUX","Formatted","Forth","Fortran","Fortran Free Form","FreeMarker","Frege","Futhark","Game Maker Language","GAML","GAMS","GAP","GCC Machine Description","G-code","GDB","GDScript","GEDCOM","Genie","Genshi","Gentoo Ebuild","Gentoo Eclass","Gerber Image","Gettext Catalog","Gherkin","Git Attributes","Git Config","GLSL","Glyph","Glyph Bitmap Distribution Format","GN","Gnuplot","Go","Golo","Gosu","Grace","Gradle","Grammatical Framework","Graph Modeling Language","GraphQL","Graphviz (DOT)","Groovy","Groovy Server Pages","Hack","Haml","Handlebars","HAProxy","Harbour","Haskell","Haxe","HCL","HiveQL","HLSL","HolyC","HTML","HTML+Django","HTML+ECR","HTML+EEX","HTML+ERB","HTML+PHP","HTML+Razor","HTTP","HXML","Hy","HyPhy","IDL","Idris","Ignore List","IGOR Pro","Inform 7","INI","Inno Setup","Io","Ioke","IRC log","Isabelle","Isabelle ROOT","J","Jasmin","Java","Java Properties","JavaScript","JavaScript+ERB","Java Server Pages","JFlex","Jison","Jison Lex","Jolie","JSON","JSON5","JSONiq","JSONLD","Jsonnet","JSON with Comments","JSX","Julia","Jupyter Notebook","Kaitai Struct","KiCad Layout","KiCad Legacy Layout","KiCad Schematic","Kit","Kotlin","KRL","LabVIEW","Lark","Lasso","Latte","Lean","Less","Lex","LFE","LilyPond","Limbo","Linker Script","Linux Kernel Module","Liquid","Literate Agda","Literate CoffeeScript","Literate Haskell","LiveScript","LLVM","Logos","Logtalk","LOLCODE","LookML","LoomScript","LSL","LTspice Symbol","Lua","M","M4","M4Sugar","Macaulay2","Makefile","Mako","Markdown","Marko","Mask","Mathematica","MATLAB","Maven POM","Max","MAXScript","mcfunction","MediaWiki","Mercury","Meson","Metal","Microsoft Developer Studio Project","MiniD","Mirah","mIRC Script","MLIR","Modelica","Modula-2","Modula-3","Module Management System","Monkey","Moocode","MoonScript","Motorola 68K Assembly","MQL4","MQL5","MTML","MUF","mupad","Muse","Mustache","Myghty","nanorc","NASL","NCL","Nearley","Nemerle","NEON","nesC","NetLinx","NetLinx+ERB","NetLogo","NewLisp","Nextflow","Nginx","Nim","Ninja","Nit","Nix","NL","NPM Config","NSIS","Nu","NumPy","NWScript","ObjDump","Object Data Instance Notation","Objective-C","Objective-C++","Objective-J","ObjectScript","OCaml","Odin","Omgrofl","ooc","Opa","Opal","OpenCL","OpenEdge ABL","Open Policy Agent","OpenQASM","OpenRC runscript","OpenSCAD","OpenStep Property List","OpenType Feature File","Org","Ox","Oxygene","Oz","P4","Pan","Papyrus","Parrot","Parrot Assembly","Parrot Internal Representation","Pascal","Pawn","Pep8","Perl","PHP","Pic","Pickle","PicoLisp","PigLatin","Pike","PlantUML","PLpgSQL","PLSQL","Pod","Pod 6","PogoScript","Pony","PostCSS","PostScript","POV-Ray SDL","PowerBuilder","PowerShell","Prisma","Processing","Proguard","Prolog","Propeller Spin","Protocol Buffer","Public Key","Pug","Puppet","PureBasic","Pure Data","PureScript","Python","Python console","Python traceback","q","Q#","QMake","QML","Qt Script","Quake","R","Racket","Ragel","Raku","RAML","Rascal","Raw token data","RDoc","Readline Config","REALbasic","Reason","Rebol","Red","Redcode","Regular Expression","RenderScript","Ren'Py","ReScript","reStructuredText","REXX","Rich Text Format","Ring","Riot","RMarkdown","RobotFramework","Roff","Roff Manpage","Rouge","RPC","RPM Spec","Ruby","RUNOFF","Rust","Sage","SaltStack","SAS","Sass","Scala","Scaml","Scheme","Scilab","SCSS","sed","Self","ShaderLab","Shell","ShellSession","Shen","Sieve","Slash","Slice","Slim","Smali","Smalltalk","Smarty","SmPL","SMT","Solidity","SourcePawn","SPARQL","Spline Font Database","SQF","SQL","SQLPL","Squirrel","SRecode Template","SSH Config","Stan","Standard ML","Starlark","Stata","STON","Stylus","SubRip Text","SugarSS","SuperCollider","Svelte","SVG","Swift","SWIG","SystemVerilog","Tcl","Tcsh","Tea","Terra","TeX","Texinfo","Text","Textile","Thrift","TI Program","TLA","TOML","TSQL","TSV","TSX","Turing","Turtle","Twig","TXL","Type Language","TypeScript","Unified Parallel C","Unity3D Asset","Unix Assembly","Uno","UnrealScript","UrWeb","V","Vala","VBA","VBScript","VCL","Verilog","VHDL","Vim Help File","Vim script","Vim Snippet","Visual Basic .NET","Volt","Vue","Wavefront Material","Wavefront Object","wdl","WebAssembly","WebIDL","Web Ontology Language","WebVTT","Wget Config","Windows Registry Entries","wisp","Wollok","World of Warcraft Addon Data","X10","xBase","X BitMap","XC","XCompose","X Font Directory Index","XML","XML Property List","Xojo","XPages","X PixMap","XProc","XQuery","XS","XSLT","Xtend","Yacc","YAML","YANG","YARA","YASnippet","ZAP","Zeek","ZenScript","Zephir","Zig","ZIL","Zimpl"])),Qo=[{name:"repo"},{name:"file",fields:[{name:"directory"},{name:"path"}]},{name:"content"},{name:"symbol",fields:[{name:"file"},{name:"module"},{name:"namespace"},{name:"package"},{name:"class"},{name:"method"},{name:"property"},{name:"field"},{name:"constructor"},{name:"enum"},{name:"interface"},{name:"function"},{name:"variable"},{name:"constant"},{name:"string"},{name:"number"},{name:"boolean"},{name:"array"},{name:"object"},{name:"key"},{name:"null"},{name:"enum-member"},{name:"struct"},{name:"event"},{name:"operator"},{name:"type-parameter"}]},{name:"commit",fields:[{name:"diff",fields:[{name:"added"},{name:"removed"}]}]}],Wo=(e,t)=>{if(t<0)return[];const n=[];for(const r of e)n.push(`${r.name}`),r.fields&&n.push(...Wo(r.fields,t-1).map((e=>`${r.name}.`+e)));return n};let Ko,Zo;!function(e){e.after="after",e.archived="archived",e.author="author",e.before="before",e.case="case",e.committer="committer",e.content="content",e.context="context",e.count="count",e.file="file",e.fork="fork",e.lang="lang",e.message="message",e.patterntype="patterntype",e.repo="repo",e.repogroup="repogroup",e.repohascommitafter="repohascommitafter",e.repohasfile="repohasfile",e.rev="rev",e.select="select",e.timeout="timeout",e.type="type",e.visibility="visibility"}(Ko||(Ko={})),function(e){e.f="file",e.g="repogroup",e.l="lang",e.language="lang",e.m="message",e.msg="message",e.r="repo",e.revision="rev",e.since="after",e.until="before"}(Zo||(Zo={}));const Yo=[...Object.keys(Ko),...Object.keys(Zo)];let Jo;!function(e){e.author="-author",e.committer="-committer",e.content="-content",e.f="-f",e.file="-file",e.l="-l",e.lang="-lang",e.message="-message",e.r="-r",e.repo="-repo",e.repohasfile="-repohasfile"}(Jo||(Jo={}));Object.values(Jo),Ko.author,Ko.committer,Ko.content,Ko.file,Ko.file,Ko.lang,Ko.lang,Ko.message,Ko.repo,Ko.repo,Ko.repohasfile;const Xo=[{label:"Search a GitHub organization",insertText:"^github\\.com/${1:ORGANIZATION}/.*",asSnippet:!0},{label:"Search a single GitHub repository",insertText:"^github\\.com/${1:ORGANIZATION}/${2:REPO-NAME}$",asSnippet:!0},{label:"Search for repositories with fuzzy string search",insertText:"${1:STRING}",asSnippet:!0}];Ko.after,Ko.archived,Ko.author,Ko.before,Ko.case,Ko.committer,Ko.content,Ko.context,Ko.count,Ko.file,Ko.fork,Ko.lang,Ko.message,Ko.patterntype,Ko.repo,Ko.repogroup,Ko.repohascommitafter,Ko.repohasfile,Ko.rev,Ko.select,Ko.timeout,Ko.type,Ko.visibility;function ei(e){const t={label:e};return/\s/.test(e)&&(t.insertText=`"${e}"`),t}let ti,ni,ri,oi,ii,ai,si,ci,li,ui,fi,pi,di,hi,mi,gi,vi,bi,yi,wi,Ei,_i,xi,Si,Oi,Ti,Ci,ki,Ni,Ai,Ii,Pi,Ri,Di,Li,Mi,ji,Fi,Bi,Ui,qi,Vi,$i,zi;!function(e){e.READ="READ"}(ti||(ti={})),function(e){e.UNPUBLISHED="UNPUBLISHED",e.PUBLISHED="PUBLISHED"}(ni||(ni={})),function(e){e.SCHEDULED="SCHEDULED",e.QUEUED="QUEUED",e.PROCESSING="PROCESSING",e.ERRORED="ERRORED",e.FAILED="FAILED",e.COMPLETED="COMPLETED"}(ri||(ri={})),function(e){e.DRAFT="DRAFT",e.OPEN="OPEN",e.CLOSED="CLOSED",e.MERGED="MERGED",e.DELETED="DELETED"}(oi||(oi={})),function(e){e.APPROVED="APPROVED",e.CHANGES_REQUESTED="CHANGES_REQUESTED",e.PENDING="PENDING",e.COMMENTED="COMMENTED",e.DISMISSED="DISMISSED"}(ii||(ii={})),function(e){e.PENDING="PENDING",e.PASSED="PASSED",e.FAILED="FAILED"}(ai||(ai={})),function(e){e.UNPUBLISHED="UNPUBLISHED",e.FAILED="FAILED",e.RETRYING="RETRYING",e.SCHEDULED="SCHEDULED",e.PROCESSING="PROCESSING",e.OPEN="OPEN",e.DRAFT="DRAFT",e.CLOSED="CLOSED",e.MERGED="MERGED",e.DELETED="DELETED"}(si||(si={})),function(e){e.PUSH="PUSH",e.UPDATE="UPDATE",e.UNDRAFT="UNDRAFT",e.PUBLISH="PUBLISH",e.PUBLISH_DRAFT="PUBLISH_DRAFT",e.SYNC="SYNC",e.IMPORT="IMPORT",e.CLOSE="CLOSE",e.REOPEN="REOPEN",e.SLEEP="SLEEP",e.DETACH="DETACH",e.ARCHIVE="ARCHIVE"}(ci||(ci={})),function(e){e.EXISTING="EXISTING",e.BRANCH="BRANCH"}(li||(li={})),function(e){e.QUEUED="QUEUED",e.PROCESSING="PROCESSING",e.ERRORED="ERRORED",e.FAILED="FAILED",e.COMPLETED="COMPLETED"}(ui||(ui={})),function(e){e.REPO_NAME_ASC="REPO_NAME_ASC",e.REPO_NAME_DESC="REPO_NAME_DESC"}(fi||(fi={})),function(e){e.SKIPPED="SKIPPED",e.PENDING="PENDING",e.QUEUED="QUEUED",e.PROCESSING="PROCESSING",e.FAILED="FAILED",e.COMPLETED="COMPLETED",e.CANCELING="CANCELING",e.CANCELED="CANCELED"}(pi||(pi={})),function(e){e.OPEN="OPEN",e.CLOSED="CLOSED",e.DRAFT="DRAFT"}(di||(di={})),function(e){e.COMMENT="COMMENT",e.DETACH="DETACH",e.REENQUEUE="REENQUEUE",e.MERGE="MERGE",e.CLOSE="CLOSE",e.PUBLISH="PUBLISH"}(hi||(hi={})),function(e){e.PROCESSING="PROCESSING",e.COMPLETED="COMPLETED",e.FAILED="FAILED"}(mi||(mi={})),function(e){e.PENDING="PENDING",e.PROCESSING="PROCESSING",e.FAILED="FAILED",e.COMPLETED="COMPLETED",e.QUEUED="QUEUED",e.CANCELING="CANCELING",e.CANCELED="CANCELED"}(gi||(gi={})),function(e){e.NORMAL="NORMAL",e.CRITICAL="CRITICAL"}(vi||(vi={})),function(e){e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.ERROR="ERROR"}(bi||(bi={})),function(e){e.PROCESSING="PROCESSING",e.ERRORED="ERRORED",e.COMPLETED="COMPLETED",e.QUEUED="QUEUED",e.UPLOADING="UPLOADING",e.DELETING="DELETING"}(yi||(yi={})),function(e){e.PROCESSING="PROCESSING",e.ERRORED="ERRORED",e.COMPLETED="COMPLETED",e.QUEUED="QUEUED"}(wi||(wi={})),function(e){e.LANGUAGE_SUPPORTED="LANGUAGE_SUPPORTED",e.PROJECT_STRUCTURE_SUPPORTED="PROJECT_STRUCTURE_SUPPORTED",e.INDEX_JOB_INFERED="INDEX_JOB_INFERED"}(Ei||(Ei={})),function(e){e.UNKNOWN="UNKNOWN",e.NATIVE="NATIVE",e.THIRD_PARTY="THIRD_PARTY"}(_i||(_i={})),function(e){e.UNSUPPORTED="UNSUPPORTED",e.BASIC="BASIC"}(xi||(xi={})),function(e){e.HOUR="HOUR",e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR"}(Si||(Si={})),function(e){e.NOTEBOOK_UPDATED_AT="NOTEBOOK_UPDATED_AT",e.NOTEBOOK_CREATED_AT="NOTEBOOK_CREATED_AT",e.NOTEBOOK_STAR_COUNT="NOTEBOOK_STAR_COUNT"}(Oi||(Oi={})),function(e){e.MARKDOWN="MARKDOWN",e.QUERY="QUERY",e.FILE="FILE",e.SYMBOL="SYMBOL",e.COMPUTE="COMPUTE"}(Ti||(Ti={})),function(e){e.WEB="WEB",e.CODEHOSTINTEGRATION="CODEHOSTINTEGRATION",e.BACKEND="BACKEND",e.STATICWEB="STATICWEB",e.IDEEXTENSION="IDEEXTENSION"}(Ci||(Ci={})),function(e){e.V1="V1",e.V2="V2"}(ki||(ki={})),function(e){e.literal="literal",e.regexp="regexp",e.structural="structural"}(Ni||(Ni={})),function(e){e.AWSCODECOMMIT="AWSCODECOMMIT",e.BITBUCKETCLOUD="BITBUCKETCLOUD",e.BITBUCKETSERVER="BITBUCKETSERVER",e.GITHUB="GITHUB",e.GITLAB="GITLAB",e.GITOLITE="GITOLITE",e.GOMODULES="GOMODULES",e.JVMPACKAGES="JVMPACKAGES",e.NPMPACKAGES="NPMPACKAGES",e.OTHER="OTHER",e.PAGURE="PAGURE",e.PERFORCE="PERFORCE",e.PHABRICATOR="PHABRICATOR"}(Ai||(Ai={})),function(e){e.ADDED="ADDED",e.UNCHANGED="UNCHANGED",e.DELETED="DELETED"}(Ii||(Ii={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING",e.INFORMATION="INFORMATION",e.HINT="HINT"}(Pi||(Pi={})),function(e){e.UNKNOWN="UNKNOWN",e.FILE="FILE",e.MODULE="MODULE",e.NAMESPACE="NAMESPACE",e.PACKAGE="PACKAGE",e.CLASS="CLASS",e.METHOD="METHOD",e.PROPERTY="PROPERTY",e.FIELD="FIELD",e.CONSTRUCTOR="CONSTRUCTOR",e.ENUM="ENUM",e.INTERFACE="INTERFACE",e.FUNCTION="FUNCTION",e.VARIABLE="VARIABLE",e.CONSTANT="CONSTANT",e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.ARRAY="ARRAY",e.OBJECT="OBJECT",e.KEY="KEY",e.NULL="NULL",e.ENUMMEMBER="ENUMMEMBER",e.STRUCT="STRUCT",e.EVENT="EVENT",e.OPERATOR="OPERATOR",e.TYPEPARAMETER="TYPEPARAMETER"}(Ri||(Ri={})),function(e){e.GIT_BRANCH="GIT_BRANCH",e.GIT_TAG="GIT_TAG",e.GIT_REF_OTHER="GIT_REF_OTHER"}(Di||(Di={})),function(e){e.AUTHORED_OR_COMMITTED_AT="AUTHORED_OR_COMMITTED_AT"}(Li||(Li={})),function(e){e.GIT_COMMIT="GIT_COMMIT",e.GIT_TAG="GIT_TAG",e.GIT_TREE="GIT_TREE",e.GIT_BLOB="GIT_BLOB",e.GIT_UNKNOWN="GIT_UNKNOWN"}(Mi||(Mi={})),function(e){e.ACCEPT="ACCEPT",e.REJECT="REJECT"}(ji||(ji={})),function(e){e.REPOSITORY_NAME="REPOSITORY_NAME",e.REPO_CREATED_AT="REPO_CREATED_AT",e.REPOSITORY_CREATED_AT="REPOSITORY_CREATED_AT"}(Fi||(Fi={})),function(e){e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR"}(Bi||(Bi={})),function(e){e.PAGEVIEW="PAGEVIEW",e.SEARCHQUERY="SEARCHQUERY",e.CODEINTEL="CODEINTEL",e.CODEINTELREFS="CODEINTELREFS",e.CODEINTELINTEGRATION="CODEINTELINTEGRATION",e.CODEINTELINTEGRATIONREFS="CODEINTELINTEGRATIONREFS",e.STAGEMANAGE="STAGEMANAGE",e.STAGEPLAN="STAGEPLAN",e.STAGECODE="STAGECODE",e.STAGEREVIEW="STAGEREVIEW",e.STAGEVERIFY="STAGEVERIFY",e.STAGEPACKAGE="STAGEPACKAGE",e.STAGEDEPLOY="STAGEDEPLOY",e.STAGECONFIGURE="STAGECONFIGURE",e.STAGEMONITOR="STAGEMONITOR",e.STAGESECURE="STAGESECURE",e.STAGEAUTOMATE="STAGEAUTOMATE"}(Ui||(Ui={})),function(e){e.TODAY="TODAY",e.THIS_WEEK="THIS_WEEK",e.THIS_MONTH="THIS_MONTH",e.ALL_TIME="ALL_TIME"}(qi||(qi={})),function(e){e.SEARCH_CONTEXT_SPEC="SEARCH_CONTEXT_SPEC",e.SEARCH_CONTEXT_UPDATED_AT="SEARCH_CONTEXT_UPDATED_AT"}(Vi||(Vi={})),function(e){e[e.Literal=1]="Literal",e[e.Regexp=2]="Regexp",e[e.Structural=3]="Structural"}($i||($i={})),function(e){e.Or="or",e.And="and",e.Not="not"}(zi||(zi={}));const Hi=(e,t,n=!1)=>({type:"literal",value:e,range:t,quoted:n}),Gi=(...e)=>(t,n)=>{const r=[];for(const o of e){const e=o(t,n);if("success"===e.type)return e;r.push(e.expected)}return{type:"error",expected:`One of: ${r.join(", ")}`,at:n}},Qi=e=>(t,n)=>{if(t[n]!==e)return{type:"error",expected:e,at:n};let r=n+1;for(;t[r]&&(t[r]!==e||"\\"===t[r-1]);)r+=1;return t[r]?{type:"success",term:Hi(t.slice(n+1,r),{start:n,end:r+1},!0)}:{type:"error",expected:e,at:r}},Wi=(e,t,n)=>(e.source.startsWith("^")||(e=new RegExp(`^${e.source}`,e.flags)),(r,o)=>{const i=r.slice(Math.max(0,o));if(!i)return{type:"error",expected:n||`/${e.source}/`,at:o};const a=i.match(e);if(!a)return{type:"error",expected:n||`/${e.source}/`,at:o};const s={start:o,end:o+a[0].length};return{type:"success",term:t?"function"==typeof t?t(a[0],s):t:{type:"literal",value:a[0],range:s}}}),Ki=(e,t)=>{let n=t,r=0,o="";const i=[],a=()=>{o=e[n],n+=1};if(!aa(e,t))return{type:"error",expected:"no recognized filter or keyword",at:t};for(;void 0!==e[n];){if(a(),o.match(/\s/)&&0===r){n-=1;break}if("("===o){if(!aa(e,n))return{type:"error",expected:"no recognized filter or keyword",at:n};r+=1,i.push(o)}else if(")"===o){if(r-=1,r<0&&n>1){n-=1,r=0;break}i.push(o)}else if(" "===o){if(!aa(e,n))return{type:"error",expected:"no recognized filter or keyword",at:n};i.push(o)}else if("\\"===o){if(void 0!==e[n]){a(),i.push("\\",o);continue}i.push(o)}else i.push(o)}return 0!==r?{type:"error",expected:"no unbalanced parentheses",at:n}:{type:"success",term:Hi(i.join(""),{start:t,end:n})}},Zi=Wi(/\s+/,((e,t)=>({type:"whitespace",range:t}))),Yi=Wi(/[^\s)]+/),Ji=Wi(/(not|NOT)/,((e,{start:t,end:n})=>({type:"keyword",value:e,range:{start:t,end:n},kind:zi.Not}))),Xi=Wi(/(and|AND)/,((e,{start:t,end:n})=>({type:"keyword",value:e,range:{start:t,end:n},kind:zi.And}))),ea=Wi(/(or|OR)/,((e,{start:t,end:n})=>({type:"keyword",value:e,range:{start:t,end:n},kind:zi.Or}))),ta=Gi(Xi,ea,Ji),na=(Wi(/\/\/.*/,((e,{start:t,end:n})=>({type:"comment",value:e,range:{start:t,end:n}}))),Wi(new RegExp(`-?(${Yo.join("|")})+(?=:)`,"i"))),ra=(Gi(Qi('"'),Qi("'"),Ki,Yi),Wi(/\(/,((e,t)=>({type:"openingParen",range:t}))),Wi(/\)/,((e,t)=>({type:"closingParen",range:t})))),oa=(e,t)=>(n,r)=>{const o=e(n,r);if("error"===o.type)return o;let i;const a=[];if(Array.isArray(o.term))for(const e of o.term)a.push(e),i=e.range.end;else a.push(o.term),i=o.term.range.end;if(i&&void 0!==n[i]){const e=t(n,i);if("error"===e.type)return e;a.push(e.term),i=e.term.range.end}return{type:"success",term:a}},ia=Gi(na,oa(ta,Zi)),aa=(e,t)=>"success"!==ia(e,t).type;Gi(Zi,ra);let sa;!function(e){e.Global="Global",e.Subexpression="Subexpression"}(sa||(sa={}));const ca=e=>{const t=e.split(",");if(1===t.length)return{line:parseInt(e,10),character:0};if(2===t.length)return{line:parseInt(t[0],10),character:parseInt(t[1],10)};throw new Error("unexpected position: "+e)};function la(e){const t=new URL(e),n=t.hostname+decodeURIComponent(t.pathname),r=decodeURIComponent(t.search.slice("?".length))||void 0;let o;null!=r&&r.match(/[\dA-f]{40}/)&&(o=r);const i=t.hash.slice("#".length).split(":").map(decodeURIComponent);let a,s,c;if(1===i.length&&(a=i[0]),2===i.length){a=i[0];const e=i[1],t=e.split("-");if(1===t.length&&(s=ca(t[0])),2===t.length&&(c={start:ca(t[0]),end:ca(t[1])}),t.length>2)throw new Error("unexpected range or position: "+e)}if(i.length>2)throw new Error("unexpected fragment: "+t.hash);return{repoName:n,revision:r,commitID:o,filePath:a||void 0,position:s,range:c}}function ua(e){if(e.startsWith("#")&&(e=e.slice("#".length)),!function(e){return e.startsWith("#")&&(e=e.slice("#".length)),""!==e&&!e.includes("=")&&(e.includes("$info")||e.includes("$def")||e.includes("$references")||e.includes("$impl")||e.includes("$history"))}(e)){const t=new URLSearchParams(e),n=pa(t)||{};return t.get("tab")&&(n.viewState=t.get("tab")),n}if(!/^(L\d+(:\d+)?(-\d+(:\d+)?)?)?(\$.*)?$/.test(e))return{};const t=e.split("$",2),n=fa(t[0]);return t[1]&&(n.viewState=t[1]),n}function fa(e){if(!/^(L\d+(:\d+)?(-L?\d+(:\d+)?)?)?$/.test(e))return{};let t,n,r,o;if(e.startsWith("L")){const i=e.slice(1),[a,s]=i.split("-",2);if(a){const e=da(a);t=e.line,n=e.character}if(s){const e=da(s);r=e.line,o=e.character}}let i={line:t,character:n,endLine:r,endCharacter:o};return i=void 0===t||void 0!==r&&typeof n!=typeof o?{}:void 0===n?void 0===r?{line:t}:{line:t,endLine:r}:void 0===r||void 0===o?{line:t,character:n}:{line:t,character:n,endLine:r,endCharacter:o},i}function pa(e){const t=Jn(e);return t?fa(t):void 0}function da(e){e.startsWith("L")&&(e=e.slice(1));const t=e.split(":",2);let n,r;return t.length>=1&&(n=parseInt(t[0],10)),2===t.length&&(r=parseInt(t[1],10)),n="number"==typeof n&&isNaN(n)?void 0:n,r="number"==typeof r&&isNaN(r)?void 0:r,void 0===n?{line:void 0,character:void 0}:{line:n,character:r}}function ha({repoName:e,revision:t}){return t?`${Xn(e)}@${function(e){return Xn(e)}(t)}`:e}function ma(e){const t=nr(function(e,t){return"code"===t.renderMode&&e.set("view","code"),e}(new URLSearchParams,e),function(e){if(e.range)return"L"+(e.range.start.line===e.range.end.line&&e.range.start.character===e.range.end.character?Zn(e.range.start):`${Zn(e.range.start)}-${Zn(e.range.end)}`);if(e.position)return"L"+Zn(e.position)}(e)),n=[...t].length>0?`?${tr(t)}`:"";return`/${ha({repoName:e.repoName,revision:e.revision})}/-/blob/${e.filePath}${n}${r=e.viewState,r?`#tab=${r}`:""}`;var r}function ga(e,t){return`${e.replace(/\/$/,"")}${ma(t)}`}const va=e=>e.line.toString()+(e.character?`,${e.character}`:"");function ba(e){const t=e.commitID||e.revision;let n=`git://${Xn(e.repoName)}`;return n+=t?"?"+Xn(t):"",n+=e.filePath?"#"+Xn(e.filePath):"",n+=e.position||e.range?":":"",n+=e.position?va(e.position):"",n+=e.range?va(e.range.start)+"-"+va(e.range.end):"",n}function ya({repoName:e,filePath:t,commitID:n}){return`git://${Xn(e)}?${n}#${Xn(t)}`}function wa(e,t){const n=e.find((e=>{const n=la(e.uri);return n.repoName===t.repoName&&n.revision===t.revision}));return void 0!==(null==n?void 0:n.inputRevision)?{...t,commitID:void 0,revision:n.inputRevision}:t}const Ea="loading";function _a({extensionsController:e,platformContext:t},n){return function({getDefinition:e,hasReferenceProvidersForDocument:t,getWorkspaceRoots:n,platformContext:{urlToFile:r,requestGraphQL:o}},i){const a={textDocument:{uri:ba(i)},position:{line:i.line-1,character:i.character-1},part:i.part},s=e(a).pipe(Sa({urlToFile:r,requestGraphQL:o},{getWorkspaceRoots:n},a),st((e=>[{isLoading:!1,result:ln(e)}])),Wt());return Oe([s.pipe(_n(qn,null)),t(a),kt([!1],z(!0).pipe(It(qn),on(s.pipe(qe((({result:e})=>null!==e))))),s.pipe(qe((({result:e})=>null!==e)),ut(!0)))]).pipe(H((([e,t,n])=>{const o=e!==Ea&&!cn(e)&&null!=e&&e.url?e.url:"",s=r({...i,position:i},{part:i.part});return{"goToDefinition.showLoading":e===Ea,"goToDefinition.url":e!==Ea&&!cn(e)&&(null==e?void 0:e.url)||null,"goToDefinition.notFound":e!==Ea&&!cn(e)&&null===e,"goToDefinition.error":cn(e)&&e.stack,"findReferences.url":t&&n?r({...i,position:i,viewState:"references"},{part:i.part}):null,"panel.url":r({...i,position:i,viewState:"panelID"},{part:i.part}),hoverPosition:a,hoveredOnDefinition:s===o}})),Qe(((e,t)=>Ot()(e,t))))}({platformContext:t,getDefinition:t=>ee(e.extHostAPI).pipe(ze((e=>Xr(e.getDefinition(t))))),hasReferenceProvidersForDocument:t=>ee(e.extHostAPI).pipe(ze((e=>Xr(e.hasReferenceProvidersForDocument(t))))),getWorkspaceRoots:()=>ee(e.extHostAPI).pipe(ze((e=>Xr(e.getWorkspaceRoots()))))},n).pipe(ze((t=>xa(t,e.extHostAPI))))}const xa=(e,t)=>ee(t).pipe(ze((t=>Xr(t.getContributions({extraContext:e})))),rn(),H((e=>Vo(e,Ao.Hover))));const Sa=({urlToFile:e,requestGraphQL:t},{getWorkspaceRoots:n},r)=>o=>Oe([o,n()]).pipe(ze((([{isLoading:n,result:o},i])=>{if(0===o.length)return z({isLoading:n,result:null});if((o=No()(o,Ot())).length>1){const t=wa(i||[],la(r.textDocument.uri));return z({isLoading:n,result:{url:e({...t,revision:t.revision||"",filePath:t.filePath||"",position:{line:r.position.line+1,character:r.position.character+1},viewState:"def"},{part:r.part}),multiple:!0}})}const a=o[0],s=wa(i||[],la(a.uri));return a.range&&(s.position={line:a.range.start.line+1,character:a.range.start.character+1}),le([{isLoading:!0}],Fo({...s,requestGraphQL:t}).pipe(H((t=>({url:e({...s,revision:s.revision||"",filePath:s.filePath||"",rawRepoName:t},{part:r.part}),multiple:!1}))),H((e=>({isLoading:n,result:e})))))})),hn(((e,t)=>({...e,...t})),{isLoading:!0,result:null}));const Oa="Card-module__card_1wo7K";function Ta(){return(Ta=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const Ca=t.forwardRef((({children:e,className:n,as:r="div",...o},a)=>{const{isBranded:s}=c();return t.createElement(r,Ta({className:i()(s&&Oa,n),ref:a},o),e)}));var ka=n(50672),Na=n.n(ka),Aa=(n(42497),n(8202),n(14245));function Ia(e){const t=(0,Aa.basename)(e),n=function(e){const t=e.split(".");if(1===t.length)return"";if(2===t.length&&""===t[0])return"";return t[t.length-1].toLowerCase()}(e);return function(e){switch(e.toLowerCase()){case"dockerfile":return"dockerfile";default:return}}(t)||function(e){switch(e.toLowerCase()){case"adb":case"ada":case"ads":return"ada";case"cls":case"apex":case"trigger":return"apex";case"as":return"actionscript";case"apacheconf":return"apache";case"applescript":case"scpt":return"applescript";case"sh":case"bash":case"zsh":return"shell";case"clj":case"cljs":case"cljx":return"clojure";case"css":return"css";case"cmake":case"cmake.in":case"in":return"cmake";case"coffee":case"cake":case"cson":case"cjsx":case"iced":return"coffescript";case"cs":case"csx":return"csharp";case"c":case"cc":case"cpp":case"cxx":case"c++":case"h++":case"hh":case"h":case"hpp":case"pc":case"pcc":return"cpp";case"cu":case"cuh":return"cuda";case"dart":return"dart";case"diff":case"patch":return"diff";case"jinja":return"django";case"bat":case"cmd":return"dos";case"ex":case"exs":return"elixir";case"elm":return"elm";case"erl":return"erlang";case"f":case"for":case"frt":case"fr":case"forth":case"4th":case"fth":return"fortran";case"fs":return"fsharp";case"go":return"go";case"graphql":return"graphql";case"groovy":return"groovy";case"haml":return"haml";case"hbs":case"handlebars":return"handlebars";case"hs":case"hsc":return"haskell";case"htm":case"html":case"xhtml":return"html";case"ini":case"cfg":case"prefs":case"pro":case"properties":return"ini";case"java":return"java";case"js":case"jsx":case"es":case"es6":case"jss":case"jsm":return"javascript";case"json":case"sublime_metrics":case"sublime_session":case"sublime-keymap":case"sublime-mousemap":case"sublime-project":case"sublime-settings":case"sublime-workspace":return"json";case"jsonnet":case"libsonnet":return"jsonnet";case"jl":return"julia";case"kt":case"ktm":case"kts":return"kotlin";case"less":return"less";case"lisp":case"asd":case"cl":case"lsp":case"l":case"ny":case"podsl":case"sexp":case"el":return"lisp";case"lua":case"fcgi":case"nse":case"pd_lua":case"rbxs":case"wlua":return"lua";case"mk":case"mak":return"makefile";case"md":case"mkdown":case"mkd":return"markdown";case"nginxconf":return"nginx";case"m":case"mm":return"objectivec";case"ml":case"eliom":case"eliomi":case"ml4":case"mli":case"mll":case"mly":case"re":return"ocaml";case"p":case"pas":case"pp":return"pascal";case"pl":case"al":case"cgi":case"perl":case"ph":case"plx":case"pm":case"pod":case"psgi":case"t":return"perl";case"php":case"phtml":case"php3":case"php4":case"php5":case"php6":case"php7":case"phps":return"php";case"ps1":case"psd1":case"psm1":return"powershell";case"proto":return"protobuf";case"py":case"pyc":case"pyd":case"pyo":case"pyw":case"pyz":return"python";case"r":case"rd":case"rsx":return"r";case"repro":return"repro";case"rb":case"builder":case"eye":case"gemspec":case"god":case"jbuilder":case"mspec":case"pluginspec":case"podspec":case"rabl":case"rake":case"rbuild":case"rbw":case"rbx":case"ru":case"ruby":case"spec":case"thor":case"watchr":return"ruby";case"rs":case"rs.in":return"rust";case"sass":case"scss":return"scss";case"sbt":case"sc":case"scala":return"scala";case"strato":return"strato";case"scm":case"sch":case"sls":case"sps":case"ss":return"scheme";case"st":return"smalltalk";case"sql":return"sql";case"styl":return"stylus";case"swift":return"swift";case"thrift":return"thrift";case"ts":case"tsx":return"typescript";case"twig":return"twig";case"vb":return"vbnet";case"vbs":return"vbscrip";case"v":case"veo":case"sv":case"svh":case"svi":return"verilog";case"vhd":case"vhdl":return"vhdl";case"vim":return"vim";case"xml":case"adml":case"admx":case"ant":case"axml":case"builds":case"ccxml":case"clixml":case"cproject":case"csl":case"csproj":case"ct":case"dita":case"ditamap":case"ditaval":case"dll.config":case"dotsettings":case"filters":case"fsproj":case"fxml":case"glade":case"gml":case"grxml":case"iml":case"ivy":case"jelly":case"jsproj":case"kml":case"launch":case"mdpolicy":case"mjml":case"mod":case"mxml":case"nproj":case"nuspec":case"odd":case"osm":case"pkgproj":case"plist":case"props":case"ps1xml":case"psc1":case"pt":case"rdf":case"resx":case"rss":case"scxml":case"sfproj":case"srdf":case"storyboard":case"stTheme":case"sublime-snippet":case"targets":case"tmCommand":case"tml":case"tmLanguage":case"tmPreferences":case"tmSnippet":case"tmTheme":case"ui":case"urdf":case"ux":case"vbproj":case"vcxproj":case"vsixmanifest":case"vssettings":case"vstemplate":case"vxml":case"wixproj":case"wsdl":case"wsf":case"wxi":case"wxl":case"wxs":case"x3d":case"xacro":case"xaml":case"xib":case"xlf":case"xliff":case"xmi":case"xml.dist":case"xproj":case"xsd":case"xspec":case"xul":case"zcml":return"xml";case"yml":case"yaml":return"yaml";default:return}}(n)||"plaintext"}n(31781);var Pa=n(9588),Ra=n.n(Pa),Da=n(28838);function La(e,t){const n=t?e.light:e.dark,{range:r,isWholeLine:o,after:i,light:a,dark:s,...c}=e;return{...c,...n}}function Ma(e,t){const n=t?e.light:e.dark,{contentText:r,hoverMessage:o,linkURL:i,light:a,dark:s,...c}=e;return{...c,...n}}Ra()("TextDocumentDecorationType");const ja=e=>({[Rr]:!0,subscribe:t=>Gr(e.subscribe({next:e=>{t.next(e)},error:e=>{t.error(e&&{message:e.message,name:e.name,stack:e.stack})},complete:()=>{t.complete()}}))});n(87831);n(12452);var Fa=n(38523),Ba=n.n(Fa);const Ua=new Set(["blue","yellow","orange","pink","red","purple","green","grey"]);const qa=["contributes","activationEvents","url"];const Va=new Set(["sourcegraph/code-stats-insights","sourcegraph/search-insights"]);function $a(e,t){if(!cn(e.subjects)&&e.subjects){const r=e.subjects.find((e=>e.subject.__typename===t));var n;if(r&&!cn(r.settings))return null===(n=r.settings)||void 0===n?void 0:n.extensions}}new Set(["sourcegraph/code-stats-insights","sourcegraph/search-insights"]);new Map;Error;const za=1,Ha=2,Ga=3,Qa=4,Wa=5;var Ka=n(19373),Za=n.n(Ka);function Ya(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ja={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const Xa=/[&<>"']/,es=/[&<>"']/g,ts=/[<>"']|&(?!#?\w+;)/,ns=/[<>"']|&(?!#?\w+;)/g,rs={"&":"&","<":"<",">":">",'"':""","'":"'"},os=e=>rs[e];function is(e,t){if(t){if(Xa.test(e))return e.replace(es,os)}else if(ts.test(e))return e.replace(ns,os);return e}const as=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function ss(e){return e.replace(as,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const cs=/(^|[^\[])\^/g;function ls(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(cs,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const us=/[^\w:]/g,fs=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ps(e,t,n){if(e){let e;try{e=decodeURIComponent(ss(n)).replace(us,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!fs.test(n)&&(n=function(e,t){ds[" "+e]||(hs.test(e)?ds[" "+e]=e+"/":ds[" "+e]=ws(e,"/",!0));const n=-1===(e=ds[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(ms,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(gs,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const ds={},hs=/^[^:]+:\/*[^/]*$/,ms=/^([^:]+:)[\s\S]*$/,gs=/^([^:]+:\/*[^/]*)[\s\S]*$/;const vs={exec:function(){}};function bs(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function ys(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n[n.length-1].trim()||n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function ws(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.substr(0,r-o)}function Es(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function _s(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function xs(e,t,n,r){const o=t.href,i=t.title?is(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:is(a)}}class Ss{constructor(e){this.options=e||Ja}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ws(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ws(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,a,s,c,l,u,f,p=t[1].trim();const d=p.length>1,h={type:"list",raw:"",ordered:d,start:d?+p.slice(0,-1):"",loose:!1,items:[]};p=d?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=d?p:"[*+-]");const m=new RegExp(`^( {0,3}${p})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;e&&!this.rules.block.hr.test(e)&&(t=m.exec(e));){u=t[2].split("\n"),this.options.pedantic?(i=2,f=u[0].trimLeft()):(i=t[2].search(/[^ ]/),i=t[1].length+(i>4?1:i),f=u[0].slice(i-t[1].length)),s=!1,n=t[0],!u[0]&&/^ *$/.test(u[1])&&(n=t[1]+u.slice(0,2).join("\n")+"\n",h.loose=!0,u=[]);const p=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(a=1;a<u.length;a++){if(l=u[a],this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),p.test(l)){n=t[1]+u.slice(0,a).join("\n")+"\n";break}if(s){if(!(l.search(/[^ ]/)>=i)&&l.trim()){n=t[1]+u.slice(0,a).join("\n")+"\n";break}f+="\n"+l.slice(i)}else l.trim()||(s=!0),l.search(/[^ ]/)>=i?f+="\n"+l.slice(i):f+="\n"+l}h.loose||(c?h.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(f),r&&(o="[ ] "!==r[0],f=f.replace(/^\[[ xX]\] +/,""))),h.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:f}),h.raw+=n,e=e.slice(n.length)}h.items[h.items.length-1].raw=n.trimRight(),h.items[h.items.length-1].text=f.trimRight(),h.raw=h.raw.trimRight();const g=h.items.length;for(a=0;a<g;a++)this.lexer.state.top=!1,h.items[a].tokens=this.lexer.blockTokens(h.items[a].text,[]),h.items[a].tokens.some((e=>"space"===e.type))&&(h.loose=!0,h.items[a].loose=!0);return h}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):is(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:ys(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,a=e.align.length;for(n=0;n<a;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(a=e.rows.length,n=0;n<a;n++)e.rows[n]=ys(e.rows[n],e.header.length).map((e=>({text:e})));for(a=e.header.length,r=0;r<a;r++)e.header[r].tokens=[],this.lexer.inlineTokens(e.header[r].text,e.header[r].tokens);for(a=e.rows.length,r=0;r<a;r++)for(i=e.rows[r],o=0;o<i.length;o++)i[o].tokens=[],this.lexer.inlineTokens(i[o].text,i[o].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:is(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):is(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=ws(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),xs(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return xs(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,a=n,s=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){s+=i;continue}if(a-=i,a>0)continue;if(i=Math.min(i,i+a+s),Math.min(n,i)%2){const t=e.slice(1,n+r.index+i);return{type:"em",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+i-1);return{type:"strong",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=is(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=is(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=is(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=is(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=is(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):is(n[0]):n[0]:is(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Os={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:vs,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Os.def=ls(Os.def).replace("label",Os._label).replace("title",Os._title).getRegex(),Os.bullet=/(?:[*+-]|\d{1,9}[.)])/,Os.listItemStart=ls(/^( *)(bull) */).replace("bull",Os.bullet).getRegex(),Os.list=ls(Os.list).replace(/bull/g,Os.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Os.def.source+")").getRegex(),Os._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Os._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Os.html=ls(Os.html,"i").replace("comment",Os._comment).replace("tag",Os._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Os.paragraph=ls(Os._paragraph).replace("hr",Os.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Os._tag).getRegex(),Os.blockquote=ls(Os.blockquote).replace("paragraph",Os.paragraph).getRegex(),Os.normal=bs({},Os),Os.gfm=bs({},Os.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Os.gfm.table=ls(Os.gfm.table).replace("hr",Os.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Os._tag).getRegex(),Os.pedantic=bs({},Os.normal,{html:ls("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Os._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vs,paragraph:ls(Os.normal._paragraph).replace("hr",Os.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Os.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const Ts={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:vs,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:vs,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function Cs(e){return e.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026")}function ks(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}Ts._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Ts.punctuation=ls(Ts.punctuation).replace(/punctuation/g,Ts._punctuation).getRegex(),Ts.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ts.escapedEmSt=/\\\*|\\_/g,Ts._comment=ls(Os._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ts.emStrong.lDelim=ls(Ts.emStrong.lDelim).replace(/punct/g,Ts._punctuation).getRegex(),Ts.emStrong.rDelimAst=ls(Ts.emStrong.rDelimAst,"g").replace(/punct/g,Ts._punctuation).getRegex(),Ts.emStrong.rDelimUnd=ls(Ts.emStrong.rDelimUnd,"g").replace(/punct/g,Ts._punctuation).getRegex(),Ts._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ts._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ts._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ts.autolink=ls(Ts.autolink).replace("scheme",Ts._scheme).replace("email",Ts._email).getRegex(),Ts._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ts.tag=ls(Ts.tag).replace("comment",Ts._comment).replace("attribute",Ts._attribute).getRegex(),Ts._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ts._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ts._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ts.link=ls(Ts.link).replace("label",Ts._label).replace("href",Ts._href).replace("title",Ts._title).getRegex(),Ts.reflink=ls(Ts.reflink).replace("label",Ts._label).getRegex(),Ts.reflinkSearch=ls(Ts.reflinkSearch,"g").replace("reflink",Ts.reflink).replace("nolink",Ts.nolink).getRegex(),Ts.normal=bs({},Ts),Ts.pedantic=bs({},Ts.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ls(/^!?\[(label)\]\((.*?)\)/).replace("label",Ts._label).getRegex(),reflink:ls(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ts._label).getRegex()}),Ts.gfm=bs({},Ts.normal,{escape:ls(Ts.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Ts.gfm.url=ls(Ts.gfm.url,"i").replace("email",Ts.gfm._extended_email).getRegex(),Ts.breaks=bs({},Ts.gfm,{br:ls(Ts.br).replace("{2,}","*").getRegex(),text:ls(Ts.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class Ns{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ja,this.options.tokenizer=this.options.tokenizer||new Ss,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Os.normal,inline:Ts.normal};this.options.pedantic?(t.block=Os.pedantic,t.inline=Ts.pedantic):this.options.gfm&&(t.block=Os.gfm,this.options.breaks?t.inline=Ts.breaks:t.inline=Ts.gfm),this.tokenizer.rules=t}static get rules(){return{block:Os,inline:Ts}}static lex(e,t){return new Ns(t).lex(e)}static lexInline(e,t){return new Ns(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),n.type&&t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,o,i,a,s,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+_s("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+_s("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(s=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,s))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,ks))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,ks))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,Cs))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(s=n.raw.slice(-1)),a=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class As{constructor(e){this.options=e||Ja}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+is(r,!0)+'">'+(n?e:is(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:is(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=ps(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+is(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=ps(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class Is{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Ps{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class Rs{constructor(e){this.options=e||Ja,this.options.renderer=this.options.renderer||new As,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Is,this.slugger=new Ps}static parse(e,t){return new Rs(t).parse(e)}static parseInline(e,t){return new Rs(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,a,s,c,l,u,f,p,d,h,m,g,v,b,y,w,E="";const _=e.length;for(n=0;n<_;n++)if(f=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]&&(w=this.options.extensions.renderers[f.type].call({parser:this},f),!1!==w||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(f.type)))E+=w||"";else switch(f.type){case"space":continue;case"hr":E+=this.renderer.hr();continue;case"heading":E+=this.renderer.heading(this.parseInline(f.tokens),f.depth,ss(this.parseInline(f.tokens,this.textRenderer)),this.slugger);continue;case"code":E+=this.renderer.code(f.text,f.lang,f.escaped);continue;case"table":for(l="",c="",i=f.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(f.header[r].tokens),{header:!0,align:f.align[r]});for(l+=this.renderer.tablerow(c),u="",i=f.rows.length,r=0;r<i;r++){for(s=f.rows[r],c="",a=s.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(s[o].tokens),{header:!1,align:f.align[o]});u+=this.renderer.tablerow(c)}E+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(f.tokens),E+=this.renderer.blockquote(u);continue;case"list":for(p=f.ordered,d=f.start,h=f.loose,i=f.items.length,u="",r=0;r<i;r++)g=f.items[r],v=g.checked,b=g.task,m="",g.task&&(y=this.renderer.checkbox(v),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=y+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,b,v);E+=this.renderer.list(u,p,d);continue;case"html":E+=this.renderer.html(f.text);continue;case"paragraph":E+=this.renderer.paragraph(this.parseInline(f.tokens));continue;case"text":for(u=f.tokens?this.parseInline(f.tokens):f.text;n+1<_&&"text"===e[n+1].type;)f=e[++n],u+="\n"+(f.tokens?this.parseInline(f.tokens):f.text);E+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+f.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return E}parseInline(e,t){t=t||this.renderer;let n,r,o,i="";const a=e.length;for(n=0;n<a;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=o||"";else switch(r.type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}function Ds(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),Es(t=bs({},Ds.defaults,t||{})),n){const r=t.highlight;let o;try{o=Ns.lex(e,t)}catch(e){return n(e)}const i=function(e){let i;if(!e)try{t.walkTokens&&Ds.walkTokens(o,t.walkTokens),i=Rs.parse(o,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,i)};if(!r||r.length<3)return i();if(delete t.highlight,!o.length)return i();let a=0;return Ds.walkTokens(o,(function(e){"code"===e.type&&(a++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),a--,0===a&&i()}))}),0))})),void(0===a&&i())}try{const n=Ns.lex(e,t);return t.walkTokens&&Ds.walkTokens(n,t.walkTokens),Rs.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+is(e.message+"",!0)+"</pre>";throw e}}Ds.options=Ds.setOptions=function(e){var t;return bs(Ds.defaults,e),t=Ds.defaults,Ja=t,Ds},Ds.getDefaults=Ya,Ds.defaults=Ja,Ds.use=function(...e){const t=bs({},...e),n=Ds.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach((e=>{if(e.extensions&&(r=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=Ds.defaults.renderer||new As;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let i=e.renderer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.renderer=n}if(e.tokenizer){const n=Ds.defaults.tokenizer||new Ss;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let i=e.tokenizer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.tokenizer=n}if(e.walkTokens){const n=Ds.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),Ds.setOptions(t)}))},Ds.walkTokens=function(e,t){for(const n of e)switch(t.call(Ds,n),n.type){case"table":for(const e of n.header)Ds.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)Ds.walkTokens(n.tokens,t);break;case"list":Ds.walkTokens(n.items,t);break;default:Ds.defaults.extensions&&Ds.defaults.extensions.childTokens&&Ds.defaults.extensions.childTokens[n.type]?Ds.defaults.extensions.childTokens[n.type].forEach((function(e){Ds.walkTokens(n[e],t)})):n.tokens&&Ds.walkTokens(n.tokens,t)}},Ds.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");Es(t=bs({},Ds.defaults,t||{}));try{const n=Ns.lexInline(e,t);return t.walkTokens&&Ds.walkTokens(n,t.walkTokens),Rs.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+is(e.message+"",!0)+"</pre>";throw e}},Ds.Parser=Rs,Ds.parser=Rs.parse,Ds.Renderer=As,Ds.TextRenderer=Is,Ds.Lexer=Ns,Ds.lexer=Ns.lex,Ds.Tokenizer=Ss,Ds.Slugger=Ps,Ds.parse=Ds;Ds.options,Ds.setOptions,Ds.use,Ds.walkTokens,Ds.parseInline,Rs.parse,Ns.lex;var Ls=n(95327),Ms=n.n(Ls);const js=e=>{const t=document.createElement("span");return t.textContent=e,t.innerHTML},Fs=["fill","stroke","stroke-width"],Bs=[/.*/],Us=(e,t={})=>{const n=Ds(e,{gfm:!0,breaks:t.breaks,sanitize:!1,highlight:(e,t)=>((e,t)=>{try{return"plaintext"===t||"text"===t?js(e):"sourcegraph"===t?e:t?(0,zn.highlight)(e,{language:t,ignoreIllegals:!0}).value:(0,zn.highlightAuto)(e).value}catch(t){return console.warn("Error syntax-highlighting hover markdown code block",t),js(e)}})(e,t)});let r;return t.plainText?r={...Ms().defaults,allowedAttributes:{},allowedSchemes:[],allowedSchemesByTag:{},allowedTags:[],selfClosing:[]}:(r={...Ms().defaults,exclusiveFilter:({tag:e,attribs:t})=>"object"===e&&!t.type,allowedTags:[...Za()(Ms().defaults.allowedTags,"iframe"),"img","picture","source","object","svg","rect","defs","pattern","mask","circle","path","title"],allowedAttributes:{...Ms().defaults.allowedAttributes,a:[...Ms().defaults.allowedAttributes.a,"title","data-tooltip","class",{name:"rel",values:["noopener","noreferrer"]}],img:[...Ms().defaults.allowedAttributes.img,"alt","width","height","align","style"],source:["srcset","media"],object:["data",{name:"type",values:["image/svg+xml"]},"width"],svg:["width","height","viewbox","version","preserveaspectratio","style"],rect:["x","y","width","height","transform",...Fs],path:["d",...Fs],circle:["cx","cy",...Fs],pattern:["id","width","height","patternunits","patterntransform"],mask:["id"],span:["class"],code:["class"],h1:["id"],h2:["id"],h3:["id"],h4:["id"],h5:["id"],h6:["id"]},allowedStyles:{img:{padding:Bs,"padding-left":Bs,"padding-right":Bs,"padding-top":Bs,"padding-bottom":Bs},svg:{flex:Bs,"flex-grow":Bs,"flex-shrink":Bs,"flex-basis":Bs}}},t.allowDataUriLinksAndDownloads&&(r.allowedAttributes.a=[...r.allowedAttributes.a,"download"],r.allowedSchemesByTag={...r.allowedSchemesByTag,a:[...r.allowedSchemesByTag.a||r.allowedSchemes,"data"]})),Ms()(n,r)},qs={alert:"Alert-module__alert_2l0FA",btn:"Alert-module__btn_39eQm","alert-primary":"Alert-module__alert-primary_rR3d-",alertPrimary:"Alert-module__alert-primary_rR3d-","alert-secondary":"Alert-module__alert-secondary_7Nezz",alertSecondary:"Alert-module__alert-secondary_7Nezz","alert-success":"Alert-module__alert-success_8LLu6",alertSuccess:"Alert-module__alert-success_8LLu6","alert-danger":"Alert-module__alert-danger_Dz5VZ",alertDanger:"Alert-module__alert-danger_Dz5VZ","alert-warning":"Alert-module__alert-warning_2-06D",alertWarning:"Alert-module__alert-warning_2-06D","alert-info":"Alert-module__alert-info_HKUsm",alertInfo:"Alert-module__alert-info_HKUsm","alert-merged":"Alert-module__alert-merged_3H9Zn",alertMerged:"Alert-module__alert-merged_3H9Zn","alert-note":"Alert-module__alert-note_1lOBN",alertNote:"Alert-module__alert-note_1lOBN","alert-waiting":"Alert-module__alert-waiting_ym1Xw",alertWaiting:"Alert-module__alert-waiting_ym1Xw"};function Vs(){return(Vs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const $s=t.forwardRef((({children:e,as:n="div",variant:r,className:o,...a},s)=>{const{isBranded:l}=c(),u=l&&i()(qs.alert,r&&(({variant:e})=>i()(qs[`alert${wr()(e)}`]))({variant:r}));return t.createElement(n,Vs({ref:s,className:i()(u,o)},a),e)})),zs="HoverOverlay-module__hover-overlay_GnQ4U",Hs="HoverOverlay-module__card_3Y1Qk",Gs="HoverOverlay-module__badge_1yHRL",Qs="HoverOverlay-module__badge-label_14ax7",Ws="HoverOverlay-module__alert_1VfF7",Ks="HoverOverlay-module__hover-overlay__content_1qzcX",Zs="HoverOverlay-module__alert-dismiss_1DJhV",Ys="HoverOverlay-module__actions_3k7B1",Js="HoverOverlay-module__actions-inner_1A944",Xs="HoverOverlay-module__action_3jCN1",ec="HoverOverlay-module__overlay-logo_37n_Z",tc="HoverOverlay-module__loader-row_2ZOSL",nc="HoverOverlay-module__hover-error_VUMQ7",rc="HoverOverlay-module__hover-empty_Nzw5p",oc="HoverOverlayContent-module__hover-overlay__content_2RDwm",ic="HoverOverlayAlerts-module__hover-overlay__alerts_2cAta",ac={info:Ga,warning:Ha,error:za},sc=e=>{const{hoverAlerts:n,onAlertDismissed:o,getAlertClassName:a,getAlertVariant:s}=e;return t.createElement("div",{className:i()(ic,e.className)},n.map((({summary:e,iconKind:n,type:c},l)=>{return t.createElement($s,{key:l,variant:null==s?void 0:s(n?ac[n]:Ga),className:i()(Ws,null==a?void 0:a(n?ac[n]:Ga))},"plaintext"===e.kind?t.createElement("span",{"data-testid":"hover-overlay-content",className:i()(oc,Ks)},e.value):t.createElement("span",{"data-testid":"hover-overlay-content",className:i()(oc,Ks),dangerouslySetInnerHTML:{__html:Us(e.value)}}),c&&t.createElement("div",{className:i()(Zs)},t.createElement(r,{to:"",onClick:(u=c,e=>{e.preventDefault(),o&&o(u)}),role:"button"},t.createElement("small",null,"Dismiss"))));var u})))},cc={badge:"Badge-module__badge_3-NyA",focus:"Badge-module__focus_1GzbE",btn:"Badge-module__btn_3gy8e",pill:"Badge-module__pill_1tDDJ",sm:"Badge-module__sm_2Ucd0",primary:"Badge-module__primary_3Mnyp",secondary:"Badge-module__secondary_1aGWy",success:"Badge-module__success_Xk9YR",danger:"Badge-module__danger_3C1__",info:"Badge-module__info_1nStF",warning:"Badge-module__warning_TvoOc",merged:"Badge-module__merged_nmYys","outline-secondary":"Badge-module__outline-secondary_391TE",outlineSecondary:"Badge-module__outline-secondary_391TE"};function lc(){return(lc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const uc=({children:e,variant:n,small:o,pill:a,tooltip:s,className:l,href:u,as:f="span",...p})=>{const{isBranded:d}=c(),h=d&&i()(cc.badge,n&&cc[n],o&&cc.sm,a&&cc.pill),m={"data-tooltip":s,className:i()(h,l),...p};return u?t.createElement(r,lc({to:u,rel:"noopener",target:"_blank"},m),e):t.createElement(f,m,e)},fc="HoverOverlayContents-module__hover-overlay__contents_2f8kl",pc="HoverOverlayContents-module__hover-overlay__contents--loading_NaOl_",dc="HoverOverlayContents-module__hover-overlay__content_3L2yD";const hc=e=>{const{content:n,aggregatedBadges:r=[],index:o,errorAlertClassName:a,errorAlertVariant:s,badgeClassName:c}=e;if("markdown"!==n.kind)return t.createElement("span",{"data-testid":"hover-overlay-content",className:i()(oc,dc)},t.createElement("p",null,n.value));const l=function(e){try{return Us(e)}catch(e){return ln(e)}}(n.value);return l instanceof Error?t.createElement($s,{className:i()(nc,a),variant:s},wr()(l.message)):t.createElement(t.Fragment,null,0!==o&&t.createElement("hr",null),r.map((({text:e,linkURL:n,hoverMessage:r})=>t.createElement("small",{key:e,className:i()(Gs)},t.createElement(uc,{variant:"secondary",small:!0,className:i()("test-hover-badge",c,Qs),href:n,tooltip:r},e)))),t.createElement("span",{"data-testid":"hover-overlay-content",className:i()(oc,dc,e.contentClassName,"test-tooltip-content"),dangerouslySetInnerHTML:{__html:l}}))},mc=e=>{var n;const{hoverOrError:r,iconClassName:o,errorAlertClassName:a,errorAlertVariant:s,badgeClassName:c,contentClassName:l}=e;return"loading"===r?t.createElement("div",{className:i()(tc)},t.createElement(Pr,{inline:!1,className:o})):cn(r)?t.createElement($s,{className:i()(a,nc),variant:s},wr()(r.message)):void 0===r?null:null===r||0===r.contents.length&&null!==(n=r.alerts)&&void 0!==n&&n.length?t.createElement("small",{className:i()(rc)},"No hover information available."):t.createElement(t.Fragment,null,r.contents.map(((e,n)=>t.createElement(hc,{key:n,index:n,content:e,aggregatedBadges:r.aggregatedBadges,errorAlertClassName:a,errorAlertVariant:s,badgeClassName:c,contentClassName:l}))))};function gc(){return(gc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const vc=e=>t.createElement("svg",gc({viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t.createElement("path",{d:"M30.8 51.8c-2.8.5-5.5-1.3-6-4.1L17.2 6.2c-.5-2.8 1.3-5.5 4.1-6s5.5 1.3 6 4.1l7.6 41.5c.5 2.8-1.4 5.5-4.1 6z",fill:"#FF5543"}),t.createElement("path",{d:"M10.9 44.7C9.1 45 7.3 44.4 6 43c-1.8-2.2-1.6-5.4.6-7.2L38.7 8.5c2.2-1.8 5.4-1.6 7.2.6 1.8 2.2 1.6 5.4-.6 7.2l-32 27.3c-.7.6-1.6 1-2.4 1.1z",fill:"#A112FF"}),t.createElement("path",{d:"M46.8 38.1c-.9.2-1.8.1-2.6-.2L4.4 23.8c-2.7-1-4.1-3.9-3.1-6.6 1-2.7 3.9-4.1 6.6-3.1l39.7 14.1c2.7 1 4.1 3.9 3.1 6.6-.6 1.8-2.2 3-3.9 3.3z",fill:"#00CBEC"})),bc="HoverOverlayLogo-module__container_miAfr",yc="HoverOverlayLogo-module__icon_1L74h",wc=({className:e})=>t.createElement("span",{className:i()(bc,e)},t.createElement(vc,{className:yc})),Ec=({hoveredToken:e,hoverOrError:t,actionsOrError:n})=>!e||(!t||"loading"===t||cn(t))&&(!n||"loading"===n||cn(n));function _c(){return(_c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const xc="loading",Sc=e=>e?{opacity:1,visibility:"visible",left:`${e.left}px`,top:`${e.top}px`}:{opacity:0,visibility:"hidden"},Oc=e=>{const{hoverOrError:n,hoverRef:r,overlayPosition:o,actionsOrError:a,platformContext:s,telemetryService:c,extensionsController:l,location:u,className:f,iconClassName:p,badgeClassName:d,actionItemClassName:h,actionItemPressedClassName:m,contentClassName:g,actionItemStyleProps:v,getAlertClassName:b,getAlertVariant:y,onAlertDismissed:w,useBrandedLogo:E}=e;return function(e){const{telemetryService:n,hoveredToken:r}=e,o=(0,t.useRef)(e),i=()=>n.log("hover");(0,t.useEffect)((()=>i()),[]),Ec(e)||Ot()(r,o.current.hoveredToken)&&!Ec(o.current)||i(),o.current=e}(e),n||a&&!cn(a)?t.createElement(Ca,{"data-testid":"hover-overlay",style:Sc(o),className:i()(Hs,zs,f),ref:r},t.createElement("div",{"data-testid":"hover-overlay-contents",className:i()(fc,n===xc&&pc)},t.createElement(mc,{hoverOrError:n,iconClassName:p,badgeClassName:d,errorAlertClassName:null==b?void 0:b(za),errorAlertVariant:null==y?void 0:y(za),contentClassName:g})),n&&n!==xc&&!cn(n)&&n.alerts&&n.alerts.length>0&&t.createElement(sc,{hoverAlerts:n.alerts,iconClassName:p,getAlertClassName:b,getAlertVariant:y,onAlertDismissed:w}),null!=a&&a!==xc&&!cn(a)&&a.length>0&&t.createElement("div",{className:Ys},t.createElement("div",{className:Js},a.map(((e,n)=>{return t.createElement(yo,_c({key:n},e,{className:i()(Xs,h,`test-tooltip-${r=e.action.title||"untitled",r.replace(/[^A-Za-z]/g,"-").toLowerCase()}`),iconClassName:p,pressedClassName:m,variant:"actionItem",disabledDuringExecution:!0,showLoadingSpinnerDuringExecution:!0,showInlineError:!0,platformContext:s,telemetryService:c,extensionsController:l,location:u,actionItemStyleProps:v}));var r}))),E&&t.createElement(wc,{className:ec}))):null},Tc=(e,t)=>{const n=new URL(e);for(const[e,r]of Object.entries(t))n.searchParams.set(e,r);return n};var Cc,kc;!function(e){e[e.Extension=0]="Extension",e[e.Page=1]="Page"}(Cc||(Cc={})),function(e){e[e.Content=0]="Content",e[e.Background=1]="Background",e[e.Options=2]="Options"}(kc||(kc={}));const Nc=function(){const e="EXTENSION"===window.SG_ENV?Cc.Extension:Cc.Page;let t=kc.Content;return e===Cc.Extension&&(window.location.pathname.includes("options.html")?t=kc.Options:globalThis.browser&&browser.runtime.getBackgroundPage&&(t=kc.Background)),{appEnvironment:e,scriptEnvironment:t}}(),Ac=Nc.scriptEnvironment===kc.Background,Ic=(Nc.scriptEnvironment,kc.Options,Nc.appEnvironment===Cc.Extension),Pc=!Ic,Rc=(Boolean(document.querySelector(".phabricator-wordmark")),e=>t=>{if(Ac)throw new Error("Tried to call background page function from background page itself");if(Pc)throw new Error("Tried to call background page function from in-page integration");return browser.runtime.sendMessage({type:e,payload:t})}),Dc={createBlobURL:Rc("createBlobURL"),openOptionsPage:Rc("openOptionsPage"),requestGraphQL:Rc("requestGraphQL"),notifyRepoSyncError:Rc("notifyRepoSyncError"),checkRepoSyncError:Rc("checkRepoSyncError"),fetchCache:Rc("fetchCache"),getCookie:Rc("getCookie")};function Lc(){return window.navigator.userAgent.includes("Firefox")}const Mc="https://sourcegraph.com";function jc(e){return e?Vc("sync","sourcegraphURL").pipe(H((e=>e||Mc))):z(window.SOURCEGRAPH_URL||window.localStorage.getItem("SOURCEGRAPH_URL")||Mc)}function Fc(){return window.SOURCEGRAPH_PHABRICATOR_EXTENSION?"phabricator-integration":window.SOURCEGRAPH_INTEGRATION?window.SOURCEGRAPH_INTEGRATION:window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")?"safari-extension":Lc()?"firefox-extension":"chrome-extension"}function Bc(){if(globalThis.browser){return browser.runtime.getManifest().version}return"NO_VERSION"}function Uc(e){return(null==e?void 0:e.replace(/\/$/,""))===Mc}const qc=globalThis.browser&&browser.storage,Vc=(e,t)=>{return"chrome-extension"!==Fc()&&"managed"===e?z(void 0):le(ee(qc[e].get(t)).pipe(H((e=>e[t]))),(n=qc.onChanged,new B((e=>{const t=(...t)=>e.next(t);try{n.addListener(t)}catch(t){return void e.error(t)}return()=>n.removeListener(t)}))).pipe(qe((([,t])=>e===t)),H((([e])=>e)),qe((e=>Object.prototype.hasOwnProperty.call(e,t))),H((e=>e[t].newValue))));var n},$c=e=>({textDocument:{uri:ya(e)},position:{character:e.position.character-1,line:e.position.line-1}});var zc=Object.prototype.hasOwnProperty;function Hc(e,t,n){for(n of e.keys())if(Gc(n,t))return n}function Gc(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Gc(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((o=r)&&"object"==typeof o&&!(o=Hc(t,o)))return!1;if(!t.has(o))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((o=r[0])&&"object"==typeof o&&!(o=Hc(t,o)))return!1;if(!Gc(r[1],t.get(o)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(zc.call(e,n)&&++r&&!zc.call(t,n))return!1;if(!(n in t)||!Gc(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function Qc(e){var n=(0,t.useRef)(),r=(0,t.useRef)(0);return Gc(e,n.current)||(n.current=e,r.current+=1),[r.current]}function Wc(e,n){return(0,t.useEffect)(e,Qc(n))}function Kc(e){const[n,r]=(0,t.useState)(),[o,i]=(0,t.useState)();if((0,t.useEffect)((()=>{i(void 0);const t=e.subscribe({next:i,error:r});return()=>t.unsubscribe()}),[e]),n)throw n;return o}const Zc="ActionsNavItems-module__action-item_3JYz6";function Yc(){return(Yc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const Jc=e=>{const{scope:n,extraContext:r,extensionsController:o,menu:a,wrapInList:s,transformContributions:c=Na()}=e,l=(0,t.useMemo)((()=>new Ro(1)),[]);Wc((()=>{l.next(n)}),[n]);const u=(0,t.useMemo)((()=>new Ro(1)),[]);Wc((()=>{u.next(r)}),[r]);const f=Kc((0,t.useMemo)((()=>Oe([l,u,ee(o.extHostAPI)]).pipe(ze((([e,t,n])=>Xr(n.getContributions({scope:e,extraContext:t})))),H(c))),[l,u,o,c])),p=(0,t.useRef)(null);return f?(p.current=Vo(f,a).map((n=>t.createElement(t.Fragment,{key:n.action.id}," ",t.createElement("li",{className:e.listItemClass},t.createElement(yo,Yc({key:n.action.id},n,e,{variant:"actionItem",iconClassName:e.actionItemIconClass,className:i()(Zc,e.actionItemClass),pressedClassName:e.actionItemPressedClass,actionItemStyleProps:e.actionItemStyleProps})))))),s?p.current.length>0?t.createElement("ul",{className:e.listClass},p.current):null:t.createElement(t.Fragment,null,p.current)):t.createElement(t.Fragment,null,p.current)};function Xc(e,t){var n;return void 0===e&&(e=0),void 0===t&&(t=je),(p(n=e)||!(n-parseFloat(n)+1>=0)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=je),new B((function(n){return n.add(t.schedule(el,e,{subscriber:n,counter:0,period:e})),n}))}function el(e){var t=e.subscriber,n=e.counter,r=e.period;t.next(n),this.schedule({subscriber:t,counter:n+1,period:r},r)}const tl=({iconClassName:e,label:n,ariaLabel:o,className:i,href:a,onClick:s,rel:c,target:l,title:u,dataTestId:f})=>t.createElement(r,{to:null!=a?a:"",className:i,target:null!=l?l:"_blank",rel:null!=c?c:"noopener noreferrer",title:u,"aria-label":o,onClick:s,"data-testid":f},t.createElement(vc,{className:e})," ",n),nl=({className:e,iconClassName:n,sourcegraphURL:r,onSignInClose:o})=>{const i=Tc(new URL("/sign-in?close=true",r),{utm_source:Fc(),utm_campaign:"sign-in-button"}).href,[a]=function(e){const n=(0,t.useMemo)((()=>new ye),[]),r=(0,t.useMemo)((()=>n.pipe(e)),[n,e]);return[(0,t.useMemo)((()=>n.next.bind(n)),[n]),Kc(r)]}((0,t.useCallback)((e=>e.pipe(ze((e=>{const t=window.open(i,"_blank");return t?(e.preventDefault(),Xc(300).pipe(qe((()=>t.closed)),Ye(1))):[]})),tt(o))),[o,i]));return t.createElement(tl,{href:i,label:"Sign in to Sourcegraph",title:"Sign into Sourcegraph to get hover tooltips, go to definition and more",ariaLabel:"Sign into Sourcegraph to get hover tooltips, go to definition and more",className:e,iconClassName:n,onClick:a})};function rl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return"function"==typeof n&&e.pop(),$(e,void 0).lift(new ol(n))}var ol=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new il(e,this.resultSelector))},e}(),il=function(e){function t(t,n,r){void 0===r&&(r=Object.create(null));var o=e.call(this,t)||this;return o.resultSelector=n,o.iterators=[],o.active=0,o.resultSelector="function"==typeof n?n:void 0,o}return w(t,e),t.prototype._next=function(e){var t=this.iterators;p(e)?t.push(new sl(e)):"function"==typeof e[K]?t.push(new al(e[K]())):t.push(new cl(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0!==t){this.active=t;for(var n=0;n<t;n++){var r=e[n];if(r.stillUnsubscribed)this.destination.add(r.subscribe());else this.active--}}else this.destination.complete()},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,n=this.destination,r=0;r<t;r++){if("function"==typeof(a=e[r]).hasValue&&!a.hasValue())return}var o=!1,i=[];for(r=0;r<t;r++){var a,s=(a=e[r]).next();if(a.hasCompleted()&&(o=!0),s.done)return void n.complete();i.push(s.value)}this.resultSelector?this._tryresultSelector(i):n.next(i),o&&n.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(D),al=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return Boolean(e&&e.done)},e}(),sl=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[K]=function(){return this},e.prototype.next=function(e){var t=this.index++,n=this.array;return t<this.length?{value:n[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),cl=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.parent=n,o.observable=r,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return w(t,e),t.prototype[K]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return re(this.observable,new te(this))},t}(ne);class ll extends Error{}class ul extends Error{}const fl=jo((({rawRepoName:e,requestGraphQL:t})=>t({request:fr`
|
|
11
|
+
`,variables:{repoName:t},mightContainPrivateInfo:!0})).pipe(H(pr),H((({repository:e})=>{if(!e)throw new So(t);if(!e.mirrorInfo.cloned)throw new _o(t);return e.uri})))),(({repoName:e})=>e));var Bo=n(93234),Uo=n.n(Bo);const qo=["group","id"];function Vo(e,t){var n;if(!e.actions)return[];const r=[],o=null===(n=e.menus)||void 0===n?void 0:n[t];if(o)for(const{action:t,alt:n,when:i,disabledWhen:a}of Uo()(o,qo)){const o=e.actions.find((e=>e.id===t)),s=e.actions.find((e=>e.id===n));o&&r.push({action:o,altAction:s,active:void 0===i||!!i,disabledWhen:!!a})}return r}var $o=n(26705),zo=n.n($o);const Ho=["Assembly","Bash","C","C++","C#","CSS","Dart","Elixir","Erlang","Go","GraphQL","Groovy","Haskell","HTML","Java","JavaScript","Kotlin","JSON","Julia","Lua","Markdown","Objective-C","OCaml","PHP","PowerShell","Python","R","Ruby","Rust","Sass","Scala","SQL","Swift","Terraform","TypeScript","VBA","XML","YAML","Zig"],Go=zo()(Ho.concat(["1C Enterprise","4D","ABAP","ABNF","ActionScript","Ada","Adobe Font Metrics","Agda","AGS Script","AL","Alloy","Alpine Abuild","Altium Designer","AMPL","AngelScript","Ant Build System","ANTLR","ApacheConf","Apex","API Blueprint","APL","Apollo Guidance Computer","AppleScript","Arc","AsciiDoc","ASL","ASN.1","AspectJ","ASP.NET","Assembly","Asymptote","ATS","Augeas","AutoHotkey","AutoIt","Avro IDL","Awk","Ballerina","Batchfile","Befunge","BibTeX","Bison","BitBake","Blade","BlitzBasic","BlitzMax","Bluespec","Boo","Brainfuck","Brightscript","C","C#","C++","C2hs Haskell","Cabal Config","Cap'n Proto","CartoCSS","Ceylon","Chapel","Charity","ChucK","Cirru","Clarion","Classic ASP","Clean","Click","CLIPS","Clojure","Closure Templates","Cloud Firestore Security Rules","CMake","C-ObjDump","COBOL","CodeQL","CoffeeScript","ColdFusion","ColdFusion CFC","COLLADA","Common Lisp","Common Workflow Language","Component Pascal","CoNLL-U","Cool","Coq","Cpp-ObjDump","Creole","Crystal","CSON","Csound","Csound Document","Csound Score","CSS","CSV","Cuda","cURL Config","CWeb","Cycript","Cython","D","Dafny","Darcs Patch","Dart","DataWeave","desktop","Dhall","Diff","DIGITAL Command Language","dircolors","DirectX 3D File","DM","DNS Zone","D-ObjDump","Dockerfile","Dogescript","DTrace","Dylan","E","Eagle","Easybuild","EBNF","eC","Ecere Projects","ECL","ECLiPSe","EditorConfig","Edje Data Collection","edn","Eiffel","EJS","Elixir","Elm","Emacs Lisp","EmberScript","EML","EQ","Erlang","F#","F*","Factor","Fancy","Fantom","Faust","FIGlet Font","Filebench WML","Filterscript","fish","FLUX","Formatted","Forth","Fortran","Fortran Free Form","FreeMarker","Frege","Futhark","Game Maker Language","GAML","GAMS","GAP","GCC Machine Description","G-code","GDB","GDScript","GEDCOM","Genie","Genshi","Gentoo Ebuild","Gentoo Eclass","Gerber Image","Gettext Catalog","Gherkin","Git Attributes","Git Config","GLSL","Glyph","Glyph Bitmap Distribution Format","GN","Gnuplot","Go","Golo","Gosu","Grace","Gradle","Grammatical Framework","Graph Modeling Language","GraphQL","Graphviz (DOT)","Groovy","Groovy Server Pages","Hack","Haml","Handlebars","HAProxy","Harbour","Haskell","Haxe","HCL","HiveQL","HLSL","HolyC","HTML","HTML+Django","HTML+ECR","HTML+EEX","HTML+ERB","HTML+PHP","HTML+Razor","HTTP","HXML","Hy","HyPhy","IDL","Idris","Ignore List","IGOR Pro","Inform 7","INI","Inno Setup","Io","Ioke","IRC log","Isabelle","Isabelle ROOT","J","Jasmin","Java","Java Properties","JavaScript","JavaScript+ERB","Java Server Pages","JFlex","Jison","Jison Lex","Jolie","JSON","JSON5","JSONiq","JSONLD","Jsonnet","JSON with Comments","JSX","Julia","Jupyter Notebook","Kaitai Struct","KiCad Layout","KiCad Legacy Layout","KiCad Schematic","Kit","Kotlin","KRL","LabVIEW","Lark","Lasso","Latte","Lean","Less","Lex","LFE","LilyPond","Limbo","Linker Script","Linux Kernel Module","Liquid","Literate Agda","Literate CoffeeScript","Literate Haskell","LiveScript","LLVM","Logos","Logtalk","LOLCODE","LookML","LoomScript","LSL","LTspice Symbol","Lua","M","M4","M4Sugar","Macaulay2","Makefile","Mako","Markdown","Marko","Mask","Mathematica","MATLAB","Maven POM","Max","MAXScript","mcfunction","MediaWiki","Mercury","Meson","Metal","Microsoft Developer Studio Project","MiniD","Mirah","mIRC Script","MLIR","Modelica","Modula-2","Modula-3","Module Management System","Monkey","Moocode","MoonScript","Motorola 68K Assembly","MQL4","MQL5","MTML","MUF","mupad","Muse","Mustache","Myghty","nanorc","NASL","NCL","Nearley","Nemerle","NEON","nesC","NetLinx","NetLinx+ERB","NetLogo","NewLisp","Nextflow","Nginx","Nim","Ninja","Nit","Nix","NL","NPM Config","NSIS","Nu","NumPy","NWScript","ObjDump","Object Data Instance Notation","Objective-C","Objective-C++","Objective-J","ObjectScript","OCaml","Odin","Omgrofl","ooc","Opa","Opal","OpenCL","OpenEdge ABL","Open Policy Agent","OpenQASM","OpenRC runscript","OpenSCAD","OpenStep Property List","OpenType Feature File","Org","Ox","Oxygene","Oz","P4","Pan","Papyrus","Parrot","Parrot Assembly","Parrot Internal Representation","Pascal","Pawn","Pep8","Perl","PHP","Pic","Pickle","PicoLisp","PigLatin","Pike","PlantUML","PLpgSQL","PLSQL","Pod","Pod 6","PogoScript","Pony","PostCSS","PostScript","POV-Ray SDL","PowerBuilder","PowerShell","Prisma","Processing","Proguard","Prolog","Propeller Spin","Protocol Buffer","Public Key","Pug","Puppet","PureBasic","Pure Data","PureScript","Python","Python console","Python traceback","q","Q#","QMake","QML","Qt Script","Quake","R","Racket","Ragel","Raku","RAML","Rascal","Raw token data","RDoc","Readline Config","REALbasic","Reason","Rebol","Red","Redcode","Regular Expression","RenderScript","Ren'Py","ReScript","reStructuredText","REXX","Rich Text Format","Ring","Riot","RMarkdown","RobotFramework","Roff","Roff Manpage","Rouge","RPC","RPM Spec","Ruby","RUNOFF","Rust","Sage","SaltStack","SAS","Sass","Scala","Scaml","Scheme","Scilab","SCSS","sed","Self","ShaderLab","Shell","ShellSession","Shen","Sieve","Slash","Slice","Slim","Smali","Smalltalk","Smarty","SmPL","SMT","Solidity","SourcePawn","SPARQL","Spline Font Database","SQF","SQL","SQLPL","Squirrel","SRecode Template","SSH Config","Stan","Standard ML","Starlark","Stata","STON","Stylus","SubRip Text","SugarSS","SuperCollider","Svelte","SVG","Swift","SWIG","SystemVerilog","Tcl","Tcsh","Tea","Terra","TeX","Texinfo","Text","Textile","Thrift","TI Program","TLA","TOML","TSQL","TSV","TSX","Turing","Turtle","Twig","TXL","Type Language","TypeScript","Unified Parallel C","Unity3D Asset","Unix Assembly","Uno","UnrealScript","UrWeb","V","Vala","VBA","VBScript","VCL","Verilog","VHDL","Vim Help File","Vim script","Vim Snippet","Visual Basic .NET","Volt","Vue","Wavefront Material","Wavefront Object","wdl","WebAssembly","WebIDL","Web Ontology Language","WebVTT","Wget Config","Windows Registry Entries","wisp","Wollok","World of Warcraft Addon Data","X10","xBase","X BitMap","XC","XCompose","X Font Directory Index","XML","XML Property List","Xojo","XPages","X PixMap","XProc","XQuery","XS","XSLT","Xtend","Yacc","YAML","YANG","YARA","YASnippet","ZAP","Zeek","ZenScript","Zephir","Zig","ZIL","Zimpl"])),Qo=[{name:"repo"},{name:"file",fields:[{name:"directory"},{name:"path"}]},{name:"content"},{name:"symbol",fields:[{name:"file"},{name:"module"},{name:"namespace"},{name:"package"},{name:"class"},{name:"method"},{name:"property"},{name:"field"},{name:"constructor"},{name:"enum"},{name:"interface"},{name:"function"},{name:"variable"},{name:"constant"},{name:"string"},{name:"number"},{name:"boolean"},{name:"array"},{name:"object"},{name:"key"},{name:"null"},{name:"enum-member"},{name:"struct"},{name:"event"},{name:"operator"},{name:"type-parameter"}]},{name:"commit",fields:[{name:"diff",fields:[{name:"added"},{name:"removed"}]}]}],Wo=(e,t)=>{if(t<0)return[];const n=[];for(const r of e)n.push(`${r.name}`),r.fields&&n.push(...Wo(r.fields,t-1).map((e=>`${r.name}.`+e)));return n};let Ko,Zo;!function(e){e.after="after",e.archived="archived",e.author="author",e.before="before",e.case="case",e.committer="committer",e.content="content",e.context="context",e.count="count",e.file="file",e.fork="fork",e.lang="lang",e.message="message",e.patterntype="patterntype",e.repo="repo",e.repogroup="repogroup",e.repohascommitafter="repohascommitafter",e.repohasfile="repohasfile",e.rev="rev",e.select="select",e.timeout="timeout",e.type="type",e.visibility="visibility"}(Ko||(Ko={})),function(e){e.f="file",e.g="repogroup",e.l="lang",e.language="lang",e.m="message",e.msg="message",e.r="repo",e.revision="rev",e.since="after",e.until="before"}(Zo||(Zo={}));const Yo=[...Object.keys(Ko),...Object.keys(Zo)];let Jo;!function(e){e.author="-author",e.committer="-committer",e.content="-content",e.f="-f",e.file="-file",e.l="-l",e.lang="-lang",e.message="-message",e.r="-r",e.repo="-repo",e.repohasfile="-repohasfile"}(Jo||(Jo={}));Object.values(Jo),Ko.author,Ko.committer,Ko.content,Ko.file,Ko.file,Ko.lang,Ko.lang,Ko.message,Ko.repo,Ko.repo,Ko.repohasfile;const Xo=[{label:"Search a GitHub organization",insertText:"^github\\.com/${1:ORGANIZATION}/.*",asSnippet:!0},{label:"Search a single GitHub repository",insertText:"^github\\.com/${1:ORGANIZATION}/${2:REPO-NAME}$",asSnippet:!0},{label:"Search for repositories with fuzzy string search",insertText:"${1:STRING}",asSnippet:!0}];Ko.after,Ko.archived,Ko.author,Ko.before,Ko.case,Ko.committer,Ko.content,Ko.context,Ko.count,Ko.file,Ko.fork,Ko.lang,Ko.message,Ko.patterntype,Ko.repo,Ko.repogroup,Ko.repohascommitafter,Ko.repohasfile,Ko.rev,Ko.select,Ko.timeout,Ko.type,Ko.visibility;function ei(e){const t={label:e};return/\s/.test(e)&&(t.insertText=`"${e}"`),t}let ti,ni,ri,oi,ii,ai,si,ci,li,ui,fi,pi,di,hi,mi,gi,vi,bi,yi,wi,Ei,_i,xi,Si,Oi,Ti,Ci,ki,Ni,Ai,Ii,Pi,Ri,Di,Li,Mi,ji,Fi,Bi,Ui,qi,Vi,$i,zi;!function(e){e.READ="READ"}(ti||(ti={})),function(e){e.UNPUBLISHED="UNPUBLISHED",e.PUBLISHED="PUBLISHED"}(ni||(ni={})),function(e){e.SCHEDULED="SCHEDULED",e.QUEUED="QUEUED",e.PROCESSING="PROCESSING",e.ERRORED="ERRORED",e.FAILED="FAILED",e.COMPLETED="COMPLETED"}(ri||(ri={})),function(e){e.DRAFT="DRAFT",e.OPEN="OPEN",e.CLOSED="CLOSED",e.MERGED="MERGED",e.DELETED="DELETED"}(oi||(oi={})),function(e){e.APPROVED="APPROVED",e.CHANGES_REQUESTED="CHANGES_REQUESTED",e.PENDING="PENDING",e.COMMENTED="COMMENTED",e.DISMISSED="DISMISSED"}(ii||(ii={})),function(e){e.PENDING="PENDING",e.PASSED="PASSED",e.FAILED="FAILED"}(ai||(ai={})),function(e){e.UNPUBLISHED="UNPUBLISHED",e.FAILED="FAILED",e.RETRYING="RETRYING",e.SCHEDULED="SCHEDULED",e.PROCESSING="PROCESSING",e.OPEN="OPEN",e.DRAFT="DRAFT",e.CLOSED="CLOSED",e.MERGED="MERGED",e.DELETED="DELETED"}(si||(si={})),function(e){e.PUSH="PUSH",e.UPDATE="UPDATE",e.UNDRAFT="UNDRAFT",e.PUBLISH="PUBLISH",e.PUBLISH_DRAFT="PUBLISH_DRAFT",e.SYNC="SYNC",e.IMPORT="IMPORT",e.CLOSE="CLOSE",e.REOPEN="REOPEN",e.SLEEP="SLEEP",e.DETACH="DETACH",e.ARCHIVE="ARCHIVE"}(ci||(ci={})),function(e){e.EXISTING="EXISTING",e.BRANCH="BRANCH"}(li||(li={})),function(e){e.QUEUED="QUEUED",e.PROCESSING="PROCESSING",e.ERRORED="ERRORED",e.FAILED="FAILED",e.COMPLETED="COMPLETED"}(ui||(ui={})),function(e){e.REPO_NAME_ASC="REPO_NAME_ASC",e.REPO_NAME_DESC="REPO_NAME_DESC"}(fi||(fi={})),function(e){e.SKIPPED="SKIPPED",e.PENDING="PENDING",e.QUEUED="QUEUED",e.PROCESSING="PROCESSING",e.FAILED="FAILED",e.COMPLETED="COMPLETED",e.CANCELING="CANCELING",e.CANCELED="CANCELED"}(pi||(pi={})),function(e){e.OPEN="OPEN",e.CLOSED="CLOSED",e.DRAFT="DRAFT"}(di||(di={})),function(e){e.COMMENT="COMMENT",e.DETACH="DETACH",e.REENQUEUE="REENQUEUE",e.MERGE="MERGE",e.CLOSE="CLOSE",e.PUBLISH="PUBLISH"}(hi||(hi={})),function(e){e.PROCESSING="PROCESSING",e.COMPLETED="COMPLETED",e.FAILED="FAILED"}(mi||(mi={})),function(e){e.PENDING="PENDING",e.PROCESSING="PROCESSING",e.FAILED="FAILED",e.COMPLETED="COMPLETED",e.QUEUED="QUEUED",e.CANCELING="CANCELING",e.CANCELED="CANCELED"}(gi||(gi={})),function(e){e.NORMAL="NORMAL",e.CRITICAL="CRITICAL"}(vi||(vi={})),function(e){e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.ERROR="ERROR"}(bi||(bi={})),function(e){e.PROCESSING="PROCESSING",e.ERRORED="ERRORED",e.COMPLETED="COMPLETED",e.QUEUED="QUEUED",e.UPLOADING="UPLOADING",e.DELETING="DELETING"}(yi||(yi={})),function(e){e.PROCESSING="PROCESSING",e.ERRORED="ERRORED",e.COMPLETED="COMPLETED",e.QUEUED="QUEUED"}(wi||(wi={})),function(e){e.LANGUAGE_SUPPORTED="LANGUAGE_SUPPORTED",e.PROJECT_STRUCTURE_SUPPORTED="PROJECT_STRUCTURE_SUPPORTED",e.INDEX_JOB_INFERED="INDEX_JOB_INFERED"}(Ei||(Ei={})),function(e){e.UNKNOWN="UNKNOWN",e.NATIVE="NATIVE",e.THIRD_PARTY="THIRD_PARTY"}(_i||(_i={})),function(e){e.UNSUPPORTED="UNSUPPORTED",e.BASIC="BASIC"}(xi||(xi={})),function(e){e.HOUR="HOUR",e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR"}(Si||(Si={})),function(e){e.NOTEBOOK_UPDATED_AT="NOTEBOOK_UPDATED_AT",e.NOTEBOOK_CREATED_AT="NOTEBOOK_CREATED_AT",e.NOTEBOOK_STAR_COUNT="NOTEBOOK_STAR_COUNT"}(Oi||(Oi={})),function(e){e.MARKDOWN="MARKDOWN",e.QUERY="QUERY",e.FILE="FILE",e.SYMBOL="SYMBOL",e.COMPUTE="COMPUTE"}(Ti||(Ti={})),function(e){e.WEB="WEB",e.CODEHOSTINTEGRATION="CODEHOSTINTEGRATION",e.BACKEND="BACKEND",e.STATICWEB="STATICWEB",e.IDEEXTENSION="IDEEXTENSION"}(Ci||(Ci={})),function(e){e.V1="V1",e.V2="V2"}(ki||(ki={})),function(e){e.literal="literal",e.regexp="regexp",e.structural="structural"}(Ni||(Ni={})),function(e){e.AWSCODECOMMIT="AWSCODECOMMIT",e.BITBUCKETCLOUD="BITBUCKETCLOUD",e.BITBUCKETSERVER="BITBUCKETSERVER",e.GITHUB="GITHUB",e.GITLAB="GITLAB",e.GITOLITE="GITOLITE",e.GOMODULES="GOMODULES",e.JVMPACKAGES="JVMPACKAGES",e.NPMPACKAGES="NPMPACKAGES",e.OTHER="OTHER",e.PAGURE="PAGURE",e.PERFORCE="PERFORCE",e.PHABRICATOR="PHABRICATOR"}(Ai||(Ai={})),function(e){e.ADDED="ADDED",e.UNCHANGED="UNCHANGED",e.DELETED="DELETED"}(Ii||(Ii={})),function(e){e.ERROR="ERROR",e.WARNING="WARNING",e.INFORMATION="INFORMATION",e.HINT="HINT"}(Pi||(Pi={})),function(e){e.UNKNOWN="UNKNOWN",e.FILE="FILE",e.MODULE="MODULE",e.NAMESPACE="NAMESPACE",e.PACKAGE="PACKAGE",e.CLASS="CLASS",e.METHOD="METHOD",e.PROPERTY="PROPERTY",e.FIELD="FIELD",e.CONSTRUCTOR="CONSTRUCTOR",e.ENUM="ENUM",e.INTERFACE="INTERFACE",e.FUNCTION="FUNCTION",e.VARIABLE="VARIABLE",e.CONSTANT="CONSTANT",e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.ARRAY="ARRAY",e.OBJECT="OBJECT",e.KEY="KEY",e.NULL="NULL",e.ENUMMEMBER="ENUMMEMBER",e.STRUCT="STRUCT",e.EVENT="EVENT",e.OPERATOR="OPERATOR",e.TYPEPARAMETER="TYPEPARAMETER"}(Ri||(Ri={})),function(e){e.GIT_BRANCH="GIT_BRANCH",e.GIT_TAG="GIT_TAG",e.GIT_REF_OTHER="GIT_REF_OTHER"}(Di||(Di={})),function(e){e.AUTHORED_OR_COMMITTED_AT="AUTHORED_OR_COMMITTED_AT"}(Li||(Li={})),function(e){e.GIT_COMMIT="GIT_COMMIT",e.GIT_TAG="GIT_TAG",e.GIT_TREE="GIT_TREE",e.GIT_BLOB="GIT_BLOB",e.GIT_UNKNOWN="GIT_UNKNOWN"}(Mi||(Mi={})),function(e){e.ACCEPT="ACCEPT",e.REJECT="REJECT"}(ji||(ji={})),function(e){e.REPOSITORY_NAME="REPOSITORY_NAME",e.REPO_CREATED_AT="REPO_CREATED_AT",e.REPOSITORY_CREATED_AT="REPOSITORY_CREATED_AT"}(Fi||(Fi={})),function(e){e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR"}(Bi||(Bi={})),function(e){e.PAGEVIEW="PAGEVIEW",e.SEARCHQUERY="SEARCHQUERY",e.CODEINTEL="CODEINTEL",e.CODEINTELREFS="CODEINTELREFS",e.CODEINTELINTEGRATION="CODEINTELINTEGRATION",e.CODEINTELINTEGRATIONREFS="CODEINTELINTEGRATIONREFS",e.STAGEMANAGE="STAGEMANAGE",e.STAGEPLAN="STAGEPLAN",e.STAGECODE="STAGECODE",e.STAGEREVIEW="STAGEREVIEW",e.STAGEVERIFY="STAGEVERIFY",e.STAGEPACKAGE="STAGEPACKAGE",e.STAGEDEPLOY="STAGEDEPLOY",e.STAGECONFIGURE="STAGECONFIGURE",e.STAGEMONITOR="STAGEMONITOR",e.STAGESECURE="STAGESECURE",e.STAGEAUTOMATE="STAGEAUTOMATE"}(Ui||(Ui={})),function(e){e.TODAY="TODAY",e.THIS_WEEK="THIS_WEEK",e.THIS_MONTH="THIS_MONTH",e.ALL_TIME="ALL_TIME"}(qi||(qi={})),function(e){e.SEARCH_CONTEXT_SPEC="SEARCH_CONTEXT_SPEC",e.SEARCH_CONTEXT_UPDATED_AT="SEARCH_CONTEXT_UPDATED_AT"}(Vi||(Vi={})),function(e){e[e.Literal=1]="Literal",e[e.Regexp=2]="Regexp",e[e.Structural=3]="Structural"}($i||($i={})),function(e){e.Or="or",e.And="and",e.Not="not"}(zi||(zi={}));const Hi=(e,t,n=!1)=>({type:"literal",value:e,range:t,quoted:n}),Gi=(...e)=>(t,n)=>{const r=[];for(const o of e){const e=o(t,n);if("success"===e.type)return e;r.push(e.expected)}return{type:"error",expected:`One of: ${r.join(", ")}`,at:n}},Qi=e=>(t,n)=>{if(t[n]!==e)return{type:"error",expected:e,at:n};let r=n+1;for(;t[r]&&(t[r]!==e||"\\"===t[r-1]);)r+=1;return t[r]?{type:"success",term:Hi(t.slice(n+1,r),{start:n,end:r+1},!0)}:{type:"error",expected:e,at:r}},Wi=(e,t,n)=>(e.source.startsWith("^")||(e=new RegExp(`^${e.source}`,e.flags)),(r,o)=>{const i=r.slice(Math.max(0,o));if(!i)return{type:"error",expected:n||`/${e.source}/`,at:o};const a=i.match(e);if(!a)return{type:"error",expected:n||`/${e.source}/`,at:o};const s={start:o,end:o+a[0].length};return{type:"success",term:t?"function"==typeof t?t(a[0],s):t:{type:"literal",value:a[0],range:s}}}),Ki=(e,t)=>{let n=t,r=0,o="";const i=[],a=()=>{o=e[n],n+=1};if(!aa(e,t))return{type:"error",expected:"no recognized filter or keyword",at:t};for(;void 0!==e[n];){if(a(),o.match(/\s/)&&0===r){n-=1;break}if("("===o){if(!aa(e,n))return{type:"error",expected:"no recognized filter or keyword",at:n};r+=1,i.push(o)}else if(")"===o){if(r-=1,r<0&&n>1){n-=1,r=0;break}i.push(o)}else if(" "===o){if(!aa(e,n))return{type:"error",expected:"no recognized filter or keyword",at:n};i.push(o)}else if("\\"===o){if(void 0!==e[n]){a(),i.push("\\",o);continue}i.push(o)}else i.push(o)}return 0!==r?{type:"error",expected:"no unbalanced parentheses",at:n}:{type:"success",term:Hi(i.join(""),{start:t,end:n})}},Zi=Wi(/\s+/,((e,t)=>({type:"whitespace",range:t}))),Yi=Wi(/[^\s)]+/),Ji=Wi(/(not|NOT)/,((e,{start:t,end:n})=>({type:"keyword",value:e,range:{start:t,end:n},kind:zi.Not}))),Xi=Wi(/(and|AND)/,((e,{start:t,end:n})=>({type:"keyword",value:e,range:{start:t,end:n},kind:zi.And}))),ea=Wi(/(or|OR)/,((e,{start:t,end:n})=>({type:"keyword",value:e,range:{start:t,end:n},kind:zi.Or}))),ta=Gi(Xi,ea,Ji),na=(Wi(/\/\/.*/,((e,{start:t,end:n})=>({type:"comment",value:e,range:{start:t,end:n}}))),Wi(new RegExp(`-?(${Yo.join("|")})+(?=:)`,"i"))),ra=(Gi(Qi('"'),Qi("'"),Ki,Yi),Wi(/\(/,((e,t)=>({type:"openingParen",range:t}))),Wi(/\)/,((e,t)=>({type:"closingParen",range:t})))),oa=(e,t)=>(n,r)=>{const o=e(n,r);if("error"===o.type)return o;let i;const a=[];if(Array.isArray(o.term))for(const e of o.term)a.push(e),i=e.range.end;else a.push(o.term),i=o.term.range.end;if(i&&void 0!==n[i]){const e=t(n,i);if("error"===e.type)return e;a.push(e.term),i=e.term.range.end}return{type:"success",term:a}},ia=Gi(na,oa(ta,Zi)),aa=(e,t)=>"success"!==ia(e,t).type;Gi(Zi,ra);let sa;!function(e){e.Global="Global",e.Subexpression="Subexpression"}(sa||(sa={}));const ca=e=>{const t=e.split(",");if(1===t.length)return{line:parseInt(e,10),character:0};if(2===t.length)return{line:parseInt(t[0],10),character:parseInt(t[1],10)};throw new Error("unexpected position: "+e)};function la(e){const t=new URL(e),n=t.hostname+decodeURIComponent(t.pathname),r=decodeURIComponent(t.search.slice("?".length))||void 0;let o;null!=r&&r.match(/[\dA-f]{40}/)&&(o=r);const i=t.hash.slice("#".length).split(":").map(decodeURIComponent);let a,s,c;if(1===i.length&&(a=i[0]),2===i.length){a=i[0];const e=i[1],t=e.split("-");if(1===t.length&&(s=ca(t[0])),2===t.length&&(c={start:ca(t[0]),end:ca(t[1])}),t.length>2)throw new Error("unexpected range or position: "+e)}if(i.length>2)throw new Error("unexpected fragment: "+t.hash);return{repoName:n,revision:r,commitID:o,filePath:a||void 0,position:s,range:c}}function ua(e){if(e.startsWith("#")&&(e=e.slice("#".length)),!function(e){return e.startsWith("#")&&(e=e.slice("#".length)),""!==e&&!e.includes("=")&&(e.includes("$info")||e.includes("$def")||e.includes("$references")||e.includes("$impl")||e.includes("$history"))}(e)){const t=new URLSearchParams(e),n=pa(t)||{};return t.get("tab")&&(n.viewState=t.get("tab")),n}if(!/^(L\d+(:\d+)?(-\d+(:\d+)?)?)?(\$.*)?$/.test(e))return{};const t=e.split("$",2),n=fa(t[0]);return t[1]&&(n.viewState=t[1]),n}function fa(e){if(!/^(L\d+(:\d+)?(-L?\d+(:\d+)?)?)?$/.test(e))return{};let t,n,r,o;if(e.startsWith("L")){const i=e.slice(1),[a,s]=i.split("-",2);if(a){const e=da(a);t=e.line,n=e.character}if(s){const e=da(s);r=e.line,o=e.character}}let i={line:t,character:n,endLine:r,endCharacter:o};return i=void 0===t||void 0!==r&&typeof n!=typeof o?{}:void 0===n?void 0===r?{line:t}:{line:t,endLine:r}:void 0===r||void 0===o?{line:t,character:n}:{line:t,character:n,endLine:r,endCharacter:o},i}function pa(e){const t=Jn(e);return t?fa(t):void 0}function da(e){e.startsWith("L")&&(e=e.slice(1));const t=e.split(":",2);let n,r;return t.length>=1&&(n=parseInt(t[0],10)),2===t.length&&(r=parseInt(t[1],10)),n="number"==typeof n&&isNaN(n)?void 0:n,r="number"==typeof r&&isNaN(r)?void 0:r,void 0===n?{line:void 0,character:void 0}:{line:n,character:r}}function ha({repoName:e,revision:t}){return t?`${Xn(e)}@${function(e){return Xn(e)}(t)}`:e}function ma(e){const t=nr(function(e,t){return"code"===t.renderMode&&e.set("view","code"),e}(new URLSearchParams,e),function(e){if(e.range)return"L"+(e.range.start.line===e.range.end.line&&e.range.start.character===e.range.end.character?Zn(e.range.start):`${Zn(e.range.start)}-${Zn(e.range.end)}`);if(e.position)return"L"+Zn(e.position)}(e)),n=[...t].length>0?`?${tr(t)}`:"";return`/${ha({repoName:e.repoName,revision:e.revision})}/-/blob/${e.filePath}${n}${r=e.viewState,r?`#tab=${r}`:""}`;var r}function ga(e,t){return`${e.replace(/\/$/,"")}${ma(t)}`}const va=e=>e.line.toString()+(e.character?`,${e.character}`:"");function ba(e){const t=e.commitID||e.revision;let n=`git://${Xn(e.repoName)}`;return n+=t?"?"+Xn(t):"",n+=e.filePath?"#"+Xn(e.filePath):"",n+=e.position||e.range?":":"",n+=e.position?va(e.position):"",n+=e.range?va(e.range.start)+"-"+va(e.range.end):"",n}function ya({repoName:e,filePath:t,commitID:n}){return`git://${Xn(e)}?${n}#${Xn(t)}`}function wa(e,t){const n=e.find((e=>{const n=la(e.uri);return n.repoName===t.repoName&&n.revision===t.revision}));return void 0!==(null==n?void 0:n.inputRevision)?{...t,commitID:void 0,revision:n.inputRevision}:t}const Ea="loading";function _a({extensionsController:e,platformContext:t},n){return function({getDefinition:e,hasReferenceProvidersForDocument:t,getWorkspaceRoots:n,platformContext:{urlToFile:r,requestGraphQL:o}},i){const a={textDocument:{uri:ba(i)},position:{line:i.line-1,character:i.character-1},part:i.part},s=e(a).pipe(Sa({urlToFile:r,requestGraphQL:o},{getWorkspaceRoots:n},a),st((e=>[{isLoading:!1,result:ln(e)}])),Wt());return Oe([s.pipe(_n(qn,null)),t(a),kt([!1],z(!0).pipe(It(qn),on(s.pipe(qe((({result:e})=>null!==e))))),s.pipe(qe((({result:e})=>null!==e)),ut(!0)))]).pipe(H((([e,t,n])=>{const o=e!==Ea&&!cn(e)&&null!=e&&e.url?e.url:"",s=r({...i,position:i},{part:i.part});return{"goToDefinition.showLoading":e===Ea,"goToDefinition.url":e!==Ea&&!cn(e)&&(null==e?void 0:e.url)||null,"goToDefinition.notFound":e!==Ea&&!cn(e)&&null===e,"goToDefinition.error":cn(e)&&e.stack,"findReferences.url":t&&n?r({...i,position:i,viewState:"references"},{part:i.part}):null,"panel.url":r({...i,position:i,viewState:"panelID"},{part:i.part}),hoverPosition:a,hoveredOnDefinition:s===o}})),Qe(((e,t)=>Ot()(e,t))))}({platformContext:t,getDefinition:t=>ee(e.extHostAPI).pipe(ze((e=>Xr(e.getDefinition(t))))),hasReferenceProvidersForDocument:t=>ee(e.extHostAPI).pipe(ze((e=>Xr(e.hasReferenceProvidersForDocument(t))))),getWorkspaceRoots:()=>ee(e.extHostAPI).pipe(ze((e=>Xr(e.getWorkspaceRoots()))))},n).pipe(ze((t=>xa(t,e.extHostAPI))))}const xa=(e,t)=>ee(t).pipe(ze((t=>Xr(t.getContributions({extraContext:e})))),rn(),H((e=>Vo(e,Ao.Hover))));const Sa=({urlToFile:e,requestGraphQL:t},{getWorkspaceRoots:n},r)=>o=>Oe([o,n()]).pipe(ze((([{isLoading:n,result:o},i])=>{if(0===o.length)return z({isLoading:n,result:null});if((o=No()(o,Ot())).length>1){const t=wa(i||[],la(r.textDocument.uri));return z({isLoading:n,result:{url:e({...t,revision:t.revision||"",filePath:t.filePath||"",position:{line:r.position.line+1,character:r.position.character+1},viewState:"def"},{part:r.part}),multiple:!0}})}const a=o[0],s=wa(i||[],la(a.uri));return a.range&&(s.position={line:a.range.start.line+1,character:a.range.start.character+1}),le([{isLoading:!0}],Fo({...s,requestGraphQL:t}).pipe(H((t=>({url:e({...s,revision:s.revision||"",filePath:s.filePath||"",rawRepoName:t},{part:r.part}),multiple:!1}))),H((e=>({isLoading:n,result:e})))))})),hn(((e,t)=>({...e,...t})),{isLoading:!0,result:null}));const Oa="Card-module__card_1wo7K";function Ta(){return(Ta=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const Ca=t.forwardRef((({children:e,className:n,as:r="div",...o},a)=>{const{isBranded:s}=c();return t.createElement(r,Ta({className:i()(s&&Oa,n),ref:a},o),e)}));var ka=n(50672),Na=n.n(ka),Aa=(n(42497),n(8202),n(14245));function Ia(e){const t=(0,Aa.basename)(e),n=function(e){const t=e.split(".");if(1===t.length)return"";if(2===t.length&&""===t[0])return"";return t[t.length-1].toLowerCase()}(e);return function(e){switch(e.toLowerCase()){case"dockerfile":return"dockerfile";default:return}}(t)||function(e){switch(e.toLowerCase()){case"adb":case"ada":case"ads":return"ada";case"cls":case"apex":case"trigger":return"apex";case"as":return"actionscript";case"apacheconf":return"apache";case"applescript":case"scpt":return"applescript";case"sh":case"bash":case"zsh":return"shell";case"clj":case"cljs":case"cljx":return"clojure";case"css":return"css";case"cmake":case"cmake.in":case"in":return"cmake";case"coffee":case"cake":case"cson":case"cjsx":case"iced":return"coffescript";case"cs":case"csx":return"csharp";case"c":case"cc":case"cpp":case"cxx":case"c++":case"h++":case"hh":case"h":case"hpp":case"pc":case"pcc":return"cpp";case"cu":case"cuh":return"cuda";case"dart":return"dart";case"diff":case"patch":return"diff";case"jinja":return"django";case"bat":case"cmd":return"dos";case"ex":case"exs":return"elixir";case"elm":return"elm";case"erl":return"erlang";case"f":case"for":case"frt":case"fr":case"forth":case"4th":case"fth":return"fortran";case"fs":return"fsharp";case"go":return"go";case"graphql":return"graphql";case"groovy":return"groovy";case"haml":return"haml";case"hbs":case"handlebars":return"handlebars";case"hs":case"hsc":return"haskell";case"htm":case"html":case"xhtml":return"html";case"ini":case"cfg":case"prefs":case"pro":case"properties":return"ini";case"java":return"java";case"js":case"jsx":case"es":case"es6":case"jss":case"jsm":return"javascript";case"json":case"sublime_metrics":case"sublime_session":case"sublime-keymap":case"sublime-mousemap":case"sublime-project":case"sublime-settings":case"sublime-workspace":return"json";case"jsonnet":case"libsonnet":return"jsonnet";case"jl":return"julia";case"kt":case"ktm":case"kts":return"kotlin";case"less":return"less";case"lisp":case"asd":case"cl":case"lsp":case"l":case"ny":case"podsl":case"sexp":case"el":return"lisp";case"lua":case"fcgi":case"nse":case"pd_lua":case"rbxs":case"wlua":return"lua";case"mk":case"mak":return"makefile";case"md":case"mkdown":case"mkd":return"markdown";case"nginxconf":return"nginx";case"m":case"mm":return"objectivec";case"ml":case"eliom":case"eliomi":case"ml4":case"mli":case"mll":case"mly":case"re":return"ocaml";case"p":case"pas":case"pp":return"pascal";case"pl":case"al":case"cgi":case"perl":case"ph":case"plx":case"pm":case"pod":case"psgi":case"t":return"perl";case"php":case"phtml":case"php3":case"php4":case"php5":case"php6":case"php7":case"phps":return"php";case"ps1":case"psd1":case"psm1":return"powershell";case"proto":return"protobuf";case"py":case"pyc":case"pyd":case"pyo":case"pyw":case"pyz":return"python";case"r":case"rd":case"rsx":return"r";case"repro":return"repro";case"rb":case"builder":case"eye":case"gemspec":case"god":case"jbuilder":case"mspec":case"pluginspec":case"podspec":case"rabl":case"rake":case"rbuild":case"rbw":case"rbx":case"ru":case"ruby":case"spec":case"thor":case"watchr":return"ruby";case"rs":case"rs.in":return"rust";case"sass":case"scss":return"scss";case"sbt":case"sc":case"scala":return"scala";case"strato":return"strato";case"scm":case"sch":case"sls":case"sps":case"ss":return"scheme";case"st":return"smalltalk";case"sql":return"sql";case"styl":return"stylus";case"swift":return"swift";case"thrift":return"thrift";case"ts":case"tsx":return"typescript";case"twig":return"twig";case"vb":return"vbnet";case"vbs":return"vbscrip";case"v":case"veo":case"sv":case"svh":case"svi":return"verilog";case"vhd":case"vhdl":return"vhdl";case"vim":return"vim";case"xml":case"adml":case"admx":case"ant":case"axml":case"builds":case"ccxml":case"clixml":case"cproject":case"csl":case"csproj":case"ct":case"dita":case"ditamap":case"ditaval":case"dll.config":case"dotsettings":case"filters":case"fsproj":case"fxml":case"glade":case"gml":case"grxml":case"iml":case"ivy":case"jelly":case"jsproj":case"kml":case"launch":case"mdpolicy":case"mjml":case"mod":case"mxml":case"nproj":case"nuspec":case"odd":case"osm":case"pkgproj":case"plist":case"props":case"ps1xml":case"psc1":case"pt":case"rdf":case"resx":case"rss":case"scxml":case"sfproj":case"srdf":case"storyboard":case"stTheme":case"sublime-snippet":case"targets":case"tmCommand":case"tml":case"tmLanguage":case"tmPreferences":case"tmSnippet":case"tmTheme":case"ui":case"urdf":case"ux":case"vbproj":case"vcxproj":case"vsixmanifest":case"vssettings":case"vstemplate":case"vxml":case"wixproj":case"wsdl":case"wsf":case"wxi":case"wxl":case"wxs":case"x3d":case"xacro":case"xaml":case"xib":case"xlf":case"xliff":case"xmi":case"xml.dist":case"xproj":case"xsd":case"xspec":case"xul":case"zcml":return"xml";case"yml":case"yaml":return"yaml";default:return}}(n)||"plaintext"}n(31781);var Pa=n(9588),Ra=n.n(Pa),Da=n(28838);function La(e,t){const n=t?e.light:e.dark,{range:r,isWholeLine:o,after:i,light:a,dark:s,...c}=e;return{...c,...n}}function Ma(e,t){const n=t?e.light:e.dark,{contentText:r,hoverMessage:o,linkURL:i,light:a,dark:s,...c}=e;return{...c,...n}}Ra()("TextDocumentDecorationType");const ja=e=>({[Rr]:!0,subscribe:t=>Gr(e.subscribe({next:e=>{t.next(e)},error:e=>{t.error(e&&{message:e.message,name:e.name,stack:e.stack})},complete:()=>{t.complete()}}))});n(87831);n(12452);var Fa=n(38523),Ba=n.n(Fa);const Ua=new Set(["blue","yellow","orange","pink","red","purple","green","grey"]);const qa=["contributes","activationEvents","url"];const Va=new Set(["sourcegraph/code-stats-insights","sourcegraph/search-insights"]);function $a(e,t){if(!cn(e.subjects)&&e.subjects){const r=e.subjects.find((e=>e.subject.__typename===t));var n;if(r&&!cn(r.settings))return null===(n=r.settings)||void 0===n?void 0:n.extensions}}new Set(["sourcegraph/code-stats-insights","sourcegraph/search-insights"]);new Map;Error;const za=1,Ha=2,Ga=3,Qa=4,Wa=5;var Ka=n(19373),Za=n.n(Ka);function Ya(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ja={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const Xa=/[&<>"']/,es=/[&<>"']/g,ts=/[<>"']|&(?!#?\w+;)/,ns=/[<>"']|&(?!#?\w+;)/g,rs={"&":"&","<":"<",">":">",'"':""","'":"'"},os=e=>rs[e];function is(e,t){if(t){if(Xa.test(e))return e.replace(es,os)}else if(ts.test(e))return e.replace(ns,os);return e}const as=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function ss(e){return e.replace(as,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const cs=/(^|[^\[])\^/g;function ls(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(cs,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const us=/[^\w:]/g,fs=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ps(e,t,n){if(e){let e;try{e=decodeURIComponent(ss(n)).replace(us,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!fs.test(n)&&(n=function(e,t){ds[" "+e]||(hs.test(e)?ds[" "+e]=e+"/":ds[" "+e]=ws(e,"/",!0));const n=-1===(e=ds[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(ms,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(gs,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const ds={},hs=/^[^:]+:\/*[^/]*$/,ms=/^([^:]+:)[\s\S]*$/,gs=/^([^:]+:\/*[^/]*)[\s\S]*$/;const vs={exec:function(){}};function bs(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function ys(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n[n.length-1].trim()||n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function ws(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.substr(0,r-o)}function Es(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function _s(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function xs(e,t,n,r){const o=t.href,i=t.title?is(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a,[])};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:is(a)}}class Ss{constructor(e){this.options=e||Ja}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ws(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ws(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,a,s,c,l,u,f,p=t[1].trim();const d=p.length>1,h={type:"list",raw:"",ordered:d,start:d?+p.slice(0,-1):"",loose:!1,items:[]};p=d?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=d?p:"[*+-]");const m=new RegExp(`^( {0,3}${p})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;e&&!this.rules.block.hr.test(e)&&(t=m.exec(e));){u=t[2].split("\n"),this.options.pedantic?(i=2,f=u[0].trimLeft()):(i=t[2].search(/[^ ]/),i=t[1].length+(i>4?1:i),f=u[0].slice(i-t[1].length)),s=!1,n=t[0],!u[0]&&/^ *$/.test(u[1])&&(n=t[1]+u.slice(0,2).join("\n")+"\n",h.loose=!0,u=[]);const p=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(a=1;a<u.length;a++){if(l=u[a],this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),p.test(l)){n=t[1]+u.slice(0,a).join("\n")+"\n";break}if(s){if(!(l.search(/[^ ]/)>=i)&&l.trim()){n=t[1]+u.slice(0,a).join("\n")+"\n";break}f+="\n"+l.slice(i)}else l.trim()||(s=!0),l.search(/[^ ]/)>=i?f+="\n"+l.slice(i):f+="\n"+l}h.loose||(c?h.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(f),r&&(o="[ ] "!==r[0],f=f.replace(/^\[[ xX]\] +/,""))),h.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:f}),h.raw+=n,e=e.slice(n.length)}h.items[h.items.length-1].raw=n.trimRight(),h.items[h.items.length-1].text=f.trimRight(),h.raw=h.raw.trimRight();const g=h.items.length;for(a=0;a<g;a++)this.lexer.state.top=!1,h.items[a].tokens=this.lexer.blockTokens(h.items[a].text,[]),h.items[a].tokens.some((e=>"space"===e.type))&&(h.loose=!0,h.items[a].loose=!0);return h}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):is(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:ys(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,a=e.align.length;for(n=0;n<a;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(a=e.rows.length,n=0;n<a;n++)e.rows[n]=ys(e.rows[n],e.header.length).map((e=>({text:e})));for(a=e.header.length,r=0;r<a;r++)e.header[r].tokens=[],this.lexer.inlineTokens(e.header[r].text,e.header[r].tokens);for(a=e.rows.length,r=0;r<a;r++)for(i=e.rows[r],o=0;o<i.length;o++)i[o].tokens=[],this.lexer.inlineTokens(i[o].text,i[o].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:is(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):is(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=ws(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if("\\"===e[o])o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),xs(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return xs(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let o,i,a=n,s=0;const c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=c.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){s+=i;continue}if(a-=i,a>0)continue;if(i=Math.min(i,i+a+s),Math.min(n,i)%2){const t=e.slice(1,n+r.index+i);return{type:"em",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+r.index+i-1);return{type:"strong",raw:e.slice(0,n+r.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=is(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=is(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=is(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=is(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=is(n[0]),r="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):is(n[0]):n[0]:is(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Os={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:vs,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Os.def=ls(Os.def).replace("label",Os._label).replace("title",Os._title).getRegex(),Os.bullet=/(?:[*+-]|\d{1,9}[.)])/,Os.listItemStart=ls(/^( *)(bull) */).replace("bull",Os.bullet).getRegex(),Os.list=ls(Os.list).replace(/bull/g,Os.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Os.def.source+")").getRegex(),Os._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Os._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Os.html=ls(Os.html,"i").replace("comment",Os._comment).replace("tag",Os._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Os.paragraph=ls(Os._paragraph).replace("hr",Os.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Os._tag).getRegex(),Os.blockquote=ls(Os.blockquote).replace("paragraph",Os.paragraph).getRegex(),Os.normal=bs({},Os),Os.gfm=bs({},Os.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Os.gfm.table=ls(Os.gfm.table).replace("hr",Os.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Os._tag).getRegex(),Os.pedantic=bs({},Os.normal,{html:ls("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Os._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vs,paragraph:ls(Os.normal._paragraph).replace("hr",Os.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Os.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const Ts={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:vs,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:vs,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function Cs(e){return e.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026")}function ks(e){let t,n,r="";const o=e.length;for(t=0;t<o;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}Ts._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Ts.punctuation=ls(Ts.punctuation).replace(/punctuation/g,Ts._punctuation).getRegex(),Ts.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Ts.escapedEmSt=/\\\*|\\_/g,Ts._comment=ls(Os._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ts.emStrong.lDelim=ls(Ts.emStrong.lDelim).replace(/punct/g,Ts._punctuation).getRegex(),Ts.emStrong.rDelimAst=ls(Ts.emStrong.rDelimAst,"g").replace(/punct/g,Ts._punctuation).getRegex(),Ts.emStrong.rDelimUnd=ls(Ts.emStrong.rDelimUnd,"g").replace(/punct/g,Ts._punctuation).getRegex(),Ts._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ts._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ts._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ts.autolink=ls(Ts.autolink).replace("scheme",Ts._scheme).replace("email",Ts._email).getRegex(),Ts._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ts.tag=ls(Ts.tag).replace("comment",Ts._comment).replace("attribute",Ts._attribute).getRegex(),Ts._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ts._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ts._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ts.link=ls(Ts.link).replace("label",Ts._label).replace("href",Ts._href).replace("title",Ts._title).getRegex(),Ts.reflink=ls(Ts.reflink).replace("label",Ts._label).getRegex(),Ts.reflinkSearch=ls(Ts.reflinkSearch,"g").replace("reflink",Ts.reflink).replace("nolink",Ts.nolink).getRegex(),Ts.normal=bs({},Ts),Ts.pedantic=bs({},Ts.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ls(/^!?\[(label)\]\((.*?)\)/).replace("label",Ts._label).getRegex(),reflink:ls(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ts._label).getRegex()}),Ts.gfm=bs({},Ts.normal,{escape:ls(Ts.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Ts.gfm.url=ls(Ts.gfm.url,"i").replace("email",Ts.gfm._extended_email).getRegex(),Ts.breaks=bs({},Ts.gfm,{br:ls(Ts.br).replace("{2,}","*").getRegex(),text:ls(Ts.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class Ns{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ja,this.options.tokenizer=this.options.tokenizer||new Ss,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Os.normal,inline:Ts.normal};this.options.pedantic?(t.block=Os.pedantic,t.inline=Ts.pedantic):this.options.gfm&&(t.block=Os.gfm,this.options.breaks?t.inline=Ts.breaks:t.inline=Ts.gfm),this.tokenizer.rules=t}static get rules(){return{block:Os,inline:Ts}}static lex(e,t){return new Ns(t).lex(e)}static lexInline(e,t){return new Ns(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),n.type&&t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,r,o,i,a,s,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,i.index)+"["+_s("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,i.index)+"["+_s("a",i[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,i.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(s=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,s))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,ks))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,ks))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o,Cs))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(s=n.raw.slice(-1)),a=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class As{constructor(e){this.options=e||Ja}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+is(r,!0)+'">'+(n?e:is(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:is(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=ps(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+is(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){if(null===(e=ps(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class Is{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Ps{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class Rs{constructor(e){this.options=e||Ja,this.options.renderer=this.options.renderer||new As,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Is,this.slugger=new Ps}static parse(e,t){return new Rs(t).parse(e)}static parseInline(e,t){return new Rs(t).parseInline(e)}parse(e,t=!0){let n,r,o,i,a,s,c,l,u,f,p,d,h,m,g,v,b,y,w,E="";const _=e.length;for(n=0;n<_;n++)if(f=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]&&(w=this.options.extensions.renderers[f.type].call({parser:this},f),!1!==w||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(f.type)))E+=w||"";else switch(f.type){case"space":continue;case"hr":E+=this.renderer.hr();continue;case"heading":E+=this.renderer.heading(this.parseInline(f.tokens),f.depth,ss(this.parseInline(f.tokens,this.textRenderer)),this.slugger);continue;case"code":E+=this.renderer.code(f.text,f.lang,f.escaped);continue;case"table":for(l="",c="",i=f.header.length,r=0;r<i;r++)c+=this.renderer.tablecell(this.parseInline(f.header[r].tokens),{header:!0,align:f.align[r]});for(l+=this.renderer.tablerow(c),u="",i=f.rows.length,r=0;r<i;r++){for(s=f.rows[r],c="",a=s.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(s[o].tokens),{header:!1,align:f.align[o]});u+=this.renderer.tablerow(c)}E+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(f.tokens),E+=this.renderer.blockquote(u);continue;case"list":for(p=f.ordered,d=f.start,h=f.loose,i=f.items.length,u="",r=0;r<i;r++)g=f.items[r],v=g.checked,b=g.task,m="",g.task&&(y=this.renderer.checkbox(v),h?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=y+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,b,v);E+=this.renderer.list(u,p,d);continue;case"html":E+=this.renderer.html(f.text);continue;case"paragraph":E+=this.renderer.paragraph(this.parseInline(f.tokens));continue;case"text":for(u=f.tokens?this.parseInline(f.tokens):f.text;n+1<_&&"text"===e[n+1].type;)f=e[++n],u+="\n"+(f.tokens?this.parseInline(f.tokens):f.text);E+=t?this.renderer.paragraph(u):u;continue;default:{const e='Token with "'+f.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return E}parseInline(e,t){t=t||this.renderer;let n,r,o,i="";const a=e.length;for(n=0;n<a;n++)if(r=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(o=this.options.extensions.renderers[r.type].call({parser:this},r),!1!==o||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)))i+=o||"";else switch(r.type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}function Ds(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),Es(t=bs({},Ds.defaults,t||{})),n){const r=t.highlight;let o;try{o=Ns.lex(e,t)}catch(e){return n(e)}const i=function(e){let i;if(!e)try{t.walkTokens&&Ds.walkTokens(o,t.walkTokens),i=Rs.parse(o,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,i)};if(!r||r.length<3)return i();if(delete t.highlight,!o.length)return i();let a=0;return Ds.walkTokens(o,(function(e){"code"===e.type&&(a++,setTimeout((()=>{r(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),a--,0===a&&i()}))}),0))})),void(0===a&&i())}try{const n=Ns.lex(e,t);return t.walkTokens&&Ds.walkTokens(n,t.walkTokens),Rs.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+is(e.message+"",!0)+"</pre>";throw e}}Ds.options=Ds.setOptions=function(e){var t;return bs(Ds.defaults,e),t=Ds.defaults,Ja=t,Ds},Ds.getDefaults=Ya,Ds.defaults=Ja,Ds.use=function(...e){const t=bs({},...e),n=Ds.defaults.extensions||{renderers:{},childTokens:{}};let r;e.forEach((e=>{if(e.extensions&&(r=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let r=e.renderer.apply(this,n);return!1===r&&(r=t.apply(this,n)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=Ds.defaults.renderer||new As;for(const t in e.renderer){const r=n[t];n[t]=(...o)=>{let i=e.renderer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.renderer=n}if(e.tokenizer){const n=Ds.defaults.tokenizer||new Ss;for(const t in e.tokenizer){const r=n[t];n[t]=(...o)=>{let i=e.tokenizer[t].apply(n,o);return!1===i&&(i=r.apply(n,o)),i}}t.tokenizer=n}if(e.walkTokens){const n=Ds.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}r&&(t.extensions=n),Ds.setOptions(t)}))},Ds.walkTokens=function(e,t){for(const n of e)switch(t.call(Ds,n),n.type){case"table":for(const e of n.header)Ds.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)Ds.walkTokens(n.tokens,t);break;case"list":Ds.walkTokens(n.items,t);break;default:Ds.defaults.extensions&&Ds.defaults.extensions.childTokens&&Ds.defaults.extensions.childTokens[n.type]?Ds.defaults.extensions.childTokens[n.type].forEach((function(e){Ds.walkTokens(n[e],t)})):n.tokens&&Ds.walkTokens(n.tokens,t)}},Ds.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");Es(t=bs({},Ds.defaults,t||{}));try{const n=Ns.lexInline(e,t);return t.walkTokens&&Ds.walkTokens(n,t.walkTokens),Rs.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+is(e.message+"",!0)+"</pre>";throw e}},Ds.Parser=Rs,Ds.parser=Rs.parse,Ds.Renderer=As,Ds.TextRenderer=Is,Ds.Lexer=Ns,Ds.lexer=Ns.lex,Ds.Tokenizer=Ss,Ds.Slugger=Ps,Ds.parse=Ds;Ds.options,Ds.setOptions,Ds.use,Ds.walkTokens,Ds.parseInline,Rs.parse,Ns.lex;var Ls=n(95327),Ms=n.n(Ls);const js=e=>{const t=document.createElement("span");return t.textContent=e,t.innerHTML},Fs=["fill","stroke","stroke-width"],Bs=[/.*/],Us=(e,t={})=>{const n=Ds(e,{gfm:!0,breaks:t.breaks,sanitize:!1,highlight:(e,t)=>((e,t)=>{try{return"plaintext"===t||"text"===t?js(e):"sourcegraph"===t?e:t?(0,zn.highlight)(e,{language:t,ignoreIllegals:!0}).value:(0,zn.highlightAuto)(e).value}catch(t){return console.warn("Error syntax-highlighting hover markdown code block",t),js(e)}})(e,t)});let r;return t.plainText?r={...Ms().defaults,allowedAttributes:{},allowedSchemes:[],allowedSchemesByTag:{},allowedTags:[],selfClosing:[]}:(r={...Ms().defaults,exclusiveFilter:({tag:e,attribs:t})=>"object"===e&&!t.type,allowedTags:[...Za()(Ms().defaults.allowedTags,"iframe"),"img","picture","source","object","svg","rect","defs","pattern","mask","circle","path","title"],allowedAttributes:{...Ms().defaults.allowedAttributes,a:[...Ms().defaults.allowedAttributes.a,"title","data-tooltip","class",{name:"rel",values:["noopener","noreferrer"]}],img:[...Ms().defaults.allowedAttributes.img,"alt","width","height","align","style"],source:["srcset","media"],object:["data",{name:"type",values:["image/svg+xml"]},"width"],svg:["width","height","viewbox","version","preserveaspectratio","style"],rect:["x","y","width","height","transform",...Fs],path:["d",...Fs],circle:["cx","cy",...Fs],pattern:["id","width","height","patternunits","patterntransform"],mask:["id"],span:["class"],code:["class"],h1:["id"],h2:["id"],h3:["id"],h4:["id"],h5:["id"],h6:["id"]},allowedStyles:{img:{padding:Bs,"padding-left":Bs,"padding-right":Bs,"padding-top":Bs,"padding-bottom":Bs},svg:{flex:Bs,"flex-grow":Bs,"flex-shrink":Bs,"flex-basis":Bs}}},t.allowDataUriLinksAndDownloads&&(r.allowedAttributes.a=[...r.allowedAttributes.a,"download"],r.allowedSchemesByTag={...r.allowedSchemesByTag,a:[...r.allowedSchemesByTag.a||r.allowedSchemes,"data"]})),Ms()(n,r)},qs={alert:"Alert-module__alert_2l0FA",btn:"Alert-module__btn_39eQm","alert-primary":"Alert-module__alert-primary_rR3d-",alertPrimary:"Alert-module__alert-primary_rR3d-","alert-secondary":"Alert-module__alert-secondary_7Nezz",alertSecondary:"Alert-module__alert-secondary_7Nezz","alert-success":"Alert-module__alert-success_8LLu6",alertSuccess:"Alert-module__alert-success_8LLu6","alert-danger":"Alert-module__alert-danger_Dz5VZ",alertDanger:"Alert-module__alert-danger_Dz5VZ","alert-warning":"Alert-module__alert-warning_2-06D",alertWarning:"Alert-module__alert-warning_2-06D","alert-info":"Alert-module__alert-info_HKUsm",alertInfo:"Alert-module__alert-info_HKUsm","alert-merged":"Alert-module__alert-merged_3H9Zn",alertMerged:"Alert-module__alert-merged_3H9Zn","alert-note":"Alert-module__alert-note_1lOBN",alertNote:"Alert-module__alert-note_1lOBN","alert-waiting":"Alert-module__alert-waiting_ym1Xw",alertWaiting:"Alert-module__alert-waiting_ym1Xw"};function Vs(){return(Vs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const $s=t.forwardRef((({children:e,as:n="div",variant:r,className:o,...a},s)=>{const{isBranded:l}=c(),u=l&&i()(qs.alert,r&&(({variant:e})=>i()(qs[`alert${wr()(e)}`]))({variant:r}));return t.createElement(n,Vs({ref:s,className:i()(u,o)},a),e)})),zs="HoverOverlay-module__hover-overlay_GnQ4U",Hs="HoverOverlay-module__card_3Y1Qk",Gs="HoverOverlay-module__badge_1yHRL",Qs="HoverOverlay-module__badge-label_14ax7",Ws="HoverOverlay-module__alert_1VfF7",Ks="HoverOverlay-module__hover-overlay__content_1qzcX",Zs="HoverOverlay-module__alert-dismiss_1DJhV",Ys="HoverOverlay-module__actions_3k7B1",Js="HoverOverlay-module__actions-inner_1A944",Xs="HoverOverlay-module__action_3jCN1",ec="HoverOverlay-module__overlay-logo_37n_Z",tc="HoverOverlay-module__loader-row_2ZOSL",nc="HoverOverlay-module__hover-error_VUMQ7",rc="HoverOverlay-module__hover-empty_Nzw5p",oc="HoverOverlayContent-module__hover-overlay__content_2RDwm",ic="HoverOverlayAlerts-module__hover-overlay__alerts_2cAta",ac={info:Ga,warning:Ha,error:za},sc=e=>{const{hoverAlerts:n,onAlertDismissed:o,getAlertClassName:a,getAlertVariant:s}=e;return t.createElement("div",{className:i()(ic,e.className)},n.map((({summary:e,iconKind:n,type:c},l)=>{return t.createElement($s,{key:l,variant:null==s?void 0:s(n?ac[n]:Ga),className:i()(Ws,null==a?void 0:a(n?ac[n]:Ga))},"plaintext"===e.kind?t.createElement("span",{"data-testid":"hover-overlay-content",className:i()(oc,Ks)},e.value):t.createElement("span",{"data-testid":"hover-overlay-content",className:i()(oc,Ks),dangerouslySetInnerHTML:{__html:Us(e.value)}}),c&&t.createElement("div",{className:i()(Zs)},t.createElement(r,{to:"",onClick:(u=c,e=>{e.preventDefault(),o&&o(u)}),role:"button"},t.createElement("small",null,"Dismiss"))));var u})))},cc={badge:"Badge-module__badge_3-NyA",focus:"Badge-module__focus_1GzbE",btn:"Badge-module__btn_3gy8e",pill:"Badge-module__pill_1tDDJ",sm:"Badge-module__sm_2Ucd0",primary:"Badge-module__primary_3Mnyp",secondary:"Badge-module__secondary_1aGWy",success:"Badge-module__success_Xk9YR",danger:"Badge-module__danger_3C1__",info:"Badge-module__info_1nStF",warning:"Badge-module__warning_TvoOc",merged:"Badge-module__merged_nmYys","outline-secondary":"Badge-module__outline-secondary_391TE",outlineSecondary:"Badge-module__outline-secondary_391TE"};function lc(){return(lc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const uc=({children:e,variant:n,small:o,pill:a,tooltip:s,className:l,href:u,as:f="span",...p})=>{const{isBranded:d}=c(),h=d&&i()(cc.badge,n&&cc[n],o&&cc.sm,a&&cc.pill),m={"data-tooltip":s,className:i()(h,l),...p};return u?t.createElement(r,lc({to:u,rel:"noopener",target:"_blank"},m),e):t.createElement(f,m,e)},fc="HoverOverlayContents-module__hover-overlay__contents_2f8kl",pc="HoverOverlayContents-module__hover-overlay__contents--loading_NaOl_",dc="HoverOverlayContents-module__hover-overlay__content_3L2yD";const hc=e=>{const{content:n,aggregatedBadges:r=[],index:o,errorAlertClassName:a,errorAlertVariant:s,badgeClassName:c}=e;if("markdown"!==n.kind)return t.createElement("span",{"data-testid":"hover-overlay-content",className:i()(oc,dc)},t.createElement("p",null,n.value));const l=function(e){try{return Us(e)}catch(e){return ln(e)}}(n.value);return l instanceof Error?t.createElement($s,{className:i()(nc,a),variant:s},wr()(l.message)):t.createElement(t.Fragment,null,0!==o&&t.createElement("hr",null),r.map((({text:e,linkURL:n,hoverMessage:r})=>t.createElement("small",{key:e,className:i()(Gs)},t.createElement(uc,{variant:"secondary",small:!0,className:i()("test-hover-badge",c,Qs),href:n,tooltip:r},e)))),t.createElement("span",{"data-testid":"hover-overlay-content",className:i()(oc,dc,e.contentClassName,"test-tooltip-content"),dangerouslySetInnerHTML:{__html:l}}))},mc=e=>{var n;const{hoverOrError:r,iconClassName:o,errorAlertClassName:a,errorAlertVariant:s,badgeClassName:c,contentClassName:l}=e;return"loading"===r?t.createElement("div",{className:i()(tc)},t.createElement(Pr,{inline:!1,className:o})):cn(r)?t.createElement($s,{className:i()(a,nc),variant:s},wr()(r.message)):void 0===r?null:null===r||0===r.contents.length&&null!==(n=r.alerts)&&void 0!==n&&n.length?t.createElement("small",{className:i()(rc)},"No hover information available."):t.createElement(t.Fragment,null,r.contents.map(((e,n)=>t.createElement(hc,{key:n,index:n,content:e,aggregatedBadges:r.aggregatedBadges,errorAlertClassName:a,errorAlertVariant:s,badgeClassName:c,contentClassName:l}))))};function gc(){return(gc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const vc=e=>t.createElement("svg",gc({viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t.createElement("path",{d:"M30.8 51.8c-2.8.5-5.5-1.3-6-4.1L17.2 6.2c-.5-2.8 1.3-5.5 4.1-6s5.5 1.3 6 4.1l7.6 41.5c.5 2.8-1.4 5.5-4.1 6z",fill:"#FF5543"}),t.createElement("path",{d:"M10.9 44.7C9.1 45 7.3 44.4 6 43c-1.8-2.2-1.6-5.4.6-7.2L38.7 8.5c2.2-1.8 5.4-1.6 7.2.6 1.8 2.2 1.6 5.4-.6 7.2l-32 27.3c-.7.6-1.6 1-2.4 1.1z",fill:"#A112FF"}),t.createElement("path",{d:"M46.8 38.1c-.9.2-1.8.1-2.6-.2L4.4 23.8c-2.7-1-4.1-3.9-3.1-6.6 1-2.7 3.9-4.1 6.6-3.1l39.7 14.1c2.7 1 4.1 3.9 3.1 6.6-.6 1.8-2.2 3-3.9 3.3z",fill:"#00CBEC"})),bc="HoverOverlayLogo-module__container_miAfr",yc="HoverOverlayLogo-module__icon_1L74h",wc=({className:e})=>t.createElement("span",{className:i()(bc,e)},t.createElement(vc,{className:yc})),Ec=({hoveredToken:e,hoverOrError:t,actionsOrError:n})=>!e||(!t||"loading"===t||cn(t))&&(!n||"loading"===n||cn(n));function _c(){return(_c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const xc="loading",Sc=e=>e?{opacity:1,visibility:"visible",left:`${e.left}px`,top:`${e.top}px`}:{opacity:0,visibility:"hidden"},Oc=e=>{const{hoverOrError:n,hoverRef:r,overlayPosition:o,actionsOrError:a,platformContext:s,telemetryService:c,extensionsController:l,location:u,className:f,iconClassName:p,badgeClassName:d,actionItemClassName:h,actionItemPressedClassName:m,contentClassName:g,actionItemStyleProps:v,getAlertClassName:b,getAlertVariant:y,onAlertDismissed:w,useBrandedLogo:E}=e;return function(e){const{telemetryService:n,hoveredToken:r}=e,o=(0,t.useRef)(e),i=()=>n.log("hover");(0,t.useEffect)((()=>i()),[]),Ec(e)||Ot()(r,o.current.hoveredToken)&&!Ec(o.current)||i(),o.current=e}(e),n||a&&!cn(a)?t.createElement(Ca,{"data-testid":"hover-overlay",style:Sc(o),className:i()(Hs,zs,f),ref:r},t.createElement("div",{"data-testid":"hover-overlay-contents",className:i()(fc,n===xc&&pc)},t.createElement(mc,{hoverOrError:n,iconClassName:p,badgeClassName:d,errorAlertClassName:null==b?void 0:b(za),errorAlertVariant:null==y?void 0:y(za),contentClassName:g})),n&&n!==xc&&!cn(n)&&n.alerts&&n.alerts.length>0&&t.createElement(sc,{hoverAlerts:n.alerts,iconClassName:p,getAlertClassName:b,getAlertVariant:y,onAlertDismissed:w}),null!=a&&a!==xc&&!cn(a)&&a.length>0&&t.createElement("div",{className:Ys},t.createElement("div",{className:Js},a.map(((e,n)=>{return t.createElement(yo,_c({key:n},e,{className:i()(Xs,h,`test-tooltip-${r=e.action.title||"untitled",r.replace(/[^A-Za-z]/g,"-").toLowerCase()}`),iconClassName:p,pressedClassName:m,variant:"actionItem",disabledDuringExecution:!0,showLoadingSpinnerDuringExecution:!0,showInlineError:!0,platformContext:s,telemetryService:c,extensionsController:l,location:u,actionItemStyleProps:v}));var r}))),E&&t.createElement(wc,{className:ec}))):null},Tc=(e,t)=>{const n=new URL(e);for(const[e,r]of Object.entries(t))n.searchParams.set(e,r);return n};var Cc,kc;!function(e){e[e.Extension=0]="Extension",e[e.Page=1]="Page"}(Cc||(Cc={})),function(e){e[e.Content=0]="Content",e[e.Background=1]="Background",e[e.Options=2]="Options"}(kc||(kc={}));const Nc=function(){const e="EXTENSION"===window.SG_ENV?Cc.Extension:Cc.Page;let t=kc.Content;return e===Cc.Extension&&(window.location.pathname.includes("options.html")?t=kc.Options:globalThis.browser&&browser.runtime.getBackgroundPage&&(t=kc.Background)),{appEnvironment:e,scriptEnvironment:t}}(),Ac=Nc.scriptEnvironment===kc.Background,Ic=(Nc.scriptEnvironment,kc.Options,Nc.appEnvironment===Cc.Extension),Pc=!Ic,Rc=(Boolean(document.querySelector(".phabricator-wordmark")),e=>t=>{if(Ac)throw new Error("Tried to call background page function from background page itself");if(Pc)throw new Error("Tried to call background page function from in-page integration");return browser.runtime.sendMessage({type:e,payload:t})}),Dc={createBlobURL:Rc("createBlobURL"),openOptionsPage:Rc("openOptionsPage"),requestGraphQL:Rc("requestGraphQL"),notifyRepoSyncError:Rc("notifyRepoSyncError"),checkRepoSyncError:Rc("checkRepoSyncError"),fetchCache:Rc("fetchCache")};function Lc(){return window.navigator.userAgent.includes("Firefox")}const Mc="https://sourcegraph.com";function jc(e){return e?Vc("sync","sourcegraphURL").pipe(H((e=>e||Mc))):z(window.SOURCEGRAPH_URL||window.localStorage.getItem("SOURCEGRAPH_URL")||Mc)}function Fc(){return window.SOURCEGRAPH_PHABRICATOR_EXTENSION?"phabricator-integration":window.SOURCEGRAPH_INTEGRATION?window.SOURCEGRAPH_INTEGRATION:window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")?"safari-extension":Lc()?"firefox-extension":"chrome-extension"}function Bc(){if(globalThis.browser){return browser.runtime.getManifest().version}return"NO_VERSION"}function Uc(e){return(null==e?void 0:e.replace(/\/$/,""))===Mc}const qc=globalThis.browser&&browser.storage,Vc=(e,t)=>{return"chrome-extension"!==Fc()&&"managed"===e?z(void 0):le(ee(qc[e].get(t)).pipe(H((e=>e[t]))),(n=qc.onChanged,new B((e=>{const t=(...t)=>e.next(t);try{n.addListener(t)}catch(t){return void e.error(t)}return()=>n.removeListener(t)}))).pipe(qe((([,t])=>e===t)),H((([e])=>e)),qe((e=>Object.prototype.hasOwnProperty.call(e,t))),H((e=>e[t].newValue))));var n},$c=e=>({textDocument:{uri:ya(e)},position:{character:e.position.character-1,line:e.position.line-1}});var zc=Object.prototype.hasOwnProperty;function Hc(e,t,n){for(n of e.keys())if(Gc(n,t))return n}function Gc(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Gc(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((o=r)&&"object"==typeof o&&!(o=Hc(t,o)))return!1;if(!t.has(o))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((o=r[0])&&"object"==typeof o&&!(o=Hc(t,o)))return!1;if(!Gc(r[1],t.get(o)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(zc.call(e,n)&&++r&&!zc.call(t,n))return!1;if(!(n in t)||!Gc(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function Qc(e){var n=(0,t.useRef)(),r=(0,t.useRef)(0);return Gc(e,n.current)||(n.current=e,r.current+=1),[r.current]}function Wc(e,n){return(0,t.useEffect)(e,Qc(n))}function Kc(e){const[n,r]=(0,t.useState)(),[o,i]=(0,t.useState)();if((0,t.useEffect)((()=>{i(void 0);const t=e.subscribe({next:i,error:r});return()=>t.unsubscribe()}),[e]),n)throw n;return o}const Zc="ActionsNavItems-module__action-item_3JYz6";function Yc(){return(Yc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const Jc=e=>{const{scope:n,extraContext:r,extensionsController:o,menu:a,wrapInList:s,transformContributions:c=Na()}=e,l=(0,t.useMemo)((()=>new Ro(1)),[]);Wc((()=>{l.next(n)}),[n]);const u=(0,t.useMemo)((()=>new Ro(1)),[]);Wc((()=>{u.next(r)}),[r]);const f=Kc((0,t.useMemo)((()=>Oe([l,u,ee(o.extHostAPI)]).pipe(ze((([e,t,n])=>Xr(n.getContributions({scope:e,extraContext:t})))),H(c))),[l,u,o,c])),p=(0,t.useRef)(null);return f?(p.current=Vo(f,a).map((n=>t.createElement(t.Fragment,{key:n.action.id}," ",t.createElement("li",{className:e.listItemClass},t.createElement(yo,Yc({key:n.action.id},n,e,{variant:"actionItem",iconClassName:e.actionItemIconClass,className:i()(Zc,e.actionItemClass),pressedClassName:e.actionItemPressedClass,actionItemStyleProps:e.actionItemStyleProps})))))),s?p.current.length>0?t.createElement("ul",{className:e.listClass},p.current):null:t.createElement(t.Fragment,null,p.current)):t.createElement(t.Fragment,null,p.current)};function Xc(e,t){var n;return void 0===e&&(e=0),void 0===t&&(t=je),(p(n=e)||!(n-parseFloat(n)+1>=0)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=je),new B((function(n){return n.add(t.schedule(el,e,{subscriber:n,counter:0,period:e})),n}))}function el(e){var t=e.subscriber,n=e.counter,r=e.period;t.next(n),this.schedule({subscriber:t,counter:n+1,period:r},r)}const tl=({iconClassName:e,label:n,ariaLabel:o,className:i,href:a,onClick:s,rel:c,target:l,title:u,dataTestId:f})=>t.createElement(r,{to:null!=a?a:"",className:i,target:null!=l?l:"_blank",rel:null!=c?c:"noopener noreferrer",title:u,"aria-label":o,onClick:s,"data-testid":f},t.createElement(vc,{className:e})," ",n),nl=({className:e,iconClassName:n,sourcegraphURL:r,onSignInClose:o})=>{const i=Tc(new URL("/sign-in?close=true",r),{utm_source:Fc(),utm_campaign:"sign-in-button"}).href,[a]=function(e){const n=(0,t.useMemo)((()=>new ye),[]),r=(0,t.useMemo)((()=>n.pipe(e)),[n,e]);return[(0,t.useMemo)((()=>n.next.bind(n)),[n]),Kc(r)]}((0,t.useCallback)((e=>e.pipe(ze((e=>{const t=window.open(i,"_blank");return t?(e.preventDefault(),Xc(300).pipe(qe((()=>t.closed)),Ye(1))):[]})),tt(o))),[o,i]));return t.createElement(tl,{href:i,label:"Sign in to Sourcegraph",title:"Sign into Sourcegraph to get hover tooltips, go to definition and more",ariaLabel:"Sign into Sourcegraph to get hover tooltips, go to definition and more",className:e,iconClassName:n,onClick:a})};function rl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return"function"==typeof n&&e.pop(),$(e,void 0).lift(new ol(n))}var ol=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new il(e,this.resultSelector))},e}(),il=function(e){function t(t,n,r){void 0===r&&(r=Object.create(null));var o=e.call(this,t)||this;return o.resultSelector=n,o.iterators=[],o.active=0,o.resultSelector="function"==typeof n?n:void 0,o}return w(t,e),t.prototype._next=function(e){var t=this.iterators;p(e)?t.push(new sl(e)):"function"==typeof e[K]?t.push(new al(e[K]())):t.push(new cl(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0!==t){this.active=t;for(var n=0;n<t;n++){var r=e[n];if(r.stillUnsubscribed)this.destination.add(r.subscribe());else this.active--}}else this.destination.complete()},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,n=this.destination,r=0;r<t;r++){if("function"==typeof(a=e[r]).hasValue&&!a.hasValue())return}var o=!1,i=[];for(r=0;r<t;r++){var a,s=(a=e[r]).next();if(a.hasCompleted()&&(o=!0),s.done)return void n.complete();i.push(s.value)}this.resultSelector?this._tryresultSelector(i):n.next(i),o&&n.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(D),al=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return Boolean(e&&e.done)},e}(),sl=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[K]=function(){return this},e.prototype.next=function(e){var t=this.index++,n=this.array;return t<this.length?{value:n[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),cl=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.parent=n,o.observable=r,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return w(t,e),t.prototype[K]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return re(this.observable,new te(this))},t}(ne);class ll extends Error{}class ul extends Error{}const fl=jo((({rawRepoName:e,requestGraphQL:t})=>t({request:fr`
|
|
12
12
|
query ResolveRepo($rawRepoName: String!) {
|
|
13
13
|
repository(name: $rawRepoName) {
|
|
14
14
|
name
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
newPath
|
|
74
74
|
internalID
|
|
75
75
|
}
|
|
76
|
-
`,variables:{repo:t.repo,base:t.base,head:t.head,first:null!==(n=t.first)&&void 0!==n?n:null},mightContainPrivateInfo:!0}).pipe(H(pr),H((({repository:e})=>{if(!e)throw new So(t.repo);if(!e.comparison||!e.comparison.fileDiffs)throw new Error("empty fileDiffs");return e.comparison.fileDiffs})))}),(({repo:e,base:t,head:n,first:r})=>`${e}:${String(t)}:${String(n)}:${String(r)}`));function yl(){return(yl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}class wl extends t.Component{subscriptions=new g;componentUpdates=new ye;constructor(e){super(e),this.state={fileDiff:void 0}}componentDidMount(){const{requestGraphQL:e}=this.props.platformContext;this.subscriptions.add(this.componentUpdates.pipe(ze((t=>bl({repo:this.props.openProps.repoName,base:this.props.openProps.commit.baseRev,head:this.props.openProps.commit.headRev,requestGraphQL:e}).pipe(H((e=>({...e,nodes:e.nodes.filter((e=>e.oldPath===this.props.openProps.filePath))}))),st((e=>(console.error(e),[void 0]))))))).subscribe((e=>{this.setState({fileDiff:e})}))),this.componentUpdates.next(this.props)}componentWillUnmount(){this.subscriptions.unsubscribe()}render(){const e=this.getOpenInSourcegraphUrl(this.props.openProps);return t.createElement(tl,yl({},this.props,{className:i()("open-on-sourcegraph",this.props.className),dataTestId:"open-on-sourcegraph",href:e}))}getOpenInSourcegraphUrl(e){const t=e.sourcegraphURL,n=Tc(new URL(`/${e.repoName}/-/compare/${e.commit.baseRev}...${e.commit.headRev}`,t),{utm_source:Fc(),utm_campaign:"open-diff-on-sourcegraph"}).href;if(this.state.fileDiff&&this.state.fileDiff.nodes.length>0){return`${n}${this.state.fileDiff.totalCount&&this.state.fileDiff.totalCount>25?`&first=${this.state.fileDiff.totalCount}`:""}#diff-${this.state.fileDiff.nodes[0].internalID}`}return n}}function El(){return(El=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const _l=({openProps:{sourcegraphURL:e,repoName:n,revision:r,filePath:o},className:a,...s})=>{const c=Tc(new URL(ma({repoName:n,revision:r,filePath:o}),e),{utm_source:Fc(),utm_campaign:"open-on-sourcegraph"});return t.createElement(tl,El({},s,{className:i()("open-on-sourcegraph",a),dataTestId:"open-on-sourcegraph",href:c.href}))},xl="CodeViewToolbar-module__code-view-toolbar_12_7s",Sl="CodeViewToolbar-module__item_Q45fy";function Ol(){return(Ol=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const Tl=e=>{var n,r,o,a,s,c,l,u,f,p,d,h,m,g;return t.createElement("ul",{className:i()(xl,e.className),"data-testid":"code-view-toolbar"},!e.hideActions&&t.createElement(Jc,Ol({},e,{listItemClass:i()(Sl,null!==(n=null===(r=e.buttonProps)||void 0===r?void 0:r.listItemClass)&&void 0!==n?n:e.listItemClass),actionItemClass:i()(null!==(o=null===(a=e.buttonProps)||void 0===a?void 0:a.actionItemClass)&&void 0!==o?o:e.actionItemClass),menu:Ao.EditorTitle,extensionsController:e.extensionsController,platformContext:e.platformContext,location:e.location,scope:e.scope}))," ",cn(e.fileInfoOrError)?lr(e.fileInfoOrError)?t.createElement(nl,{sourcegraphURL:e.sourcegraphURL,onSignInClose:e.onSignInClose,className:i()(null!==(s=null===(c=e.buttonProps)||void 0===c?void 0:c.actionItemClass)&&void 0!==s?s:e.actionItemClass),iconClassName:e.actionItemIconClass}):null:t.createElement(t.Fragment,null,!("blob"in e.fileInfoOrError)&&e.fileInfoOrError.head&&e.fileInfoOrError.base&&t.createElement("li",{className:i()(Sl,null!==(l=null===(u=e.buttonProps)||void 0===u?void 0:u.listItemClass)&&void 0!==l?l:e.listItemClass)},t.createElement(wl,{ariaLabel:"View file diff on Sourcegraph",platformContext:e.platformContext,className:i()(null!==(f=null===(p=e.buttonProps)||void 0===p?void 0:p.actionItemClass)&&void 0!==f?f:e.actionItemClass),iconClassName:e.actionItemIconClass,openProps:{sourcegraphURL:e.sourcegraphURL,repoName:e.fileInfoOrError.base.repoName,filePath:e.fileInfoOrError.base.filePath,revision:vl(e.fileInfoOrError.base).revision,commit:{baseRev:vl(e.fileInfoOrError.base).revision,headRev:vl(e.fileInfoOrError.head).revision}}}))," ","blob"in e.fileInfoOrError&&void 0!==e.fileInfoOrError.blob.content&&t.createElement("li",{className:i()(Sl,null!==(d=null===(h=e.buttonProps)||void 0===h?void 0:h.actionItemClass)&&void 0!==d?d:e.listItemClass)},t.createElement(_l,{ariaLabel:"View file on Sourcegraph",className:i()(null!==(m=null===(g=e.buttonProps)||void 0===g?void 0:g.actionItemClass)&&void 0!==m?m:e.actionItemClass),iconClassName:e.actionItemIconClass,openProps:{sourcegraphURL:e.sourcegraphURL,repoName:e.fileInfoOrError.blob.repoName,filePath:e.fileInfoOrError.blob.filePath,revision:vl(e.fileInfoOrError.blob).revision}}))))},Cl=({children:e,onClick:n,as:r="div"})=>{const o=(0,t.useCallback)((e=>{var t;"a"===(null===(t=e.target)||void 0===t?void 0:t.tagName.toLowerCase())&&n(e)}),[n]);return t.createElement(r,{onClick:o},e)},kl=({children:e,...n})=>t.createElement(s.Provider,{value:n},e);var Nl,Al=new Uint8Array(16);function Il(){if(!Nl&&!(Nl="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nl(Al)}const Pl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const Rl=function(e){return"string"==typeof e&&Pl.test(e)};for(var Dl=[],Ll=0;Ll<256;++Ll)Dl.push((Ll+256).toString(16).substr(1));const Ml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Dl[e[t+0]]+Dl[e[t+1]]+Dl[e[t+2]]+Dl[e[t+3]]+"-"+Dl[e[t+4]]+Dl[e[t+5]]+"-"+Dl[e[t+6]]+Dl[e[t+7]]+"-"+Dl[e[t+8]]+Dl[e[t+9]]+"-"+Dl[e[t+10]]+Dl[e[t+11]]+Dl[e[t+12]]+Dl[e[t+13]]+Dl[e[t+14]]+Dl[e[t+15]]).toLowerCase();if(!Rl(n))throw TypeError("Stringified UUID is invalid");return n};const jl=function(e,t,n){var r=(e=e||{}).random||(e.rng||Il)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Ml(r)},Fl="sourcegraphAnonymousUid";class Bl{subscription=new g;isEnabled=!1;constructor(e,t){this.innerTelemetryService=e,this.subscription.add(t.subscribe((e=>{this.isEnabled=e})))}log(e,t,n){setTimeout((()=>{this.isEnabled&&this.innerTelemetryService.log(e,t,n)}))}logViewEvent(e,t){setTimeout((()=>{this.isEnabled&&this.innerTelemetryService.logViewEvent(e,t)}))}logPageView(e,t,n){setTimeout((()=>{this.isEnabled&&this.innerTelemetryService.logPageView(e,t,n)}))}unsubscribe(){return this.isEnabled=!1,this.subscription.unsubscribe()}}class Ul{uid=null;platform=Fc();version=Bc();constructor(e,t){this.requestGraphQL=e,this.sourcegraphURL=t,this.getAnonUserID().catch(vr())}generateAnonUserID=()=>jl();async getAnonUserID(){if(this.uid)return this.uid;if(Pc){let e=localStorage.getItem(Fl);return null===e&&(e=this.generateAnonUserID(),localStorage.setItem(Fl,e)),this.uid=e,this.uid}let{sourcegraphAnonymousUid:e}=await qc.sync.get();return e||(e=this.generateAnonUserID(),await qc.sync.set({sourcegraphAnonymousUid:e})),this.uid=e,e}async logEvent(e,t,n,r){
|
|
76
|
+
`,variables:{repo:t.repo,base:t.base,head:t.head,first:null!==(n=t.first)&&void 0!==n?n:null},mightContainPrivateInfo:!0}).pipe(H(pr),H((({repository:e})=>{if(!e)throw new So(t.repo);if(!e.comparison||!e.comparison.fileDiffs)throw new Error("empty fileDiffs");return e.comparison.fileDiffs})))}),(({repo:e,base:t,head:n,first:r})=>`${e}:${String(t)}:${String(n)}:${String(r)}`));function yl(){return(yl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}class wl extends t.Component{subscriptions=new g;componentUpdates=new ye;constructor(e){super(e),this.state={fileDiff:void 0}}componentDidMount(){const{requestGraphQL:e}=this.props.platformContext;this.subscriptions.add(this.componentUpdates.pipe(ze((t=>bl({repo:this.props.openProps.repoName,base:this.props.openProps.commit.baseRev,head:this.props.openProps.commit.headRev,requestGraphQL:e}).pipe(H((e=>({...e,nodes:e.nodes.filter((e=>e.oldPath===this.props.openProps.filePath))}))),st((e=>(console.error(e),[void 0]))))))).subscribe((e=>{this.setState({fileDiff:e})}))),this.componentUpdates.next(this.props)}componentWillUnmount(){this.subscriptions.unsubscribe()}render(){const e=this.getOpenInSourcegraphUrl(this.props.openProps);return t.createElement(tl,yl({},this.props,{className:i()("open-on-sourcegraph",this.props.className),dataTestId:"open-on-sourcegraph",href:e}))}getOpenInSourcegraphUrl(e){const t=e.sourcegraphURL,n=Tc(new URL(`/${e.repoName}/-/compare/${e.commit.baseRev}...${e.commit.headRev}`,t),{utm_source:Fc(),utm_campaign:"open-diff-on-sourcegraph"}).href;if(this.state.fileDiff&&this.state.fileDiff.nodes.length>0){return`${n}${this.state.fileDiff.totalCount&&this.state.fileDiff.totalCount>25?`&first=${this.state.fileDiff.totalCount}`:""}#diff-${this.state.fileDiff.nodes[0].internalID}`}return n}}function El(){return(El=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const _l=({openProps:{sourcegraphURL:e,repoName:n,revision:r,filePath:o},className:a,...s})=>{const c=Tc(new URL(ma({repoName:n,revision:r,filePath:o}),e),{utm_source:Fc(),utm_campaign:"open-on-sourcegraph"});return t.createElement(tl,El({},s,{className:i()("open-on-sourcegraph",a),dataTestId:"open-on-sourcegraph",href:c.href}))},xl="CodeViewToolbar-module__code-view-toolbar_12_7s",Sl="CodeViewToolbar-module__item_Q45fy";function Ol(){return(Ol=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const Tl=e=>{var n,r,o,a,s,c,l,u,f,p,d,h,m,g;return t.createElement("ul",{className:i()(xl,e.className),"data-testid":"code-view-toolbar"},!e.hideActions&&t.createElement(Jc,Ol({},e,{listItemClass:i()(Sl,null!==(n=null===(r=e.buttonProps)||void 0===r?void 0:r.listItemClass)&&void 0!==n?n:e.listItemClass),actionItemClass:i()(null!==(o=null===(a=e.buttonProps)||void 0===a?void 0:a.actionItemClass)&&void 0!==o?o:e.actionItemClass),menu:Ao.EditorTitle,extensionsController:e.extensionsController,platformContext:e.platformContext,location:e.location,scope:e.scope}))," ",cn(e.fileInfoOrError)?lr(e.fileInfoOrError)?t.createElement(nl,{sourcegraphURL:e.sourcegraphURL,onSignInClose:e.onSignInClose,className:i()(null!==(s=null===(c=e.buttonProps)||void 0===c?void 0:c.actionItemClass)&&void 0!==s?s:e.actionItemClass),iconClassName:e.actionItemIconClass}):null:t.createElement(t.Fragment,null,!("blob"in e.fileInfoOrError)&&e.fileInfoOrError.head&&e.fileInfoOrError.base&&t.createElement("li",{className:i()(Sl,null!==(l=null===(u=e.buttonProps)||void 0===u?void 0:u.listItemClass)&&void 0!==l?l:e.listItemClass)},t.createElement(wl,{ariaLabel:"View file diff on Sourcegraph",platformContext:e.platformContext,className:i()(null!==(f=null===(p=e.buttonProps)||void 0===p?void 0:p.actionItemClass)&&void 0!==f?f:e.actionItemClass),iconClassName:e.actionItemIconClass,openProps:{sourcegraphURL:e.sourcegraphURL,repoName:e.fileInfoOrError.base.repoName,filePath:e.fileInfoOrError.base.filePath,revision:vl(e.fileInfoOrError.base).revision,commit:{baseRev:vl(e.fileInfoOrError.base).revision,headRev:vl(e.fileInfoOrError.head).revision}}}))," ","blob"in e.fileInfoOrError&&void 0!==e.fileInfoOrError.blob.content&&t.createElement("li",{className:i()(Sl,null!==(d=null===(h=e.buttonProps)||void 0===h?void 0:h.actionItemClass)&&void 0!==d?d:e.listItemClass)},t.createElement(_l,{ariaLabel:"View file on Sourcegraph",className:i()(null!==(m=null===(g=e.buttonProps)||void 0===g?void 0:g.actionItemClass)&&void 0!==m?m:e.actionItemClass),iconClassName:e.actionItemIconClass,openProps:{sourcegraphURL:e.sourcegraphURL,repoName:e.fileInfoOrError.blob.repoName,filePath:e.fileInfoOrError.blob.filePath,revision:vl(e.fileInfoOrError.blob).revision}}))))},Cl=({children:e,onClick:n,as:r="div"})=>{const o=(0,t.useCallback)((e=>{var t;"a"===(null===(t=e.target)||void 0===t?void 0:t.tagName.toLowerCase())&&n(e)}),[n]);return t.createElement(r,{onClick:o},e)},kl=({children:e,...n})=>t.createElement(s.Provider,{value:n},e);var Nl,Al=new Uint8Array(16);function Il(){if(!Nl&&!(Nl="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nl(Al)}const Pl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const Rl=function(e){return"string"==typeof e&&Pl.test(e)};for(var Dl=[],Ll=0;Ll<256;++Ll)Dl.push((Ll+256).toString(16).substr(1));const Ml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Dl[e[t+0]]+Dl[e[t+1]]+Dl[e[t+2]]+Dl[e[t+3]]+"-"+Dl[e[t+4]]+Dl[e[t+5]]+"-"+Dl[e[t+6]]+Dl[e[t+7]]+"-"+Dl[e[t+8]]+Dl[e[t+9]]+"-"+Dl[e[t+10]]+Dl[e[t+11]]+Dl[e[t+12]]+Dl[e[t+13]]+Dl[e[t+14]]+Dl[e[t+15]]).toLowerCase();if(!Rl(n))throw TypeError("Stringified UUID is invalid");return n};const jl=function(e,t,n){var r=(e=e||{}).random||(e.rng||Il)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Ml(r)},Fl="sourcegraphAnonymousUid";class Bl{subscription=new g;isEnabled=!1;constructor(e,t){this.innerTelemetryService=e,this.subscription.add(t.subscribe((e=>{this.isEnabled=e})))}log(e,t,n){setTimeout((()=>{this.isEnabled&&this.innerTelemetryService.log(e,t,n)}))}logViewEvent(e,t){setTimeout((()=>{this.isEnabled&&this.innerTelemetryService.logViewEvent(e,t)}))}logPageView(e,t,n){setTimeout((()=>{this.isEnabled&&this.innerTelemetryService.logPageView(e,t,n)}))}unsubscribe(){return this.isEnabled=!1,this.subscription.unsubscribe()}}class Ul{uid=null;platform=Fc();version=Bc();constructor(e,t){this.requestGraphQL=e,this.sourcegraphURL=t,this.getAnonUserID().catch(vr())}generateAnonUserID=()=>jl();async getAnonUserID(){if(this.uid)return this.uid;if(Pc){let e=localStorage.getItem(Fl);return null===e&&(e=this.generateAnonUserID(),localStorage.setItem(Fl,e)),this.uid=e,this.uid}let{sourcegraphAnonymousUid:e}=await qc.sync.get();return e||(e=this.generateAnonUserID(),await qc.sync.set({sourcegraphAnonymousUid:e})),this.uid=e,e}async logEvent(e,t,n,r){const o=await this.getAnonUserID();r&&((e,t,n,r)=>{r({request:fr`
|
|
77
77
|
mutation logUserEvent($event: UserEvent!, $userCookieID: String!) {
|
|
78
78
|
logUserEvent(event: $event, userCookieID: $userCookieID) {
|
|
79
79
|
alwaysNil
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
`,variables:{event:e,userCookieID:t},mightContainPrivateInfo:!1}).subscribe({error:()=>{}})})(r,
|
|
82
|
+
`,variables:{event:e,userCookieID:t},mightContainPrivateInfo:!1}).subscribe({error:()=>{}})})(r,o,this.sourcegraphURL,this.requestGraphQL),((e,t)=>{t({request:fr`
|
|
83
83
|
mutation logEvent(
|
|
84
84
|
$name: String!
|
|
85
85
|
$userCookieID: String!
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
alwaysNil
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
`,variables:{...e,source:Ci.CODEHOSTINTEGRATION,argument:e.argument&&JSON.stringify(e.argument),publicArgument:e.publicArgument&&JSON.stringify(e.publicArgument)},mightContainPrivateInfo:!1}).subscribe({error:e=>{}})})({name:e,userCookieID:i,url:this.sourcegraphURL,firstSourceURL:a,argument:{platform:this.platform,version:this.version,...t},publicArgument:{platform:this.platform,version:this.version,...n}},this.requestGraphQL)}async log(e,t,n){switch(e){case"findReferences":await this.logEvent(e,t,n,Ui.CODEINTELINTEGRATIONREFS);break;case"goToDefinition":case"goToDefinition.preloaded":case"hover":await this.logEvent(e,t,n,Ui.CODEINTELINTEGRATION);break;default:await this.logEvent(e,t,n)}}async logViewEvent(e,t){await this.logEvent(`View${e}`,t)}async logPageView(e,t,n){await this.logEvent(`${e}Viewed`,t,n)}}const ql={allowErrorReporting:!1,sendTelemetry:!0,experimentalLinkPreviews:!1,experimentalTextFieldCompletion:!1,clickToGoToDefinition:!1},Vl=({get:e,set:t})=>({set:t,enable:e=>t(e,!0),disable:e=>t(e,!1),async isEnabled(t){const n=await e(t);return"boolean"==typeof n?n:ql[t]},async toggle(n){const r=await e(n);return await t(n,!r),!r}});const $l=Vl({get:async function(e){const{featureFlags:t={}}=await qc.sync.get();return t[e]},set:async function(e,t){const{featureFlags:n}=await qc.sync.get("featureFlags");await qc.sync.set({featureFlags:{...n,[e]:t}})}}),zl=Vl({get:async e=>{const t=localStorage.getItem(e);return null===t?void 0:"true"===t},set:async(e,t)=>{localStorage.setItem(e,String(t))}}),Hl=Pc?zl:$l,Gl={sendTelemetry:!1,allowErrorReporting:!1,experimentalLinkPreviews:!1,experimentalTextFieldCompletion:!1,clickToGoToDefinition:!1},Ql=e=>({...Gl,...e}),Wl=()=>(Ic?Vc("sync","featureFlags"):z(void 0)).pipe(H(Ql));function Kl(e){return Wl().pipe(H((t=>t[e])),Qe())}const Zl=e=>jc(e).pipe(H((t=>!(Lc()&&e)||!Uc(t)))),Yl=e=>Oe([Zl(e),Kl("sendTelemetry")]).pipe(H((([e,t])=>!!e||t)));function Jl(){const{host:e,pathname:t}=location,[n,r]=t.slice(1).split("/");if(!n||!r)throw new ll(`Could not parse repoName from Bitbucket Cloud url: ${location.href}`);return`${e}/${n}/${r}`}const Xl={getCodeElementFromTarget:e=>e.closest(".view-line > span"),getLineNumberFromCodeElement:e=>{if(!document.querySelector(".line-number"))throw new Error("No line number elements found on the currently viewed page");const t=e.closest(".react-monaco-editor-container");if(!t)throw new Error("No editor found");const n=e.closest(".view-line"),r=[...t.querySelectorAll(".view-line")].findIndex((e=>e===n)),o=t.querySelectorAll(".line-number")[r];if(o){var i,a,s;let e=parseInt(null!==(i=o.dataset.lineNum)&&void 0!==i?i:"",10);if(!isNaN(e))return e;if(e=parseInt(null!==(a=null===(s=o.textContent)||void 0===s?void 0:s.trim())&&void 0!==a?a:"",10),!isNaN(e))return e}throw new Error("Could not find line number")},getLineElementFromLineNumber:eu,getCodeElementFromLineNumber:(e,t)=>{const n=eu(e,t);if(!n)return null;const r=n.querySelector(":scope > span");return r||console.error(`Could not find code element inside .view-line container for line #${t}`),r}};function eu(e,t){let n=e.querySelector(`[data-line-num="${t}"]`);if(!n)for(const o of e.querySelectorAll(".line-number")){var r;if(parseInt(null!==(r=o.textContent)&&void 0!==r?r:"",10)===t){n=o;break}}if(!n)return console.error(`Could not find line number element for line #${t}`),null;const o=[...e.querySelectorAll(".line-number")].findIndex((e=>e===n)),i=e.querySelectorAll(".view-line")[o];return i||console.error(`Could not find line element for line #${t}`),i}function tu(e,t,n){var r,o;const i=null===(r=e.querySelector(`[aria-label="${"base"===n?"From":"To"} line ${t}"]`))||void 0===r||null===(o=r.closest(".line-wrapper"))||void 0===o?void 0:o.querySelector(".code-component");if(!i)throw new Error(`Could not locate line number element for line ${t}, part: ${String(n)}`);return i}const nu={getCodeElementFromTarget:e=>e.closest(".code-diff"),getLineNumberFromCodeElement:e=>{var t;const n=e.closest(".line-wrapper"),r=null==n?void 0:n.querySelectorAll(".line-number-permalink");if(!r||0===r.length)throw new Error("Could not find line number permalink(s) for code element");const o=r[r.length-1],i=parseInt(null!==(t=o.textContent)&&void 0!==t?t:"",10);if(!isNaN(i))return i;throw new Error("Could not find line number for code element")},getLineElementFromLineNumber:tu,getCodeElementFromLineNumber:(e,t,n)=>{var r;return null===(r=tu(e,t,n))||void 0===r?void 0:r.querySelector(".code-diff")},getDiffCodePart:e=>{var t,n,r;const o=e.closest(".code-component"),i=null==o?void 0:o.querySelector(".line-type");if(null!=i&&null!==(t=i.textContent)&&void 0!==t&&t.includes("+"))return"head";if(null!=i&&null!==(n=i.textContent)&&void 0!==n&&n.includes("+"))return"base";if(!e.closest(".side-by-side"))return"head";const a=e.closest(".line-wrapper");if(null!=a&&a.id)return null!=a&&a.id.includes("oldline")?"base":"head";return 0===[...(null==a||null===(r=a.parentElement)||void 0===r?void 0:r.childNodes)||[]].findIndex((e=>e===a))?"base":"head"},isFirstCharacterDiffIndicator:()=>!1};function ru(e,t,n){var r;const o=null===(r=e.querySelector(`[data-${"base"===n?"f":"t"}num="${t}"]`))||void 0===r?void 0:r.closest(".udiff-line");if(!o)throw new Error(`Could not locate line number element for line ${t}, part: ${String(n)}`);return o}const ou={getCodeElementFromTarget:e=>e.closest(".source"),getLineNumberFromCodeElement:e=>{const t=e.closest(".udiff-line");if(!t)throw new Error("Could not find line element");const n=t.querySelector(".line-numbers");if(!n)throw new Error("Could not find line numbers element");const r=null==n?void 0:n.dataset.tnum;if(r){const e=parseInt(r,10);if(!isNaN(e))return e}const o=null==n?void 0:n.dataset.fnum;if(o){const e=parseInt(o,10);if(!isNaN(e))return e}throw new Error("Could not find line number for code element")},getLineElementFromLineNumber:ru,getCodeElementFromLineNumber:(e,t,n)=>{var r;return null===(r=ru(e,t,n))||void 0===r?void 0:r.querySelector(".source")},getDiffCodePart:e=>{const t=e.closest(".udiff-line");if(!t)throw new Error("Could not find line element for code element");return t.classList.contains("deletion")?"base":"head"},isFirstCharacterDiffIndicator:()=>!0},iu=e=>e.replace("//","/"),au=["modified","renamed","removed","added"];function su(){const e=Jl(),t=location.pathname.match(/src\/(.*?)\/(.*)/);if(!t)throw new Error("Unable to determine revision or file path");const n=decodeURIComponent(t[1]),r=decodeURIComponent(t[2]),o=function(){const e=['a[type="button"]',"a"];for(const t of e){const e=document.querySelectorAll(t);for(const t of e){const e=t.href.match(/full-commit\/([\da-f]{40})\//);if(e)return e[1]}}return null}();return{blob:{rawRepoName:e,revision:n,filePath:r,commitID:null!=o?o:n}}}function cu(e){const t=Jl(),n=function(e){const t=[...e.querySelectorAll('[data-qa="bk-file__header"] span')];for(const e of t)for(const t of au){var n;if(null!==(n=e.textContent)&&void 0!==n&&n.toLowerCase().includes(t))return t}return"modified"}(e),{base:r,head:o}=function(e,t){var n;const r=null===(n=e.querySelector('[data-qa="bk-filepath"]'))||void 0===n?void 0:n.cloneNode(!0),o=null==r?void 0:r.textContent;if(!(r instanceof HTMLElement&&o))throw new Error("Could not find breadcrumbs component for code view");if("added"===t)return{head:o};if("removed"===t)return{base:o};if("modified"===t)return{base:o,head:o};const i="<>SEPARATOR<>",a=r.querySelectorAll('[aria-label="arrow"]');for(const e of a)e.textContent=i;const[s,c,l]=r.textContent.split(/[{}]/),[u,f]=c.split(i);return{base:iu(s+u+l),head:iu(s+f+l)}}(e,n),{baseRevision:i,headRevision:a}=function(){var e,t;const n=document.querySelector('[data-qa="pr-branches-and-state-styles"]');if(!n)throw new Error("Could not find branches element");const r=[...n.querySelectorAll('[aria-hidden="true"]')];if(2!==r.length)throw new Error("Expected source and destination branch elements");const o=null!==(e=r[0].textContent)&&void 0!==e?e:"";return{baseRevision:null!==(t=r[1].textContent)&&void 0!==t?t:"",headRevision:o}}();return"added"===n?{head:{rawRepoName:t,filePath:o,commitID:a,revision:a}}:"removed"===n?{base:{rawRepoName:t,filePath:r,commitID:i,revision:i}}:{head:{rawRepoName:t,filePath:o,commitID:a,revision:a},base:{rawRepoName:t,filePath:r,commitID:i,revision:i}}}function lu(e){const t=Jl(),n=function(e){const t=e.querySelector(".diff-entry-lozenge");for(const e of au){var n;if(null!=t&&null!==(n=t.textContent)&&void 0!==n&&n.toLowerCase().includes(e))return e}return"modified"}(e),{head:r,base:o}=function(e,t){var n;const r=null===(n=e.querySelector(".filename"))||void 0===n?void 0:n.cloneNode(!0);if(!r)throw new Error("Could not find breadcrumbs component for code view");for(const e of r.childNodes)e instanceof HTMLSpanElement&&(e.textContent=null);const o=r.textContent.trim();if("added"===t)return{head:o};if("removed"===t)return{base:o};if("modified"===t)return{base:o,head:o};const[i,a,s]=o.split(/[{}]/).map((e=>e.trim())),[c,l]=a.split("\u2192").map((e=>e.trim()));return{base:iu(i+c+s),head:iu(i+l+s)}}(e,n),{baseCommitID:i,headCommitID:a}=function(){var e;const t=null===(e=document.querySelector('[title="Parent commit"]'))||void 0===e?void 0:e.href.match(/\/commits\/(.*)/);if(!t)throw new Error("Could not determine base commit ID");const n=t[1],r=window.location.href.match(/\/commits\/(.*)/);if(!r)throw new Error("Could not determine head commit ID");return{baseCommitID:n,headCommitID:r[1]}}();return"added"===n?{head:{rawRepoName:t,filePath:r,commitID:a}}:"removed"===n?{base:{rawRepoName:t,filePath:o,commitID:i}}:{head:{rawRepoName:t,filePath:r,commitID:a},base:{rawRepoName:t,filePath:o,commitID:i}}}const uu="codeHost-module__icon_3KtzB",fu="codeHost-module__commit-container_8Jft-";function pu(e){const t=e.querySelector(".sg-toolbar-mount");if(t)return t;const n=e.querySelector('[data-testid="file-actions"');if(!n)throw new Error("Unable to find mount location");const r=document.createElement("div");return r.classList.add("sg-toolbar-mount"),n.prepend(r),r}function du(e){const t=e.querySelector(".sg-toolbar-mount");if(t)return t;const n=e.querySelector(".diff-actions");if(!n)throw new Error("Unable to find mount location");n.classList.add(fu);const r=document.createElement("div");return r.classList.add("sg-toolbar-mount"),n.prepend(r),r}const hu={type:"bitbucket-cloud",name:"Bitbucket Cloud",codeViewResolvers:[{selector:e=>{const t=e.querySelector('[data-qa="bk-file__header"]'),n=e.querySelector('[data-qa="bk-file__content"]');if(!t||!n)return null;let r=t;for(;!r.contains(n);){if(!r.parentElement)return null;r=r.parentElement}return[r]},resolveView:e=>function({pathname:e}){return/\/pull-requests\/\d+/.test(e)}(window.location)?{element:e,getToolbarMount:pu,dom:nu,resolveFileInfo:cu}:{element:e,getToolbarMount:pu,dom:Xl,resolveFileInfo:su}},{selector:".bb-udiff",resolveView:e=>({element:e,getToolbarMount:du,dom:ou,resolveFileInfo:lu})}],getContext:async function(){const e=Jl();return Promise.resolve({rawRepoName:e,revision:"",privateRepository:!1})},getViewContextOnSourcegraphMount:function(e){var t;const n="open-on-sourcegraph",r=he(e,'[data-qa="page-header-wrapper"] > div > div');if(!r)return null;let o=r.querySelector("#open-on-sourcegraph");if(o)return o;o=document.createElement("span"),o.id=n;const i=null===(t=r.childNodes[1])||void 0===t?void 0:t.childNodes[1].firstChild;return i instanceof HTMLElement?i.append(o):r.append(o),o},check:function(){return"bitbucket.org"===location.hostname},viewOnSourcegraphButtonClassProps:{className:"codeHost-module__open-on-sourcegraph_10lR9",iconClassName:uu},codeViewToolbarClassProps:{className:"codeHost-module__code-view-toolbar_N0wZ1",listItemClass:"codeHost-module__list-item_370zl",actionItemClass:"codeHost-module__code-view-toolbar-action-item_2p6Pr",actionItemPressedClass:"codeHost-module__pressed_1ksxF",actionItemIconClass:uu},hoverOverlayClassProps:{className:"codeHost-module__hover-overlay_2e1lQ",badgeClassName:"codeHost-module__badge_16Tsk",actionItemClassName:"codeHost-module__hover-overlay-action-item_39z-G",iconClassName:uu,contentClassName:"codeHost-module__content_eSBN7"},notificationClassNames:{1:"",2:"",3:"",4:"",5:""},codeViewsRequireTokenization:!0},mu=(e,t)=>n=>i()(e[n],t),gu=/\/projects\/([^/]+)\/repos\/([^/]+)\//;const vu=(e,t)=>{const n=e.querySelector(`[data-line-number="${t}"]`);if(!n)throw new Error(`Line ${t} not found in code view`);const r=n.closest(".line");if(!r)throw new Error("Could not find line elem for line element");return r},bu={getCodeElementFromTarget:e=>{const t=e.closest(".CodeMirror-line");return t?t.querySelector('span[role="presentation"]'):null},getLineNumberFromCodeElement:e=>{const t=e.closest(".line");if(!t)throw new Error("Could not find line containing code element");const n=t.querySelector(".line-locator");if(!n)throw new Error("Could not find the line number in a line container");const r=parseInt(n.dataset.lineNumber||"",10);if(isNaN(r))throw new TypeError("data-line-number not set on line number element");return r},getLineElementFromLineNumber:vu,getCodeElementFromLineNumber:(e,t)=>vu(e,t).querySelector('.CodeMirror-line span[role="presentation"]')},yu=(e,t,n)=>{for(const r of e.querySelectorAll(".line-number-"+("head"===n?"to":"from"))){const e=parseInt((r.textContent||"").trim(),10);if(!isNaN(e)&&e===t){const e=r.closest(".line");if(!e)throw new Error("Could not find lineElem from lineNumElem");return e}}throw new Error(`Could not locate line number element for line ${t}, part: ${String(n)}`)},wu={getCodeElementFromTarget:bu.getCodeElementFromTarget,getLineNumberFromCodeElement:e=>{const t=e.closest(".line");if(!t)throw new Error("Could not find line containing code element");const n=t.querySelector(".line-number-to");if(n){const e=parseInt((n.textContent||"").trim(),10);if(!isNaN(e))return e}const r=t.querySelector(".line-number-from");if(r){const e=parseInt((r.textContent||"").trim(),10);if(!isNaN(e))return e}throw new Error("Could not find line number element for code element")},getLineElementFromLineNumber:yu,getCodeElementFromLineNumber:(e,t,n)=>yu(e,t,n).querySelector('.CodeMirror-line span[role="presentation"]'),getDiffCodePart:e=>{var t;if(!document.querySelector(".side-by-side-diff"))return e.closest(".line").classList.contains("removed")?"base":"head";return null!==(t=e.closest(".diff-editor").previousElementSibling)&&void 0!==t&&t.classList.contains("segment-connector-column")?"head":"base"},isFirstCharacterDiffIndicator:()=>!1},Eu=(e,t,n)=>{for(const i of e.querySelectorAll(".diff-line-number")){var r;const e=null===(r=i.textContent)||void 0===r?void 0:r.trim().split(" ")[0];if(!e)continue;const a=parseInt(e,10);if(!isNaN(a)&&a===t){var o;const e=null===(o=i.closest("tr"))||void 0===o?void 0:o.querySelector(`.diff-line[data-diff-line="${"head"===n?"TO":"FROM"}"]`);if(!e)throw new Error("Could not find lineElem from lineNumElem");return e}}throw new Error(`Could not locate line number element for line ${t}, part: ${String(n)}`)},_u={getCodeElementFromTarget:e=>e.closest(".diff-line"),getLineNumberFromCodeElement:e=>{var t;const n=null===(t=e.closest("tr"))||void 0===t?void 0:t.querySelector(".diff-gutter .diff-line-number");if(n){const e=parseInt((n.textContent||"").trim(),10);if(!isNaN(e))return e}throw new Error("Could not find line number element for code element")},getDiffCodePart:e=>{var t;const n=null===(t=e.closest("tr"))||void 0===t?void 0:t.querySelectorAll(".diff-line");if(!n||0===n.length)throw new Error("Could not find diff lines for code element");if(1===n.length)return e.classList.contains("added-line")?"head":"base";const[r,o]=n;return e===r?"base":e===o?"head":e.classList.contains("removed-line")?"base":"head"},getLineElementFromLineNumber:Eu,getCodeElementFromLineNumber:Eu};var xu=n(11570),Su=n.n(xu);const Ou=(e,t,n)=>`${window.AJS?window.AJS.contextPath():window.location.origin}/rest/api/1.0/projects/${encodeURIComponent(e)}/repos/${t}${n}`,Tu=e=>ar(e,{selector:e=>ur(e).json()}),Cu=jo((({project:e,repoSlug:t,prID:n})=>Tu(Ou(e,t,`/pull-requests/${n}`)).pipe(H((({fromRef:e,toRef:t})=>({baseCommitID:t.latestCommit,headCommitID:e.latestCommit}))))),(({prID:e})=>e.toString())),ku=jo((({project:e,repoSlug:t,commitID:n})=>Tu(Ou(e,t,`/commits/${n}`)).pipe(H((({parents:e})=>Su()(e))),qe(Kn),H((({id:e})=>e)))),(({project:e,repoSlug:t,commitID:n})=>`${e}:${t}:${n}`)),Nu=["a.raw-view-link","a.source-view-link","a.mode-source"],Au=({repoSlug:e,project:t})=>[window.location.hostname,t,e].join("/"),Iu=e=>{const t=[];for(const n of Nu)try{const t=e.querySelector(n);if(!t)throw new Error(`Could not find selector ${n} in code view`);const r=new URL(t.href),o=r.pathname,i=o.match(/\/projects\/(.*?)\/repos\/(.*?)\/(?:browse|raw)\/(.*)$/);if(!i)throw new Error(`Path of link matching selector ${n} did not match path regex: ${o}`);const[,a,s,c]=i,l=r.searchParams.get("at");if(!l)throw new Error(`href of link matching selector ${n} did not have 'at' search param: ${r.href}`);const u=l.match(/refs\/heads\/(.*?)$/),f=u?u[1]:l;return{rawRepoName:Au({repoSlug:s,project:a}),filePath:decodeURIComponent(c),revision:f,project:a,repoSlug:s}}catch(e){t.push(e);continue}throw un(t)},Pu=(e="a.commitid")=>{const t=document.querySelector(e);if(!t)throw new Error("No element found matching a.commitid");const n=t.dataset.commitid;if(!n)throw new Error("Element matching a.commitid has no data-commitid");return n},Ru=e=>{const{rawRepoName:t,filePath:n,revision:r,project:o,repoSlug:i}=Iu(e);return{rawRepoName:t,filePath:n,revision:r,commitID:(()=>{const e=document.querySelector("span[data-revision-ref]");if(!e)throw new Error("Could not find span[data-revision-ref] element");try{const{latestCommit:t}=JSON.parse(e.dataset.revisionRef);return t}catch{throw new Error("Could not parse JSON from revision selector")}})(),project:o,repoSlug:i}},Du=({codeViewElement:e})=>e.querySelector(".change-type-lozenge"),Lu=({changeTypeElement:e})=>{if(!e)return"MODIFY";const t=[...e.classList].find((e=>/^change-type-[A-Z]+/.test(e)));if(!t)throw new Error("Could not detect change type from change type element");return t.replace(/^change-type-/,"")},Mu=({filePath:e,changeType:t,changeTypeElement:n})=>{if("ADD"!==t){if("MODIFY"===t||"DELETE"===t)return e;if("MOVE"===t||"RENAME"===t||"COPY"===t){if(!n)throw new Error(`Change type is ${t} but no change type indicator found`);const r=n.getAttribute("original-title");if(!r)throw new Error("Moved change type badge did not have original-title attribute");const o=document.createElement("span");o.innerHTML=r;const i=o.textContent;if("MOVE"===t||"COPY"===t){const e=i.split("\u2192")[0].trim();if(!e)throw new Error(`Unexpected move change type badge content "${i}"`);return e}if("RENAME"===t){const t=/Renamed from '(.+)'/,n=i.match(t);if(!n)throw new Error(`Rename change type badge content did not match ${t.toString()}: "${i}"`);return Aa.join(Aa.dirname(e),n[1])}}throw new Error(`Unexpected change type "${t}"`)}},ju=e=>{var t;const n=null!==(t=e.querySelector(".breadcrumbs"))&&void 0!==t?t:e.querySelector(".file-breadcrumbs");if(!n)throw new Error("Could not find diff code view breadcrumbs element through selector .breadcrumbs");const r=n.textContent;if(!r)throw new Error("Unexpected empty file path in breadcrumbs");const o=location.pathname.match(/\/projects\/(.*?)\/repos\/(.*?)\//);if(!o)throw new Error("Location did not match regexp");const[,i,a]=o,s=Au({project:i,repoSlug:a}),c=Du({codeViewElement:e}),l=Lu({changeTypeElement:c});return{changeType:l,rawRepoName:s,filePath:r,baseFilePath:Mu({changeTypeElement:c,changeType:l,filePath:r})||r,project:i,repoSlug:a}};const Fu=e=>{const t=ju(e),{rawRepoName:n,filePath:r,baseFilePath:o}=t,i=function(){const e=window.location.pathname.match(/pull-requests\/(\d*?)\/(diff|overview|commits)/);if(!e)throw new Error(`Could not parse PR ID from pathname: ${window.location.pathname}`);return parseInt(e[1],10)}();return Cu({...t,prID:i}).pipe(H((({headCommitID:e,baseCommitID:t})=>({head:{rawRepoName:n,filePath:r,commitID:e},base:{rawRepoName:n,filePath:o,commitID:t}}))))},Bu="codeHost-module__command-palette-button_1LPsz",Uu="codeHost-module__command-palette-popover_wqnFp",qu="codeHost-module__no-results_3Di26",Vu="codeHost-module__open-on-sourcegraph_i9J2G",$u="codeHost-module__sg-toolbar-mount_2Fbz5",zu="codeHost-module__code-view-toolbar_IVqgq",Hu="codeHost-module__action-nav-item_223JV",Gu="codeHost-module__action-nav-item-new-diff_23eTl",Qu="codeHost-module__action-item-new-diff_3Tuv4",Wu="codeHost-module__hover-action-item_9CC-W",Ku="codeHost-module__command-list-popover-button_3eptU",Zu=(e,t=".file-toolbar .secondary")=>{const n=e.querySelector(".sg-toolbar-mount");if(n)return n;const r=e.querySelector(t);if(!r)throw new Error("Unable to find mount location");const o=document.createElement("div");return o.classList.add("btn-group"),o.classList.add("sg-toolbar-mount"),o.classList.add($u),r.prepend(o),o},Yu=e=>({direction:t,codeView:n,position:r})=>{const o=e.getCodeElementFromLineNumber(n,r.line,r.part);if(!o)throw new Error("(adjustPosition) could not find code element for line provided");let i=0;for(const e of o.querySelectorAll("[cm-text]")){const t=e.getAttribute("cm-text")||"",n=e.textContent||"";i+=t.length-n.length}const a=t===Fn.ActualToCodeView?-1:1;return z({line:r.line,character:r.character+a*i})},Ju={getToolbarMount:Zu,dom:bu,resolveFileInfo:e=>({blob:Ru(e)}),getPositionAdjuster:()=>Yu(bu)},Xu={getToolbarMount:Zu,dom:wu,getPositionAdjuster:()=>Yu(wu),overrideTokenize:!0},ef={...Xu,resolveFileInfo:e=>{const{changeType:t,rawRepoName:n,filePath:r,commitID:o,baseFilePath:i,revision:a,...s}=(e=>{const{rawRepoName:t,project:n,repoSlug:r,filePath:o}=Iu(e),i=Pu(),a=Du({codeViewElement:e}),s=Lu({changeTypeElement:a});return{changeType:s,rawRepoName:t,filePath:o,baseFilePath:Mu({changeTypeElement:a,changeType:s,filePath:o})||o,commitID:i,project:n,repoSlug:r}})(e);return"ADD"===t?z({head:{rawRepoName:n,filePath:r,commitID:o}}):ku({commitID:o,...s}).pipe(H((e=>"DELETE"===t?{base:{rawRepoName:n,filePath:i,commitID:e}}:{base:{rawRepoName:n,filePath:i,commitID:e},head:{rawRepoName:n,filePath:r,commitID:o}})))}},tf={...Xu,resolveFileInfo:Fu},nf={...Xu,resolveFileInfo:e=>{const{rawRepoName:t,filePath:n,baseFilePath:r}=ju(e),{baseCommitID:o,headCommitID:i}=function(){const e=document.querySelector("#branch-compare .source-selector a.commitid[data-commitid]"),t=document.querySelector("#branch-compare .target-selector a.commitid[data-commitid]");if(!e||!t)throw new Error("Could not resolve Bitbucket compare diff spec");return{headCommitID:e.getAttribute("data-commitid"),baseCommitID:t.getAttribute("data-commitid")}}();return{base:{rawRepoName:t,filePath:r,commitID:i},head:{rawRepoName:t,filePath:n,commitID:o}}}},rf={...Xu,resolveFileInfo:e=>(e=>{const t=Pu(".commit-badge-oneline .commitid"),n=Pu(".commit-parents .commitid"),{rawRepoName:r,filePath:o,baseFilePath:i}=ju(e);return{head:{rawRepoName:r,filePath:o,commitID:t},base:{rawRepoName:r,filePath:i,commitID:n}}})(e)},of={selector:".change-view",resolveView:e=>({element:e,...af})},af={resolveFileInfo:Fu,getToolbarMount:e=>Zu(e,".change-header .diff-actions"),toolbarButtonProps:{listItemClass:Gu,actionItemClass:Qu},dom:_u};const sf="aui-icon",cf={[Qa]:"aui-message aui-message-info",[Wa]:"aui-message aui-message-success",[Ga]:"aui-message aui-message-info",[Ha]:"aui-message aui-message-warning",[za]:"aui-message aui-message-error"},lf={type:"bitbucket-server",name:"Bitbucket Server",check:()=>!!document.querySelector(".bitbucket-header-logo")||!!document.querySelector(".aui-header-logo.aui-header-logo-bitbucket"),codeViewResolvers:[{selector:".file-content",resolveView:e=>{const t=e.querySelector(".content-view");if(!t)return null;if(document.querySelector("#branch-compare"))return{element:e,...nf};if((({pathname:e})=>/\/projects\/[^/]+\/repos\/[^/]+\/commits\/\w+$/.test(e))(window.location))return{element:e,...rf};if(e.querySelector(".mode-toggle")){return t.classList.contains("diff-view")?{element:e,...ef}:{element:e,...Ju}}return(({pathname:e})=>/\/projects\/[^/]+\/repos\/[^/]+\/pull-requests\/\d+/.test(e))(window.location)?{element:e,...tf}:(console.error("Unknown code view",e),null)}},of],getCommandPaletteMount:e=>{const t=he(e,".aui-header-primary .aui-nav");if(!t)return null;const n=["command-palette-button",Bu];return t.querySelector(n.map((e=>`.${e}`)).join(""))||(()=>{const e=document.createElement("li");return e.className=n.join(" "),t.append(e),e})()},notificationClassNames:cf,commandPaletteClassProps:{buttonClassName:i()(Ku,"aui-alignment-target aui-alignment-abutted aui-alignment-abutted-left aui-alignment-element-attached-top aui-alignment-element-attached-left aui-alignment-target-attached-bottom aui-alignment-target-attached-left"),buttonElement:"a",buttonOpenClassName:"aui-dropdown2-active active aui-alignment-enabled",showCaret:!1,popoverClassName:i()(Uu,"aui-dropdown2 aui-style-default aui-layer aui-dropdown2-in-header aui-alignment-element aui-alignment-side-bottom aui-alignment-snap-left aui-alignment-enabled aui-alignment-abutted aui-alignment-abutted-left aui-alignment-element-attached-top aui-alignment-element-attached-left aui-alignment-target-attached-bottom aui-alignment-target-attached-left"),popoverInnerClassName:"aui-dropdown2-section",formClassName:"aui",inputClassName:"text",resultsContainerClassName:"results",listClassName:"results-list",listItemClassName:"result",selectedListItemClassName:"focused",noResultsClassName:qu,iconClassName:sf},codeViewToolbarClassProps:{className:i()(zu,"aui-buttons"),actionItemClass:"aui-button",actionItemIconClass:"aui-icon",listItemClass:Hu},hoverOverlayClassProps:{className:"aui-dialog",actionItemClassName:i()("aui-button",Wu),getAlertClassName:mu(cf),iconClassName:sf},getViewContextOnSourcegraphMount:function(e){const t=he(e,".branch-selector-toolbar .aui-buttons");if(!t)return null;const n=t.querySelector("#open-on-sourcegraph");if(n)return n;const r=document.createElement("span");return r.id="open-on-sourcegraph",r.className=Vu,t.append(r),r},getContext:async function(){const e=function(e){const{hostname:t,pathname:n}=e,r=n.match(gu);if(!r)throw new Error(`location pathname does not match path regex: ${n}`);const[,o,i]=r;return{rawRepoName:`${t}/${o}/${i}`}}(window.location);let t={};try{t=function(){var e;const t=document.querySelector("#repository-layout-revision-selector .name[data-revision-ref]");if(!t)throw new Error("branchNameElement not found");const n=t.getAttribute("data-revision-ref");let r=null;if(n)try{r=JSON.parse(n)}catch{throw new Error(`Could not parse revisionRefStr: ${n}`)}if(null!==(e=r)&&void 0!==e&&e.latestCommit)return{revision:r.latestCommit};throw new Error(`revisionRefInfo is empty or has no latestCommit (revisionRefStr: ${String(n)})`)}()}catch{}return Promise.resolve({...e,...t,privateRepository:"bitbucket.org"!==window.location.hostname})},viewOnSourcegraphButtonClassProps:{className:"aui-button",iconClassName:sf},codeViewsRequireTokenization:!1};var uf=n(65291),ff=n.n(uf),pf=n(92674),df=n.n(pf),hf=n(26416),mf=n.n(hf);function gf(e){return new B((function(t){var n;try{n=e()}catch(e){return void t.error(e)}return(n?ee(n):Ne()).subscribe(t)}))}function vf(e){return t=>gf((()=>{const n=new Map;return t.pipe(wt(Me),ce(),tt((({removedNodes:e})=>{for(const t of e){if(!(t instanceof HTMLElement))continue;const e=n.get(t);if(e)e.subscriptions.unsubscribe(),n.delete(t);else for(const[e,r]of n.entries())t.contains(e)&&(r.subscriptions.unsubscribe(),n.delete(e))}})),oe((t=>ee(t.addedNodes).pipe(qe(Wn(HTMLElement)),oe((t=>ee(e).pipe(oe((({selector:e,resolveView:n})=>[...bf(t,e)].map((e=>{const t=n(e);return t&&{...t,subscriptions:new g}})))),qe(Kn),qe((e=>!n.has(e.element))),tt((e=>{n.set(e.element,e)})))))))))}))}function bf(e,t){if("string"==typeof t)return de(e,t);return t(e)||[]}const yf=/patchset (\d+)/i;function wf(e,t){return`refs/changes/${e.slice(-2).padStart(2,"0")}/${e}/${t}`}function Ef(e){var t,n;return null!==(t=null===(n=If(document.body,e))||void 0===n?void 0:n.textContent)&&void 0!==t?t:void 0}function _f(e){const t=yf.exec(e);if(null!=t&&t[1])return t[1]}function xf(){const e=new URL(window.location.href).pathname.split("/"),t=e.indexOf("c"),n=e.indexOf("+"),r=e.slice(t+1,n).join("/"),o=e[n+1],i=e[n+2],a=e.slice(n+3).join("/"),s=window.location.hostname+"/"+r,{basePatchsetId:c,headPatchsetId:l}=function(){var e,t;const n=null!==(e=Ef("#app >> #app-element >> gr-change-view >> #fileListHeader >> #rangeSelect >> #basePatchDropdown >> #triggerText"))&&void 0!==e?e:Ef("#app >> #app-element >> gr-diff-view >> #rangeSelect >> #basePatchDropdown >> #triggerText"),r=null!==(t=Ef("#app >> #app-element >> gr-change-view >> #fileListHeader >> #rangeSelect >> #patchNumDropdown >> #triggerText"))&&void 0!==t?t:Ef("#app >> #app-element >> gr-diff-view >> #rangeSelect >> #patchNumDropdown >> #triggerText");return{basePatchsetId:n&&_f(n),headPatchsetId:r&&_f(r)}}();return{repoName:s,changeId:o,patchsetId:l||i,filePath:a,basePatchsetId:c}}const Sf={selector(e){var t;if(e.matches("#diffTable"))return[e];const n=If(document,"#app >> #app-element >> gr-change-view >> #fileList"),r=[...(null==n||null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".file-row.expanded"))||[]].map((e=>{const t=e.parentElement;if(t)return If(t,"gr-diff-host >> gr-diff >> #diffTable")}));return mf()(r)},resolveView(e){const t=Pf(e,".stickyArea");if(!t)return null;const n=t.querySelector(".file-row"),r=null==n?void 0:n.getAttribute("data-path");if(!r)return null;const o=xf();if(!o.patchsetId)return console.error("Sourcegraph: Cannot get Gerrit patchset ID"),null;const i=wf(o.changeId,o.patchsetId);let a;return a=o.basePatchsetId?wf(o.changeId,o.basePatchsetId):function(){var e,t,n;const r=If(document.body,"#app >> #app-element >> gr-change-view >> #metadata >> gr-commit-info");if(!r)return null;return null==r||null===(e=r.shadowRoot)||void 0===e||null===(t=e.querySelector(".container"))||void 0===t||null===(n=t.textContent)||void 0===n?void 0:n.trim()}()||i+"^",Df(e),{element:e,dom:Tf,resolveFileInfo(){const e={base:{filePath:r||"",rawRepoName:o.repoName,commitID:a},head:{filePath:r||"",rawRepoName:o.repoName,commitID:i}};return console.log("resolveFileListCodeView: fileInfo",e),e}}}},Of=(e,t,n)=>{const r="head"===n?"right":"left",o=e.querySelector(`td.lineNum.${r}[data-value="${t}"]`);if(!o)return null;const i=function(e,t){var n;const r=[...(null===(n=e.parentElement)||void 0===n?void 0:n.childNodes)||[]],o=r.slice(r.indexOf(e)+1);for(const e of o)if(e instanceof HTMLElement&&e.matches(t))return e;return null}(o,"td.content");return null==i?void 0:i.querySelector(".contentText")},Tf={getLineElementFromLineNumber:Of,getCodeElementFromLineNumber:Of,getCodeElementFromTarget:e=>{var t;const n=e.closest("td.content"),r=null==n||null===(t=n.closest("tr"))||void 0===t?void 0:t.querySelector("[data-line-number]");if(r){if("FILE"===r.getAttribute("data-line-number"))return null}return n},getLineNumberFromCodeElement:e=>{var t;const n=Af(e);if(!n)throw console.error(e),new TypeError("Could not find line number (no side)");const r=e.closest("td"),o=null==r||null===(t=r.parentElement)||void 0===t?void 0:t.querySelector(`.lineNum.${n}`),i=null==o?void 0:o.getAttribute("data-value");if(!i)throw new TypeError(`Could not find line number (${n})`);return parseInt(i,10)},getDiffCodePart:e=>{const t=Af(e);return"left"===t?"base":"right"===t?"head":(console.error("Cannot tell: base or head"),"base")}},Cf=[{selector(e){const t=If(document.body,"#app >> #app-element >> gr-diff-view >> #diffHost >> #diff >> #diffTable");return t?[t]:[]},resolveView(e){const t=xf();if(!t.patchsetId)return console.error("Sourcegraph: cannot find patchset ID"),null;const n=wf(t.changeId,t.patchsetId);let r=n+"^";return t.basePatchsetId&&(r=wf(t.changeId,t.basePatchsetId)),Df(e),{element:e,dom:Tf,getToolbarMount(e){var t;const n=null===(t=function(e){var t;const n=Pf(e,"gr-diff-view");return null==n||null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelector("gr-fixed-panel .subHeader")}(e))||void 0===t?void 0:t.querySelector(".patchRangeLeft");if(!n)throw new Error("Could not find subheader");const r=n.querySelector(".sourcegraph-toolbar-mount");if(r)return r;const o=document.createElement("div");return o.classList.add("sourcegraph-toolbar-mount"),n.append(o),n.append(Rf(Lf)),o},resolveFileInfo(){const e={base:{filePath:t.filePath||"",rawRepoName:t.repoName,commitID:r},head:{filePath:t.filePath||"",rawRepoName:t.repoName,commitID:n}};return console.log("resolveFilePageCodeView: fileInfo",e),e}}}},Sf],kf={type:"gerrit",name:"Gerrit",codeViewResolvers:Cf,contentViewResolvers:[],nativeTooltipResolvers:[],codeViewsRequireTokenization:!0,observeMutations:(e,t,n)=>{let r=[];return Xc(1500).pipe(H((()=>{const{filePath:e=""}=xf(),t=[...Cf.map((e=>e.selector)),Nf].map((e=>[...bf(document.body,e)])).flat(),n=t.filter((t=>!df()(r,{element:t,filePath:e}))),o=r.filter((n=>!(n.filePath===e&&t.find((e=>e===n.element)))));for(const t of n)r.push({element:t,filePath:e});return r=r.filter((e=>!df()(o,e))),{addedNodes:n,removedNodes:o.map((e=>e.element))}})),qe((({addedNodes:e,removedNodes:t})=>!!e.length||!!t.length)),H((e=>[e])),Lo(),Bt())},getContext:async()=>{const{repoName:e,changeId:t,patchsetId:n}=xf();return Promise.resolve({privateRepository:!0,rawRepoName:e,revision:n&&wf(t,n)})},check:function(){return!!document.querySelector("gr-app#app")},notificationClassNames:{1:"",2:"",3:"",4:"",5:""},hoverOverlayClassProps:{className:"codeHost-module__hover-overlay_1jwSd"},codeViewToolbarClassProps:{className:"code-view-toolbar--gerrit",actionItemIconClass:"icon--gerrit"},viewOnSourcegraphButtonClassProps:{className:"open-on-sourcegraph--gerrit",iconClassName:"open-on-sourcegraph-icon--gerrit"},getViewContextOnSourcegraphMount:e=>{const t=ff()(Nf(e));if(!t)return null;const n=t.querySelector(".open-in-sourcegraph-mount");if(n)return n;const r=document.createElement("gr-button");return r.setAttribute("link","link"),r.classList.add("open-in-sourcegraph-mount"),t.prepend(r),t.append(Rf(Lf)),r}},Nf=()=>{const e=If(document.body,"#app >> #app-element >> gr-change-view >> #actions >> #secondaryActions");return e?[e]:null};function Af(e){var t,n;if("unified"===function(e){const t=e.closest("tr");return null!=t&&t.matches(".unified")?"unified":"side-by-side"}(e)){var r,o;return(null===(r=e.closest("tr"))||void 0===r||null===(o=r.querySelector("td.right"))||void 0===o?void 0:o.getAttribute("data-value"))?"right":"left"}return null!==(t=e.closest("td"))&&void 0!==t&&null!==(n=t.previousElementSibling)&&void 0!==n&&n.matches(".right")?"right":"left"}function If(e,t){var n;"string"==typeof t&&(t=t.split(">>"));let r=e;const o=t.slice(0,-1),i=t[t.length-1];for(const e of o){var a;if(!r)return null;r=(null===(a=r.querySelector(e))||void 0===a?void 0:a.shadowRoot)||null}return null===(n=r)||void 0===n?void 0:n.querySelector(i)}function Pf(e,t){for(;;){var n;const r=e.closest(t);if(r)return r;if(!(e=null===(n=e.getRootNode())||void 0===n?void 0:n.host)||e===document.getRootNode())return null}}function Rf(e){const t=document.createElement("style");return t.textContent=e,t}function Df(e){if(!e.querySelector("style.sourcegraph-injected-style")){const t=Rf(Mf);t.classList.add("sourcegraph-injected-style"),e.append(t)}}const Lf="\n.icon--gerrit {\n height: 1.3rem;\n width: 1.3rem;\n padding: 5px 4px;\n}\n.open-on-sourcegraph-icon--gerrit {\n height: 1rem;\n width: 1rem;\n}\n.open-on-sourcegraph--gerrit {\n text-decoration: none;\n}\n",Mf="\n.sourcegraph-document-highlight {\n background-color: var(--secondary);\n}\n.selection-highlight {\n background-color: var(--mark-bg);\n}\n";var jf,Ff,Bf=n(36021),Uf=n.n(Bf);!function(e){e.Ok="ok",e.Exited="exited",e.Crashed="crashed",e.Abnormal="abnormal"}(jf||(jf={})),function(e){e.Ok="ok",e.Errored="errored",e.Crashed="crashed"}(Ff||(Ff={}));var qf=n(97753),Vf=n(91698),$f=(0,qf.Rf)(),zf="Sentry Logger ",Hf=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,qf.Cf)((function(){$f.console.log(zf+"[Log]: "+e.join(" "))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,qf.Cf)((function(){$f.console.warn(zf+"[Warn]: "+e.join(" "))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,qf.Cf)((function(){$f.console.error(zf+"[Error]: "+e.join(" "))}))},e}();$f.__SENTRY__=$f.__SENTRY__||{};var Gf,Qf=$f.__SENTRY__.logger||($f.__SENTRY__.logger=new Hf),Wf=n(59212);function Kf(e){return"[object Object]"===Object.prototype.toString.call(e)}function Zf(e){return Boolean(e&&e.then&&"function"==typeof e.then)}!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"}(Gf||(Gf={}));var Yf=function(){function e(e){var t=this;this._state=Gf.PENDING,this._handlers=[],this._resolve=function(e){t._setResult(Gf.RESOLVED,e)},this._reject=function(e){t._setResult(Gf.REJECTED,e)},this._setResult=function(e,n){t._state===Gf.PENDING&&(Zf(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._attachHandler=function(e){t._handlers=t._handlers.concat(e),t._executeHandlers()},this._executeHandlers=function(){if(t._state!==Gf.PENDING){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e.done||(t._state===Gf.RESOLVED&&e.onfulfilled&&e.onfulfilled(t._value),t._state===Gf.REJECTED&&e.onrejected&&e.onrejected(t._value),e.done=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.resolve=function(t){return new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.all=function(t){return new e((function(n,r){if(Array.isArray(t))if(0!==t.length){var o=t.length,i=[];t.forEach((function(t,a){e.resolve(t).then((function(e){i[a]=e,0===(o-=1)&&n(i)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},e.prototype.then=function(t,n){var r=this;return new e((function(e,o){r._attachHandler({done:!1,onfulfilled:function(n){if(t)try{return void e(t(n))}catch(e){return void o(e)}else e(n)},onrejected:function(t){if(n)try{return void e(n(t))}catch(e){return void o(e)}else o(t)}})}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))},e.prototype.toString=function(){return"[object SyncPromise]"},e}(),Jf=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=C(t._breadcrumbs),n._tags=E({},t._tags),n._extra=E({},t._extra),n._contexts=E({},t._contexts),n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=C(t._eventProcessors),n._requestSession=t._requestSession),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){return this._tags=E(E({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=E(E({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){return this._extra=E(E({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=E(E({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=E(E({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e,t,n,r,o=this.getSpan();return(null===(e=o)||void 0===e?void 0:e.transaction)?null===(t=o)||void 0===t?void 0:t.transaction:(null===(r=null===(n=o)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?o.spanRecorder.spans[0]:void 0},e.prototype.setSession=function(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=E(E({},this._tags),t._tags),this._extra=E(E({},this._extra),t._extra),this._contexts=E(E({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):Kf(t)&&(t=t,this._tags=E(E({},this._tags),t.tags),this._extra=E(E({},this._extra),t.extra),this._contexts=E(E({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r=E({timestamp:(0,Vf.yW)()},e);return this._breadcrumbs=C(this._breadcrumbs,[r]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){var n;if(this._extra&&Object.keys(this._extra).length&&(e.extra=E(E({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=E(E({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=E(E({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=E(E({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=E({trace:this._span.getTraceContext()},e.contexts);var r=null===(n=this._span.transaction)||void 0===n?void 0:n.name;r&&(e.tags=E({transaction:r},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=C(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,this._notifyEventProcessors(C(Xf(),this._eventProcessors),e,t)},e.prototype._notifyEventProcessors=function(e,t,n,r){var o=this;return void 0===r&&(r=0),new Yf((function(i,a){var s=e[r];if(null===t||"function"!=typeof s)i(t);else{var c=s(E({},t),n);Zf(c)?c.then((function(t){return o._notifyEventProcessors(e,t,n,r+1).then(i)})).then(null,a):o._notifyEventProcessors(e,c,n,r+1).then(i).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function Xf(){var e=(0,qf.Rf)();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function ep(e){var t,n;if(Kf(e)){var r=e,o={};try{for(var i=O(Object.keys(r)),a=i.next();!a.done;a=i.next()){var s=a.value;void 0!==r[s]&&(o[s]=ep(r[s]))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o}return Array.isArray(e)?e.map(ep):e}var tp=function(){function e(e){this.errors=0,this.sid=(0,qf.DM)(),this.duration=0,this.status=jf.Ok,this.init=!0,this.ignoreDuration=!1;var t=(0,Vf.ph)();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||(0,Vf.ph)(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:(0,qf.DM)()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):this.status===jf.Ok?this.update({status:jf.Exited}):this.update()},e.prototype.toJSON=function(){return ep({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:ep({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},e}(),np=function(){function e(e,t,n){void 0===t&&(t=new Jf),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()},e.prototype.pushScope=function(){var e=Jf.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e},e.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=(0,qf.DM)(),r=t;if(!t){var o=void 0;try{throw new Error("Sentry syntheticException")}catch(e){o=e}r={originalException:e,syntheticException:o}}return this._invokeClient("captureException",e,E(E({},r),{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var r=this._lastEventId=(0,qf.DM)(),o=n;if(!n){var i=void 0;try{throw new Error(e)}catch(e){i=e}o={originalException:e,syntheticException:i}}return this._invokeClient("captureMessage",e,t,E(E({},o),{event_id:r})),r},e.prototype.captureEvent=function(e,t){var n=(0,qf.DM)();return"transaction"!==e.type&&(this._lastEventId=n),this._invokeClient("captureEvent",e,E(E({},t),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop(),r=n.scope,o=n.client;if(r&&o){var i=o.getOptions&&o.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,c=i.maxBreadcrumbs,l=void 0===c?100:c;if(!(l<=0)){var u=(0,Vf.yW)(),f=E({timestamp:u},e),p=s?(0,qf.Cf)((function(){return s(f,t)})):f;null!==p&&r.addBreadcrumb(p,l)}}},e.prototype.setUser=function(e){var t=this.getScope();t&&t.setUser(e)},e.prototype.setTags=function(e){var t=this.getScope();t&&t.setTags(e)},e.prototype.setExtras=function(e){var t=this.getScope();t&&t.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getScope();n&&n.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getScope();n&&n.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getScope();n&&n.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop(),n=t.scope,r=t.client;n&&r&&e(n)},e.prototype.run=function(e){var t=op(this);try{e(this)}finally{op(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return Qf.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e,t,n,r,o;null===(n=null===(t=null===(e=this.getStackTop())||void 0===e?void 0:e.scope)||void 0===t?void 0:t.getSession())||void 0===n||n.close(),this._sendSessionUpdate(),null===(o=null===(r=this.getStackTop())||void 0===r?void 0:r.scope)||void 0===o||o.setSession()},e.prototype.startSession=function(e){var t=this.getStackTop(),n=t.scope,r=t.client,o=r&&r.getOptions()||{},i=o.release,a=o.environment,s=((0,qf.Rf)().navigator||{}).userAgent,c=new tp(E(E(E({release:i,environment:a},n&&{user:n.getUser()}),s&&{userAgent:s}),e));if(n){var l=n.getSession&&n.getSession();l&&l.status===jf.Ok&&l.update({status:jf.Exited}),this.endSession(),n.setSession(c)}return c},e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession&&t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},e.prototype._invokeClient=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),i=o.scope,a=o.client;a&&a[e]&&(t=a)[e].apply(t,C(n,[i]))},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=rp(),o=r.__SENTRY__;if(o&&o.extensions&&"function"==typeof o.extensions[e])return o.extensions[e].apply(this,t);Qf.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function rp(){var e=(0,qf.Rf)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function op(e){var t=rp(),n=sp(t);return cp(t,e),n}function ip(){var e=rp();return ap(e)&&!sp(e).isOlderThan(4)||cp(e,new np),(0,Wf.KV)()?function(e){var t,n,r;try{var o=null===(r=null===(n=null===(t=rp().__SENTRY__)||void 0===t?void 0:t.extensions)||void 0===n?void 0:n.domain)||void 0===r?void 0:r.active;if(!o)return sp(e);if(!ap(o)||sp(o).isOlderThan(4)){var i=sp(e).getStackTop();cp(o,new np(i.client,Jf.clone(i.scope)))}return sp(o)}catch(t){return sp(e)}}(e):sp(e)}function ap(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function sp(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new np),e.__SENTRY__.hub}function cp(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}function lp(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=ip();if(r&&r[e])return r[e].apply(r,C(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function up(e,t){var n;try{throw new Error("Sentry syntheticException")}catch(e){n=e}return lp("captureException",e,{captureContext:t,originalException:e,syntheticException:n})}var fp=n(76727);const pp=(e,t)=>({selector:e,resolveView:e=>({...t,element:e})}),dp=(e,t,n)=>((e,t)=>{const{repoName:n,commitID:r}=e;return dl({repoName:n,revision:r,requestGraphQL:t}).pipe(hl())})(e,n).pipe(ze((()=>ml({repoName:e.repoName,filePath:e.filePath,commitID:e.commitID,requestGraphQL:n}))),H((t=>t?{...e,content:t.join("\n")}:{...e})),st((n=>ee(t(n)).pipe(ze((t=>{if(t)return z(e);throw n}))))));function hp(){return function(e){const t=function(e){if(void 0!==e.line)return{start:{line:e.line,character:e.character||0},end:{line:e.endLine||e.line,character:e.endCharacter||e.character||0}}}(e);if(void 0===t)return[];const n={line:t.start.line-1,character:Yn(t.start.character)},r={line:t.end.line-1,character:Yn(t.end.character)};return[{start:n,end:r,anchor:n,active:r,isReversed:!1}]}(ua(window.location.hash))}function mp(){return Ae(window,"hashchange").pipe(H(hp),Qe(((e,t)=>Ot()(e,t))))}function gp(e){const t=e.title.split(" \u2192 ");return t.length>1?{headFilePath:t[1],baseFilePath:t[0]}:{headFilePath:t[0],baseFilePath:t[0]}}function vp(e){const{pageType:t}=_p();if(!Ep(t))return null;let n="",r="";if("pull"===t){var o;const t=null===(o=document.querySelector("details-menu[src*='sha1='][src*='sha2=']"))||void 0===o?void 0:o.getAttribute("src"),i=e.classList.contains("js-comment-container");if(t){const e=new URLSearchParams(t),n=e.get("sha1"),r=e.get("sha2");if(n&&r)return{baseCommitID:n,headCommitID:r}}else if(i){const t=function(e){const t=e.querySelector(`summary a[href^="${location.pathname}"`);if(!t)return null;const n=t.href.match(bp);if(!n)return null;const r=n[3],o=yp(document.documentElement.innerHTML,!0);return r&&o?{...o,headCommitID:r}:null}(e);if(t)return t}else{const e=document.querySelector('input[name="comparison_start_oid"]');e&&(n=e.value);const t=document.querySelector('input[name="comparison_end_oid"]');t&&(r=t.value)}}else if("commit"===t){const e=document.querySelectorAll(".sha-block:not(.patch-diff-links)");if(e&&2===e.length){const t=e[0].querySelector("a");t&&(n=t.href.split("/").slice(-1)[0]);const o=e[1].querySelector("span.sha");o&&(r=o.innerHTML)}}else if("compare"===t){const e=function(){const[e,t]=document.querySelectorAll(".commitish-suggester .select-menu-button span");if(e&&t&&e.textContent&&t.textContent)return{baseCommitID:e.textContent,headCommitID:t.textContent};return}();if(e)return e}return""===n||""===r?yp(document.documentElement.innerHTML,"pull"===t):{baseCommitID:n,headCommitID:r}}const bp=/\/files\/((\w+)\.\.)?(\w+)#diff-\w+$/;function yp(e,t){if(!t)return null;const n="\x3c!-- base sha1: "",r=e.indexOf(n);if(-1===r)return null;const o="\x3c!-- head sha1: "",i=e.indexOf(o,r);if(-1===i)return null;return{baseCommitID:e.slice(r+n.length,40),headCommitID:e.slice(i+o.length,40)}}function wp(){const e=document.querySelector("a.js-permalink-shortcut");if(!e)throw new Error("Unable to determine the file path because no a.js-permalink-shortcut element was found.");const t=new URL(e.href),[,,,n,,...r]=t.pathname.split("/");if("tree"!==n&&0===r.length)throw new Error(`Unable to determine the file path because the a.js-permalink-shortcut element's href's path was ${t.pathname} (it is expected to be of the form /<user>/<repo>/blob/<commitID>/<path/to/file>).`);return decodeURIComponent(r.join("/"))}function Ep(e){switch(e){case"commit":case"pull":case"compare":return!0;default:return!1}}function _p(e=window.location){const{host:t,pathname:n}=e,[r,o,i,...a]=n.slice(1).split("/");if(!r||!o)throw new ll(`Could not parse repoName from GitHub url: ${e.href}`);const s=`${r}/${o}`,c=`${t}/${s}`;switch(i){case"blob":case"tree":return{pageType:i,rawRepoName:c,revisionAndFilePath:decodeURIComponent(a.join("/")),repoName:s};case"pull":case"commit":case"compare":return{pageType:i,rawRepoName:c,repoName:s};default:return{pageType:"other",rawRepoName:c,repoName:s}}}const xp=e=>{let t=e.closest("td").previousElementSibling;for(;t;){if(t.dataset.lineNumber)return parseInt(t.dataset.lineNumber,10);t=t.previousElementSibling}throw new Error("Could not find a line number in any cell")},Sp=e=>{var t;const n=e.closest("td.blob-code");return!n||null!==(t=n.parentElement)&&void 0!==t&&t.classList.contains("js-expandable-line")?null:n},Op=(e,t,n)=>{const r=Pp(e),o=((e,t)=>"base"===e?0:t?2:1)(n,r)+1,i=e.querySelector(`td:nth-child(${o})[data-line-number="${t}"]`);if(!i)return null;if(!r&&"base"===n&&!i.classList.contains("blob-num-addition")&&!i.classList.contains("blob-num-deletion"))return null;let a;if(r)a=i.nextElementSibling;else{a=i.parentElement.lastElementChild}return a},Tp=e=>e.classList.contains("blob-code-inner")?e:e.querySelector(".blob-code-inner"),Cp={getCodeElementFromTarget:e=>{const t=Sp(e);return t&&Tp(t)},getLineElementFromLineNumber:Op,getCodeElementFromLineNumber:(e,t,n)=>{const r=Op(e,t,n);return r&&Tp(r)},getLineNumberFromCodeElement:xp,getDiffCodePart:e=>{const t=e.closest("td");return t.classList.contains("blob-code-addition")?"head":t.classList.contains("blob-code-deletion")||Pp(e)&&t.nextElementSibling?"base":"head"},isFirstCharacterDiffIndicator:e=>{const t=e.closest(".blob-code-inner"),n=t&&["deletion","context","addition"].some((e=>t.classList.contains("blob-code-marker-"+e))),r=e.closest("tr"),o=null==r?void 0:r.querySelector("td[data-code-marker]"),i=null==t?void 0:t.hasAttribute("data-code-marker"),a=o||i,s=e.closest(".refined-github-diff-signs");return!n&&!a&&!s}},kp=(e,t)=>{const n=e.querySelector(`td[data-line-number="${t}"]`);return n&&n.nextElementSibling},Np={getCodeElementFromTarget:Sp,getCodeElementFromLineNumber:kp,getLineElementFromLineNumber:kp,getLineNumberFromCodeElement:xp},Ap=(e,t)=>{const n=((e,t)=>{const n=e.querySelectorAll("td.blob-num");let r=null;for(const e of n)if(e.querySelector("a").href.endsWith(`#L${t}`)){r=e;break}return r})(e,t);return n&&n.nextElementSibling},Ip={getCodeElementFromTarget:Sp,getCodeElementFromLineNumber:Ap,getLineElementFromLineNumber:Ap,getLineNumberFromCodeElement:e=>{const t=e.closest("td").previousElementSibling;return parseInt(t.firstElementChild.textContent,10)}};function Pp(e){const{pageType:t}=_p();if(!Ep(t))return!1;const n=e.classList.contains("file")?e:e.closest(".file");if(!n)throw new Error("Could not resolve code view element");if(n.classList.contains("js-comment-container"))return!1;const r=n.querySelector("table");if(!r)throw new Error("Could not find code view table");return r.classList.contains("js-file-diff-split")||r.classList.contains("file-diff-split")}const Rp=()=>{const e=_p();if("blob"!==e.pageType&&"tree"!==e.pageType)throw new Error(`Current URL does not match a blob or tree url: ${window.location.href}`);const{revisionAndFilePath:t,rawRepoName:n}=e,r=wp(),o=r&&!r.startsWith("/")?`/${r}`:r,i=o?t.slice(0,-o.length):t;if(!t.endsWith(o))throw new Error(`The file path ${o} should always be a suffix of revAndFilePath ${t}, but isn't in this case.`);return{blob:{rawRepoName:n,filePath:r,revision:i,commitID:fe({selector:".js-permalink-shortcut",hrefRegex:/^\/.*?\/.*?\/(?:blob|tree)\/([\da-f]{40})/})}}},Dp=/\/([\da-f]{40})$/i,Lp=e=>{const t=e.querySelector("a.commit-tease-sha");if(!t)throw new Error("Could not find commit link in snippet code view");const n=t.href.match(Dp);if(null==n||!n[1])throw new Error(`Could not parse commitID from snippet commit link href: ${t.href}`);const r=n[1],o=e.querySelectorAll("a:not(.commit-tease-sha)"),i=new URL(o[0].href),a=_p(i);if("blob"!==a.pageType)throw new Error(`Snippet URL does not match a blob url: ${i.href}`);const{revisionAndFilePath:s,rawRepoName:c}=a;if(!s.startsWith(r))throw new Error(`Could not parse filePath: revAndFilePath ${s} does not start with commitID ${r}`);return{blob:{rawRepoName:c,filePath:s.slice(r.length+1),commitID:r,revision:r}}},Mp=["tooltipped","tooltipped-n"];const jp="codeHost-module__command-palette-action-item_16BFG",Fp="codeHost-module__action-item_7QWb2",Bp="codeHost-module__icon_3PdA7",Up="codeHost-module__code-view-toolbar_gOzAp",qp="codeHost-module__code-view-toolbar-item_2fTzz",Vp="codeHost-module__hover-overlay-badge_3wpZt";function $p(e){const t="github-file-actions-toolbar-mount",n=e.querySelector("."+t);if(n)return n;const r=document.createElement("div");r.className=t;const o=e.querySelector(".file-actions");if(!o)throw new Error("Could not find GitHub file actions with selector .file-actions");o.classList.add("sg-github-file-actions");const i=e.querySelector(".show-file-notes");return i?i.after(r):o.prepend(r),r}const zp={dom:Cp,getToolbarMount:$p,resolveFileInfo:e=>{const{rawRepoName:t}=_p(),{headFilePath:n,baseFilePath:r}=function(e){const t=e.querySelector(".file-info");if(t){if("A"===t.tagName)return gp(t);const e=t.querySelector(".diffstat + a");if(e)return gp(e)}const n=e.querySelector(".file-header a");if(n)return gp(n);throw new Error("Could not determine diff file name")}(e);if(!n)throw new Error("cannot determine file path");const o=vp(e);if(!o)throw new Error("cannot determine delta info");const{headCommitID:i,baseCommitID:a}=o;return{head:{rawRepoName:t,filePath:n,commitID:i,revision:i},base:{rawRepoName:t,filePath:r||n,commitID:a,revision:a}}},getScrollBoundaries:e=>{const t=e.querySelector(".file-header");if(!t)throw new Error("Could not find .file-header element in GitHub PR code view");return[t]}},Hp={...zp,getToolbarMount:void 0},Gp={dom:Np,getToolbarMount:$p,resolveFileInfo:Rp,getSelections:hp,observeSelections:mp},Qp=e=>({direction:t,codeView:n,position:r})=>ml({...r,requestGraphQL:e}).pipe(H((e=>{const o=Np.getCodeElementFromLineNumber(n,r.line,r.part);if(!o)throw new Error("(adjustPosition) could not find code element for line provided");const i=e[r.line-1],a=o.textContent||"",s=i.length-Uf()(i).length,c=a.length-Uf()(a).length,l=t===Fn.ActualToCodeView?-1:1,u=Math.abs(s-c)*l;return{line:r.line,character:r.character+u}}))),Wp=pp(".code-list-item",{dom:Ip,getPositionAdjuster:Qp,resolveFileInfo:Lp}),Kp={dom:Np,resolveFileInfo:Lp,getPositionAdjuster:Qp},Zp=e=>{const t="sourcegraph-github-file-code-view-toolbar-mount",n=e.querySelector(`.${t}`);if(n)return n;const r=document.createElement("div");r.style.display="inline-flex",r.style.verticalAlign="middle",r.style.alignItems="center",r.className=t;const o=e.querySelector("#raw-url"),i=null==o?void 0:o.closest(".BtnGroup");if(null==i||!i.parentNode)throw new Error("File actions not found");return i.parentNode.insertBefore(r,i),r},Yp={selector:".js-file-line-container",resolveView:e=>{const t=e.closest(".blob-wrapper-embedded");if(t){return{element:t.parentElement,...Kp}}const{pageType:n}=_p();if("blob"!==n)return null;const r=e.closest(".repository-content");if(!r)throw new Error("Could not find repository content element");return{element:r,...Gp,getToolbarMount:Zp}}},Jp={selector:e=>{const t=new Set;for(const n of de(e,".file"))0===n.querySelectorAll(".js-diff-load-container").length&&t.add(n);for(const n of de(e,".js-blob-wrapper")){const e=n.closest(".file");e instanceof HTMLElement&&t.add(e)}return[...t]},resolveView:e=>{if(e.querySelector("article.markdown-body"))return null;if(e.closest(".js-suggested-changes-blob"))return null;const{pageType:t}=_p();return"blob"===t&&1===document.querySelectorAll(".file").length&&0===document.querySelectorAll(".diff-view").length?{element:e,...Gp}:e.closest(".discussion-item-body")||e.classList.contains("js-comment-container")?{element:e,...Hp}:{element:e,...zp}}};function Xp(){const e=document.head.querySelector('meta[property="og:site_name"]');return!!e&&("GitHub Enterprise"===e.content||"GitHub"===e.content)&&document.body.classList.contains("enterprise")}const ed="open-on-sourcegraph",td=i()(Bp,"v-align-text-bottom"),nd={[Qa]:"flash",[Wa]:"flash flash-success",[Ga]:"flash",[Ha]:"flash flash-warn",[za]:"flash flash-error"},rd={searchViewResolver:{selector:'.js-site-search-form input[type="text"][aria-controls="jump-to-results"]',resolveView:e=>({element:e})},resultViewResolver:{selector:"#jump-to-suggestion-search-global",resolveView:e=>({element:e})},onChange:({value:e,searchURL:t,resultElement:n})=>{var r;const o="#jump-to-sourcegraph-search-global";(n=>{const r=n.querySelector(".jump-to-suggestion-name");r.textContent=e,r.setAttribute("aria-label",e);const o=n.querySelector("a"),i=new URL(t);i.searchParams.append("q",e),o.setAttribute("href",i.href),o.setAttribute("target","_blank"),n.setAttribute("style","display: "+(e?"initial":"none !important"))})(null!==(r=document.querySelector(o))&&void 0!==r?r:(()=>{var e,t;const r=n.cloneNode(!0);r.id=o.replace("#",""),r.classList.remove("navigation-focus"),r.setAttribute("aria-selected","false");const i=document.createElement("img");i.src=fp,i.setAttribute("style","width: 16px; height: 20px; float: left; margin-right: 2px;"),i.setAttribute("alt","Sourcegraph Logo Image");const a=r.querySelector(".js-jump-to-badge-search-text-global");return a.textContent="Sourcegraph",null===(e=a.parentNode)||void 0===e||e.insertBefore(i,a),null===(t=n.parentNode)||void 0===t||t.insertBefore(r,n.nextElementSibling),r})())}},od=(e,t=Dc.fetchCache,n="#repository-container-header h1 span.Label")=>"github.com"!==window.location.hostname?Promise.resolve(!0):t({url:`https://api.github.com/repos/${e}`,credentials:"omit",cacheMaxAge:36e5}).then((e=>{const t=e.headers["x-ratelimit-remaining"];if(Number(t)<=0){const e=new Error("Github rate limit exceeded.");throw up(e),e}return e})).then((({data:e})=>"boolean"!=typeof e.private||e.private)).catch((e=>{var t,r;return console.warn("Failed to fetch if the repository is private.",e),"public"!==(null===(t=document.querySelector(n))||void 0===t||null===(r=t.textContent)||void 0===r?void 0:r.toLowerCase().trim())})),id=()=>"/search"===window.location.pathname,ad=()=>"/search/advanced"===window.location.pathname,sd=()=>!id()&&window.location.pathname.endsWith("/search"),cd=()=>Boolean(new URLSearchParams(window.location.search).get("q"))&&!ad(),ld=()=>{const e=new URLSearchParams(window.location.search).get("type");return e?e.toLowerCase():""},ud=e=>{const t=e.filter(Boolean).map((e=>e.trim())),n=(()=>{switch(ld()){case"repositories":return"repo";case"commits":return"commit";case"code":return"";default:return id()||ad()?"repo":""}})(),r=new URLSearchParams(window.location.search).get("l");if(n&&t.push(`type:${n}`),r&&t.push(`lang:${encodeURIComponent(r)}`),sd()){const[e,n]=window.location.pathname.split("/").filter(Boolean);t.push(`repo:${e}/${n}$`)}for(const e of["org","user"]){const n=t.findIndex((t=>t.startsWith(`${e}:`)));if(n>=0){const r=t[n].replace(`${e}:`,"");r&&(t[n]=`repo:${r}/*`)}}return t.join("+")},fd=(e,t="")=>{let n=document.querySelector(`#${e}`);return n||(n=document.createElement("div"),n.setAttribute("id",e),n.classList.add(...t.split(/\s/gi)),n)};const pd={type:"github",name:Xp()?"GitHub Enterprise":"GitHub",searchEnhancement:rd,enhanceSearchPage:function(e){if(!(id()||ad()||sd()||cd()))return;const n=({container:n,className:r="",getSearchQuery:o,utmCampaign:a})=>{const s=Tc(new URL("/search",e),{utm_source:Fc(),utm_campaign:a});(0,me.render)(t.createElement(tl,{label:"Search on Sourcegraph",title:"Search on Sourcegraph to get hover tooltips, go to definition and more",ariaLabel:"Search on Sourcegraph to get hover tooltips, go to definition and more",className:i()("btn","m-auto",r),iconClassName:i()("mr-1","v-align-middle",Bp),href:s.href,dataTestId:"search-on-sourcegraph",onClick:e=>{const t=ud(o());e.target.href=`${s.href}${t?`&q=${t}`:""}`}}),n)};if(cd()){const e=ld();if(["repositories","commits","code"].includes(e)||""===e&&(id()||sd())){var r,o;const e=document.querySelector(".application-main form.js-site-search-form"),t=null==e?void 0:e.querySelector("input.form-control[name='q']"),i=null==e||null===(r=e.parentElement)||void 0===r||null===(o=r.parentElement)||void 0===o?void 0:o.querySelector("button[type='submit']");if(t&&i){const e=fd("pageSearchFormSourcegraphButton","ml-2 d-none d-md-block");i.after(e),n({container:e,utmCampaign:"github-search-results-page",getSearchQuery:()=>t.value.split(" ")})}const a=document.querySelector("header form.js-site-search-form input.form-control[name='q']"),s=document.querySelector(".codesearch-results"),c=null==s?void 0:s.querySelector(".blankslate"),l=null==s?void 0:s.querySelector("div > div > h3");if(a&&(c||l)){const e=fd("headerSearchInputSourcegraphButton","ml-auto d-none d-lg-block");c?(e.classList.add("mt-2"),c.append(e)):l&&(e.classList.add("mr-2"),l.after(e)),n({container:e,className:c?"":"btn-sm",utmCampaign:"github-search-results-page",getSearchQuery:()=>a.value.split(" ")})}}return}const a=document.querySelector("#search_form"),s=null==a?void 0:a.querySelector(".search-form-fluid"),c=null==a?void 0:a.querySelector("input");if(s&&c){const e=fd("searchInputSourcegraphButton","ml-0 ml-md-2 mt-2 mt-md-0");null==s||s.append(e),n({container:e,utmCampaign:`github-${ad()?"advanced":"simple"}-search-page`,getSearchQuery:()=>c.value.split(" ")})}},codeViewResolvers:[Jp,Yp,Wp],contentViewResolvers:[{selector:".markdown-body",resolveView:e=>({element:e})}],nativeTooltipResolvers:[{selector:".js-tagsearch-popover",resolveView:e=>({element:e})}],routeChange:e=>e.pipe(H((()=>{const{pathname:e}=window.location,t=e.slice(1).split("/")[2];return"blob"===t||"tree"===t?e.endsWith(wp())?e:void 0:cd()?null===(n=document.querySelector(".codesearch-results h3"))||void 0===n||null===(r=n.textContent)||void 0===r?void 0:r.trim():e;var n,r})),qe(Boolean),Qe()),getContext:async()=>{const{repoName:e,rawRepoName:t,pageType:n}=_p();return{rawRepoName:t,revision:"blob"===n||"tree"===n?Rp().blob.revision:void 0,privateRepository:await od(e)}},isLightTheme:gf((()=>{const e=document.documentElement.dataset.colorMode;return"auto"===e?((e=window)=>{const t=e.matchMedia("(prefers-color-scheme: dark)");return{observable:le(z(!t.matches),Ae(t,"change").pipe(H((e=>!e.matches)))),initialValue:!t.matches}})().observable:z("dark"!==e)})),getViewContextOnSourcegraphMount:e=>{const t=he(e,".pagehead-actions");if(!t||0===t.children.length)return null;let n=t.querySelector("#open-on-sourcegraph");return n||(n=document.createElement("li"),n.id=ed,t.prepend(n),n)},viewOnSourcegraphButtonClassProps:{className:"btn btn-sm tooltipped tooltipped-s",iconClassName:td},check:()=>((e=window.location.href)=>/^https?:\/\/(www\.)?github\.com/.test(e))()||Xp(),getCommandPaletteMount:e=>{const t="command-palette-button",n=e.querySelector(`.Header .${t}`);if(n)return n;const r=he(e,".HeaderMenu > :last-child");if(r){const e=document.createElement("div");return e.classList.add(t),r.prepend(e),e}let o=he(e,".Header-item:nth-last-child(2)");if(o){0!==o.previousElementSibling.children.length&&(o=o.previousElementSibling);const e=document.createElement("div");return e.classList.add("Header-item","mr-0","mr-lg-3",t),o.before(e),e}return null},notificationClassNames:nd,commandPaletteClassProps:{buttonClassName:"Header-link d-flex flex-items-baseline",popoverClassName:"Box",formClassName:"p-1",inputClassName:"form-control input-sm header-search-input jump-to-field",listClassName:"p-0 m-0 js-navigation-container jump-to-suggestions-results-container",selectedListItemClassName:"navigation-focus",listItemClassName:"d-flex flex-justify-start flex-items-center p-0 f5 navigation-item js-navigation-item js-jump-to-scoped-search",actionItemClassName:i()(jp,"no-underline d-flex flex-auto flex-items-center jump-to-suggestions-path p-2"),noResultsClassName:"d-flex flex-auto flex-items-center jump-to-suggestions-path p-2",iconClassName:td},codeViewToolbarClassProps:{className:Up,listItemClass:i()(qp,"BtnGroup"),actionItemClass:i()("btn btn-sm tooltipped tooltipped-s BtnGroup-item",Fp),actionItemPressedClass:"selected",actionItemIconClass:i()(Bp,"v-align-text-bottom")},hoverOverlayClassProps:{className:"Box",actionItemClassName:"btn btn-sm btn-secondary",actionItemPressedClassName:"active",badgeClassName:i()("label",Vp),getAlertClassName:mu(nd,"flash-full"),iconClassName:td},setElementTooltip:function(e,t){"string"==typeof t?(e.classList.add(...Mp),e.setAttribute("aria-label",t)):(e.classList.remove(...Mp),e.removeAttribute("aria-label"))},linkPreviewContentClass:"text-small text-gray p-1 mx-1 border rounded-1 bg-gray text-gray-dark",urlToFile:(e,t,n)=>{if(t.viewState)return ga(e,t);if(!t.rawRepoName.startsWith(window.location.hostname))return ga(e,t);const r=t.revision||"HEAD",{rawRepoName:o}=_p();if(o===t.rawRepoName&&void 0!==n.part){const e=document.querySelectorAll(".file");for(const r of e){const e=r.querySelector(".file-header[data-path][data-anchor]");if(!e)continue;if(e.dataset.path===t.filePath){const r=e.dataset.anchor,o=new URL(window.location.href);if(o.hash=r,t.position&&(o.hash+=`${"base"===n.part?"L":"R"}${t.position.line}`),!document.querySelector(o.hash))break;return o.href}}}const i=t.position?`#L${t.position.line}${t.position.character?`:${t.position.character}`:""}`:"";return`https://${t.rawRepoName}/blob/${r}/${t.filePath}${i}`},codeViewsRequireTokenization:!0},dd=(e,t,n)=>e.querySelector(`#LC${t}`),hd={getCodeElementFromTarget:e=>e.closest("span.line"),getLineNumberFromCodeElement:e=>{const t=e.id.replace(/^LC/,"");return parseInt(t,10)},getCodeElementFromLineNumber:dd,getLineElementFromLineNumber:dd},md=e=>{const t=e.closest("[data-interop-type]");return t?"old"===t.dataset.interopType?"base":"head":(e=>{let t="old";const n=e.closest(".diff-td,td");return n.classList.contains("parallel")&&(t="left-side"),n.classList.contains(t)?"base":"head"})(e)},gd=(e,t,n)=>{const r="base"===n?"old":"new",o=e.querySelector(`[data-interop-${r}-line="${t}"]`);return o?o.querySelector("span.line"):((e,t,n)=>{const r=e.querySelector(`.${"base"===n?"old_line":"new_line"} [data-linenumber="${t}"]`);if(!r)return null;const o=r.closest(".diff-tr,tr");if(!o)return null;let i="span.line";return o.classList.contains("parallel")&&(i=`.${"base"===n?"left-side":"right-side"} ${i}`),o.querySelector(i)})(e,t,n)},vd={getCodeElementFromTarget:hd.getCodeElementFromTarget,getLineNumberFromCodeElement:e=>{const t=e.closest("[data-interop-line]");return t?parseInt(t.dataset.interopLine||"",10):(e=>{const t=md(e);let n=e.closest(".diff-td,td");for(;n&&(!n.matches(".diff-line-num."+("base"===t?"old_line":"new_line"))||!n.querySelector("a"))&&n.previousElementSibling;)n=n.previousElementSibling;if(n){const e=n.querySelector("a");return parseInt(e.dataset.linenumber||"",10)}throw new Error("Unable to determine line number for diff code element")})(e)},getCodeElementFromLineNumber:gd,getLineElementFromLineNumber:(e,t,n)=>{const r=gd(e,t,n);return r&&r.parentElement},getDiffCodePart:md},bd=(e,t,n)=>`${window.location.origin}/api/v4/projects/${encodeURIComponent(e)}%2f${t}${n}`,yd=e=>ar(e,{selector:e=>ur(e).json()}),wd=jo((e=>yd(`${window.location.origin}/api/v4/projects/${e}`).pipe(H((({web_url:e})=>{const{hostname:t,pathname:n}=new URL(e);return`${t}${n}`})))),Na()),Ed=jo((({owner:e,projectName:t,mergeRequestID:n,diffID:r})=>r?yd(bd(e,t,`/merge_requests/${n}/versions/${r}`)).pipe(H((({base_commit_sha:e})=>e))):z(void 0)),(({owner:e,projectName:t,mergeRequestID:n,diffID:r})=>`${e}:${t}:${n}:${String(r)}`)),_d=jo((({owner:e,projectName:t,mergeRequestID:n,rawRepoName:r,diffID:o})=>rl(yd(bd(e,t,`/merge_requests/${n}`)),Ed({owner:e,projectName:t,mergeRequestID:n,diffID:o})).pipe(ze((([{diff_refs:e,source_project_id:t},n])=>wd(t).pipe(H((t=>({baseCommitID:n||e.base_sha,commitID:e.head_sha,rawRepoName:r,baseRawRepoName:t})))))))),(({owner:e,projectName:t,mergeRequestID:n,rawRepoName:r,diffID:o})=>`${e}:${t}:${n}:${r}:${String(o)}`)),xd=jo((({owner:e,projectName:t,commitID:n})=>yd(bd(e,t,`/repository/commits/${n}`)).pipe(H((({parent_ids:e})=>Su()(e))))),(({owner:e,projectName:t,commitID:n})=>`${e}:${t}:${n}`));var Sd=n(68642),Od=n.n(Sd),Td=n(90006),Cd=n.n(Td);let kd;!function(e){e[e.File=0]="File",e[e.Commit=1]="Commit",e[e.MergeRequest=2]="MergeRequest",e[e.Other=3]="Other"}(kd||(kd={}));function Nd(){const e=document.querySelector(".context-header a");if(!e)throw new Error("Unable to determine project name");const t=new URL(e.href).pathname.slice(1),n=t.split("/"),r=Od()(n,n.length-1).join("/"),o=Cd()(n),i=((e,t,n)=>{const r=n.match(new RegExp(`^/${e}/${t}(/-)?/(commit|merge_requests|blob)/`));if(!r)return kd.Other;switch(r[2]){case"commit":return kd.Commit;case"merge_requests":return kd.MergeRequest;case"blob":return kd.File;default:return kd.Other}})(r,o,window.location.pathname);return{owner:r,projectName:o,rawRepoName:[Ic?window.location.hostname:new URL(gon.gitlab_url).hostname,r,o].join("/"),repoName:t,pageKind:i}}const Ad=()=>{let e=window.location.pathname.match(/merge_requests\/(.*?)\/diffs/);if(!e&&document.querySelector(".diffs-tab.active")&&(e=window.location.pathname.match(/merge_requests\/(.*?)((\/)|$)/)),!e)throw new Error("Unable to determine merge request ID");return e[1]},Id=e=>{const t=e.dataset.originalTitle||e.dataset.title||e.title;if(!t)throw new Error("Unable to get file paths from code view: no file title");return t.endsWith(" deleted")?t.slice(0,-8):t};function Pd(e){const t=e.querySelectorAll(".file-title-name");if(0===t.length)throw new Error("Unable to get file paths from code view: no .file-title.name");const n=t.length>1,r=Id(t.item(n?1:0));return{headFilePath:r,baseFilePath:n?Id(t.item(0)):r}}function Rd(){const{rawRepoName:e,owner:t,projectName:n}=Nd();return{rawRepoName:e,owner:t,projectName:n,commitID:Cd()(window.location.pathname.split("/"))}}const Dd="codeHost-module__command-list-popover_hwImg",Ld="codeHost-module__hover-overlay_3Cize";const Md=(e,t)=>{const n=e.querySelector(".sg-toolbar-mount-gitlab");if(n)return n;const r=e.querySelector(".file-actions");if(!r)throw new Error("Unable to find mount location");const o=document.createElement("div");return o.classList.add("sg-toolbar-mount","sg-toolbar-mount-gitlab"),t===kd.Commit&&o.classList.add("gl-mr-3"),r.prepend(o),o},jd={dom:hd,getToolbarMount:e=>Md(e,kd.File),resolveFileInfo:()=>{const{rawRepoName:e,filePath:t,revision:n}=function(){const{rawRepoName:e}=Nd(),t=window.location.pathname.match(/\/blob\/(.*?)\/(.*)/);if(!t)throw new Error("Unable to determine revision or file path");const n=decodeURIComponent(t[1]);return{rawRepoName:e,filePath:decodeURIComponent(t[2]),revision:n}}();if(!t)throw new Error(`Unable to determine the file path of the current file because the current URL (window.location ${window.location.href}) does not have a file path.`);return{blob:{rawRepoName:e,filePath:t,commitID:fe({selector:".js-data-file-blob-permalink-url",hrefRegex:new RegExp("^/.*?/.*?/blob/([0-9a-f]{40})/")}),revision:n}}},getSelections:hp,observeSelections:mp},Fd=e=>{const t=e.querySelector(".js-file-title");if(!t)throw new Error("Could not find .file-title element");return[t]},Bd={dom:vd,getToolbarMount:e=>Md(e,kd.MergeRequest),resolveFileInfo:e=>{return ee(_d({...Nd(),mergeRequestID:Ad(),diffID:null!==(t=new URLSearchParams(window.location.search).get("diff_id"))&&void 0!==t?t:void 0})).pipe(H((t=>{const{rawRepoName:n,baseRawRepoName:r,commitID:o,baseCommitID:i}=t,{headFilePath:a,baseFilePath:s}=Pd(e);return{head:{rawRepoName:n,filePath:a,commitID:o},base:{rawRepoName:r,filePath:s,commitID:i}}})));var t},getScrollBoundaries:Fd},Ud={dom:vd,getToolbarMount:e=>Md(e,kd.Commit),resolveFileInfo:e=>rr(Rd).pipe(ze((({owner:e,projectName:t,commitID:n,rawRepoName:r})=>xd({owner:e,projectName:t,commitID:n}).pipe(H((e=>({commitID:n,baseCommitID:e,rawRepoName:r})))))),H((({commitID:t,baseCommitID:n,rawRepoName:r})=>{const{headFilePath:o,baseFilePath:i}=Pd(e);return{head:{rawRepoName:r,filePath:o,commitID:t},base:{rawRepoName:r,filePath:i,commitID:n}}}))),getScrollBoundaries:Fd},qd={selector:".file-holder",resolveView:e=>{if(e.classList.contains("discussion-wrapper"))return null;const{pageKind:t}=Nd();return t===kd.Other?null:t===kd.File?{element:e,...jd}:t===kd.MergeRequest?e.querySelector(".file-actions")?{element:e,...Bd}:null:{element:e,...Ud}}},Vd={[Qa]:"alert alert-secondary",[Wa]:"alert alert-success",[Ga]:"alert alert-info",[Ha]:"alert alert-warning",[za]:"alert alert-danger"},$d=(e,t=Dc.fetchCache)=>"gitlab.com"===window.location.hostname&&e?t({url:`https://gitlab.com/api/v4/projects/${encodeURIComponent(e)}`,credentials:"omit",cacheMaxAge:36e5}).then((e=>{const t=e.headers["ratelimit-remaining"];if(Number(t)<=0){const e=new Error("Gitlab rate limit exceeded.");throw up(e),e}return e})).then((({status:e})=>200!==e)).catch((e=>(console.warn("Failed to fetch repository visibility info.",e),!0))):Promise.resolve(!0),zd={type:"gitlab",name:"GitLab",check:function(){return!!document.head.querySelector('meta[content="GitLab"]')},codeViewResolvers:[qd],adjustOverlayPosition:({top:e,left:t})=>{const n=document.querySelector("header");n&&(e+=n.getBoundingClientRect().height);const r=document.querySelector("#js-peek.development");return r&&(e+=r.getBoundingClientRect().height),{top:e,left:t}},getCommandPaletteMount:e=>{const t=he(e,".navbar-collapse");if(!t)return null;const n="command-palette-button";return t.querySelector("."+n)||(()=>{const e=document.createElement("div");return e.className=n,t.prepend(e),e})()},getContext:async()=>{const{repoName:e,...t}=Nd();return{...t,privateRepository:await $d(e)}},urlToFile:(e,t,n)=>{if(t.viewState||!t.rawRepoName.startsWith(window.location.hostname))return ga(e,t);if(Nd().rawRepoName===t.rawRepoName&&void 0!==n.part){const e=bf(document.body,qd.selector);for(const r of e){const{headFilePath:e,baseFilePath:o}=Pd(r);if(e!==t.filePath&&o!==t.filePath)continue;if(!t.position){const e=new URL(window.location.href);return e.hash=r.id,e.href}const i=null!==n.part?{head:".new_line",base:".old_line"}[n.part]:"",a=r.querySelector(`${i} a[data-linenumber="${t.position.line}"]`);if(!a)break;return new URL(a.href).href}}const r=new URL(`https://${t.rawRepoName}/blob/${t.revision}/${t.filePath}`);if(t.position){const{line:e}=t.position;r.hash=`#L${e}`}return r.href},notificationClassNames:Vd,commandPaletteClassProps:{popoverClassName:i()("dropdown-menu",Dd),formClassName:"dropdown-input",inputClassName:"dropdown-input-field",resultsContainerClassName:"dropdown-content",selectedActionItemClassName:"is-focused",noResultsClassName:"px-3",iconClassName:"s16 align-bottom"},codeViewToolbarClassProps:{className:"pl-0",actionItemClass:"btn btn-md gl-button btn-icon",actionItemPressedClass:"active",actionItemIconClass:"gl-button-icon gl-icon s16"},hoverOverlayClassProps:{className:i()("card",Ld),actionItemClassName:"btn btn-secondary",actionItemPressedClassName:"active",iconClassName:"square s16",getAlertClassName:mu(Vd)},codeViewsRequireTokenization:!0,getHoverOverlayMountLocation:()=>{const{pageKind:e}=Nd();return e===kd.MergeRequest?"div.tab-pane.diffs":null}},Hd=e=>Boolean("TH"===e.tagName&&e.textContent||e.dataset.n),Gd=e=>parseInt(("TH"===e.tagName?e.textContent:e.dataset.n)||"",10),Qd=e=>{let t=e;for(;t;){if(Hd(t))return t;t=t.previousElementSibling}return null},Wd=(e,t,n)=>{let r=((e,t,n)=>{const r=e.querySelector("td[data-n]")?"td[data-n]":`th:nth-of-type(${"base"===n?1:2})`;for(const o of e.querySelectorAll(r))if(Gd(o)===t){if("head"===n&&null===o.previousElementSibling)continue;return o}return null})(e,t,n);for(;r&&("TD"!==r.tagName||r.classList.contains("n")||Hd(r)||r.classList.contains("copy"));)r=r.nextElementSibling;return r},Kd={getCodeElementFromTarget:e=>{if("TH"===e.tagName||e.classList.contains("copy"))return null;const t=e.closest("td");return t?t.classList.contains("show-more")||t.classList.contains("show-context")?null:Qd(t)?t:null:null},getCodeElementFromLineNumber:Wd,getLineElementFromLineNumber:Wd,getLineNumberFromCodeElement:e=>{const t=Qd(e);if(!t)throw new Error("Could not find line number cell from code element");return Gd(t)},getDiffCodePart:e=>{if(e.classList.contains("old"))return"base";if(e.classList.contains("new"))return"head";const t=Qd(e);if(!t)throw new Error("Could not find line number cell from code element");return t.classList.contains("left")?"base":t.classList.contains("right")||t.previousElementSibling?"head":"base"},isFirstCharacterDiffIndicator:e=>{const t=e.firstElementChild;return!(null==t||!t.classList.contains("aural-only"))}},Zd=(e,t,n)=>{const r=e.querySelector(`tr:nth-of-type(${t})`);if(!r)throw new Error(`unable to find row ${t} from code view`);return r.querySelector("td")},Yd={getCodeElementFromTarget:e=>e.closest("td"),getCodeElementFromLineNumber:Zd,getLineElementFromLineNumber:Zd,getLineNumberFromCodeElement:e=>{let t=e;for(;null!==t&&"TH"!==t.tagName&&!t.classList.contains("phabricator-source-line");)t=t.previousElementSibling;if(!t)throw new Error("could not find line number cell from code element");const n=t.querySelector("a");if(!n)throw new Error("could not find line number anchor from code element");if(void 0!==n.dataset.n){const e=parseInt(n.dataset.n,10);if(isNaN(e))throw new TypeError(`Could not parse lineNumber from data-n attribute: ${n.dataset.n}`);return e}const r=parseInt(n.textContent||"",10);if(isNaN(r))throw new TypeError(`Could not parse lineNumber from lineAnchor.textContent: ${String(n.textContent)}`);return r},isFirstCharacterDiffIndicator:()=>!1};let Jd;!function(e){e[e.Diffusion=1]="Diffusion",e[e.Differential=2]="Differential",e[e.Revision=3]="Revision",e[e.Change=4]="Change"}(Jd||(Jd={}));const Xd=/r([\dA-z]+)([\da-f]{40})/;function eh(){const e=document.querySelectorAll(".phui-tag-core").item(0);if(!e)throw new Error("Could not find Phabricator page tag");return Xd.exec(e.children[0].getAttribute("href"))}function th(){const e=eh();if(!e)throw new Error("Could not determine callsign from page tag");return e[1]}function nh(){const e=eh();if(!e)throw new Error("Could not determine commitID from page tag");return e[2]}const rh=/Diff (\d+)/;const oh=/^\/?(source|diffusion)\/([\w-]+)\/browse\/([\w-]+\/)?([^$;]+)(;[\da-f]{40})?(?:\$\d+)?/i,ih=/^\/?(d\d+)(?:\?(?:(?:id=(\d+))|(vs=(?:\d+|on)&id=\d+)))?/i,ah=/^\/?r([\dA-z]+)([\da-f]{40})/i,sh=/^\/?(source|diffusion)\/([\da-z]+)\/change\/([\w-]+)\/([^;]+)(;[\da-f]{40})?/i,ch=/^\/?\/differential\/changeset.*/i,lh=/^vs=((?:\d+|on))&id=(\d+)/i;function uh(e,t,n){try{const r=e.href.replace(e.origin,""),o=oh.exec(r);if(o){const e=o[4];if(!e)throw new Error(`Could not determine file path from diffusionMatch, stateUrl: ${r}`);return vh(th(),t,n).pipe(H((({rawRepoName:t})=>({mode:Jd.Diffusion,rawRepoName:t,filePath:e,commitID:nh()}))))}const i=ih.exec(r);if(i){const e=i[1],r=i[3],o=parseInt(e.split("D")[1],10);let a,s=i[2]?parseInt(i[2],10):void 0;if(s||(s=function(){const e=document.querySelector("#differential-review-stage");if(!e)throw new Error("no element with id differential-review-stage found on page.");const t=e.parentElement;if(!t)throw new Error("parent container of diff container not found.");const n=t.children[0].querySelectorAll(".phui-header-header").item(0);if(!n||!n.textContent)throw new Error("Could not find diffTitle element, or it had no text content");const r=rh.exec(n.textContent);if(!r)throw new Error(`diffTitle element does not match pattern. Content: '${n.textContent}'`);return parseInt(r[1],10)}()),r){const e=lh.exec(r),t=null==e?void 0:e[1];t&&"on"!==t&&(a=parseInt(t,10),console.log(`comparison diffID ${s} baseDiffID ${a}`))}return yh(o,t,n).pipe(H((({rawRepoName:e})=>({baseRawRepoName:e,headRawRepoName:e,revisionID:o,diffID:s,baseDiffID:a,mode:Jd.Differential}))))}const a=ah.exec(r);if(a){const e=a[1],r=a[2],o=function(){const e=document.querySelectorAll(".phui-property-list-key");for(const t of e)if("Parents "===t.textContent){const e=t.nextSibling.children[0].children[0].href,n=new URL(e),r=ah.exec(n.pathname);if(r)return r[2]}throw new Error("Could not determine base commit ID from revision page")}();return vh(e,t,n).pipe(H((({rawRepoName:e})=>({mode:Jd.Revision,rawRepoName:e,baseCommitID:o,headCommitID:r}))))}const s=sh.exec(r);if(s){const e=s[8],r=th(),o=nh();return vh(r,t,n).pipe(H((({rawRepoName:t})=>({mode:Jd.Change,filePath:e,rawRepoName:t,commitID:o}))))}if(ch.exec(r)){const e=document.querySelector(".phui-crumbs-view");if(!e)throw new Error("failed parsing changeset dom");const[,r,o]=e.querySelectorAll("a"),i=r.getAttribute("href").match(/D(\d+)/);if(!i)throw new Error("failed parsing differentialID");const a=parseInt(i[1],10),s=o.getAttribute("href").match(/\/differential\/diff\/(\d+)/);if(!s)throw new Error("failed parsing diffID");const c=parseInt(s[1],10);return yh(a,t,n).pipe(H((({rawRepoName:e})=>({baseRawRepoName:e,headRawRepoName:e,revisionID:a,diffID:c,mode:Jd.Differential}))))}throw new Error(`Could not determine Phabricator state from stateUrl ${r}`)}catch(e){return vt(e)}}function fh(e){let t=e;if(t=t.replace("\\",""),e.startsWith("git@"))t=e.slice("git@".length),t=t.replace(":","/");else if(e.startsWith("git://"))t=e.slice("git://".length);else if(e.startsWith("https://"))t=e.slice("https://".length);else if(e.includes("@")){t=e.split("@")[1],t=t.replace(":","/")}return t.replace(/.git$/,"")}function ph(e,t){const n=function(){const e=document.querySelector(".phabricator-search-menu form");if(!e)throw new Error("cannot create conduit request form");const t=new FormData;return t.set("__csrf__",e.querySelector("input[name=__csrf__]").value),t.set("__form__",e.querySelector("input[name=__form__]").value),t}();for(const[e,r]of Object.entries(t))n.set(`params[${e}]`,JSON.stringify(r));return ar(window.location.origin+e,{method:"POST",body:n,credentials:"include",headers:{Accept:"application/json"},selector:e=>ur(e).json()}).pipe(H((e=>{if(null!==e.error_code)throw new Error(`error ${e.error_code}: ${e.error_info}`);return e.result})))}const dh=jo((({diffID:e,revisionID:t,queryConduit:n=ph})=>n("/api/differential.querydiffs",{ids:[e],revisionIDs:[t]}).pipe(H((t=>t[String(e)])))),(({diffID:e,revisionID:t})=>`${e}-${t}`)),hh=jo((({diffID:e,queryConduit:t=ph})=>t("/api/differential.getrawdiff",{diffID:e})),(({diffID:e})=>e.toString())),mh=jo((({revisionID:e,queryConduit:t=ph})=>t("/api/differential.query",{ids:[e]}).pipe(H((t=>{const n=t[0].repositoryPHID;if(!n)throw new Error(`no repositoryPHID for revision ${e}`);return n})))),(({revisionID:e})=>e.toString())),gh=jo((({requestGraphQL:e,...t})=>e({request:fr`
|
|
102
|
+
`,variables:{...e,source:Ci.CODEHOSTINTEGRATION,argument:e.argument&&JSON.stringify(e.argument),publicArgument:e.publicArgument&&JSON.stringify(e.publicArgument)},mightContainPrivateInfo:!1}).subscribe({error:e=>{}})})({name:e,userCookieID:o,url:this.sourcegraphURL,argument:{platform:this.platform,version:this.version,...t},publicArgument:{platform:this.platform,version:this.version,...n}},this.requestGraphQL)}async log(e,t,n){switch(e){case"findReferences":await this.logEvent(e,t,n,Ui.CODEINTELINTEGRATIONREFS);break;case"goToDefinition":case"goToDefinition.preloaded":case"hover":await this.logEvent(e,t,n,Ui.CODEINTELINTEGRATION);break;default:await this.logEvent(e,t,n)}}async logViewEvent(e,t){await this.logEvent(`View${e}`,t)}async logPageView(e,t,n){await this.logEvent(`${e}Viewed`,t,n)}}const ql={allowErrorReporting:!1,sendTelemetry:!0,experimentalLinkPreviews:!1,experimentalTextFieldCompletion:!1,clickToGoToDefinition:!1},Vl=({get:e,set:t})=>({set:t,enable:e=>t(e,!0),disable:e=>t(e,!1),async isEnabled(t){const n=await e(t);return"boolean"==typeof n?n:ql[t]},async toggle(n){const r=await e(n);return await t(n,!r),!r}});const $l=Vl({get:async function(e){const{featureFlags:t={}}=await qc.sync.get();return t[e]},set:async function(e,t){const{featureFlags:n}=await qc.sync.get("featureFlags");await qc.sync.set({featureFlags:{...n,[e]:t}})}}),zl=Vl({get:async e=>{const t=localStorage.getItem(e);return null===t?void 0:"true"===t},set:async(e,t)=>{localStorage.setItem(e,String(t))}}),Hl=Pc?zl:$l,Gl={sendTelemetry:!1,allowErrorReporting:!1,experimentalLinkPreviews:!1,experimentalTextFieldCompletion:!1,clickToGoToDefinition:!1},Ql=e=>({...Gl,...e}),Wl=()=>(Ic?Vc("sync","featureFlags"):z(void 0)).pipe(H(Ql));function Kl(e){return Wl().pipe(H((t=>t[e])),Qe())}const Zl=e=>jc(e).pipe(H((t=>!(Lc()&&e)||!Uc(t)))),Yl=e=>Oe([Zl(e),Kl("sendTelemetry")]).pipe(H((([e,t])=>!!e||t)));function Jl(){const{host:e,pathname:t}=location,[n,r]=t.slice(1).split("/");if(!n||!r)throw new ll(`Could not parse repoName from Bitbucket Cloud url: ${location.href}`);return`${e}/${n}/${r}`}const Xl={getCodeElementFromTarget:e=>e.closest(".view-line > span"),getLineNumberFromCodeElement:e=>{if(!document.querySelector(".line-number"))throw new Error("No line number elements found on the currently viewed page");const t=e.closest(".react-monaco-editor-container");if(!t)throw new Error("No editor found");const n=e.closest(".view-line"),r=[...t.querySelectorAll(".view-line")].findIndex((e=>e===n)),o=t.querySelectorAll(".line-number")[r];if(o){var i,a,s;let e=parseInt(null!==(i=o.dataset.lineNum)&&void 0!==i?i:"",10);if(!isNaN(e))return e;if(e=parseInt(null!==(a=null===(s=o.textContent)||void 0===s?void 0:s.trim())&&void 0!==a?a:"",10),!isNaN(e))return e}throw new Error("Could not find line number")},getLineElementFromLineNumber:eu,getCodeElementFromLineNumber:(e,t)=>{const n=eu(e,t);if(!n)return null;const r=n.querySelector(":scope > span");return r||console.error(`Could not find code element inside .view-line container for line #${t}`),r}};function eu(e,t){let n=e.querySelector(`[data-line-num="${t}"]`);if(!n)for(const o of e.querySelectorAll(".line-number")){var r;if(parseInt(null!==(r=o.textContent)&&void 0!==r?r:"",10)===t){n=o;break}}if(!n)return console.error(`Could not find line number element for line #${t}`),null;const o=[...e.querySelectorAll(".line-number")].findIndex((e=>e===n)),i=e.querySelectorAll(".view-line")[o];return i||console.error(`Could not find line element for line #${t}`),i}function tu(e,t,n){var r,o;const i=null===(r=e.querySelector(`[aria-label="${"base"===n?"From":"To"} line ${t}"]`))||void 0===r||null===(o=r.closest(".line-wrapper"))||void 0===o?void 0:o.querySelector(".code-component");if(!i)throw new Error(`Could not locate line number element for line ${t}, part: ${String(n)}`);return i}const nu={getCodeElementFromTarget:e=>e.closest(".code-diff"),getLineNumberFromCodeElement:e=>{var t;const n=e.closest(".line-wrapper"),r=null==n?void 0:n.querySelectorAll(".line-number-permalink");if(!r||0===r.length)throw new Error("Could not find line number permalink(s) for code element");const o=r[r.length-1],i=parseInt(null!==(t=o.textContent)&&void 0!==t?t:"",10);if(!isNaN(i))return i;throw new Error("Could not find line number for code element")},getLineElementFromLineNumber:tu,getCodeElementFromLineNumber:(e,t,n)=>{var r;return null===(r=tu(e,t,n))||void 0===r?void 0:r.querySelector(".code-diff")},getDiffCodePart:e=>{var t,n,r;const o=e.closest(".code-component"),i=null==o?void 0:o.querySelector(".line-type");if(null!=i&&null!==(t=i.textContent)&&void 0!==t&&t.includes("+"))return"head";if(null!=i&&null!==(n=i.textContent)&&void 0!==n&&n.includes("+"))return"base";if(!e.closest(".side-by-side"))return"head";const a=e.closest(".line-wrapper");if(null!=a&&a.id)return null!=a&&a.id.includes("oldline")?"base":"head";return 0===[...(null==a||null===(r=a.parentElement)||void 0===r?void 0:r.childNodes)||[]].findIndex((e=>e===a))?"base":"head"},isFirstCharacterDiffIndicator:()=>!1};function ru(e,t,n){var r;const o=null===(r=e.querySelector(`[data-${"base"===n?"f":"t"}num="${t}"]`))||void 0===r?void 0:r.closest(".udiff-line");if(!o)throw new Error(`Could not locate line number element for line ${t}, part: ${String(n)}`);return o}const ou={getCodeElementFromTarget:e=>e.closest(".source"),getLineNumberFromCodeElement:e=>{const t=e.closest(".udiff-line");if(!t)throw new Error("Could not find line element");const n=t.querySelector(".line-numbers");if(!n)throw new Error("Could not find line numbers element");const r=null==n?void 0:n.dataset.tnum;if(r){const e=parseInt(r,10);if(!isNaN(e))return e}const o=null==n?void 0:n.dataset.fnum;if(o){const e=parseInt(o,10);if(!isNaN(e))return e}throw new Error("Could not find line number for code element")},getLineElementFromLineNumber:ru,getCodeElementFromLineNumber:(e,t,n)=>{var r;return null===(r=ru(e,t,n))||void 0===r?void 0:r.querySelector(".source")},getDiffCodePart:e=>{const t=e.closest(".udiff-line");if(!t)throw new Error("Could not find line element for code element");return t.classList.contains("deletion")?"base":"head"},isFirstCharacterDiffIndicator:()=>!0},iu=e=>e.replace("//","/"),au=["modified","renamed","removed","added"];function su(){const e=Jl(),t=location.pathname.match(/src\/(.*?)\/(.*)/);if(!t)throw new Error("Unable to determine revision or file path");const n=decodeURIComponent(t[1]),r=decodeURIComponent(t[2]),o=function(){const e=['a[type="button"]',"a"];for(const t of e){const e=document.querySelectorAll(t);for(const t of e){const e=t.href.match(/full-commit\/([\da-f]{40})\//);if(e)return e[1]}}return null}();return{blob:{rawRepoName:e,revision:n,filePath:r,commitID:null!=o?o:n}}}function cu(e){const t=Jl(),n=function(e){const t=[...e.querySelectorAll('[data-qa="bk-file__header"] span')];for(const e of t)for(const t of au){var n;if(null!==(n=e.textContent)&&void 0!==n&&n.toLowerCase().includes(t))return t}return"modified"}(e),{base:r,head:o}=function(e,t){var n;const r=null===(n=e.querySelector('[data-qa="bk-filepath"]'))||void 0===n?void 0:n.cloneNode(!0),o=null==r?void 0:r.textContent;if(!(r instanceof HTMLElement&&o))throw new Error("Could not find breadcrumbs component for code view");if("added"===t)return{head:o};if("removed"===t)return{base:o};if("modified"===t)return{base:o,head:o};const i="<>SEPARATOR<>",a=r.querySelectorAll('[aria-label="arrow"]');for(const e of a)e.textContent=i;const[s,c,l]=r.textContent.split(/[{}]/),[u,f]=c.split(i);return{base:iu(s+u+l),head:iu(s+f+l)}}(e,n),{baseRevision:i,headRevision:a}=function(){var e,t;const n=document.querySelector('[data-qa="pr-branches-and-state-styles"]');if(!n)throw new Error("Could not find branches element");const r=[...n.querySelectorAll('[aria-hidden="true"]')];if(2!==r.length)throw new Error("Expected source and destination branch elements");const o=null!==(e=r[0].textContent)&&void 0!==e?e:"";return{baseRevision:null!==(t=r[1].textContent)&&void 0!==t?t:"",headRevision:o}}();return"added"===n?{head:{rawRepoName:t,filePath:o,commitID:a,revision:a}}:"removed"===n?{base:{rawRepoName:t,filePath:r,commitID:i,revision:i}}:{head:{rawRepoName:t,filePath:o,commitID:a,revision:a},base:{rawRepoName:t,filePath:r,commitID:i,revision:i}}}function lu(e){const t=Jl(),n=function(e){const t=e.querySelector(".diff-entry-lozenge");for(const e of au){var n;if(null!=t&&null!==(n=t.textContent)&&void 0!==n&&n.toLowerCase().includes(e))return e}return"modified"}(e),{head:r,base:o}=function(e,t){var n;const r=null===(n=e.querySelector(".filename"))||void 0===n?void 0:n.cloneNode(!0);if(!r)throw new Error("Could not find breadcrumbs component for code view");for(const e of r.childNodes)e instanceof HTMLSpanElement&&(e.textContent=null);const o=r.textContent.trim();if("added"===t)return{head:o};if("removed"===t)return{base:o};if("modified"===t)return{base:o,head:o};const[i,a,s]=o.split(/[{}]/).map((e=>e.trim())),[c,l]=a.split("\u2192").map((e=>e.trim()));return{base:iu(i+c+s),head:iu(i+l+s)}}(e,n),{baseCommitID:i,headCommitID:a}=function(){var e;const t=null===(e=document.querySelector('[title="Parent commit"]'))||void 0===e?void 0:e.href.match(/\/commits\/(.*)/);if(!t)throw new Error("Could not determine base commit ID");const n=t[1],r=window.location.href.match(/\/commits\/(.*)/);if(!r)throw new Error("Could not determine head commit ID");return{baseCommitID:n,headCommitID:r[1]}}();return"added"===n?{head:{rawRepoName:t,filePath:r,commitID:a}}:"removed"===n?{base:{rawRepoName:t,filePath:o,commitID:i}}:{head:{rawRepoName:t,filePath:r,commitID:a},base:{rawRepoName:t,filePath:o,commitID:i}}}const uu="codeHost-module__icon_3KtzB",fu="codeHost-module__commit-container_8Jft-";function pu(e){const t=e.querySelector(".sg-toolbar-mount");if(t)return t;const n=e.querySelector('[data-testid="file-actions"');if(!n)throw new Error("Unable to find mount location");const r=document.createElement("div");return r.classList.add("sg-toolbar-mount"),n.prepend(r),r}function du(e){const t=e.querySelector(".sg-toolbar-mount");if(t)return t;const n=e.querySelector(".diff-actions");if(!n)throw new Error("Unable to find mount location");n.classList.add(fu);const r=document.createElement("div");return r.classList.add("sg-toolbar-mount"),n.prepend(r),r}const hu={type:"bitbucket-cloud",name:"Bitbucket Cloud",codeViewResolvers:[{selector:e=>{const t=e.querySelector('[data-qa="bk-file__header"]'),n=e.querySelector('[data-qa="bk-file__content"]');if(!t||!n)return null;let r=t;for(;!r.contains(n);){if(!r.parentElement)return null;r=r.parentElement}return[r]},resolveView:e=>function({pathname:e}){return/\/pull-requests\/\d+/.test(e)}(window.location)?{element:e,getToolbarMount:pu,dom:nu,resolveFileInfo:cu}:{element:e,getToolbarMount:pu,dom:Xl,resolveFileInfo:su}},{selector:".bb-udiff",resolveView:e=>({element:e,getToolbarMount:du,dom:ou,resolveFileInfo:lu})}],getContext:async function(){const e=Jl();return Promise.resolve({rawRepoName:e,revision:"",privateRepository:!1})},getViewContextOnSourcegraphMount:function(e){var t;const n="open-on-sourcegraph",r=he(e,'[data-qa="page-header-wrapper"] > div > div');if(!r)return null;let o=r.querySelector("#open-on-sourcegraph");if(o)return o;o=document.createElement("span"),o.id=n;const i=null===(t=r.childNodes[1])||void 0===t?void 0:t.childNodes[1].firstChild;return i instanceof HTMLElement?i.append(o):r.append(o),o},check:function(){return"bitbucket.org"===location.hostname},viewOnSourcegraphButtonClassProps:{className:"codeHost-module__open-on-sourcegraph_10lR9",iconClassName:uu},codeViewToolbarClassProps:{className:"codeHost-module__code-view-toolbar_N0wZ1",listItemClass:"codeHost-module__list-item_370zl",actionItemClass:"codeHost-module__code-view-toolbar-action-item_2p6Pr",actionItemPressedClass:"codeHost-module__pressed_1ksxF",actionItemIconClass:uu},hoverOverlayClassProps:{className:"codeHost-module__hover-overlay_2e1lQ",badgeClassName:"codeHost-module__badge_16Tsk",actionItemClassName:"codeHost-module__hover-overlay-action-item_39z-G",iconClassName:uu,contentClassName:"codeHost-module__content_eSBN7"},notificationClassNames:{1:"",2:"",3:"",4:"",5:""},codeViewsRequireTokenization:!0},mu=(e,t)=>n=>i()(e[n],t),gu=/\/projects\/([^/]+)\/repos\/([^/]+)\//;const vu=(e,t)=>{const n=e.querySelector(`[data-line-number="${t}"]`);if(!n)throw new Error(`Line ${t} not found in code view`);const r=n.closest(".line");if(!r)throw new Error("Could not find line elem for line element");return r},bu={getCodeElementFromTarget:e=>{const t=e.closest(".CodeMirror-line");return t?t.querySelector('span[role="presentation"]'):null},getLineNumberFromCodeElement:e=>{const t=e.closest(".line");if(!t)throw new Error("Could not find line containing code element");const n=t.querySelector(".line-locator");if(!n)throw new Error("Could not find the line number in a line container");const r=parseInt(n.dataset.lineNumber||"",10);if(isNaN(r))throw new TypeError("data-line-number not set on line number element");return r},getLineElementFromLineNumber:vu,getCodeElementFromLineNumber:(e,t)=>vu(e,t).querySelector('.CodeMirror-line span[role="presentation"]')},yu=(e,t,n)=>{for(const r of e.querySelectorAll(".line-number-"+("head"===n?"to":"from"))){const e=parseInt((r.textContent||"").trim(),10);if(!isNaN(e)&&e===t){const e=r.closest(".line");if(!e)throw new Error("Could not find lineElem from lineNumElem");return e}}throw new Error(`Could not locate line number element for line ${t}, part: ${String(n)}`)},wu={getCodeElementFromTarget:bu.getCodeElementFromTarget,getLineNumberFromCodeElement:e=>{const t=e.closest(".line");if(!t)throw new Error("Could not find line containing code element");const n=t.querySelector(".line-number-to");if(n){const e=parseInt((n.textContent||"").trim(),10);if(!isNaN(e))return e}const r=t.querySelector(".line-number-from");if(r){const e=parseInt((r.textContent||"").trim(),10);if(!isNaN(e))return e}throw new Error("Could not find line number element for code element")},getLineElementFromLineNumber:yu,getCodeElementFromLineNumber:(e,t,n)=>yu(e,t,n).querySelector('.CodeMirror-line span[role="presentation"]'),getDiffCodePart:e=>{var t;if(!document.querySelector(".side-by-side-diff"))return e.closest(".line").classList.contains("removed")?"base":"head";return null!==(t=e.closest(".diff-editor").previousElementSibling)&&void 0!==t&&t.classList.contains("segment-connector-column")?"head":"base"},isFirstCharacterDiffIndicator:()=>!1},Eu=(e,t,n)=>{for(const i of e.querySelectorAll(".diff-line-number")){var r;const e=null===(r=i.textContent)||void 0===r?void 0:r.trim().split(" ")[0];if(!e)continue;const a=parseInt(e,10);if(!isNaN(a)&&a===t){var o;const e=null===(o=i.closest("tr"))||void 0===o?void 0:o.querySelector(`.diff-line[data-diff-line="${"head"===n?"TO":"FROM"}"]`);if(!e)throw new Error("Could not find lineElem from lineNumElem");return e}}throw new Error(`Could not locate line number element for line ${t}, part: ${String(n)}`)},_u={getCodeElementFromTarget:e=>e.closest(".diff-line"),getLineNumberFromCodeElement:e=>{var t;const n=null===(t=e.closest("tr"))||void 0===t?void 0:t.querySelector(".diff-gutter .diff-line-number");if(n){const e=parseInt((n.textContent||"").trim(),10);if(!isNaN(e))return e}throw new Error("Could not find line number element for code element")},getDiffCodePart:e=>{var t;const n=null===(t=e.closest("tr"))||void 0===t?void 0:t.querySelectorAll(".diff-line");if(!n||0===n.length)throw new Error("Could not find diff lines for code element");if(1===n.length)return e.classList.contains("added-line")?"head":"base";const[r,o]=n;return e===r?"base":e===o?"head":e.classList.contains("removed-line")?"base":"head"},getLineElementFromLineNumber:Eu,getCodeElementFromLineNumber:Eu};var xu=n(11570),Su=n.n(xu);const Ou=(e,t,n)=>`${window.AJS?window.AJS.contextPath():window.location.origin}/rest/api/1.0/projects/${encodeURIComponent(e)}/repos/${t}${n}`,Tu=e=>ar(e,{selector:e=>ur(e).json()}),Cu=jo((({project:e,repoSlug:t,prID:n})=>Tu(Ou(e,t,`/pull-requests/${n}`)).pipe(H((({fromRef:e,toRef:t})=>({baseCommitID:t.latestCommit,headCommitID:e.latestCommit}))))),(({prID:e})=>e.toString())),ku=jo((({project:e,repoSlug:t,commitID:n})=>Tu(Ou(e,t,`/commits/${n}`)).pipe(H((({parents:e})=>Su()(e))),qe(Kn),H((({id:e})=>e)))),(({project:e,repoSlug:t,commitID:n})=>`${e}:${t}:${n}`)),Nu=["a.raw-view-link","a.source-view-link","a.mode-source"],Au=({repoSlug:e,project:t})=>[window.location.hostname,t,e].join("/"),Iu=e=>{const t=[];for(const n of Nu)try{const t=e.querySelector(n);if(!t)throw new Error(`Could not find selector ${n} in code view`);const r=new URL(t.href),o=r.pathname,i=o.match(/\/projects\/(.*?)\/repos\/(.*?)\/(?:browse|raw)\/(.*)$/);if(!i)throw new Error(`Path of link matching selector ${n} did not match path regex: ${o}`);const[,a,s,c]=i,l=r.searchParams.get("at");if(!l)throw new Error(`href of link matching selector ${n} did not have 'at' search param: ${r.href}`);const u=l.match(/refs\/heads\/(.*?)$/),f=u?u[1]:l;return{rawRepoName:Au({repoSlug:s,project:a}),filePath:decodeURIComponent(c),revision:f,project:a,repoSlug:s}}catch(e){t.push(e);continue}throw un(t)},Pu=(e="a.commitid")=>{const t=document.querySelector(e);if(!t)throw new Error("No element found matching a.commitid");const n=t.dataset.commitid;if(!n)throw new Error("Element matching a.commitid has no data-commitid");return n},Ru=e=>{const{rawRepoName:t,filePath:n,revision:r,project:o,repoSlug:i}=Iu(e);return{rawRepoName:t,filePath:n,revision:r,commitID:(()=>{const e=document.querySelector("span[data-revision-ref]");if(!e)throw new Error("Could not find span[data-revision-ref] element");try{const{latestCommit:t}=JSON.parse(e.dataset.revisionRef);return t}catch{throw new Error("Could not parse JSON from revision selector")}})(),project:o,repoSlug:i}},Du=({codeViewElement:e})=>e.querySelector(".change-type-lozenge"),Lu=({changeTypeElement:e})=>{if(!e)return"MODIFY";const t=[...e.classList].find((e=>/^change-type-[A-Z]+/.test(e)));if(!t)throw new Error("Could not detect change type from change type element");return t.replace(/^change-type-/,"")},Mu=({filePath:e,changeType:t,changeTypeElement:n})=>{if("ADD"!==t){if("MODIFY"===t||"DELETE"===t)return e;if("MOVE"===t||"RENAME"===t||"COPY"===t){if(!n)throw new Error(`Change type is ${t} but no change type indicator found`);const r=n.getAttribute("original-title");if(!r)throw new Error("Moved change type badge did not have original-title attribute");const o=document.createElement("span");o.innerHTML=r;const i=o.textContent;if("MOVE"===t||"COPY"===t){const e=i.split("\u2192")[0].trim();if(!e)throw new Error(`Unexpected move change type badge content "${i}"`);return e}if("RENAME"===t){const t=/Renamed from '(.+)'/,n=i.match(t);if(!n)throw new Error(`Rename change type badge content did not match ${t.toString()}: "${i}"`);return Aa.join(Aa.dirname(e),n[1])}}throw new Error(`Unexpected change type "${t}"`)}},ju=e=>{var t;const n=null!==(t=e.querySelector(".breadcrumbs"))&&void 0!==t?t:e.querySelector(".file-breadcrumbs");if(!n)throw new Error("Could not find diff code view breadcrumbs element through selector .breadcrumbs");const r=n.textContent;if(!r)throw new Error("Unexpected empty file path in breadcrumbs");const o=location.pathname.match(/\/projects\/(.*?)\/repos\/(.*?)\//);if(!o)throw new Error("Location did not match regexp");const[,i,a]=o,s=Au({project:i,repoSlug:a}),c=Du({codeViewElement:e}),l=Lu({changeTypeElement:c});return{changeType:l,rawRepoName:s,filePath:r,baseFilePath:Mu({changeTypeElement:c,changeType:l,filePath:r})||r,project:i,repoSlug:a}};const Fu=e=>{const t=ju(e),{rawRepoName:n,filePath:r,baseFilePath:o}=t,i=function(){const e=window.location.pathname.match(/pull-requests\/(\d*?)\/(diff|overview|commits)/);if(!e)throw new Error(`Could not parse PR ID from pathname: ${window.location.pathname}`);return parseInt(e[1],10)}();return Cu({...t,prID:i}).pipe(H((({headCommitID:e,baseCommitID:t})=>({head:{rawRepoName:n,filePath:r,commitID:e},base:{rawRepoName:n,filePath:o,commitID:t}}))))},Bu="codeHost-module__command-palette-button_1LPsz",Uu="codeHost-module__command-palette-popover_wqnFp",qu="codeHost-module__no-results_3Di26",Vu="codeHost-module__open-on-sourcegraph_i9J2G",$u="codeHost-module__sg-toolbar-mount_2Fbz5",zu="codeHost-module__code-view-toolbar_IVqgq",Hu="codeHost-module__action-nav-item_223JV",Gu="codeHost-module__action-nav-item-new-diff_23eTl",Qu="codeHost-module__action-item-new-diff_3Tuv4",Wu="codeHost-module__hover-action-item_9CC-W",Ku="codeHost-module__command-list-popover-button_3eptU",Zu=(e,t=".file-toolbar .secondary")=>{const n=e.querySelector(".sg-toolbar-mount");if(n)return n;const r=e.querySelector(t);if(!r)throw new Error("Unable to find mount location");const o=document.createElement("div");return o.classList.add("btn-group"),o.classList.add("sg-toolbar-mount"),o.classList.add($u),r.prepend(o),o},Yu=e=>({direction:t,codeView:n,position:r})=>{const o=e.getCodeElementFromLineNumber(n,r.line,r.part);if(!o)throw new Error("(adjustPosition) could not find code element for line provided");let i=0;for(const e of o.querySelectorAll("[cm-text]")){const t=e.getAttribute("cm-text")||"",n=e.textContent||"";i+=t.length-n.length}const a=t===Fn.ActualToCodeView?-1:1;return z({line:r.line,character:r.character+a*i})},Ju={getToolbarMount:Zu,dom:bu,resolveFileInfo:e=>({blob:Ru(e)}),getPositionAdjuster:()=>Yu(bu)},Xu={getToolbarMount:Zu,dom:wu,getPositionAdjuster:()=>Yu(wu),overrideTokenize:!0},ef={...Xu,resolveFileInfo:e=>{const{changeType:t,rawRepoName:n,filePath:r,commitID:o,baseFilePath:i,revision:a,...s}=(e=>{const{rawRepoName:t,project:n,repoSlug:r,filePath:o}=Iu(e),i=Pu(),a=Du({codeViewElement:e}),s=Lu({changeTypeElement:a});return{changeType:s,rawRepoName:t,filePath:o,baseFilePath:Mu({changeTypeElement:a,changeType:s,filePath:o})||o,commitID:i,project:n,repoSlug:r}})(e);return"ADD"===t?z({head:{rawRepoName:n,filePath:r,commitID:o}}):ku({commitID:o,...s}).pipe(H((e=>"DELETE"===t?{base:{rawRepoName:n,filePath:i,commitID:e}}:{base:{rawRepoName:n,filePath:i,commitID:e},head:{rawRepoName:n,filePath:r,commitID:o}})))}},tf={...Xu,resolveFileInfo:Fu},nf={...Xu,resolveFileInfo:e=>{const{rawRepoName:t,filePath:n,baseFilePath:r}=ju(e),{baseCommitID:o,headCommitID:i}=function(){const e=document.querySelector("#branch-compare .source-selector a.commitid[data-commitid]"),t=document.querySelector("#branch-compare .target-selector a.commitid[data-commitid]");if(!e||!t)throw new Error("Could not resolve Bitbucket compare diff spec");return{headCommitID:e.getAttribute("data-commitid"),baseCommitID:t.getAttribute("data-commitid")}}();return{base:{rawRepoName:t,filePath:r,commitID:i},head:{rawRepoName:t,filePath:n,commitID:o}}}},rf={...Xu,resolveFileInfo:e=>(e=>{const t=Pu(".commit-badge-oneline .commitid"),n=Pu(".commit-parents .commitid"),{rawRepoName:r,filePath:o,baseFilePath:i}=ju(e);return{head:{rawRepoName:r,filePath:o,commitID:t},base:{rawRepoName:r,filePath:i,commitID:n}}})(e)},of={selector:".change-view",resolveView:e=>({element:e,...af})},af={resolveFileInfo:Fu,getToolbarMount:e=>Zu(e,".change-header .diff-actions"),toolbarButtonProps:{listItemClass:Gu,actionItemClass:Qu},dom:_u};const sf="aui-icon",cf={[Qa]:"aui-message aui-message-info",[Wa]:"aui-message aui-message-success",[Ga]:"aui-message aui-message-info",[Ha]:"aui-message aui-message-warning",[za]:"aui-message aui-message-error"},lf={type:"bitbucket-server",name:"Bitbucket Server",check:()=>!!document.querySelector(".bitbucket-header-logo")||!!document.querySelector(".aui-header-logo.aui-header-logo-bitbucket"),codeViewResolvers:[{selector:".file-content",resolveView:e=>{const t=e.querySelector(".content-view");if(!t)return null;if(document.querySelector("#branch-compare"))return{element:e,...nf};if((({pathname:e})=>/\/projects\/[^/]+\/repos\/[^/]+\/commits\/\w+$/.test(e))(window.location))return{element:e,...rf};if(e.querySelector(".mode-toggle")){return t.classList.contains("diff-view")?{element:e,...ef}:{element:e,...Ju}}return(({pathname:e})=>/\/projects\/[^/]+\/repos\/[^/]+\/pull-requests\/\d+/.test(e))(window.location)?{element:e,...tf}:(console.error("Unknown code view",e),null)}},of],getCommandPaletteMount:e=>{const t=he(e,".aui-header-primary .aui-nav");if(!t)return null;const n=["command-palette-button",Bu];return t.querySelector(n.map((e=>`.${e}`)).join(""))||(()=>{const e=document.createElement("li");return e.className=n.join(" "),t.append(e),e})()},notificationClassNames:cf,commandPaletteClassProps:{buttonClassName:i()(Ku,"aui-alignment-target aui-alignment-abutted aui-alignment-abutted-left aui-alignment-element-attached-top aui-alignment-element-attached-left aui-alignment-target-attached-bottom aui-alignment-target-attached-left"),buttonElement:"a",buttonOpenClassName:"aui-dropdown2-active active aui-alignment-enabled",showCaret:!1,popoverClassName:i()(Uu,"aui-dropdown2 aui-style-default aui-layer aui-dropdown2-in-header aui-alignment-element aui-alignment-side-bottom aui-alignment-snap-left aui-alignment-enabled aui-alignment-abutted aui-alignment-abutted-left aui-alignment-element-attached-top aui-alignment-element-attached-left aui-alignment-target-attached-bottom aui-alignment-target-attached-left"),popoverInnerClassName:"aui-dropdown2-section",formClassName:"aui",inputClassName:"text",resultsContainerClassName:"results",listClassName:"results-list",listItemClassName:"result",selectedListItemClassName:"focused",noResultsClassName:qu,iconClassName:sf},codeViewToolbarClassProps:{className:i()(zu,"aui-buttons"),actionItemClass:"aui-button",actionItemIconClass:"aui-icon",listItemClass:Hu},hoverOverlayClassProps:{className:"aui-dialog",actionItemClassName:i()("aui-button",Wu),getAlertClassName:mu(cf),iconClassName:sf},getViewContextOnSourcegraphMount:function(e){const t=he(e,".branch-selector-toolbar .aui-buttons");if(!t)return null;const n=t.querySelector("#open-on-sourcegraph");if(n)return n;const r=document.createElement("span");return r.id="open-on-sourcegraph",r.className=Vu,t.append(r),r},getContext:async function(){const e=function(e){const{hostname:t,pathname:n}=e,r=n.match(gu);if(!r)throw new Error(`location pathname does not match path regex: ${n}`);const[,o,i]=r;return{rawRepoName:`${t}/${o}/${i}`}}(window.location);let t={};try{t=function(){var e;const t=document.querySelector("#repository-layout-revision-selector .name[data-revision-ref]");if(!t)throw new Error("branchNameElement not found");const n=t.getAttribute("data-revision-ref");let r=null;if(n)try{r=JSON.parse(n)}catch{throw new Error(`Could not parse revisionRefStr: ${n}`)}if(null!==(e=r)&&void 0!==e&&e.latestCommit)return{revision:r.latestCommit};throw new Error(`revisionRefInfo is empty or has no latestCommit (revisionRefStr: ${String(n)})`)}()}catch{}return Promise.resolve({...e,...t,privateRepository:"bitbucket.org"!==window.location.hostname})},viewOnSourcegraphButtonClassProps:{className:"aui-button",iconClassName:sf},codeViewsRequireTokenization:!1};var uf=n(65291),ff=n.n(uf),pf=n(92674),df=n.n(pf),hf=n(26416),mf=n.n(hf);function gf(e){return new B((function(t){var n;try{n=e()}catch(e){return void t.error(e)}return(n?ee(n):Ne()).subscribe(t)}))}function vf(e){return t=>gf((()=>{const n=new Map;return t.pipe(wt(Me),ce(),tt((({removedNodes:e})=>{for(const t of e){if(!(t instanceof HTMLElement))continue;const e=n.get(t);if(e)e.subscriptions.unsubscribe(),n.delete(t);else for(const[e,r]of n.entries())t.contains(e)&&(r.subscriptions.unsubscribe(),n.delete(e))}})),oe((t=>ee(t.addedNodes).pipe(qe(Wn(HTMLElement)),oe((t=>ee(e).pipe(oe((({selector:e,resolveView:n})=>[...bf(t,e)].map((e=>{const t=n(e);return t&&{...t,subscriptions:new g}})))),qe(Kn),qe((e=>!n.has(e.element))),tt((e=>{n.set(e.element,e)})))))))))}))}function bf(e,t){if("string"==typeof t)return de(e,t);return t(e)||[]}const yf=/patchset (\d+)/i;function wf(e,t){return`refs/changes/${e.slice(-2).padStart(2,"0")}/${e}/${t}`}function Ef(e){var t,n;return null!==(t=null===(n=If(document.body,e))||void 0===n?void 0:n.textContent)&&void 0!==t?t:void 0}function _f(e){const t=yf.exec(e);if(null!=t&&t[1])return t[1]}function xf(){const e=new URL(window.location.href).pathname.split("/"),t=e.indexOf("c"),n=e.indexOf("+"),r=e.slice(t+1,n).join("/"),o=e[n+1],i=e[n+2],a=e.slice(n+3).join("/"),s=window.location.hostname+"/"+r,{basePatchsetId:c,headPatchsetId:l}=function(){var e,t;const n=null!==(e=Ef("#app >> #app-element >> gr-change-view >> #fileListHeader >> #rangeSelect >> #basePatchDropdown >> #triggerText"))&&void 0!==e?e:Ef("#app >> #app-element >> gr-diff-view >> #rangeSelect >> #basePatchDropdown >> #triggerText"),r=null!==(t=Ef("#app >> #app-element >> gr-change-view >> #fileListHeader >> #rangeSelect >> #patchNumDropdown >> #triggerText"))&&void 0!==t?t:Ef("#app >> #app-element >> gr-diff-view >> #rangeSelect >> #patchNumDropdown >> #triggerText");return{basePatchsetId:n&&_f(n),headPatchsetId:r&&_f(r)}}();return{repoName:s,changeId:o,patchsetId:l||i,filePath:a,basePatchsetId:c}}const Sf={selector(e){var t;if(e.matches("#diffTable"))return[e];const n=If(document,"#app >> #app-element >> gr-change-view >> #fileList"),r=[...(null==n||null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".file-row.expanded"))||[]].map((e=>{const t=e.parentElement;if(t)return If(t,"gr-diff-host >> gr-diff >> #diffTable")}));return mf()(r)},resolveView(e){const t=Pf(e,".stickyArea");if(!t)return null;const n=t.querySelector(".file-row"),r=null==n?void 0:n.getAttribute("data-path");if(!r)return null;const o=xf();if(!o.patchsetId)return console.error("Sourcegraph: Cannot get Gerrit patchset ID"),null;const i=wf(o.changeId,o.patchsetId);let a;return a=o.basePatchsetId?wf(o.changeId,o.basePatchsetId):function(){var e,t,n;const r=If(document.body,"#app >> #app-element >> gr-change-view >> #metadata >> gr-commit-info");if(!r)return null;return null==r||null===(e=r.shadowRoot)||void 0===e||null===(t=e.querySelector(".container"))||void 0===t||null===(n=t.textContent)||void 0===n?void 0:n.trim()}()||i+"^",Df(e),{element:e,dom:Tf,resolveFileInfo(){const e={base:{filePath:r||"",rawRepoName:o.repoName,commitID:a},head:{filePath:r||"",rawRepoName:o.repoName,commitID:i}};return console.log("resolveFileListCodeView: fileInfo",e),e}}}},Of=(e,t,n)=>{const r="head"===n?"right":"left",o=e.querySelector(`td.lineNum.${r}[data-value="${t}"]`);if(!o)return null;const i=function(e,t){var n;const r=[...(null===(n=e.parentElement)||void 0===n?void 0:n.childNodes)||[]],o=r.slice(r.indexOf(e)+1);for(const e of o)if(e instanceof HTMLElement&&e.matches(t))return e;return null}(o,"td.content");return null==i?void 0:i.querySelector(".contentText")},Tf={getLineElementFromLineNumber:Of,getCodeElementFromLineNumber:Of,getCodeElementFromTarget:e=>{var t;const n=e.closest("td.content"),r=null==n||null===(t=n.closest("tr"))||void 0===t?void 0:t.querySelector("[data-line-number]");if(r){if("FILE"===r.getAttribute("data-line-number"))return null}return n},getLineNumberFromCodeElement:e=>{var t;const n=Af(e);if(!n)throw console.error(e),new TypeError("Could not find line number (no side)");const r=e.closest("td"),o=null==r||null===(t=r.parentElement)||void 0===t?void 0:t.querySelector(`.lineNum.${n}`),i=null==o?void 0:o.getAttribute("data-value");if(!i)throw new TypeError(`Could not find line number (${n})`);return parseInt(i,10)},getDiffCodePart:e=>{const t=Af(e);return"left"===t?"base":"right"===t?"head":(console.error("Cannot tell: base or head"),"base")}},Cf=[{selector(e){const t=If(document.body,"#app >> #app-element >> gr-diff-view >> #diffHost >> #diff >> #diffTable");return t?[t]:[]},resolveView(e){const t=xf();if(!t.patchsetId)return console.error("Sourcegraph: cannot find patchset ID"),null;const n=wf(t.changeId,t.patchsetId);let r=n+"^";return t.basePatchsetId&&(r=wf(t.changeId,t.basePatchsetId)),Df(e),{element:e,dom:Tf,getToolbarMount(e){var t;const n=null===(t=function(e){var t;const n=Pf(e,"gr-diff-view");return null==n||null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelector("gr-fixed-panel .subHeader")}(e))||void 0===t?void 0:t.querySelector(".patchRangeLeft");if(!n)throw new Error("Could not find subheader");const r=n.querySelector(".sourcegraph-toolbar-mount");if(r)return r;const o=document.createElement("div");return o.classList.add("sourcegraph-toolbar-mount"),n.append(o),n.append(Rf(Lf)),o},resolveFileInfo(){const e={base:{filePath:t.filePath||"",rawRepoName:t.repoName,commitID:r},head:{filePath:t.filePath||"",rawRepoName:t.repoName,commitID:n}};return console.log("resolveFilePageCodeView: fileInfo",e),e}}}},Sf],kf={type:"gerrit",name:"Gerrit",codeViewResolvers:Cf,contentViewResolvers:[],nativeTooltipResolvers:[],codeViewsRequireTokenization:!0,observeMutations:(e,t,n)=>{let r=[];return Xc(1500).pipe(H((()=>{const{filePath:e=""}=xf(),t=[...Cf.map((e=>e.selector)),Nf].map((e=>[...bf(document.body,e)])).flat(),n=t.filter((t=>!df()(r,{element:t,filePath:e}))),o=r.filter((n=>!(n.filePath===e&&t.find((e=>e===n.element)))));for(const t of n)r.push({element:t,filePath:e});return r=r.filter((e=>!df()(o,e))),{addedNodes:n,removedNodes:o.map((e=>e.element))}})),qe((({addedNodes:e,removedNodes:t})=>!!e.length||!!t.length)),H((e=>[e])),Lo(),Bt())},getContext:async()=>{const{repoName:e,changeId:t,patchsetId:n}=xf();return Promise.resolve({privateRepository:!0,rawRepoName:e,revision:n&&wf(t,n)})},check:function(){return!!document.querySelector("gr-app#app")},notificationClassNames:{1:"",2:"",3:"",4:"",5:""},hoverOverlayClassProps:{className:"codeHost-module__hover-overlay_1jwSd"},codeViewToolbarClassProps:{className:"code-view-toolbar--gerrit",actionItemIconClass:"icon--gerrit"},viewOnSourcegraphButtonClassProps:{className:"open-on-sourcegraph--gerrit",iconClassName:"open-on-sourcegraph-icon--gerrit"},getViewContextOnSourcegraphMount:e=>{const t=ff()(Nf(e));if(!t)return null;const n=t.querySelector(".open-in-sourcegraph-mount");if(n)return n;const r=document.createElement("gr-button");return r.setAttribute("link","link"),r.classList.add("open-in-sourcegraph-mount"),t.prepend(r),t.append(Rf(Lf)),r}},Nf=()=>{const e=If(document.body,"#app >> #app-element >> gr-change-view >> #actions >> #secondaryActions");return e?[e]:null};function Af(e){var t,n;if("unified"===function(e){const t=e.closest("tr");return null!=t&&t.matches(".unified")?"unified":"side-by-side"}(e)){var r,o;return(null===(r=e.closest("tr"))||void 0===r||null===(o=r.querySelector("td.right"))||void 0===o?void 0:o.getAttribute("data-value"))?"right":"left"}return null!==(t=e.closest("td"))&&void 0!==t&&null!==(n=t.previousElementSibling)&&void 0!==n&&n.matches(".right")?"right":"left"}function If(e,t){var n;"string"==typeof t&&(t=t.split(">>"));let r=e;const o=t.slice(0,-1),i=t[t.length-1];for(const e of o){var a;if(!r)return null;r=(null===(a=r.querySelector(e))||void 0===a?void 0:a.shadowRoot)||null}return null===(n=r)||void 0===n?void 0:n.querySelector(i)}function Pf(e,t){for(;;){var n;const r=e.closest(t);if(r)return r;if(!(e=null===(n=e.getRootNode())||void 0===n?void 0:n.host)||e===document.getRootNode())return null}}function Rf(e){const t=document.createElement("style");return t.textContent=e,t}function Df(e){if(!e.querySelector("style.sourcegraph-injected-style")){const t=Rf(Mf);t.classList.add("sourcegraph-injected-style"),e.append(t)}}const Lf="\n.icon--gerrit {\n height: 1.3rem;\n width: 1.3rem;\n padding: 5px 4px;\n}\n.open-on-sourcegraph-icon--gerrit {\n height: 1rem;\n width: 1rem;\n}\n.open-on-sourcegraph--gerrit {\n text-decoration: none;\n}\n",Mf="\n.sourcegraph-document-highlight {\n background-color: var(--secondary);\n}\n.selection-highlight {\n background-color: var(--mark-bg);\n}\n";var jf,Ff,Bf=n(36021),Uf=n.n(Bf);!function(e){e.Ok="ok",e.Exited="exited",e.Crashed="crashed",e.Abnormal="abnormal"}(jf||(jf={})),function(e){e.Ok="ok",e.Errored="errored",e.Crashed="crashed"}(Ff||(Ff={}));var qf=n(97753),Vf=n(91698),$f=(0,qf.Rf)(),zf="Sentry Logger ",Hf=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,qf.Cf)((function(){$f.console.log(zf+"[Log]: "+e.join(" "))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,qf.Cf)((function(){$f.console.warn(zf+"[Warn]: "+e.join(" "))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,qf.Cf)((function(){$f.console.error(zf+"[Error]: "+e.join(" "))}))},e}();$f.__SENTRY__=$f.__SENTRY__||{};var Gf,Qf=$f.__SENTRY__.logger||($f.__SENTRY__.logger=new Hf),Wf=n(59212);function Kf(e){return"[object Object]"===Object.prototype.toString.call(e)}function Zf(e){return Boolean(e&&e.then&&"function"==typeof e.then)}!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"}(Gf||(Gf={}));var Yf=function(){function e(e){var t=this;this._state=Gf.PENDING,this._handlers=[],this._resolve=function(e){t._setResult(Gf.RESOLVED,e)},this._reject=function(e){t._setResult(Gf.REJECTED,e)},this._setResult=function(e,n){t._state===Gf.PENDING&&(Zf(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._attachHandler=function(e){t._handlers=t._handlers.concat(e),t._executeHandlers()},this._executeHandlers=function(){if(t._state!==Gf.PENDING){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e.done||(t._state===Gf.RESOLVED&&e.onfulfilled&&e.onfulfilled(t._value),t._state===Gf.REJECTED&&e.onrejected&&e.onrejected(t._value),e.done=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.resolve=function(t){return new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.all=function(t){return new e((function(n,r){if(Array.isArray(t))if(0!==t.length){var o=t.length,i=[];t.forEach((function(t,a){e.resolve(t).then((function(e){i[a]=e,0===(o-=1)&&n(i)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},e.prototype.then=function(t,n){var r=this;return new e((function(e,o){r._attachHandler({done:!1,onfulfilled:function(n){if(t)try{return void e(t(n))}catch(e){return void o(e)}else e(n)},onrejected:function(t){if(n)try{return void e(n(t))}catch(e){return void o(e)}else o(t)}})}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))},e.prototype.toString=function(){return"[object SyncPromise]"},e}(),Jf=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=C(t._breadcrumbs),n._tags=E({},t._tags),n._extra=E({},t._extra),n._contexts=E({},t._contexts),n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=C(t._eventProcessors),n._requestSession=t._requestSession),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){return this._tags=E(E({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=E(E({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){return this._extra=E(E({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=E(E({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=E(E({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e,t,n,r,o=this.getSpan();return(null===(e=o)||void 0===e?void 0:e.transaction)?null===(t=o)||void 0===t?void 0:t.transaction:(null===(r=null===(n=o)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?o.spanRecorder.spans[0]:void 0},e.prototype.setSession=function(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=E(E({},this._tags),t._tags),this._extra=E(E({},this._extra),t._extra),this._contexts=E(E({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):Kf(t)&&(t=t,this._tags=E(E({},this._tags),t.tags),this._extra=E(E({},this._extra),t.extra),this._contexts=E(E({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r=E({timestamp:(0,Vf.yW)()},e);return this._breadcrumbs=C(this._breadcrumbs,[r]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){var n;if(this._extra&&Object.keys(this._extra).length&&(e.extra=E(E({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=E(E({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=E(E({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=E(E({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=E({trace:this._span.getTraceContext()},e.contexts);var r=null===(n=this._span.transaction)||void 0===n?void 0:n.name;r&&(e.tags=E({transaction:r},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=C(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,this._notifyEventProcessors(C(Xf(),this._eventProcessors),e,t)},e.prototype._notifyEventProcessors=function(e,t,n,r){var o=this;return void 0===r&&(r=0),new Yf((function(i,a){var s=e[r];if(null===t||"function"!=typeof s)i(t);else{var c=s(E({},t),n);Zf(c)?c.then((function(t){return o._notifyEventProcessors(e,t,n,r+1).then(i)})).then(null,a):o._notifyEventProcessors(e,c,n,r+1).then(i).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function Xf(){var e=(0,qf.Rf)();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function ep(e){var t,n;if(Kf(e)){var r=e,o={};try{for(var i=O(Object.keys(r)),a=i.next();!a.done;a=i.next()){var s=a.value;void 0!==r[s]&&(o[s]=ep(r[s]))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o}return Array.isArray(e)?e.map(ep):e}var tp=function(){function e(e){this.errors=0,this.sid=(0,qf.DM)(),this.duration=0,this.status=jf.Ok,this.init=!0,this.ignoreDuration=!1;var t=(0,Vf.ph)();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||(0,Vf.ph)(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:(0,qf.DM)()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):this.status===jf.Ok?this.update({status:jf.Exited}):this.update()},e.prototype.toJSON=function(){return ep({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:ep({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},e}(),np=function(){function e(e,t,n){void 0===t&&(t=new Jf),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()},e.prototype.pushScope=function(){var e=Jf.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e},e.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=(0,qf.DM)(),r=t;if(!t){var o=void 0;try{throw new Error("Sentry syntheticException")}catch(e){o=e}r={originalException:e,syntheticException:o}}return this._invokeClient("captureException",e,E(E({},r),{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var r=this._lastEventId=(0,qf.DM)(),o=n;if(!n){var i=void 0;try{throw new Error(e)}catch(e){i=e}o={originalException:e,syntheticException:i}}return this._invokeClient("captureMessage",e,t,E(E({},o),{event_id:r})),r},e.prototype.captureEvent=function(e,t){var n=(0,qf.DM)();return"transaction"!==e.type&&(this._lastEventId=n),this._invokeClient("captureEvent",e,E(E({},t),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop(),r=n.scope,o=n.client;if(r&&o){var i=o.getOptions&&o.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,c=i.maxBreadcrumbs,l=void 0===c?100:c;if(!(l<=0)){var u=(0,Vf.yW)(),f=E({timestamp:u},e),p=s?(0,qf.Cf)((function(){return s(f,t)})):f;null!==p&&r.addBreadcrumb(p,l)}}},e.prototype.setUser=function(e){var t=this.getScope();t&&t.setUser(e)},e.prototype.setTags=function(e){var t=this.getScope();t&&t.setTags(e)},e.prototype.setExtras=function(e){var t=this.getScope();t&&t.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getScope();n&&n.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getScope();n&&n.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getScope();n&&n.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop(),n=t.scope,r=t.client;n&&r&&e(n)},e.prototype.run=function(e){var t=op(this);try{e(this)}finally{op(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return Qf.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e,t,n,r,o;null===(n=null===(t=null===(e=this.getStackTop())||void 0===e?void 0:e.scope)||void 0===t?void 0:t.getSession())||void 0===n||n.close(),this._sendSessionUpdate(),null===(o=null===(r=this.getStackTop())||void 0===r?void 0:r.scope)||void 0===o||o.setSession()},e.prototype.startSession=function(e){var t=this.getStackTop(),n=t.scope,r=t.client,o=r&&r.getOptions()||{},i=o.release,a=o.environment,s=((0,qf.Rf)().navigator||{}).userAgent,c=new tp(E(E(E({release:i,environment:a},n&&{user:n.getUser()}),s&&{userAgent:s}),e));if(n){var l=n.getSession&&n.getSession();l&&l.status===jf.Ok&&l.update({status:jf.Exited}),this.endSession(),n.setSession(c)}return c},e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession&&t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},e.prototype._invokeClient=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),i=o.scope,a=o.client;a&&a[e]&&(t=a)[e].apply(t,C(n,[i]))},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=rp(),o=r.__SENTRY__;if(o&&o.extensions&&"function"==typeof o.extensions[e])return o.extensions[e].apply(this,t);Qf.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function rp(){var e=(0,qf.Rf)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function op(e){var t=rp(),n=sp(t);return cp(t,e),n}function ip(){var e=rp();return ap(e)&&!sp(e).isOlderThan(4)||cp(e,new np),(0,Wf.KV)()?function(e){var t,n,r;try{var o=null===(r=null===(n=null===(t=rp().__SENTRY__)||void 0===t?void 0:t.extensions)||void 0===n?void 0:n.domain)||void 0===r?void 0:r.active;if(!o)return sp(e);if(!ap(o)||sp(o).isOlderThan(4)){var i=sp(e).getStackTop();cp(o,new np(i.client,Jf.clone(i.scope)))}return sp(o)}catch(t){return sp(e)}}(e):sp(e)}function ap(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function sp(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new np),e.__SENTRY__.hub}function cp(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}function lp(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=ip();if(r&&r[e])return r[e].apply(r,C(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function up(e,t){var n;try{throw new Error("Sentry syntheticException")}catch(e){n=e}return lp("captureException",e,{captureContext:t,originalException:e,syntheticException:n})}var fp=n(76727);const pp=(e,t)=>({selector:e,resolveView:e=>({...t,element:e})}),dp=(e,t,n)=>((e,t)=>{const{repoName:n,commitID:r}=e;return dl({repoName:n,revision:r,requestGraphQL:t}).pipe(hl())})(e,n).pipe(ze((()=>ml({repoName:e.repoName,filePath:e.filePath,commitID:e.commitID,requestGraphQL:n}))),H((t=>t?{...e,content:t.join("\n")}:{...e})),st((n=>ee(t(n)).pipe(ze((t=>{if(t)return z(e);throw n}))))));function hp(){return function(e){const t=function(e){if(void 0!==e.line)return{start:{line:e.line,character:e.character||0},end:{line:e.endLine||e.line,character:e.endCharacter||e.character||0}}}(e);if(void 0===t)return[];const n={line:t.start.line-1,character:Yn(t.start.character)},r={line:t.end.line-1,character:Yn(t.end.character)};return[{start:n,end:r,anchor:n,active:r,isReversed:!1}]}(ua(window.location.hash))}function mp(){return Ae(window,"hashchange").pipe(H(hp),Qe(((e,t)=>Ot()(e,t))))}function gp(e){const t=e.title.split(" \u2192 ");return t.length>1?{headFilePath:t[1],baseFilePath:t[0]}:{headFilePath:t[0],baseFilePath:t[0]}}function vp(e){const{pageType:t}=_p();if(!Ep(t))return null;let n="",r="";if("pull"===t){var o;const t=null===(o=document.querySelector("details-menu[src*='sha1='][src*='sha2=']"))||void 0===o?void 0:o.getAttribute("src"),i=e.classList.contains("js-comment-container");if(t){const e=new URLSearchParams(t),n=e.get("sha1"),r=e.get("sha2");if(n&&r)return{baseCommitID:n,headCommitID:r}}else if(i){const t=function(e){const t=e.querySelector(`summary a[href^="${location.pathname}"`);if(!t)return null;const n=t.href.match(bp);if(!n)return null;const r=n[3],o=yp(document.documentElement.innerHTML,!0);return r&&o?{...o,headCommitID:r}:null}(e);if(t)return t}else{const e=document.querySelector('input[name="comparison_start_oid"]');e&&(n=e.value);const t=document.querySelector('input[name="comparison_end_oid"]');t&&(r=t.value)}}else if("commit"===t){const e=document.querySelectorAll(".sha-block:not(.patch-diff-links)");if(e&&2===e.length){const t=e[0].querySelector("a");t&&(n=t.href.split("/").slice(-1)[0]);const o=e[1].querySelector("span.sha");o&&(r=o.innerHTML)}}else if("compare"===t){const e=function(){const[e,t]=document.querySelectorAll(".commitish-suggester .select-menu-button span");if(e&&t&&e.textContent&&t.textContent)return{baseCommitID:e.textContent,headCommitID:t.textContent};return}();if(e)return e}return""===n||""===r?yp(document.documentElement.innerHTML,"pull"===t):{baseCommitID:n,headCommitID:r}}const bp=/\/files\/((\w+)\.\.)?(\w+)#diff-\w+$/;function yp(e,t){if(!t)return null;const n="\x3c!-- base sha1: "",r=e.indexOf(n);if(-1===r)return null;const o="\x3c!-- head sha1: "",i=e.indexOf(o,r);if(-1===i)return null;return{baseCommitID:e.slice(r+n.length,40),headCommitID:e.slice(i+o.length,40)}}function wp(){const e=document.querySelector("a.js-permalink-shortcut");if(!e)throw new Error("Unable to determine the file path because no a.js-permalink-shortcut element was found.");const t=new URL(e.href),[,,,n,,...r]=t.pathname.split("/");if("tree"!==n&&0===r.length)throw new Error(`Unable to determine the file path because the a.js-permalink-shortcut element's href's path was ${t.pathname} (it is expected to be of the form /<user>/<repo>/blob/<commitID>/<path/to/file>).`);return decodeURIComponent(r.join("/"))}function Ep(e){switch(e){case"commit":case"pull":case"compare":return!0;default:return!1}}function _p(e=window.location){const{host:t,pathname:n}=e,[r,o,i,...a]=n.slice(1).split("/");if(!r||!o)throw new ll(`Could not parse repoName from GitHub url: ${e.href}`);const s=`${r}/${o}`,c=`${t}/${s}`;switch(i){case"blob":case"tree":return{pageType:i,rawRepoName:c,revisionAndFilePath:decodeURIComponent(a.join("/")),repoName:s};case"pull":case"commit":case"compare":return{pageType:i,rawRepoName:c,repoName:s};default:return{pageType:"other",rawRepoName:c,repoName:s}}}const xp=e=>{let t=e.closest("td").previousElementSibling;for(;t;){if(t.dataset.lineNumber)return parseInt(t.dataset.lineNumber,10);t=t.previousElementSibling}throw new Error("Could not find a line number in any cell")},Sp=e=>{var t;const n=e.closest("td.blob-code");return!n||null!==(t=n.parentElement)&&void 0!==t&&t.classList.contains("js-expandable-line")?null:n},Op=(e,t,n)=>{const r=Pp(e),o=((e,t)=>"base"===e?0:t?2:1)(n,r)+1,i=e.querySelector(`td:nth-child(${o})[data-line-number="${t}"]`);if(!i)return null;if(!r&&"base"===n&&!i.classList.contains("blob-num-addition")&&!i.classList.contains("blob-num-deletion"))return null;let a;if(r)a=i.nextElementSibling;else{a=i.parentElement.lastElementChild}return a},Tp=e=>e.classList.contains("blob-code-inner")?e:e.querySelector(".blob-code-inner"),Cp={getCodeElementFromTarget:e=>{const t=Sp(e);return t&&Tp(t)},getLineElementFromLineNumber:Op,getCodeElementFromLineNumber:(e,t,n)=>{const r=Op(e,t,n);return r&&Tp(r)},getLineNumberFromCodeElement:xp,getDiffCodePart:e=>{const t=e.closest("td");return t.classList.contains("blob-code-addition")?"head":t.classList.contains("blob-code-deletion")||Pp(e)&&t.nextElementSibling?"base":"head"},isFirstCharacterDiffIndicator:e=>{const t=e.closest(".blob-code-inner"),n=t&&["deletion","context","addition"].some((e=>t.classList.contains("blob-code-marker-"+e))),r=e.closest("tr"),o=null==r?void 0:r.querySelector("td[data-code-marker]"),i=null==t?void 0:t.hasAttribute("data-code-marker"),a=o||i,s=e.closest(".refined-github-diff-signs");return!n&&!a&&!s}},kp=(e,t)=>{const n=e.querySelector(`td[data-line-number="${t}"]`);return n&&n.nextElementSibling},Np={getCodeElementFromTarget:Sp,getCodeElementFromLineNumber:kp,getLineElementFromLineNumber:kp,getLineNumberFromCodeElement:xp},Ap=(e,t)=>{const n=((e,t)=>{const n=e.querySelectorAll("td.blob-num");let r=null;for(const e of n)if(e.querySelector("a").href.endsWith(`#L${t}`)){r=e;break}return r})(e,t);return n&&n.nextElementSibling},Ip={getCodeElementFromTarget:Sp,getCodeElementFromLineNumber:Ap,getLineElementFromLineNumber:Ap,getLineNumberFromCodeElement:e=>{const t=e.closest("td").previousElementSibling;return parseInt(t.firstElementChild.textContent,10)}};function Pp(e){const{pageType:t}=_p();if(!Ep(t))return!1;const n=e.classList.contains("file")?e:e.closest(".file");if(!n)throw new Error("Could not resolve code view element");if(n.classList.contains("js-comment-container"))return!1;const r=n.querySelector("table");if(!r)throw new Error("Could not find code view table");return r.classList.contains("js-file-diff-split")||r.classList.contains("file-diff-split")}const Rp=()=>{const e=_p();if("blob"!==e.pageType&&"tree"!==e.pageType)throw new Error(`Current URL does not match a blob or tree url: ${window.location.href}`);const{revisionAndFilePath:t,rawRepoName:n}=e,r=wp(),o=r&&!r.startsWith("/")?`/${r}`:r,i=o?t.slice(0,-o.length):t;if(!t.endsWith(o))throw new Error(`The file path ${o} should always be a suffix of revAndFilePath ${t}, but isn't in this case.`);return{blob:{rawRepoName:n,filePath:r,revision:i,commitID:fe({selector:".js-permalink-shortcut",hrefRegex:/^\/.*?\/.*?\/(?:blob|tree)\/([\da-f]{40})/})}}},Dp=/\/([\da-f]{40})$/i,Lp=e=>{const t=e.querySelector("a.commit-tease-sha");if(!t)throw new Error("Could not find commit link in snippet code view");const n=t.href.match(Dp);if(null==n||!n[1])throw new Error(`Could not parse commitID from snippet commit link href: ${t.href}`);const r=n[1],o=e.querySelectorAll("a:not(.commit-tease-sha)"),i=new URL(o[0].href),a=_p(i);if("blob"!==a.pageType)throw new Error(`Snippet URL does not match a blob url: ${i.href}`);const{revisionAndFilePath:s,rawRepoName:c}=a;if(!s.startsWith(r))throw new Error(`Could not parse filePath: revAndFilePath ${s} does not start with commitID ${r}`);return{blob:{rawRepoName:c,filePath:s.slice(r.length+1),commitID:r,revision:r}}},Mp=["tooltipped","tooltipped-n"];const jp="codeHost-module__command-palette-action-item_16BFG",Fp="codeHost-module__action-item_7QWb2",Bp="codeHost-module__icon_3PdA7",Up="codeHost-module__code-view-toolbar_gOzAp",qp="codeHost-module__code-view-toolbar-item_2fTzz",Vp="codeHost-module__hover-overlay-badge_3wpZt";function $p(e){const t="github-file-actions-toolbar-mount",n=e.querySelector("."+t);if(n)return n;const r=document.createElement("div");r.className=t;const o=e.querySelector(".file-actions");if(!o)throw new Error("Could not find GitHub file actions with selector .file-actions");o.classList.add("sg-github-file-actions");const i=e.querySelector(".show-file-notes");return i?i.after(r):o.prepend(r),r}const zp={dom:Cp,getToolbarMount:$p,resolveFileInfo:e=>{const{rawRepoName:t}=_p(),{headFilePath:n,baseFilePath:r}=function(e){const t=e.querySelector(".file-info");if(t){if("A"===t.tagName)return gp(t);const e=t.querySelector(".diffstat + a");if(e)return gp(e)}const n=e.querySelector(".file-header a");if(n)return gp(n);throw new Error("Could not determine diff file name")}(e);if(!n)throw new Error("cannot determine file path");const o=vp(e);if(!o)throw new Error("cannot determine delta info");const{headCommitID:i,baseCommitID:a}=o;return{head:{rawRepoName:t,filePath:n,commitID:i,revision:i},base:{rawRepoName:t,filePath:r||n,commitID:a,revision:a}}},getScrollBoundaries:e=>{const t=e.querySelector(".file-header");if(!t)throw new Error("Could not find .file-header element in GitHub PR code view");return[t]}},Hp={...zp,getToolbarMount:void 0},Gp={dom:Np,getToolbarMount:$p,resolveFileInfo:Rp,getSelections:hp,observeSelections:mp},Qp=e=>({direction:t,codeView:n,position:r})=>ml({...r,requestGraphQL:e}).pipe(H((e=>{const o=Np.getCodeElementFromLineNumber(n,r.line,r.part);if(!o)throw new Error("(adjustPosition) could not find code element for line provided");const i=e[r.line-1],a=o.textContent||"",s=i.length-Uf()(i).length,c=a.length-Uf()(a).length,l=t===Fn.ActualToCodeView?-1:1,u=Math.abs(s-c)*l;return{line:r.line,character:r.character+u}}))),Wp=pp(".code-list-item",{dom:Ip,getPositionAdjuster:Qp,resolveFileInfo:Lp}),Kp={dom:Np,resolveFileInfo:Lp,getPositionAdjuster:Qp},Zp=e=>{const t="sourcegraph-github-file-code-view-toolbar-mount",n=e.querySelector(`.${t}`);if(n)return n;const r=document.createElement("div");r.style.display="inline-flex",r.style.verticalAlign="middle",r.style.alignItems="center",r.className=t;const o=e.querySelector("#raw-url"),i=null==o?void 0:o.closest(".BtnGroup");if(null==i||!i.parentNode)throw new Error("File actions not found");return i.parentNode.insertBefore(r,i),r},Yp={selector:".js-file-line-container",resolveView:e=>{const t=e.closest(".blob-wrapper-embedded");if(t){return{element:t.parentElement,...Kp}}const{pageType:n}=_p();if("blob"!==n)return null;const r=e.closest(".repository-content");if(!r)throw new Error("Could not find repository content element");return{element:r,...Gp,getToolbarMount:Zp}}},Jp={selector:e=>{const t=new Set;for(const n of de(e,".file"))0===n.querySelectorAll(".js-diff-load-container").length&&t.add(n);for(const n of de(e,".js-blob-wrapper")){const e=n.closest(".file");e instanceof HTMLElement&&t.add(e)}return[...t]},resolveView:e=>{if(e.querySelector("article.markdown-body"))return null;if(e.closest(".js-suggested-changes-blob"))return null;const{pageType:t}=_p();return"blob"===t&&1===document.querySelectorAll(".file").length&&0===document.querySelectorAll(".diff-view").length?{element:e,...Gp}:e.closest(".discussion-item-body")||e.classList.contains("js-comment-container")?{element:e,...Hp}:{element:e,...zp}}};function Xp(){const e=document.head.querySelector('meta[property="og:site_name"]');return!!e&&("GitHub Enterprise"===e.content||"GitHub"===e.content)&&document.body.classList.contains("enterprise")}const ed="open-on-sourcegraph",td=i()(Bp,"v-align-text-bottom"),nd={[Qa]:"flash",[Wa]:"flash flash-success",[Ga]:"flash",[Ha]:"flash flash-warn",[za]:"flash flash-error"},rd={searchViewResolver:{selector:'.js-site-search-form input[type="text"][aria-controls="jump-to-results"]',resolveView:e=>({element:e})},resultViewResolver:{selector:"#jump-to-suggestion-search-global",resolveView:e=>({element:e})},onChange:({value:e,searchURL:t,resultElement:n})=>{var r;const o="#jump-to-sourcegraph-search-global";(n=>{const r=n.querySelector(".jump-to-suggestion-name");r.textContent=e,r.setAttribute("aria-label",e);const o=n.querySelector("a"),i=new URL(t);i.searchParams.append("q",e),o.setAttribute("href",i.href),o.setAttribute("target","_blank"),n.setAttribute("style","display: "+(e?"initial":"none !important"))})(null!==(r=document.querySelector(o))&&void 0!==r?r:(()=>{var e,t;const r=n.cloneNode(!0);r.id=o.replace("#",""),r.classList.remove("navigation-focus"),r.setAttribute("aria-selected","false");const i=document.createElement("img");i.src=fp,i.setAttribute("style","width: 16px; height: 20px; float: left; margin-right: 2px;"),i.setAttribute("alt","Sourcegraph Logo Image");const a=r.querySelector(".js-jump-to-badge-search-text-global");return a.textContent="Sourcegraph",null===(e=a.parentNode)||void 0===e||e.insertBefore(i,a),null===(t=n.parentNode)||void 0===t||t.insertBefore(r,n.nextElementSibling),r})())}},od=(e,t=Dc.fetchCache,n="#repository-container-header h1 span.Label")=>"github.com"!==window.location.hostname?Promise.resolve(!0):t({url:`https://api.github.com/repos/${e}`,credentials:"omit",cacheMaxAge:36e5}).then((e=>{const t=e.headers["x-ratelimit-remaining"];if(Number(t)<=0){const e=new Error("Github rate limit exceeded.");throw up(e),e}return e})).then((({data:e})=>"boolean"!=typeof e.private||e.private)).catch((e=>{var t,r;return console.warn("Failed to fetch if the repository is private.",e),"public"!==(null===(t=document.querySelector(n))||void 0===t||null===(r=t.textContent)||void 0===r?void 0:r.toLowerCase().trim())})),id=()=>"/search"===window.location.pathname,ad=()=>"/search/advanced"===window.location.pathname,sd=()=>!id()&&window.location.pathname.endsWith("/search"),cd=()=>Boolean(new URLSearchParams(window.location.search).get("q"))&&!ad(),ld=()=>{const e=new URLSearchParams(window.location.search).get("type");return e?e.toLowerCase():""},ud=e=>{const t=e.filter(Boolean).map((e=>e.trim())),n=(()=>{switch(ld()){case"repositories":return"repo";case"commits":return"commit";case"code":return"";default:return id()||ad()?"repo":""}})(),r=new URLSearchParams(window.location.search).get("l");if(n&&t.push(`type:${n}`),r&&t.push(`lang:${encodeURIComponent(r)}`),sd()){const[e,n]=window.location.pathname.split("/").filter(Boolean);t.push(`repo:${e}/${n}$`)}for(const e of["org","user"]){const n=t.findIndex((t=>t.startsWith(`${e}:`)));if(n>=0){const r=t[n].replace(`${e}:`,"");r&&(t[n]=`repo:${r}/*`)}}return t.join("+")},fd=(e,t="")=>{let n=document.querySelector(`#${e}`);return n||(n=document.createElement("div"),n.setAttribute("id",e),n.classList.add(...t.split(/\s/gi)),n)};const pd={type:"github",name:Xp()?"GitHub Enterprise":"GitHub",searchEnhancement:rd,enhanceSearchPage:function(e){if(!(id()||ad()||sd()||cd()))return;const n=({container:n,className:r="",getSearchQuery:o,utmCampaign:a})=>{const s=Tc(new URL("/search",e),{utm_source:Fc(),utm_campaign:a});(0,me.render)(t.createElement(tl,{label:"Search on Sourcegraph",title:"Search on Sourcegraph to get hover tooltips, go to definition and more",ariaLabel:"Search on Sourcegraph to get hover tooltips, go to definition and more",className:i()("btn","m-auto",r),iconClassName:i()("mr-1","v-align-middle",Bp),href:s.href,dataTestId:"search-on-sourcegraph",onClick:e=>{const t=ud(o());e.target.href=`${s.href}${t?`&q=${t}`:""}`}}),n)};if(cd()){const e=ld();if(["repositories","commits","code"].includes(e)||""===e&&(id()||sd())){var r,o;const e=document.querySelector(".application-main form.js-site-search-form"),t=null==e?void 0:e.querySelector("input.form-control[name='q']"),i=null==e||null===(r=e.parentElement)||void 0===r||null===(o=r.parentElement)||void 0===o?void 0:o.querySelector("button[type='submit']");if(t&&i){const e=fd("pageSearchFormSourcegraphButton","ml-2 d-none d-md-block");i.after(e),n({container:e,utmCampaign:"github-search-results-page",getSearchQuery:()=>t.value.split(" ")})}const a=document.querySelector("header form.js-site-search-form input.form-control[name='q']"),s=document.querySelector(".codesearch-results"),c=null==s?void 0:s.querySelector(".blankslate"),l=null==s?void 0:s.querySelector("div > div > h3");if(a&&(c||l)){const e=fd("headerSearchInputSourcegraphButton","ml-auto d-none d-lg-block");c?(e.classList.add("mt-2"),c.append(e)):l&&(e.classList.add("mr-2"),l.after(e)),n({container:e,className:c?"":"btn-sm",utmCampaign:"github-search-results-page",getSearchQuery:()=>a.value.split(" ")})}}return}const a=document.querySelector("#search_form"),s=null==a?void 0:a.querySelector(".search-form-fluid"),c=null==a?void 0:a.querySelector("input");if(s&&c){const e=fd("searchInputSourcegraphButton","ml-0 ml-md-2 mt-2 mt-md-0");null==s||s.append(e),n({container:e,utmCampaign:`github-${ad()?"advanced":"simple"}-search-page`,getSearchQuery:()=>c.value.split(" ")})}},codeViewResolvers:[Jp,Yp,Wp],contentViewResolvers:[{selector:".markdown-body",resolveView:e=>({element:e})}],nativeTooltipResolvers:[{selector:".js-tagsearch-popover",resolveView:e=>({element:e})}],routeChange:e=>e.pipe(H((()=>{const{pathname:e}=window.location,t=e.slice(1).split("/")[2];return"blob"===t||"tree"===t?e.endsWith(wp())?e:void 0:cd()?null===(n=document.querySelector(".codesearch-results h3"))||void 0===n||null===(r=n.textContent)||void 0===r?void 0:r.trim():e;var n,r})),qe(Boolean),Qe()),getContext:async()=>{const{repoName:e,rawRepoName:t,pageType:n}=_p();return{rawRepoName:t,revision:"blob"===n||"tree"===n?Rp().blob.revision:void 0,privateRepository:await od(e)}},isLightTheme:gf((()=>{const e=document.documentElement.dataset.colorMode;return"auto"===e?((e=window)=>{const t=e.matchMedia("(prefers-color-scheme: dark)");return{observable:le(z(!t.matches),Ae(t,"change").pipe(H((e=>!e.matches)))),initialValue:!t.matches}})().observable:z("dark"!==e)})),getViewContextOnSourcegraphMount:e=>{const t=he(e,".pagehead-actions");if(!t||0===t.children.length)return null;let n=t.querySelector("#open-on-sourcegraph");return n||(n=document.createElement("li"),n.id=ed,t.prepend(n),n)},viewOnSourcegraphButtonClassProps:{className:"btn btn-sm tooltipped tooltipped-s",iconClassName:td},check:()=>((e=window.location.href)=>/^https?:\/\/(www\.)?github\.com/.test(e))()||Xp(),getCommandPaletteMount:e=>{const t="command-palette-button",n=e.querySelector(`.Header .${t}`);if(n)return n;const r=he(e,".HeaderMenu > :last-child");if(r){const e=document.createElement("div");return e.classList.add(t),r.prepend(e),e}let o=he(e,".Header-item:nth-last-child(2)");if(o){0!==o.previousElementSibling.children.length&&(o=o.previousElementSibling);const e=document.createElement("div");return e.classList.add("Header-item","mr-0","mr-lg-3",t),o.before(e),e}return null},notificationClassNames:nd,commandPaletteClassProps:{buttonClassName:"Header-link d-flex flex-items-baseline",popoverClassName:"Box",formClassName:"p-1",inputClassName:"form-control input-sm header-search-input jump-to-field",listClassName:"p-0 m-0 js-navigation-container jump-to-suggestions-results-container",selectedListItemClassName:"navigation-focus",listItemClassName:"d-flex flex-justify-start flex-items-center p-0 f5 navigation-item js-navigation-item js-jump-to-scoped-search",actionItemClassName:i()(jp,"no-underline d-flex flex-auto flex-items-center jump-to-suggestions-path p-2"),noResultsClassName:"d-flex flex-auto flex-items-center jump-to-suggestions-path p-2",iconClassName:td},codeViewToolbarClassProps:{className:Up,listItemClass:i()(qp,"BtnGroup"),actionItemClass:i()("btn btn-sm tooltipped tooltipped-s BtnGroup-item",Fp),actionItemPressedClass:"selected",actionItemIconClass:i()(Bp,"v-align-text-bottom")},hoverOverlayClassProps:{className:"Box",actionItemClassName:"btn btn-sm btn-secondary",actionItemPressedClassName:"active",badgeClassName:i()("label",Vp),getAlertClassName:mu(nd,"flash-full"),iconClassName:td},setElementTooltip:function(e,t){"string"==typeof t?(e.classList.add(...Mp),e.setAttribute("aria-label",t)):(e.classList.remove(...Mp),e.removeAttribute("aria-label"))},linkPreviewContentClass:"text-small text-gray p-1 mx-1 border rounded-1 bg-gray text-gray-dark",urlToFile:(e,t,n)=>{if(t.viewState)return ga(e,t);if(!t.rawRepoName.startsWith(window.location.hostname))return ga(e,t);const r=t.revision||"HEAD",{rawRepoName:o}=_p();if(o===t.rawRepoName&&void 0!==n.part){const e=document.querySelectorAll(".file");for(const r of e){const e=r.querySelector(".file-header[data-path][data-anchor]");if(!e)continue;if(e.dataset.path===t.filePath){const r=e.dataset.anchor,o=new URL(window.location.href);if(o.hash=r,t.position&&(o.hash+=`${"base"===n.part?"L":"R"}${t.position.line}`),!document.querySelector(o.hash))break;return o.href}}}const i=t.position?`#L${t.position.line}${t.position.character?`:${t.position.character}`:""}`:"";return`https://${t.rawRepoName}/blob/${r}/${t.filePath}${i}`},codeViewsRequireTokenization:!0},dd=(e,t,n)=>e.querySelector(`#LC${t}`),hd={getCodeElementFromTarget:e=>e.closest("span.line"),getLineNumberFromCodeElement:e=>{const t=e.id.replace(/^LC/,"");return parseInt(t,10)},getCodeElementFromLineNumber:dd,getLineElementFromLineNumber:dd},md=e=>{const t=e.closest("[data-interop-type]");return t?"old"===t.dataset.interopType?"base":"head":(e=>{let t="old";const n=e.closest(".diff-td,td");return n.classList.contains("parallel")&&(t="left-side"),n.classList.contains(t)?"base":"head"})(e)},gd=(e,t,n)=>{const r="base"===n?"old":"new",o=e.querySelector(`[data-interop-${r}-line="${t}"]`);return o?o.querySelector("span.line"):((e,t,n)=>{const r=e.querySelector(`.${"base"===n?"old_line":"new_line"} [data-linenumber="${t}"]`);if(!r)return null;const o=r.closest(".diff-tr,tr");if(!o)return null;let i="span.line";return o.classList.contains("parallel")&&(i=`.${"base"===n?"left-side":"right-side"} ${i}`),o.querySelector(i)})(e,t,n)},vd={getCodeElementFromTarget:hd.getCodeElementFromTarget,getLineNumberFromCodeElement:e=>{const t=e.closest("[data-interop-line]");return t?parseInt(t.dataset.interopLine||"",10):(e=>{const t=md(e);let n=e.closest(".diff-td,td");for(;n&&(!n.matches(".diff-line-num."+("base"===t?"old_line":"new_line"))||!n.querySelector("a"))&&n.previousElementSibling;)n=n.previousElementSibling;if(n){const e=n.querySelector("a");return parseInt(e.dataset.linenumber||"",10)}throw new Error("Unable to determine line number for diff code element")})(e)},getCodeElementFromLineNumber:gd,getLineElementFromLineNumber:(e,t,n)=>{const r=gd(e,t,n);return r&&r.parentElement},getDiffCodePart:md},bd=(e,t,n)=>`${window.location.origin}/api/v4/projects/${encodeURIComponent(e)}%2f${t}${n}`,yd=e=>ar(e,{selector:e=>ur(e).json()}),wd=jo((e=>yd(`${window.location.origin}/api/v4/projects/${e}`).pipe(H((({web_url:e})=>{const{hostname:t,pathname:n}=new URL(e);return`${t}${n}`})))),Na()),Ed=jo((({owner:e,projectName:t,mergeRequestID:n,diffID:r})=>r?yd(bd(e,t,`/merge_requests/${n}/versions/${r}`)).pipe(H((({base_commit_sha:e})=>e))):z(void 0)),(({owner:e,projectName:t,mergeRequestID:n,diffID:r})=>`${e}:${t}:${n}:${String(r)}`)),_d=jo((({owner:e,projectName:t,mergeRequestID:n,rawRepoName:r,diffID:o})=>rl(yd(bd(e,t,`/merge_requests/${n}`)),Ed({owner:e,projectName:t,mergeRequestID:n,diffID:o})).pipe(ze((([{diff_refs:e,source_project_id:t},n])=>wd(t).pipe(H((t=>({baseCommitID:n||e.base_sha,commitID:e.head_sha,rawRepoName:r,baseRawRepoName:t})))))))),(({owner:e,projectName:t,mergeRequestID:n,rawRepoName:r,diffID:o})=>`${e}:${t}:${n}:${r}:${String(o)}`)),xd=jo((({owner:e,projectName:t,commitID:n})=>yd(bd(e,t,`/repository/commits/${n}`)).pipe(H((({parent_ids:e})=>Su()(e))))),(({owner:e,projectName:t,commitID:n})=>`${e}:${t}:${n}`));var Sd=n(68642),Od=n.n(Sd),Td=n(90006),Cd=n.n(Td);let kd;!function(e){e[e.File=0]="File",e[e.Commit=1]="Commit",e[e.MergeRequest=2]="MergeRequest",e[e.Other=3]="Other"}(kd||(kd={}));function Nd(){const e=document.querySelector(".context-header a");if(!e)throw new Error("Unable to determine project name");const t=new URL(e.href).pathname.slice(1),n=t.split("/"),r=Od()(n,n.length-1).join("/"),o=Cd()(n),i=((e,t,n)=>{const r=n.match(new RegExp(`^/${e}/${t}(/-)?/(commit|merge_requests|blob)/`));if(!r)return kd.Other;switch(r[2]){case"commit":return kd.Commit;case"merge_requests":return kd.MergeRequest;case"blob":return kd.File;default:return kd.Other}})(r,o,window.location.pathname);return{owner:r,projectName:o,rawRepoName:[Ic?window.location.hostname:new URL(gon.gitlab_url).hostname,r,o].join("/"),repoName:t,pageKind:i}}const Ad=()=>{let e=window.location.pathname.match(/merge_requests\/(.*?)\/diffs/);if(!e&&document.querySelector(".diffs-tab.active")&&(e=window.location.pathname.match(/merge_requests\/(.*?)((\/)|$)/)),!e)throw new Error("Unable to determine merge request ID");return e[1]},Id=e=>{const t=e.dataset.originalTitle||e.dataset.title||e.title;if(!t)throw new Error("Unable to get file paths from code view: no file title");return t.endsWith(" deleted")?t.slice(0,-8):t};function Pd(e){const t=e.querySelectorAll(".file-title-name");if(0===t.length)throw new Error("Unable to get file paths from code view: no .file-title.name");const n=t.length>1,r=Id(t.item(n?1:0));return{headFilePath:r,baseFilePath:n?Id(t.item(0)):r}}function Rd(){const{rawRepoName:e,owner:t,projectName:n}=Nd();return{rawRepoName:e,owner:t,projectName:n,commitID:Cd()(window.location.pathname.split("/"))}}const Dd="codeHost-module__command-list-popover_hwImg",Ld="codeHost-module__hover-overlay_3Cize";const Md=(e,t)=>{const n=e.querySelector(".sg-toolbar-mount-gitlab");if(n)return n;const r=e.querySelector(".file-actions");if(!r)throw new Error("Unable to find mount location");const o=document.createElement("div");return o.classList.add("sg-toolbar-mount","sg-toolbar-mount-gitlab"),t===kd.Commit&&o.classList.add("gl-mr-3"),r.prepend(o),o},jd={dom:hd,getToolbarMount:e=>Md(e,kd.File),resolveFileInfo:()=>{const{rawRepoName:e,filePath:t,revision:n}=function(){const{rawRepoName:e}=Nd(),t=window.location.pathname.match(/\/blob\/(.*?)\/(.*)/);if(!t)throw new Error("Unable to determine revision or file path");const n=decodeURIComponent(t[1]);return{rawRepoName:e,filePath:decodeURIComponent(t[2]),revision:n}}();if(!t)throw new Error(`Unable to determine the file path of the current file because the current URL (window.location ${window.location.href}) does not have a file path.`);return{blob:{rawRepoName:e,filePath:t,commitID:fe({selector:".js-data-file-blob-permalink-url",hrefRegex:new RegExp("^/.*?/.*?/blob/([0-9a-f]{40})/")}),revision:n}}},getSelections:hp,observeSelections:mp},Fd=e=>{const t=e.querySelector(".js-file-title");if(!t)throw new Error("Could not find .file-title element");return[t]},Bd={dom:vd,getToolbarMount:e=>Md(e,kd.MergeRequest),resolveFileInfo:e=>{return ee(_d({...Nd(),mergeRequestID:Ad(),diffID:null!==(t=new URLSearchParams(window.location.search).get("diff_id"))&&void 0!==t?t:void 0})).pipe(H((t=>{const{rawRepoName:n,baseRawRepoName:r,commitID:o,baseCommitID:i}=t,{headFilePath:a,baseFilePath:s}=Pd(e);return{head:{rawRepoName:n,filePath:a,commitID:o},base:{rawRepoName:r,filePath:s,commitID:i}}})));var t},getScrollBoundaries:Fd},Ud={dom:vd,getToolbarMount:e=>Md(e,kd.Commit),resolveFileInfo:e=>rr(Rd).pipe(ze((({owner:e,projectName:t,commitID:n,rawRepoName:r})=>xd({owner:e,projectName:t,commitID:n}).pipe(H((e=>({commitID:n,baseCommitID:e,rawRepoName:r})))))),H((({commitID:t,baseCommitID:n,rawRepoName:r})=>{const{headFilePath:o,baseFilePath:i}=Pd(e);return{head:{rawRepoName:r,filePath:o,commitID:t},base:{rawRepoName:r,filePath:i,commitID:n}}}))),getScrollBoundaries:Fd},qd={selector:".file-holder",resolveView:e=>{if(e.classList.contains("discussion-wrapper"))return null;const{pageKind:t}=Nd();return t===kd.Other?null:t===kd.File?{element:e,...jd}:t===kd.MergeRequest?e.querySelector(".file-actions")?{element:e,...Bd}:null:{element:e,...Ud}}},Vd={[Qa]:"alert alert-secondary",[Wa]:"alert alert-success",[Ga]:"alert alert-info",[Ha]:"alert alert-warning",[za]:"alert alert-danger"},$d=(e,t=Dc.fetchCache)=>"gitlab.com"===window.location.hostname&&e?t({url:`https://gitlab.com/api/v4/projects/${encodeURIComponent(e)}`,credentials:"omit",cacheMaxAge:36e5}).then((e=>{const t=e.headers["ratelimit-remaining"];if(Number(t)<=0){const e=new Error("Gitlab rate limit exceeded.");throw up(e),e}return e})).then((({status:e})=>200!==e)).catch((e=>(console.warn("Failed to fetch repository visibility info.",e),!0))):Promise.resolve(!0),zd={type:"gitlab",name:"GitLab",check:function(){return!!document.head.querySelector('meta[content="GitLab"]')},codeViewResolvers:[qd],adjustOverlayPosition:({top:e,left:t})=>{const n=document.querySelector("header");n&&(e+=n.getBoundingClientRect().height);const r=document.querySelector("#js-peek.development");return r&&(e+=r.getBoundingClientRect().height),{top:e,left:t}},getCommandPaletteMount:e=>{const t=he(e,".navbar-collapse");if(!t)return null;const n="command-palette-button";return t.querySelector("."+n)||(()=>{const e=document.createElement("div");return e.className=n,t.prepend(e),e})()},getContext:async()=>{const{repoName:e,...t}=Nd();return{...t,privateRepository:await $d(e)}},urlToFile:(e,t,n)=>{if(t.viewState||!t.rawRepoName.startsWith(window.location.hostname))return ga(e,t);if(Nd().rawRepoName===t.rawRepoName&&void 0!==n.part){const e=bf(document.body,qd.selector);for(const r of e){const{headFilePath:e,baseFilePath:o}=Pd(r);if(e!==t.filePath&&o!==t.filePath)continue;if(!t.position){const e=new URL(window.location.href);return e.hash=r.id,e.href}const i=null!==n.part?{head:".new_line",base:".old_line"}[n.part]:"",a=r.querySelector(`${i} a[data-linenumber="${t.position.line}"]`);if(!a)break;return new URL(a.href).href}}const r=new URL(`https://${t.rawRepoName}/blob/${t.revision}/${t.filePath}`);if(t.position){const{line:e}=t.position;r.hash=`#L${e}`}return r.href},notificationClassNames:Vd,commandPaletteClassProps:{popoverClassName:i()("dropdown-menu",Dd),formClassName:"dropdown-input",inputClassName:"dropdown-input-field",resultsContainerClassName:"dropdown-content",selectedActionItemClassName:"is-focused",noResultsClassName:"px-3",iconClassName:"s16 align-bottom"},codeViewToolbarClassProps:{className:"pl-0",actionItemClass:"btn btn-md gl-button btn-icon",actionItemPressedClass:"active",actionItemIconClass:"gl-button-icon gl-icon s16"},hoverOverlayClassProps:{className:i()("card",Ld),actionItemClassName:"btn btn-secondary",actionItemPressedClassName:"active",iconClassName:"square s16",getAlertClassName:mu(Vd)},codeViewsRequireTokenization:!0,getHoverOverlayMountLocation:()=>{const{pageKind:e}=Nd();return e===kd.MergeRequest?"div.tab-pane.diffs":null}},Hd=e=>Boolean("TH"===e.tagName&&e.textContent||e.dataset.n),Gd=e=>parseInt(("TH"===e.tagName?e.textContent:e.dataset.n)||"",10),Qd=e=>{let t=e;for(;t;){if(Hd(t))return t;t=t.previousElementSibling}return null},Wd=(e,t,n)=>{let r=((e,t,n)=>{const r=e.querySelector("td[data-n]")?"td[data-n]":`th:nth-of-type(${"base"===n?1:2})`;for(const o of e.querySelectorAll(r))if(Gd(o)===t){if("head"===n&&null===o.previousElementSibling)continue;return o}return null})(e,t,n);for(;r&&("TD"!==r.tagName||r.classList.contains("n")||Hd(r)||r.classList.contains("copy"));)r=r.nextElementSibling;return r},Kd={getCodeElementFromTarget:e=>{if("TH"===e.tagName||e.classList.contains("copy"))return null;const t=e.closest("td");return t?t.classList.contains("show-more")||t.classList.contains("show-context")?null:Qd(t)?t:null:null},getCodeElementFromLineNumber:Wd,getLineElementFromLineNumber:Wd,getLineNumberFromCodeElement:e=>{const t=Qd(e);if(!t)throw new Error("Could not find line number cell from code element");return Gd(t)},getDiffCodePart:e=>{if(e.classList.contains("old"))return"base";if(e.classList.contains("new"))return"head";const t=Qd(e);if(!t)throw new Error("Could not find line number cell from code element");return t.classList.contains("left")?"base":t.classList.contains("right")||t.previousElementSibling?"head":"base"},isFirstCharacterDiffIndicator:e=>{const t=e.firstElementChild;return!(null==t||!t.classList.contains("aural-only"))}},Zd=(e,t,n)=>{const r=e.querySelector(`tr:nth-of-type(${t})`);if(!r)throw new Error(`unable to find row ${t} from code view`);return r.querySelector("td")},Yd={getCodeElementFromTarget:e=>e.closest("td"),getCodeElementFromLineNumber:Zd,getLineElementFromLineNumber:Zd,getLineNumberFromCodeElement:e=>{let t=e;for(;null!==t&&"TH"!==t.tagName&&!t.classList.contains("phabricator-source-line");)t=t.previousElementSibling;if(!t)throw new Error("could not find line number cell from code element");const n=t.querySelector("a");if(!n)throw new Error("could not find line number anchor from code element");if(void 0!==n.dataset.n){const e=parseInt(n.dataset.n,10);if(isNaN(e))throw new TypeError(`Could not parse lineNumber from data-n attribute: ${n.dataset.n}`);return e}const r=parseInt(n.textContent||"",10);if(isNaN(r))throw new TypeError(`Could not parse lineNumber from lineAnchor.textContent: ${String(n.textContent)}`);return r},isFirstCharacterDiffIndicator:()=>!1};let Jd;!function(e){e[e.Diffusion=1]="Diffusion",e[e.Differential=2]="Differential",e[e.Revision=3]="Revision",e[e.Change=4]="Change"}(Jd||(Jd={}));const Xd=/r([\dA-z]+)([\da-f]{40})/;function eh(){const e=document.querySelectorAll(".phui-tag-core").item(0);if(!e)throw new Error("Could not find Phabricator page tag");return Xd.exec(e.children[0].getAttribute("href"))}function th(){const e=eh();if(!e)throw new Error("Could not determine callsign from page tag");return e[1]}function nh(){const e=eh();if(!e)throw new Error("Could not determine commitID from page tag");return e[2]}const rh=/Diff (\d+)/;const oh=/^\/?(source|diffusion)\/([\w-]+)\/browse\/([\w-]+\/)?([^$;]+)(;[\da-f]{40})?(?:\$\d+)?/i,ih=/^\/?(d\d+)(?:\?(?:(?:id=(\d+))|(vs=(?:\d+|on)&id=\d+)))?/i,ah=/^\/?r([\dA-z]+)([\da-f]{40})/i,sh=/^\/?(source|diffusion)\/([\da-z]+)\/change\/([\w-]+)\/([^;]+)(;[\da-f]{40})?/i,ch=/^\/?\/differential\/changeset.*/i,lh=/^vs=((?:\d+|on))&id=(\d+)/i;function uh(e,t,n){try{const r=e.href.replace(e.origin,""),o=oh.exec(r);if(o){const e=o[4];if(!e)throw new Error(`Could not determine file path from diffusionMatch, stateUrl: ${r}`);return vh(th(),t,n).pipe(H((({rawRepoName:t})=>({mode:Jd.Diffusion,rawRepoName:t,filePath:e,commitID:nh()}))))}const i=ih.exec(r);if(i){const e=i[1],r=i[3],o=parseInt(e.split("D")[1],10);let a,s=i[2]?parseInt(i[2],10):void 0;if(s||(s=function(){const e=document.querySelector("#differential-review-stage");if(!e)throw new Error("no element with id differential-review-stage found on page.");const t=e.parentElement;if(!t)throw new Error("parent container of diff container not found.");const n=t.children[0].querySelectorAll(".phui-header-header").item(0);if(!n||!n.textContent)throw new Error("Could not find diffTitle element, or it had no text content");const r=rh.exec(n.textContent);if(!r)throw new Error(`diffTitle element does not match pattern. Content: '${n.textContent}'`);return parseInt(r[1],10)}()),r){const e=lh.exec(r),t=null==e?void 0:e[1];t&&"on"!==t&&(a=parseInt(t,10),console.log(`comparison diffID ${s} baseDiffID ${a}`))}return yh(o,t,n).pipe(H((({rawRepoName:e})=>({baseRawRepoName:e,headRawRepoName:e,revisionID:o,diffID:s,baseDiffID:a,mode:Jd.Differential}))))}const a=ah.exec(r);if(a){const e=a[1],r=a[2],o=function(){const e=document.querySelectorAll(".phui-property-list-key");for(const t of e)if("Parents "===t.textContent){const e=t.nextSibling.children[0].children[0].href,n=new URL(e),r=ah.exec(n.pathname);if(r)return r[2]}throw new Error("Could not determine base commit ID from revision page")}();return vh(e,t,n).pipe(H((({rawRepoName:e})=>({mode:Jd.Revision,rawRepoName:e,baseCommitID:o,headCommitID:r}))))}const s=sh.exec(r);if(s){const e=s[8],r=th(),o=nh();return vh(r,t,n).pipe(H((({rawRepoName:t})=>({mode:Jd.Change,filePath:e,rawRepoName:t,commitID:o}))))}if(ch.exec(r)){const e=document.querySelector(".phui-crumbs-view");if(!e)throw new Error("failed parsing changeset dom");const[,r,o]=e.querySelectorAll("a"),i=r.getAttribute("href").match(/D(\d+)/);if(!i)throw new Error("failed parsing differentialID");const a=parseInt(i[1],10),s=o.getAttribute("href").match(/\/differential\/diff\/(\d+)/);if(!s)throw new Error("failed parsing diffID");const c=parseInt(s[1],10);return yh(a,t,n).pipe(H((({rawRepoName:e})=>({baseRawRepoName:e,headRawRepoName:e,revisionID:a,diffID:c,mode:Jd.Differential}))))}throw new Error(`Could not determine Phabricator state from stateUrl ${r}`)}catch(e){return vt(e)}}function fh(e){let t=e;if(t=t.replace("\\",""),e.startsWith("git@"))t=e.slice("git@".length),t=t.replace(":","/");else if(e.startsWith("git://"))t=e.slice("git://".length);else if(e.startsWith("https://"))t=e.slice("https://".length);else if(e.includes("@")){t=e.split("@")[1],t=t.replace(":","/")}return t.replace(/.git$/,"")}function ph(e,t){const n=function(){const e=document.querySelector(".phabricator-search-menu form");if(!e)throw new Error("cannot create conduit request form");const t=new FormData;return t.set("__csrf__",e.querySelector("input[name=__csrf__]").value),t.set("__form__",e.querySelector("input[name=__form__]").value),t}();for(const[e,r]of Object.entries(t))n.set(`params[${e}]`,JSON.stringify(r));return ar(window.location.origin+e,{method:"POST",body:n,credentials:"include",headers:{Accept:"application/json"},selector:e=>ur(e).json()}).pipe(H((e=>{if(null!==e.error_code)throw new Error(`error ${e.error_code}: ${e.error_info}`);return e.result})))}const dh=jo((({diffID:e,revisionID:t,queryConduit:n=ph})=>n("/api/differential.querydiffs",{ids:[e],revisionIDs:[t]}).pipe(H((t=>t[String(e)])))),(({diffID:e,revisionID:t})=>`${e}-${t}`)),hh=jo((({diffID:e,queryConduit:t=ph})=>t("/api/differential.getrawdiff",{diffID:e})),(({diffID:e})=>e.toString())),mh=jo((({revisionID:e,queryConduit:t=ph})=>t("/api/differential.query",{ids:[e]}).pipe(H((t=>{const n=t[0].repositoryPHID;if(!n)throw new Error(`no repositoryPHID for revision ${e}`);return n})))),(({revisionID:e})=>e.toString())),gh=jo((({requestGraphQL:e,...t})=>e({request:fr`
|
|
103
103
|
mutation addPhabricatorRepo($callsign: String!, $repoName: String!, $phabricatorURL: String!) {
|
|
104
104
|
addPhabricatorRepo(callsign: $callsign, uri: $repoName, url: $phabricatorURL) {
|
|
105
105
|
alwaysNil
|
|
@@ -221,4 +221,4 @@
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
`,variables:{},mightContainPrivateInfo:!0}).pipe(H((({data:e})=>{var t;return null==e||null===(t=e.currentUser)||void 0===t?void 0:t.settingsURL})),qe(Kn)),LT=async({sourcegraphURL:e,codeHost:n,requestGraphQL:r,render:o})=>{if(!Uc(e)||!n.getContext)return!0;let a;try{const e=await n.getContext();if(!e.privateRepository)return!0;a=e.rawRepoName;return await pl({rawRepoName:a,requestGraphQL:r}).toPromise()}catch(c){if(c instanceof ll)return!1;if(Ic&&Dc.notifyRepoSyncError({sourcegraphURL:e,hasRepoSyncError:!0}).catch((e=>{console.error("Error notifying background page of private cloud.",e)})),!n.getViewContextOnSourcegraphMount)return console.warn("Repository is not cloned or you are not authenticated to Sourcegraph.",c),!1;if(c instanceof ul)console.warn("Not authenticated to Sourcegraph.",c),o(t.createElement(nl,NT({},n.viewOnSourcegraphButtonClassProps,{sourcegraphURL:e})),n.getViewContextOnSourcegraphMount(document.body));else{console.warn("Repository is not cloned.",c);const l=await DT(r).toPromise();var s;if(a&&l)o(t.createElement(CT,NT({},n.viewOnSourcegraphButtonClassProps,{className:i()("open-on-sourcegraph",null===(s=n.viewOnSourcegraphButtonClassProps)||void 0===s?void 0:s.className),codeHostType:n.type,href:RT(e,l,a.split("/").slice(1).join("/"))})),n.getViewContextOnSourcegraphMount(document.body))}return!1}};async function MT({mutations:e,codeHost:n,extensionsController:r,platformContext:o,showGlobalDebug:s,telemetryService:c,render:l,minimalUI:u,hideActions:f,background:p}){var d;const h=a.lX(),m=new g,{requestGraphQL:v,sourcegraphURL:b}=o,y=e.pipe(ce(),oe((e=>e.addedNodes),w,1),qe(Wn(HTMLElement)));var w;m.add((null!==(d=n.isLightTheme)&&void 0!==d?d:z(!0)).subscribe((e=>{document.body.classList.toggle("theme-light",e),document.body.classList.toggle("theme-dark",!e)})));const E=n.nativeTooltipResolvers?ee(o.settings).pipe(H((({final:e})=>e)),qe(Kn),qe((_=cn,e=>!_(e))),H((e=>!!e["codeHost.useNativeTooltips"])),Qe(((e,t)=>Ot()(e,t))),Lo(1),Bt()):z(!1);var _;const x=[],S=new Pe(!1),O=S.next.bind(S),T=async e=>{var t,r;return Oo(e)&&(!Uc(b)||!(null===(t=await(null===(r=n.getContext)||void 0===r?void 0:r.call(n)))||void 0===t||!t.privateRepository))};if((e=>"github"===e.type)(n)){const{searchEnhancement:t,enhanceSearchPage:r}=n;t&&m.add(function(e,t,n){const{searchViewResolver:r,resultViewResolver:o,onChange:i}=e,a=Tc(new URL("/search",t),{utm_source:Fc(),utm_campaign:"global-search"}),s=n.pipe(vf([r]),ze((({element:e})=>Ae(e,"input").pipe(H((e=>e.target.value)),ue(e.value)))),H((e=>({value:e,searchURL:a.href}))),wt(Me)),c=n.pipe(vf([o]),wt(Me));return Oe([s,c]).pipe(H((([e,{element:t}])=>({...e,resultElement:t})))).subscribe(i)}(t,b,e)),r&&m.add(r(b))}if(!await LT({sourcegraphURL:b,requestGraphQL:v,codeHost:n,render:l}))return m;if(n.nativeTooltipResolvers){const{subscription:t,nativeTooltipsAlert:o}=function(e,t,{nativeTooltipResolvers:n,name:r},o){const i=e.pipe(vf(n||[]));return{nativeTooltipsAlert:i.pipe(rn(),ze((()=>o.pipe(qe((e=>!e)),ut({type:"nativeTooltips",summary:{kind:Da.MarkupKind.Markdown,value:`<small>Sourcegraph has hidden ${r}'s native hover tooltips. You can toggle this at any time: to enable the native tooltips run "Code host: prefer non-Sourcegraph hover tooltips" from the command palette or set <code>{"codeHost.useNativeTooltips": true}</code> in your user settings.</small>`}})))),Lo(1),Bt()),subscription:i.subscribe((({element:e,subscriptions:n})=>{n.add(t.pipe(Fe(o)).subscribe((([t,n])=>{const r=!t&&!n;e.dataset.nativeTooltipHidden=String(r),e.classList.toggle("nativeTooltips-module__native-tooltip--hidden_FNij5",r)})))}))}}(e,E,n,S);m.add(t),x.push(o),m.add(function(e){return Yr(e.extHostAPI.then((e=>e.registerContributions({actions:[{id:"codeHost.toggleUseNativeTooltips",command:"updateConfiguration",category:"Code host",commandArguments:["codeHost.useNativeTooltips","${!config.codeHost.useNativeTooltips}",null,"json"],title:'Prefer ${config.codeHost.useNativeTooltips && "Sourcegraph" || "non-Sourcegraph"} hover tooltips'}],menus:{commandPalette:[{action:"codeHost.toggleUseNativeTooltips"}]}}))))}(r))}const{hoverifier:C,subscription:k}=IT({codeHost:n,extensionsController:r,platformContext:o,telemetryService:c,render:l,hoverAlerts:x,mutations:e,repoSyncErrors:S});if(m.add(C),m.add(k),n.getCommandPaletteMount&&!u&&m.add(y.pipe(H(n.getCommandPaletteMount),qe(Kn)).subscribe((({extensionsController:e,history:n,render:r,...o})=>a=>{r(t.createElement(Sw,null,t.createElement(ym,nT({},o,{popoverClassName:i()("command-list-popover",o.popoverClassName),popoverInnerClassName:o.popoverInnerClassName,menu:Ao.CommandPalette,extensionsController:e,location:n.location})),t.createElement(tv,{extensionsController:e,notificationItemStyleProps:{notificationItemClassNames:o.notificationClassNames}})),a)})({extensionsController:r,history:h,platformContext:o,telemetryService:c,render:l,...n.commandPaletteClassProps,notificationClassNames:n.notificationClassNames}))),s){const e=(()=>{const e=document.createElement("div");return e.dataset.globalDebug="true",document.body.append(e),e})();(({extensionsController:e,platformContext:n,history:r,render:o,sourcegraphURL:i})=>a=>{o(t.createElement(Ow,{extensionsController:e,location:r.location,platformContext:n,sourcegraphURL:i}),a)})({extensionsController:r,platformContext:o,history:h,sourcegraphURL:b,render:l})(e)}const N=new ye,A=N.next.bind(N);m.add(le([null],N).pipe(ze((()=>ee(o.refreshSettings()).pipe(st((e=>(console.error("Refreshing settings failed",e),[]))))))).subscribe());const I=new Pe(0);if(n.getContext){const{getContext:e,viewOnSourcegraphButtonClassProps:r}=n,o=Oe([N.pipe(ue(null)),ee(e())]).pipe(ze((([,{rawRepoName:e,revision:t}])=>dl({repoName:e,revision:t,requestGraphQL:v}).pipe(hl(),ut(!0),ue(void 0)))),st((e=>Oo(e)||e instanceof ll?[!1]:[ln(e)])),tt((e=>{if("boolean"==typeof e){const t=!1===e;O(t),Ic&&p.notifyRepoSyncError({sourcegraphURL:b,hasRepoSyncError:t}).catch((e=>{console.error("Error notifying background page of private cloud error:",e)}))}})));n.getViewContextOnSourcegraphMount?m.add(Oe([o,y.pipe(H(n.getViewContextOnSourcegraphMount),qe(Kn)),I.pipe(H((e=>0===e)),Qe()),ee(e()),DT(v)]).subscribe((([e,o,i,a,s])=>{l(t.createElement(TT,NT({},r,{codeHostType:n.type,context:a,minimalUI:u,sourcegraphURL:b,userSettingsURL:RT(b,s,a.rawRepoName),repoExistsOrError:e,showSignInButton:i,onSignInClose:A,onConfigureSourcegraphClick:Pc?void 0:PT})),o)}))):m.add(o.subscribe())}const P=e.pipe((({codeViewResolvers:e})=>vf(e))(n),tt((e=>{I.next(I.value+1),e.subscriptions.add((()=>I.next(I.value-1)))})),function(e,t=((e,t)=>new IntersectionObserver(e,t))){return n=>new B((r=>{const o=new g,i=new Map,a=t(((e,t)=>{for(const n of e){const e=n.target;n.isIntersecting&&i.get(e)&&(r.next(i.get(e)),t.unobserve(n.target),i.delete(e))}}),e);return o.add((()=>a.disconnect())),o.add(n.subscribe((e=>{i.set(e.element,e),a.observe(e.element),e.subscriptions.add((()=>{i.delete(e.element),a.unobserve(e.element)}))}))),o}))}({rootMargin:"4000px 0px"}),oe((e=>rr((()=>e.resolveFileInfo(e.element,o.requestGraphQL))).pipe(oe((e=>((e,t,n)=>{if("blob"in e)return gl(e.blob,t,n).pipe(H((t=>({blob:{...e.blob,...t}}))));if(e.head&&e.base)return rl(gl(e.head,t,n),gl(e.base,t,n)).pipe(H((([e,t])=>({head:e,base:t}))));return e.head?gl(e.head,t,n).pipe(H((e=>({head:e})))):gl(e.base,t,n).pipe(H((e=>({base:e}))))})(e,T,o.requestGraphQL))),oe((t=>((e,t,n)=>{if("blob"in e)return dp(e.blob,t,n).pipe(H((e=>({blob:e}))));if(e.head&&e.base)return rl(dp(e.base,t,n),dp(e.head,t,n)).pipe(H((([e,t])=>({head:t,base:e}))));return e.head?dp(e.head,t,n).pipe(H((e=>({head:e})))):dp(e.base,t,n).pipe(H((e=>({base:e}))))})(t,T,o.requestGraphQL).pipe(H((t=>({diffOrBlobInfo:t,...e})))))),st((e=>ee(T(e)).pipe((t=>{if(t)return ke;throw e})))),tt({error:i=>{if(e.getToolbarMount){const s=e.getToolbarMount(e.element);l(t.createElement(Tl,NT({},n.codeViewToolbarClassProps,{fileInfoOrError:i,sourcegraphURL:b,telemetryService:c,platformContext:o,extensionsController:r,buttonProps:e.toolbarButtonProps,onSignInClose:A,location:a.ob(window.location)})),s)}}}),dt((e=>e.pipe(tt((e=>{if(!lr(e))throw e})),ze((()=>N))))),st((e=>(console.error("Could not resolve file info for code view",e),[])))))),wt(Me)),R=new Map,D=async(e,t)=>{if(R.set(e,(R.get(e)||0)+1),1===R.get(e)){const n={uri:e,inputRevision:t};return r.extHostAPI.then((n=>n.addWorkspaceRoot({uri:e,inputRevision:t}))).catch((e=>console.error("Sourcegraph: error adding workspace root",{error:ln(e),workspaceRoot:n})))}},L=async e=>{const t=R.get(e);if(!t)throw new Error(`No preexisting root refs for uri ${e}`);const n=t-1;if(R.set(e,n),0===n)return r.extHostAPI.then((t=>t.removeWorkspaceRoot(e))).catch((t=>console.error("Sourcegraph: error removing workspace root",{error:ln(t),uri:e})))};return m.add(P.subscribe((e=>{console.log("Code view added");let i=!1;e.subscriptions.add((()=>{i=!0,console.log("Code view removed")})),i||(async()=>{const{element:s,diffOrBlobInfo:p,getPositionAdjuster:d,getToolbarMount:h,toolbarButtonProps:m,overrideTokenize:v}=e,y=async t=>{const n=ya(t),o={uri:n,languageId:Ia(t.filePath),text:t.content},i={type:"CodeEditor",resource:n,selections:e.getSelections?e.getSelections(e.element):[],isActive:!0},a=await r.extHostAPI,s=(({repoName:e,commitID:t})=>`git://${Xn(e)}?${t}`)(t),[,c]=await Promise.all([a.addTextDocumentIfNotExists(o),a.addViewerIfNotExists(i),D(s,t.revision)]);return e.subscriptions.add((()=>{Promise.all([L(s),a.removeViewer(c)]).catch((e=>console.error("Sourcegraph: error removing viewer and workspace root",{error:ln(e)})))})),{...i,...c,model:o}},w=await(async e=>{if("blob"in e)return{blob:{...e.blob,editor:await y(e.blob)}};if(e.head&&e.base){const[t,n]=await Promise.all([y(e.head),y(e.base)]);return{head:{...e.head,editor:t},base:{...e.base,editor:n}}}return e.base?{base:{...e.base,editor:await y(e.base)},head:void 0}:{head:{...e.head,editor:await y(e.head)},base:void 0}})(p);let _;if(_="blob"in w?w.blob.editor:w.head?w.head.editor:w.base.editor,i)return;const x={...e.dom,getCodeElementFromTarget:t=>null!==t.closest(".sourcegraph-extension-element")?null:e.dom.getCodeElementFromTarget(t)},S=(t,o)=>{var i;let a=new Map,c=!0;const l=(t,n)=>{try{a=iT(x,s,null!=t?t:[],a,null==n||n,c,o),c=null==n||n}catch(t){console.error("Could not apply decorations to code view",e.element,t)}};e.subscriptions.add(Oe([ee(r.extHostAPI).pipe(ze((e=>Xr(e.getTextDecorations({viewerId:t.viewerId}))))),null!==(i=n.isLightTheme)&&void 0!==i?i:z(!0)]).pipe(ot(l)).subscribe((([e,t])=>l(e,t))))};u||("blob"in w?S(w.blob.editor):(w.head&&S(w.head.editor,"head"),w.base&&S(w.base.editor,"base")));const O=({part:e})=>{if("blob"in p)return vl(p.blob);if(p.head&&"head"===e)return vl(p.head);if(p.base&&"base"===e)return vl(p.base);throw new Error(`Could not resolve context for diff part ${JSON.stringify(e)}`)},T=null==d?void 0:d(o.requestGraphQL);let k=new g;if(e.subscriptions.add(E.subscribe((t=>{k.unsubscribe(),t||(k=C.hoverify({dom:x,positionEvents:z(s).pipe($n({domFunctions:x,tokenize:!!("boolean"==typeof v?v:n.codeViewsRequireTokenization)})),resolveContext:O,adjustPosition:T,scrollBoundaries:e.getScrollBoundaries?e.getScrollBoundaries(e.element):[],overrideTokenize:v}))}))),e.subscriptions.add(k),s.classList.add("sg-mounted"),h&&!u){var N,I,P;const i=h(s);l(t.createElement(Tl,NT({},n.codeViewToolbarClassProps,{actionItemClass:null!==(N=null===(I=e.toolbarButtonProps)||void 0===I?void 0:I.actionItemClass)&&void 0!==N?N:null===(P=n.codeViewToolbarClassProps)||void 0===P?void 0:P.actionItemClass,hideActions:f,fileInfoOrError:p,sourcegraphURL:b,telemetryService:c,platformContext:o,extensionsController:r,buttonProps:m,location:a.ob(window.location),scope:_,onSignInClose:A})),i)}})().catch((e=>{console.error("Sourcegraph: uncaught error handling code view",ln(e))}))}))),m.add(Hh(ee(Hl.isEnabled("experimentalLinkPreviews")).pipe(ze((t=>t?e:[]))),{extensionsController:r},n)),m}const jT=[lf,hu,pd,zd,Fh,kf],FT=["github.com","gitlab.com"];function BT(e,n,{sourcegraphURL:r,assetsURL:o},i,a=(()=>null!==localStorage.getItem("debug"))()){var s,c;const l=new g,{platformContext:u,extensionsController:f}=function({urlToFile:e},t,n){const r=tT({urlToFile:e},t,n);return{platformContext:r,extensionsController:Vg(r)}}(n,{sourcegraphURL:r,assetsURL:o},i),{requestGraphQL:p}=u;l.add(f);const d=Oe([Yl(i),ee(null!==(s=null===(c=n.getContext)||void 0===c?void 0:c.call(n).then((e=>e.privateRepository)))&&void 0!==s?s:Promise.resolve(!0))]).pipe(H((([e,t])=>e&&(!Uc(r)||!t)))),h=new Ul(p,r),m=new Bl(h,d);let v;l.add(m);const b=i?Vc("sync","disableExtension"):z(!1),y=localStorage.getItem("sourcegraphMinimalUI"),w=null!==y?"true"===y:"gitlab"===n.type&&!i,E="gerrit"===n.type,_=(e,n)=>(0,me.render)(t.createElement(kl,{isBranded:!1},e),n);return l.add(b.subscribe((async t=>{t?(v&&v.unsubscribe(),console.log("Browser extension is disabled")):(v=await MT({mutations:e,codeHost:n,extensionsController:f,platformContext:u,showGlobalDebug:a,telemetryService:m,render:_,minimalUI:w,hideActions:E,background:Dc}),l.add(v),console.log((i?"Browser extension":"Native integration")+" is enabled"))}))),l}async function UT(e,t,n){const r=new g,o=(e=>{const t=jT.find((e=>e.check()));if(t){if(Uc(e)){const{hostname:e}=new URL(location.href);if(!FT.some((t=>t===e)))return void console.log(`Sourcegraph code host integration: stopped initialization since ${e} is not a supported code host when Sourcegraph URL is https://sourcegraph.com.\n List of supported code hosts on https://sourcegraph.com: ${FT.join(", ")}`)}return t}})(e.sourcegraphURL);if(o){console.log("Sourcegraph: Detected code host:",o.type),n&&await n(o);const i=(o.observeMutations||pe)(document.body,{childList:!0,subtree:!0}).pipe(ue([{addedNodes:[document.body],removedNodes:[]}]));let a;r.add(o.routeChange?o.routeChange(i).subscribe((()=>{a&&a.unsubscribe(),a=BT(i,o,e,t)})):BT(i,o,e,t))}return r}const qT="sourcegraph-app-background";function VT({id:e,path:t,assetsURL:n}){const r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",new URL(t,n).href),r.id=e,document.head.append(r)}r=f,function(){console.log("Sourcegraph native integration is running");const e=window.SOURCEGRAPH_URL;if(!e)throw new Error("window.SOURCEGRAPH_URL is undefined");const t=function(e){const t=window.SOURCEGRAPH_ASSETS_URL||new URL("/.assets/extension/",e).href;return t.endsWith("/")?t:t+"/"}(e);null!==document.querySelector(`#${qT}`)?document.dispatchEvent(new CustomEvent("sourcegraph:native-integration-activated")):function(){const e=document.createElement("div");e.id=qT,e.dataset.platform=Fc(),e.dataset.version=Bc(),e.style.display="none",document.body.append(e)}(),VT({id:"sourcegraph-styles",path:"css/style.bundle.css",assetsURL:t}),VT({id:"sourcegraph-styles-css-modules",path:"css/inject.bundle.css",assetsURL:t}),window.localStorage.setItem("SOURCEGRAPH_URL",e),window.SOURCEGRAPH_URL=e,UT({sourcegraphURL:e,assetsURL:t},false).catch((e=>{console.error("Error injecting Sourcegraph code intelligence:",e)}))}()})()})();
|
|
224
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
224
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWdyYXRpb24uYnVuZGxlLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQHNvdXJjZWdyYXBoL2Jyb3dzZXIvaW50ZWdyYXRpb24uYnVuZGxlLmpzIl0sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7OztBQStxbUVBOzs7Ozs7QUFrNVZBOzs7Ozs7Ozs7Ozs7Ozs7QUE4Q0E7Ozs7Ozs7Ozs7O0FBdURBOzs7Ozs7Ozs7O0FBcURBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTBLQTs7Ozs7O0FBb2RBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTJDQTs7Ozs7O0FBMitRQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBMk5BOzs7Ozs7Ozs7Ozs7OztBQW8vSkE7Ozs7Ozs7Ozs7Ozs7O0FBcUJBOzs7Ozs7Ozs7O0FBdTBLQTs7Ozs7Ozs7OztBQWpDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBaWhZQTs7Ozs7O0FBdEVBO0FBRUE7Ozs7OztBQXV5Q0EiLCJzb3VyY2VSb290IjoiIn0=
|