@sourcegraph/code-host-integration 0.0.74 → 0.0.77

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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},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/${Xn(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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},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){var o;const i=await this.getAnonUserID();r&&((e,t,n,r)=>{r({request:fr`
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,i,this.sourcegraphURL,this.requestGraphQL);const a=Uc(this.sourcegraphURL)?null===(o=await(Ac?browser.cookies.get:Dc.getCookie)({url:this.sourcegraphURL,name:"sourcegraphSourceUrl"}))||void 0===o?void 0:o.value:void 0;((e,t)=>{t({request:fr`
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: &quot;",r=e.indexOf(n);if(-1===r)return null;const o="\x3c!-- head sha1: &quot;",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: &quot;",r=e.indexOf(n);if(-1===r)return null;const o="\x3c!-- head sha1: &quot;",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}`)||e.querySelector(`.Header-old .${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
@@ -129,7 +129,7 @@
129
129
  oid
130
130
  }
131
131
  }
132
- `,variables:t,mightContainPrivateInfo:!0}).pipe(H(pr),H((({resolvePhabricatorDiff:e})=>{if(!e)throw new Error("Empty resolvePhabricatorDiff");const{oid:t}=e;if(!t)throw new Error("Could not resolve staging revision: empty oid");return{commitID:t}})));function xh(e,t,n){return function(e,t){return dh({...e,queryConduit:t}).pipe(ze((n=>e.isBase||!e.baseDiffID||function(e,t){for(const n of t)if(n.currentPath===e)return!0;return!1}(e.filePath,n.changes)?z({...e,diffDetails:n}):dh({...e,queryConduit:t}).pipe(H((t=>({...e,diffDetails:t,diffID:e.baseDiffID,useBaseForDiff:!0})))))))}(e,n).pipe(ze((({diffDetails:e,...r})=>{const o=function(e){const t=e.diffDetails.properties["arc.staging"];if(!t)return;let n;n=e.isBase?`refs/tags/phabricator/${e.useDiffForBase?"diff":"base"}/${e.diffID}`:`refs/tags/phabricator/${e.useBaseForDiff?"base":"diff"}/${e.diffID}`;for(const r of e.diffDetails.properties["arc.staging"].refs)if(r.ref===n){const e=r.remote.uri;if(e)return{repoName:fh(e),ref:r,unconfigured:"repository.unconfigured"===t.status}}}({diffDetails:e,...r}),i={repoName:r.repoName,diffID:r.diffID,baseRev:e.sourceControlBaseRevision,date:e.dateCreated,authorName:e.authorName,authorEmail:e.authorEmail,description:e.description};return r.isBase&&!r.useDiffForBase?z({commitID:e.sourceControlBaseRevision}):!o||o.unconfigured?hh({diffID:r.diffID,queryConduit:n}).pipe(ze((e=>_h({...i,patch:e,requestGraphQL:t})))):fl({rawRepoName:o.repoName,requestGraphQL:t}).pipe(ut({commitID:o.ref.commit,stagingRepoName:o.repoName}),st((e=>{if(!Oo(e))throw e;return hh({diffID:r.diffID,queryConduit:n}).pipe(ze((e=>_h({...i,patch:e,requestGraphQL:t}))))})))})))}const Sh=(e,t,n=ph)=>uh(window.location,t,n).pipe(H((e=>{if(e.mode!==Jd.Diffusion)throw new Error(`Unexpected PhabricatorState for resolveDiffusionFileInfo, PhabricatorMode: ${e.mode}`);const{filePath:t,commitID:n,rawRepoName:r}=e;return{blob:{filePath:t,commitID:n,rawRepoName:r}}}))),Oh="codeHost-module__hover-overlay_3rw5s",Th="codeHost-module__icon_3HyWM",Ch="codeHost-module__action-item_35MZg",kh="codeHost-module__hover-overlay-action-item_1yTXu",Nh="codeHost-module__hover-overlay-action-item-icon_1oozE",Ah=(e,t)=>({line:e.line,character:e.character+t}),Ih=e=>({direction:t,codeView:n,position:r})=>ml({...r,requestGraphQL:e}).pipe(H((e=>{const o=Kd.getCodeElementFromLineNumber(n,r.line,r.part);if(!o)throw new Error("(adjustPosition) could not find code element for line provided");const i=(e=>{var t;let n=e.textContent||"",r=0;if(null!==(t=e.firstElementChild)&&void 0!==t&&t.classList.contains("aural-only")){const t=e.firstElementChild.textContent||"";r=t.replace(/^(\+|-)/,"").length,n=n.slice(t.length-r)}return 8203===n.charCodeAt(0)&&(n=n.slice(1),r++),{textContent:n,adjust:r}})(o),a=i.textContent,s=e[r.line-1],c=(u=a,!!(l=s)&&!!u&&l.startsWith("\t")&&!u.startsWith("\t"));var l,u;const f=t===Fn.CodeViewToActual?-1:1;return Ah(r,c?(function(e){let t=e,n=0;for(;t.length>=2&&t.startsWith(" ");)++n,t=t.slice(2);return n}(a)+i.adjust)*f:i.adjust*f)}))),Ph={dom:Kd,resolveFileInfo:(e,t,n=ph)=>uh(window.location,t,n).pipe(H((e=>{if(e.mode!==Jd.Revision)throw new Error(`Unexpected Phabricator state for resolveRevisionFileInfo, PhabricatorMode: ${e.mode}`);const{rawRepoName:t,headCommitID:n,baseCommitID:r}=e,o=function(e){const t=document.querySelector(".differential-file-icon-header");if(!t)throw new Error("Unable to find file path container for revision code view");if(!t.textContent)throw new Error("`textContent` is undefined for revision file path container");return t.textContent}();return{base:{rawRepoName:t,filePath:o,commitID:r},head:{rawRepoName:t,filePath:o,commitID:n}}}))),getPositionAdjuster:Ih,getToolbarMount:e=>{let t=e.querySelector(".sourcegraph-phabricator-code-view-toolbar-mount");if(t)return t;const n=e.querySelector(".differential-changeset-buttons");if(!n)throw new Error("Unable to find action links for revision");return t=document.createElement("div"),t.style.display="inline-block",t.classList.add("sourcegraph-phabricator-code-view-toolbar-mount"),n.prepend(t),t}},Rh={dom:Kd,resolveFileInfo:(e,t,n=ph)=>uh(window.location,t,n).pipe(ze((r=>{if(r.mode!==Jd.Differential)throw new Error(`Unexpected PhabricatorState for resolveDiffFileInfo, PhabricatorMode: ${r.mode}`);const{filePath:o,baseFilePath:i}=function(e){const t=e.children[3].textContent,n=e.querySelectorAll(".differential-meta-notice");let r;const o="This file was moved from ";for(const e of n){let t=e.textContent;if(t.startsWith(o)){t=t.slice(0,-1),r=t.split(o)[1];break}}return{filePath:t,baseFilePath:r}}(e);return rl(xh({repoName:r.baseRawRepoName,revisionID:r.revisionID,diffID:r.baseDiffID||r.diffID,baseDiffID:r.baseDiffID,useDiffForBase:Boolean(r.baseDiffID),useBaseForDiff:!1,filePath:i||o,isBase:!0},t,n).pipe(H((({commitID:e,stagingRepoName:t})=>({commitID:e,rawRepoName:t||r.baseRawRepoName})))),xh({repoName:r.headRawRepoName,revisionID:r.revisionID,diffID:r.diffID,baseDiffID:r.baseDiffID,useDiffForBase:!1,useBaseForDiff:!1,filePath:o,isBase:!1},t,n).pipe(H((({commitID:e,stagingRepoName:t})=>({commitID:e,rawRepoName:t||r.headRawRepoName}))))).pipe(H((([e,t])=>({base:{rawRepoName:e.rawRepoName,filePath:i||o,commitID:e.commitID},head:{rawRepoName:t.rawRepoName,filePath:o,commitID:t.commitID}}))))}))),getPositionAdjuster:Ih,getToolbarMount:e=>{const t="sourcegraph-phabricator-code-view-toolbar-mount",n=e.querySelector("."+t);if(n)return n;const r=e.querySelector(".differential-changeset-buttons");if(!r)throw new Error("Unable to find action links for changeset");const o=document.createElement("div");return o.style.display="inline-block",o.classList.add(t),r.prepend(o," "),o},isDiff:!0},Dh={selector:".differential-changeset",resolveView:e=>window.location.pathname.match(/^\/r/)?{element:e,...Ph}:{element:e,...Rh}},Lh=pp(".diffusion-source",{dom:Yd,resolveFileInfo:Sh,getToolbarMount:()=>{const e=document.querySelector(".phui-two-column-content .phui-header-action-links");if(!e)throw new Error("unable to find file actions");const t=document.createElement("div");return t.style.display="inline-block",t.classList.add("sourcegraph-phabricator-code-view-toolbar-mount"),e.prepend(t),t}}),Mh=pp(".phabricator-source-code-container",{dom:Yd,resolveFileInfo:Sh}),jh={[Qa]:"phui-info-view phui-info-severity-plain",[Wa]:"phui-info-view phui-info-severity-success",[Ga]:"phui-info-view phui-info-severity-notice",[Ha]:"phui-info-view phui-info-severity-warning",[za]:"phui-info-view phui-info-severity-error"},Fh={codeViewResolvers:[Dh,Lh,Mh],type:"phabricator",name:"Phabricator",check:()=>!!document.querySelector(".phabricator-wordmark"),codeViewToolbarClassProps:{actionItemClass:i()("button grey",Ch),actionItemIconClass:Th},notificationClassNames:jh,hoverOverlayClassProps:{className:i()("aphront-dialog-view",Oh),actionItemClassName:i()("button grey",kh),iconClassName:Nh,getAlertClassName:mu(jh)},codeViewsRequireTokenization:!0};var Bh={leading:!0,trailing:!1};var Uh=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new qh(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),qh=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.duration=n,a.scheduler=r,a.leading=o,a.trailing=i,a._hasTrailingValue=!1,a._trailingValue=null,a}return w(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Vh,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(D);function Vh(e){e.subscriber.clearThrottle()}function $h({setElementTooltip:e,linkPreviewContentClass:t},n,r){const o="sg-link-preview-content";let i;if(n.nextSibling instanceof HTMLElement&&n.nextSibling.classList.contains(o)&&(i=n.nextSibling),null!=r&&r.content&&r.content.length>0){i?i.innerHTML="":(i=document.createElement("span"),i.classList.add(o),t&&i.classList.add(...t.split(" ")),n.after(i));for(const e of r.content.map((({kind:e,value:t})=>void 0===e||"markdown"===e?{html:Us(t).replace(/^<p>/,"").replace(/<\/p>\s*$/,"")}:t)))if("string"==typeof e)i.append(e);else{const t=document.createElement("span");for(t.innerHTML=e.html;t.hasChildNodes();)i.append(t.childNodes[0])}}else i&&(i.remove(),i=void 0);e&&(e(n,zh(r)),i&&e(i,zh(r)))}function zh(e){if(!e)return null;const t=e.hover.map((({value:e})=>e)).filter((e=>!!e));return t.length>0?t.join(" "):null}function Hh(e,{extensionsController:t},{contentViewResolvers:n,linkPreviewContentClass:r,setElementTooltip:o}){const i=e.pipe(vf(n||[]),wt(Me)),a=new ye,s=new Map;return i.pipe(oe((e=>kt(z(e).pipe(tt((()=>{console.log("Content view added",{contentViewEvent:e}),s.set(e.element,new g),e.subscriptions.add((()=>{console.log("Content view removed",{contentViewEvent:e});const t=s.get(e.element);if(!t)throw new Error("No linkPreview subscriptions");t.unsubscribe()}))}))),pe(e.element,{childList:!0},a).pipe(wt(Me),H((()=>e.element.innerHTML)),Qe(),tt((()=>console.log("Content view updated",{contentViewEvent:e}))),ut(e),function(e,t,n){return void 0===t&&(t=je),void 0===n&&(n=Bh),function(r){return r.lift(new Uh(e,t,n.leading,n.trailing))}}(2e3,void 0,{leading:!0,trailing:!0}))))),tt((({element:e})=>{let n=s.get(e);if(!n)throw new Error("No linkPreview subscriptions");n.unsubscribe(),n=new g,s.set(e,n);for(const i of e.querySelectorAll("a[href]"))n.add(ee(t.extHostAPI).pipe(ze((e=>Xr(e.getLinkPreviews(i.href))))).subscribe((e=>{try{a.next(!0),$h({setElementTooltip:o,linkPreviewContentClass:r},i,e)}finally{a.next(!1)}})))}))).subscribe()}var Gh=n(32805),Qh=n(42797),Wh=n.n(Qh),Kh=n(88514),Zh=n.n(Kh),Yh=n(37310),Jh=n.n(Yh),Xh=n(46950),em=n.n(Xh),tm=n(51437),nm=n(51491),rm=n.n(nm);const om=jo((e=>ee(e).pipe(ze((e=>Xr(e.haveInitialExtensionsLoaded()))))),(()=>"haveInitialExtensionsLoaded")),im=({text:e,pattern:n,className:r})=>t.createElement("span",null,function(e,t){const n=[];let r,o=0;for(let a=0;a<t.length;a++){var i;const s=e.indexOf(t.charAt(a),o);if(-1===s)break;null!==(i=r)&&void 0!==i&&i.match&&s===o?r.end=s+1:(r&&!r.match||s>o)&&(n.push({start:o,end:s,match:!1}),r=void 0),r||(r={start:s,end:s+1,match:!0},n.push(r)),o=s+1}e&&o<e.length&&n.push({start:o,end:e.length,match:!1});return n}(e.toLowerCase(),n.toLowerCase()).map(((n,o)=>n.match?t.createElement("strong",{key:o,className:r},e.slice(n.start,n.end)):e.slice(n.start,n.end))));const am="EmptyCommandListContainer-module__empty-command-list_NA_s5";function sm(){return(sm=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 cm=({className:e,children:n,...r})=>t.createElement("div",sm({className:i()(am,e)},r),n),lm="EmptyCommandList-module__title_Sbph5",um="EmptyCommandList-module__text_s1AXs",fm="EmptyCommandList-module__illustration_3pj62",pm=({settingsCascade:e,sourcegraphURL:n})=>{const r=!!e&&function(e){const t=$a(e,"User"),n=$a(e,"DefaultSettings");if(t&&n)for(const e of Object.keys(t))if(!(e in n))return!1;return!0}(e);return t.createElement(cm,null,t.createElement("p",{className:lm},r?"You don't have any extensions enabled":"You don't have any active actions"),t.createElement("p",{className:um},r?"Enable Sourcegraph extensions to get additional functionality, integrations, and make special actions available from this menu.":"Commands from your installed extensions will be shown when you navigate to certain pages."),t.createElement(Or,{to:n+"/extensions",variant:"primary"},"Explore extensions"),t.createElement(dm,{className:fm}))},dm=t.memo((({className:e})=>t.createElement("svg",{width:"59",height:"64",viewBox:"0 0 59 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e},t.createElement("path",{d:"M51.5825 43.9313C55.4271 45.582 57.2515 40.6516 57.8679 40.6516C58.4844 40.6516 58.9775 41.1397 58.9775 41.7497V60.3841C58.9775 62.3806 57.3411 64 55.3237 64H37.9287C37.7942 63.9778 37.6934 63.9556 37.6373 63.9335C35.9449 63.1459 40.2322 61.0779 40.1928 58.8201C40.1396 55.7739 38.0632 54.658 33.5688 54.658C29.0744 54.658 26.6802 55.4072 27.9131 59.6776C28.3325 61.1303 31.0022 63.1903 29.1192 63.9335C29.052 63.9556 28.8838 63.9778 28.6597 64H11.7803C9.78528 64 8.17132 62.4139 8.1377 60.4395V43.225C8.16011 43.0697 8.18253 42.9588 8.21615 42.9033C9.01192 41.2284 11.7803 44.8776 13.3831 45.4322C17.6197 46.8853 21.5201 43.1362 21.5201 38.6884C21.5201 34.2406 18.9535 27.9515 14.7168 29.4156C13.1141 29.9702 9.00072 34.8363 8.24978 32.9729C8.21615 32.9063 8.19374 32.7178 8.17132 32.4626L8.1377 16.9373C8.1377 16.9373 8.18253 16.3605 8.23857 16.0832C8.5636 13.9979 10.7492 13.1328 12.6209 13.1328L14.7168 13.1771C14.7168 13.1771 19.8725 13.2991 24.0644 13.3102H25.8016C27.6509 13.3102 29.0632 13.2659 29.3097 13.166C31.1927 12.4229 27.3147 9.63882 26.7543 8.05269C25.286 3.85997 29.0856 0 33.5688 0C38.052 0 41.8516 3.85997 40.3945 8.04159C39.8341 9.62773 36.1467 12.3785 37.8391 13.1549C37.996 13.2326 38.4219 13.277 39.0496 13.3102H46.7047C49.7533 13.2437 52.4096 13.1549 52.4096 13.1549L54.5055 13.1106C55.2228 13.1106 55.9962 13.2659 56.7023 13.5653C56.7247 13.5764 56.7583 13.5875 56.7919 13.5986C56.8592 13.6319 56.9152 13.6652 56.9825 13.6984C57.1394 13.7872 57.3075 13.8759 57.4532 13.9757C57.5877 14.0756 57.7222 14.1865 57.8455 14.2974C57.8791 14.3307 57.9127 14.3529 57.9464 14.3861C58.4283 14.852 58.787 15.451 58.9215 16.1941C58.9775 16.427 58.9999 16.6711 58.9999 16.9262V29.4156C58.9887 30.0257 58.4218 32.5682 57.9403 32.9484C55.2912 35.0404 54.2316 27.1052 50.5229 30.8565C47.5946 33.8183 47.7379 42.2805 51.5825 43.9313Z",fill:"url(#paint0_linear)",fillOpacity:"0.32"}),t.createElement("rect",{y:"24.6855",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{y:"46.627",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{y:"52.1133",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{y:"19.1992",width:"11.0972",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"11.0977",y:"30.1699",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"11.0977",y:"41.1426",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"11.0977",y:"35.6562",width:"15.7211",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"13.8711",y:"24.6855",width:"9.24768",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"13.8711",y:"46.627",width:"9.24768",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"13.8711",y:"52.1133",width:"5.54861",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"12.0225",y:"19.1992",width:"5.54861",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"24.9688",y:"30.1699",width:"4.62384",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"24.9688",y:"41.1426",width:"9.24767",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"30.5176",y:"30.1699",width:"7.39814",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"35.1416",y:"41.1426",width:"4.62384",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"27.7432",y:"35.6562",width:"7.39814",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("defs",null,t.createElement("linearGradient",{id:"paint0_linear",x1:"33.5688",y1:"0",x2:"33.5688",y2:"64",gradientUnits:"userSpaceOnUse"},t.createElement("stop",{stopColor:"#95A5C6",stopOpacity:"0.6"}),t.createElement("stop",{offset:"1",stopColor:"#95A5C6"})))))),hm="CommandList-module__command-list_10tyf",mm="CommandList-module__popover-button_1ug-b";function gm(){return(gm=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 vm=jo((e=>ee(e).pipe(ze((e=>Xr(e.getContributions()))))),(()=>"getContributions"));class bm extends t.PureComponent{static RECENT_ACTIONS_STORAGE_KEY="commandList.recentActions";static readRecentActions(){const e=localStorage.getItem(bm.RECENT_ACTIONS_STORAGE_KEY);if(null===e)return null;try{const t=JSON.parse(e);return Array.isArray(t)&&t.every((e=>"string"==typeof e))?t:null}catch(e){console.error("Error reading recent actions:",e)}return bm.writeRecentActions(null),null}static writeRecentActions(e){try{if(null===e)localStorage.removeItem(bm.RECENT_ACTIONS_STORAGE_KEY);else{const t=JSON.stringify(e);localStorage.setItem(bm.RECENT_ACTIONS_STORAGE_KEY,t)}}catch(e){console.error("Error writing recent actions:",e)}}state={input:"",selectedIndex:0,recentActions:bm.readRecentActions()};subscriptions=new g;selectedItem=null;setSelectedItem=e=>{this.selectedItem=e};componentDidMount(){this.subscriptions.add(om(this.props.extensionsController.extHostAPI).pipe(qe((e=>e)),ze((()=>vm(this.props.extensionsController.extHostAPI)))).subscribe((e=>{this.setState({contributions:e})}))),this.subscriptions.add(this.props.platformContext.settings.subscribe((e=>this.setState({settingsCascade:e})))),setTimeout((()=>{this.setState({autoFocus:!0})}))}componentDidUpdate(e,t){this.state.recentActions!==t.recentActions&&bm.writeRecentActions(this.state.recentActions)}componentWillUnmount(){this.subscriptions.unsubscribe()}render(){if(!this.state.contributions)return t.createElement(cm,{className:hm},t.createElement("div",{className:"d-flex py-5 align-items-center justify-content-center"},t.createElement(Pr,{inline:!1}),t.createElement("span",{className:"mx-2"},"Loading Sourcegraph extensions"),t.createElement(Nr,{as:em()})));const e=Vo(this.state.contributions,this.props.menu),n=this.state.input.trim(),r=function(e,t,n){if(!t)return null===n?e:Uo()(e,(e=>{const t=n.indexOf(e.action.id);return-1===t?null:t}),(({action:e})=>e.id));const r=new Array(e.length),o=new Array(e.length),i=e.filter(((e,n)=>{let i=r[n];return void 0===i&&(i=`${e.action.category?`${e.action.category}: `:""}${e.action.title||e.action.command||""}`,r[n]=i),void 0===o[n]&&(o[n]=rm()(i,t,0)),o[n]>0})).map(((e,t)=>{const r=null==n?void 0:n.indexOf(e.action.id);return{item:e,score:o[t],recentIndex:-1===r?null:r}}));return Uo()(i,"recentIndex","score",(({item:e})=>e.action.id)).map((({item:e})=>e))}(e,this.state.input,this.state.recentActions),o=(this.state.selectedIndex%r.length+r.length)%r.length;return t.createElement("div",{className:hm},t.createElement("header",null,t.createElement("form",{className:this.props.formClassName,onSubmit:this.onSubmit},t.createElement("label",{className:"sr-only",htmlFor:"command-list-input"},"Command"),t.createElement("input",{id:"command-list-input",ref:e=>e&&this.state.autoFocus&&e.focus({preventScroll:!0}),type:"text",className:this.props.inputClassName,value:this.state.input,placeholder:"Run Sourcegraph action...",spellCheck:!1,autoCorrect:"off",autoComplete:"off",onChange:this.onInputChange,onKeyDown:this.onInputKeyDown}))),t.createElement("div",{className:this.props.resultsContainerClassName},t.createElement("ul",{className:this.props.listClassName},r.length>0?r.map(((e,r)=>t.createElement("li",{className:i()(this.props.listItemClassName,r===o&&this.props.selectedListItemClassName),key:e.action.id},t.createElement(yo,gm({},this.props,{className:i()(this.props.actionItemClassName,r===o&&this.props.selectedActionItemClassName)},e,{ref:r===o?this.setSelectedItem:void 0,title:t.createElement(im,{text:[e.action.category,e.action.title||e.action.command].filter(Boolean).join(": "),pattern:n}),onDidExecute:this.onActionDidExecute}))))):n.length>0?t.createElement("li",{className:this.props.noResultsClassName},"No matching commands"):t.createElement(pm,{settingsCascade:this.state.settingsCascade,sourcegraphURL:this.props.platformContext.sourcegraphURL}))))}onInputChange=e=>{this.setState({input:e.currentTarget.value,selectedIndex:0})};onInputKeyDown=e=>{switch(e.key){case br.s.ArrowDown:e.preventDefault(),this.setSelectedIndex(1);break;case br.s.ArrowUp:e.preventDefault(),this.setSelectedIndex(-1);break;case br.s.Enter:this.selectedItem&&this.selectedItem.runAction(e)}};onSubmit=e=>e.preventDefault();setSelectedIndex(e){this.setState((t=>({selectedIndex:t.selectedIndex+e})))}onActionDidExecute=e=>{this.setState((t=>{const{recentActions:n}=t;return n?{recentActions:zo()([e,...n]).slice(0,10)}:{recentActions:[e]}})),this.props.onSelect&&this.props.onSelect()}}const ym=({buttonClassName:e,buttonElement:n="span",buttonOpenClassName:r,showCaret:o=!0,popoverClassName:a,popoverInnerClassName:s,keyboardShortcutForShow:c,variant:l,...u})=>{const[f,p]=(0,t.useState)(!1),d=(0,t.useCallback)((()=>p(!1)),[]),h=(0,t.useCallback)((()=>p(!f)),[f]),m=(0,t.useMemo)((()=>Ra()("command-list-popover-button-")),[]),g=()=>f?t.createElement(Nr,{as:Zh()}):t.createElement(Nr,{as:Wh()});return t.createElement(xr,{as:n,role:"button",id:m,onClick:h,className:i()(mm,e,f&&r),variant:l},t.createElement(Nr,{as:Jh(),size:"md"}),o&&t.createElement(g,null),t.createElement(tm.ZP,{isOpen:f,toggle:h,popperClassName:a,innerClassName:i()("popover-inner",s),placement:"bottom-end",target:m,trigger:"legacy",delay:0,fade:!1,hideArrow:!0},t.createElement(bm,gm({},u,{onSelect:d}))),null==c?void 0:c.keybindings.map(((e,n)=>t.createElement(Gh.z9,gm({key:n},e,{onMatch:h})))))};var wm=n(7263),Em=n.n(wm);function _m(e,t,n){var r;return r=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n},function(e){return e.lift(function(e){var t,n,r=e.bufferSize,o=void 0===r?Number.POSITIVE_INFINITY:r,i=e.windowTime,a=void 0===i?Number.POSITIVE_INFINITY:i,s=e.refCount,c=e.scheduler,l=0,u=!1,f=!1;return function(e){var r;l++,!t||u?(u=!1,t=new Ro(o,a,c),r=t.subscribe(this),n=e.subscribe({next:function(e){t.next(e)},error:function(e){u=!0,t.error(e)},complete:function(){f=!0,n=void 0,t.complete()}})):r=t.subscribe(this),this.add((function(){l--,r.unsubscribe(),n&&!f&&s&&0===l&&(n.unsubscribe(),n=void 0,t=void 0)}))}}(r))}}function xm(e){return(xm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var Sm="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function Om(e,t){for(var n,r=/\r\n|[\n\r]/g,o=1,i=t+1;(n=r.exec(e.body))&&n.index<t;)o+=1,i=t+1-(n.index+n[0].length);return{line:o,column:i}}function Tm(e){return Cm(e.source,Om(e.source,e.start))}function Cm(e,t){var n=e.locationOffset.column-1,r=Nm(n)+e.body,o=t.line-1,i=e.locationOffset.line-1,a=t.line+i,s=1===t.line?n:0,c=t.column+s,l="".concat(e.name,":").concat(a,":").concat(c,"\n"),u=r.split(/\r\n|[\n\r]/g),f=u[o];if(f.length>120){for(var p=Math.floor(c/80),d=c%80,h=[],m=0;m<f.length;m+=80)h.push(f.slice(m,m+80));return l+km([["".concat(a),h[0]]].concat(h.slice(1,p+1).map((function(e){return["",e]})),[[" ",Nm(d-1)+"^"],["",h[p+1]]]))}return l+km([["".concat(a-1),u[o-1]],["".concat(a),f],["",Nm(c-1)+"^"],["".concat(a+1),u[o+1]]])}function km(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),n=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,r=e[0],o=e[1];return Nm(n-(t=r).length)+t+(o?" | "+o:" |")})).join("\n")}function Nm(e){return Array(e+1).join(" ")}function Am(e){return(Am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Im(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pm(e,t){return!t||"object"!==Am(t)&&"function"!=typeof t?Rm(e):t}function Rm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dm(e){var t="function"==typeof Map?new Map:void 0;return(Dm=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Lm(e,arguments,Fm(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),jm(r,e)})(e)}function Lm(e,t,n){return(Lm=Mm()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&jm(o,n.prototype),o}).apply(null,arguments)}function Mm(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function jm(e,t){return(jm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fm(e){return(Fm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Bm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jm(e,t)}(s,e);var t,n,r,o,i,a=(t=s,n=Mm(),function(){var e,r=Fm(t);if(n){var o=Fm(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Pm(this,e)});function s(e,t,n,r,o,i,c){var l,u,f,p,d;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),d=a.call(this,e);var h,m=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,g=n;!g&&m&&(g=null===(h=m[0].loc)||void 0===h?void 0:h.source);var v,b=r;!b&&m&&(b=m.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),b&&0===b.length&&(b=void 0),r&&n?v=r.map((function(e){return Om(n,e)})):m&&(v=m.reduce((function(e,t){return t.loc&&e.push(Om(t.loc.source,t.loc.start)),e}),[]));var y,w=c;if(null==w&&null!=i){var E=i.extensions;"object"==xm(y=E)&&null!==y&&(w=E)}return Object.defineProperties(Rm(d),{name:{value:"GraphQLError"},message:{value:e,enumerable:!0,writable:!0},locations:{value:null!==(l=v)&&void 0!==l?l:void 0,enumerable:null!=v},path:{value:null!=o?o:void 0,enumerable:null!=o},nodes:{value:null!=m?m:void 0},source:{value:null!==(u=g)&&void 0!==u?u:void 0},positions:{value:null!==(f=b)&&void 0!==f?f:void 0},originalError:{value:i},extensions:{value:null!==(p=w)&&void 0!==p?p:void 0,enumerable:null!=w}}),(null==i?void 0:i.stack)?(Object.defineProperty(Rm(d),"stack",{value:i.stack,writable:!0,configurable:!0}),Pm(d)):(Error.captureStackTrace?Error.captureStackTrace(Rm(d),s):Object.defineProperty(Rm(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return r=s,(o=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n<r.length;n++){var o=r[n];o.loc&&(t+="\n\n"+Tm(o.loc))}else if(e.source&&e.locations)for(var i=0,a=e.locations;i<a.length;i++){var s=a[i];t+="\n\n"+Cm(e.source,s)}return t}(this)}},{key:Sm,get:function(){return"Object"}}])&&Im(r.prototype,o),i&&Im(r,i),s}(Dm(Error));function Um(e,t,n){return new Bm("Syntax Error: ".concat(n),void 0,e,[t])}var qm=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});const Vm="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function $m(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,Vm&&(e.prototype[Vm]=t)}var zm=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();$m(zm);var Hm=function(){function e(e,t,n,r,o,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=o,this.value=a,this.prev=i,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function Gm(e){return null!=e&&"string"==typeof e.kind}$m(Hm);var Qm=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Wm(e){return(Wm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Km(e){return Zm(e,[])}function Zm(e,t){switch(Wm(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=function(e){var t=e[String(Vm)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==r){var o=r.call(e);if(o!==e)return"string"==typeof o?o:Zm(o,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,o=[],i=0;i<n;++i)o.push(Zm(e[i],t));1===r?o.push("... 1 more item"):r>1&&o.push("... ".concat(r," more items"));return"["+o.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]";return"{ "+n.map((function(n){return n+": "+Zm(e[n],t)})).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function Ym(e,t){if(!Boolean(e))throw new Error(t)}const Jm=function(e,t){return e instanceof t};function Xm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var eg=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||Ym(0,"Body must be a string. Received: ".concat(Km(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ym(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ym(0,"column in locationOffset is 1-indexed and must be positive.")}var t,n,r;return t=e,(n=[{key:Sm,get:function(){return"Source"}}])&&Xm(t.prototype,n),r&&Xm(t,r),e}();var tg=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function ng(e){var t=e.split(/\r\n|[\n\r]/g),n=function(e){for(var t,n=!0,r=!0,o=0,i=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:n=!1,r=!0,o=0;break;case 9:case 32:++o;break;default:r&&!n&&(null===i||o<i)&&(i=o),r=!1}return null!==(t=i)&&void 0!==t?t:0}(e);if(0!==n)for(var r=1;r<t.length;r++)t[r]=t[r].slice(n);for(var o=0;o<t.length&&rg(t[o]);)++o;for(var i=t.length;i>o&&rg(t[i-1]);)--i;return t.slice(o,i).join("\n")}function rg(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}var og=function(){function e(e){var t=new Hm(Qm.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==Qm.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=ag(this,e)}while(e.kind===Qm.COMMENT);return e},e}();function ig(e){return isNaN(e)?Qm.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function ag(e,t){for(var n=e.source,r=n.body,o=r.length,i=t.end;i<o;){var a=r.charCodeAt(i),s=e.line,c=1+i-e.lineStart;switch(a){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===r.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 33:return new Hm(Qm.BANG,i,i+1,s,c,t);case 35:return cg(n,i,s,c,t);case 36:return new Hm(Qm.DOLLAR,i,i+1,s,c,t);case 38:return new Hm(Qm.AMP,i,i+1,s,c,t);case 40:return new Hm(Qm.PAREN_L,i,i+1,s,c,t);case 41:return new Hm(Qm.PAREN_R,i,i+1,s,c,t);case 46:if(46===r.charCodeAt(i+1)&&46===r.charCodeAt(i+2))return new Hm(Qm.SPREAD,i,i+3,s,c,t);break;case 58:return new Hm(Qm.COLON,i,i+1,s,c,t);case 61:return new Hm(Qm.EQUALS,i,i+1,s,c,t);case 64:return new Hm(Qm.AT,i,i+1,s,c,t);case 91:return new Hm(Qm.BRACKET_L,i,i+1,s,c,t);case 93:return new Hm(Qm.BRACKET_R,i,i+1,s,c,t);case 123:return new Hm(Qm.BRACE_L,i,i+1,s,c,t);case 124:return new Hm(Qm.PIPE,i,i+1,s,c,t);case 125:return new Hm(Qm.BRACE_R,i,i+1,s,c,t);case 34:return 34===r.charCodeAt(i+1)&&34===r.charCodeAt(i+2)?pg(n,i,s,c,t,e):fg(n,i,s,c,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return lg(n,i,a,s,c,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return hg(n,i,s,c,t)}throw Um(n,i,sg(a))}var l=e.line,u=1+i-e.lineStart;return new Hm(Qm.EOF,o,o,l,u,t)}function sg(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(ig(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(ig(e),".")}function cg(e,t,n,r,o){var i,a=e.body,s=t;do{i=a.charCodeAt(++s)}while(!isNaN(i)&&(i>31||9===i));return new Hm(Qm.COMMENT,t,s,n,r,o,a.slice(t+1,s))}function lg(e,t,n,r,o,i){var a=e.body,s=n,c=t,l=!1;if(45===s&&(s=a.charCodeAt(++c)),48===s){if((s=a.charCodeAt(++c))>=48&&s<=57)throw Um(e,c,"Invalid number, unexpected digit after 0: ".concat(ig(s),"."))}else c=ug(e,c,s),s=a.charCodeAt(c);if(46===s&&(l=!0,s=a.charCodeAt(++c),c=ug(e,c,s),s=a.charCodeAt(c)),69!==s&&101!==s||(l=!0,43!==(s=a.charCodeAt(++c))&&45!==s||(s=a.charCodeAt(++c)),c=ug(e,c,s),s=a.charCodeAt(c)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw Um(e,c,"Invalid number, expected digit but got: ".concat(ig(s),"."));return new Hm(l?Qm.FLOAT:Qm.INT,t,c,r,o,i,a.slice(t,c))}function ug(e,t,n){var r=e.body,o=t,i=n;if(i>=48&&i<=57){do{i=r.charCodeAt(++o)}while(i>=48&&i<=57);return o}throw Um(e,o,"Invalid number, expected digit but got: ".concat(ig(i),"."))}function fg(e,t,n,r,o){for(var i,a,s,c,l=e.body,u=t+1,f=u,p=0,d="";u<l.length&&!isNaN(p=l.charCodeAt(u))&&10!==p&&13!==p;){if(34===p)return d+=l.slice(f,u),new Hm(Qm.STRING,t,u+1,n,r,o,d);if(p<32&&9!==p)throw Um(e,u,"Invalid character within String: ".concat(ig(p),"."));if(++u,92===p){switch(d+=l.slice(f,u-1),p=l.charCodeAt(u)){case 34:d+='"';break;case 47:d+="/";break;case 92:d+="\\";break;case 98:d+="\b";break;case 102:d+="\f";break;case 110:d+="\n";break;case 114:d+="\r";break;case 116:d+="\t";break;case 117:var h=(i=l.charCodeAt(u+1),a=l.charCodeAt(u+2),s=l.charCodeAt(u+3),c=l.charCodeAt(u+4),dg(i)<<12|dg(a)<<8|dg(s)<<4|dg(c));if(h<0){var m=l.slice(u+1,u+5);throw Um(e,u,"Invalid character escape sequence: \\u".concat(m,"."))}d+=String.fromCharCode(h),u+=4;break;default:throw Um(e,u,"Invalid character escape sequence: \\".concat(String.fromCharCode(p),"."))}f=++u}}throw Um(e,u,"Unterminated string.")}function pg(e,t,n,r,o,i){for(var a=e.body,s=t+3,c=s,l=0,u="";s<a.length&&!isNaN(l=a.charCodeAt(s));){if(34===l&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2))return u+=a.slice(c,s),new Hm(Qm.BLOCK_STRING,t,s+3,n,r,o,ng(u));if(l<32&&9!==l&&10!==l&&13!==l)throw Um(e,s,"Invalid character within String: ".concat(ig(l),"."));10===l?(++s,++i.line,i.lineStart=s):13===l?(10===a.charCodeAt(s+1)?s+=2:++s,++i.line,i.lineStart=s):92===l&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2)&&34===a.charCodeAt(s+3)?(u+=a.slice(c,s)+'"""',c=s+=4):++s}throw Um(e,s,"Unterminated string.")}function dg(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function hg(e,t,n,r,o){for(var i=e.body,a=i.length,s=t+1,c=0;s!==a&&!isNaN(c=i.charCodeAt(s))&&(95===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++s;return new Hm(Qm.NAME,t,s,n,r,o,i.slice(t,s))}var mg=function(){function e(e,t){var n=function(e){return Jm(e,eg)}(e)?e:new eg(e);this._lexer=new og(n),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(Qm.NAME);return{kind:qm.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:qm.DOCUMENT,definitions:this.many(Qm.SOF,this.parseDefinition,Qm.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(Qm.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(Qm.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(Qm.BRACE_L))return{kind:qm.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(Qm.NAME)&&(t=this.parseName()),{kind:qm.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(Qm.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(Qm.PAREN_L,this.parseVariableDefinition,Qm.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:qm.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Qm.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Qm.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(Qm.DOLLAR),{kind:qm.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:qm.SELECTION_SET,selections:this.many(Qm.BRACE_L,this.parseSelection,Qm.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(Qm.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(Qm.COLON)?(e=r,t=this.parseName()):t=r,{kind:qm.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Qm.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Qm.PAREN_L,t,Qm.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(Qm.COLON),{kind:qm.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:qm.ARGUMENT,name:this.parseName(),value:(this.expectToken(Qm.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(Qm.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(Qm.NAME)?{kind:qm.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:qm.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:qm.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:qm.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case Qm.BRACKET_L:return this.parseList(e);case Qm.BRACE_L:return this.parseObject(e);case Qm.INT:return this._lexer.advance(),{kind:qm.INT,value:t.value,loc:this.loc(t)};case Qm.FLOAT:return this._lexer.advance(),{kind:qm.FLOAT,value:t.value,loc:this.loc(t)};case Qm.STRING:case Qm.BLOCK_STRING:return this.parseStringLiteral();case Qm.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:qm.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:qm.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:qm.NULL,loc:this.loc(t)};default:return{kind:qm.ENUM,value:t.value,loc:this.loc(t)}}case Qm.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:qm.STRING,value:e.value,block:e.kind===Qm.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:qm.LIST,values:this.any(Qm.BRACKET_L,(function(){return t.parseValueLiteral(e)}),Qm.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:qm.OBJECT,fields:this.any(Qm.BRACE_L,(function(){return t.parseObjectField(e)}),Qm.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(Qm.COLON),{kind:qm.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(Qm.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(Qm.AT),{kind:qm.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(Qm.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(Qm.BRACKET_R),e={kind:qm.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(Qm.BANG)?{kind:qm.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:qm.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===Qm.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(Qm.STRING)||this.peek(Qm.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(Qm.BRACE_L,this.parseOperationTypeDefinition,Qm.BRACE_R);return{kind:qm.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(Qm.COLON);var n=this.parseNamedType();return{kind:qm.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:qm.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),i=this.parseFieldsDefinition();return{kind:qm.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:o,fields:i,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(Qm.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(Qm.AMP)||this.peek(Qm.NAME));return t}return this.delimitedMany(Qm.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(Qm.BRACE_L)&&this._lexer.lookahead().kind===Qm.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(Qm.BRACE_L,this.parseFieldDefinition,Qm.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Qm.COLON);var o=this.parseTypeReference(),i=this.parseDirectives(!0);return{kind:qm.FIELD_DEFINITION,description:t,name:n,arguments:r,type:o,directives:i,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(Qm.PAREN_L,this.parseInputValueDef,Qm.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Qm.COLON);var r,o=this.parseTypeReference();this.expectOptionalToken(Qm.EQUALS)&&(r=this.parseValueLiteral(!0));var i=this.parseDirectives(!0);return{kind:qm.INPUT_VALUE_DEFINITION,description:t,name:n,type:o,defaultValue:r,directives:i,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),i=this.parseFieldsDefinition();return{kind:qm.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:o,fields:i,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseUnionMemberTypes();return{kind:qm.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:o,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(Qm.EQUALS)?this.delimitedMany(Qm.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();return{kind:qm.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:o,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(Qm.BRACE_L,this.parseEnumValueDefinition,Qm.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:qm.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();return{kind:qm.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:o,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(Qm.BRACE_L,this.parseInputValueDef,Qm.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===Qm.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(Qm.BRACE_L,this.parseOperationTypeDefinition,Qm.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:qm.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:qm.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===o.length)throw this.unexpected();return{kind:qm.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:o,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===o.length)throw this.unexpected();return{kind:qm.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:o,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:qm.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:qm.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:qm.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Qm.AT);var n=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var i=this.parseDirectiveLocations();return{kind:qm.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:o,locations:i,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(Qm.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==tg[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new zm(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw Um(this._lexer.source,t.start,"Expected ".concat(vg(e),", found ").concat(gg(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==Qm.NAME||t.value!==e)throw Um(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(gg(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===Qm.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return Um(this._lexer.source,t.start,"Unexpected ".concat(gg(t),"."))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n},e}();function gg(e){var t=e.value;return vg(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function vg(e){return function(e){return e===Qm.BANG||e===Qm.DOLLAR||e===Qm.AMP||e===Qm.PAREN_L||e===Qm.PAREN_R||e===Qm.SPREAD||e===Qm.COLON||e===Qm.EQUALS||e===Qm.AT||e===Qm.BRACKET_L||e===Qm.BRACKET_R||e===Qm.BRACE_L||e===Qm.PIPE||e===Qm.BRACE_R}(e)?'"'.concat(e,'"'):e}var bg=new Map,yg=new Map,wg=!0,Eg=!1;function _g(e){return e.replace(/[\s,]+/g," ").trim()}function xg(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,o=_g((a=e.loc).source.body.substring(a.start,a.end)),i=yg.get(r);i&&!i.has(o)?wg&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):i||yg.set(r,i=new Set),i.add(o),t.has(o)||(t.add(o),n.push(e))}else n.push(e);var a})),E(E({},e),{definitions:n})}function Sg(e){var t=_g(e);if(!bg.has(t)){var n=function(e,t){return new mg(e,t).parseDocument()}(e,{experimentalFragmentVariables:Eg});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");bg.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(xg(n)))}return bg.get(t)}function Og(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach((function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]})),Sg(r)}var Tg,Cg=Og,kg=function(){bg.clear(),yg.clear()},Ng=function(){wg=!1},Ag=function(){Eg=!0},Ig=function(){Eg=!1};(Tg=Og||(Og={})).gql=Cg,Tg.resetCaches=kg,Tg.disableFragmentWarnings=Ng,Tg.enableExperimentalFragmentVariables=Ag,Tg.disableExperimentalFragmentVariables=Ig,Og.default=Og;const Pg=e=>"string"==typeof e?Og(e):e;function Rg(e){return new B((t=>{const n=e.then((e=>e.subscribe(t))).catch((()=>t.unsubscribe()));return function(){t.unsubscribe(),n.then((e=>null==e?void 0:e.unsubscribe())).catch((e=>console.log(e)))}}))}const Dg=fr`
132
+ `,variables:t,mightContainPrivateInfo:!0}).pipe(H(pr),H((({resolvePhabricatorDiff:e})=>{if(!e)throw new Error("Empty resolvePhabricatorDiff");const{oid:t}=e;if(!t)throw new Error("Could not resolve staging revision: empty oid");return{commitID:t}})));function xh(e,t,n){return function(e,t){return dh({...e,queryConduit:t}).pipe(ze((n=>e.isBase||!e.baseDiffID||function(e,t){for(const n of t)if(n.currentPath===e)return!0;return!1}(e.filePath,n.changes)?z({...e,diffDetails:n}):dh({...e,queryConduit:t}).pipe(H((t=>({...e,diffDetails:t,diffID:e.baseDiffID,useBaseForDiff:!0})))))))}(e,n).pipe(ze((({diffDetails:e,...r})=>{const o=function(e){const t=e.diffDetails.properties["arc.staging"];if(!t)return;let n;n=e.isBase?`refs/tags/phabricator/${e.useDiffForBase?"diff":"base"}/${e.diffID}`:`refs/tags/phabricator/${e.useBaseForDiff?"base":"diff"}/${e.diffID}`;for(const r of e.diffDetails.properties["arc.staging"].refs)if(r.ref===n){const e=r.remote.uri;if(e)return{repoName:fh(e),ref:r,unconfigured:"repository.unconfigured"===t.status}}}({diffDetails:e,...r}),i={repoName:r.repoName,diffID:r.diffID,baseRev:e.sourceControlBaseRevision,date:e.dateCreated,authorName:e.authorName,authorEmail:e.authorEmail,description:e.description};return r.isBase&&!r.useDiffForBase?z({commitID:e.sourceControlBaseRevision}):!o||o.unconfigured?hh({diffID:r.diffID,queryConduit:n}).pipe(ze((e=>_h({...i,patch:e,requestGraphQL:t})))):fl({rawRepoName:o.repoName,requestGraphQL:t}).pipe(ut({commitID:o.ref.commit,stagingRepoName:o.repoName}),st((e=>{if(!Oo(e))throw e;return hh({diffID:r.diffID,queryConduit:n}).pipe(ze((e=>_h({...i,patch:e,requestGraphQL:t}))))})))})))}const Sh=(e,t,n=ph)=>uh(window.location,t,n).pipe(H((e=>{if(e.mode!==Jd.Diffusion)throw new Error(`Unexpected PhabricatorState for resolveDiffusionFileInfo, PhabricatorMode: ${e.mode}`);const{filePath:t,commitID:n,rawRepoName:r}=e;return{blob:{filePath:t,commitID:n,rawRepoName:r}}}))),Oh="codeHost-module__hover-overlay_3rw5s",Th="codeHost-module__icon_3HyWM",Ch="codeHost-module__action-item_35MZg",kh="codeHost-module__hover-overlay-action-item_1yTXu",Nh="codeHost-module__hover-overlay-action-item-icon_1oozE",Ah=(e,t)=>({line:e.line,character:e.character+t}),Ih=e=>({direction:t,codeView:n,position:r})=>ml({...r,requestGraphQL:e}).pipe(H((e=>{const o=Kd.getCodeElementFromLineNumber(n,r.line,r.part);if(!o)throw new Error("(adjustPosition) could not find code element for line provided");const i=(e=>{var t;let n=e.textContent||"",r=0;if(null!==(t=e.firstElementChild)&&void 0!==t&&t.classList.contains("aural-only")){const t=e.firstElementChild.textContent||"";r=t.replace(/^(\+|-)/,"").length,n=n.slice(t.length-r)}return 8203===n.charCodeAt(0)&&(n=n.slice(1),r++),{textContent:n,adjust:r}})(o),a=i.textContent,s=e[r.line-1],c=(u=a,!!(l=s)&&!!u&&l.startsWith("\t")&&!u.startsWith("\t"));var l,u;const f=t===Fn.CodeViewToActual?-1:1;return Ah(r,c?(function(e){let t=e,n=0;for(;t.length>=2&&t.startsWith(" ");)++n,t=t.slice(2);return n}(a)+i.adjust)*f:i.adjust*f)}))),Ph={dom:Kd,resolveFileInfo:(e,t,n=ph)=>uh(window.location,t,n).pipe(H((e=>{if(e.mode!==Jd.Revision)throw new Error(`Unexpected Phabricator state for resolveRevisionFileInfo, PhabricatorMode: ${e.mode}`);const{rawRepoName:t,headCommitID:n,baseCommitID:r}=e,o=function(e){const t=document.querySelector(".differential-file-icon-header");if(!t)throw new Error("Unable to find file path container for revision code view");if(!t.textContent)throw new Error("`textContent` is undefined for revision file path container");return t.textContent}();return{base:{rawRepoName:t,filePath:o,commitID:r},head:{rawRepoName:t,filePath:o,commitID:n}}}))),getPositionAdjuster:Ih,getToolbarMount:e=>{let t=e.querySelector(".sourcegraph-phabricator-code-view-toolbar-mount");if(t)return t;const n=e.querySelector(".differential-changeset-buttons");if(!n)throw new Error("Unable to find action links for revision");return t=document.createElement("div"),t.style.display="inline-block",t.classList.add("sourcegraph-phabricator-code-view-toolbar-mount"),n.prepend(t),t}},Rh={dom:Kd,resolveFileInfo:(e,t,n=ph)=>uh(window.location,t,n).pipe(ze((r=>{if(r.mode!==Jd.Differential)throw new Error(`Unexpected PhabricatorState for resolveDiffFileInfo, PhabricatorMode: ${r.mode}`);const{filePath:o,baseFilePath:i}=function(e){const t=e.children[3].textContent,n=e.querySelectorAll(".differential-meta-notice");let r;const o="This file was moved from ";for(const e of n){let t=e.textContent;if(t.startsWith(o)){t=t.slice(0,-1),r=t.split(o)[1];break}}return{filePath:t,baseFilePath:r}}(e);return rl(xh({repoName:r.baseRawRepoName,revisionID:r.revisionID,diffID:r.baseDiffID||r.diffID,baseDiffID:r.baseDiffID,useDiffForBase:Boolean(r.baseDiffID),useBaseForDiff:!1,filePath:i||o,isBase:!0},t,n).pipe(H((({commitID:e,stagingRepoName:t})=>({commitID:e,rawRepoName:t||r.baseRawRepoName})))),xh({repoName:r.headRawRepoName,revisionID:r.revisionID,diffID:r.diffID,baseDiffID:r.baseDiffID,useDiffForBase:!1,useBaseForDiff:!1,filePath:o,isBase:!1},t,n).pipe(H((({commitID:e,stagingRepoName:t})=>({commitID:e,rawRepoName:t||r.headRawRepoName}))))).pipe(H((([e,t])=>({base:{rawRepoName:e.rawRepoName,filePath:i||o,commitID:e.commitID},head:{rawRepoName:t.rawRepoName,filePath:o,commitID:t.commitID}}))))}))),getPositionAdjuster:Ih,getToolbarMount:e=>{const t="sourcegraph-phabricator-code-view-toolbar-mount",n=e.querySelector("."+t);if(n)return n;const r=e.querySelector(".differential-changeset-buttons");if(!r)throw new Error("Unable to find action links for changeset");const o=document.createElement("div");return o.style.display="inline-block",o.classList.add(t),r.prepend(o," "),o},isDiff:!0},Dh={selector:".differential-changeset",resolveView:e=>window.location.pathname.match(/^\/r/)?{element:e,...Ph}:{element:e,...Rh}},Lh=pp(".diffusion-source",{dom:Yd,resolveFileInfo:Sh,getToolbarMount:()=>{const e=document.querySelector(".phui-two-column-content .phui-header-action-links");if(!e)throw new Error("unable to find file actions");const t=document.createElement("div");return t.style.display="inline-block",t.classList.add("sourcegraph-phabricator-code-view-toolbar-mount"),e.prepend(t),t}}),Mh=pp(".phabricator-source-code-container",{dom:Yd,resolveFileInfo:Sh}),jh={[Qa]:"phui-info-view phui-info-severity-plain",[Wa]:"phui-info-view phui-info-severity-success",[Ga]:"phui-info-view phui-info-severity-notice",[Ha]:"phui-info-view phui-info-severity-warning",[za]:"phui-info-view phui-info-severity-error"},Fh={codeViewResolvers:[Dh,Lh,Mh],type:"phabricator",name:"Phabricator",check:()=>!!document.querySelector(".phabricator-wordmark"),codeViewToolbarClassProps:{actionItemClass:i()("button grey",Ch),actionItemIconClass:Th},notificationClassNames:jh,hoverOverlayClassProps:{className:i()("aphront-dialog-view",Oh),actionItemClassName:i()("button grey",kh),iconClassName:Nh,getAlertClassName:mu(jh)},codeViewsRequireTokenization:!0};var Bh={leading:!0,trailing:!1};var Uh=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new qh(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),qh=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.duration=n,a.scheduler=r,a.leading=o,a.trailing=i,a._hasTrailingValue=!1,a._trailingValue=null,a}return w(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Vh,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(D);function Vh(e){e.subscriber.clearThrottle()}function $h({setElementTooltip:e,linkPreviewContentClass:t},n,r){const o="sg-link-preview-content";let i;if(n.nextSibling instanceof HTMLElement&&n.nextSibling.classList.contains(o)&&(i=n.nextSibling),null!=r&&r.content&&r.content.length>0){i?i.innerHTML="":(i=document.createElement("span"),i.classList.add(o),t&&i.classList.add(...t.split(" ")),n.after(i));for(const e of r.content.map((({kind:e,value:t})=>void 0===e||"markdown"===e?{html:Us(t).replace(/^<p>/,"").replace(/<\/p>\s*$/,"")}:t)))if("string"==typeof e)i.append(e);else{const t=document.createElement("span");for(t.innerHTML=e.html;t.hasChildNodes();)i.append(t.childNodes[0])}}else i&&(i.remove(),i=void 0);e&&(e(n,zh(r)),i&&e(i,zh(r)))}function zh(e){if(!e)return null;const t=e.hover.map((({value:e})=>e)).filter((e=>!!e));return t.length>0?t.join(" "):null}function Hh(e,{extensionsController:t},{contentViewResolvers:n,linkPreviewContentClass:r,setElementTooltip:o}){const i=e.pipe(vf(n||[]),wt(Me)),a=new ye,s=new Map;return i.pipe(oe((e=>kt(z(e).pipe(tt((()=>{console.log("Content view added",{contentViewEvent:e}),s.set(e.element,new g),e.subscriptions.add((()=>{console.log("Content view removed",{contentViewEvent:e});const t=s.get(e.element);if(!t)throw new Error("No linkPreview subscriptions");t.unsubscribe()}))}))),pe(e.element,{childList:!0},a).pipe(wt(Me),H((()=>e.element.innerHTML)),Qe(),tt((()=>console.log("Content view updated",{contentViewEvent:e}))),ut(e),function(e,t,n){return void 0===t&&(t=je),void 0===n&&(n=Bh),function(r){return r.lift(new Uh(e,t,n.leading,n.trailing))}}(2e3,void 0,{leading:!0,trailing:!0}))))),tt((({element:e})=>{let n=s.get(e);if(!n)throw new Error("No linkPreview subscriptions");n.unsubscribe(),n=new g,s.set(e,n);for(const i of e.querySelectorAll("a[href]"))n.add(ee(t.extHostAPI).pipe(ze((e=>Xr(e.getLinkPreviews(i.href))))).subscribe((e=>{try{a.next(!0),$h({setElementTooltip:o,linkPreviewContentClass:r},i,e)}finally{a.next(!1)}})))}))).subscribe()}var Gh=n(32805),Qh=n(42797),Wh=n.n(Qh),Kh=n(88514),Zh=n.n(Kh),Yh=n(37310),Jh=n.n(Yh),Xh=n(46950),em=n.n(Xh),tm=n(51437),nm=n(51491),rm=n.n(nm);const om=jo((e=>ee(e).pipe(ze((e=>Xr(e.haveInitialExtensionsLoaded()))))),(()=>"haveInitialExtensionsLoaded")),im=({text:e,pattern:n,className:r})=>t.createElement("span",null,function(e,t){const n=[];let r,o=0;for(let a=0;a<t.length;a++){var i;const s=e.indexOf(t.charAt(a),o);if(-1===s)break;null!==(i=r)&&void 0!==i&&i.match&&s===o?r.end=s+1:(r&&!r.match||s>o)&&(n.push({start:o,end:s,match:!1}),r=void 0),r||(r={start:s,end:s+1,match:!0},n.push(r)),o=s+1}e&&o<e.length&&n.push({start:o,end:e.length,match:!1});return n}(e.toLowerCase(),n.toLowerCase()).map(((n,o)=>n.match?t.createElement("strong",{key:o,className:r},e.slice(n.start,n.end)):e.slice(n.start,n.end))));const am="EmptyCommandListContainer-module__empty-command-list_NA_s5";function sm(){return(sm=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 cm=({className:e,children:n,...r})=>t.createElement("div",sm({className:i()(am,e)},r),n),lm="EmptyCommandList-module__title_Sbph5",um="EmptyCommandList-module__text_s1AXs",fm="EmptyCommandList-module__illustration_3pj62",pm=({settingsCascade:e,sourcegraphURL:n})=>{const r=!!e&&function(e){const t=$a(e,"User"),n=$a(e,"DefaultSettings");if(t&&n)for(const e of Object.keys(t))if(!(e in n))return!1;return!0}(e);return t.createElement(cm,null,t.createElement("p",{className:lm},r?"You don't have any extensions enabled":"You don't have any active actions"),t.createElement("p",{className:um},r?"Enable Sourcegraph extensions to get additional functionality, integrations, and make special actions available from this menu.":"Commands from your installed extensions will be shown when you navigate to certain pages."),t.createElement(Or,{to:n+"/extensions",variant:"primary"},"Explore extensions"),t.createElement(dm,{className:fm}))},dm=t.memo((({className:e})=>t.createElement("svg",{width:"59",height:"64",viewBox:"0 0 59 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e},t.createElement("path",{d:"M51.5825 43.9313C55.4271 45.582 57.2515 40.6516 57.8679 40.6516C58.4844 40.6516 58.9775 41.1397 58.9775 41.7497V60.3841C58.9775 62.3806 57.3411 64 55.3237 64H37.9287C37.7942 63.9778 37.6934 63.9556 37.6373 63.9335C35.9449 63.1459 40.2322 61.0779 40.1928 58.8201C40.1396 55.7739 38.0632 54.658 33.5688 54.658C29.0744 54.658 26.6802 55.4072 27.9131 59.6776C28.3325 61.1303 31.0022 63.1903 29.1192 63.9335C29.052 63.9556 28.8838 63.9778 28.6597 64H11.7803C9.78528 64 8.17132 62.4139 8.1377 60.4395V43.225C8.16011 43.0697 8.18253 42.9588 8.21615 42.9033C9.01192 41.2284 11.7803 44.8776 13.3831 45.4322C17.6197 46.8853 21.5201 43.1362 21.5201 38.6884C21.5201 34.2406 18.9535 27.9515 14.7168 29.4156C13.1141 29.9702 9.00072 34.8363 8.24978 32.9729C8.21615 32.9063 8.19374 32.7178 8.17132 32.4626L8.1377 16.9373C8.1377 16.9373 8.18253 16.3605 8.23857 16.0832C8.5636 13.9979 10.7492 13.1328 12.6209 13.1328L14.7168 13.1771C14.7168 13.1771 19.8725 13.2991 24.0644 13.3102H25.8016C27.6509 13.3102 29.0632 13.2659 29.3097 13.166C31.1927 12.4229 27.3147 9.63882 26.7543 8.05269C25.286 3.85997 29.0856 0 33.5688 0C38.052 0 41.8516 3.85997 40.3945 8.04159C39.8341 9.62773 36.1467 12.3785 37.8391 13.1549C37.996 13.2326 38.4219 13.277 39.0496 13.3102H46.7047C49.7533 13.2437 52.4096 13.1549 52.4096 13.1549L54.5055 13.1106C55.2228 13.1106 55.9962 13.2659 56.7023 13.5653C56.7247 13.5764 56.7583 13.5875 56.7919 13.5986C56.8592 13.6319 56.9152 13.6652 56.9825 13.6984C57.1394 13.7872 57.3075 13.8759 57.4532 13.9757C57.5877 14.0756 57.7222 14.1865 57.8455 14.2974C57.8791 14.3307 57.9127 14.3529 57.9464 14.3861C58.4283 14.852 58.787 15.451 58.9215 16.1941C58.9775 16.427 58.9999 16.6711 58.9999 16.9262V29.4156C58.9887 30.0257 58.4218 32.5682 57.9403 32.9484C55.2912 35.0404 54.2316 27.1052 50.5229 30.8565C47.5946 33.8183 47.7379 42.2805 51.5825 43.9313Z",fill:"url(#paint0_linear)",fillOpacity:"0.32"}),t.createElement("rect",{y:"24.6855",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{y:"46.627",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{y:"52.1133",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{y:"19.1992",width:"11.0972",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"11.0977",y:"30.1699",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"11.0977",y:"41.1426",width:"12.9467",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"11.0977",y:"35.6562",width:"15.7211",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"13.8711",y:"24.6855",width:"9.24768",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"13.8711",y:"46.627",width:"9.24768",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"13.8711",y:"52.1133",width:"5.54861",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"12.0225",y:"19.1992",width:"5.54861",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"24.9688",y:"30.1699",width:"4.62384",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"24.9688",y:"41.1426",width:"9.24767",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"30.5176",y:"30.1699",width:"7.39814",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"35.1416",y:"41.1426",width:"4.62384",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("rect",{x:"27.7432",y:"35.6562",width:"7.39814",height:"2.74286",rx:"1.37143",fill:"#ABC7EB",fillOpacity:"0.5"}),t.createElement("defs",null,t.createElement("linearGradient",{id:"paint0_linear",x1:"33.5688",y1:"0",x2:"33.5688",y2:"64",gradientUnits:"userSpaceOnUse"},t.createElement("stop",{stopColor:"#95A5C6",stopOpacity:"0.6"}),t.createElement("stop",{offset:"1",stopColor:"#95A5C6"})))))),hm="CommandList-module__command-list_10tyf",mm="CommandList-module__popover-button_1ug-b";function gm(){return(gm=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 vm=jo((e=>ee(e).pipe(ze((e=>Xr(e.getContributions()))))),(()=>"getContributions"));class bm extends t.PureComponent{static RECENT_ACTIONS_STORAGE_KEY="commandList.recentActions";static readRecentActions(){const e=localStorage.getItem(bm.RECENT_ACTIONS_STORAGE_KEY);if(null===e)return null;try{const t=JSON.parse(e);return Array.isArray(t)&&t.every((e=>"string"==typeof e))?t:null}catch(e){console.error("Error reading recent actions:",e)}return bm.writeRecentActions(null),null}static writeRecentActions(e){try{if(null===e)localStorage.removeItem(bm.RECENT_ACTIONS_STORAGE_KEY);else{const t=JSON.stringify(e);localStorage.setItem(bm.RECENT_ACTIONS_STORAGE_KEY,t)}}catch(e){console.error("Error writing recent actions:",e)}}state={input:"",selectedIndex:0,recentActions:bm.readRecentActions()};subscriptions=new g;selectedItem=null;setSelectedItem=e=>{this.selectedItem=e};componentDidMount(){this.subscriptions.add(om(this.props.extensionsController.extHostAPI).pipe(qe((e=>e)),ze((()=>vm(this.props.extensionsController.extHostAPI)))).subscribe((e=>{this.setState({contributions:e})}))),this.subscriptions.add(this.props.platformContext.settings.subscribe((e=>this.setState({settingsCascade:e})))),setTimeout((()=>{this.setState({autoFocus:!0})}))}componentDidUpdate(e,t){this.state.recentActions!==t.recentActions&&bm.writeRecentActions(this.state.recentActions)}componentWillUnmount(){this.subscriptions.unsubscribe()}render(){if(!this.state.contributions)return t.createElement(cm,{className:hm},t.createElement("div",{className:"d-flex py-5 align-items-center justify-content-center"},t.createElement(Pr,{inline:!1}),t.createElement("span",{className:"mx-2"},"Loading Sourcegraph extensions"),t.createElement(Nr,{as:em()})));const e=Vo(this.state.contributions,this.props.menu),n=this.state.input.trim(),r=function(e,t,n){if(!t)return null===n?e:Uo()(e,(e=>{const t=n.indexOf(e.action.id);return-1===t?null:t}),(({action:e})=>e.id));const r=new Array(e.length),o=new Array(e.length),i=e.filter(((e,n)=>{let i=r[n];return void 0===i&&(i=`${e.action.category?`${e.action.category}: `:""}${e.action.title||e.action.command||""}`,r[n]=i),void 0===o[n]&&(o[n]=rm()(i,t,0)),o[n]>0})).map(((e,t)=>{const r=null==n?void 0:n.indexOf(e.action.id);return{item:e,score:o[t],recentIndex:-1===r?null:r}}));return Uo()(i,"recentIndex","score",(({item:e})=>e.action.id)).map((({item:e})=>e))}(e,this.state.input,this.state.recentActions),o=(this.state.selectedIndex%r.length+r.length)%r.length;return t.createElement("div",{className:hm},t.createElement("header",null,t.createElement("form",{className:this.props.formClassName,onSubmit:this.onSubmit},t.createElement("label",{className:"sr-only",htmlFor:"command-list-input"},"Command"),t.createElement("input",{id:"command-list-input",ref:e=>e&&this.state.autoFocus&&e.focus({preventScroll:!0}),type:"text",className:this.props.inputClassName,value:this.state.input,placeholder:"Run Sourcegraph action...",spellCheck:!1,autoCorrect:"off",autoComplete:"off",onChange:this.onInputChange,onKeyDown:this.onInputKeyDown}))),t.createElement("div",{className:this.props.resultsContainerClassName},t.createElement("ul",{className:this.props.listClassName},r.length>0?r.map(((e,r)=>t.createElement("li",{className:i()(this.props.listItemClassName,r===o&&this.props.selectedListItemClassName),key:e.action.id},t.createElement(yo,gm({},this.props,{className:i()(this.props.actionItemClassName,r===o&&this.props.selectedActionItemClassName)},e,{ref:r===o?this.setSelectedItem:void 0,title:t.createElement(im,{text:[e.action.category,e.action.title||e.action.command].filter(Boolean).join(": "),pattern:n}),onDidExecute:this.onActionDidExecute}))))):n.length>0?t.createElement("li",{className:this.props.noResultsClassName},"No matching commands"):t.createElement(pm,{settingsCascade:this.state.settingsCascade,sourcegraphURL:this.props.platformContext.sourcegraphURL}))))}onInputChange=e=>{this.setState({input:e.currentTarget.value,selectedIndex:0})};onInputKeyDown=e=>{switch(e.key){case br.s.ArrowDown:e.preventDefault(),this.setSelectedIndex(1);break;case br.s.ArrowUp:e.preventDefault(),this.setSelectedIndex(-1);break;case br.s.Enter:this.selectedItem&&this.selectedItem.runAction(e)}};onSubmit=e=>e.preventDefault();setSelectedIndex(e){this.setState((t=>({selectedIndex:t.selectedIndex+e})))}onActionDidExecute=e=>{this.setState((t=>{const{recentActions:n}=t;return n?{recentActions:zo()([e,...n]).slice(0,10)}:{recentActions:[e]}})),this.props.onSelect&&this.props.onSelect()}}const ym=({buttonClassName:e,buttonElement:n="span",buttonOpenClassName:r,showCaret:o=!0,popoverClassName:a,popoverInnerClassName:s,keyboardShortcutForShow:c,variant:l,...u})=>{const[f,p]=(0,t.useState)(!1),d=(0,t.useCallback)((()=>p(!1)),[]),h=(0,t.useCallback)((()=>p(!f)),[f]),m=(0,t.useMemo)((()=>Ra()("command-list-popover-button-")),[]),g=()=>f?t.createElement(Nr,{as:Zh()}):t.createElement(Nr,{as:Wh()});return t.createElement(xr,{as:n,role:"button",id:m,onClick:h,className:i()(mm,e,f&&r),variant:l,"aria-label":"Command list"},t.createElement(Nr,{as:Jh(),size:"md"}),o&&t.createElement(g,null),t.createElement(tm.ZP,{isOpen:f,toggle:h,popperClassName:a,innerClassName:i()("popover-inner",s),placement:"bottom-end",target:m,trigger:"legacy",delay:0,fade:!1,hideArrow:!0},t.createElement(bm,gm({},u,{onSelect:d}))),null==c?void 0:c.keybindings.map(((e,n)=>t.createElement(Gh.z9,gm({key:n},e,{onMatch:h})))))};var wm=n(7263),Em=n.n(wm);function _m(e,t,n){var r;return r=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n},function(e){return e.lift(function(e){var t,n,r=e.bufferSize,o=void 0===r?Number.POSITIVE_INFINITY:r,i=e.windowTime,a=void 0===i?Number.POSITIVE_INFINITY:i,s=e.refCount,c=e.scheduler,l=0,u=!1,f=!1;return function(e){var r;l++,!t||u?(u=!1,t=new Ro(o,a,c),r=t.subscribe(this),n=e.subscribe({next:function(e){t.next(e)},error:function(e){u=!0,t.error(e)},complete:function(){f=!0,n=void 0,t.complete()}})):r=t.subscribe(this),this.add((function(){l--,r.unsubscribe(),n&&!f&&s&&0===l&&(n.unsubscribe(),n=void 0,t=void 0)}))}}(r))}}function xm(e){return(xm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var Sm="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function Om(e,t){for(var n,r=/\r\n|[\n\r]/g,o=1,i=t+1;(n=r.exec(e.body))&&n.index<t;)o+=1,i=t+1-(n.index+n[0].length);return{line:o,column:i}}function Tm(e){return Cm(e.source,Om(e.source,e.start))}function Cm(e,t){var n=e.locationOffset.column-1,r=Nm(n)+e.body,o=t.line-1,i=e.locationOffset.line-1,a=t.line+i,s=1===t.line?n:0,c=t.column+s,l="".concat(e.name,":").concat(a,":").concat(c,"\n"),u=r.split(/\r\n|[\n\r]/g),f=u[o];if(f.length>120){for(var p=Math.floor(c/80),d=c%80,h=[],m=0;m<f.length;m+=80)h.push(f.slice(m,m+80));return l+km([["".concat(a),h[0]]].concat(h.slice(1,p+1).map((function(e){return["",e]})),[[" ",Nm(d-1)+"^"],["",h[p+1]]]))}return l+km([["".concat(a-1),u[o-1]],["".concat(a),f],["",Nm(c-1)+"^"],["".concat(a+1),u[o+1]]])}function km(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),n=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,r=e[0],o=e[1];return Nm(n-(t=r).length)+t+(o?" | "+o:" |")})).join("\n")}function Nm(e){return Array(e+1).join(" ")}function Am(e){return(Am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Im(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pm(e,t){return!t||"object"!==Am(t)&&"function"!=typeof t?Rm(e):t}function Rm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dm(e){var t="function"==typeof Map?new Map:void 0;return(Dm=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Lm(e,arguments,Fm(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),jm(r,e)})(e)}function Lm(e,t,n){return(Lm=Mm()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&jm(o,n.prototype),o}).apply(null,arguments)}function Mm(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function jm(e,t){return(jm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fm(e){return(Fm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Bm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jm(e,t)}(s,e);var t,n,r,o,i,a=(t=s,n=Mm(),function(){var e,r=Fm(t);if(n){var o=Fm(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Pm(this,e)});function s(e,t,n,r,o,i,c){var l,u,f,p,d;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),d=a.call(this,e);var h,m=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,g=n;!g&&m&&(g=null===(h=m[0].loc)||void 0===h?void 0:h.source);var v,b=r;!b&&m&&(b=m.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),b&&0===b.length&&(b=void 0),r&&n?v=r.map((function(e){return Om(n,e)})):m&&(v=m.reduce((function(e,t){return t.loc&&e.push(Om(t.loc.source,t.loc.start)),e}),[]));var y,w=c;if(null==w&&null!=i){var E=i.extensions;"object"==xm(y=E)&&null!==y&&(w=E)}return Object.defineProperties(Rm(d),{name:{value:"GraphQLError"},message:{value:e,enumerable:!0,writable:!0},locations:{value:null!==(l=v)&&void 0!==l?l:void 0,enumerable:null!=v},path:{value:null!=o?o:void 0,enumerable:null!=o},nodes:{value:null!=m?m:void 0},source:{value:null!==(u=g)&&void 0!==u?u:void 0},positions:{value:null!==(f=b)&&void 0!==f?f:void 0},originalError:{value:i},extensions:{value:null!==(p=w)&&void 0!==p?p:void 0,enumerable:null!=w}}),(null==i?void 0:i.stack)?(Object.defineProperty(Rm(d),"stack",{value:i.stack,writable:!0,configurable:!0}),Pm(d)):(Error.captureStackTrace?Error.captureStackTrace(Rm(d),s):Object.defineProperty(Rm(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return r=s,(o=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n<r.length;n++){var o=r[n];o.loc&&(t+="\n\n"+Tm(o.loc))}else if(e.source&&e.locations)for(var i=0,a=e.locations;i<a.length;i++){var s=a[i];t+="\n\n"+Cm(e.source,s)}return t}(this)}},{key:Sm,get:function(){return"Object"}}])&&Im(r.prototype,o),i&&Im(r,i),s}(Dm(Error));function Um(e,t,n){return new Bm("Syntax Error: ".concat(n),void 0,e,[t])}var qm=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});const Vm="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function $m(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,Vm&&(e.prototype[Vm]=t)}var zm=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();$m(zm);var Hm=function(){function e(e,t,n,r,o,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=o,this.value=a,this.prev=i,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function Gm(e){return null!=e&&"string"==typeof e.kind}$m(Hm);var Qm=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Wm(e){return(Wm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Km(e){return Zm(e,[])}function Zm(e,t){switch(Wm(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=function(e){var t=e[String(Vm)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==r){var o=r.call(e);if(o!==e)return"string"==typeof o?o:Zm(o,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,o=[],i=0;i<n;++i)o.push(Zm(e[i],t));1===r?o.push("... 1 more item"):r>1&&o.push("... ".concat(r," more items"));return"["+o.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]";return"{ "+n.map((function(n){return n+": "+Zm(e[n],t)})).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function Ym(e,t){if(!Boolean(e))throw new Error(t)}const Jm=function(e,t){return e instanceof t};function Xm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var eg=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||Ym(0,"Body must be a string. Received: ".concat(Km(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ym(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ym(0,"column in locationOffset is 1-indexed and must be positive.")}var t,n,r;return t=e,(n=[{key:Sm,get:function(){return"Source"}}])&&Xm(t.prototype,n),r&&Xm(t,r),e}();var tg=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function ng(e){var t=e.split(/\r\n|[\n\r]/g),n=function(e){for(var t,n=!0,r=!0,o=0,i=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:n=!1,r=!0,o=0;break;case 9:case 32:++o;break;default:r&&!n&&(null===i||o<i)&&(i=o),r=!1}return null!==(t=i)&&void 0!==t?t:0}(e);if(0!==n)for(var r=1;r<t.length;r++)t[r]=t[r].slice(n);for(var o=0;o<t.length&&rg(t[o]);)++o;for(var i=t.length;i>o&&rg(t[i-1]);)--i;return t.slice(o,i).join("\n")}function rg(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}var og=function(){function e(e){var t=new Hm(Qm.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==Qm.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=ag(this,e)}while(e.kind===Qm.COMMENT);return e},e}();function ig(e){return isNaN(e)?Qm.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function ag(e,t){for(var n=e.source,r=n.body,o=r.length,i=t.end;i<o;){var a=r.charCodeAt(i),s=e.line,c=1+i-e.lineStart;switch(a){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===r.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 33:return new Hm(Qm.BANG,i,i+1,s,c,t);case 35:return cg(n,i,s,c,t);case 36:return new Hm(Qm.DOLLAR,i,i+1,s,c,t);case 38:return new Hm(Qm.AMP,i,i+1,s,c,t);case 40:return new Hm(Qm.PAREN_L,i,i+1,s,c,t);case 41:return new Hm(Qm.PAREN_R,i,i+1,s,c,t);case 46:if(46===r.charCodeAt(i+1)&&46===r.charCodeAt(i+2))return new Hm(Qm.SPREAD,i,i+3,s,c,t);break;case 58:return new Hm(Qm.COLON,i,i+1,s,c,t);case 61:return new Hm(Qm.EQUALS,i,i+1,s,c,t);case 64:return new Hm(Qm.AT,i,i+1,s,c,t);case 91:return new Hm(Qm.BRACKET_L,i,i+1,s,c,t);case 93:return new Hm(Qm.BRACKET_R,i,i+1,s,c,t);case 123:return new Hm(Qm.BRACE_L,i,i+1,s,c,t);case 124:return new Hm(Qm.PIPE,i,i+1,s,c,t);case 125:return new Hm(Qm.BRACE_R,i,i+1,s,c,t);case 34:return 34===r.charCodeAt(i+1)&&34===r.charCodeAt(i+2)?pg(n,i,s,c,t,e):fg(n,i,s,c,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return lg(n,i,a,s,c,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return hg(n,i,s,c,t)}throw Um(n,i,sg(a))}var l=e.line,u=1+i-e.lineStart;return new Hm(Qm.EOF,o,o,l,u,t)}function sg(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(ig(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(ig(e),".")}function cg(e,t,n,r,o){var i,a=e.body,s=t;do{i=a.charCodeAt(++s)}while(!isNaN(i)&&(i>31||9===i));return new Hm(Qm.COMMENT,t,s,n,r,o,a.slice(t+1,s))}function lg(e,t,n,r,o,i){var a=e.body,s=n,c=t,l=!1;if(45===s&&(s=a.charCodeAt(++c)),48===s){if((s=a.charCodeAt(++c))>=48&&s<=57)throw Um(e,c,"Invalid number, unexpected digit after 0: ".concat(ig(s),"."))}else c=ug(e,c,s),s=a.charCodeAt(c);if(46===s&&(l=!0,s=a.charCodeAt(++c),c=ug(e,c,s),s=a.charCodeAt(c)),69!==s&&101!==s||(l=!0,43!==(s=a.charCodeAt(++c))&&45!==s||(s=a.charCodeAt(++c)),c=ug(e,c,s),s=a.charCodeAt(c)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw Um(e,c,"Invalid number, expected digit but got: ".concat(ig(s),"."));return new Hm(l?Qm.FLOAT:Qm.INT,t,c,r,o,i,a.slice(t,c))}function ug(e,t,n){var r=e.body,o=t,i=n;if(i>=48&&i<=57){do{i=r.charCodeAt(++o)}while(i>=48&&i<=57);return o}throw Um(e,o,"Invalid number, expected digit but got: ".concat(ig(i),"."))}function fg(e,t,n,r,o){for(var i,a,s,c,l=e.body,u=t+1,f=u,p=0,d="";u<l.length&&!isNaN(p=l.charCodeAt(u))&&10!==p&&13!==p;){if(34===p)return d+=l.slice(f,u),new Hm(Qm.STRING,t,u+1,n,r,o,d);if(p<32&&9!==p)throw Um(e,u,"Invalid character within String: ".concat(ig(p),"."));if(++u,92===p){switch(d+=l.slice(f,u-1),p=l.charCodeAt(u)){case 34:d+='"';break;case 47:d+="/";break;case 92:d+="\\";break;case 98:d+="\b";break;case 102:d+="\f";break;case 110:d+="\n";break;case 114:d+="\r";break;case 116:d+="\t";break;case 117:var h=(i=l.charCodeAt(u+1),a=l.charCodeAt(u+2),s=l.charCodeAt(u+3),c=l.charCodeAt(u+4),dg(i)<<12|dg(a)<<8|dg(s)<<4|dg(c));if(h<0){var m=l.slice(u+1,u+5);throw Um(e,u,"Invalid character escape sequence: \\u".concat(m,"."))}d+=String.fromCharCode(h),u+=4;break;default:throw Um(e,u,"Invalid character escape sequence: \\".concat(String.fromCharCode(p),"."))}f=++u}}throw Um(e,u,"Unterminated string.")}function pg(e,t,n,r,o,i){for(var a=e.body,s=t+3,c=s,l=0,u="";s<a.length&&!isNaN(l=a.charCodeAt(s));){if(34===l&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2))return u+=a.slice(c,s),new Hm(Qm.BLOCK_STRING,t,s+3,n,r,o,ng(u));if(l<32&&9!==l&&10!==l&&13!==l)throw Um(e,s,"Invalid character within String: ".concat(ig(l),"."));10===l?(++s,++i.line,i.lineStart=s):13===l?(10===a.charCodeAt(s+1)?s+=2:++s,++i.line,i.lineStart=s):92===l&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2)&&34===a.charCodeAt(s+3)?(u+=a.slice(c,s)+'"""',c=s+=4):++s}throw Um(e,s,"Unterminated string.")}function dg(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function hg(e,t,n,r,o){for(var i=e.body,a=i.length,s=t+1,c=0;s!==a&&!isNaN(c=i.charCodeAt(s))&&(95===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++s;return new Hm(Qm.NAME,t,s,n,r,o,i.slice(t,s))}var mg=function(){function e(e,t){var n=function(e){return Jm(e,eg)}(e)?e:new eg(e);this._lexer=new og(n),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(Qm.NAME);return{kind:qm.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:qm.DOCUMENT,definitions:this.many(Qm.SOF,this.parseDefinition,Qm.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(Qm.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(Qm.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(Qm.BRACE_L))return{kind:qm.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(Qm.NAME)&&(t=this.parseName()),{kind:qm.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(Qm.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(Qm.PAREN_L,this.parseVariableDefinition,Qm.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:qm.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Qm.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Qm.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(Qm.DOLLAR),{kind:qm.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:qm.SELECTION_SET,selections:this.many(Qm.BRACE_L,this.parseSelection,Qm.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(Qm.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(Qm.COLON)?(e=r,t=this.parseName()):t=r,{kind:qm.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Qm.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Qm.PAREN_L,t,Qm.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(Qm.COLON),{kind:qm.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:qm.ARGUMENT,name:this.parseName(),value:(this.expectToken(Qm.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(Qm.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(Qm.NAME)?{kind:qm.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:qm.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:qm.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:qm.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case Qm.BRACKET_L:return this.parseList(e);case Qm.BRACE_L:return this.parseObject(e);case Qm.INT:return this._lexer.advance(),{kind:qm.INT,value:t.value,loc:this.loc(t)};case Qm.FLOAT:return this._lexer.advance(),{kind:qm.FLOAT,value:t.value,loc:this.loc(t)};case Qm.STRING:case Qm.BLOCK_STRING:return this.parseStringLiteral();case Qm.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:qm.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:qm.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:qm.NULL,loc:this.loc(t)};default:return{kind:qm.ENUM,value:t.value,loc:this.loc(t)}}case Qm.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:qm.STRING,value:e.value,block:e.kind===Qm.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:qm.LIST,values:this.any(Qm.BRACKET_L,(function(){return t.parseValueLiteral(e)}),Qm.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:qm.OBJECT,fields:this.any(Qm.BRACE_L,(function(){return t.parseObjectField(e)}),Qm.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(Qm.COLON),{kind:qm.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(Qm.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(Qm.AT),{kind:qm.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(Qm.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(Qm.BRACKET_R),e={kind:qm.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(Qm.BANG)?{kind:qm.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:qm.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===Qm.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(Qm.STRING)||this.peek(Qm.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(Qm.BRACE_L,this.parseOperationTypeDefinition,Qm.BRACE_R);return{kind:qm.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(Qm.COLON);var n=this.parseNamedType();return{kind:qm.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:qm.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),i=this.parseFieldsDefinition();return{kind:qm.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:o,fields:i,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(Qm.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(Qm.AMP)||this.peek(Qm.NAME));return t}return this.delimitedMany(Qm.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(Qm.BRACE_L)&&this._lexer.lookahead().kind===Qm.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(Qm.BRACE_L,this.parseFieldDefinition,Qm.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Qm.COLON);var o=this.parseTypeReference(),i=this.parseDirectives(!0);return{kind:qm.FIELD_DEFINITION,description:t,name:n,arguments:r,type:o,directives:i,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(Qm.PAREN_L,this.parseInputValueDef,Qm.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Qm.COLON);var r,o=this.parseTypeReference();this.expectOptionalToken(Qm.EQUALS)&&(r=this.parseValueLiteral(!0));var i=this.parseDirectives(!0);return{kind:qm.INPUT_VALUE_DEFINITION,description:t,name:n,type:o,defaultValue:r,directives:i,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),i=this.parseFieldsDefinition();return{kind:qm.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:o,fields:i,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseUnionMemberTypes();return{kind:qm.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:o,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(Qm.EQUALS)?this.delimitedMany(Qm.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();return{kind:qm.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:o,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(Qm.BRACE_L,this.parseEnumValueDefinition,Qm.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:qm.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();return{kind:qm.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:o,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(Qm.BRACE_L,this.parseInputValueDef,Qm.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===Qm.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(Qm.BRACE_L,this.parseOperationTypeDefinition,Qm.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:qm.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:qm.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===o.length)throw this.unexpected();return{kind:qm.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:o,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===o.length)throw this.unexpected();return{kind:qm.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:o,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:qm.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:qm.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:qm.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Qm.AT);var n=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var i=this.parseDirectiveLocations();return{kind:qm.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:o,locations:i,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(Qm.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==tg[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new zm(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw Um(this._lexer.source,t.start,"Expected ".concat(vg(e),", found ").concat(gg(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==Qm.NAME||t.value!==e)throw Um(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(gg(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===Qm.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return Um(this._lexer.source,t.start,"Unexpected ".concat(gg(t),"."))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n},e}();function gg(e){var t=e.value;return vg(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function vg(e){return function(e){return e===Qm.BANG||e===Qm.DOLLAR||e===Qm.AMP||e===Qm.PAREN_L||e===Qm.PAREN_R||e===Qm.SPREAD||e===Qm.COLON||e===Qm.EQUALS||e===Qm.AT||e===Qm.BRACKET_L||e===Qm.BRACKET_R||e===Qm.BRACE_L||e===Qm.PIPE||e===Qm.BRACE_R}(e)?'"'.concat(e,'"'):e}var bg=new Map,yg=new Map,wg=!0,Eg=!1;function _g(e){return e.replace(/[\s,]+/g," ").trim()}function xg(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,o=_g((a=e.loc).source.body.substring(a.start,a.end)),i=yg.get(r);i&&!i.has(o)?wg&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):i||yg.set(r,i=new Set),i.add(o),t.has(o)||(t.add(o),n.push(e))}else n.push(e);var a})),E(E({},e),{definitions:n})}function Sg(e){var t=_g(e);if(!bg.has(t)){var n=function(e,t){return new mg(e,t).parseDocument()}(e,{experimentalFragmentVariables:Eg});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");bg.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(xg(n)))}return bg.get(t)}function Og(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach((function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]})),Sg(r)}var Tg,Cg=Og,kg=function(){bg.clear(),yg.clear()},Ng=function(){wg=!1},Ag=function(){Eg=!0},Ig=function(){Eg=!1};(Tg=Og||(Og={})).gql=Cg,Tg.resetCaches=kg,Tg.disableFragmentWarnings=Ng,Tg.enableExperimentalFragmentVariables=Ag,Tg.disableExperimentalFragmentVariables=Ig,Og.default=Og;const Pg=e=>"string"==typeof e?Og(e):e;function Rg(e){return new B((t=>{const n=e.then((e=>e.subscribe(t))).catch((()=>t.unsubscribe()));return function(){t.unsubscribe(),n.then((e=>null==e?void 0:e.unsubscribe())).catch((e=>console.log(e)))}}))}const Dg=fr`
133
133
  query Extensions($first: Int!, $extensionIDs: [String!]!, $extensionManifestFields: [String!]!) {
134
134
  extensionRegistry {
135
135
  extensions(first: $first, extensionIDs: $extensionIDs) {
@@ -177,7 +177,7 @@
177
177
  }
178
178
  }
179
179
  }
180
- `,variables:{subject:t,lastID:n,edit:r},mightContainPrivateInfo:!1})).pipe(H(pr),H((()=>{}))).toPromise()}({requestGraphQL:e},t,n,r)}class Aw extends B{constructor(e,t){super((e=>(e.next(this.value),Vc("local",this.key).subscribe(((n=t)=>{this.value=n,e.next(n)}))))),this.key=e,this.value=t}async next(e){await qc.local.set({[this.key]:e})}}var Iw={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Pw=Object.freeze({});function Rw(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Iw,r=void 0,o=Array.isArray(e),i=[e],a=-1,s=[],c=void 0,l=void 0,u=void 0,f=[],p=[],d=e;do{var h=++a===i.length,m=h&&0!==s.length;if(h){if(l=0===p.length?void 0:f[f.length-1],c=u,u=p.pop(),m){if(o)c=c.slice();else{for(var g={},v=0,b=Object.keys(c);v<b.length;v++){var y=b[v];g[y]=c[y]}c=g}for(var w=0,E=0;E<s.length;E++){var _=s[E][0],x=s[E][1];o&&(_-=w),o&&null===x?(c.splice(_,1),w++):c[_]=x}}a=r.index,i=r.keys,s=r.edits,o=r.inArray,r=r.prev}else{if(l=u?o?a:i[a]:void 0,null==(c=u?u[l]:d))continue;u&&f.push(l)}var S,O=void 0;if(!Array.isArray(c)){if(!Gm(c))throw new Error("Invalid AST Node: ".concat(Km(c),"."));var T=Dw(t,c.kind,h);if(T){if((O=T.call(t,c,l,u,f,p))===Pw)break;if(!1===O){if(!h){f.pop();continue}}else if(void 0!==O&&(s.push([l,O]),!h)){if(!Gm(O)){f.pop();continue}c=O}}}if(void 0===O&&m&&s.push([l,c]),h)f.pop();else r={inArray:o,index:a,keys:i,edits:s,prev:r},i=(o=Array.isArray(c))?c:null!==(S=n[c.kind])&&void 0!==S?S:[],a=-1,s=[],u&&p.push(u),u=c}while(void 0!==r);return 0!==s.length&&(d=s[s.length-1][1]),d}function Dw(e,t,n){var r=e[t];if(r){if(!n&&"function"==typeof r)return r;var o=n?r.leave:r.enter;if("function"==typeof o)return o}else{var i=n?e.leave:e.enter;if(i){if("function"==typeof i)return i;var a=i[t];if("function"==typeof a)return a}}}function Lw(e){return Rw(e,{leave:Mw})}var Mw={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return Fw(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=Uw("(",Fw(e.variableDefinitions,", "),")"),o=Fw(e.directives," "),i=e.selectionSet;return n||o||r||"query"!==t?Fw([t,Fw([n,r]),o,i]," "):i},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,o=e.directives;return t+": "+n+Uw(" = ",r)+Uw(" ",Fw(o," "))},SelectionSet:function(e){return Bw(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,o=e.directives,i=e.selectionSet,a=Uw("",t,": ")+n,s=a+Uw("(",Fw(r,", "),")");return s.length>80&&(s=a+Uw("(\n",qw(Fw(r,"\n")),"\n)")),Fw([s,Fw(o," "),i]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+Uw(" ",Fw(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return Fw(["...",Uw("on ",t),Fw(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,o=e.directives,i=e.selectionSet;return"fragment ".concat(t).concat(Uw("(",Fw(r,", "),")")," ")+"on ".concat(n," ").concat(Uw("",Fw(o," ")," "))+i},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),o=" "===e[0]||"\t"===e[0],i='"'===e[e.length-1],a="\\"===e[e.length-1],s=!r||i||a||n,c="";return!s||r&&o||(c+="\n"+t),c+=t?e.replace(/\n/g,"\n"+t):e,s&&(c+="\n"),'"""'+c.replace(/"""/g,'\\"""')+'"""'}(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+Fw(e.values,", ")+"]"},ObjectValue:function(e){return"{"+Fw(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+Uw("(",Fw(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:jw((function(e){var t=e.directives,n=e.operationTypes;return Fw(["schema",Fw(t," "),Bw(n)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:jw((function(e){return Fw(["scalar",e.name,Fw(e.directives," ")]," ")})),ObjectTypeDefinition:jw((function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Fw(["type",t,Uw("implements ",Fw(n," & ")),Fw(r," "),Bw(o)]," ")})),FieldDefinition:jw((function(e){var t=e.name,n=e.arguments,r=e.type,o=e.directives;return t+($w(n)?Uw("(\n",qw(Fw(n,"\n")),"\n)"):Uw("(",Fw(n,", "),")"))+": "+r+Uw(" ",Fw(o," "))})),InputValueDefinition:jw((function(e){var t=e.name,n=e.type,r=e.defaultValue,o=e.directives;return Fw([t+": "+n,Uw("= ",r),Fw(o," ")]," ")})),InterfaceTypeDefinition:jw((function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Fw(["interface",t,Uw("implements ",Fw(n," & ")),Fw(r," "),Bw(o)]," ")})),UnionTypeDefinition:jw((function(e){var t=e.name,n=e.directives,r=e.types;return Fw(["union",t,Fw(n," "),r&&0!==r.length?"= "+Fw(r," | "):""]," ")})),EnumTypeDefinition:jw((function(e){var t=e.name,n=e.directives,r=e.values;return Fw(["enum",t,Fw(n," "),Bw(r)]," ")})),EnumValueDefinition:jw((function(e){return Fw([e.name,Fw(e.directives," ")]," ")})),InputObjectTypeDefinition:jw((function(e){var t=e.name,n=e.directives,r=e.fields;return Fw(["input",t,Fw(n," "),Bw(r)]," ")})),DirectiveDefinition:jw((function(e){var t=e.name,n=e.arguments,r=e.repeatable,o=e.locations;return"directive @"+t+($w(n)?Uw("(\n",qw(Fw(n,"\n")),"\n)"):Uw("(",Fw(n,", "),")"))+(r?" repeatable":"")+" on "+Fw(o," | ")})),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return Fw(["extend schema",Fw(t," "),Bw(n)]," ")},ScalarTypeExtension:function(e){return Fw(["extend scalar",e.name,Fw(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Fw(["extend type",t,Uw("implements ",Fw(n," & ")),Fw(r," "),Bw(o)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Fw(["extend interface",t,Uw("implements ",Fw(n," & ")),Fw(r," "),Bw(o)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return Fw(["extend union",t,Fw(n," "),r&&0!==r.length?"= "+Fw(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return Fw(["extend enum",t,Fw(n," "),Bw(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return Fw(["extend input",t,Fw(n," "),Bw(r)]," ")}};function jw(e){return function(t){return Fw([t.description,e(t)],"\n")}}function Fw(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(n))&&void 0!==t?t:""}function Bw(e){return Uw("{\n",qw(Fw(e,"\n")),"\n}")}function Uw(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function qw(e){return Uw(" ",e.replace(/\n/g,"\n "))}function Vw(e){return-1!==e.indexOf("\n")}function $w(e){return null!=e&&e.some(Vw)}var zw="Invariant Violation",Hw=Object.setPrototypeOf,Gw=void 0===Hw?function(e,t){return e.__proto__=t,e}:Hw,Qw=function(e){function t(n){void 0===n&&(n=zw);var r=e.call(this,"number"==typeof n?zw+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=zw,Gw(r,t.prototype),r}return w(t,e),t}(Error);function Ww(e,t){if(!e)throw new Qw(t)}var Kw=["debug","log","warn","error","silent"],Zw=Kw.indexOf("log");function Yw(e){return function(){if(Kw.indexOf(e)>=Zw){var t=console[e]||console.log;return t.apply(console,arguments)}}}!function(e){e.debug=Yw("debug"),e.log=Yw("log"),e.warn=Yw("warn"),e.error=Yw("error")}(Ww||(Ww={}));function Jw(e){try{return e()}catch(e){}}const Xw=Jw((function(){return globalThis}))||Jw((function(){return window}))||Jw((function(){return self}))||Jw((function(){return global}))||Jw((function(){return Jw.constructor("return this")()}));var eE="__",tE=[eE,eE].join("DEV");const nE=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(Xw,tE,{value:"production"!==Jw((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),Xw[tE]}}();var rE=n(6591);function oE(e){try{return e()}catch(e){}}var iE=oE((function(){return globalThis}))||oE((function(){return window}))||oE((function(){return self}))||oE((function(){return n.g}))||oE((function(){return oE.constructor("return this")()})),aE=!1;function sE(){aE&&(delete iE.process,aE=!1)}function cE(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return lE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lE(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function lE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fE(e,t,n){return t&&uE(e.prototype,t),n&&uE(e,n),e}!iE||oE((function(){return"production"}))||oE((function(){return rE}))||(Object.defineProperty(iE,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),aE=!0),sE(),__DEV__?Ww("boolean"==typeof nE,nE):Ww("boolean"==typeof nE,36);var pE=function(){return"function"==typeof Symbol},dE=function(e){return pE()&&Boolean(Symbol[e])},hE=function(e){return dE(e)?Symbol[e]:"@@"+e};pE()&&!dE("observable")&&(Symbol.observable=Symbol("observable"));var mE=hE("iterator"),gE=hE("observable"),vE=hE("species");function bE(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function yE(e){var t=e.constructor;return void 0!==t&&null===(t=t[vE])&&(t=void 0),void 0!==t?t:kE}function wE(e){wE.log?wE.log(e):setTimeout((function(){throw e}))}function EE(e){Promise.resolve().then((function(){try{e()}catch(e){wE(e)}}))}function _E(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=bE(t,"unsubscribe");n&&n.call(t)}}catch(e){wE(e)}}function xE(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function SE(e,t,n){e._state="running";var r=e._observer;try{var o=bE(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(xE(e),!o)throw n;o.call(r,n);break;case"complete":xE(e),o&&o.call(r)}}catch(e){wE(e)}"closed"===e._state?_E(e):"running"===e._state&&(e._state="ready")}function OE(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void EE((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(SE(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void SE(e,t,n);e._queue.push({type:t,value:n})}}var TE=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new CE(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(xE(this),_E(this))},fE(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),CE=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){OE(this._subscription,"next",e)},t.error=function(e){OE(this._subscription,"error",e)},t.complete=function(){OE(this._subscription,"complete")},fE(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),kE=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new TE(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function i(){o.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(yE(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(yE(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=yE(this),r=arguments.length>1,o=!1,i=arguments[1],a=i;return new n((function(n){return t.subscribe({next:function(t){var i=!o;if(o=!0,!i||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=yE(this);return new o((function(t){var r,i=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){i===n.length?(r=void 0,t.complete()):e(o.from(n[i++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=yE(this);return new n((function(r){var o=[],i=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var i=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=o.indexOf(i);e>=0&&o.splice(e,1),a()}});o.push(i)},error:function(e){r.error(e)},complete:function(){a()}});function a(){i.closed&&0===o.length&&r.complete()}return function(){o.forEach((function(e){return e.unsubscribe()})),i.unsubscribe()}}))},t[gE]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=bE(t,gE);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return function(e){return e instanceof kE}(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(dE("iterator")&&(r=bE(t,mE)))return new n((function(e){EE((function(){if(!e.closed){for(var n,o=cE(r.call(t));!(n=o()).done;){var i=n.value;if(e.next(i),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){EE((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o((function(e){EE((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},fE(e,null,[{key:vE,get:function(){return this}}]),e}();function NE(e){return null!==e&&"object"==typeof e}function AE(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw __DEV__?new Qw("Found a ".concat(e.operation," operation").concat(e.name?" named '".concat(e.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new Qw(41);"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(__DEV__?Ww(1===r.length,"Found ".concat(r.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):Ww(1===r.length,42),n=r[0].name.value),E(E({},e),{definitions:k([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions)})}function IE(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function PE(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=t&&t[e.name.value];return __DEV__?Ww(n,"No fragment named ".concat(e.name.value,".")):Ww(n,43),n;default:return null}}function RE(e){return{__ref:String(e)}}function DE(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function LE(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var o={};n.fields.map((function(e){return LE(o,e.name,e.value,r)})),e[t.value]=o}else if(function(e){return"Variable"===e.kind}(n)){var i=(r||{})[n.name.value];e[t.value]=i}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return LE(n,t,e,r),n[t.value]}));else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw __DEV__?new Qw('The inline argument "'.concat(t.value,'" of kind "').concat(n.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new Qw(52);e[t.value]=null}}pE()&&Object.defineProperty(kE,Symbol("extensions"),{value:{symbol:gE,hostReportError:wE},configurable:!0});var ME=["connection","include","skip","client","rest","export"],jE=Object.assign((function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var o={};return r.forEach((function(e){o[e]=t[e]})),"".concat(n.connection.key,"(").concat(FE(o),")")}return n.connection.key}var i=e;if(t){var a=FE(t);i+="(".concat(a,")")}return n&&Object.keys(n).forEach((function(e){-1===ME.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?i+="@".concat(e,"(").concat(FE(n[e]),")"):i+="@".concat(e))})),i}),{setStringify:function(e){var t=FE;return FE=e,t}}),FE=function(e){return JSON.stringify(e,BE)};function BE(e,t){return NE(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{})),t}function UE(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,o=e.value;return LE(n,r,o,t)})),n}return null}function qE(e){return e.alias?e.alias.value:e.name.value}function VE(e,t,n){if("string"==typeof e.__typename)return e.__typename;for(var r=0,o=t.selections;r<o.length;r++){var i=o[r];if($E(i)){if("__typename"===i.name.value)return e[qE(i)]}else{var a=VE(e,PE(i,n).selectionSet,n);if("string"==typeof a)return a}}}function $E(e){return"Field"===e.kind}function zE(e){return"InlineFragment"===e.kind}function HE(e){__DEV__?Ww(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):Ww(e&&"Document"===e.kind,44);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new Qw('Schema type definitions not allowed in queries. Found: "'.concat(e.kind,'"')):new Qw(45);return e}));return __DEV__?Ww(t.length<=1,"Ambiguous GraphQL document: contains ".concat(t.length," operations")):Ww(t.length<=1,46),e}function GE(e){return HE(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function QE(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function WE(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function KE(e){var t=GE(e);return __DEV__?Ww(t&&"query"===t.operation,"Must contain a query definition."):Ww(t&&"query"===t.operation,47),t}function ZE(e){var t;HE(e);for(var n=0,r=e.definitions;n<r.length;n++){var o=r[n];if("OperationDefinition"===o.kind){var i=o.operation;if("query"===i||"mutation"===i||"subscription"===i)return o}"FragmentDefinition"!==o.kind||t||(t=o)}if(t)return t;throw __DEV__?new Qw("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new Qw(51)}function YE(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&LE(t,e.variable.name,e.defaultValue)})),t}function JE(e,t){return t?t(e):kE.of()}function XE(e){return"function"==typeof e?new n_(e):e}function e_(e){return e.request.length<=1}var t_=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return w(t,e),t}(Error),n_=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return kE.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(XE).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var o=XE(n),i=XE(r||new e(JE));return e_(o)&&e_(i)?new e((function(e){return t(e)?o.request(e)||kE.of():i.request(e)||kE.of()})):new e((function(e,n){return t(e)?o.request(e,n)||kE.of():i.request(e,n)||kE.of()}))},e.execute=function(e,t){return e.request(function(e,t){var n=E({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=E(E({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return E({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?QE(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(t.indexOf(o)<0)throw __DEV__?new Qw("illegal argument: ".concat(o)):new Qw(24)}return e}(t))))||kE.of()},e.concat=function(t,n){var r=XE(t);if(e_(r))return __DEV__&&Ww.warn(new t_("You are calling concat on a terminating link, which will have no effect",r)),r;var o=XE(n);return e_(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||kE.of()}))||kE.of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||kE.of()}))||kE.of()}))},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(JE)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new Qw("request is not implemented"):new Qw(19)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),r_=n_.execute;function o_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)}))})),n}var i_=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=__DEV__?new Qw("Network request failed. ".concat(t," is not serializable: ").concat(e.message)):new Qw(21);throw r.parseError=e,r}return n},a_=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r},s_=Object.prototype.hasOwnProperty;var c_={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},l_=function(e,t){return t(e)};function u_(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={},i={};n.forEach((function(e){o=E(E(E({},o),e.options),{headers:E(E({},o.headers),f_(e.headers))}),e.credentials&&(o.credentials=e.credentials),i=E(E({},i),e.http)}));var a=e.operationName,s=e.extensions,c=e.variables,l=e.query,u={operationName:a,variables:c};return i.includeExtensions&&(u.extensions=s),i.includeQuery&&(u.query=t(l,Lw)),{options:o,body:u}}function f_(e){if(e){var t=Object.create(null);return Object.keys(Object(e)).forEach((function(n){t[n.toLowerCase()]=e[n]})),t}return e}function p_(e){return new kE((function(t){t.error(e)}))}var d_=Jw((function(){return fetch})),h_=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,o=e.print,i=void 0===o?l_:o,a=e.includeExtensions,s=e.useGETForQueries,c=e.includeUnusedVariables,l=void 0!==c&&c,u=_(e,["uri","fetch","print","includeExtensions","useGETForQueries","includeUnusedVariables"]);__DEV__&&function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new Qw("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new Qw(20)}(r||d_);var f={http:{includeExtensions:a},options:u.fetchOptions,credentials:u.credentials,headers:u.headers};return new n_((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,n),o=e.getContext(),a={};if(o.clientAwareness){var c=o.clientAwareness,u=c.name,p=c.version;u&&(a["apollographql-client-name"]=u),p&&(a["apollographql-client-version"]=p)}var d,h=E(E({},a),o.headers),m={http:o.http,options:o.fetchOptions,credentials:o.credentials,headers:h},g=u_(e,i,c_,f,m),v=g.options,b=g.body;if(b.variables&&!l){var y=new Set(Object.keys(b.variables));Rw(e.query,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&y.delete(e.name.value)}}),y.size&&(b.variables=E({},b.variables),y.forEach((function(e){delete b.variables[e]})))}if(!v.signal){var w=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),_=w.controller,x=w.signal;(d=_)&&(v.signal=x)}if(s&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(v.method="GET"),"GET"===v.method){var S=function(e,t){var n=[],r=function(e,t){n.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var o=void 0;try{o=i_(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",o)}if(t.extensions){var i=void 0;try{i=i_(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",i)}var a="",s=e,c=e.indexOf("#");-1!==c&&(a=e.substr(c),s=e.substr(0,c));var l=-1===s.indexOf("?")?"?":"&";return{newURI:s+l+n.join("&")+a}}(t,b),O=S.newURI,T=S.parseError;if(T)return p_(T);t=O}else try{v.body=i_(b,"Payload")}catch(T){return p_(T)}return new kE((function(n){var o;return(r||Jw((function(){return fetch}))||d_)(t,v).then((function(t){return e.setContext({response:t}),t})).then((o=e,function(e){return e.text().then((function(t){try{return JSON.parse(t)}catch(r){var n=r;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}})).then((function(t){return e.status>=300&&a_(e,t,"Response not successful: Received status code ".concat(e.status)),Array.isArray(t)||s_.call(t,"data")||s_.call(t,"errors")||a_(e,t,"Server response was missing for query '".concat(Array.isArray(o)?o.map((function(e){return e.operationName})):o.operationName,"'.")),t}))})).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){d&&d.abort()}}))}))},m_=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,h_(t).request)||this;return n.options=t,n}return w(t,e),t}(n_),g_=Object.prototype,v_=g_.toString,b_=g_.hasOwnProperty,y_=Function.prototype.toString,w_=new Map;function E_(e,t){try{return __(e,t)}finally{w_.clear()}}function __(e,t){if(e===t)return!0;var n,r,o,i=v_.call(e);if(i!==v_.call(t))return!1;switch(i){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(T_(e,t))return!0;var a=x_(e),s=x_(t),c=a.length;if(c!==s.length)return!1;for(var l=0;l<c;++l)if(!b_.call(t,a[l]))return!1;for(l=0;l<c;++l){var u=a[l];if(!__(e[u],t[u]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(T_(e,t))return!0;for(var f=e.entries(),p="[object Map]"===i;;){var d=f.next();if(d.done)break;var h=d.value,m=h[0],g=h[1];if(!t.has(m))return!1;if(p&&!__(g,t.get(m)))return!1}return!0;case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":var v=e.byteLength;if(v===t.byteLength)for(;v--&&e[v]===t[v];);return-1===v;case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":var b=y_.call(e);return b===y_.call(t)&&(r=O_,!((o=(n=b).length-r.length)>=0&&n.indexOf(r,o)===o))}return!1}function x_(e){return Object.keys(e).filter(S_,e)}function S_(e){return void 0!==this[e]}var O_="{ [native code] }";function T_(e,t){var n=w_.get(e);if(n){if(n.has(t))return!0}else w_.set(e,n=new Set);return n.add(t),!1}var C_=function(){return Object.create(null)},k_=Array.prototype,N_=k_.forEach,A_=k_.slice,I_=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=C_),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return N_.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(A_.call(e)))},e.prototype.getChildTrie=function(t){var n=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r},e}();var P_="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),R_="function"==typeof WeakSet,D_="function"==typeof Symbol&&"function"==typeof Symbol.for;function L_(e,t){var n=e.directives;return!n||!n.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments,r=e.name.value;__DEV__?Ww(n&&1===n.length,"Incorrect number of arguments for the @".concat(r," directive.")):Ww(n&&1===n.length,38);var o=n[0];__DEV__?Ww(o.name&&"if"===o.name.value,"Invalid argument for the @".concat(r," directive.")):Ww(o.name&&"if"===o.name.value,39);var i=o.value;__DEV__?Ww(i&&("Variable"===i.kind||"BooleanValue"===i.kind),"Argument for the @".concat(r," directive must be a variable or a boolean value.")):Ww(i&&("Variable"===i.kind||"BooleanValue"===i.kind),40),t.push({directive:e,ifArgument:o})}}));return t}(n).every((function(e){var n=e.directive,r=e.ifArgument,o=!1;return"Variable"===r.value.kind?(o=t&&t[r.value.name.value],__DEV__?Ww(void 0!==o,"Invalid variable referenced in @".concat(n.name.value," directive.")):Ww(void 0!==o,37)):o=r.value.value,"skip"===n.name.value?!o:o}))}function M_(e,t){return function(e){var t=[];return Rw(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function j_(e){return e&&M_(["client"],e)&&M_(["export"],e)}var F_=Object.prototype.hasOwnProperty;function B_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return U_(e)}function U_(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new V_,o=1;o<n;++o)t=r.merge(t,e[o]);return t}var q_=function(e,t,n){return this.merge(e[n],t[n])},V_=function(){function e(e){void 0===e&&(e=q_),this.reconciler=e,this.isObject=NE,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var n=this,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];return NE(t)&&NE(e)?(Object.keys(t).forEach((function(o){if(F_.call(e,o)){var i=e[o];if(t[o]!==i){var a=n.reconciler.apply(n,k([e,t,o],r));a!==i&&((e=n.shallowCopyForMerge(e))[o]=a)}}else(e=n.shallowCopyForMerge(e))[o]=t[o]})),e):t},e.prototype.shallowCopyForMerge=function(e){if(NE(e)){if(this.pastCopies.has(e)){if(!Object.isFrozen(e))return e;this.pastCopies.delete(e)}e=Array.isArray(e)?e.slice(0):E({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e)}return e},e}(),$_=Object.prototype.hasOwnProperty;function z_(e,t){var n=e.__typename,r=e.id,o=e._id;if("string"==typeof n&&(t&&(t.keyObject=void 0!==r?{id:r}:void 0!==o?{_id:o}:void 0),void 0===r&&(r=o),void 0!==r))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var H_={dataIdFromObject:z_,addTypename:!0,resultCaching:!0,canonizeResults:!1};function G_(e){var t=e.canonizeResults;return void 0===t?H_.canonizeResults:t}var Q_=/^[_a-z][_0-9a-z]*/i;function W_(e){var t=e.match(Q_);return t?t[0]:e}function K_(e,t,n){return!!NE(t)&&(Y_(t)?t.every((function(t){return K_(e,t,n)})):e.selections.every((function(e){if($E(e)&&L_(e,n)){var r=qE(e);return $_.call(t,r)&&(!e.selectionSet||K_(e.selectionSet,t[r],n))}return!0})))}function Z_(e){return NE(e)&&!DE(e)&&!Y_(e)}var Y_=function(e){return Array.isArray(e)};var J_,X_,ex=function(){function e(){this.known=new(R_?WeakSet:Set),this.pool=new I_(P_),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return NE(e)&&this.known.has(e)},e.prototype.pass=function(e){if(NE(e)){var t=function(e){return NE(e)?Y_(e)?e.slice(0):E({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(NE(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this);return(s=this.pool.lookupArray(r)).array||(this.known.add(s.array=r),__DEV__&&Object.freeze(r)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var o=Object.getPrototypeOf(e),i=[o],a=this.sortedKeys(e);i.push(a.json);var s,c=i.length;if(a.sorted.forEach((function(n){i.push(t.admit(e[n]))})),!(s=this.pool.lookupArray(i)).object){var l=s.object=Object.create(o);this.known.add(l),a.sorted.forEach((function(e,t){l[e]=i[c+t]})),__DEV__&&Object.freeze(l)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}(),tx=Object.assign((function(e){if(NE(e)){void 0===J_&&nx();var t=J_.admit(e),n=X_.get(t);return void 0===n&&X_.set(t,n=JSON.stringify(t)),n}return JSON.stringify(e)}),{reset:nx});function nx(){J_=new ex,X_=new(P_?WeakMap:Map)}function rx(e,t,n){return new kE((function(r){var o=r.next,i=r.error,a=r.complete,s=0,c=!1,l={then:function(e){return new Promise((function(t){return t(e())}))}};function u(e,t){return e?function(t){++s;var n=function(){return e(t)};l=l.then(n,n).then((function(e){--s,o&&o.call(r,e),c&&f.complete()}),(function(e){throw--s,e})).catch((function(e){i&&i.call(r,e)}))}:function(e){return t&&t.call(r,e)}}var f={next:u(t,o),error:u(n,i),complete:function(){c=!0,s||a&&a.call(r)}},p=e.subscribe(f);return function(){return p.unsubscribe()}}))}function ox(e){return e.errors&&e.errors.length>0||!1}function ix(e,t,n){var r=0;return e.forEach((function(n,o){t.call(this,n,o,e)&&(e[r++]=n)}),n),e.length=r,e}var ax={kind:"Field",name:{kind:"Name",value:"__typename"}};function sx(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&sx(t[e.name.value],t)}))}function cx(e){return sx(GE(e)||function(e){__DEV__?Ww("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):Ww("Document"===e.kind,48),__DEV__?Ww(e.definitions.length<=1,"Fragment must have exactly one definition."):Ww(e.definitions.length<=1,49);var t=e.definitions[0];return __DEV__?Ww("FragmentDefinition"===t.kind,"Must be a fragment definition."):Ww("FragmentDefinition"===t.kind,50),t}(e),IE(WE(e)))?null:e}function lx(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function ux(e,t){var n=Object.create(null),r=[],o=Object.create(null),i=[],a=cx(Rw(t,{Variable:{enter:function(e,t,r){"VariableDefinition"!==r.kind&&(n[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&(e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(lx(e))))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&r.push({name:e.value.name.value})})),t.selectionSet&&dx(t.selectionSet).forEach((function(e){i.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){o[e.name.value]=!0}},Directive:{enter:function(t){if(lx(e)(t))return null}}}));return a&&ix(r,(function(e){return!!e.name&&!n[e.name]})).length&&(a=function(e,t){var n=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return cx(Rw(t,{OperationDefinition:{enter:function(t){return E(E({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var r=0;if(t.arguments&&t.arguments.forEach((function(e){n(e)&&(r+=1)})),1===r)return null}}},Argument:{enter:function(e){if(n(e))return null}}}))}(r,a)),a&&ix(i,(function(e){return!!e.name&&!o[e.name]})).length&&(a=function(e,t){function n(t){if(e.some((function(e){return e.name===t.name.value})))return null}return cx(Rw(t,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}(i,a)),a}var fx=Object.assign((function(e){return Rw(HE(e),{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var r=e.selections;if(r)if(!r.some((function(e){return $E(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var o=n;if(!($E(o)&&o.directives&&o.directives.some((function(e){return"export"===e.name.value}))))return E(E({},e),{selections:k(k([],r),[ax])})}}}}})}),{added:function(e){return e===ax}}),px={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&Ww.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function dx(e){var t=[];return e.selections.forEach((function(e){($E(e)||zE(e))&&e.selectionSet?dx(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function hx(e){return"query"===ZE(e).operation?e:Rw(e,{OperationDefinition:{enter:function(e){return E(E({},e),{operation:"query"})}}})}var mx=new Map;function gx(e){var t=mx.get(e)||1;return mx.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function vx(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function bx(e){function t(t){Object.defineProperty(e,t,{value:kE})}return D_&&Symbol.species&&t(Symbol.species),t("@@species"),e}function yx(e){return e&&"function"==typeof e.then}var wx=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.addCount=0,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],vx(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),vx(n.observers,"error",e))},complete:function(){if(null!==n.sub){var e=n.sources.shift();e?yx(e)?e.then((function(e){return n.sub=e.subscribe(n.handlers)})):n.sub=e.subscribe(n.handlers):(n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),vx(n.observers,"complete"))}}},n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.complete()},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new kE(t)]),yx(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return w(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e),++this.addCount)},t.prototype.removeObserver=function(e,t){this.observers.delete(e)&&--this.addCount<1&&!t&&this.handlers.error(new Error("Observable cancelled prematurely"))},t.prototype.cleanup=function(e){var t=this,n=!1,r=function(){n||(n=!0,t.observers.delete(o),e())},o={next:r,error:r,complete:r},i=this.addCount;this.addObserver(o),this.addCount=i},t}(kE);function Ex(e){return Array.isArray(e)&&e.length>0}bx(wx);var _x,xx=function(e){function t(n){var r,o,i=n.graphQLErrors,a=n.clientErrors,s=n.networkError,c=n.errorMessage,l=n.extraInfo,u=e.call(this,c)||this;return u.graphQLErrors=i||[],u.clientErrors=a||[],u.networkError=s||null,u.message=c||(o="",(Ex((r=u).graphQLErrors)||Ex(r.clientErrors))&&(r.graphQLErrors||[]).concat(r.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";o+="".concat(t,"\n")})),r.networkError&&(o+="".concat(r.networkError.message,"\n")),o=o.replace(/\n$/,"")),u.extraInfo=l,u.__proto__=t.prototype,u}return w(t,e),t}(Error);function Sx(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(_x||(_x={}));var Ox=Object.prototype.toString;function Tx(e){return Cx(e)}function Cx(e,t){switch(Ox.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=Cx(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=Cx(e[n],t)})),r;default:return e}}var kx=Object.assign,Nx=Object.hasOwnProperty,Ax=!1,Ix=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,o=t.options,i=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Px)}catch(e){}var n=!i.observers.size;i.observers.add(e);var r=i.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&i.reobserve().catch((function(){})),function(){i.observers.delete(e)&&!i.observers.size&&i.tearDownQuery()}}))||this;i.observers=new Set,i.subscriptions=new Set,i.isTornDown=!1,i.options=o,i.queryId=r.queryId||n.generateQueryId();var a=GE(o.query);return i.queryName=a&&a.name&&a.name.value,i.initialFetchPolicy=o.fetchPolicy||"cache-first",i.queryManager=n,i.queryInfo=r,i}return w(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){o.unsubscribe()}),0)},error:n},o=e.subscribe(r)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||_x.ready,r=E(E({},t),{loading:Sx(n),networkStatus:n}),o=this.options.fetchPolicy,i=void 0===o?"cache-first":o;if("network-only"===i||"no-cache"===i||"standby"===i||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var a=this.queryInfo.getDiff();(a.complete||this.options.returnPartialData)&&(r.data=a.result),E_(r.data,{})&&(r.data=void 0),a.complete?(delete r.partial,!a.complete||r.networkStatus!==_x.loading||"cache-first"!==i&&"cache-only"!==i||(r.networkStatus=_x.ready,r.loading=!1)):r.partial=!0,!__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||Rx(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e){return!this.last||!E_(this.last.result,e)},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||E_(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if(n.fetchPolicy="cache-and-network"===r?r:"no-cache"===r?"no-cache":"network-only",__DEV__&&e&&Nx.call(e,"variables")){var o=KE(this.options.query),i=o.variableDefinitions;i&&i.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&Ww.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=o.name)||void 0===t?void 0:t.value)||JSON.stringify(o),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!E_(this.options.variables,e)&&(n.variables=this.options.variables=E(E({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,_x.refetch)},t.prototype.fetchMore=function(e){var t=this,n=E(E({},e.query?e:E(E(E({},this.options),e),{variables:E(E({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),r=this.queryManager.generateQueryId();return n.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=_x.fetchMore,this.observe()),this.queryManager.fetchQuery(r,n,_x.fetchMore).then((function(r){var o=r.data,i=e.updateQuery;return i?(__DEV__&&!Ax&&(__DEV__&&Ww.warn("The updateQuery callback for fetchMore is deprecated, and will be removed\nin the next major version of Apollo Client.\n\nPlease convert updateQuery functions to field policies with appropriate\nread and merge functions, or use/adapt a helper function (such as\nconcatPagination, offsetLimitPagination, or relayStylePagination) from\n@apollo/client/utilities.\n\nThe field policy system handles pagination more effectively than a\nhand-written updateQuery function, and you only need to define the policy\nonce, rather than every time you call fetchMore."),Ax=!0),t.updateQuery((function(e){return i(e,{fetchMoreResult:o,variables:n.variables})}))):t.queryManager.cache.writeQuery({query:n.query,variables:n.variables,data:o}),r})).finally((function(){t.queryManager.stopQuery(r),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var o=t.variables;return r(e,{subscriptionData:n,variables:o})}))},error:function(t){e.onError?e.onError(t):__DEV__&&Ww.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return E_(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.initialFetchPolicy,variables:e},_x.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n){if(!t||t.interval!==n){__DEV__?Ww(n,"Attempted to start a polling query without a polling interval."):Ww(n,10),(t||(this.pollingInfo={})).interval=n;var r=function(){e.pollingInfo&&(Sx(e.queryInfo.networkStatus)?o():e.reobserve({fetchPolicy:"network-only"},_x.poll).then(o,o))},o=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};o()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=E(E({},this.last),{result:this.queryManager.assumeImmutableResults?e:Tx(e),variables:t}),Ex(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var n=this;this.isTornDown=!1;var r=t===_x.refetch||t===_x.fetchMore||t===_x.poll,o=this.options.variables,i=r?o_(this.options,e):kx(this.options,o_(e));r||(this.updatePolling(),e&&e.variables&&!e.fetchPolicy&&!E_(e.variables,o)&&(i.fetchPolicy=this.initialFetchPolicy,void 0===t&&(t=_x.setVariables)));var a=i.variables&&E({},i.variables),s=this.fetch(i,t),c={next:function(e){n.reportResult(e,a)},error:function(e){n.reportError(e,a)}};return r||(this.concast&&this.observer&&this.concast.removeObserver(this.observer,!0),this.concast=s,this.observer=c),s.addObserver(c),s.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError();(n||this.isDifferentFromLastResult(e))&&((n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),vx(this.observers,"next",e))},t.prototype.reportError=function(e,t){var n=E(E({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:_x.error,loading:!1});this.updateLastResult(n,t),vx(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(kE);function Px(e){__DEV__&&Ww.error("Unhandled error",e.message,e.stack)}function Rx(e){__DEV__&&e&&__DEV__&&Ww.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}bx(Ix);var Dx=null,Lx={},Mx=1,jx="@wry/context:Slot",Fx=Array,Bx=Fx[jx]||function(){var e=function(){function e(){this.id=["slot",Mx++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=Dx;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Lx)break;return e!==Dx&&(Dx.slots[this.id]=t),!0}return Dx&&(Dx.slots[this.id]=Lx),!1},e.prototype.getValue=function(){if(this.hasValue())return Dx.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var o,i=((o={__proto__:null})[this.id]=e,o),a=Dx;Dx={parent:a,slots:i};try{return t.apply(r,n)}finally{Dx=a}},e.bind=function(e){var t=Dx;return function(){var n=Dx;try{return Dx=t,e.apply(this,arguments)}finally{Dx=n}}},e.noContext=function(e,t,n){if(!Dx)return e.apply(n,t);var r=Dx;try{return Dx=null,e.apply(n,t)}finally{Dx=r}},e}();try{Object.defineProperty(Fx,jx,{value:Fx[jx]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();Bx.bind,Bx.noContext;function Ux(){}var qx,Vx=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=Ux),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),$x=new Bx,zx=Object.prototype.hasOwnProperty,Hx=void 0===(qx=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:qx;function Gx(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Qx=[];function Wx(e,t){if(!e)throw new Error(t||"assertion failure")}function Kx(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Zx=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!Xx(this))return Yx(this),this.value[0]},e.prototype.recompute=function(e){return Wx(!this.recomputing,"already recomputing"),Yx(this),Xx(this)?function(e,t){aS(e),$x.withValue(e,Jx,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{Gx(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,Xx(e))return;tS(e)}(e);return Kx(e.value)}(this,e):Kx(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,eS(this),Gx(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),aS(this),nS(this,(function(t,n){t.setDirty(),sS(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Qx.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(Hx(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Qx.push(this.deps),this.deps=null)},e.count=0,e}();function Yx(e){var t=$x.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Xx(e)?rS(t,e):oS(t,e),t}function Jx(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function Xx(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function eS(e){nS(e,rS)}function tS(e){nS(e,oS)}function nS(e,t){var n=e.parents.size;if(n)for(var r=Hx(e.parents),o=0;o<n;++o)t(r[o],e)}function rS(e,t){Wx(e.childValues.has(t)),Wx(Xx(t));var n=!Xx(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=Qx.pop()||new Set;e.dirtyChildren.add(t),n&&eS(e)}function oS(e,t){Wx(e.childValues.has(t)),Wx(!Xx(t));var n,r,o,i=e.childValues.get(t);0===i.length?e.childValues.set(t,t.value.slice(0)):(n=i,r=t.value,(o=n.length)>0&&o===r.length&&n[o-1]===r[o-1]||e.setDirty()),iS(e,t),Xx(e)||tS(e)}function iS(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(Qx.length<100&&Qx.push(n),e.dirtyChildren=null))}function aS(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){sS(e,n)})),e.forgetDeps(),Wx(null===e.dirtyChildren)}function sS(e,t){t.parents.delete(e),e.childValues.delete(t),iS(e,t)}var cS={setDirty:!0,dispose:!0,forget:!0};function lS(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=$x.getValue();if(r){var o=t.get(e);o||t.set(e,o=new Set),r.dependOn(o),"function"==typeof n&&(Gx(o),o.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var o=n&&zx.call(cS,n)?n:"setDirty";Hx(r).forEach((function(e){return e[o]()})),t.delete(e),Gx(r)}},r}function uS(){var e=new I_("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}uS();var fS=new Set;function pS(e,t){void 0===t&&(t=Object.create(null));var n=new Vx(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=t.keyArgs,o=t.makeCacheKey||uS(),i=function(){var i=o.apply(null,r?r.apply(null,arguments):arguments);if(void 0===i)return e.apply(null,arguments);var a=n.get(i);a||(n.set(i,a=new Zx(e)),a.subscribe=t.subscribe,a.forget=function(){return n.delete(i)});var s=a.recompute(Array.prototype.slice.call(arguments));return n.set(i,a),fS.add(n),$x.hasValue()||(fS.forEach((function(e){return e.clean()})),fS.clear()),s};function a(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function c(e){return n.delete(e)}return Object.defineProperty(i,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),i.dirtyKey=a,i.dirty=function(){a(o.apply(null,arguments))},i.peekKey=s,i.peek=function(){return s(o.apply(null,arguments))},i.forgetKey=c,i.forget=function(){return c(o.apply(null,arguments))},i.makeCacheKey=o,i.getKey=r?function(){return o.apply(null,r.apply(null,arguments))}:o,Object.freeze(i)}var dS=new Bx,hS=new WeakMap;function mS(e){var t=hS.get(e);return t||hS.set(e,t={vars:new Set,dep:lS()}),t}function gS(e){mS(e).vars.forEach((function(t){return t.forgetCache(e)}))}function vS(e){var t=new Set,n=new Set,r=function(i){if(arguments.length>0){if(e!==i){e=i,t.forEach((function(e){mS(e).dep.dirty(r),bS(e)}));var a=Array.from(n);n.clear(),a.forEach((function(t){return t(e)}))}}else{var s=dS.getValue();s&&(o(s),mS(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var o=r.attachCache=function(e){return t.add(e),mS(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function bS(e){e.broadcastWatches&&e.broadcastWatches()}var yS=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,o=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),o&&this.setFragmentMatcher(o)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=B_(t.resolvers,e)})):this.resolvers=B_(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,o=e.variables,i=e.onlyRunForcedResolvers,a=void 0!==i&&i;return x(this,void 0,void 0,(function(){return S(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,o,this.fragmentMatcher,a).then((function(e){return E(E({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return M_(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){HE(e);var t=ux([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=Rw(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return $E(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return E(E({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),x(this,void 0,void 0,(function(){return S(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return E(E({},t),e.exportedVariables)}))]:[2,E({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Rw(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Pw}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:hx(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,o,i){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o=function(){return!0}),void 0===i&&(i=!1),x(this,void 0,void 0,(function(){var a,s,c,l,u,f,p,d,h;return S(this,(function(m){return a=ZE(e),s=WE(e),c=IE(s),l=a.operation,u=l?l.charAt(0).toUpperCase()+l.slice(1):"Query",p=(f=this).cache,d=f.client,h={fragmentMap:c,context:E(E({},n),{cache:p,client:d}),variables:r,fragmentMatcher:o,defaultOperationType:u,exportedVariables:{},onlyRunForcedResolvers:i},[2,this.resolveSelectionSet(a.selectionSet,t,h).then((function(e){return{result:e,exportedVariables:h.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return x(this,void 0,void 0,(function(){var r,o,i,a,s,c=this;return S(this,(function(l){return r=n.fragmentMap,o=n.context,i=n.variables,a=[t],s=function(e){return x(c,void 0,void 0,(function(){var s,c;return S(this,(function(l){return L_(e,i)?$E(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&a.push(((n={})[qE(e)]=t,n))}))]:(zE(e)?s=e:(s=r[e.name.value],__DEV__?Ww(s,"No fragment named ".concat(e.name.value)):Ww(s,9)),s&&s.typeCondition&&(c=s.typeCondition.name.value,n.fragmentMatcher(t,c,o))?[2,this.resolveSelectionSet(s.selectionSet,t,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return U_(a)}))]}))}))},e.prototype.resolveField=function(e,t,n){return x(this,void 0,void 0,(function(){var r,o,i,a,s,c,l,u,f,p=this;return S(this,(function(d){return r=n.variables,o=e.name.value,i=qE(e),a=o!==i,s=t[i]||t[o],c=Promise.resolve(s),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(l=t.__typename||n.defaultOperationType,(u=this.resolvers&&this.resolvers[l])&&(f=u[a?o:i])&&(c=Promise.resolve(dS.withValue(this.cache,f,[t,UE(e,r),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,c.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?p.resolveSubSelectedArray(e,t,n):e.selectionSet?p.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}(),wS=new(P_?WeakMap:Map);function ES(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return wS.set(e,(wS.get(e)+1)%1e15),n.apply(this,arguments)})}function _S(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var xS=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;wS.has(n)||(wS.set(n,0),ES(n,"evict"),ES(n,"modify"),ES(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||_x.loading;return this.variables&&this.networkStatus!==_x.loading&&!E_(this.variables,e.variables)&&(t=_x.setVariables),E_(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){_S(this),this.lastDiff=void 0,this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&E_(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||E_(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},e.prototype.notify=function(){var e=this;_S(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Sx(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=E(E({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&E_(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===wS.get(this.cache)&&E_(t,n.variables)&&E_(e.data,n.result.data))},e.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Ex(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(t.variables)):0!==n&&(SS(e,t.errorPolicy)?this.cache.performTransaction((function(o){if(r.shouldWrite(e,t.variables))o.writeQuery({query:r.document,data:e.data,variables:t.variables,overwrite:1===n}),r.lastWrite={result:e,variables:t.variables,dmCount:wS.get(r.cache)};else if(r.lastDiff&&r.lastDiff.diff.complete)return void(e.data=r.lastDiff.diff.result);var i=r.getDiffOptions(t.variables),a=o.diff(i);r.stopped||r.updateWatch(t.variables),r.updateLastDiff(a,i),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=_x.ready},e.prototype.markError=function(e){return this.networkStatus=_x.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function SS(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!ox(e);return!r&&n&&e.data&&(r=!0),r}var OS=Object.prototype.hasOwnProperty,TS=function(){function e(e){var t=e.cache,n=e.link,r=e.queryDeduplication,o=void 0!==r&&r,i=e.onBroadcast,a=e.ssrMode,s=void 0!==a&&a,c=e.clientAwareness,l=void 0===c?{}:c,u=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(P_?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.queryDeduplication=o,this.clientAwareness=l,this.localState=u||new yS({cache:t}),this.ssrMode=s,this.assumeImmutableResults=!!f,(this.onBroadcast=i)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(__DEV__?new Qw("QueryManager stopped while query was in flight"):new Qw(11))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,r=e.optimisticResponse,o=e.updateQueries,i=e.refetchQueries,a=void 0===i?[]:i,s=e.awaitRefetchQueries,c=void 0!==s&&s,l=e.update,u=e.onQueryUpdated,f=e.errorPolicy,p=void 0===f?"none":f,d=e.fetchPolicy,h=void 0===d?"network-only":d,m=e.keepRootFields,g=e.context;return x(this,void 0,void 0,(function(){var e,i,s;return S(this,(function(f){switch(f.label){case 0:return __DEV__?Ww(t,"mutation option is required. You must specify your GraphQL document in the mutation option."):Ww(t,12),__DEV__?Ww("network-only"===h||"no-cache"===h,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):Ww("network-only"===h||"no-cache"===h,13),e=this.generateMutationId(),t=this.transform(t).document,n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,g)]:[3,2];case 1:n=f.sent(),f.label=2;case 2:return i=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:n,loading:!0,error:null}),r&&this.markMutationOptimistic(r,{mutationId:e,document:t,variables:n,fetchPolicy:h,errorPolicy:p,context:g,updateQueries:o,update:l,keepRootFields:m}),this.broadcastQueries(),s=this,[2,new Promise((function(f,d){return rx(s.getObservableFromLink(t,E(E({},g),{optimisticResponse:r}),n,!1),(function(f){if(ox(f)&&"none"===p)throw new xx({graphQLErrors:f.errors});i&&(i.loading=!1,i.error=null);var d=E({},f);return"function"==typeof a&&(a=a(d)),"ignore"===p&&ox(d)&&delete d.errors,s.markMutationResult({mutationId:e,result:d,document:t,variables:n,fetchPolicy:h,errorPolicy:p,context:g,update:l,updateQueries:o,awaitRefetchQueries:c,refetchQueries:a,removeOptimistic:r?e:void 0,onQueryUpdated:u,keepRootFields:m})})).subscribe({next:function(e){s.broadcastQueries(),f(e)},error:function(t){i&&(i.loading=!1,i.error=t),r&&s.cache.removeOptimistic(e),s.broadcastQueries(),d(t instanceof xx?t:new xx({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,o=[],i="no-cache"===e.fetchPolicy;if(!i&&SS(r,e.errorPolicy)){o.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var a=e.updateQueries;a&&this.queries.forEach((function(e,i){var s=e.observableQuery,c=s&&s.queryName;if(c&&OS.call(a,c)){var l=a[c],u=n.queries.get(i),f=u.document,p=u.variables,d=t.diff({query:f,variables:p,returnPartialData:!0,optimistic:!1}),h=d.result;if(d.complete&&h){var m=l(h,{mutationResult:r,queryName:f&&QE(f)||void 0,queryVariables:p});m&&o.push({result:m,dataId:"ROOT_QUERY",query:f,variables:p})}}}))}if(o.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var s=[];if(this.refetchQueries({updateCache:function(t){i||o.forEach((function(e){return t.write(e)}));var a=e.update;if(a){if(!i){var s=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});s.complete&&(r=E(E({},r),{data:s.result}))}a(t,r,{context:e.context,variables:e.variables})}i||e.keepRootFields||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return s.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(s).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(E(E({},t),{result:{data:r}}),e)}catch(e){__DEV__&&Ww.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t,n=this.transformCache;if(!n.has(e)){var r=this.cache.transformDocument(e),o=(t=this.cache.transformForLink(r),ux([px],HE(t))),i=this.localState.clientQuery(r),a=o&&this.localState.serverQuery(o),s={document:r,hasClientExports:j_(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:a,defaultVars:YE(GE(r)),asQuery:E(E({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?E(E({},e),{operation:"query"}):e}))})},c=function(e){e&&!n.has(e)&&n.set(e,s)};c(e),c(r),c(i),c(a)}return n.get(e)},e.prototype.getVariables=function(e,t){return E(E({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=E(E({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new xS(this),n=new Ix({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:e.query,observableQuery:n,variables:e.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?Ww(e.query,"query option is required. You must specify your GraphQL document in the query option."):Ww(e.query,14),__DEV__?Ww("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):Ww("Document"===e.query.kind,15),__DEV__?Ww(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):Ww(!e.returnPartialData,16),__DEV__?Ww(!e.pollInterval,"pollInterval option only supported on watchQuery."):Ww(!e.pollInterval,17),this.fetchQuery(t,e).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Qw("Store reset while query was in flight (not completed in link chain)"):new Qw(18)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=_x.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,o=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):NE(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e).document,!1):NE(e)&&e.query&&o.add(e)})),this.queries.forEach((function(t,o){var i=t.observableQuery,a=t.document;if(i){if("all"===e)return void n.set(o,i);var s=i.queryName;if("standby"===i.options.fetchPolicy||"active"===e&&!i.hasObservers())return;("active"===e||s&&r.has(s)||a&&r.has(a))&&(n.set(o,i),s&&r.set(s,!0),a&&r.set(a,!0))}})),o.size&&o.forEach((function(e){var r=gx("legacyOneTimeQuery"),o=t.getQuery(r).init({document:e.query,variables:e.variables}),i=new Ix({queryManager:t,queryInfo:o,options:E(E({},e),{fetchPolicy:"network-only"})});Ww(i.queryId===r),o.setObservableQuery(i),n.set(r,i)})),__DEV__&&r.size&&r.forEach((function(e,t){e||__DEV__&&Ww.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,o){var i=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==i&&"cache-only"!==i)&&n.push(r.refetch()),t.getQuery(o).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,o=e.errorPolicy,i=e.variables,a=e.context,s=void 0===a?{}:a;n=this.transform(n).document,i=this.getVariables(n,i);var c=function(e){return t.getObservableFromLink(n,s,e).map((function(i){if("no-cache"!==r&&(SS(i,o)&&t.cache.write({query:n,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),ox(i))throw new xx({graphQLErrors:i.errors});return i}))};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,i,s).then(c);return new kE((function(e){var t=null;return l.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return c(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var o,i,a=this;void 0===r&&(r=null!==(o=null==t?void 0:t.queryDeduplication)&&void 0!==o?o:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var c=this.inFlightLinkObservables,l=this.link,u={query:s,variables:n,operationName:QE(s)||void 0,context:this.prepareContext(E(E({},t),{forceFetch:!r}))};if(t=u.context,r){var f=c.get(s)||new Map;c.set(s,f);var p=tx(n);if(!(i=f.get(p))){var d=new wx([r_(l,u)]);f.set(p,i=d),d.cleanup((function(){f.delete(p)&&f.size<1&&c.delete(s)}))}}else i=new wx([r_(l,u)])}else i=new wx([kE.of({data:{}})]),t=this.prepareContext(t);var h=this.transform(e).clientQuery;return h&&(i=rx(i,(function(e){return a.localState.runResolvers({document:h,remoteResult:e,context:t,variables:n})}))),i},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return rx(this.getObservableFromLink(e.document,n.context,n.variables),(function(o){var i=Ex(o.errors);if(r>=e.lastRequestId){if(i&&"none"===n.errorPolicy)throw e.markError(new xx({graphQLErrors:o.errors}));e.markResult(o,n,t),e.markReady()}var a={data:o.data,loading:!1,networkStatus:e.networkStatus||_x.ready};return i&&"ignore"!==n.errorPolicy&&(a.errors=o.errors),a}),(function(t){var n=t.hasOwnProperty("graphQLErrors")?t:new xx({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=_x.loading);var o=this.transform(t.query).document,i=this.getVariables(o,t.variables),a=this.getQuery(e),s=t.fetchPolicy,c=void 0===s?"cache-first":s,l=t.errorPolicy,u=void 0===l?"none":l,f=t.returnPartialData,p=void 0!==f&&f,d=t.notifyOnNetworkStatusChange,h=void 0!==d&&d,m=t.context,g=void 0===m?{}:m,v=Object.assign({},t,{query:o,variables:i,fetchPolicy:c,errorPolicy:u,returnPartialData:p,notifyOnNetworkStatusChange:h,context:g}),b=function(e){return v.variables=e,r.fetchQueryByPolicy(a,v,n)};this.fetchCancelFns.set(e,(function(e){setTimeout((function(){return y.cancel(e)}))}));var y=new wx(this.transform(v.query).hasClientExports?this.localState.addExportedVariables(v.query,v.variables,v.context).then(b):b(v.variables));return y.cleanup((function(){r.fetchCancelFns.delete(e),function(e){var t=e.fetchPolicy,n=void 0===t?"cache-first":t,r=e.nextFetchPolicy;r&&(e.fetchPolicy="function"==typeof r?r.call(e,n):r)}(t)})),y},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,o=e.optimistic,i=void 0!==o&&o,a=e.removeOptimistic,s=void 0===a?i?gx("refetchQueries"):void 0:a,c=e.onQueryUpdated,l=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){l.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var u=new Map;return n&&this.cache.batch({update:n,optimistic:i&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof xS&&e.watcher.observableQuery;if(r){if(c){l.delete(r.queryId);var o=c(r,t,n);return!0===o&&(o=r.refetch()),!1!==o&&u.set(r,o),o}null!==c&&l.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),l.size&&l.forEach((function(e,n){var r,o=e.oq,i=e.lastDiff,a=e.diff;if(c){if(!a){var s=o.queryInfo;s.reset(),a=s.getDiff()}r=c(o,a,i)}c&&!0!==r||(r=o.refetch()),!1!==r&&u.set(o,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),u},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,o=t.query,i=t.variables,a=t.fetchPolicy,s=t.refetchWritePolicy,c=t.errorPolicy,l=t.returnPartialData,u=t.context,f=t.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:o,variables:i,networkStatus:n});var d=function(){return e.getDiff(i)},h=function(t,n){void 0===n&&(n=e.networkStatus||_x.loading);var a=t.result;!__DEV__||l||E_(a,{})||Rx(t.missing);var s=function(e){return kE.of(E({data:e,loading:Sx(n),networkStatus:n},t.complete?null:{partial:!0}))};return a&&r.transform(o).hasForcedResolvers?r.localState.runResolvers({document:o,remoteResult:{data:a},context:u,variables:i,onlyRunForcedResolvers:!0}).then((function(e){return s(e.data||void 0)})):s(a)},m="no-cache"===a?0:n===_x.refetch&&"merge"!==s?1:2,g=function(){return r.getResultsFromLink(e,m,{variables:i,context:u,fetchPolicy:a,errorPolicy:c})},v=f&&"number"==typeof p&&p!==n&&Sx(n);switch(a){default:case"cache-first":return(b=d()).complete?[h(b,e.markReady())]:l||v?[h(b),g()]:[g()];case"cache-and-network":var b;return(b=d()).complete||l||v?[h(b),g()]:[g()];case"cache-only":return[h(d(),e.markReady())];case"network-only":return v?[h(d()),g()]:[g()];case"no-cache":return v?[h(e.getDiff()),g()]:[g()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new xS(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return E(E({},t),{clientAwareness:this.clientAwareness})},e}(),CS=!1;function kS(e,t){return o_(e,t,t.variables&&{variables:E(E({},e.variables),t.variables)})}var NS=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,o=e.headers,i=e.cache,a=e.ssrMode,s=void 0!==a&&a,c=e.ssrForceFetchDelay,l=void 0===c?0:c,u=e.connectToDevTools,f=void 0===u?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:u,p=e.queryDeduplication,d=void 0===p||p,h=e.defaultOptions,m=e.assumeImmutableResults,g=void 0!==m&&m,v=e.resolvers,b=e.typeDefs,y=e.fragmentMatcher,w=e.name,E=e.version,_=e.link;if(_||(_=n?new m_({uri:n,credentials:r,headers:o}):n_.empty()),!i)throw __DEV__?new Qw("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Qw(7);if(this.link=_,this.cache=i,this.disableNetworkFetches=s||l>0,this.queryDeduplication=d,this.defaultOptions=h||{},this.typeDefs=b,l&&setTimeout((function(){return t.disableNetworkFetches=!1}),l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!CS&&__DEV__&&(CS=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var x=window.navigator,S=x&&x.userAgent,O=void 0;"string"==typeof S&&(S.indexOf("Chrome/")>-1?O="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":S.indexOf("Firefox/")>-1&&(O="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),O&&__DEV__&&Ww.log("Download the Apollo DevTools for a better development experience: "+O)}this.version="3.5.10",this.localState=new yS({cache:i,client:this,resolvers:v,fragmentMatcher:y}),this.queryManager=new TS({cache:this.cache,link:this.link,queryDeduplication:d,ssrMode:s,clientAwareness:{name:w,version:E},localState:this.localState,assumeImmutableResults:g,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=kS(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=E(E({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=kS(this.defaultOptions.query,e)),__DEV__?Ww("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):Ww("cache-and-network"!==e.fetchPolicy,8),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=E(E({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=kS(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return r_(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var o=Promise.all(r);return o.queries=n,o.results=r,o.catch((function(e){__DEV__&&Ww.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),o},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),AS=n_.from,IS=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r};const PS=function(){function e(e){var t=e.debug,n=void 0!==t&&t;this.debug=n,this.lines=[]}return e.prototype.emit=function(t,n){if(t in console){var r=e.prefix;console[t].apply(console,IS([r],n))}},e.prototype.tailLogs=function(){var e=this;this.lines.forEach((function(t){var n=t[0],r=t[1];return e.emit(n,r)}))},e.prototype.getLogs=function(){return this.lines},e.prototype.write=function(t,n){var r=e.buffer;this.lines=IS(this.lines.slice(1-r),[[t,n]]),(this.debug||"log"!==t)&&this.emit(t,n)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("log",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("warn",e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("error",e)},e.buffer=30,e.prefix="[apollo-cache-persist]",e}();const RS=function(){function e(e){var t=e.cache,n=e.serialize,r=void 0===n||n;this.cache=t,this.serialize=r}return e.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},e.prototype.restore=function(e){this.serialize&&"string"==typeof e&&(e=JSON.parse(e)),null!=e&&this.cache.restore(e)},e}();var DS=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},LS=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const MS=function(){function e(e){var t=e.storage,n=e.key,r=void 0===n?"apollo-cache-persist":n;this.storage=t,this.key=r}return e.prototype.read=function(){return DS(this,void 0,void 0,(function(){return LS(this,(function(e){return[2,this.storage.getItem(this.key)]}))}))},e.prototype.write=function(e){return DS(this,void 0,void 0,(function(){return LS(this,(function(t){switch(t.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.purge=function(){return DS(this,void 0,void 0,(function(){return LS(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}}))}))},e.prototype.getSize=function(){return DS(this,void 0,void 0,(function(){var e;return LS(this,(function(t){switch(t.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return null==(e=t.sent())?[2,0]:[2,"string"==typeof e?e.length:null]}}))}))},e}();var jS=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},FS=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const BS=function(){function e(e,t){var n=e.log,r=e.cache,o=e.storage,i=t.maxSize,a=void 0===i?1048576:i,s=t.persistenceMapper;this.log=n,this.cache=r,this.storage=o,this.paused=!1,s&&(this.persistenceMapper=s),a&&(this.maxSize=a)}return e.prototype.persist=function(){return jS(this,void 0,void 0,(function(){var e,t;return FS(this,(function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),e=this.cache.extract(),this.paused||!this.persistenceMapper?[3,2]:[4,this.persistenceMapper(e)];case 1:e=n.sent(),n.label=2;case 2:return null!=this.maxSize&&"string"==typeof e&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return n.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return n.sent(),this.log.info("string"==typeof e?"Persisted cache of size "+e.length+" characters":"Persisted cache"),[3,7];case 6:throw t=n.sent(),this.log.error("Error persisting cache",t),t;case 7:return[2]}}))}))},e.prototype.restore=function(){return jS(this,void 0,void 0,(function(){var e,t;return FS(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return null==(e=n.sent())?[3,3]:[4,this.cache.restore(e)];case 2:return n.sent(),this.log.info("string"==typeof e?"Restored cache of size "+e.length+" characters":"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),n.label=4;case 4:return[3,6];case 5:throw t=n.sent(),this.log.error("Error restoring cache",t),t;case 6:return[2]}}))}))},e.prototype.purge=function(){return jS(this,void 0,void 0,(function(){var e;return FS(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return t.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=t.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}}))}))},e}(),US=function(e){var t=e.cache;return function(e){var n=t.write,r=t.evict,o=t.modify;return t.write=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=n.apply(t,r);return e(),i},t.evict=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=r.apply(t,n);return e(),i},t.modify=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=o.apply(t,n);return e(),i},function(){t.write=n,t.evict=r,t.modify=o}}};const qS=function(){function e(t,n){var r=this,o=t.log,i=t.persistor;this.fire=function(){r.debounce?(null!=r.timeout&&clearTimeout(r.timeout),r.timeout=setTimeout(r.persist,r.debounce)):r.persist()},this.persist=function(){r.paused||r.persistor.persist()};var a=e.defaultDebounce,s=n.cache,c=n.debounce,l=n.trigger,u=void 0===l?"write":l;if(u)switch(this.debounce=null!=c?c:a,this.persistor=i,this.paused=!1,u){case"write":this.uninstall=US({cache:s})(this.fire);break;case"background":c&&o.warn("Debounce is not recommended with `background` trigger"),this.debounce=c,this.uninstall=function(e){var t=e.log,n=e.cache;return function(e){return t.warn("Trigger option `background` not available on web; using `write` trigger"),US({cache:n})(e)}}({cache:s,log:o})(this.fire);break;default:if("function"!=typeof u)throw Error("Unrecognized trigger option: "+u);this.uninstall=u(this.fire)}}return e.prototype.pause=function(){this.paused=!0},e.prototype.resume=function(){this.paused=!1},e.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},e.defaultDebounce=1e3,e}();const VS=function(){function e(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var t=new PS(e),n=new RS(e),r=new MS(e),o=new BS({log:t,cache:n,storage:r},e),i=new qS({log:t,persistor:o},e);this.log=t,this.cache=n,this.storage=r,this.persistor=o,this.trigger=i}return e.prototype.persist=function(){return this.persistor.persist()},e.prototype.restore=function(){return this.persistor.restore()},e.prototype.purge=function(){return this.persistor.purge()},e.prototype.pause=function(){this.trigger.pause()},e.prototype.resume=function(){this.trigger.resume()},e.prototype.remove=function(){this.trigger.remove()},e.prototype.getLogs=function(e){if(void 0===e&&(e=!1),!e)return this.log.getLogs();this.log.tailLogs()},e.prototype.getSize=function(){return this.storage.getSize()},e}();var $S=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zS=(function(e){function t(t){var n=e.call(this,t)||this;return n.storage=new HS(t),n.persistor=new zS({log:n.log,cache:n.cache,storage:n.storage},t),n}$S(t,e),t.prototype.restoreSync=function(){this.persistor.restoreSync()}}(VS),function(e){function t(t,n){var r=t.log,o=t.cache,i=t.storage;return e.call(this,{log:r,cache:o,storage:i},n)||this}return $S(t,e),t.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},t}(BS)),HS=function(e){function t(t){return e.call(this,t)||this}return $S(t,e),t.prototype.readSync=function(){return this.storage.getItem(this.key)},t}(MS),GS=(function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){return this.storage.setItem(e,t)}}(),function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.get(e)},e.prototype.removeItem=function(e){return this.storage.remove(e)},e.prototype.setItem=function(e,t){return this.storage.set(e,t)}}(),function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){var n=this;return new Promise((function(r,o){n.storage.setItem(e,t).then((function(){return r()})).catch((function(){return o()}))}))}}(),function(){function e(e){this.storage=e}return e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){return null!==t?this.storage.setItem(e,t):this.removeItem(e)},e}());(function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.getItem(e)||null},e.prototype.removeItem=function(e){var t=this;return new Promise((function(n,r){Promise.resolve(t.storage.removeItem(e)).then((function(){return n()})).catch((function(){return r()}))}))},e.prototype.setItem=function(e,t){var n=this;return new Promise((function(r,o){n.storage.setItem(e,t).then((function(){return r()})).catch((function(){return o()}))}))}})(),function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){return null!==t?this.storage.setItem(e,t):this.removeItem(e)}}();class QS extends n_{requests={};request(e,t){var n;const r=null!==(n=e.getContext())&&void 0!==n?n:{};if(!r.concurrentRequests)return t(e);const{key:o="",limit:i}=r.concurrentRequests,a={operation:e,forward:t,observers:[],groupKey:o,limit:null!=i?i:3,observable:new kE((e=>(a.observers.push(e),()=>{this.cancelOperation(a)})))};return this.addOperations(a),a.observable}addOperations(e){this.requests[e.groupKey]||(this.requests[e.groupKey]={queue:[],activeQueue:[]}),this.requests[e.groupKey].queue.push(e),this.scheduleOperations(e.groupKey)}cancelOperation(e){const{queue:t,activeQueue:n}=this.requests[e.groupKey];var r;if(-1!==t.indexOf(e))return this.requests[e.groupKey].queue=t.filter((t=>t!==e)),void(null===(r=e.currentSubscription)||void 0===r||r.unsubscribe());var o;-1!==n.indexOf(e)&&(this.requests[e.groupKey].activeQueue=n.filter((t=>t!==e)),null===(o=e.currentSubscription)||void 0===o||o.unsubscribe(),this.scheduleOperations(e.groupKey))}scheduleOperations(e){const{activeQueue:t,queue:n}=this.requests[e],r=Math.max(...n.map((e=>e.limit)));for(;t.length<r&&n.length>0;){const e=n.shift();e&&(t.push(e),e.currentSubscription=e.forward(e.operation).subscribe({next:t=>this.onNext(t,e),error:t=>this.onErrorLink(t,e),complete:()=>this.onComplete(e)}))}}onNext(e,t){for(const r of t.observers){var n;null===(n=r.next)||void 0===n||n.call(r,e)}}onErrorLink(e,t){for(const r of t.observers){var n;null===(n=r.error)||void 0===n||n.call(r,e)}this.finishEventExecution(t)}onComplete(e){for(const n of e.observers){var t;null===(t=n.complete)||void 0===t||t.call(n)}this.finishEventExecution(e)}finishEventExecution(e){const{activeQueue:t}=this.requests[e.groupKey];this.requests[e.groupKey].activeQueue=t.filter((t=>t!==e)),this.scheduleOperations(e.groupKey)}}var WS=function(){function e(){this.getFragmentDoc=pS(AE)}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(n)}),r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(E(E({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(E(E({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=_(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,o=e.fragmentName,i=_(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(i,{query:this.getFragmentDoc(r,o),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),o=t(r);return null==o?r:(n.writeQuery(E(E({},e),{data:o})),o)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),o=t(r);return null==o?r:(n.writeFragment(E(E({},e),{data:o})),o)}})},e}(),KS=function(e,t,n,r){this.message=e,this.path=t,this.query=n,this.variables=r};function ZS(e){var t=new Set([e]);return t.forEach((function(e){NE(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(n){NE(e[n])&&t.add(e[n])}))})),e}function YS(e){return __DEV__&&ZS(e),e}var JS=Object.create(null),XS=function(){return JS},eO=Object.create(null),tO=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return YS(DE(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return DE(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return RE(e);if(DE(e))return e;var r=n.policies.identify(e)[0];if(r){var o=RE(r);return t&&n.merge(r,e),o}}}return e.prototype.toObject=function(){return E({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),$_.call(this.data,e)){var n=this.data[e];if(n&&$_.call(n,t))return n[t]}return"__typename"===t&&$_.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof iO?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),$_.call(this.data,e)?this.data[e]:this instanceof iO?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;DE(e)&&(e=e.__ref),DE(t)&&(t=t.__ref);var o="string"==typeof e?this.lookup(n=e):e,i="string"==typeof t?this.lookup(n=t):t;if(i){__DEV__?Ww("string"==typeof n,"store.merge expects a string ID"):Ww("string"==typeof n,1);var a=new V_(sO).merge(o,i);if(this.data[n]=a,a!==o&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);o||(s.__exists=1),Object.keys(i).forEach((function(e){if(!o||o[e]!==a[e]){s[e]=1;var t=W_(e);t===e||r.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||r instanceof iO||delete a[e]}})),!s.__typename||o&&o.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var o=Object.create(null),i=!1,a=!0,s={DELETE:JS,INVALIDATE:eO,isReference:DE,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||RE(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(c){var l=W_(c),u=r[c];if(void 0!==u){var f="function"==typeof t?t:t[c]||t[l];if(f){var p=f===XS?JS:f(YS(u),E(E({},s),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));p===eO?n.group.dirty(e,c):(p===JS&&(p=void 0),p!==u&&(o[c]=p,i=!0,u=p))}void 0!==u&&(a=!1)}})),i)return this.merge(e,o),a&&(this instanceof iO?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,o=this.lookup(e);if(o){var i=this.getFieldValue(o,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:i,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=XS,r):XS)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&($_.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof iO&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){$_.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&$_.call(e,n)||t.delete(n)})),e){var n=e.__META,r=_(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof iO?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){$_.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var o=this;o instanceof iO;)o=o.parent;r.forEach((function(e){return o.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!$_.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){DE(e)&&(t[e.__ref]=!0),NE(e)&&Object.keys(e).forEach((function(t){var n=e[t];NE(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),nO=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?lS():null,this.keyMaker=new I_(P_)},e.prototype.depend=function(e,t){if(this.d){this.d(rO(e,t));var n=W_(t);n!==t&&this.d(rO(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(rO(e,t),"__exists"===t?"forget":"setDirty")},e}();function rO(e,t){return t+"#"+e}function oO(e,t){cO(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,o=void 0===r||r,i=t.seed,a=e.call(this,n,new nO(o))||this;return a.stump=new aO(a),a.storageTrie=new I_(P_),i&&a.replace(i),a}return w(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(tO||(tO={}));var iO=function(e){function t(t,n,r,o){var i=e.call(this,n.policies,o)||this;return i.id=t,i.parent=n,i.replay=r,i.group=o,r(i),i}return w(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],o=n.lookup(e);o?r?r!==o&&Object.keys(r).forEach((function(n){E_(r[n],o[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(o).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return E(E({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return $_.call(this.data,t)?E(E({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(tO),aO=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new nO(t.group.caching,t.group))||this}return w(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(iO);function sO(e,t,n){var r=e[n],o=t[n];return E_(r,o)?r:o}function cO(e){return!!(e instanceof tO&&e.group.caching)}function lO(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var uO=function(){function e(e){var t=this;this.knownResults=new(P_?WeakMap:Map),this.config=o_(e,{addTypename:!1!==e.addTypename,canonizeResults:G_(e)}),this.canon=e.canon||new ex,this.executeSelectionSet=pS((function(e){var n,r=e.context.canonizeResults,o=lO(e);o[3]=!r;var i=(n=t.executeSelectionSet).peek.apply(n,o);return i?r?E(E({},i),{result:t.canon.admit(i.result)}):i:(oO(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:lO,makeCacheKey:function(e,t,n,r){if(cO(n.store))return n.store.makeCacheKey(e,DE(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=pS((function(e){return oO(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(cO(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new ex},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,o=void 0===r?"ROOT_QUERY":r,i=e.variables,a=e.returnPartialData,s=void 0===a||a,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,u=this.config.cache.policies;i=E(E({},YE(KE(n))),i);var f,p=RE(o),d=new V_,h=this.executeSelectionSet({selectionSet:ZE(n).selectionSet,objectOrReference:p,enclosingRef:p,context:{store:t,query:n,policies:u,variables:i,varString:tx(i),canonizeResults:l,fragmentMap:IE(WE(n)),merge:function(e,t){return d.merge(e,t)}}});if(h.missing&&(f=[new KS(fO(h.missing),h.missing,n,i)],!s))throw f[0];return{result:h.result,complete:!f,missing:f}},e.prototype.isFresh=function(e,t,n,r){if(cO(r.store)&&this.knownResults.get(e)===n){var o=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(o&&e===o.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,o=e.enclosingRef,i=e.context;if(DE(r)&&!i.policies.rootTypenamesById[r.__ref]&&!i.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var a,s=i.variables,c=i.policies,l=i.store.getFieldValue(r,"__typename"),u={};function f(e,t){var n;return e.missing&&(a=i.merge(a,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&(u={__typename:l});var p=new Set(n.selections);p.forEach((function(e){var n,d;if(L_(e,s))if($E(e)){var h=c.readField({fieldName:e.name.value,field:e,variables:i.variables,from:r},i),m=qE(e);void 0===h?fx.added(e)||(a=i.merge(a,((n={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(DE(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Y_(h)?h=f(t.executeSubSelectedArray({field:e,array:h,enclosingRef:o,context:i}),m):e.selectionSet?null!=h&&(h=f(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:h,enclosingRef:DE(h)?h:o,context:i}),m)):i.canonizeResults&&(h=t.canon.pass(h)),void 0!==h&&(u=i.merge(u,((d={})[m]=h,d)))}else{var g=PE(e,i.fragmentMap);g&&c.fragmentMatches(g,l)&&g.selectionSet.selections.forEach(p.add,p)}}));var d={result:u,missing:a},h=i.canonizeResults?this.canon.admit(d):YS(d);return h.result&&this.knownResults.set(h.result,n),h},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,o=e.array,i=e.enclosingRef,a=e.context;function s(e,n){var r;return e.missing&&(t=a.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(o=o.filter(a.store.canRead)),o=o.map((function(e,t){return null===e?null:Y_(e)?s(n.executeSubSelectedArray({field:r,array:e,enclosingRef:i,context:a}),t):r.selectionSet?s(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:DE(e)?e:i,context:a}),t):(__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){NE(n)&&(__DEV__?Ww(!DE(n),"Missing selection set for object of type ".concat(function(e,t){return DE(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n)," returned for query field ").concat(t.name.value)):Ww(!DE(n),5),Object.values(n).forEach(r.add,r))}))}}(a.store,r,e),e)})),{result:a.canonizeResults?this.canon.admit(o):o,missing:t}},e}();function fO(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var pO=Object.create(null);function dO(e){var t=JSON.stringify(e);return pO[t]||(pO[t]=Object.create(null))}function hO(e){var t=dO(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},o=n.keyObject=gO(e,(function(e){var o=yO(n.storeObject,e,r);return void 0===o&&t!==n.storeObject&&$_.call(t,e[0])&&(o=yO(t,e,bO)),__DEV__?Ww(void 0!==o,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):Ww(void 0!==o,2),o}));return"".concat(n.typename,":").concat(JSON.stringify(o))})}function mO(e){var t=dO(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,o=n.variables,i=n.fieldName,a=gO(e,(function(e){var n=e[0],i=n.charAt(0);if("@"!==i)if("$"!==i){if(t)return yO(t,e)}else{var a=n.slice(1);if(o&&$_.call(o,a)){var s=e.slice(0);return s[0]=a,yO(o,s)}}else if(r&&Ex(r.directives)){var c=n.slice(1),l=r.directives.find((function(e){return e.name.value===c})),u=l&&UE(l,o);return u&&yO(u,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(i+=":"+s),i})}function gO(e,t){var n=new V_;return vO(e).reduce((function(e,r){var o,i=t(r);if(void 0!==i){for(var a=r.length-1;a>=0;--a)(o={})[r[a]]=i,i=o;e=n.merge(e,i)}return e}),Object.create(null))}function vO(e){var t=dO(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,o){Y_(t)?(vO(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Y_(e[o+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function bO(e,t){return e[t]}function yO(e,t,n){return n=n||bO,wO(t.reduce((function e(t,r){return Y_(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function wO(e){return NE(e)?Y_(e)?e.map(wO):gO(Object.keys(e).sort(),(function(t){return yO(e,t)})):e}function EO(e){return void 0!==e.args?e.args:e.field?UE(e.field,e.variables):null}jE.setStringify(tx);var _O=function(){},xO=function(e,t){return t.fieldName},SO=function(e,t,n){return(0,n.mergeObjects)(e,t)},OO=function(e,t){return t},TO=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=E({dataIdFromObject:z_},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r=this,o=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,a=t&&t.storeObject||e,s=E(E({},t),{typename:o,storeObject:a,readField:t&&t.readField||function(){var e=kO(arguments,a);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),c=o&&this.getTypePolicy(o),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var u=l(e,s);if(!Y_(u)){i=u;break}l=hO(u)}return i=i?String(i):void 0,s.keyObject?[i,s.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],o=r.queryType,i=r.mutationType,a=r.subscriptionType,s=_(r,["queryType","mutationType","subscriptionType"]);o&&t.setRootTypename("Query",n),i&&t.setRootTypename("Mutation",n),a&&t.setRootTypename("Subscription",n),$_.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),o=t.keyFields,i=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?SO:!1===t?OO:e.merge}a(r,t.merge),r.keyFn=!1===o?_O:Y_(o)?hO(o):"function"==typeof o?o:r.keyFn,i&&Object.keys(i).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),o=i[t];if("function"==typeof o)r.read=o;else{var s=o.keyArgs,c=o.read,l=o.merge;r.keyFn=!1===s?xO:Y_(s)?mO(s):"function"==typeof s?s:r.keyFn,"function"==typeof c&&(r.read=c),a(r,l)}r.read&&r.merge&&(r.keyFn=r.keyFn||xO)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?Ww(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):Ww(!r||r===e,3),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(Q_);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!$_.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),o=r.fields,i=_(r,["fields"]);Object.assign(n,i),Object.assign(n.fields,o)}))}var o=this.toBeAdded[e];return o&&o.length&&o.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var o=this;if(!e.typeCondition)return!0;if(!t)return!1;var i=e.typeCondition.name.value;if(t===i)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(i))for(var a=this.getSupertypeSet(t,!0),s=[a],c=function(e){var t=o.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},l=!(!n||!this.fuzzySubtypes.size),u=!1,f=0;f<s.length;++f){var p=s[f];if(p.has(i))return a.has(i)||(u&&__DEV__&&Ww.warn("Inferring subtype ".concat(t," of supertype ").concat(i)),a.add(i)),!0;p.forEach(c),l&&f===s.length-1&&K_(e.selectionSet,n,r)&&(l=!1,u=!0,this.fuzzySubtypes.forEach((function(e,n){var r=t.match(e);r&&r[0]===t&&c(n)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!(!n||!n.keyFn)},e.prototype.getStoreFieldName=function(e){var t,n=e.typename,r=e.fieldName,o=this.getFieldPolicy(n,r,!1),i=o&&o.keyFn;if(i&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},s=EO(e);i;){var c=i(s,a);if(!Y_(c)){t=c||r;break}i=mO(c)}return void 0===t&&(t=e.field?function(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var o=r.name,i=r.value;return LE(n[e.name.value],o,i,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,o=e.value;return LE(r,n,o,t)}))),jE(e.name.value,r,n)}(e.field,e.variables):jE(r,EO(e))),!1===t?r:r===W_(t)?t:r+":"+t},e.prototype.readField=function(e,t){var n=e.from;if(n&&(e.field||e.fieldName)){if(void 0===e.typename){var r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}var o=this.getStoreFieldName(e),i=W_(o),a=t.store.getFieldValue(n,o),s=this.getFieldPolicy(e.typename,i,!1),c=s&&s.read;if(c){var l=CO(this,n,e,t,t.store.getStorage(DE(n)?n.__ref:n,o));return dS.withValue(this.cache,c,[a,l])}return a}},e.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},e.prototype.getMergeFunction=function(e,t,n){var r=this.getFieldPolicy(e,t,!1),o=r&&r.merge;return!o&&n&&(o=(r=this.getTypePolicy(n))&&r.merge),o},e.prototype.runMergeFunction=function(e,t,n,r,o){var i=n.field,a=n.typename,s=n.merge;return s===SO?NO(r.store)(e,t):s===OO?t:(r.overwrite&&(e=void 0),s(e,t,CO(this,void 0,{typename:a,fieldName:i.name.value,field:i,variables:r.variables},r,o||Object.create(null))))},e}();function CO(e,t,n,r,o){var i=e.getStoreFieldName(n),a=W_(i),s=n.variables||r.variables,c=r.store,l=c.toReference,u=c.canRead;return{args:EO(n),field:n.field||null,fieldName:a,storeFieldName:i,variables:s,isReference:DE,toReference:l,storage:o,cache:e.cache,canRead:u,readField:function(){return e.readField(kO(arguments,t,r),r)},mergeObjects:NO(r.store)}}function kO(e,t,n){var r,o,i,a=e[0],s=e[1],c=e.length;return"string"==typeof a?r={fieldName:a,from:c>1?s:t}:(r=E({},a),$_.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Ww.warn("Undefined 'from' passed to readField with arguments ".concat((o=Array.from(e),i=gx("stringifyForDisplay"),JSON.stringify(o,(function(e,t){return void 0===t?i:t})).split(JSON.stringify(i)).join("<undefined>")))),void 0===r.variables&&(r.variables=n),r}function NO(e){return function(t,n){if(Y_(t)||Y_(n))throw __DEV__?new Qw("Cannot automatically merge arrays"):new Qw(4);if(NE(t)&&NE(n)){var r=e.getFieldValue(t,"__typename"),o=e.getFieldValue(n,"__typename");if(r&&o&&r!==o)return n;if(DE(t)&&Z_(n))return e.merge(t.__ref,n),t;if(Z_(t)&&DE(n))return e.merge(t,n.__ref),n;if(Z_(t)&&Z_(n))return E(E({},t),n)}return n}}function AO(e,t,n){var r="".concat(t).concat(n),o=e.flavors.get(r);return o||e.flavors.set(r,o=e.clientOnly===t&&e.deferred===n?e:E(E({},e),{clientOnly:t,deferred:n})),o}var IO=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,o=t.result,i=t.dataId,a=t.variables,s=t.overwrite,c=GE(r),l=new V_;a=E(E({},YE(c)),a);var u={store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:tx(a),fragmentMap:IE(WE(r)),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map},f=this.processSelectionSet({result:o||Object.create(null),dataId:i,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:u});if(!DE(f))throw __DEV__?new Qw("Could not identify object ".concat(JSON.stringify(o))):new Qw(6);return u.incomingById.forEach((function(t,r){var o=t.storeObject,i=t.mergeTree,a=t.fieldNodeSet,s=RE(r);if(i&&i.map.size){var c=n.applyMerges(i,s,o,u);if(DE(c))return;o=c}if(__DEV__&&!u.overwrite){var l=Object.create(null);a.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)}));Object.keys(o).forEach((function(e){(function(e){return!0===l[W_(e)]})(e)&&!function(e){var t=i&&i.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var o=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},i=o(e);if(!i)return;var a=o(t);if(!a)return;if(DE(i))return;if(E_(i,a))return;if(Object.keys(i).every((function(e){return void 0!==r.getFieldValue(a,e)})))return;var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),c=W_(n),l="".concat(s,".").concat(c);if(jO.has(l))return;jO.add(l);var u=[];Y_(i)||Y_(a)||[i,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||u.includes(t)||u.push(t)}));__DEV__&&Ww.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(u.length?"either ensure all objects of type "+u.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(i).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(a).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}(s,o,e,u.store)}))}e.merge(r,o)})),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,o=e.selectionSet,i=e.context,a=e.mergeTree,s=this.cache.policies,c=Object.create(null),l=n&&s.rootTypenamesById[n]||VE(r,o,i.fragmentMap)||n&&i.store.get(n,"__typename");"string"==typeof l&&(c.__typename=l);var u=function(){var e=kO(arguments,c,i.variables);if(DE(e.from)){var t=i.incomingById.get(e.from.__ref);if(t){var n=s.readField(E(E({},e),{from:t.storeObject}),i);if(void 0!==n)return n}}return s.readField(e,i)},f=new Set;this.flattenFields(o,r,i,l).forEach((function(e,n){var o,i=qE(n),p=r[i];if(f.add(n),void 0!==p){var d=s.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),h=RO(a,d),m=t.processFieldValue(p,n,n.selectionSet?AO(e,!1,!1):e,h),g=void 0;n.selectionSet&&(DE(m)||Z_(m))&&(g=u("__typename",m));var v=s.getMergeFunction(l,n.name.value,g);v?h.info={field:n,typename:l,merge:v}:MO(a,d),c=e.merge(c,((o={})[d]=m,o))}else!__DEV__||e.clientOnly||e.deferred||fx.added(n)||s.getReadFunction(l,n.name.value)||__DEV__&&Ww.error("Missing field '".concat(qE(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))}));try{var p=s.identify(r,{typename:l,selectionSet:o,fragmentMap:i.fragmentMap,storeObject:c,readField:u}),d=p[0],h=p[1];n=n||d,h&&(c=i.merge(c,h))}catch(e){if(!n)throw e}if("string"==typeof n){var m=RE(n),g=i.written[n]||(i.written[n]=[]);if(g.indexOf(o)>=0)return m;if(g.push(o),this.reader&&this.reader.isFresh(r,m,o,i))return m;var v=i.incomingById.get(n);return v?(v.storeObject=i.merge(v.storeObject,c),v.mergeTree=DO(v.mergeTree,a),f.forEach((function(e){return v.fieldNodeSet.add(e)}))):i.incomingById.set(n,{storeObject:c,mergeTree:LO(a)?void 0:a,fieldNodeSet:f}),m}return c},e.prototype.processFieldValue=function(e,t,n,r){var o=this;return t.selectionSet&&null!==e?Y_(e)?e.map((function(e,i){var a=o.processFieldValue(e,t,n,RO(r,i));return MO(r,i),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?Tx(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=VE(t,e,n.fragmentMap));var o=new Map,i=this.cache.policies,a=new I_(!1);return function e(s,c){var l=a.lookup(s,c.clientOnly,c.deferred);l.visited||(l.visited=!0,s.selections.forEach((function(a){if(L_(a,n.variables)){var s=c.clientOnly,l=c.deferred;if(s&&l||!Ex(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=UE(e,n.variables);r&&!1===r.if||(l=!0)}})),$E(a)){var u=o.get(a);u&&(s=s&&u.clientOnly,l=l&&u.deferred),o.set(a,AO(n,s,l))}else{var f=PE(a,n.fragmentMap);f&&i.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,AO(n,s,l))}}})))}(e,n),o},e.prototype.applyMerges=function(e,t,n,r,o){var i,a=this;if(e.map.size&&!DE(n)){var s,c=Y_(n)||!DE(t)&&!Z_(t)?void 0:t,l=n;c&&!o&&(o=[DE(c)?c.__ref:c]);var u=function(e,t){return Y_(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=u(c,t),i=u(l,t);if(void 0!==i){o&&o.push(t);var f=a.applyMerges(e,n,i,r,o);f!==i&&(s=s||new Map).set(t,f),o&&Ww(o.pop()===t)}})),s&&(n=Y_(l)?l.slice(0):E({},l),s.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,o&&(i=r.store).getStorage.apply(i,o)):n},e}(),PO=[];function RO(e,t){var n=e.map;return n.has(t)||n.set(t,PO.pop()||{map:new Map}),n.get(t)}function DO(e,t){if(e===t||!t||LO(t))return e;if(!e||LO(e))return t;var n=e.info&&t.info?E(E({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,o={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var i=new Set(t.map.keys());e.map.forEach((function(e,n){o.map.set(n,DO(e,t.map.get(n))),i.delete(n)})),i.forEach((function(n){o.map.set(n,DO(t.map.get(n),e.map.get(n)))}))}return o}function LO(e){return!e||!(e.info||e.map.size)}function MO(e,t){var n=e.map,r=n.get(t);r&&LO(r)&&(PO.push(r),n.delete(t))}var jO=new Set;var FO=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=vS,n.txCount=0,n.config=function(e){return o_(H_,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new TO({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return w(t,e),t.prototype.init=function(){var e=this.data=new tO.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader;this.storeWriter=new IO(this,this.storeReader=new uO({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:G_(this.config),canon:e?void 0:n&&n.canon})),this.maybeBroadcastWatch=pS((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(cO(n)){var r=e.optimistic,o=e.rootId,i=e.variables;return n.makeCacheKey(e.query,e.callback,tx({optimistic:r,rootId:o,variables:i}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(E(E({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof KS)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if($_.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(E(E({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||function(e){mS(e).vars.forEach((function(t){return t.attachCache(e)}))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&gS(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){tx.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(DE(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&Ww.warn(e)}},t.prototype.evict=function(e){if(!e.id){if($_.call(e,"id"))return!1;e=E(E({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),tx.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),gS(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,o=e.optimistic,i=void 0===o||o,a=e.removeOptimistic,s=e.onWatchUpdated,c=function(e){var o=n,i=o.data,a=o.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=i,n.optimisticData=a}},l=new Set;return s&&!this.txCount&&this.broadcastWatches(E(E({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof i?this.optimisticData=this.optimisticData.addLayer(i,c):!1===i?c(this.data):c(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),s&&l.size?(this.broadcastWatches(E(E({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&l.delete(e),n}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=fx(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&E_(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(WS);const BO=new FO({typePolicies:{ExtensionRegistry:{merge:(e,t)=>t},Person:{merge:(e,t)=>t},Query:{fields:{node:{merge:!0}}}}}),UO=["viewerSettings","extensionRegistry","temporarySettings"],qO="ROOT_QUERY",VO=e=>{const t=JSON.parse(e);if(!t.ROOT_QUERY||0===Object.keys(t.ROOT_QUERY).length)return Promise.resolve(e);const n={[qO]:{__typename:t.ROOT_QUERY.__typename}};function r(e){if(e)if(Array.isArray(e))for(const t of e)r(t);else if(function(e){return Boolean(e.__ref)}(e)){const o=e.__ref;n[o]=t[o],r(t[o])}else if(e&&"object"==typeof e)for(const t of Object.values(e))r(t)}for(const e of UO){const o=t.ROOT_QUERY[e];o&&(Object.assign(n.ROOT_QUERY,{[e]:o}),r(o))}return Promise.resolve(JSON.stringify(n))};const $O=e=>"apollo-cache-persist-"+(e?"authenticated":"anonymous"),zO=Em()((async e=>{const{headers:t,baseUrl:n,isAuthenticated:r}=e,o=dr({baseUrl:n}),i=new VS({cache:BO,persistenceMapper:VO,maxSize:4194304,key:$O(r),storage:new GS(window.localStorage)});localStorage.removeItem($O(!r)),await i.restore();const a=new NS({uri:o,cache:BO,defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"},query:{fetchPolicy:"network-only"}},link:AS([new QS,h_({uri:({operationName:e})=>`${o}?${e}`,headers:t})])});return Promise.resolve(a)}));function HO(e,t){if(t&&!Ac)return function(){const e=e=>ee(Dc.requestGraphQL(e));return{getBrowserGraphQLClient:Em()((()=>{const t={watchQuery:({variables:t,query:n})=>e({request:Lw(n),variables:t,mightContainPrivateInfo:!1})};return Promise.resolve(t)})),requestGraphQL:e}}();return{getBrowserGraphQLClient:Em()((()=>zO({headers:{"X-Requested-With":`Sourcegraph - ${Fc()} v${Bc()}`},baseUrl:e,isAuthenticated:!1}))),requestGraphQL:({request:e,variables:n})=>jc(t).pipe(Ye(1),ze((t=>function({request:e,baseUrl:t,variables:n,...r}){return ar(dr({request:e,baseUrl:t}),{...r,method:"POST",body:JSON.stringify({query:e,variables:n}),selector:e=>ur(e).json()})}({request:e,variables:n,baseUrl:t,credentials:"include"}))))}}function GO(e,t,n){const r=t[t.length-1];for(const n of t.slice(0,-1))e=e[n];const o=e[r];return e[r]=n,o}function*QO(e,t=null,n=null,r=[],o=new WeakSet){if(yield{value:e,path:r,parent:n,key:t},!pn()(e)||o.has(e))return;o.add(e);const i=Object.keys(e);for(const t of i)yield*QO(e[t],t,e,[...r,t],o)}function WO(e){if(Pc)return function({assetsURL:e}){return new Promise((t=>{const n=document.createElement("iframe");n.setAttribute("src",new URL("extensionHostFrame.html",e).href),n.setAttribute("style","display: none;"),document.body.append(n);const r=new MessageChannel,o=new MessageChannel,i={proxy:r.port2,expose:o.port2},a={proxy:o.port1,expose:r.port1};n.addEventListener("load",(()=>{n.contentWindow.postMessage({type:"workerInit",payload:{endpoints:a,wrapEndpoints:!1}},new URL(e).origin,Object.values(a)),t({endpoints:i,subscription:new g((()=>n.remove()))})}),{once:!0})}))}(e);const t=jl(),n=new g,r=e=>{const r=browser.runtime.connect({name:`${e}-${t}`});n.add((()=>r.disconnect()));const o=function(e,t,n){const r=new g,o=new Map,i=new Map,a=e=>{if(!e.name.startsWith(t))return;const n=e.name.slice(t.length),r=i.get(n);r?(i.delete(n),r(e)):o.set(n,e)};browser.runtime.onConnect.addListener(a),r.add((()=>browser.runtime.onConnect.removeListener(a)));const s=(e,t)=>{const n=o.get(e);if(n)return o.delete(e),void t(n);i.set(e,t)},{port1:c,port2:l}=new MessageChannel;return function e(a,c){const l=new g((()=>{const e=a.name.slice(t.length);o.delete(e),i.delete(e),c.close(),a.disconnect()}));r.add(l);const u=r=>{const o=r.data,i=[];for(const{value:r,path:a,key:s,parent:c}of QO(o))if(r instanceof MessagePort){c[s]=null;const o=jl();e(n(t+o),r),i.push({path:a,id:o})}const s={message:o,portRefs:i};a.postMessage(s),5===o.type&&l.unsubscribe()};c.addEventListener("message",u),l.add((()=>c.removeEventListener("message",u)));const f=({message:t,portRefs:n})=>{const r=[];for(const o of n){const{port1:n,port2:i}=new MessageChannel;GO(t,o.path,n),r.push(n),s(o.id,(t=>e(t,i)))}c.postMessage(t,r),5===t.type&&l.unsubscribe()};a.onMessage.addListener(f),l.add((()=>a.onMessage.removeListener(f)));const p=l.unsubscribe.bind(l);a.onDisconnect.addListener(p),l.add((()=>a.onDisconnect.removeListener(p))),c.start()}(e,l),{messagePort:c,subscription:r}}(r,`comlink-${e}-`,(e=>browser.runtime.connect({name:e})));return n.add(o.subscription),o.messagePort};return Promise.resolve({endpoints:{proxy:r("proxy"),expose:r("expose")},subscription:n})}const KO=()=>Ic&&Lc();function ZO(){const{manifestURL:e,scriptURL:t}=function(e){return{manifestURL:browser.extension.getURL(`extensions/${e}/package.json`),scriptURL:browser.extension.getURL(`extensions/${e}/extension.js`)}}("template");return ee(fetch(e).then((e=>ur(e).json())).then((e=>[{id:"sourcegraph/template",manifest:e,scriptURL:t}])))}var YO=n(21635);const JO="sourcegraphClientSettings";const XO=(()=>{const e=Pc?function(e,t){const n=localStorage.getItem(e);return Ae(window,"storage").pipe(qe((t=>t.key===e)),H((e=>e.newValue)),ue(n),H((e=>null!=e?e:t)),Qe())}(JO,"{}"):Vc("sync","clientSettings"),t={__typename:"Client",id:"Client",displayName:"Client",viewerCanAdminister:!0};return e.pipe(H((e=>(0,oo.parse)(e||""))),H((e=>({subjects:[{subject:t,settings:e,lastID:null}],final:e||{}}))))})();const eT=fr`
180
+ `,variables:{subject:t,lastID:n,edit:r},mightContainPrivateInfo:!1})).pipe(H(pr),H((()=>{}))).toPromise()}({requestGraphQL:e},t,n,r)}class Aw extends B{constructor(e,t){super((e=>(e.next(this.value),Vc("local",this.key).subscribe(((n=t)=>{this.value=n,e.next(n)}))))),this.key=e,this.value=t}async next(e){await qc.local.set({[this.key]:e})}}var Iw={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Pw=Object.freeze({});function Rw(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Iw,r=void 0,o=Array.isArray(e),i=[e],a=-1,s=[],c=void 0,l=void 0,u=void 0,f=[],p=[],d=e;do{var h=++a===i.length,m=h&&0!==s.length;if(h){if(l=0===p.length?void 0:f[f.length-1],c=u,u=p.pop(),m){if(o)c=c.slice();else{for(var g={},v=0,b=Object.keys(c);v<b.length;v++){var y=b[v];g[y]=c[y]}c=g}for(var w=0,E=0;E<s.length;E++){var _=s[E][0],x=s[E][1];o&&(_-=w),o&&null===x?(c.splice(_,1),w++):c[_]=x}}a=r.index,i=r.keys,s=r.edits,o=r.inArray,r=r.prev}else{if(l=u?o?a:i[a]:void 0,null==(c=u?u[l]:d))continue;u&&f.push(l)}var S,O=void 0;if(!Array.isArray(c)){if(!Gm(c))throw new Error("Invalid AST Node: ".concat(Km(c),"."));var T=Dw(t,c.kind,h);if(T){if((O=T.call(t,c,l,u,f,p))===Pw)break;if(!1===O){if(!h){f.pop();continue}}else if(void 0!==O&&(s.push([l,O]),!h)){if(!Gm(O)){f.pop();continue}c=O}}}if(void 0===O&&m&&s.push([l,c]),h)f.pop();else r={inArray:o,index:a,keys:i,edits:s,prev:r},i=(o=Array.isArray(c))?c:null!==(S=n[c.kind])&&void 0!==S?S:[],a=-1,s=[],u&&p.push(u),u=c}while(void 0!==r);return 0!==s.length&&(d=s[s.length-1][1]),d}function Dw(e,t,n){var r=e[t];if(r){if(!n&&"function"==typeof r)return r;var o=n?r.leave:r.enter;if("function"==typeof o)return o}else{var i=n?e.leave:e.enter;if(i){if("function"==typeof i)return i;var a=i[t];if("function"==typeof a)return a}}}function Lw(e){return Rw(e,{leave:Mw})}var Mw={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return Fw(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=Uw("(",Fw(e.variableDefinitions,", "),")"),o=Fw(e.directives," "),i=e.selectionSet;return n||o||r||"query"!==t?Fw([t,Fw([n,r]),o,i]," "):i},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,o=e.directives;return t+": "+n+Uw(" = ",r)+Uw(" ",Fw(o," "))},SelectionSet:function(e){return Bw(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,o=e.directives,i=e.selectionSet,a=Uw("",t,": ")+n,s=a+Uw("(",Fw(r,", "),")");return s.length>80&&(s=a+Uw("(\n",qw(Fw(r,"\n")),"\n)")),Fw([s,Fw(o," "),i]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+Uw(" ",Fw(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return Fw(["...",Uw("on ",t),Fw(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,o=e.directives,i=e.selectionSet;return"fragment ".concat(t).concat(Uw("(",Fw(r,", "),")")," ")+"on ".concat(n," ").concat(Uw("",Fw(o," ")," "))+i},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),o=" "===e[0]||"\t"===e[0],i='"'===e[e.length-1],a="\\"===e[e.length-1],s=!r||i||a||n,c="";return!s||r&&o||(c+="\n"+t),c+=t?e.replace(/\n/g,"\n"+t):e,s&&(c+="\n"),'"""'+c.replace(/"""/g,'\\"""')+'"""'}(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+Fw(e.values,", ")+"]"},ObjectValue:function(e){return"{"+Fw(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+Uw("(",Fw(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:jw((function(e){var t=e.directives,n=e.operationTypes;return Fw(["schema",Fw(t," "),Bw(n)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:jw((function(e){return Fw(["scalar",e.name,Fw(e.directives," ")]," ")})),ObjectTypeDefinition:jw((function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Fw(["type",t,Uw("implements ",Fw(n," & ")),Fw(r," "),Bw(o)]," ")})),FieldDefinition:jw((function(e){var t=e.name,n=e.arguments,r=e.type,o=e.directives;return t+($w(n)?Uw("(\n",qw(Fw(n,"\n")),"\n)"):Uw("(",Fw(n,", "),")"))+": "+r+Uw(" ",Fw(o," "))})),InputValueDefinition:jw((function(e){var t=e.name,n=e.type,r=e.defaultValue,o=e.directives;return Fw([t+": "+n,Uw("= ",r),Fw(o," ")]," ")})),InterfaceTypeDefinition:jw((function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Fw(["interface",t,Uw("implements ",Fw(n," & ")),Fw(r," "),Bw(o)]," ")})),UnionTypeDefinition:jw((function(e){var t=e.name,n=e.directives,r=e.types;return Fw(["union",t,Fw(n," "),r&&0!==r.length?"= "+Fw(r," | "):""]," ")})),EnumTypeDefinition:jw((function(e){var t=e.name,n=e.directives,r=e.values;return Fw(["enum",t,Fw(n," "),Bw(r)]," ")})),EnumValueDefinition:jw((function(e){return Fw([e.name,Fw(e.directives," ")]," ")})),InputObjectTypeDefinition:jw((function(e){var t=e.name,n=e.directives,r=e.fields;return Fw(["input",t,Fw(n," "),Bw(r)]," ")})),DirectiveDefinition:jw((function(e){var t=e.name,n=e.arguments,r=e.repeatable,o=e.locations;return"directive @"+t+($w(n)?Uw("(\n",qw(Fw(n,"\n")),"\n)"):Uw("(",Fw(n,", "),")"))+(r?" repeatable":"")+" on "+Fw(o," | ")})),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return Fw(["extend schema",Fw(t," "),Bw(n)]," ")},ScalarTypeExtension:function(e){return Fw(["extend scalar",e.name,Fw(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Fw(["extend type",t,Uw("implements ",Fw(n," & ")),Fw(r," "),Bw(o)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Fw(["extend interface",t,Uw("implements ",Fw(n," & ")),Fw(r," "),Bw(o)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return Fw(["extend union",t,Fw(n," "),r&&0!==r.length?"= "+Fw(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return Fw(["extend enum",t,Fw(n," "),Bw(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return Fw(["extend input",t,Fw(n," "),Bw(r)]," ")}};function jw(e){return function(t){return Fw([t.description,e(t)],"\n")}}function Fw(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(n))&&void 0!==t?t:""}function Bw(e){return Uw("{\n",qw(Fw(e,"\n")),"\n}")}function Uw(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function qw(e){return Uw(" ",e.replace(/\n/g,"\n "))}function Vw(e){return-1!==e.indexOf("\n")}function $w(e){return null!=e&&e.some(Vw)}var zw="Invariant Violation",Hw=Object.setPrototypeOf,Gw=void 0===Hw?function(e,t){return e.__proto__=t,e}:Hw,Qw=function(e){function t(n){void 0===n&&(n=zw);var r=e.call(this,"number"==typeof n?zw+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=zw,Gw(r,t.prototype),r}return w(t,e),t}(Error);function Ww(e,t){if(!e)throw new Qw(t)}var Kw=["debug","log","warn","error","silent"],Zw=Kw.indexOf("log");function Yw(e){return function(){if(Kw.indexOf(e)>=Zw){var t=console[e]||console.log;return t.apply(console,arguments)}}}!function(e){e.debug=Yw("debug"),e.log=Yw("log"),e.warn=Yw("warn"),e.error=Yw("error")}(Ww||(Ww={}));function Jw(e){try{return e()}catch(e){}}const Xw=Jw((function(){return globalThis}))||Jw((function(){return window}))||Jw((function(){return self}))||Jw((function(){return global}))||Jw((function(){return Jw.constructor("return this")()}));var eE="__",tE=[eE,eE].join("DEV");const nE=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(Xw,tE,{value:"production"!==Jw((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),Xw[tE]}}();var rE=n(6591);function oE(e){try{return e()}catch(e){}}var iE=oE((function(){return globalThis}))||oE((function(){return window}))||oE((function(){return self}))||oE((function(){return n.g}))||oE((function(){return oE.constructor("return this")()})),aE=!1;function sE(){aE&&(delete iE.process,aE=!1)}function cE(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return lE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lE(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function lE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fE(e,t,n){return t&&uE(e.prototype,t),n&&uE(e,n),e}!iE||oE((function(){return"production"}))||oE((function(){return rE}))||(Object.defineProperty(iE,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),aE=!0),sE(),__DEV__?Ww("boolean"==typeof nE,nE):Ww("boolean"==typeof nE,36);var pE=function(){return"function"==typeof Symbol},dE=function(e){return pE()&&Boolean(Symbol[e])},hE=function(e){return dE(e)?Symbol[e]:"@@"+e};pE()&&!dE("observable")&&(Symbol.observable=Symbol("observable"));var mE=hE("iterator"),gE=hE("observable"),vE=hE("species");function bE(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function yE(e){var t=e.constructor;return void 0!==t&&null===(t=t[vE])&&(t=void 0),void 0!==t?t:kE}function wE(e){wE.log?wE.log(e):setTimeout((function(){throw e}))}function EE(e){Promise.resolve().then((function(){try{e()}catch(e){wE(e)}}))}function _E(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=bE(t,"unsubscribe");n&&n.call(t)}}catch(e){wE(e)}}function xE(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function SE(e,t,n){e._state="running";var r=e._observer;try{var o=bE(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(xE(e),!o)throw n;o.call(r,n);break;case"complete":xE(e),o&&o.call(r)}}catch(e){wE(e)}"closed"===e._state?_E(e):"running"===e._state&&(e._state="ready")}function OE(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void EE((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(SE(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void SE(e,t,n);e._queue.push({type:t,value:n})}}var TE=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new CE(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(xE(this),_E(this))},fE(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),CE=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){OE(this._subscription,"next",e)},t.error=function(e){OE(this._subscription,"error",e)},t.complete=function(){OE(this._subscription,"complete")},fE(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),kE=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new TE(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function i(){o.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(yE(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(yE(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=yE(this),r=arguments.length>1,o=!1,i=arguments[1],a=i;return new n((function(n){return t.subscribe({next:function(t){var i=!o;if(o=!0,!i||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=yE(this);return new o((function(t){var r,i=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){i===n.length?(r=void 0,t.complete()):e(o.from(n[i++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=yE(this);return new n((function(r){var o=[],i=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var i=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=o.indexOf(i);e>=0&&o.splice(e,1),a()}});o.push(i)},error:function(e){r.error(e)},complete:function(){a()}});function a(){i.closed&&0===o.length&&r.complete()}return function(){o.forEach((function(e){return e.unsubscribe()})),i.unsubscribe()}}))},t[gE]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=bE(t,gE);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return function(e){return e instanceof kE}(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(dE("iterator")&&(r=bE(t,mE)))return new n((function(e){EE((function(){if(!e.closed){for(var n,o=cE(r.call(t));!(n=o()).done;){var i=n.value;if(e.next(i),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){EE((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o((function(e){EE((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},fE(e,null,[{key:vE,get:function(){return this}}]),e}();function NE(e){return null!==e&&"object"==typeof e}function AE(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw __DEV__?new Qw("Found a ".concat(e.operation," operation").concat(e.name?" named '".concat(e.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new Qw(41);"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(__DEV__?Ww(1===r.length,"Found ".concat(r.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):Ww(1===r.length,42),n=r[0].name.value),E(E({},e),{definitions:k([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions)})}function IE(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function PE(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=t&&t[e.name.value];return __DEV__?Ww(n,"No fragment named ".concat(e.name.value,".")):Ww(n,43),n;default:return null}}function RE(e){return{__ref:String(e)}}function DE(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function LE(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var o={};n.fields.map((function(e){return LE(o,e.name,e.value,r)})),e[t.value]=o}else if(function(e){return"Variable"===e.kind}(n)){var i=(r||{})[n.name.value];e[t.value]=i}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return LE(n,t,e,r),n[t.value]}));else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw __DEV__?new Qw('The inline argument "'.concat(t.value,'" of kind "').concat(n.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new Qw(52);e[t.value]=null}}pE()&&Object.defineProperty(kE,Symbol("extensions"),{value:{symbol:gE,hostReportError:wE},configurable:!0});var ME=["connection","include","skip","client","rest","export"],jE=Object.assign((function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var o={};return r.forEach((function(e){o[e]=t[e]})),"".concat(n.connection.key,"(").concat(FE(o),")")}return n.connection.key}var i=e;if(t){var a=FE(t);i+="(".concat(a,")")}return n&&Object.keys(n).forEach((function(e){-1===ME.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?i+="@".concat(e,"(").concat(FE(n[e]),")"):i+="@".concat(e))})),i}),{setStringify:function(e){var t=FE;return FE=e,t}}),FE=function(e){return JSON.stringify(e,BE)};function BE(e,t){return NE(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{})),t}function UE(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,o=e.value;return LE(n,r,o,t)})),n}return null}function qE(e){return e.alias?e.alias.value:e.name.value}function VE(e,t,n){if("string"==typeof e.__typename)return e.__typename;for(var r=0,o=t.selections;r<o.length;r++){var i=o[r];if($E(i)){if("__typename"===i.name.value)return e[qE(i)]}else{var a=VE(e,PE(i,n).selectionSet,n);if("string"==typeof a)return a}}}function $E(e){return"Field"===e.kind}function zE(e){return"InlineFragment"===e.kind}function HE(e){__DEV__?Ww(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):Ww(e&&"Document"===e.kind,44);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new Qw('Schema type definitions not allowed in queries. Found: "'.concat(e.kind,'"')):new Qw(45);return e}));return __DEV__?Ww(t.length<=1,"Ambiguous GraphQL document: contains ".concat(t.length," operations")):Ww(t.length<=1,46),e}function GE(e){return HE(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function QE(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function WE(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function KE(e){var t=GE(e);return __DEV__?Ww(t&&"query"===t.operation,"Must contain a query definition."):Ww(t&&"query"===t.operation,47),t}function ZE(e){var t;HE(e);for(var n=0,r=e.definitions;n<r.length;n++){var o=r[n];if("OperationDefinition"===o.kind){var i=o.operation;if("query"===i||"mutation"===i||"subscription"===i)return o}"FragmentDefinition"!==o.kind||t||(t=o)}if(t)return t;throw __DEV__?new Qw("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new Qw(51)}function YE(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&LE(t,e.variable.name,e.defaultValue)})),t}function JE(e,t){return t?t(e):kE.of()}function XE(e){return"function"==typeof e?new n_(e):e}function e_(e){return e.request.length<=1}var t_=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return w(t,e),t}(Error),n_=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return kE.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(XE).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var o=XE(n),i=XE(r||new e(JE));return e_(o)&&e_(i)?new e((function(e){return t(e)?o.request(e)||kE.of():i.request(e)||kE.of()})):new e((function(e,n){return t(e)?o.request(e,n)||kE.of():i.request(e,n)||kE.of()}))},e.execute=function(e,t){return e.request(function(e,t){var n=E({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=E(E({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return E({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?QE(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(t.indexOf(o)<0)throw __DEV__?new Qw("illegal argument: ".concat(o)):new Qw(24)}return e}(t))))||kE.of()},e.concat=function(t,n){var r=XE(t);if(e_(r))return __DEV__&&Ww.warn(new t_("You are calling concat on a terminating link, which will have no effect",r)),r;var o=XE(n);return e_(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||kE.of()}))||kE.of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||kE.of()}))||kE.of()}))},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(JE)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new Qw("request is not implemented"):new Qw(19)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),r_=n_.execute;function o_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)}))})),n}var i_=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=__DEV__?new Qw("Network request failed. ".concat(t," is not serializable: ").concat(e.message)):new Qw(21);throw r.parseError=e,r}return n},a_=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r},s_=Object.prototype.hasOwnProperty;var c_={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},l_=function(e,t){return t(e)};function u_(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={},i={};n.forEach((function(e){o=E(E(E({},o),e.options),{headers:E(E({},o.headers),f_(e.headers))}),e.credentials&&(o.credentials=e.credentials),i=E(E({},i),e.http)}));var a=e.operationName,s=e.extensions,c=e.variables,l=e.query,u={operationName:a,variables:c};return i.includeExtensions&&(u.extensions=s),i.includeQuery&&(u.query=t(l,Lw)),{options:o,body:u}}function f_(e){if(e){var t=Object.create(null);return Object.keys(Object(e)).forEach((function(n){t[n.toLowerCase()]=e[n]})),t}return e}function p_(e){return new kE((function(t){t.error(e)}))}var d_=Jw((function(){return fetch})),h_=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,o=e.print,i=void 0===o?l_:o,a=e.includeExtensions,s=e.useGETForQueries,c=e.includeUnusedVariables,l=void 0!==c&&c,u=_(e,["uri","fetch","print","includeExtensions","useGETForQueries","includeUnusedVariables"]);__DEV__&&function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new Qw("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new Qw(20)}(r||d_);var f={http:{includeExtensions:a},options:u.fetchOptions,credentials:u.credentials,headers:u.headers};return new n_((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,n),o=e.getContext(),a={};if(o.clientAwareness){var c=o.clientAwareness,u=c.name,p=c.version;u&&(a["apollographql-client-name"]=u),p&&(a["apollographql-client-version"]=p)}var d,h=E(E({},a),o.headers),m={http:o.http,options:o.fetchOptions,credentials:o.credentials,headers:h},g=u_(e,i,c_,f,m),v=g.options,b=g.body;if(b.variables&&!l){var y=new Set(Object.keys(b.variables));Rw(e.query,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&y.delete(e.name.value)}}),y.size&&(b.variables=E({},b.variables),y.forEach((function(e){delete b.variables[e]})))}if(!v.signal){var w=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),_=w.controller,x=w.signal;(d=_)&&(v.signal=x)}if(s&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(v.method="GET"),"GET"===v.method){var S=function(e,t){var n=[],r=function(e,t){n.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var o=void 0;try{o=i_(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",o)}if(t.extensions){var i=void 0;try{i=i_(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",i)}var a="",s=e,c=e.indexOf("#");-1!==c&&(a=e.substr(c),s=e.substr(0,c));var l=-1===s.indexOf("?")?"?":"&";return{newURI:s+l+n.join("&")+a}}(t,b),O=S.newURI,T=S.parseError;if(T)return p_(T);t=O}else try{v.body=i_(b,"Payload")}catch(T){return p_(T)}return new kE((function(n){var o;return(r||Jw((function(){return fetch}))||d_)(t,v).then((function(t){return e.setContext({response:t}),t})).then((o=e,function(e){return e.text().then((function(t){try{return JSON.parse(t)}catch(r){var n=r;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}})).then((function(t){return e.status>=300&&a_(e,t,"Response not successful: Received status code ".concat(e.status)),Array.isArray(t)||s_.call(t,"data")||s_.call(t,"errors")||a_(e,t,"Server response was missing for query '".concat(Array.isArray(o)?o.map((function(e){return e.operationName})):o.operationName,"'.")),t}))})).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){d&&d.abort()}}))}))},m_=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,h_(t).request)||this;return n.options=t,n}return w(t,e),t}(n_),g_=Object.prototype,v_=g_.toString,b_=g_.hasOwnProperty,y_=Function.prototype.toString,w_=new Map;function E_(e,t){try{return __(e,t)}finally{w_.clear()}}function __(e,t){if(e===t)return!0;var n,r,o,i=v_.call(e);if(i!==v_.call(t))return!1;switch(i){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(T_(e,t))return!0;var a=x_(e),s=x_(t),c=a.length;if(c!==s.length)return!1;for(var l=0;l<c;++l)if(!b_.call(t,a[l]))return!1;for(l=0;l<c;++l){var u=a[l];if(!__(e[u],t[u]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(T_(e,t))return!0;for(var f=e.entries(),p="[object Map]"===i;;){var d=f.next();if(d.done)break;var h=d.value,m=h[0],g=h[1];if(!t.has(m))return!1;if(p&&!__(g,t.get(m)))return!1}return!0;case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":var v=e.byteLength;if(v===t.byteLength)for(;v--&&e[v]===t[v];);return-1===v;case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":var b=y_.call(e);return b===y_.call(t)&&(r=O_,!((o=(n=b).length-r.length)>=0&&n.indexOf(r,o)===o))}return!1}function x_(e){return Object.keys(e).filter(S_,e)}function S_(e){return void 0!==this[e]}var O_="{ [native code] }";function T_(e,t){var n=w_.get(e);if(n){if(n.has(t))return!0}else w_.set(e,n=new Set);return n.add(t),!1}var C_=function(){return Object.create(null)},k_=Array.prototype,N_=k_.forEach,A_=k_.slice,I_=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=C_),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return N_.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(A_.call(e)))},e.prototype.getChildTrie=function(t){var n=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r},e}();var P_="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),R_="function"==typeof WeakSet,D_="function"==typeof Symbol&&"function"==typeof Symbol.for;function L_(e,t){var n=e.directives;return!n||!n.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments,r=e.name.value;__DEV__?Ww(n&&1===n.length,"Incorrect number of arguments for the @".concat(r," directive.")):Ww(n&&1===n.length,38);var o=n[0];__DEV__?Ww(o.name&&"if"===o.name.value,"Invalid argument for the @".concat(r," directive.")):Ww(o.name&&"if"===o.name.value,39);var i=o.value;__DEV__?Ww(i&&("Variable"===i.kind||"BooleanValue"===i.kind),"Argument for the @".concat(r," directive must be a variable or a boolean value.")):Ww(i&&("Variable"===i.kind||"BooleanValue"===i.kind),40),t.push({directive:e,ifArgument:o})}}));return t}(n).every((function(e){var n=e.directive,r=e.ifArgument,o=!1;return"Variable"===r.value.kind?(o=t&&t[r.value.name.value],__DEV__?Ww(void 0!==o,"Invalid variable referenced in @".concat(n.name.value," directive.")):Ww(void 0!==o,37)):o=r.value.value,"skip"===n.name.value?!o:o}))}function M_(e,t){return function(e){var t=[];return Rw(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function j_(e){return e&&M_(["client"],e)&&M_(["export"],e)}var F_=Object.prototype.hasOwnProperty;function B_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return U_(e)}function U_(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new V_,o=1;o<n;++o)t=r.merge(t,e[o]);return t}var q_=function(e,t,n){return this.merge(e[n],t[n])},V_=function(){function e(e){void 0===e&&(e=q_),this.reconciler=e,this.isObject=NE,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var n=this,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];return NE(t)&&NE(e)?(Object.keys(t).forEach((function(o){if(F_.call(e,o)){var i=e[o];if(t[o]!==i){var a=n.reconciler.apply(n,k([e,t,o],r));a!==i&&((e=n.shallowCopyForMerge(e))[o]=a)}}else(e=n.shallowCopyForMerge(e))[o]=t[o]})),e):t},e.prototype.shallowCopyForMerge=function(e){if(NE(e)){if(this.pastCopies.has(e)){if(!Object.isFrozen(e))return e;this.pastCopies.delete(e)}e=Array.isArray(e)?e.slice(0):E({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e)}return e},e}(),$_=Object.prototype.hasOwnProperty;function z_(e,t){var n=e.__typename,r=e.id,o=e._id;if("string"==typeof n&&(t&&(t.keyObject=void 0!==r?{id:r}:void 0!==o?{_id:o}:void 0),void 0===r&&(r=o),void 0!==r))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var H_={dataIdFromObject:z_,addTypename:!0,resultCaching:!0,canonizeResults:!1};function G_(e){var t=e.canonizeResults;return void 0===t?H_.canonizeResults:t}var Q_=/^[_a-z][_0-9a-z]*/i;function W_(e){var t=e.match(Q_);return t?t[0]:e}function K_(e,t,n){return!!NE(t)&&(Y_(t)?t.every((function(t){return K_(e,t,n)})):e.selections.every((function(e){if($E(e)&&L_(e,n)){var r=qE(e);return $_.call(t,r)&&(!e.selectionSet||K_(e.selectionSet,t[r],n))}return!0})))}function Z_(e){return NE(e)&&!DE(e)&&!Y_(e)}var Y_=function(e){return Array.isArray(e)};var J_,X_,ex=function(){function e(){this.known=new(R_?WeakSet:Set),this.pool=new I_(P_),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return NE(e)&&this.known.has(e)},e.prototype.pass=function(e){if(NE(e)){var t=function(e){return NE(e)?Y_(e)?e.slice(0):E({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(NE(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this);return(s=this.pool.lookupArray(r)).array||(this.known.add(s.array=r),__DEV__&&Object.freeze(r)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var o=Object.getPrototypeOf(e),i=[o],a=this.sortedKeys(e);i.push(a.json);var s,c=i.length;if(a.sorted.forEach((function(n){i.push(t.admit(e[n]))})),!(s=this.pool.lookupArray(i)).object){var l=s.object=Object.create(o);this.known.add(l),a.sorted.forEach((function(e,t){l[e]=i[c+t]})),__DEV__&&Object.freeze(l)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}(),tx=Object.assign((function(e){if(NE(e)){void 0===J_&&nx();var t=J_.admit(e),n=X_.get(t);return void 0===n&&X_.set(t,n=JSON.stringify(t)),n}return JSON.stringify(e)}),{reset:nx});function nx(){J_=new ex,X_=new(P_?WeakMap:Map)}function rx(e,t,n){return new kE((function(r){var o=r.next,i=r.error,a=r.complete,s=0,c=!1,l={then:function(e){return new Promise((function(t){return t(e())}))}};function u(e,t){return e?function(t){++s;var n=function(){return e(t)};l=l.then(n,n).then((function(e){--s,o&&o.call(r,e),c&&f.complete()}),(function(e){throw--s,e})).catch((function(e){i&&i.call(r,e)}))}:function(e){return t&&t.call(r,e)}}var f={next:u(t,o),error:u(n,i),complete:function(){c=!0,s||a&&a.call(r)}},p=e.subscribe(f);return function(){return p.unsubscribe()}}))}function ox(e){return e.errors&&e.errors.length>0||!1}function ix(e,t,n){var r=0;return e.forEach((function(n,o){t.call(this,n,o,e)&&(e[r++]=n)}),n),e.length=r,e}var ax={kind:"Field",name:{kind:"Name",value:"__typename"}};function sx(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&sx(t[e.name.value],t)}))}function cx(e){return sx(GE(e)||function(e){__DEV__?Ww("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):Ww("Document"===e.kind,48),__DEV__?Ww(e.definitions.length<=1,"Fragment must have exactly one definition."):Ww(e.definitions.length<=1,49);var t=e.definitions[0];return __DEV__?Ww("FragmentDefinition"===t.kind,"Must be a fragment definition."):Ww("FragmentDefinition"===t.kind,50),t}(e),IE(WE(e)))?null:e}function lx(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function ux(e,t){var n=Object.create(null),r=[],o=Object.create(null),i=[],a=cx(Rw(t,{Variable:{enter:function(e,t,r){"VariableDefinition"!==r.kind&&(n[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&(e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(lx(e))))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&r.push({name:e.value.name.value})})),t.selectionSet&&dx(t.selectionSet).forEach((function(e){i.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){o[e.name.value]=!0}},Directive:{enter:function(t){if(lx(e)(t))return null}}}));return a&&ix(r,(function(e){return!!e.name&&!n[e.name]})).length&&(a=function(e,t){var n=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return cx(Rw(t,{OperationDefinition:{enter:function(t){return E(E({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var r=0;if(t.arguments&&t.arguments.forEach((function(e){n(e)&&(r+=1)})),1===r)return null}}},Argument:{enter:function(e){if(n(e))return null}}}))}(r,a)),a&&ix(i,(function(e){return!!e.name&&!o[e.name]})).length&&(a=function(e,t){function n(t){if(e.some((function(e){return e.name===t.name.value})))return null}return cx(Rw(t,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}(i,a)),a}var fx=Object.assign((function(e){return Rw(HE(e),{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var r=e.selections;if(r)if(!r.some((function(e){return $E(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var o=n;if(!($E(o)&&o.directives&&o.directives.some((function(e){return"export"===e.name.value}))))return E(E({},e),{selections:k(k([],r),[ax])})}}}}})}),{added:function(e){return e===ax}}),px={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&Ww.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function dx(e){var t=[];return e.selections.forEach((function(e){($E(e)||zE(e))&&e.selectionSet?dx(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function hx(e){return"query"===ZE(e).operation?e:Rw(e,{OperationDefinition:{enter:function(e){return E(E({},e),{operation:"query"})}}})}var mx=new Map;function gx(e){var t=mx.get(e)||1;return mx.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function vx(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function bx(e){function t(t){Object.defineProperty(e,t,{value:kE})}return D_&&Symbol.species&&t(Symbol.species),t("@@species"),e}function yx(e){return e&&"function"==typeof e.then}var wx=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.addCount=0,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],vx(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),vx(n.observers,"error",e))},complete:function(){if(null!==n.sub){var e=n.sources.shift();e?yx(e)?e.then((function(e){return n.sub=e.subscribe(n.handlers)})):n.sub=e.subscribe(n.handlers):(n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),vx(n.observers,"complete"))}}},n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.complete()},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new kE(t)]),yx(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return w(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e),++this.addCount)},t.prototype.removeObserver=function(e,t){this.observers.delete(e)&&--this.addCount<1&&!t&&this.handlers.error(new Error("Observable cancelled prematurely"))},t.prototype.cleanup=function(e){var t=this,n=!1,r=function(){n||(n=!0,t.observers.delete(o),e())},o={next:r,error:r,complete:r},i=this.addCount;this.addObserver(o),this.addCount=i},t}(kE);function Ex(e){return Array.isArray(e)&&e.length>0}bx(wx);var _x,xx=function(e){function t(n){var r,o,i=n.graphQLErrors,a=n.clientErrors,s=n.networkError,c=n.errorMessage,l=n.extraInfo,u=e.call(this,c)||this;return u.graphQLErrors=i||[],u.clientErrors=a||[],u.networkError=s||null,u.message=c||(o="",(Ex((r=u).graphQLErrors)||Ex(r.clientErrors))&&(r.graphQLErrors||[]).concat(r.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";o+="".concat(t,"\n")})),r.networkError&&(o+="".concat(r.networkError.message,"\n")),o=o.replace(/\n$/,"")),u.extraInfo=l,u.__proto__=t.prototype,u}return w(t,e),t}(Error);function Sx(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(_x||(_x={}));var Ox=Object.prototype.toString;function Tx(e){return Cx(e)}function Cx(e,t){switch(Ox.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=Cx(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=Cx(e[n],t)})),r;default:return e}}var kx=Object.assign,Nx=Object.hasOwnProperty,Ax=!1,Ix=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,o=t.options,i=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Px)}catch(e){}var n=!i.observers.size;i.observers.add(e);var r=i.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&i.reobserve().catch((function(){})),function(){i.observers.delete(e)&&!i.observers.size&&i.tearDownQuery()}}))||this;i.observers=new Set,i.subscriptions=new Set,i.isTornDown=!1,i.options=o,i.queryId=r.queryId||n.generateQueryId();var a=GE(o.query);return i.queryName=a&&a.name&&a.name.value,i.initialFetchPolicy=o.fetchPolicy||"cache-first",i.queryManager=n,i.queryInfo=r,i}return w(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){o.unsubscribe()}),0)},error:n},o=e.subscribe(r)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||_x.ready,r=E(E({},t),{loading:Sx(n),networkStatus:n}),o=this.options.fetchPolicy,i=void 0===o?"cache-first":o;if("network-only"===i||"no-cache"===i||"standby"===i||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var a=this.queryInfo.getDiff();(a.complete||this.options.returnPartialData)&&(r.data=a.result),E_(r.data,{})&&(r.data=void 0),a.complete?(delete r.partial,!a.complete||r.networkStatus!==_x.loading||"cache-first"!==i&&"cache-only"!==i||(r.networkStatus=_x.ready,r.loading=!1)):r.partial=!0,!__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||Rx(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e){return!this.last||!E_(this.last.result,e)},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||E_(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if(n.fetchPolicy="cache-and-network"===r?r:"no-cache"===r?"no-cache":"network-only",__DEV__&&e&&Nx.call(e,"variables")){var o=KE(this.options.query),i=o.variableDefinitions;i&&i.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&Ww.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=o.name)||void 0===t?void 0:t.value)||JSON.stringify(o),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!E_(this.options.variables,e)&&(n.variables=this.options.variables=E(E({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,_x.refetch)},t.prototype.fetchMore=function(e){var t=this,n=E(E({},e.query?e:E(E(E({},this.options),e),{variables:E(E({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),r=this.queryManager.generateQueryId();return n.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=_x.fetchMore,this.observe()),this.queryManager.fetchQuery(r,n,_x.fetchMore).then((function(r){var o=r.data,i=e.updateQuery;return i?(__DEV__&&!Ax&&(__DEV__&&Ww.warn("The updateQuery callback for fetchMore is deprecated, and will be removed\nin the next major version of Apollo Client.\n\nPlease convert updateQuery functions to field policies with appropriate\nread and merge functions, or use/adapt a helper function (such as\nconcatPagination, offsetLimitPagination, or relayStylePagination) from\n@apollo/client/utilities.\n\nThe field policy system handles pagination more effectively than a\nhand-written updateQuery function, and you only need to define the policy\nonce, rather than every time you call fetchMore."),Ax=!0),t.updateQuery((function(e){return i(e,{fetchMoreResult:o,variables:n.variables})}))):t.queryManager.cache.writeQuery({query:n.query,variables:n.variables,data:o}),r})).finally((function(){t.queryManager.stopQuery(r),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var o=t.variables;return r(e,{subscriptionData:n,variables:o})}))},error:function(t){e.onError?e.onError(t):__DEV__&&Ww.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return E_(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.initialFetchPolicy,variables:e},_x.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n){if(!t||t.interval!==n){__DEV__?Ww(n,"Attempted to start a polling query without a polling interval."):Ww(n,10),(t||(this.pollingInfo={})).interval=n;var r=function(){e.pollingInfo&&(Sx(e.queryInfo.networkStatus)?o():e.reobserve({fetchPolicy:"network-only"},_x.poll).then(o,o))},o=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};o()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=E(E({},this.last),{result:this.queryManager.assumeImmutableResults?e:Tx(e),variables:t}),Ex(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var n=this;this.isTornDown=!1;var r=t===_x.refetch||t===_x.fetchMore||t===_x.poll,o=this.options.variables,i=r?o_(this.options,e):kx(this.options,o_(e));r||(this.updatePolling(),e&&e.variables&&!e.fetchPolicy&&!E_(e.variables,o)&&(i.fetchPolicy=this.initialFetchPolicy,void 0===t&&(t=_x.setVariables)));var a=i.variables&&E({},i.variables),s=this.fetch(i,t),c={next:function(e){n.reportResult(e,a)},error:function(e){n.reportError(e,a)}};return r||(this.concast&&this.observer&&this.concast.removeObserver(this.observer,!0),this.concast=s,this.observer=c),s.addObserver(c),s.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError();(n||this.isDifferentFromLastResult(e))&&((n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),vx(this.observers,"next",e))},t.prototype.reportError=function(e,t){var n=E(E({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:_x.error,loading:!1});this.updateLastResult(n,t),vx(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(kE);function Px(e){__DEV__&&Ww.error("Unhandled error",e.message,e.stack)}function Rx(e){__DEV__&&e&&__DEV__&&Ww.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}bx(Ix);var Dx=null,Lx={},Mx=1,jx="@wry/context:Slot",Fx=Array,Bx=Fx[jx]||function(){var e=function(){function e(){this.id=["slot",Mx++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=Dx;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Lx)break;return e!==Dx&&(Dx.slots[this.id]=t),!0}return Dx&&(Dx.slots[this.id]=Lx),!1},e.prototype.getValue=function(){if(this.hasValue())return Dx.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var o,i=((o={__proto__:null})[this.id]=e,o),a=Dx;Dx={parent:a,slots:i};try{return t.apply(r,n)}finally{Dx=a}},e.bind=function(e){var t=Dx;return function(){var n=Dx;try{return Dx=t,e.apply(this,arguments)}finally{Dx=n}}},e.noContext=function(e,t,n){if(!Dx)return e.apply(n,t);var r=Dx;try{return Dx=null,e.apply(n,t)}finally{Dx=r}},e}();try{Object.defineProperty(Fx,jx,{value:Fx[jx]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();Bx.bind,Bx.noContext;function Ux(){}var qx,Vx=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=Ux),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),$x=new Bx,zx=Object.prototype.hasOwnProperty,Hx=void 0===(qx=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:qx;function Gx(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Qx=[];function Wx(e,t){if(!e)throw new Error(t||"assertion failure")}function Kx(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Zx=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!Xx(this))return Yx(this),this.value[0]},e.prototype.recompute=function(e){return Wx(!this.recomputing,"already recomputing"),Yx(this),Xx(this)?function(e,t){aS(e),$x.withValue(e,Jx,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{Gx(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,Xx(e))return;tS(e)}(e);return Kx(e.value)}(this,e):Kx(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,eS(this),Gx(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),aS(this),nS(this,(function(t,n){t.setDirty(),sS(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Qx.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(Hx(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Qx.push(this.deps),this.deps=null)},e.count=0,e}();function Yx(e){var t=$x.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Xx(e)?rS(t,e):oS(t,e),t}function Jx(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function Xx(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function eS(e){nS(e,rS)}function tS(e){nS(e,oS)}function nS(e,t){var n=e.parents.size;if(n)for(var r=Hx(e.parents),o=0;o<n;++o)t(r[o],e)}function rS(e,t){Wx(e.childValues.has(t)),Wx(Xx(t));var n=!Xx(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=Qx.pop()||new Set;e.dirtyChildren.add(t),n&&eS(e)}function oS(e,t){Wx(e.childValues.has(t)),Wx(!Xx(t));var n,r,o,i=e.childValues.get(t);0===i.length?e.childValues.set(t,t.value.slice(0)):(n=i,r=t.value,(o=n.length)>0&&o===r.length&&n[o-1]===r[o-1]||e.setDirty()),iS(e,t),Xx(e)||tS(e)}function iS(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(Qx.length<100&&Qx.push(n),e.dirtyChildren=null))}function aS(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){sS(e,n)})),e.forgetDeps(),Wx(null===e.dirtyChildren)}function sS(e,t){t.parents.delete(e),e.childValues.delete(t),iS(e,t)}var cS={setDirty:!0,dispose:!0,forget:!0};function lS(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=$x.getValue();if(r){var o=t.get(e);o||t.set(e,o=new Set),r.dependOn(o),"function"==typeof n&&(Gx(o),o.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var o=n&&zx.call(cS,n)?n:"setDirty";Hx(r).forEach((function(e){return e[o]()})),t.delete(e),Gx(r)}},r}function uS(){var e=new I_("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}uS();var fS=new Set;function pS(e,t){void 0===t&&(t=Object.create(null));var n=new Vx(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=t.keyArgs,o=t.makeCacheKey||uS(),i=function(){var i=o.apply(null,r?r.apply(null,arguments):arguments);if(void 0===i)return e.apply(null,arguments);var a=n.get(i);a||(n.set(i,a=new Zx(e)),a.subscribe=t.subscribe,a.forget=function(){return n.delete(i)});var s=a.recompute(Array.prototype.slice.call(arguments));return n.set(i,a),fS.add(n),$x.hasValue()||(fS.forEach((function(e){return e.clean()})),fS.clear()),s};function a(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function c(e){return n.delete(e)}return Object.defineProperty(i,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),i.dirtyKey=a,i.dirty=function(){a(o.apply(null,arguments))},i.peekKey=s,i.peek=function(){return s(o.apply(null,arguments))},i.forgetKey=c,i.forget=function(){return c(o.apply(null,arguments))},i.makeCacheKey=o,i.getKey=r?function(){return o.apply(null,r.apply(null,arguments))}:o,Object.freeze(i)}var dS=new Bx,hS=new WeakMap;function mS(e){var t=hS.get(e);return t||hS.set(e,t={vars:new Set,dep:lS()}),t}function gS(e){mS(e).vars.forEach((function(t){return t.forgetCache(e)}))}function vS(e){var t=new Set,n=new Set,r=function(i){if(arguments.length>0){if(e!==i){e=i,t.forEach((function(e){mS(e).dep.dirty(r),bS(e)}));var a=Array.from(n);n.clear(),a.forEach((function(t){return t(e)}))}}else{var s=dS.getValue();s&&(o(s),mS(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var o=r.attachCache=function(e){return t.add(e),mS(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function bS(e){e.broadcastWatches&&e.broadcastWatches()}var yS=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,o=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),o&&this.setFragmentMatcher(o)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=B_(t.resolvers,e)})):this.resolvers=B_(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,o=e.variables,i=e.onlyRunForcedResolvers,a=void 0!==i&&i;return x(this,void 0,void 0,(function(){return S(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,o,this.fragmentMatcher,a).then((function(e){return E(E({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return M_(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){HE(e);var t=ux([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=Rw(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return $E(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return E(E({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),x(this,void 0,void 0,(function(){return S(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return E(E({},t),e.exportedVariables)}))]:[2,E({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Rw(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Pw}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:hx(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,o,i){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o=function(){return!0}),void 0===i&&(i=!1),x(this,void 0,void 0,(function(){var a,s,c,l,u,f,p,d,h;return S(this,(function(m){return a=ZE(e),s=WE(e),c=IE(s),l=a.operation,u=l?l.charAt(0).toUpperCase()+l.slice(1):"Query",p=(f=this).cache,d=f.client,h={fragmentMap:c,context:E(E({},n),{cache:p,client:d}),variables:r,fragmentMatcher:o,defaultOperationType:u,exportedVariables:{},onlyRunForcedResolvers:i},[2,this.resolveSelectionSet(a.selectionSet,t,h).then((function(e){return{result:e,exportedVariables:h.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return x(this,void 0,void 0,(function(){var r,o,i,a,s,c=this;return S(this,(function(l){return r=n.fragmentMap,o=n.context,i=n.variables,a=[t],s=function(e){return x(c,void 0,void 0,(function(){var s,c;return S(this,(function(l){return L_(e,i)?$E(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&a.push(((n={})[qE(e)]=t,n))}))]:(zE(e)?s=e:(s=r[e.name.value],__DEV__?Ww(s,"No fragment named ".concat(e.name.value)):Ww(s,9)),s&&s.typeCondition&&(c=s.typeCondition.name.value,n.fragmentMatcher(t,c,o))?[2,this.resolveSelectionSet(s.selectionSet,t,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return U_(a)}))]}))}))},e.prototype.resolveField=function(e,t,n){return x(this,void 0,void 0,(function(){var r,o,i,a,s,c,l,u,f,p=this;return S(this,(function(d){return r=n.variables,o=e.name.value,i=qE(e),a=o!==i,s=t[i]||t[o],c=Promise.resolve(s),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(l=t.__typename||n.defaultOperationType,(u=this.resolvers&&this.resolvers[l])&&(f=u[a?o:i])&&(c=Promise.resolve(dS.withValue(this.cache,f,[t,UE(e,r),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,c.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?p.resolveSubSelectedArray(e,t,n):e.selectionSet?p.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}(),wS=new(P_?WeakMap:Map);function ES(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return wS.set(e,(wS.get(e)+1)%1e15),n.apply(this,arguments)})}function _S(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var xS=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;wS.has(n)||(wS.set(n,0),ES(n,"evict"),ES(n,"modify"),ES(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||_x.loading;return this.variables&&this.networkStatus!==_x.loading&&!E_(this.variables,e.variables)&&(t=_x.setVariables),E_(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){_S(this),this.lastDiff=void 0,this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&E_(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||E_(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},e.prototype.notify=function(){var e=this;_S(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Sx(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=E(E({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&E_(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===wS.get(this.cache)&&E_(t,n.variables)&&E_(e.data,n.result.data))},e.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Ex(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(t.variables)):0!==n&&(SS(e,t.errorPolicy)?this.cache.performTransaction((function(o){if(r.shouldWrite(e,t.variables))o.writeQuery({query:r.document,data:e.data,variables:t.variables,overwrite:1===n}),r.lastWrite={result:e,variables:t.variables,dmCount:wS.get(r.cache)};else if(r.lastDiff&&r.lastDiff.diff.complete)return void(e.data=r.lastDiff.diff.result);var i=r.getDiffOptions(t.variables),a=o.diff(i);r.stopped||r.updateWatch(t.variables),r.updateLastDiff(a,i),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=_x.ready},e.prototype.markError=function(e){return this.networkStatus=_x.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function SS(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!ox(e);return!r&&n&&e.data&&(r=!0),r}var OS=Object.prototype.hasOwnProperty,TS=function(){function e(e){var t=e.cache,n=e.link,r=e.queryDeduplication,o=void 0!==r&&r,i=e.onBroadcast,a=e.ssrMode,s=void 0!==a&&a,c=e.clientAwareness,l=void 0===c?{}:c,u=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(P_?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.queryDeduplication=o,this.clientAwareness=l,this.localState=u||new yS({cache:t}),this.ssrMode=s,this.assumeImmutableResults=!!f,(this.onBroadcast=i)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(__DEV__?new Qw("QueryManager stopped while query was in flight"):new Qw(11))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,r=e.optimisticResponse,o=e.updateQueries,i=e.refetchQueries,a=void 0===i?[]:i,s=e.awaitRefetchQueries,c=void 0!==s&&s,l=e.update,u=e.onQueryUpdated,f=e.errorPolicy,p=void 0===f?"none":f,d=e.fetchPolicy,h=void 0===d?"network-only":d,m=e.keepRootFields,g=e.context;return x(this,void 0,void 0,(function(){var e,i,s;return S(this,(function(f){switch(f.label){case 0:return __DEV__?Ww(t,"mutation option is required. You must specify your GraphQL document in the mutation option."):Ww(t,12),__DEV__?Ww("network-only"===h||"no-cache"===h,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):Ww("network-only"===h||"no-cache"===h,13),e=this.generateMutationId(),t=this.transform(t).document,n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,g)]:[3,2];case 1:n=f.sent(),f.label=2;case 2:return i=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:n,loading:!0,error:null}),r&&this.markMutationOptimistic(r,{mutationId:e,document:t,variables:n,fetchPolicy:h,errorPolicy:p,context:g,updateQueries:o,update:l,keepRootFields:m}),this.broadcastQueries(),s=this,[2,new Promise((function(f,d){return rx(s.getObservableFromLink(t,E(E({},g),{optimisticResponse:r}),n,!1),(function(f){if(ox(f)&&"none"===p)throw new xx({graphQLErrors:f.errors});i&&(i.loading=!1,i.error=null);var d=E({},f);return"function"==typeof a&&(a=a(d)),"ignore"===p&&ox(d)&&delete d.errors,s.markMutationResult({mutationId:e,result:d,document:t,variables:n,fetchPolicy:h,errorPolicy:p,context:g,update:l,updateQueries:o,awaitRefetchQueries:c,refetchQueries:a,removeOptimistic:r?e:void 0,onQueryUpdated:u,keepRootFields:m})})).subscribe({next:function(e){s.broadcastQueries(),f(e)},error:function(t){i&&(i.loading=!1,i.error=t),r&&s.cache.removeOptimistic(e),s.broadcastQueries(),d(t instanceof xx?t:new xx({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,o=[],i="no-cache"===e.fetchPolicy;if(!i&&SS(r,e.errorPolicy)){o.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var a=e.updateQueries;a&&this.queries.forEach((function(e,i){var s=e.observableQuery,c=s&&s.queryName;if(c&&OS.call(a,c)){var l=a[c],u=n.queries.get(i),f=u.document,p=u.variables,d=t.diff({query:f,variables:p,returnPartialData:!0,optimistic:!1}),h=d.result;if(d.complete&&h){var m=l(h,{mutationResult:r,queryName:f&&QE(f)||void 0,queryVariables:p});m&&o.push({result:m,dataId:"ROOT_QUERY",query:f,variables:p})}}}))}if(o.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var s=[];if(this.refetchQueries({updateCache:function(t){i||o.forEach((function(e){return t.write(e)}));var a=e.update;if(a){if(!i){var s=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});s.complete&&(r=E(E({},r),{data:s.result}))}a(t,r,{context:e.context,variables:e.variables})}i||e.keepRootFields||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return s.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(s).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(E(E({},t),{result:{data:r}}),e)}catch(e){__DEV__&&Ww.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t,n=this.transformCache;if(!n.has(e)){var r=this.cache.transformDocument(e),o=(t=this.cache.transformForLink(r),ux([px],HE(t))),i=this.localState.clientQuery(r),a=o&&this.localState.serverQuery(o),s={document:r,hasClientExports:j_(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:a,defaultVars:YE(GE(r)),asQuery:E(E({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?E(E({},e),{operation:"query"}):e}))})},c=function(e){e&&!n.has(e)&&n.set(e,s)};c(e),c(r),c(i),c(a)}return n.get(e)},e.prototype.getVariables=function(e,t){return E(E({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=E(E({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new xS(this),n=new Ix({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:e.query,observableQuery:n,variables:e.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?Ww(e.query,"query option is required. You must specify your GraphQL document in the query option."):Ww(e.query,14),__DEV__?Ww("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):Ww("Document"===e.query.kind,15),__DEV__?Ww(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):Ww(!e.returnPartialData,16),__DEV__?Ww(!e.pollInterval,"pollInterval option only supported on watchQuery."):Ww(!e.pollInterval,17),this.fetchQuery(t,e).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Qw("Store reset while query was in flight (not completed in link chain)"):new Qw(18)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=_x.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,o=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):NE(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e).document,!1):NE(e)&&e.query&&o.add(e)})),this.queries.forEach((function(t,o){var i=t.observableQuery,a=t.document;if(i){if("all"===e)return void n.set(o,i);var s=i.queryName;if("standby"===i.options.fetchPolicy||"active"===e&&!i.hasObservers())return;("active"===e||s&&r.has(s)||a&&r.has(a))&&(n.set(o,i),s&&r.set(s,!0),a&&r.set(a,!0))}})),o.size&&o.forEach((function(e){var r=gx("legacyOneTimeQuery"),o=t.getQuery(r).init({document:e.query,variables:e.variables}),i=new Ix({queryManager:t,queryInfo:o,options:E(E({},e),{fetchPolicy:"network-only"})});Ww(i.queryId===r),o.setObservableQuery(i),n.set(r,i)})),__DEV__&&r.size&&r.forEach((function(e,t){e||__DEV__&&Ww.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,o){var i=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==i&&"cache-only"!==i)&&n.push(r.refetch()),t.getQuery(o).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,o=e.errorPolicy,i=e.variables,a=e.context,s=void 0===a?{}:a;n=this.transform(n).document,i=this.getVariables(n,i);var c=function(e){return t.getObservableFromLink(n,s,e).map((function(i){if("no-cache"!==r&&(SS(i,o)&&t.cache.write({query:n,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),ox(i))throw new xx({graphQLErrors:i.errors});return i}))};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,i,s).then(c);return new kE((function(e){var t=null;return l.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return c(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var o,i,a=this;void 0===r&&(r=null!==(o=null==t?void 0:t.queryDeduplication)&&void 0!==o?o:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var c=this.inFlightLinkObservables,l=this.link,u={query:s,variables:n,operationName:QE(s)||void 0,context:this.prepareContext(E(E({},t),{forceFetch:!r}))};if(t=u.context,r){var f=c.get(s)||new Map;c.set(s,f);var p=tx(n);if(!(i=f.get(p))){var d=new wx([r_(l,u)]);f.set(p,i=d),d.cleanup((function(){f.delete(p)&&f.size<1&&c.delete(s)}))}}else i=new wx([r_(l,u)])}else i=new wx([kE.of({data:{}})]),t=this.prepareContext(t);var h=this.transform(e).clientQuery;return h&&(i=rx(i,(function(e){return a.localState.runResolvers({document:h,remoteResult:e,context:t,variables:n})}))),i},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return rx(this.getObservableFromLink(e.document,n.context,n.variables),(function(o){var i=Ex(o.errors);if(r>=e.lastRequestId){if(i&&"none"===n.errorPolicy)throw e.markError(new xx({graphQLErrors:o.errors}));e.markResult(o,n,t),e.markReady()}var a={data:o.data,loading:!1,networkStatus:e.networkStatus||_x.ready};return i&&"ignore"!==n.errorPolicy&&(a.errors=o.errors),a}),(function(t){var n=t.hasOwnProperty("graphQLErrors")?t:new xx({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=_x.loading);var o=this.transform(t.query).document,i=this.getVariables(o,t.variables),a=this.getQuery(e),s=t.fetchPolicy,c=void 0===s?"cache-first":s,l=t.errorPolicy,u=void 0===l?"none":l,f=t.returnPartialData,p=void 0!==f&&f,d=t.notifyOnNetworkStatusChange,h=void 0!==d&&d,m=t.context,g=void 0===m?{}:m,v=Object.assign({},t,{query:o,variables:i,fetchPolicy:c,errorPolicy:u,returnPartialData:p,notifyOnNetworkStatusChange:h,context:g}),b=function(e){return v.variables=e,r.fetchQueryByPolicy(a,v,n)};this.fetchCancelFns.set(e,(function(e){setTimeout((function(){return y.cancel(e)}))}));var y=new wx(this.transform(v.query).hasClientExports?this.localState.addExportedVariables(v.query,v.variables,v.context).then(b):b(v.variables));return y.cleanup((function(){r.fetchCancelFns.delete(e),function(e){var t=e.fetchPolicy,n=void 0===t?"cache-first":t,r=e.nextFetchPolicy;r&&(e.fetchPolicy="function"==typeof r?r.call(e,n):r)}(t)})),y},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,o=e.optimistic,i=void 0!==o&&o,a=e.removeOptimistic,s=void 0===a?i?gx("refetchQueries"):void 0:a,c=e.onQueryUpdated,l=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){l.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var u=new Map;return n&&this.cache.batch({update:n,optimistic:i&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof xS&&e.watcher.observableQuery;if(r){if(c){l.delete(r.queryId);var o=c(r,t,n);return!0===o&&(o=r.refetch()),!1!==o&&u.set(r,o),o}null!==c&&l.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),l.size&&l.forEach((function(e,n){var r,o=e.oq,i=e.lastDiff,a=e.diff;if(c){if(!a){var s=o.queryInfo;s.reset(),a=s.getDiff()}r=c(o,a,i)}c&&!0!==r||(r=o.refetch()),!1!==r&&u.set(o,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),u},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,o=t.query,i=t.variables,a=t.fetchPolicy,s=t.refetchWritePolicy,c=t.errorPolicy,l=t.returnPartialData,u=t.context,f=t.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:o,variables:i,networkStatus:n});var d=function(){return e.getDiff(i)},h=function(t,n){void 0===n&&(n=e.networkStatus||_x.loading);var a=t.result;!__DEV__||l||E_(a,{})||Rx(t.missing);var s=function(e){return kE.of(E({data:e,loading:Sx(n),networkStatus:n},t.complete?null:{partial:!0}))};return a&&r.transform(o).hasForcedResolvers?r.localState.runResolvers({document:o,remoteResult:{data:a},context:u,variables:i,onlyRunForcedResolvers:!0}).then((function(e){return s(e.data||void 0)})):s(a)},m="no-cache"===a?0:n===_x.refetch&&"merge"!==s?1:2,g=function(){return r.getResultsFromLink(e,m,{variables:i,context:u,fetchPolicy:a,errorPolicy:c})},v=f&&"number"==typeof p&&p!==n&&Sx(n);switch(a){default:case"cache-first":return(b=d()).complete?[h(b,e.markReady())]:l||v?[h(b),g()]:[g()];case"cache-and-network":var b;return(b=d()).complete||l||v?[h(b),g()]:[g()];case"cache-only":return[h(d(),e.markReady())];case"network-only":return v?[h(d()),g()]:[g()];case"no-cache":return v?[h(e.getDiff()),g()]:[g()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new xS(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return E(E({},t),{clientAwareness:this.clientAwareness})},e}(),CS=!1;function kS(e,t){return o_(e,t,t.variables&&{variables:E(E({},e.variables),t.variables)})}var NS=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,o=e.headers,i=e.cache,a=e.ssrMode,s=void 0!==a&&a,c=e.ssrForceFetchDelay,l=void 0===c?0:c,u=e.connectToDevTools,f=void 0===u?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:u,p=e.queryDeduplication,d=void 0===p||p,h=e.defaultOptions,m=e.assumeImmutableResults,g=void 0!==m&&m,v=e.resolvers,b=e.typeDefs,y=e.fragmentMatcher,w=e.name,E=e.version,_=e.link;if(_||(_=n?new m_({uri:n,credentials:r,headers:o}):n_.empty()),!i)throw __DEV__?new Qw("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Qw(7);if(this.link=_,this.cache=i,this.disableNetworkFetches=s||l>0,this.queryDeduplication=d,this.defaultOptions=h||{},this.typeDefs=b,l&&setTimeout((function(){return t.disableNetworkFetches=!1}),l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!CS&&__DEV__&&(CS=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var x=window.navigator,S=x&&x.userAgent,O=void 0;"string"==typeof S&&(S.indexOf("Chrome/")>-1?O="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":S.indexOf("Firefox/")>-1&&(O="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),O&&__DEV__&&Ww.log("Download the Apollo DevTools for a better development experience: "+O)}this.version="3.5.10",this.localState=new yS({cache:i,client:this,resolvers:v,fragmentMatcher:y}),this.queryManager=new TS({cache:this.cache,link:this.link,queryDeduplication:d,ssrMode:s,clientAwareness:{name:w,version:E},localState:this.localState,assumeImmutableResults:g,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=kS(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=E(E({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=kS(this.defaultOptions.query,e)),__DEV__?Ww("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):Ww("cache-and-network"!==e.fetchPolicy,8),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=E(E({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=kS(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return r_(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var o=Promise.all(r);return o.queries=n,o.results=r,o.catch((function(e){__DEV__&&Ww.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),o},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),AS=n_.from,IS=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r};const PS=function(){function e(e){var t=e.debug,n=void 0!==t&&t;this.debug=n,this.lines=[]}return e.prototype.emit=function(t,n){if(t in console){var r=e.prefix;console[t].apply(console,IS([r],n))}},e.prototype.tailLogs=function(){var e=this;this.lines.forEach((function(t){var n=t[0],r=t[1];return e.emit(n,r)}))},e.prototype.getLogs=function(){return this.lines},e.prototype.write=function(t,n){var r=e.buffer;this.lines=IS(this.lines.slice(1-r),[[t,n]]),(this.debug||"log"!==t)&&this.emit(t,n)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("log",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("warn",e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("error",e)},e.buffer=30,e.prefix="[apollo-cache-persist]",e}();const RS=function(){function e(e){var t=e.cache,n=e.serialize,r=void 0===n||n;this.cache=t,this.serialize=r}return e.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},e.prototype.restore=function(e){this.serialize&&"string"==typeof e&&(e=JSON.parse(e)),null!=e&&this.cache.restore(e)},e}();var DS=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},LS=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const MS=function(){function e(e){var t=e.storage,n=e.key,r=void 0===n?"apollo-cache-persist":n;this.storage=t,this.key=r}return e.prototype.read=function(){return DS(this,void 0,void 0,(function(){return LS(this,(function(e){return[2,this.storage.getItem(this.key)]}))}))},e.prototype.write=function(e){return DS(this,void 0,void 0,(function(){return LS(this,(function(t){switch(t.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.purge=function(){return DS(this,void 0,void 0,(function(){return LS(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}}))}))},e.prototype.getSize=function(){return DS(this,void 0,void 0,(function(){var e;return LS(this,(function(t){switch(t.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return null==(e=t.sent())?[2,0]:[2,"string"==typeof e?e.length:null]}}))}))},e}();var jS=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},FS=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};const BS=function(){function e(e,t){var n=e.log,r=e.cache,o=e.storage,i=t.maxSize,a=void 0===i?1048576:i,s=t.persistenceMapper;this.log=n,this.cache=r,this.storage=o,this.paused=!1,s&&(this.persistenceMapper=s),a&&(this.maxSize=a)}return e.prototype.persist=function(){return jS(this,void 0,void 0,(function(){var e,t;return FS(this,(function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),e=this.cache.extract(),this.paused||!this.persistenceMapper?[3,2]:[4,this.persistenceMapper(e)];case 1:e=n.sent(),n.label=2;case 2:return null!=this.maxSize&&"string"==typeof e&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return n.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return n.sent(),this.log.info("string"==typeof e?"Persisted cache of size "+e.length+" characters":"Persisted cache"),[3,7];case 6:throw t=n.sent(),this.log.error("Error persisting cache",t),t;case 7:return[2]}}))}))},e.prototype.restore=function(){return jS(this,void 0,void 0,(function(){var e,t;return FS(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return null==(e=n.sent())?[3,3]:[4,this.cache.restore(e)];case 2:return n.sent(),this.log.info("string"==typeof e?"Restored cache of size "+e.length+" characters":"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),n.label=4;case 4:return[3,6];case 5:throw t=n.sent(),this.log.error("Error restoring cache",t),t;case 6:return[2]}}))}))},e.prototype.purge=function(){return jS(this,void 0,void 0,(function(){var e;return FS(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return t.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=t.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}}))}))},e}(),US=function(e){var t=e.cache;return function(e){var n=t.write,r=t.evict,o=t.modify;return t.write=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=n.apply(t,r);return e(),i},t.evict=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=r.apply(t,n);return e(),i},t.modify=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=o.apply(t,n);return e(),i},function(){t.write=n,t.evict=r,t.modify=o}}};const qS=function(){function e(t,n){var r=this,o=t.log,i=t.persistor;this.fire=function(){r.debounce?(null!=r.timeout&&clearTimeout(r.timeout),r.timeout=setTimeout(r.persist,r.debounce)):r.persist()},this.persist=function(){r.paused||r.persistor.persist()};var a=e.defaultDebounce,s=n.cache,c=n.debounce,l=n.trigger,u=void 0===l?"write":l;if(u)switch(this.debounce=null!=c?c:a,this.persistor=i,this.paused=!1,u){case"write":this.uninstall=US({cache:s})(this.fire);break;case"background":c&&o.warn("Debounce is not recommended with `background` trigger"),this.debounce=c,this.uninstall=function(e){var t=e.log,n=e.cache;return function(e){return t.warn("Trigger option `background` not available on web; using `write` trigger"),US({cache:n})(e)}}({cache:s,log:o})(this.fire);break;default:if("function"!=typeof u)throw Error("Unrecognized trigger option: "+u);this.uninstall=u(this.fire)}}return e.prototype.pause=function(){this.paused=!0},e.prototype.resume=function(){this.paused=!1},e.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},e.defaultDebounce=1e3,e}();const VS=function(){function e(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var t=new PS(e),n=new RS(e),r=new MS(e),o=new BS({log:t,cache:n,storage:r},e),i=new qS({log:t,persistor:o},e);this.log=t,this.cache=n,this.storage=r,this.persistor=o,this.trigger=i}return e.prototype.persist=function(){return this.persistor.persist()},e.prototype.restore=function(){return this.persistor.restore()},e.prototype.purge=function(){return this.persistor.purge()},e.prototype.pause=function(){this.trigger.pause()},e.prototype.resume=function(){this.trigger.resume()},e.prototype.remove=function(){this.trigger.remove()},e.prototype.getLogs=function(e){if(void 0===e&&(e=!1),!e)return this.log.getLogs();this.log.tailLogs()},e.prototype.getSize=function(){return this.storage.getSize()},e}();var $S=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zS=(function(e){function t(t){var n=e.call(this,t)||this;return n.storage=new HS(t),n.persistor=new zS({log:n.log,cache:n.cache,storage:n.storage},t),n}$S(t,e),t.prototype.restoreSync=function(){this.persistor.restoreSync()}}(VS),function(e){function t(t,n){var r=t.log,o=t.cache,i=t.storage;return e.call(this,{log:r,cache:o,storage:i},n)||this}return $S(t,e),t.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},t}(BS)),HS=function(e){function t(t){return e.call(this,t)||this}return $S(t,e),t.prototype.readSync=function(){return this.storage.getItem(this.key)},t}(MS),GS=(function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){return this.storage.setItem(e,t)}}(),function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.get(e)},e.prototype.removeItem=function(e){return this.storage.remove(e)},e.prototype.setItem=function(e,t){return this.storage.set(e,t)}}(),function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){var n=this;return new Promise((function(r,o){n.storage.setItem(e,t).then((function(){return r()})).catch((function(){return o()}))}))}}(),function(){function e(e){this.storage=e}return e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){return null!==t?this.storage.setItem(e,t):this.removeItem(e)},e}());(function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.getItem(e)||null},e.prototype.removeItem=function(e){var t=this;return new Promise((function(n,r){Promise.resolve(t.storage.removeItem(e)).then((function(){return n()})).catch((function(){return r()}))}))},e.prototype.setItem=function(e,t){var n=this;return new Promise((function(r,o){n.storage.setItem(e,t).then((function(){return r()})).catch((function(){return o()}))}))}})(),function(){function e(e){this.storage=e}e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){return null!==t?this.storage.setItem(e,t):this.removeItem(e)}}();class QS extends n_{requests={};request(e,t){var n;const r=null!==(n=e.getContext())&&void 0!==n?n:{};if(!r.concurrentRequests)return t(e);const{key:o="",limit:i}=r.concurrentRequests,a={operation:e,forward:t,observers:[],groupKey:o,limit:null!=i?i:3,observable:new kE((e=>(a.observers.push(e),()=>{this.cancelOperation(a)})))};return this.addOperations(a),a.observable}addOperations(e){this.requests[e.groupKey]||(this.requests[e.groupKey]={queue:[],activeQueue:[]}),this.requests[e.groupKey].queue.push(e),this.scheduleOperations(e.groupKey)}cancelOperation(e){const{queue:t,activeQueue:n}=this.requests[e.groupKey];var r;if(-1!==t.indexOf(e))return this.requests[e.groupKey].queue=t.filter((t=>t!==e)),void(null===(r=e.currentSubscription)||void 0===r||r.unsubscribe());var o;-1!==n.indexOf(e)&&(this.requests[e.groupKey].activeQueue=n.filter((t=>t!==e)),null===(o=e.currentSubscription)||void 0===o||o.unsubscribe(),this.scheduleOperations(e.groupKey))}scheduleOperations(e){const{activeQueue:t,queue:n}=this.requests[e],r=Math.max(...n.map((e=>e.limit)));for(;t.length<r&&n.length>0;){const e=n.shift();e&&(t.push(e),e.currentSubscription=e.forward(e.operation).subscribe({next:t=>this.onNext(t,e),error:t=>this.onErrorLink(t,e),complete:()=>this.onComplete(e)}))}}onNext(e,t){for(const r of t.observers){var n;null===(n=r.next)||void 0===n||n.call(r,e)}}onErrorLink(e,t){for(const r of t.observers){var n;null===(n=r.error)||void 0===n||n.call(r,e)}this.finishEventExecution(t)}onComplete(e){for(const n of e.observers){var t;null===(t=n.complete)||void 0===t||t.call(n)}this.finishEventExecution(e)}finishEventExecution(e){const{activeQueue:t}=this.requests[e.groupKey];this.requests[e.groupKey].activeQueue=t.filter((t=>t!==e)),this.scheduleOperations(e.groupKey)}}var WS=function(){function e(){this.getFragmentDoc=pS(AE)}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(n)}),r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(E(E({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(E(E({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=_(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,o=e.fragmentName,i=_(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(i,{query:this.getFragmentDoc(r,o),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),o=t(r);return null==o?r:(n.writeQuery(E(E({},e),{data:o})),o)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),o=t(r);return null==o?r:(n.writeFragment(E(E({},e),{data:o})),o)}})},e}(),KS=function(e,t,n,r){this.message=e,this.path=t,this.query=n,this.variables=r};function ZS(e){var t=new Set([e]);return t.forEach((function(e){NE(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(n){NE(e[n])&&t.add(e[n])}))})),e}function YS(e){return __DEV__&&ZS(e),e}var JS=Object.create(null),XS=function(){return JS},eO=Object.create(null),tO=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return YS(DE(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return DE(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return RE(e);if(DE(e))return e;var r=n.policies.identify(e)[0];if(r){var o=RE(r);return t&&n.merge(r,e),o}}}return e.prototype.toObject=function(){return E({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),$_.call(this.data,e)){var n=this.data[e];if(n&&$_.call(n,t))return n[t]}return"__typename"===t&&$_.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof iO?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),$_.call(this.data,e)?this.data[e]:this instanceof iO?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;DE(e)&&(e=e.__ref),DE(t)&&(t=t.__ref);var o="string"==typeof e?this.lookup(n=e):e,i="string"==typeof t?this.lookup(n=t):t;if(i){__DEV__?Ww("string"==typeof n,"store.merge expects a string ID"):Ww("string"==typeof n,1);var a=new V_(sO).merge(o,i);if(this.data[n]=a,a!==o&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);o||(s.__exists=1),Object.keys(i).forEach((function(e){if(!o||o[e]!==a[e]){s[e]=1;var t=W_(e);t===e||r.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||r instanceof iO||delete a[e]}})),!s.__typename||o&&o.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var o=Object.create(null),i=!1,a=!0,s={DELETE:JS,INVALIDATE:eO,isReference:DE,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||RE(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(c){var l=W_(c),u=r[c];if(void 0!==u){var f="function"==typeof t?t:t[c]||t[l];if(f){var p=f===XS?JS:f(YS(u),E(E({},s),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));p===eO?n.group.dirty(e,c):(p===JS&&(p=void 0),p!==u&&(o[c]=p,i=!0,u=p))}void 0!==u&&(a=!1)}})),i)return this.merge(e,o),a&&(this instanceof iO?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,o=this.lookup(e);if(o){var i=this.getFieldValue(o,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:i,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=XS,r):XS)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&($_.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof iO&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){$_.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&$_.call(e,n)||t.delete(n)})),e){var n=e.__META,r=_(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof iO?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){$_.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var o=this;o instanceof iO;)o=o.parent;r.forEach((function(e){return o.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!$_.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){DE(e)&&(t[e.__ref]=!0),NE(e)&&Object.keys(e).forEach((function(t){var n=e[t];NE(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),nO=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?lS():null,this.keyMaker=new I_(P_)},e.prototype.depend=function(e,t){if(this.d){this.d(rO(e,t));var n=W_(t);n!==t&&this.d(rO(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(rO(e,t),"__exists"===t?"forget":"setDirty")},e}();function rO(e,t){return t+"#"+e}function oO(e,t){cO(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,o=void 0===r||r,i=t.seed,a=e.call(this,n,new nO(o))||this;return a.stump=new aO(a),a.storageTrie=new I_(P_),i&&a.replace(i),a}return w(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(tO||(tO={}));var iO=function(e){function t(t,n,r,o){var i=e.call(this,n.policies,o)||this;return i.id=t,i.parent=n,i.replay=r,i.group=o,r(i),i}return w(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],o=n.lookup(e);o?r?r!==o&&Object.keys(r).forEach((function(n){E_(r[n],o[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(o).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return E(E({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return $_.call(this.data,t)?E(E({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(tO),aO=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new nO(t.group.caching,t.group))||this}return w(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(iO);function sO(e,t,n){var r=e[n],o=t[n];return E_(r,o)?r:o}function cO(e){return!!(e instanceof tO&&e.group.caching)}function lO(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var uO=function(){function e(e){var t=this;this.knownResults=new(P_?WeakMap:Map),this.config=o_(e,{addTypename:!1!==e.addTypename,canonizeResults:G_(e)}),this.canon=e.canon||new ex,this.executeSelectionSet=pS((function(e){var n,r=e.context.canonizeResults,o=lO(e);o[3]=!r;var i=(n=t.executeSelectionSet).peek.apply(n,o);return i?r?E(E({},i),{result:t.canon.admit(i.result)}):i:(oO(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:lO,makeCacheKey:function(e,t,n,r){if(cO(n.store))return n.store.makeCacheKey(e,DE(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=pS((function(e){return oO(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(cO(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new ex},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,o=void 0===r?"ROOT_QUERY":r,i=e.variables,a=e.returnPartialData,s=void 0===a||a,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,u=this.config.cache.policies;i=E(E({},YE(KE(n))),i);var f,p=RE(o),d=new V_,h=this.executeSelectionSet({selectionSet:ZE(n).selectionSet,objectOrReference:p,enclosingRef:p,context:{store:t,query:n,policies:u,variables:i,varString:tx(i),canonizeResults:l,fragmentMap:IE(WE(n)),merge:function(e,t){return d.merge(e,t)}}});if(h.missing&&(f=[new KS(fO(h.missing),h.missing,n,i)],!s))throw f[0];return{result:h.result,complete:!f,missing:f}},e.prototype.isFresh=function(e,t,n,r){if(cO(r.store)&&this.knownResults.get(e)===n){var o=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(o&&e===o.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,o=e.enclosingRef,i=e.context;if(DE(r)&&!i.policies.rootTypenamesById[r.__ref]&&!i.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var a,s=i.variables,c=i.policies,l=i.store.getFieldValue(r,"__typename"),u={};function f(e,t){var n;return e.missing&&(a=i.merge(a,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&(u={__typename:l});var p=new Set(n.selections);p.forEach((function(e){var n,d;if(L_(e,s))if($E(e)){var h=c.readField({fieldName:e.name.value,field:e,variables:i.variables,from:r},i),m=qE(e);void 0===h?fx.added(e)||(a=i.merge(a,((n={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(DE(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Y_(h)?h=f(t.executeSubSelectedArray({field:e,array:h,enclosingRef:o,context:i}),m):e.selectionSet?null!=h&&(h=f(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:h,enclosingRef:DE(h)?h:o,context:i}),m)):i.canonizeResults&&(h=t.canon.pass(h)),void 0!==h&&(u=i.merge(u,((d={})[m]=h,d)))}else{var g=PE(e,i.fragmentMap);g&&c.fragmentMatches(g,l)&&g.selectionSet.selections.forEach(p.add,p)}}));var d={result:u,missing:a},h=i.canonizeResults?this.canon.admit(d):YS(d);return h.result&&this.knownResults.set(h.result,n),h},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,o=e.array,i=e.enclosingRef,a=e.context;function s(e,n){var r;return e.missing&&(t=a.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(o=o.filter(a.store.canRead)),o=o.map((function(e,t){return null===e?null:Y_(e)?s(n.executeSubSelectedArray({field:r,array:e,enclosingRef:i,context:a}),t):r.selectionSet?s(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:DE(e)?e:i,context:a}),t):(__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){NE(n)&&(__DEV__?Ww(!DE(n),"Missing selection set for object of type ".concat(function(e,t){return DE(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n)," returned for query field ").concat(t.name.value)):Ww(!DE(n),5),Object.values(n).forEach(r.add,r))}))}}(a.store,r,e),e)})),{result:a.canonizeResults?this.canon.admit(o):o,missing:t}},e}();function fO(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var pO=Object.create(null);function dO(e){var t=JSON.stringify(e);return pO[t]||(pO[t]=Object.create(null))}function hO(e){var t=dO(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},o=n.keyObject=gO(e,(function(e){var o=yO(n.storeObject,e,r);return void 0===o&&t!==n.storeObject&&$_.call(t,e[0])&&(o=yO(t,e,bO)),__DEV__?Ww(void 0!==o,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):Ww(void 0!==o,2),o}));return"".concat(n.typename,":").concat(JSON.stringify(o))})}function mO(e){var t=dO(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,o=n.variables,i=n.fieldName,a=gO(e,(function(e){var n=e[0],i=n.charAt(0);if("@"!==i)if("$"!==i){if(t)return yO(t,e)}else{var a=n.slice(1);if(o&&$_.call(o,a)){var s=e.slice(0);return s[0]=a,yO(o,s)}}else if(r&&Ex(r.directives)){var c=n.slice(1),l=r.directives.find((function(e){return e.name.value===c})),u=l&&UE(l,o);return u&&yO(u,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(i+=":"+s),i})}function gO(e,t){var n=new V_;return vO(e).reduce((function(e,r){var o,i=t(r);if(void 0!==i){for(var a=r.length-1;a>=0;--a)(o={})[r[a]]=i,i=o;e=n.merge(e,i)}return e}),Object.create(null))}function vO(e){var t=dO(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,o){Y_(t)?(vO(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Y_(e[o+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function bO(e,t){return e[t]}function yO(e,t,n){return n=n||bO,wO(t.reduce((function e(t,r){return Y_(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function wO(e){return NE(e)?Y_(e)?e.map(wO):gO(Object.keys(e).sort(),(function(t){return yO(e,t)})):e}function EO(e){return void 0!==e.args?e.args:e.field?UE(e.field,e.variables):null}jE.setStringify(tx);var _O=function(){},xO=function(e,t){return t.fieldName},SO=function(e,t,n){return(0,n.mergeObjects)(e,t)},OO=function(e,t){return t},TO=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=E({dataIdFromObject:z_},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r=this,o=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,a=t&&t.storeObject||e,s=E(E({},t),{typename:o,storeObject:a,readField:t&&t.readField||function(){var e=kO(arguments,a);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),c=o&&this.getTypePolicy(o),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var u=l(e,s);if(!Y_(u)){i=u;break}l=hO(u)}return i=i?String(i):void 0,s.keyObject?[i,s.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],o=r.queryType,i=r.mutationType,a=r.subscriptionType,s=_(r,["queryType","mutationType","subscriptionType"]);o&&t.setRootTypename("Query",n),i&&t.setRootTypename("Mutation",n),a&&t.setRootTypename("Subscription",n),$_.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),o=t.keyFields,i=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?SO:!1===t?OO:e.merge}a(r,t.merge),r.keyFn=!1===o?_O:Y_(o)?hO(o):"function"==typeof o?o:r.keyFn,i&&Object.keys(i).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),o=i[t];if("function"==typeof o)r.read=o;else{var s=o.keyArgs,c=o.read,l=o.merge;r.keyFn=!1===s?xO:Y_(s)?mO(s):"function"==typeof s?s:r.keyFn,"function"==typeof c&&(r.read=c),a(r,l)}r.read&&r.merge&&(r.keyFn=r.keyFn||xO)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?Ww(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):Ww(!r||r===e,3),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(Q_);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!$_.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),o=r.fields,i=_(r,["fields"]);Object.assign(n,i),Object.assign(n.fields,o)}))}var o=this.toBeAdded[e];return o&&o.length&&o.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var o=this;if(!e.typeCondition)return!0;if(!t)return!1;var i=e.typeCondition.name.value;if(t===i)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(i))for(var a=this.getSupertypeSet(t,!0),s=[a],c=function(e){var t=o.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},l=!(!n||!this.fuzzySubtypes.size),u=!1,f=0;f<s.length;++f){var p=s[f];if(p.has(i))return a.has(i)||(u&&__DEV__&&Ww.warn("Inferring subtype ".concat(t," of supertype ").concat(i)),a.add(i)),!0;p.forEach(c),l&&f===s.length-1&&K_(e.selectionSet,n,r)&&(l=!1,u=!0,this.fuzzySubtypes.forEach((function(e,n){var r=t.match(e);r&&r[0]===t&&c(n)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!(!n||!n.keyFn)},e.prototype.getStoreFieldName=function(e){var t,n=e.typename,r=e.fieldName,o=this.getFieldPolicy(n,r,!1),i=o&&o.keyFn;if(i&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},s=EO(e);i;){var c=i(s,a);if(!Y_(c)){t=c||r;break}i=mO(c)}return void 0===t&&(t=e.field?function(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var o=r.name,i=r.value;return LE(n[e.name.value],o,i,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,o=e.value;return LE(r,n,o,t)}))),jE(e.name.value,r,n)}(e.field,e.variables):jE(r,EO(e))),!1===t?r:r===W_(t)?t:r+":"+t},e.prototype.readField=function(e,t){var n=e.from;if(n&&(e.field||e.fieldName)){if(void 0===e.typename){var r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}var o=this.getStoreFieldName(e),i=W_(o),a=t.store.getFieldValue(n,o),s=this.getFieldPolicy(e.typename,i,!1),c=s&&s.read;if(c){var l=CO(this,n,e,t,t.store.getStorage(DE(n)?n.__ref:n,o));return dS.withValue(this.cache,c,[a,l])}return a}},e.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},e.prototype.getMergeFunction=function(e,t,n){var r=this.getFieldPolicy(e,t,!1),o=r&&r.merge;return!o&&n&&(o=(r=this.getTypePolicy(n))&&r.merge),o},e.prototype.runMergeFunction=function(e,t,n,r,o){var i=n.field,a=n.typename,s=n.merge;return s===SO?NO(r.store)(e,t):s===OO?t:(r.overwrite&&(e=void 0),s(e,t,CO(this,void 0,{typename:a,fieldName:i.name.value,field:i,variables:r.variables},r,o||Object.create(null))))},e}();function CO(e,t,n,r,o){var i=e.getStoreFieldName(n),a=W_(i),s=n.variables||r.variables,c=r.store,l=c.toReference,u=c.canRead;return{args:EO(n),field:n.field||null,fieldName:a,storeFieldName:i,variables:s,isReference:DE,toReference:l,storage:o,cache:e.cache,canRead:u,readField:function(){return e.readField(kO(arguments,t,r),r)},mergeObjects:NO(r.store)}}function kO(e,t,n){var r,o,i,a=e[0],s=e[1],c=e.length;return"string"==typeof a?r={fieldName:a,from:c>1?s:t}:(r=E({},a),$_.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Ww.warn("Undefined 'from' passed to readField with arguments ".concat((o=Array.from(e),i=gx("stringifyForDisplay"),JSON.stringify(o,(function(e,t){return void 0===t?i:t})).split(JSON.stringify(i)).join("<undefined>")))),void 0===r.variables&&(r.variables=n),r}function NO(e){return function(t,n){if(Y_(t)||Y_(n))throw __DEV__?new Qw("Cannot automatically merge arrays"):new Qw(4);if(NE(t)&&NE(n)){var r=e.getFieldValue(t,"__typename"),o=e.getFieldValue(n,"__typename");if(r&&o&&r!==o)return n;if(DE(t)&&Z_(n))return e.merge(t.__ref,n),t;if(Z_(t)&&DE(n))return e.merge(t,n.__ref),n;if(Z_(t)&&Z_(n))return E(E({},t),n)}return n}}function AO(e,t,n){var r="".concat(t).concat(n),o=e.flavors.get(r);return o||e.flavors.set(r,o=e.clientOnly===t&&e.deferred===n?e:E(E({},e),{clientOnly:t,deferred:n})),o}var IO=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,o=t.result,i=t.dataId,a=t.variables,s=t.overwrite,c=GE(r),l=new V_;a=E(E({},YE(c)),a);var u={store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:tx(a),fragmentMap:IE(WE(r)),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map},f=this.processSelectionSet({result:o||Object.create(null),dataId:i,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:u});if(!DE(f))throw __DEV__?new Qw("Could not identify object ".concat(JSON.stringify(o))):new Qw(6);return u.incomingById.forEach((function(t,r){var o=t.storeObject,i=t.mergeTree,a=t.fieldNodeSet,s=RE(r);if(i&&i.map.size){var c=n.applyMerges(i,s,o,u);if(DE(c))return;o=c}if(__DEV__&&!u.overwrite){var l=Object.create(null);a.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)}));Object.keys(o).forEach((function(e){(function(e){return!0===l[W_(e)]})(e)&&!function(e){var t=i&&i.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var o=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},i=o(e);if(!i)return;var a=o(t);if(!a)return;if(DE(i))return;if(E_(i,a))return;if(Object.keys(i).every((function(e){return void 0!==r.getFieldValue(a,e)})))return;var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),c=W_(n),l="".concat(s,".").concat(c);if(jO.has(l))return;jO.add(l);var u=[];Y_(i)||Y_(a)||[i,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||u.includes(t)||u.push(t)}));__DEV__&&Ww.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(u.length?"either ensure all objects of type "+u.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(i).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(a).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}(s,o,e,u.store)}))}e.merge(r,o)})),e.retain(f.__ref),f},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,o=e.selectionSet,i=e.context,a=e.mergeTree,s=this.cache.policies,c=Object.create(null),l=n&&s.rootTypenamesById[n]||VE(r,o,i.fragmentMap)||n&&i.store.get(n,"__typename");"string"==typeof l&&(c.__typename=l);var u=function(){var e=kO(arguments,c,i.variables);if(DE(e.from)){var t=i.incomingById.get(e.from.__ref);if(t){var n=s.readField(E(E({},e),{from:t.storeObject}),i);if(void 0!==n)return n}}return s.readField(e,i)},f=new Set;this.flattenFields(o,r,i,l).forEach((function(e,n){var o,i=qE(n),p=r[i];if(f.add(n),void 0!==p){var d=s.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),h=RO(a,d),m=t.processFieldValue(p,n,n.selectionSet?AO(e,!1,!1):e,h),g=void 0;n.selectionSet&&(DE(m)||Z_(m))&&(g=u("__typename",m));var v=s.getMergeFunction(l,n.name.value,g);v?h.info={field:n,typename:l,merge:v}:MO(a,d),c=e.merge(c,((o={})[d]=m,o))}else!__DEV__||e.clientOnly||e.deferred||fx.added(n)||s.getReadFunction(l,n.name.value)||__DEV__&&Ww.error("Missing field '".concat(qE(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))}));try{var p=s.identify(r,{typename:l,selectionSet:o,fragmentMap:i.fragmentMap,storeObject:c,readField:u}),d=p[0],h=p[1];n=n||d,h&&(c=i.merge(c,h))}catch(e){if(!n)throw e}if("string"==typeof n){var m=RE(n),g=i.written[n]||(i.written[n]=[]);if(g.indexOf(o)>=0)return m;if(g.push(o),this.reader&&this.reader.isFresh(r,m,o,i))return m;var v=i.incomingById.get(n);return v?(v.storeObject=i.merge(v.storeObject,c),v.mergeTree=DO(v.mergeTree,a),f.forEach((function(e){return v.fieldNodeSet.add(e)}))):i.incomingById.set(n,{storeObject:c,mergeTree:LO(a)?void 0:a,fieldNodeSet:f}),m}return c},e.prototype.processFieldValue=function(e,t,n,r){var o=this;return t.selectionSet&&null!==e?Y_(e)?e.map((function(e,i){var a=o.processFieldValue(e,t,n,RO(r,i));return MO(r,i),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?Tx(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=VE(t,e,n.fragmentMap));var o=new Map,i=this.cache.policies,a=new I_(!1);return function e(s,c){var l=a.lookup(s,c.clientOnly,c.deferred);l.visited||(l.visited=!0,s.selections.forEach((function(a){if(L_(a,n.variables)){var s=c.clientOnly,l=c.deferred;if(s&&l||!Ex(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=UE(e,n.variables);r&&!1===r.if||(l=!0)}})),$E(a)){var u=o.get(a);u&&(s=s&&u.clientOnly,l=l&&u.deferred),o.set(a,AO(n,s,l))}else{var f=PE(a,n.fragmentMap);f&&i.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,AO(n,s,l))}}})))}(e,n),o},e.prototype.applyMerges=function(e,t,n,r,o){var i,a=this;if(e.map.size&&!DE(n)){var s,c=Y_(n)||!DE(t)&&!Z_(t)?void 0:t,l=n;c&&!o&&(o=[DE(c)?c.__ref:c]);var u=function(e,t){return Y_(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=u(c,t),i=u(l,t);if(void 0!==i){o&&o.push(t);var f=a.applyMerges(e,n,i,r,o);f!==i&&(s=s||new Map).set(t,f),o&&Ww(o.pop()===t)}})),s&&(n=Y_(l)?l.slice(0):E({},l),s.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,o&&(i=r.store).getStorage.apply(i,o)):n},e}(),PO=[];function RO(e,t){var n=e.map;return n.has(t)||n.set(t,PO.pop()||{map:new Map}),n.get(t)}function DO(e,t){if(e===t||!t||LO(t))return e;if(!e||LO(e))return t;var n=e.info&&t.info?E(E({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,o={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var i=new Set(t.map.keys());e.map.forEach((function(e,n){o.map.set(n,DO(e,t.map.get(n))),i.delete(n)})),i.forEach((function(n){o.map.set(n,DO(t.map.get(n),e.map.get(n)))}))}return o}function LO(e){return!e||!(e.info||e.map.size)}function MO(e,t){var n=e.map,r=n.get(t);r&&LO(r)&&(PO.push(r),n.delete(t))}var jO=new Set;var FO=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=vS,n.txCount=0,n.config=function(e){return o_(H_,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new TO({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return w(t,e),t.prototype.init=function(){var e=this.data=new tO.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader;this.storeWriter=new IO(this,this.storeReader=new uO({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:G_(this.config),canon:e?void 0:n&&n.canon})),this.maybeBroadcastWatch=pS((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(cO(n)){var r=e.optimistic,o=e.rootId,i=e.variables;return n.makeCacheKey(e.query,e.callback,tx({optimistic:r,rootId:o,variables:i}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(E(E({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof KS)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if($_.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(E(E({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||function(e){mS(e).vars.forEach((function(t){return t.attachCache(e)}))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&gS(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){tx.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(DE(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&Ww.warn(e)}},t.prototype.evict=function(e){if(!e.id){if($_.call(e,"id"))return!1;e=E(E({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),tx.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),gS(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,o=e.optimistic,i=void 0===o||o,a=e.removeOptimistic,s=e.onWatchUpdated,c=function(e){var o=n,i=o.data,a=o.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=i,n.optimisticData=a}},l=new Set;return s&&!this.txCount&&this.broadcastWatches(E(E({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof i?this.optimisticData=this.optimisticData.addLayer(i,c):!1===i?c(this.data):c(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),s&&l.size?(this.broadcastWatches(E(E({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&l.delete(e),n}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=fx(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&E_(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(WS);const BO=new FO({typePolicies:{ExtensionRegistry:{merge:(e,t)=>t},Person:{merge:(e,t)=>t},Query:{fields:{node:{merge:!0}}}}}),UO=["viewerSettings","extensionRegistry","temporarySettings"],qO="ROOT_QUERY",VO=e=>{const t=JSON.parse(e);if(!t.ROOT_QUERY||0===Object.keys(t.ROOT_QUERY).length)return Promise.resolve(e);const n={[qO]:{__typename:t.ROOT_QUERY.__typename}};function r(e){if(e)if(Array.isArray(e))for(const t of e)r(t);else if(function(e){return Boolean(e.__ref)}(e)){const o=e.__ref;n[o]=t[o],r(t[o])}else if(e&&"object"==typeof e)for(const t of Object.values(e))r(t)}for(const e of UO){const o=t.ROOT_QUERY[e];o&&(Object.assign(n.ROOT_QUERY,{[e]:o}),r(o))}return Promise.resolve(JSON.stringify(n))};const $O=e=>"apollo-cache-persist-"+(e?"authenticated":"anonymous"),zO=Em()((async e=>{const{headers:t,baseUrl:n,isAuthenticated:r,credentials:o}=e,i=dr({baseUrl:n}),a=new VS({cache:BO,persistenceMapper:VO,maxSize:4194304,key:$O(r),storage:new GS(window.localStorage)});localStorage.removeItem($O(!r)),await a.restore();const s=new NS({uri:i,cache:BO,defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"},query:{fetchPolicy:"network-only"}},link:AS([new QS,h_({uri:({operationName:e})=>`${i}?${e}`,headers:t,credentials:o})])});return Promise.resolve(s)}));function HO(e,t){if(t&&!Ac)return function(){const e=e=>ee(Dc.requestGraphQL(e));return{getBrowserGraphQLClient:Em()((()=>{const t={watchQuery:({variables:t,query:n})=>e({request:Lw(n),variables:t,mightContainPrivateInfo:!1})};return Promise.resolve(t)})),requestGraphQL:e}}();return{getBrowserGraphQLClient:Em()((()=>zO({headers:{"X-Requested-With":`Sourcegraph - ${Fc()} v${Bc()}`},baseUrl:e,isAuthenticated:!1,credentials:"include"}))),requestGraphQL:({request:e,variables:n})=>jc(t).pipe(Ye(1),ze((t=>function({request:e,baseUrl:t,variables:n,...r}){return ar(dr({request:e,baseUrl:t}),{...r,method:"POST",body:JSON.stringify({query:e,variables:n}),selector:e=>ur(e).json()})}({request:e,variables:n,baseUrl:t,credentials:"include"}))))}}function GO(e,t,n){const r=t[t.length-1];for(const n of t.slice(0,-1))e=e[n];const o=e[r];return e[r]=n,o}function*QO(e,t=null,n=null,r=[],o=new WeakSet){if(yield{value:e,path:r,parent:n,key:t},!pn()(e)||o.has(e))return;o.add(e);const i=Object.keys(e);for(const t of i)yield*QO(e[t],t,e,[...r,t],o)}function WO(e){if(Pc)return function({assetsURL:e}){return new Promise((t=>{const n=document.createElement("iframe");n.setAttribute("src",new URL("extensionHostFrame.html",e).href),n.setAttribute("style","display: none;"),document.body.append(n);const r=new MessageChannel,o=new MessageChannel,i={proxy:r.port2,expose:o.port2},a={proxy:o.port1,expose:r.port1};n.addEventListener("load",(()=>{n.contentWindow.postMessage({type:"workerInit",payload:{endpoints:a,wrapEndpoints:!1}},new URL(e).origin,Object.values(a)),t({endpoints:i,subscription:new g((()=>n.remove()))})}),{once:!0})}))}(e);const t=jl(),n=new g,r=e=>{const r=browser.runtime.connect({name:`${e}-${t}`});n.add((()=>r.disconnect()));const o=function(e,t,n){const r=new g,o=new Map,i=new Map,a=e=>{if(!e.name.startsWith(t))return;const n=e.name.slice(t.length),r=i.get(n);r?(i.delete(n),r(e)):o.set(n,e)};browser.runtime.onConnect.addListener(a),r.add((()=>browser.runtime.onConnect.removeListener(a)));const s=(e,t)=>{const n=o.get(e);if(n)return o.delete(e),void t(n);i.set(e,t)},{port1:c,port2:l}=new MessageChannel;return function e(a,c){const l=new g((()=>{const e=a.name.slice(t.length);o.delete(e),i.delete(e),c.close(),a.disconnect()}));r.add(l);const u=r=>{const o=r.data,i=[];for(const{value:r,path:a,key:s,parent:c}of QO(o))if(r instanceof MessagePort){c[s]=null;const o=jl();e(n(t+o),r),i.push({path:a,id:o})}const s={message:o,portRefs:i};a.postMessage(s),5===o.type&&l.unsubscribe()};c.addEventListener("message",u),l.add((()=>c.removeEventListener("message",u)));const f=({message:t,portRefs:n})=>{const r=[];for(const o of n){const{port1:n,port2:i}=new MessageChannel;GO(t,o.path,n),r.push(n),s(o.id,(t=>e(t,i)))}c.postMessage(t,r),5===t.type&&l.unsubscribe()};a.onMessage.addListener(f),l.add((()=>a.onMessage.removeListener(f)));const p=l.unsubscribe.bind(l);a.onDisconnect.addListener(p),l.add((()=>a.onDisconnect.removeListener(p))),c.start()}(e,l),{messagePort:c,subscription:r}}(r,`comlink-${e}-`,(e=>browser.runtime.connect({name:e})));return n.add(o.subscription),o.messagePort};return Promise.resolve({endpoints:{proxy:r("proxy"),expose:r("expose")},subscription:n})}const KO=()=>Ic&&Lc();function ZO(){const{manifestURL:e,scriptURL:t}=function(e){return{manifestURL:browser.extension.getURL(`extensions/${e}/package.json`),scriptURL:browser.extension.getURL(`extensions/${e}/extension.js`)}}("template");return ee(fetch(e).then((e=>ur(e).json())).then((e=>[{id:"sourcegraph/template",manifest:e,scriptURL:t}])))}var YO=n(21635);const JO="sourcegraphClientSettings";const XO=(()=>{const e=Pc?function(e,t){const n=localStorage.getItem(e);return Ae(window,"storage").pipe(qe((t=>t.key===e)),H((e=>e.newValue)),ue(n),H((e=>null!=e?e:t)),Qe())}(JO,"{}"):Vc("sync","clientSettings"),t={__typename:"Client",id:"Client",displayName:"Client",viewerCanAdminister:!0};return e.pipe(H((e=>(0,oo.parse)(e||""))),H((e=>({subjects:[{subject:t,settings:e,lastID:null}],final:e||{}}))))})();const eT=fr`
181
181
  fragment ConfigurationCascadeFields on ConfigurationCascade {
182
182
  subjects {
183
183
  __typename
@@ -214,11 +214,11 @@
214
214
  }
215
215
  }
216
216
  ${eT}
217
- `,variables:{},mightContainPrivateInfo:!1})).pipe(H(pr),H((({viewerConfiguration:e})=>{if(!e)throw new Error("fetchViewerSettings: empty viewerConfiguration");for(const t of e.subjects)t.viewerCanAdminister=!1;return{subjects:e.subjects,final:e.merged.contents}})))}(i).toPromise();o.next(e)}catch(e){if(!lr(e))throw e;console.warn(`Could not fetch Sourcegraph settings from ${t} because user is not signed into Sourcegraph`),o.next({final:"{}",subjects:[]})}},updateSettings:async(e,t)=>{if("Client"!==e){try{await kw(s,e,t,Nw)}catch(n){if(!ln(n).message.includes("version mismatch"))throw n;await s.refreshSettings(),await kw(s,e,t,Nw)}await s.refreshSettings()}else await kw(s,e,t,(()=>async function(e){const t=t=>"string"==typeof e?e:(0,oo.applyEdits)(t,(0,YO.setProperty)(t,e.path.slice(),e.value,{tabSize:2,insertSpaces:!0,eol:"\n"}));if(Pc){const e=t(localStorage.getItem(JO)||"");return localStorage.setItem(JO,e),Promise.resolve()}const{clientSettings:n="{}"}=await qc.sync.get(),r=t(n);await qc.sync.set({clientSettings:r})}(t)))},requestGraphQL:i,getGraphQLClient:a,forceUpdateTooltip:()=>{},createExtensionHost:()=>WO({assetsURL:n}),getScriptURLForExtension:()=>{if(!Pc&&!KO())return e=>Promise.allSettled(e.map((e=>Dc.createBlobURL(e)))).then((e=>e.map((e=>"rejected"===e.status?ln(e.reason):e.value))))},urlToFile:({rawRepoName:n,...r},o)=>n&&e?e(t,{rawRepoName:n,...r},o):`${t}${ma(r)}`,sourcegraphURL:t,clientApplication:"other",sideloadedExtensionURL:Pc?new Tw("sideloadedExtensionURL",null):new Aw("sideloadedExtensionURL",null),getStaticExtensions:()=>{if(KO())return ZO()}};return s}function nT(){return(nT=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 rT=(e,t)=>{e.style.backgroundColor="";const n=e.querySelectorAll(`[data-line-decoration-attachment][data-part=${String(t)}]`);for(const e of n)e.remove()},oT=e=>{e.style.backgroundColor=""},iT=(e,t,n,r,o,i,a)=>{const s=(e=>{const t=new Map;for(const n of e||[]){const e=n.range.start.line+1,r=t.get(e);r?r.push(n):t.set(e,[n])}return t})(n);for(const n of r.keys())if(!s.has(n)){const r=e.getCodeElementFromLineNumber(t,n,a);r&&rT(r,a);const o=e.getLineElementFromLineNumber(t,n,a);o&&oT(o)}for(const[n,c]of s){const s=r.get(n);if(i===o&&Ot()(c,s))continue;const l=e.getCodeElementFromLineNumber(t,n,a);if(!l){if(void 0===a)throw new Error(`Unable to find code element for line ${n}`);continue}const u=e.getLineElementFromLineNumber(t,n,a);if(u){rT(l,a),oT(u);for(const e of c){const t=La(e,o);if(t.backgroundColor){let n;n=e.isWholeLine?u:l,n.style.backgroundColor=t.backgroundColor}if(e.after){const t=Ma(e.after,o),n=e=>n=>{const r=document.createElement("a");return r.setAttribute("href",e),r.setAttribute("target",er(e)?"_blank":""),r.setAttribute("rel","noreferrer noopener"),r.style.color=t.color||"",r.append(n),r},r=document.createElement("span");r.style.color=t.color||"",r.style.backgroundColor=t.backgroundColor||"",r.textContent=e.after.contentText||null,e.after.hoverMessage&&(r.title=e.after.hoverMessage);const i=e.after.linkURL?n(e.after.linkURL)(r):r;i.dataset.part=String(a),i.className="sourcegraph-extension-element",i.dataset.lineDecorationAttachment="true",l.append(i)}}}else if(void 0===a)throw new Error(`Could not find line element for line ${n}`)}return s};var aT=1,sT=function(){return Promise.resolve()}(),cT={};function lT(e){return e in cT&&(delete cT[e],!0)}var uT=function(e){var t=aT++;return cT[t]=!0,sT.then((function(){return lT(t)&&e()})),t},fT=function(e){lT(e)},pT=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return w(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=uT(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(fT(n),t.scheduled=void 0)},t}(Re),dT=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return w(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,o=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<o&&(e=n.shift()));if(this.active=!1,t){for(;++r<o&&(e=n.shift());)e.unsubscribe();throw t}},t}(Le))(pT),hT=n(3621),mT=n(26451),gT=n(42723),vT=n(15478);class bT{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new yT(e,this.defaultValue))}}class yT extends mT.OuterSubscriber{activeObservables=0;values=[];observables=[];scheduled=!1;constructor(e,t){super(e),this.defaultValue=t}_next(e){void 0!==this.defaultValue&&this.values.push(this.defaultValue),this.observables.push(e)}_complete(){this.activeObservables=this.observables.length;for(let e=0;e<this.observables.length;e++)this.add((0,vT.D)(this,this.observables[e],this.observables[e],e))}notifyComplete(){this.activeObservables--,0===this.activeObservables&&this.destination.complete&&this.destination.complete()}notifyNext(e,t,n){this.values[n]=t,1!==this.activeObservables?this.scheduled||(this.scheduled=!0,dT.schedule((()=>{this.scheduled&&this.destination.next&&this.destination.next(this.values.slice()),this.scheduled=!1}))):this.destination.next&&this.destination.next(this.values.slice())}}function wT(e){return Pc?z(void 0):Vc("sync","dismissedHoverAlerts").pipe(ze((t=>function(e,t){switch(e.length){case 0:return z([]);case 1:return rl(...e);default:return new hT.Observable((0,gT.subscribeToArray)(e)).lift(new bT(t))}}(e).pipe(H((e=>t?e.filter((({type:e})=>!e||!t[e])):e))))),st((e=>(console.error("Error getting hover alerts",e),[void 0]))),ue([]))}async function ET(e){try{const t={dismissedHoverAlerts:{},...await qc.sync.get("dismissedHoverAlerts")};t.dismissedHoverAlerts[e]=!0,await qc.sync.set(t)}catch(e){console.error("Error dismissing alert",e)}}var _T=n(3369),xT=n.n(_T);const ST="ViewOnSourcegraphButton-module__icon--muted_1fDz9";function OT(){return(OT=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 TT=({codeHostType:e,repoExistsOrError:n,sourcegraphURL:r,userSettingsURL:o,context:a,minimalUI:s,onConfigureSourcegraphClick:c,showSignInButton:l,onSignInClose:u,className:f,iconClassName:p})=>{f=i()("open-on-sourcegraph",f);const d=i()(ST,p),h={className:f,iconClassName:p},{rawRepoName:m,revision:g,privateRepository:v}=a;if(void 0===n)return null;const b=Tc(new URL(`/${m}${g?`@${g}`:""}`,r),{utm_source:Fc(),utm_campaign:"view-on-sourcegraph"}).href;if(cn(n)){if(lr(n))return l?t.createElement(nl,OT({},h,{sourcegraphURL:r,onSignInClose:u})):null;const o={...h,href:new URL(xT()(e),"https://docs.sourcegraph.com/integration/").href,onClick:c};return t.createElement(tl,OT({},o,{iconClassName:d,href:b,label:"Error",title:n.message,ariaLabel:n.message}))}return n?s?null:t.createElement(tl,OT({},h,{href:b,title:"View repository on Sourcegraph",ariaLabel:"View repository on Sourcegraph"})):Uc(r)&&v?t.createElement(CT,OT({},h,{codeHostType:e,href:o})):t.createElement(tl,OT({},h,{href:b,iconClassName:d,label:"Repository not found",title:`The repository does not exist on the configured Sourcegraph instance ${r}`,ariaLabel:`The repository does not exist on the configured Sourcegraph instance ${r}`}))},CT=({onConfigureSourcegraphClick:e,codeHostType:n,...r})=>t.createElement(tl,OT({},r,{href:r.href||new URL(xT()(n),"https://docs.sourcegraph.com/integration/").href,onClick:e,label:"Configure Sourcegraph",title:"Set up Sourcegraph for search and code intelligence on private repositories",ariaLabel:"Set up Sourcegraph for search and code intelligence on private repositories"})),kT="codeHost-module__hover-overlay_1k2Tk";function NT(){return(NT=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)}Gn||(Gn=!0,(0,zn.registerLanguage)("go",n(2806)),(0,zn.registerLanguage)("javascript",n(31566)),(0,zn.registerLanguage)("typescript",n(97159)),(0,zn.registerLanguage)("java",n(4168)),(0,zn.registerLanguage)("python",n(15664)),(0,zn.registerLanguage)("php",n(29019)),(0,zn.registerLanguage)("bash",n(45804)),(0,zn.registerLanguage)("clojure",n(40153)),(0,zn.registerLanguage)("c-like",n(57576)),(0,zn.registerLanguage)("cpp",n(41727)),(0,zn.registerLanguage)("cs",n(88671)),(0,zn.registerLanguage)("csharp",n(88671)),(0,zn.registerLanguage)("css",n(37018)),(0,zn.registerLanguage)("dockerfile",n(86651)),(0,zn.registerLanguage)("elixir",n(67157)),(0,zn.registerLanguage)("haskell",n(26357)),(0,zn.registerLanguage)("html",n(58422)),(0,zn.registerLanguage)("lua",n(85407)),(0,zn.registerLanguage)("ocaml",n(2755)),(0,zn.registerLanguage)("r",n(17292)),(0,zn.registerLanguage)("ruby",n(30601)),(0,zn.registerLanguage)("rust",n(55610)),(0,zn.registerLanguage)("swift",n(58633)),(0,zn.registerLanguage)("markdown",n(56924)),(0,zn.registerLanguage)("diff",n(49900)),(0,zn.registerLanguage)("json",n(89475)),(0,zn.registerLanguage)("jsonc",n(89475)),(0,zn.registerLanguage)("yaml",n(14037)),(0,zn.registerLanguage)("kotlin",n(40282)),(0,zn.registerLanguage)("dart",n(60627)),(0,zn.registerLanguage)("perl",n(60583)),(0,zn.registerLanguage)("scala",n(5542)),(0,zn.registerLanguage)("graphql",Hn.definer),(0,zn.registerLanguage)("apex",n(4168)),(0,zn.registerLanguage)("http",n(9737)));const AT=(e,t)=>{const n=document.createElement("div");return n.classList.add("hover-overlay-mount",`hover-overlay-mount__${e}`),t.append(n),n};function IT({mutations:e,codeHost:n,platformContext:r,extensionsController:o,render:s,telemetryService:c,hoverAlerts:l,repoSyncErrors:u}){const f=new g,p=new ye,d=document.body,h=new ye;f.add(function({extensionsController:e,platformContext:{urlToFile:t,requestGraphQL:n},history:r,locationAssign:o}){const i=new g;return{contributionsPromise:e.extHostAPI.then((s=>{const c=s.registerContributions({actions:[{id:"goToDefinition",title:"Go to definition",command:"goToDefinition",commandArguments:["${json(hoverPosition)}"]},{id:"goToDefinition.preloaded",title:"Go to definition",disabledTitle:"You are at the definition",command:"open",commandArguments:["${goToDefinition.url}"]}],menus:{hover:[{action:"goToDefinition",when:"goToDefinition.error || goToDefinition.showLoading",disabledWhen:"hoveredOnDefinition"},{action:"goToDefinition.preloaded",when:"goToDefinition.url",disabledWhen:"hoveredOnDefinition"}]}});i.add(Yr(c)),i.add(e.registerCommand({command:"goToDefinition",run:async i=>{const c=JSON.parse(i),{result:l}=await Xr(s.getDefinition(c)).pipe(Sa({urlToFile:t,requestGraphQL:n},{getWorkspaceRoots:()=>ee(e.extHostAPI).pipe(ze((e=>Xr(e.getWorkspaceRoots()))))},c),rn((({isLoading:e,result:t})=>!e||null!==t))).toPromise();if(!l)throw new Error("No definition found.");if(l.url===a.Ep(r.location)){if(l.multiple)throw new Error("Multiple definitions shown in panel below.");throw new Error("Already at the definition.")}er(l.url)?o(l.url):r.push(l.url)}}));const l=s.registerContributions({actions:[{id:"findReferences",title:"Find references",command:"open",commandArguments:["${findReferences.url}"]}],menus:{hover:[{action:"findReferences",when:"findReferences.url && (goToDefinition.showLoading || goToDefinition.url || goToDefinition.error)",disabledWhen:"false"}]}});return i.add(Yr(l)),Promise.all([c,l])})).then((()=>{})).catch((()=>{console.error('Failed to register "Go to Definition" and "Find references" actions with extension host')})),unsubscribe:i.unsubscribe.bind(i)}}({extensionsController:o,platformContext:r,history:a.lX(),locationAssign:location.assign.bind(location)}));const m=Vn({hoverOverlayElements:p,hoverOverlayRerenders:h.pipe(Fe(p),H((([,e])=>({hoverOverlayElement:e,relativeElement:d}))),qe((v="hoverOverlayElement",b=Kn,e=>b(e[v])))),getHover:({line:e,character:t,part:r,...i})=>le([{isLoading:!0,result:null}],Oe([ee(o.extHostAPI).pipe(Fe(u),ze((([n,r])=>r?z({isLoading:!0,result:null}):Xr(n.getHover($c({...i,position:{line:e,character:t}})))))),wT([...l,u.pipe(Qe(),H((e=>e?(e=>{var t,n;return{type:"private-code",summary:{kind:Da.MarkupKind.Markdown,value:`#### Sourcegraph for private code\n\nTo get Sourcegraph hovers on your private repositories, you need to set up a private Sourcegraph instance and connect it to the browser extension.\n\n<a href="https://docs.sourcegraph.com/code_search/how-to/adding_repositories_to_cloud" class="${null!==(t=null===(n=e.hoverOverlayClassProps)||void 0===n?void 0:n.actionItemClassName)&&void 0!==t?t:""}" target="_blank" rel="noopener norefferer">Show more info</a>`}}})(n):void 0)),qe(Kn))])]).pipe(H((([{isLoading:e,result:t},n])=>({isLoading:e,result:t||null!=n&&n.length?{contents:[],...t,alerts:n}:null}))))),getDocumentHighlights:({line:e,character:t,part:n,...r})=>ee(o.extHostAPI).pipe(Fe(u),ze((([n,o])=>o?z([]):Xr(n.getDocumentHighlights($c({...r,position:{line:e,character:t}})))))),getActions:e=>u.pipe(Ye(1),ze((t=>t?z([]):_a({extensionsController:o,platformContext:r},e)))),tokenize:n.codeViewsRequireTokenization});var v,b;class y extends t.Component{subscription=new g;nextOverlayElement=p.next.bind(p);constructor(e){super(e),this.state={...m.hoverState,isLightTheme:!0}}componentDidMount(){this.subscription.add(m.hoverStateUpdates.subscribe((e=>{this.setState(e)}))),this.subscription.add(m.hoverStateUpdates.pipe(Fe(Kl("clickToGoToDefinition")),qe((([,e])=>e)),H((([e])=>e)),ze((({hoveredTokenElement:e,hoverOverlayProps:t})=>{if(void 0===e)return ke;if(void 0===t)return ke;const{actionsOrError:n}=t,r=Array.isArray(n)&&n.find((e=>"goToDefinition.preloaded"===e.action.id&&!e.disabledWhen)),o=Array.isArray(n)&&n.find((e=>"findReferences"===e.action.id&&!e.disabledWhen)),i=r||o;if(!i)return ke;const a=wo(i.action,window.location.hash);if(!a)return ke;const s=e.style.cursor;return e.style.cursor="pointer",Ae(e,"click").pipe(tt((()=>{const e=window.getSelection();if(null!==e&&""!==e.toString())return;const t=i===r?"definition":"reference";c.log(`${t}CodeHost.click`),window.location.href=a})),ot((()=>e.style.cursor=s)))}))).subscribe()),n.isLightTheme&&this.subscription.add(n.isLightTheme.subscribe((e=>{this.setState({isLightTheme:e})}))),h.next()}componentWillUnmount(){this.subscription.unsubscribe()}componentDidUpdate(){h.next()}handleHoverLinkClick=e=>{const t=e.target;if(!er(t.href))return;const n=Tc(new URL(t.href),{utm_source:Fc(),utm_campaign:"hover"}).href;var r;"_blank"===t.getAttribute("target")?window.open(n,"_blank",null!==(r=t.getAttribute("rel"))&&void 0!==r?r:void 0):window.location.href=n;e.preventDefault()};render(){var e;const s=this.getHoverOverlayProps();return s?t.createElement(Cl,{onClick:this.handleHoverLinkClick},t.createElement(Oc,NT({},s,n.hoverOverlayClassProps,{className:i()(kT,null===(e=n.hoverOverlayClassProps)||void 0===e?void 0:e.className),telemetryService:c,isLightTheme:this.state.isLightTheme,hoverRef:this.nextOverlayElement,extensionsController:o,platformContext:r,location:a.ob(window.location),onAlertDismissed:ET,useBrandedLogo:!0}))):null}getHoverOverlayProps(){if(!this.state.hoverOverlayProps)return;let{overlayPosition:e,...t}=this.state.hoverOverlayProps;return e&&n.adjustOverlayPosition&&(e=n.adjustOverlayPosition(e)),{...t,overlayPosition:e}}}const{getHoverOverlayMountLocation:w}=n;if(w){let r=null;f.add(function(e,t){return t.pipe(ce(),H((({addedNodes:t,removedNodes:n})=>{const r=e();if(null===r)return document.body;for(const e of t){if(!(e instanceof HTMLElement))continue;const t=he(e,r);if(t)return t}for(const e of n)if(e instanceof HTMLElement&&he(e,r))return document.body;return null})),qe(Kn),ue(document.body),Qe())}(w,e).subscribe((e=>{r&&r.remove();const o=AT(n.type,e);r=o,s(t.createElement(y,null),o)})))}else{const e=AT(n.type,document.body);s(t.createElement(y,null),e)}return{hoverifier:m,subscription:f}}const PT=async e=>{e.preventDefault(),Ic&&await Dc.openOptionsPage()},RT=(e,t,n)=>{const r=new URL(`${t}/repositories/manage`,e);return r.searchParams.set("filter",n),r.href},DT=e=>e({request:fr`
217
+ `,variables:{},mightContainPrivateInfo:!1})).pipe(H(pr),H((({viewerConfiguration:e})=>{if(!e)throw new Error("fetchViewerSettings: empty viewerConfiguration");for(const t of e.subjects)t.viewerCanAdminister=!1;return{subjects:e.subjects,final:e.merged.contents}})))}(i).toPromise();o.next(e)}catch(e){if(!lr(e))throw e;console.warn(`Could not fetch Sourcegraph settings from ${t} because user is not signed into Sourcegraph`),o.next({final:"{}",subjects:[]})}},updateSettings:async(e,t)=>{if("Client"!==e){try{await kw(s,e,t,Nw)}catch(n){if(!ln(n).message.includes("version mismatch"))throw n;await s.refreshSettings(),await kw(s,e,t,Nw)}await s.refreshSettings()}else await kw(s,e,t,(()=>async function(e){const t=t=>"string"==typeof e?e:(0,oo.applyEdits)(t,(0,YO.setProperty)(t,e.path.slice(),e.value,{tabSize:2,insertSpaces:!0,eol:"\n"}));if(Pc){const e=t(localStorage.getItem(JO)||"");return localStorage.setItem(JO,e),Promise.resolve()}const{clientSettings:n="{}"}=await qc.sync.get(),r=t(n);await qc.sync.set({clientSettings:r})}(t)))},requestGraphQL:i,getGraphQLClient:a,forceUpdateTooltip:()=>{},createExtensionHost:()=>WO({assetsURL:n}),getScriptURLForExtension:()=>{if(!Pc&&!KO())return e=>Promise.allSettled(e.map((e=>Dc.createBlobURL(e)))).then((e=>e.map((e=>"rejected"===e.status?ln(e.reason):e.value))))},urlToFile:({rawRepoName:n,...r},o)=>n&&e?e(t,{rawRepoName:n,...r},o):`${t}${ma(r)}`,sourcegraphURL:t,clientApplication:"other",sideloadedExtensionURL:Pc?new Tw("sideloadedExtensionURL",null):new Aw("sideloadedExtensionURL",null),getStaticExtensions:()=>{if(KO())return ZO()}};return s}function nT(){return(nT=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 rT=(e,t)=>{e.style.backgroundColor="";const n=e.querySelectorAll(`[data-line-decoration-attachment][data-part=${String(t)}]`);for(const e of n)e.remove()},oT=e=>{e.style.backgroundColor=""},iT=(e,t,n,r,o,i,a)=>{const s=(e=>{const t=new Map;for(const n of e||[]){const e=n.range.start.line+1,r=t.get(e);r?r.push(n):t.set(e,[n])}return t})(n);for(const n of r.keys())if(!s.has(n)){const r=e.getCodeElementFromLineNumber(t,n,a);r&&rT(r,a);const o=e.getLineElementFromLineNumber(t,n,a);o&&oT(o)}for(const[n,c]of s){const s=r.get(n);if(i===o&&Ot()(c,s))continue;const l=e.getCodeElementFromLineNumber(t,n,a);if(!l){if(void 0===a)throw new Error(`Unable to find code element for line ${n}`);continue}const u=e.getLineElementFromLineNumber(t,n,a);if(u){rT(l,a),oT(u);for(const e of c){const t=La(e,o);if(t.backgroundColor){let n;n=e.isWholeLine?u:l,n.style.backgroundColor=t.backgroundColor}if(e.after){const t=Ma(e.after,o),n=e=>n=>{const r=document.createElement("a");return r.setAttribute("href",e),r.setAttribute("target",er(e)?"_blank":""),r.setAttribute("rel","noreferrer noopener"),r.style.color=t.color||"",r.append(n),r},r=document.createElement("span");r.style.color=t.color||"",r.style.backgroundColor=t.backgroundColor||"",r.textContent=e.after.contentText||null,e.after.hoverMessage&&(r.title=e.after.hoverMessage);const i=e.after.linkURL?n(e.after.linkURL)(r):r;i.dataset.part=String(a),i.className="sourcegraph-extension-element",i.dataset.lineDecorationAttachment="true",l.append(i)}}}else if(void 0===a)throw new Error(`Could not find line element for line ${n}`)}return s};var aT=1,sT=function(){return Promise.resolve()}(),cT={};function lT(e){return e in cT&&(delete cT[e],!0)}var uT=function(e){var t=aT++;return cT[t]=!0,sT.then((function(){return lT(t)&&e()})),t},fT=function(e){lT(e)},pT=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return w(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=uT(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(fT(n),t.scheduled=void 0)},t}(Re),dT=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return w(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,o=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<o&&(e=n.shift()));if(this.active=!1,t){for(;++r<o&&(e=n.shift());)e.unsubscribe();throw t}},t}(Le))(pT),hT=n(3621),mT=n(26451),gT=n(42723),vT=n(15478);class bT{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new yT(e,this.defaultValue))}}class yT extends mT.OuterSubscriber{activeObservables=0;values=[];observables=[];scheduled=!1;constructor(e,t){super(e),this.defaultValue=t}_next(e){void 0!==this.defaultValue&&this.values.push(this.defaultValue),this.observables.push(e)}_complete(){this.activeObservables=this.observables.length;for(let e=0;e<this.observables.length;e++)this.add((0,vT.D)(this,this.observables[e],this.observables[e],e))}notifyComplete(){this.activeObservables--,0===this.activeObservables&&this.destination.complete&&this.destination.complete()}notifyNext(e,t,n){this.values[n]=t,1!==this.activeObservables?this.scheduled||(this.scheduled=!0,dT.schedule((()=>{this.scheduled&&this.destination.next&&this.destination.next(this.values.slice()),this.scheduled=!1}))):this.destination.next&&this.destination.next(this.values.slice())}}function wT(e){return Pc?z(void 0):Vc("sync","dismissedHoverAlerts").pipe(ze((t=>function(e,t){switch(e.length){case 0:return z([]);case 1:return rl(...e);default:return new hT.Observable((0,gT.subscribeToArray)(e)).lift(new bT(t))}}(e).pipe(H((e=>t?e.filter((({type:e})=>!e||!t[e])):e))))),st((e=>(console.error("Error getting hover alerts",e),[void 0]))),ue([]))}async function ET(e){try{const t={dismissedHoverAlerts:{},...await qc.sync.get("dismissedHoverAlerts")};t.dismissedHoverAlerts[e]=!0,await qc.sync.set(t)}catch(e){console.error("Error dismissing alert",e)}}var _T=n(3369),xT=n.n(_T);const ST="ViewOnSourcegraphButton-module__icon--muted_1fDz9";function OT(){return(OT=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 TT=({codeHostType:e,repoExistsOrError:n,sourcegraphURL:r,userSettingsURL:o,context:a,minimalUI:s,onConfigureSourcegraphClick:c,showSignInButton:l,onSignInClose:u,className:f,iconClassName:p})=>{f=i()("open-on-sourcegraph",f);const d=i()(ST,p),h={className:f,iconClassName:p},{rawRepoName:m,revision:g,privateRepository:v}=a;if(void 0===n)return null;const b=Tc(new URL(`/${m}${g?`@${g}`:""}`,r),{utm_source:Fc(),utm_campaign:"view-on-sourcegraph"}).href;if(cn(n)){if(lr(n))return l?t.createElement(nl,OT({},h,{sourcegraphURL:r,onSignInClose:u})):null;const o={...h,href:new URL(xT()(e),"https://docs.sourcegraph.com/integration/").href,onClick:c};return t.createElement(tl,OT({},o,{iconClassName:d,href:b,label:"Error",title:n.message,ariaLabel:n.message}))}return n?s?null:t.createElement(tl,OT({},h,{href:b,title:"View repository on Sourcegraph",ariaLabel:"View repository on Sourcegraph"})):Uc(r)&&v&&o?t.createElement(CT,OT({},h,{codeHostType:e,href:o})):t.createElement(tl,OT({},h,{href:b,iconClassName:d,label:"Repository not found",title:`The repository does not exist on the configured Sourcegraph instance ${r}`,ariaLabel:`The repository does not exist on the configured Sourcegraph instance ${r}`}))},CT=({onConfigureSourcegraphClick:e,codeHostType:n,...r})=>t.createElement(tl,OT({},r,{href:r.href||new URL(xT()(n),"https://docs.sourcegraph.com/integration/").href,onClick:e,label:"Configure Sourcegraph",title:"Set up Sourcegraph for search and code intelligence on private repositories",ariaLabel:"Set up Sourcegraph for search and code intelligence on private repositories"})),kT="codeHost-module__hover-overlay_1k2Tk";function NT(){return(NT=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)}Gn||(Gn=!0,(0,zn.registerLanguage)("go",n(2806)),(0,zn.registerLanguage)("javascript",n(31566)),(0,zn.registerLanguage)("typescript",n(97159)),(0,zn.registerLanguage)("java",n(4168)),(0,zn.registerLanguage)("python",n(15664)),(0,zn.registerLanguage)("php",n(29019)),(0,zn.registerLanguage)("bash",n(45804)),(0,zn.registerLanguage)("clojure",n(40153)),(0,zn.registerLanguage)("c-like",n(57576)),(0,zn.registerLanguage)("cpp",n(41727)),(0,zn.registerLanguage)("cs",n(88671)),(0,zn.registerLanguage)("csharp",n(88671)),(0,zn.registerLanguage)("css",n(37018)),(0,zn.registerLanguage)("dockerfile",n(86651)),(0,zn.registerLanguage)("elixir",n(67157)),(0,zn.registerLanguage)("haskell",n(26357)),(0,zn.registerLanguage)("html",n(58422)),(0,zn.registerLanguage)("lua",n(85407)),(0,zn.registerLanguage)("ocaml",n(2755)),(0,zn.registerLanguage)("r",n(17292)),(0,zn.registerLanguage)("ruby",n(30601)),(0,zn.registerLanguage)("rust",n(55610)),(0,zn.registerLanguage)("swift",n(58633)),(0,zn.registerLanguage)("markdown",n(56924)),(0,zn.registerLanguage)("diff",n(49900)),(0,zn.registerLanguage)("json",n(89475)),(0,zn.registerLanguage)("jsonc",n(89475)),(0,zn.registerLanguage)("yaml",n(14037)),(0,zn.registerLanguage)("kotlin",n(40282)),(0,zn.registerLanguage)("dart",n(60627)),(0,zn.registerLanguage)("perl",n(60583)),(0,zn.registerLanguage)("scala",n(5542)),(0,zn.registerLanguage)("graphql",Hn.definer),(0,zn.registerLanguage)("apex",n(4168)),(0,zn.registerLanguage)("http",n(9737)));const AT=(e,t)=>{const n=document.createElement("div");return n.classList.add("hover-overlay-mount",`hover-overlay-mount__${e}`),t.append(n),n};function IT({mutations:e,codeHost:n,platformContext:r,extensionsController:o,render:s,telemetryService:c,hoverAlerts:l,repoSyncErrors:u}){const f=new g,p=new ye,d=document.body,h=new ye;f.add(function({extensionsController:e,platformContext:{urlToFile:t,requestGraphQL:n},history:r,locationAssign:o}){const i=new g;return{contributionsPromise:e.extHostAPI.then((s=>{const c=s.registerContributions({actions:[{id:"goToDefinition",title:"Go to definition",command:"goToDefinition",commandArguments:["${json(hoverPosition)}"]},{id:"goToDefinition.preloaded",title:"Go to definition",disabledTitle:"You are at the definition",command:"open",commandArguments:["${goToDefinition.url}"]}],menus:{hover:[{action:"goToDefinition",when:"goToDefinition.error || goToDefinition.showLoading",disabledWhen:"hoveredOnDefinition"},{action:"goToDefinition.preloaded",when:"goToDefinition.url",disabledWhen:"hoveredOnDefinition"}]}});i.add(Yr(c)),i.add(e.registerCommand({command:"goToDefinition",run:async i=>{const c=JSON.parse(i),{result:l}=await Xr(s.getDefinition(c)).pipe(Sa({urlToFile:t,requestGraphQL:n},{getWorkspaceRoots:()=>ee(e.extHostAPI).pipe(ze((e=>Xr(e.getWorkspaceRoots()))))},c),rn((({isLoading:e,result:t})=>!e||null!==t))).toPromise();if(!l)throw new Error("No definition found.");if(l.url===a.Ep(r.location)){if(l.multiple)throw new Error("Multiple definitions shown in panel below.");throw new Error("Already at the definition.")}er(l.url)?o(l.url):r.push(l.url)}}));const l=s.registerContributions({actions:[{id:"findReferences",title:"Find references",command:"open",commandArguments:["${findReferences.url}"]}],menus:{hover:[{action:"findReferences",when:"findReferences.url && (goToDefinition.showLoading || goToDefinition.url || goToDefinition.error)",disabledWhen:"false"}]}});return i.add(Yr(l)),Promise.all([c,l])})).then((()=>{})).catch((()=>{console.error('Failed to register "Go to Definition" and "Find references" actions with extension host')})),unsubscribe:i.unsubscribe.bind(i)}}({extensionsController:o,platformContext:r,history:a.lX(),locationAssign:location.assign.bind(location)}));const m=Vn({hoverOverlayElements:p,hoverOverlayRerenders:h.pipe(Fe(p),H((([,e])=>({hoverOverlayElement:e,relativeElement:d}))),qe((v="hoverOverlayElement",b=Kn,e=>b(e[v])))),getHover:({line:e,character:t,part:r,...i})=>le([{isLoading:!0,result:null}],Oe([ee(o.extHostAPI).pipe(Fe(u),ze((([n,r])=>r?z({isLoading:!0,result:null}):Xr(n.getHover($c({...i,position:{line:e,character:t}})))))),wT([...l,u.pipe(Qe(),H((e=>e?(e=>{var t,n;return{type:"private-code",summary:{kind:Da.MarkupKind.Markdown,value:`#### Sourcegraph for private code\n\nTo get Sourcegraph hovers on your private repositories, you need to set up a private Sourcegraph instance and connect it to the browser extension.\n\n<a href="https://docs.sourcegraph.com/code_search/how-to/adding_repositories_to_cloud" class="${null!==(t=null===(n=e.hoverOverlayClassProps)||void 0===n?void 0:n.actionItemClassName)&&void 0!==t?t:""}" target="_blank" rel="noopener norefferer">Show more info</a>`}}})(n):void 0)),qe(Kn))])]).pipe(H((([{isLoading:e,result:t},n])=>({isLoading:e,result:t||null!=n&&n.length?{contents:[],...t,alerts:n}:null}))))),getDocumentHighlights:({line:e,character:t,part:n,...r})=>ee(o.extHostAPI).pipe(Fe(u),ze((([n,o])=>o?z([]):Xr(n.getDocumentHighlights($c({...r,position:{line:e,character:t}})))))),getActions:e=>u.pipe(Ye(1),ze((t=>t?z([]):_a({extensionsController:o,platformContext:r},e)))),tokenize:n.codeViewsRequireTokenization});var v,b;class y extends t.Component{subscription=new g;nextOverlayElement=p.next.bind(p);constructor(e){super(e),this.state={...m.hoverState,isLightTheme:!0}}componentDidMount(){this.subscription.add(m.hoverStateUpdates.subscribe((e=>{this.setState(e)}))),this.subscription.add(m.hoverStateUpdates.pipe(Fe(Kl("clickToGoToDefinition")),qe((([,e])=>e)),H((([e])=>e)),ze((({hoveredTokenElement:e,hoverOverlayProps:t})=>{if(void 0===e)return ke;if(void 0===t)return ke;const{actionsOrError:n}=t,r=Array.isArray(n)&&n.find((e=>"goToDefinition.preloaded"===e.action.id&&!e.disabledWhen)),o=Array.isArray(n)&&n.find((e=>"findReferences"===e.action.id&&!e.disabledWhen)),i=r||o;if(!i)return ke;const a=wo(i.action,window.location.hash);if(!a)return ke;const s=e.style.cursor;return e.style.cursor="pointer",Ae(e,"click").pipe(tt((()=>{const e=window.getSelection();if(null!==e&&""!==e.toString())return;const t=i===r?"definition":"reference";c.log(`${t}CodeHost.click`),window.location.href=a})),ot((()=>e.style.cursor=s)))}))).subscribe()),n.isLightTheme&&this.subscription.add(n.isLightTheme.subscribe((e=>{this.setState({isLightTheme:e})}))),h.next()}componentWillUnmount(){this.subscription.unsubscribe()}componentDidUpdate(){h.next()}handleHoverLinkClick=e=>{const t=e.target;if(!er(t.href))return;const n=Tc(new URL(t.href),{utm_source:Fc(),utm_campaign:"hover"}).href;var r;"_blank"===t.getAttribute("target")?window.open(n,"_blank",null!==(r=t.getAttribute("rel"))&&void 0!==r?r:void 0):window.location.href=n;e.preventDefault()};render(){var e;const s=this.getHoverOverlayProps();return s?t.createElement(Cl,{onClick:this.handleHoverLinkClick},t.createElement(Oc,NT({},s,n.hoverOverlayClassProps,{className:i()(kT,null===(e=n.hoverOverlayClassProps)||void 0===e?void 0:e.className),telemetryService:c,isLightTheme:this.state.isLightTheme,hoverRef:this.nextOverlayElement,extensionsController:o,platformContext:r,location:a.ob(window.location),onAlertDismissed:ET,useBrandedLogo:!0}))):null}getHoverOverlayProps(){if(!this.state.hoverOverlayProps)return;let{overlayPosition:e,...t}=this.state.hoverOverlayProps;return e&&n.adjustOverlayPosition&&(e=n.adjustOverlayPosition(e)),{...t,overlayPosition:e}}}const{getHoverOverlayMountLocation:w}=n;if(w){let r=null;f.add(function(e,t){return t.pipe(ce(),H((({addedNodes:t,removedNodes:n})=>{const r=e();if(null===r)return document.body;for(const e of t){if(!(e instanceof HTMLElement))continue;const t=he(e,r);if(t)return t}for(const e of n)if(e instanceof HTMLElement&&he(e,r))return document.body;return null})),qe(Kn),ue(document.body),Qe())}(w,e).subscribe((e=>{r&&r.remove();const o=AT(n.type,e);r=o,s(t.createElement(y,null),o)})))}else{const e=AT(n.type,document.body);s(t.createElement(y,null),e)}return{hoverifier:m,subscription:f}}const PT=async e=>{e.preventDefault(),Ic&&await Dc.openOptionsPage()},RT=(e,t,n)=>{const r=new URL(`${t}/repositories/manage`,e);return r.searchParams.set("filter",n),r.href},DT=e=>e({request:fr`
218
218
  query UserSettingsURL {
219
219
  currentUser {
220
220
  settingsURL
221
221
  }
222
222
  }
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWdyYXRpb24uYnVuZGxlLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQHNvdXJjZWdyYXBoL2Jyb3dzZXIvaW50ZWdyYXRpb24uYnVuZGxlLmpzIl0sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7OztBQStxbUVBOzs7Ozs7QUFtNVZBOzs7Ozs7Ozs7Ozs7Ozs7QUE4Q0E7Ozs7Ozs7Ozs7O0FBdURBOzs7Ozs7Ozs7O0FBcURBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTBLQTs7Ozs7O0FBb2RBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTJDQTs7Ozs7O0FBbS9RQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBMk5BOzs7Ozs7Ozs7Ozs7OztBQW8vSkE7Ozs7Ozs7Ozs7Ozs7O0FBcUJBOzs7Ozs7Ozs7O0FBdTBLQTs7Ozs7Ozs7OztBQWpDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBaWhZQTs7Ozs7O0FBdEVBO0FBRUE7Ozs7OztBQXV5Q0EiLCJzb3VyY2VSb290IjoiIn0=
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).pipe(ue(void 0))]).subscribe((([e,o,i,a,s])=>{l(t.createElement(TT,NT({},r,{codeHostType:n.type,context:a,minimalUI:u,sourcegraphURL:b,userSettingsURL:s&&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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWdyYXRpb24uYnVuZGxlLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQHNvdXJjZWdyYXBoL2Jyb3dzZXIvaW50ZWdyYXRpb24uYnVuZGxlLmpzIl0sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7OztBQStxbUVBOzs7Ozs7QUFzNVZBOzs7Ozs7Ozs7Ozs7Ozs7QUE4Q0E7Ozs7Ozs7Ozs7O0FBdURBOzs7Ozs7Ozs7O0FBcURBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTBLQTs7Ozs7O0FBb2RBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTJDQTs7Ozs7O0FBMitRQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBMk5BOzs7Ozs7Ozs7Ozs7OztBQXEvSkE7Ozs7Ozs7Ozs7Ozs7O0FBcUJBOzs7Ozs7Ozs7O0FBdTBLQTs7Ozs7Ozs7OztBQWpDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb2hZQTs7Ozs7O0FBdEVBO0FBRUE7Ozs7OztBQXV5Q0EiLCJzb3VyY2VSb290IjoiIn0=