GitHub Line Count

Count lines of code in GitHub repositories

  1. // ==UserScript==
  2. // @name GitHub Line Count
  3. // @description Count lines of code in GitHub repositories
  4. // @description:zh-CN 统计 GitHub 仓库的代码行数
  5. // @version 1.1.0
  6. // @author Wybxc
  7. // @homepage https://github.com/Wybxc/github-line-count
  8. // @match *://github.com/*
  9. // @connect api.github.com
  10. // @grant GM_registerMenuCommand
  11. // @grant GM_getValue
  12. // @grant GM_setValue
  13. // @grant GM.xmlHttpRequest
  14. // @grant GM_xmlHttpRequest
  15. // @license GPL-2.0-or-later
  16. // @namespace https://github.com/Wybxc/github-line-count
  17. // @require https://unpkg.com/badgen@3.2.3
  18. // @require https://unpkg.com/human-format@1.2.1
  19. // @require https://unpkg.com/@trim21/gm-fetch@0.3.0/dist/gm_fetch.js
  20. // ==/UserScript==
  21.  
  22. (() => { // webpackBootstrap
  23. "use strict";
  24. var __webpack_modules__ = ({
  25. 163: (function (module, __unused_webpack___webpack_exports__, __webpack_require__) {
  26. __webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {
  27. /* ESM import */var _trim21_gm_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(568);
  28. /* ESM import */var _trim21_gm_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_trim21_gm_fetch__WEBPACK_IMPORTED_MODULE_0__);
  29. /* ESM import */var _octokit_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(635);
  30. /* ESM import */var _octokit_request_error__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(736);
  31. /* ESM import */var human_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(414);
  32. /* ESM import */var human_format__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(human_format__WEBPACK_IMPORTED_MODULE_1__);
  33. function _array_like_to_array(arr, len) {
  34. if (len == null || len > arr.length) len = arr.length;
  35. for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
  36. return arr2;
  37. }
  38. function _array_with_holes(arr) {
  39. if (Array.isArray(arr)) return arr;
  40. }
  41. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  42. try {
  43. var info = gen[key](arg);
  44. var value = info.value;
  45. } catch (error) {
  46. reject(error);
  47. return;
  48. }
  49. if (info.done) {
  50. resolve(value);
  51. } else {
  52. Promise.resolve(value).then(_next, _throw);
  53. }
  54. }
  55. function _async_to_generator(fn) {
  56. return function() {
  57. var self = this, args = arguments;
  58. return new Promise(function(resolve, reject) {
  59. var gen = fn.apply(self, args);
  60. function _next(value) {
  61. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  62. }
  63. function _throw(err) {
  64. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  65. }
  66. _next(undefined);
  67. });
  68. };
  69. }
  70. function _instanceof(left, right) {
  71. if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
  72. return !!right[Symbol.hasInstance](left);
  73. } else {
  74. return left instanceof right;
  75. }
  76. }
  77. function _iterable_to_array_limit(arr, i) {
  78. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  79. if (_i == null) return;
  80. var _arr = [];
  81. var _n = true;
  82. var _d = false;
  83. var _s, _e;
  84. try {
  85. for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
  86. _arr.push(_s.value);
  87. if (i && _arr.length === i) break;
  88. }
  89. } catch (err) {
  90. _d = true;
  91. _e = err;
  92. } finally{
  93. try {
  94. if (!_n && _i["return"] != null) _i["return"]();
  95. } finally{
  96. if (_d) throw _e;
  97. }
  98. }
  99. return _arr;
  100. }
  101. function _non_iterable_rest() {
  102. throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  103. }
  104. function _sliced_to_array(arr, i) {
  105. return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
  106. }
  107. function _unsupported_iterable_to_array(o, minLen) {
  108. if (!o) return;
  109. if (typeof o === "string") return _array_like_to_array(o, minLen);
  110. var n = Object.prototype.toString.call(o).slice(8, -1);
  111. if (n === "Object" && o.constructor) n = o.constructor.name;
  112. if (n === "Map" || n === "Set") return Array.from(n);
  113. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
  114. }
  115. function _ts_generator(thisArg, body) {
  116. var f, y, t, g, _ = {
  117. label: 0,
  118. sent: function() {
  119. if (t[0] & 1) throw t[1];
  120. return t[1];
  121. },
  122. trys: [],
  123. ops: []
  124. };
  125. return g = {
  126. next: verb(0),
  127. "throw": verb(1),
  128. "return": verb(2)
  129. }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
  130. return this;
  131. }), g;
  132. function verb(n) {
  133. return function(v) {
  134. return step([
  135. n,
  136. v
  137. ]);
  138. };
  139. }
  140. function step(op) {
  141. if (f) throw new TypeError("Generator is already executing.");
  142. while(_)try {
  143. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  144. if (y = 0, t) op = [
  145. op[0] & 2,
  146. t.value
  147. ];
  148. switch(op[0]){
  149. case 0:
  150. case 1:
  151. t = op;
  152. break;
  153. case 4:
  154. _.label++;
  155. return {
  156. value: op[1],
  157. done: false
  158. };
  159. case 5:
  160. _.label++;
  161. y = op[1];
  162. op = [
  163. 0
  164. ];
  165. continue;
  166. case 7:
  167. op = _.ops.pop();
  168. _.trys.pop();
  169. continue;
  170. default:
  171. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  172. _ = 0;
  173. continue;
  174. }
  175. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  176. _.label = op[1];
  177. break;
  178. }
  179. if (op[0] === 6 && _.label < t[1]) {
  180. _.label = t[1];
  181. t = op;
  182. break;
  183. }
  184. if (t && _.label < t[2]) {
  185. _.label = t[2];
  186. _.ops.push(op);
  187. break;
  188. }
  189. if (t[2]) _.ops.pop();
  190. _.trys.pop();
  191. continue;
  192. }
  193. op = body.call(thisArg, _);
  194. } catch (e) {
  195. op = [
  196. 6,
  197. e
  198. ];
  199. y = 0;
  200. } finally{
  201. f = t = 0;
  202. }
  203. if (op[0] & 5) throw op[1];
  204. return {
  205. value: op[0] ? op[1] : void 0,
  206. done: true
  207. };
  208. }
  209. }
  210.  
  211.  
  212.  
  213.  
  214. var gh_pat = GM_getValue("gh_pat", "");
  215. GM_registerMenuCommand(gh_pat ? "Set GitHub PAT (already set ✅)" : "Set GitHub PAT", /*#__PURE__*/ _async_to_generator(function() {
  216. var pat;
  217. return _ts_generator(this, function(_state) {
  218. switch(_state.label){
  219. case 0:
  220. pat = prompt("To avoid 429 errors, it's recommended to set a GitHub Personal Access Token (PAT) with the access to public repositories. It will also enable stats for private repositories if you provide the necessary permissions.\nEnter your GitHub Personal Access Token (PAT):");
  221. if (!pat) return [
  222. 3,
  223. 2
  224. ];
  225. GM_setValue("gh_pat", pat);
  226. console.log("GitHub PAT has been set successfully.");
  227. return [
  228. 4,
  229. renderLoc()
  230. ];
  231. case 1:
  232. _state.sent();
  233. return [
  234. 3,
  235. 3
  236. ];
  237. case 2:
  238. console.log("No PAT entered, operation cancelled.");
  239. _state.label = 3;
  240. case 3:
  241. return [
  242. 2
  243. ];
  244. }
  245. });
  246. }), {
  247. id: "set-gh-pat",
  248. title: "Set GitHub PAT"
  249. });
  250. var githubIcon = "data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+R2l0SHViPC90aXRsZT48cGF0aCBkPSJNMTIgLjI5N2MtNi42MyAwLTEyIDUuMzczLTEyIDEyIDAgNS4zMDMgMy40MzggOS44IDguMjA1IDExLjM4NS42LjExMy44Mi0uMjU4LjgyLS41NzcgMC0uMjg1LS4wMS0xLjA0LS4wMTUtMi4wNC0zLjMzOC43MjQtNC4wNDItMS42MS00LjA0Mi0xLjYxQzQuNDIyIDE4LjA3IDMuNjMzIDE3LjcgMy42MzMgMTcuN2MtMS4wODctLjc0NC4wODQtLjcyOS4wODQtLjcyOSAxLjIwNS4wODQgMS44MzggMS4yMzYgMS44MzggMS4yMzYgMS4wNyAxLjgzNSAyLjgwOSAxLjMwNSAzLjQ5NS45OTguMTA4LS43NzYuNDE3LTEuMzA1Ljc2LTEuNjA1LTIuNjY1LS4zLTUuNDY2LTEuMzMyLTUuNDY2LTUuOTMgMC0xLjMxLjQ2NS0yLjM4IDEuMjM1LTMuMjItLjEzNS0uMzAzLS41NC0xLjUyMy4xMDUtMy4xNzYgMCAwIDEuMDA1LS4zMjIgMy4zIDEuMjMuOTYtLjI2NyAxLjk4LS4zOTkgMy0uNDA1IDEuMDIuMDA2IDIuMDQuMTM4IDMgLjQwNSAyLjI4LTEuNTUyIDMuMjg1LTEuMjMgMy4yODUtMS4yMy42NDUgMS42NTMuMjQgMi44NzMuMTIgMy4xNzYuNzY1Ljg0IDEuMjMgMS45MSAxLjIzIDMuMjIgMCA0LjYxLTIuODA1IDUuNjI1LTUuNDc1IDUuOTIuNDIuMzYuODEgMS4wOTYuODEgMi4yMiAwIDEuNjA2LS4wMTUgMi44OTYtLjAxNSAzLjI4NiAwIC4zMTUuMjEuNjkuODI1LjU3QzIwLjU2NSAyMi4wOTIgMjQgMTcuNTkyIDI0IDEyLjI5N2MwLTYuNjI3LTUuMzczLTEyLTEyLTEyIi8+PC9zdmc+";
  251. function renderBadge(options, title) {
  252. var _document_getElementById, _document_querySelector;
  253. var badge = window.badgen(options); // Workaround
  254. (_document_getElementById = document.getElementById("github-line-count")) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.remove();
  255. (_document_querySelector = document.querySelector(".AppHeader-context-full > nav > ul")) === null || _document_querySelector === void 0 ? void 0 : _document_querySelector.insertAdjacentHTML("beforeend", '<li id="github-line-count" style="margin-left: 0.5em">'.concat(badge, "</li>"));
  256. if (title) {
  257. var el = document.querySelector("#github-line-count > svg > title");
  258. if (el) {
  259. el.textContent = title;
  260. }
  261. }
  262. }
  263. function getCodeFrequencyStats(owner, repo) {
  264. return _getCodeFrequencyStats.apply(this, arguments);
  265. }
  266. function _getCodeFrequencyStats() {
  267. _getCodeFrequencyStats = _async_to_generator(function(owner, repo) {
  268. var gh_pat, octokit, response;
  269. return _ts_generator(this, function(_state) {
  270. switch(_state.label){
  271. case 0:
  272. gh_pat = GM_getValue("gh_pat", "");
  273. octokit = new _octokit_core__WEBPACK_IMPORTED_MODULE_2__/* .Octokit */.v({
  274. auth: gh_pat || undefined,
  275. request: {
  276. fetch: (_trim21_gm_fetch__WEBPACK_IMPORTED_MODULE_0___default())
  277. }
  278. });
  279. _state.label = 1;
  280. case 1:
  281. if (false) {}
  282. return [
  283. 4,
  284. octokit.request("GET /repos/{owner}/{repo}/stats/code_frequency", {
  285. owner: owner,
  286. repo: repo
  287. })
  288. ];
  289. case 2:
  290. response = _state.sent();
  291. if (response.status === 200) {
  292. return [
  293. 2,
  294. response.data
  295. ];
  296. }
  297. // The response may be 202, in which case we need to wait and retry
  298. return [
  299. 4,
  300. new Promise(function(resolve) {
  301. return setTimeout(resolve, 2000);
  302. })
  303. ];
  304. case 3:
  305. _state.sent();
  306. return [
  307. 3,
  308. 1
  309. ];
  310. case 4:
  311. return [
  312. 2
  313. ];
  314. }
  315. });
  316. });
  317. return _getCodeFrequencyStats.apply(this, arguments);
  318. }
  319. function getFileTreeList(owner, repo, branch) {
  320. return _getFileTreeList.apply(this, arguments);
  321. }
  322. function _getFileTreeList() {
  323. _getFileTreeList = _async_to_generator(function(owner, repo, branch) {
  324. var gh_pat, octokit, response;
  325. return _ts_generator(this, function(_state) {
  326. switch(_state.label){
  327. case 0:
  328. gh_pat = GM_getValue("gh_pat", "");
  329. octokit = new _octokit_core__WEBPACK_IMPORTED_MODULE_2__/* .Octokit */.v({
  330. auth: gh_pat || undefined,
  331. request: {
  332. fetch: (_trim21_gm_fetch__WEBPACK_IMPORTED_MODULE_0___default())
  333. }
  334. });
  335. return [
  336. 4,
  337. octokit.request("GET /repos/{owner}/{repo}/git/trees/{tree_sha}", {
  338. owner: owner,
  339. repo: repo,
  340. tree_sha: branch,
  341. recursive: "1"
  342. })
  343. ];
  344. case 1:
  345. response = _state.sent();
  346. return [
  347. 2,
  348. response.data.tree.filter(function(file) {
  349. return file.type === "tree";
  350. })
  351. ];
  352. }
  353. });
  354. });
  355. return _getFileTreeList.apply(this, arguments);
  356. }
  357. function queryLineCount(owner, repo, treePaths) {
  358. return _queryLineCount.apply(this, arguments);
  359. }
  360. function _queryLineCount() {
  361. _queryLineCount = _async_to_generator(function(owner, repo, treePaths) {
  362. var gh_pat, octokit, queries, response;
  363. return _ts_generator(this, function(_state) {
  364. switch(_state.label){
  365. case 0:
  366. gh_pat = GM_getValue("gh_pat", "");
  367. octokit = new _octokit_core__WEBPACK_IMPORTED_MODULE_2__/* .Octokit */.v({
  368. auth: gh_pat || undefined,
  369. request: {
  370. fetch: (_trim21_gm_fetch__WEBPACK_IMPORTED_MODULE_0___default())
  371. }
  372. });
  373. queries = treePaths.map(function(path, i) {
  374. return "file".concat(i, ': object(expression: "HEAD:').concat(path, '") {\n ... on Tree {\n entries {\n isGenerated\n lineCount\n }\n }\n }');
  375. }).join("\n");
  376. return [
  377. 4,
  378. octokit.graphql("query ($owner: String!, $repo: String!) {\n repository(owner: $owner, name: $repo) {\n ".concat(queries, "\n }\n }"), {
  379. owner: owner,
  380. repo: repo
  381. })
  382. ];
  383. case 1:
  384. response = _state.sent();
  385. return [
  386. 2,
  387. Object.values(response.repository).flatMap(function(param) {
  388. var entries = param.entries;
  389. return entries;
  390. }).filter(function(entry) {
  391. return !entry.isGenerated;
  392. }).reduce(function(acc, entry) {
  393. return acc + entry.lineCount;
  394. }, 0)
  395. ];
  396. }
  397. });
  398. });
  399. return _queryLineCount.apply(this, arguments);
  400. }
  401. function getErrorMessage(error) {
  402. if (_instanceof(error, _octokit_request_error__WEBPACK_IMPORTED_MODULE_3__/* .RequestError */.L)) {
  403. if (error.status === 422) {
  404. return "Too many commits";
  405. }
  406. return "HTTP ".concat(error.status);
  407. }
  408. return "".concat(error).substring(0, 20);
  409. }
  410. function renderLoc() {
  411. return _renderLoc.apply(this, arguments);
  412. }
  413. function _renderLoc() {
  414. _renderLoc = _async_to_generator(function() {
  415. var _document_querySelector, _document_querySelector1, _document_querySelector2, owner, repository, branch, repoKey, cachedLoc, lastUpdated, oneHour, loc, tree, error, stats, fallbackError;
  416. return _ts_generator(this, function(_state) {
  417. switch(_state.label){
  418. case 0:
  419. if (document.getElementById("github-line-count")) {
  420. return [
  421. 2
  422. ];
  423. }
  424. owner = (_document_querySelector = document.querySelector(".AppHeader-context-full > nav > ul > li:nth-child(1) > a")) === null || _document_querySelector === void 0 ? void 0 : _document_querySelector.innerText.trim();
  425. repository = (_document_querySelector1 = document.querySelector(".AppHeader-context-full > nav > ul > li:nth-child(2) > a")) === null || _document_querySelector1 === void 0 ? void 0 : _document_querySelector1.innerText.trim();
  426. branch = (_document_querySelector2 = document.querySelector("button#branch-picker-repos-header-ref-selector")) === null || _document_querySelector2 === void 0 ? void 0 : _document_querySelector2.innerText.trim();
  427. if (!owner || !repository || !branch) {
  428. return [
  429. 2
  430. ];
  431. }
  432. renderBadge({
  433. label: "Lines",
  434. status: "Loading...",
  435. color: "gray",
  436. icon: githubIcon
  437. });
  438. // Check cache first
  439. repoKey = "".concat(owner, "/").concat(repository);
  440. cachedLoc = GM_getValue("".concat(repoKey, "/loc"), -1);
  441. lastUpdated = GM_getValue("".concat(repoKey, "/lastUpdated"), 0);
  442. oneHour = 60 * 60 * 1000;
  443. if (Date.now() - lastUpdated < oneHour && cachedLoc >= 0) {
  444. renderBadge({
  445. label: "Lines",
  446. status: human_format__WEBPACK_IMPORTED_MODULE_1___default()(cachedLoc),
  447. color: cachedLoc < 10000 ? "green" : cachedLoc < 100000 ? "orange" : "red",
  448. icon: githubIcon
  449. }, "Lines: ".concat(cachedLoc));
  450. return [
  451. 2
  452. ];
  453. }
  454. loc = -1;
  455. _state.label = 1;
  456. case 1:
  457. _state.trys.push([
  458. 1,
  459. 4,
  460. ,
  461. 9
  462. ]);
  463. return [
  464. 4,
  465. getFileTreeList(owner, repository, branch)
  466. ];
  467. case 2:
  468. tree = _state.sent();
  469. return [
  470. 4,
  471. queryLineCount(owner, repository, tree.map(function(file) {
  472. return file.path;
  473. }))
  474. ];
  475. case 3:
  476. loc = _state.sent();
  477. return [
  478. 3,
  479. 9
  480. ];
  481. case 4:
  482. error = _state.sent();
  483. console.error("Error getting line count from file tree:", error);
  484. _state.label = 5;
  485. case 5:
  486. _state.trys.push([
  487. 5,
  488. 7,
  489. ,
  490. 8
  491. ]);
  492. return [
  493. 4,
  494. getCodeFrequencyStats(owner, repository)
  495. ];
  496. case 6:
  497. stats = _state.sent();
  498. loc = stats.reduce(function(acc, param) {
  499. var _param = _sliced_to_array(param, 3), _ = _param[0], additions = _param[1], deletions = _param[2];
  500. return acc + (additions !== null && additions !== void 0 ? additions : 0) + (deletions !== null && deletions !== void 0 ? deletions : 0);
  501. }, 0);
  502. return [
  503. 3,
  504. 8
  505. ];
  506. case 7:
  507. fallbackError = _state.sent();
  508. renderBadge({
  509. label: "Error",
  510. status: getErrorMessage(fallbackError),
  511. color: "red",
  512. icon: githubIcon
  513. });
  514. console.error("Error getting code frequency stats:", fallbackError);
  515. return [
  516. 2
  517. ];
  518. case 8:
  519. return [
  520. 3,
  521. 9
  522. ];
  523. case 9:
  524. // Cache the result and display if we got a valid line count
  525. if (loc >= 0) {
  526. GM_setValue("".concat(repoKey, "/loc"), loc);
  527. GM_setValue("".concat(repoKey, "/lastUpdated"), Date.now());
  528. renderBadge({
  529. label: "Lines",
  530. status: human_format__WEBPACK_IMPORTED_MODULE_1___default()(loc),
  531. color: loc < 10000 ? "green" : loc < 100000 ? "orange" : "red",
  532. icon: githubIcon
  533. }, "Lines: ".concat(loc));
  534. }
  535. return [
  536. 2
  537. ];
  538. }
  539. });
  540. });
  541. return _renderLoc.apply(this, arguments);
  542. }
  543. await renderLoc();
  544. // Observe for navigation changes
  545. new MutationObserver(renderLoc).observe(document.body, {
  546. childList: true
  547. });
  548.  
  549. __webpack_async_result__();
  550. } catch(e) { __webpack_async_result__(e); } }, 1);
  551.  
  552. }),
  553. 568: (function (module) {
  554. module.exports = GM_fetch;
  555.  
  556. }),
  557. 414: (function (module) {
  558. module.exports = humanFormat;
  559.  
  560. }),
  561. 648: (function (module) {
  562. var __webpack_unused_export__;
  563.  
  564.  
  565. const NullObject = function NullObject () { }
  566. NullObject.prototype = Object.create(null)
  567.  
  568. /**
  569. * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
  570. *
  571. * parameter = token "=" ( token / quoted-string )
  572. * token = 1*tchar
  573. * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
  574. * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
  575. * / DIGIT / ALPHA
  576. * ; any VCHAR, except delimiters
  577. * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
  578. * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
  579. * obs-text = %x80-FF
  580. * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
  581. */
  582. const paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu
  583.  
  584. /**
  585. * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
  586. *
  587. * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
  588. * obs-text = %x80-FF
  589. */
  590. const quotedPairRE = /\\([\v\u0020-\u00ff])/gu
  591.  
  592. /**
  593. * RegExp to match type in RFC 7231 sec 3.1.1.1
  594. *
  595. * media-type = type "/" subtype
  596. * type = token
  597. * subtype = token
  598. */
  599. const mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u
  600.  
  601. // default ContentType to prevent repeated object creation
  602. const defaultContentType = { type: '', parameters: new NullObject() }
  603. Object.freeze(defaultContentType.parameters)
  604. Object.freeze(defaultContentType)
  605.  
  606. /**
  607. * Parse media type to object.
  608. *
  609. * @param {string|object} header
  610. * @return {Object}
  611. * @public
  612. */
  613.  
  614. function parse (header) {
  615. if (typeof header !== 'string') {
  616. throw new TypeError('argument header is required and must be a string')
  617. }
  618.  
  619. let index = header.indexOf(';')
  620. const type = index !== -1
  621. ? header.slice(0, index).trim()
  622. : header.trim()
  623.  
  624. if (mediaTypeRE.test(type) === false) {
  625. throw new TypeError('invalid media type')
  626. }
  627.  
  628. const result = {
  629. type: type.toLowerCase(),
  630. parameters: new NullObject()
  631. }
  632.  
  633. // parse parameters
  634. if (index === -1) {
  635. return result
  636. }
  637.  
  638. let key
  639. let match
  640. let value
  641.  
  642. paramRE.lastIndex = index
  643.  
  644. while ((match = paramRE.exec(header))) {
  645. if (match.index !== index) {
  646. throw new TypeError('invalid parameter format')
  647. }
  648.  
  649. index += match[0].length
  650. key = match[1].toLowerCase()
  651. value = match[2]
  652.  
  653. if (value[0] === '"') {
  654. // remove quotes and escapes
  655. value = value
  656. .slice(1, value.length - 1)
  657.  
  658. quotedPairRE.test(value) && (value = value.replace(quotedPairRE, '$1'))
  659. }
  660.  
  661. result.parameters[key] = value
  662. }
  663.  
  664. if (index !== header.length) {
  665. throw new TypeError('invalid parameter format')
  666. }
  667.  
  668. return result
  669. }
  670.  
  671. function safeParse (header) {
  672. if (typeof header !== 'string') {
  673. return defaultContentType
  674. }
  675.  
  676. let index = header.indexOf(';')
  677. const type = index !== -1
  678. ? header.slice(0, index).trim()
  679. : header.trim()
  680.  
  681. if (mediaTypeRE.test(type) === false) {
  682. return defaultContentType
  683. }
  684.  
  685. const result = {
  686. type: type.toLowerCase(),
  687. parameters: new NullObject()
  688. }
  689.  
  690. // parse parameters
  691. if (index === -1) {
  692. return result
  693. }
  694.  
  695. let key
  696. let match
  697. let value
  698.  
  699. paramRE.lastIndex = index
  700.  
  701. while ((match = paramRE.exec(header))) {
  702. if (match.index !== index) {
  703. return defaultContentType
  704. }
  705.  
  706. index += match[0].length
  707. key = match[1].toLowerCase()
  708. value = match[2]
  709.  
  710. if (value[0] === '"') {
  711. // remove quotes and escapes
  712. value = value
  713. .slice(1, value.length - 1)
  714.  
  715. quotedPairRE.test(value) && (value = value.replace(quotedPairRE, '$1'))
  716. }
  717.  
  718. result.parameters[key] = value
  719. }
  720.  
  721. if (index !== header.length) {
  722. return defaultContentType
  723. }
  724.  
  725. return result
  726. }
  727.  
  728. __webpack_unused_export__ = { parse, safeParse }
  729. __webpack_unused_export__ = parse
  730. module.exports.safeParse = safeParse
  731. __webpack_unused_export__ = defaultContentType
  732.  
  733.  
  734. }),
  735. 635: (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
  736.  
  737. // EXPORTS
  738. __webpack_require__.d(__webpack_exports__, {
  739. v: () => (/* binding */ Octokit)
  740. });
  741.  
  742. ;// CONCATENATED MODULE: ./node_modules/universal-user-agent/index.js
  743. function getUserAgent() {
  744. if (typeof navigator === "object" && "userAgent" in navigator) {
  745. return navigator.userAgent;
  746. }
  747.  
  748. if (typeof process === "object" && process.version !== undefined) {
  749. return `Node.js/${process.version.substr(1)} (${process.platform}; ${
  750. process.arch
  751. })`;
  752. }
  753.  
  754. return "<environment undetectable>";
  755. }
  756.  
  757. ;// CONCATENATED MODULE: ./node_modules/before-after-hook/lib/register.js
  758. // @ts-check
  759.  
  760. function register(state, name, method, options) {
  761. if (typeof method !== "function") {
  762. throw new Error("method for before hook must be a function");
  763. }
  764.  
  765. if (!options) {
  766. options = {};
  767. }
  768.  
  769. if (Array.isArray(name)) {
  770. return name.reverse().reduce((callback, name) => {
  771. return register.bind(null, state, name, callback, options);
  772. }, method)();
  773. }
  774.  
  775. return Promise.resolve().then(() => {
  776. if (!state.registry[name]) {
  777. return method(options);
  778. }
  779.  
  780. return state.registry[name].reduce((method, registered) => {
  781. return registered.hook.bind(null, method, options);
  782. }, method)();
  783. });
  784. }
  785.  
  786. ;// CONCATENATED MODULE: ./node_modules/before-after-hook/lib/add.js
  787. // @ts-check
  788.  
  789. function addHook(state, kind, name, hook) {
  790. const orig = hook;
  791. if (!state.registry[name]) {
  792. state.registry[name] = [];
  793. }
  794.  
  795. if (kind === "before") {
  796. hook = (method, options) => {
  797. return Promise.resolve()
  798. .then(orig.bind(null, options))
  799. .then(method.bind(null, options));
  800. };
  801. }
  802.  
  803. if (kind === "after") {
  804. hook = (method, options) => {
  805. let result;
  806. return Promise.resolve()
  807. .then(method.bind(null, options))
  808. .then((result_) => {
  809. result = result_;
  810. return orig(result, options);
  811. })
  812. .then(() => {
  813. return result;
  814. });
  815. };
  816. }
  817.  
  818. if (kind === "error") {
  819. hook = (method, options) => {
  820. return Promise.resolve()
  821. .then(method.bind(null, options))
  822. .catch((error) => {
  823. return orig(error, options);
  824. });
  825. };
  826. }
  827.  
  828. state.registry[name].push({
  829. hook: hook,
  830. orig: orig,
  831. });
  832. }
  833.  
  834. ;// CONCATENATED MODULE: ./node_modules/before-after-hook/lib/remove.js
  835. // @ts-check
  836.  
  837. function removeHook(state, name, method) {
  838. if (!state.registry[name]) {
  839. return;
  840. }
  841.  
  842. const index = state.registry[name]
  843. .map((registered) => {
  844. return registered.orig;
  845. })
  846. .indexOf(method);
  847.  
  848. if (index === -1) {
  849. return;
  850. }
  851.  
  852. state.registry[name].splice(index, 1);
  853. }
  854.  
  855. ;// CONCATENATED MODULE: ./node_modules/before-after-hook/index.js
  856. // @ts-check
  857.  
  858.  
  859.  
  860.  
  861.  
  862. // bind with array of arguments: https://stackoverflow.com/a/21792913
  863. const bind = Function.bind;
  864. const bindable = bind.bind(bind);
  865.  
  866. function bindApi(hook, state, name) {
  867. const removeHookRef = bindable(removeHook, null).apply(
  868. null,
  869. name ? [state, name] : [state]
  870. );
  871. hook.api = { remove: removeHookRef };
  872. hook.remove = removeHookRef;
  873. ["before", "error", "after", "wrap"].forEach((kind) => {
  874. const args = name ? [state, kind, name] : [state, kind];
  875. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  876. });
  877. }
  878.  
  879. function Singular() {
  880. const singularHookName = Symbol("Singular");
  881. const singularHookState = {
  882. registry: {},
  883. };
  884. const singularHook = register.bind(null, singularHookState, singularHookName);
  885. bindApi(singularHook, singularHookState, singularHookName);
  886. return singularHook;
  887. }
  888.  
  889. function Collection() {
  890. const state = {
  891. registry: {},
  892. };
  893.  
  894. const hook = register.bind(null, state);
  895. bindApi(hook, state);
  896.  
  897. return hook;
  898. }
  899.  
  900. /* ESM default export */ const before_after_hook = ({ Singular, Collection });
  901.  
  902. ;// CONCATENATED MODULE: ./node_modules/@octokit/endpoint/dist-bundle/index.js
  903. // pkg/dist-src/defaults.js
  904.  
  905.  
  906. // pkg/dist-src/version.js
  907. var VERSION = "0.0.0-development";
  908.  
  909. // pkg/dist-src/defaults.js
  910. var userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;
  911. var DEFAULTS = {
  912. method: "GET",
  913. baseUrl: "https://api.github.com",
  914. headers: {
  915. accept: "application/vnd.github.v3+json",
  916. "user-agent": userAgent
  917. },
  918. mediaType: {
  919. format: ""
  920. }
  921. };
  922.  
  923. // pkg/dist-src/util/lowercase-keys.js
  924. function lowercaseKeys(object) {
  925. if (!object) {
  926. return {};
  927. }
  928. return Object.keys(object).reduce((newObj, key) => {
  929. newObj[key.toLowerCase()] = object[key];
  930. return newObj;
  931. }, {});
  932. }
  933.  
  934. // pkg/dist-src/util/is-plain-object.js
  935. function isPlainObject(value) {
  936. if (typeof value !== "object" || value === null) return false;
  937. if (Object.prototype.toString.call(value) !== "[object Object]") return false;
  938. const proto = Object.getPrototypeOf(value);
  939. if (proto === null) return true;
  940. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  941. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  942. }
  943.  
  944. // pkg/dist-src/util/merge-deep.js
  945. function mergeDeep(defaults, options) {
  946. const result = Object.assign({}, defaults);
  947. Object.keys(options).forEach((key) => {
  948. if (isPlainObject(options[key])) {
  949. if (!(key in defaults)) Object.assign(result, { [key]: options[key] });
  950. else result[key] = mergeDeep(defaults[key], options[key]);
  951. } else {
  952. Object.assign(result, { [key]: options[key] });
  953. }
  954. });
  955. return result;
  956. }
  957.  
  958. // pkg/dist-src/util/remove-undefined-properties.js
  959. function removeUndefinedProperties(obj) {
  960. for (const key in obj) {
  961. if (obj[key] === void 0) {
  962. delete obj[key];
  963. }
  964. }
  965. return obj;
  966. }
  967.  
  968. // pkg/dist-src/merge.js
  969. function merge(defaults, route, options) {
  970. if (typeof route === "string") {
  971. let [method, url] = route.split(" ");
  972. options = Object.assign(url ? { method, url } : { url: method }, options);
  973. } else {
  974. options = Object.assign({}, route);
  975. }
  976. options.headers = lowercaseKeys(options.headers);
  977. removeUndefinedProperties(options);
  978. removeUndefinedProperties(options.headers);
  979. const mergedOptions = mergeDeep(defaults || {}, options);
  980. if (options.url === "/graphql") {
  981. if (defaults && defaults.mediaType.previews?.length) {
  982. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  983. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  984. ).concat(mergedOptions.mediaType.previews);
  985. }
  986. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  987. }
  988. return mergedOptions;
  989. }
  990.  
  991. // pkg/dist-src/util/add-query-parameters.js
  992. function addQueryParameters(url, parameters) {
  993. const separator = /\?/.test(url) ? "&" : "?";
  994. const names = Object.keys(parameters);
  995. if (names.length === 0) {
  996. return url;
  997. }
  998. return url + separator + names.map((name) => {
  999. if (name === "q") {
  1000. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  1001. }
  1002. return `${name}=${encodeURIComponent(parameters[name])}`;
  1003. }).join("&");
  1004. }
  1005.  
  1006. // pkg/dist-src/util/extract-url-variable-names.js
  1007. var urlVariableRegex = /\{[^{}}]+\}/g;
  1008. function removeNonChars(variableName) {
  1009. return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
  1010. }
  1011. function extractUrlVariableNames(url) {
  1012. const matches = url.match(urlVariableRegex);
  1013. if (!matches) {
  1014. return [];
  1015. }
  1016. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  1017. }
  1018.  
  1019. // pkg/dist-src/util/omit.js
  1020. function omit(object, keysToOmit) {
  1021. const result = { __proto__: null };
  1022. for (const key of Object.keys(object)) {
  1023. if (keysToOmit.indexOf(key) === -1) {
  1024. result[key] = object[key];
  1025. }
  1026. }
  1027. return result;
  1028. }
  1029.  
  1030. // pkg/dist-src/util/url-template.js
  1031. function encodeReserved(str) {
  1032. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  1033. if (!/%[0-9A-Fa-f]/.test(part)) {
  1034. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  1035. }
  1036. return part;
  1037. }).join("");
  1038. }
  1039. function encodeUnreserved(str) {
  1040. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  1041. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  1042. });
  1043. }
  1044. function encodeValue(operator, value, key) {
  1045. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  1046. if (key) {
  1047. return encodeUnreserved(key) + "=" + value;
  1048. } else {
  1049. return value;
  1050. }
  1051. }
  1052. function isDefined(value) {
  1053. return value !== void 0 && value !== null;
  1054. }
  1055. function isKeyOperator(operator) {
  1056. return operator === ";" || operator === "&" || operator === "?";
  1057. }
  1058. function getValues(context, operator, key, modifier) {
  1059. var value = context[key], result = [];
  1060. if (isDefined(value) && value !== "") {
  1061. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  1062. value = value.toString();
  1063. if (modifier && modifier !== "*") {
  1064. value = value.substring(0, parseInt(modifier, 10));
  1065. }
  1066. result.push(
  1067. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  1068. );
  1069. } else {
  1070. if (modifier === "*") {
  1071. if (Array.isArray(value)) {
  1072. value.filter(isDefined).forEach(function(value2) {
  1073. result.push(
  1074. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  1075. );
  1076. });
  1077. } else {
  1078. Object.keys(value).forEach(function(k) {
  1079. if (isDefined(value[k])) {
  1080. result.push(encodeValue(operator, value[k], k));
  1081. }
  1082. });
  1083. }
  1084. } else {
  1085. const tmp = [];
  1086. if (Array.isArray(value)) {
  1087. value.filter(isDefined).forEach(function(value2) {
  1088. tmp.push(encodeValue(operator, value2));
  1089. });
  1090. } else {
  1091. Object.keys(value).forEach(function(k) {
  1092. if (isDefined(value[k])) {
  1093. tmp.push(encodeUnreserved(k));
  1094. tmp.push(encodeValue(operator, value[k].toString()));
  1095. }
  1096. });
  1097. }
  1098. if (isKeyOperator(operator)) {
  1099. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  1100. } else if (tmp.length !== 0) {
  1101. result.push(tmp.join(","));
  1102. }
  1103. }
  1104. }
  1105. } else {
  1106. if (operator === ";") {
  1107. if (isDefined(value)) {
  1108. result.push(encodeUnreserved(key));
  1109. }
  1110. } else if (value === "" && (operator === "&" || operator === "?")) {
  1111. result.push(encodeUnreserved(key) + "=");
  1112. } else if (value === "") {
  1113. result.push("");
  1114. }
  1115. }
  1116. return result;
  1117. }
  1118. function parseUrl(template) {
  1119. return {
  1120. expand: expand.bind(null, template)
  1121. };
  1122. }
  1123. function expand(template, context) {
  1124. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  1125. template = template.replace(
  1126. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  1127. function(_, expression, literal) {
  1128. if (expression) {
  1129. let operator = "";
  1130. const values = [];
  1131. if (operators.indexOf(expression.charAt(0)) !== -1) {
  1132. operator = expression.charAt(0);
  1133. expression = expression.substr(1);
  1134. }
  1135. expression.split(/,/g).forEach(function(variable) {
  1136. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  1137. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  1138. });
  1139. if (operator && operator !== "+") {
  1140. var separator = ",";
  1141. if (operator === "?") {
  1142. separator = "&";
  1143. } else if (operator !== "#") {
  1144. separator = operator;
  1145. }
  1146. return (values.length !== 0 ? operator : "") + values.join(separator);
  1147. } else {
  1148. return values.join(",");
  1149. }
  1150. } else {
  1151. return encodeReserved(literal);
  1152. }
  1153. }
  1154. );
  1155. if (template === "/") {
  1156. return template;
  1157. } else {
  1158. return template.replace(/\/$/, "");
  1159. }
  1160. }
  1161.  
  1162. // pkg/dist-src/parse.js
  1163. function parse(options) {
  1164. let method = options.method.toUpperCase();
  1165. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  1166. let headers = Object.assign({}, options.headers);
  1167. let body;
  1168. let parameters = omit(options, [
  1169. "method",
  1170. "baseUrl",
  1171. "url",
  1172. "headers",
  1173. "request",
  1174. "mediaType"
  1175. ]);
  1176. const urlVariableNames = extractUrlVariableNames(url);
  1177. url = parseUrl(url).expand(parameters);
  1178. if (!/^http/.test(url)) {
  1179. url = options.baseUrl + url;
  1180. }
  1181. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  1182. const remainingParameters = omit(parameters, omittedParameters);
  1183. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  1184. if (!isBinaryRequest) {
  1185. if (options.mediaType.format) {
  1186. headers.accept = headers.accept.split(/,/).map(
  1187. (format) => format.replace(
  1188. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  1189. `application/vnd$1$2.${options.mediaType.format}`
  1190. )
  1191. ).join(",");
  1192. }
  1193. if (url.endsWith("/graphql")) {
  1194. if (options.mediaType.previews?.length) {
  1195. const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
  1196. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  1197. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  1198. return `application/vnd.github.${preview}-preview${format}`;
  1199. }).join(",");
  1200. }
  1201. }
  1202. }
  1203. if (["GET", "HEAD"].includes(method)) {
  1204. url = addQueryParameters(url, remainingParameters);
  1205. } else {
  1206. if ("data" in remainingParameters) {
  1207. body = remainingParameters.data;
  1208. } else {
  1209. if (Object.keys(remainingParameters).length) {
  1210. body = remainingParameters;
  1211. }
  1212. }
  1213. }
  1214. if (!headers["content-type"] && typeof body !== "undefined") {
  1215. headers["content-type"] = "application/json; charset=utf-8";
  1216. }
  1217. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  1218. body = "";
  1219. }
  1220. return Object.assign(
  1221. { method, url, headers },
  1222. typeof body !== "undefined" ? { body } : null,
  1223. options.request ? { request: options.request } : null
  1224. );
  1225. }
  1226.  
  1227. // pkg/dist-src/endpoint-with-defaults.js
  1228. function endpointWithDefaults(defaults, route, options) {
  1229. return parse(merge(defaults, route, options));
  1230. }
  1231.  
  1232. // pkg/dist-src/with-defaults.js
  1233. function withDefaults(oldDefaults, newDefaults) {
  1234. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  1235. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  1236. return Object.assign(endpoint2, {
  1237. DEFAULTS: DEFAULTS2,
  1238. defaults: withDefaults.bind(null, DEFAULTS2),
  1239. merge: merge.bind(null, DEFAULTS2),
  1240. parse
  1241. });
  1242. }
  1243.  
  1244. // pkg/dist-src/index.js
  1245. var dist_bundle_endpoint = withDefaults(null, DEFAULTS);
  1246.  
  1247.  
  1248. // EXTERNAL MODULE: ./node_modules/fast-content-type-parse/index.js
  1249. var fast_content_type_parse = __webpack_require__(648);
  1250. // EXTERNAL MODULE: ./node_modules/@octokit/request-error/dist-src/index.js
  1251. var dist_src = __webpack_require__(736);
  1252. ;// CONCATENATED MODULE: ./node_modules/@octokit/request/dist-bundle/index.js
  1253. // pkg/dist-src/index.js
  1254.  
  1255.  
  1256. // pkg/dist-src/defaults.js
  1257.  
  1258.  
  1259. // pkg/dist-src/version.js
  1260. var dist_bundle_VERSION = "0.0.0-development";
  1261.  
  1262. // pkg/dist-src/defaults.js
  1263. var defaults_default = {
  1264. headers: {
  1265. "user-agent": `octokit-request.js/${dist_bundle_VERSION} ${getUserAgent()}`
  1266. }
  1267. };
  1268.  
  1269. // pkg/dist-src/fetch-wrapper.js
  1270.  
  1271.  
  1272. // pkg/dist-src/is-plain-object.js
  1273. function dist_bundle_isPlainObject(value) {
  1274. if (typeof value !== "object" || value === null) return false;
  1275. if (Object.prototype.toString.call(value) !== "[object Object]") return false;
  1276. const proto = Object.getPrototypeOf(value);
  1277. if (proto === null) return true;
  1278. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  1279. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  1280. }
  1281.  
  1282. // pkg/dist-src/fetch-wrapper.js
  1283.  
  1284. async function fetchWrapper(requestOptions) {
  1285. const fetch = requestOptions.request?.fetch || globalThis.fetch;
  1286. if (!fetch) {
  1287. throw new Error(
  1288. "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
  1289. );
  1290. }
  1291. const log = requestOptions.request?.log || console;
  1292. const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
  1293. const body = dist_bundle_isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSON.stringify(requestOptions.body) : requestOptions.body;
  1294. const requestHeaders = Object.fromEntries(
  1295. Object.entries(requestOptions.headers).map(([name, value]) => [
  1296. name,
  1297. String(value)
  1298. ])
  1299. );
  1300. let fetchResponse;
  1301. try {
  1302. fetchResponse = await fetch(requestOptions.url, {
  1303. method: requestOptions.method,
  1304. body,
  1305. redirect: requestOptions.request?.redirect,
  1306. headers: requestHeaders,
  1307. signal: requestOptions.request?.signal,
  1308. // duplex must be set if request.body is ReadableStream or Async Iterables.
  1309. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  1310. ...requestOptions.body && { duplex: "half" }
  1311. });
  1312. } catch (error) {
  1313. let message = "Unknown Error";
  1314. if (error instanceof Error) {
  1315. if (error.name === "AbortError") {
  1316. error.status = 500;
  1317. throw error;
  1318. }
  1319. message = error.message;
  1320. if (error.name === "TypeError" && "cause" in error) {
  1321. if (error.cause instanceof Error) {
  1322. message = error.cause.message;
  1323. } else if (typeof error.cause === "string") {
  1324. message = error.cause;
  1325. }
  1326. }
  1327. }
  1328. const requestError = new dist_src/* RequestError */.L(message, 500, {
  1329. request: requestOptions
  1330. });
  1331. requestError.cause = error;
  1332. throw requestError;
  1333. }
  1334. const status = fetchResponse.status;
  1335. const url = fetchResponse.url;
  1336. const responseHeaders = {};
  1337. for (const [key, value] of fetchResponse.headers) {
  1338. responseHeaders[key] = value;
  1339. }
  1340. const octokitResponse = {
  1341. url,
  1342. status,
  1343. headers: responseHeaders,
  1344. data: ""
  1345. };
  1346. if ("deprecation" in responseHeaders) {
  1347. const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
  1348. const deprecationLink = matches && matches.pop();
  1349. log.warn(
  1350. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  1351. );
  1352. }
  1353. if (status === 204 || status === 205) {
  1354. return octokitResponse;
  1355. }
  1356. if (requestOptions.method === "HEAD") {
  1357. if (status < 400) {
  1358. return octokitResponse;
  1359. }
  1360. throw new dist_src/* RequestError */.L(fetchResponse.statusText, status, {
  1361. response: octokitResponse,
  1362. request: requestOptions
  1363. });
  1364. }
  1365. if (status === 304) {
  1366. octokitResponse.data = await getResponseData(fetchResponse);
  1367. throw new dist_src/* RequestError */.L("Not modified", status, {
  1368. response: octokitResponse,
  1369. request: requestOptions
  1370. });
  1371. }
  1372. if (status >= 400) {
  1373. octokitResponse.data = await getResponseData(fetchResponse);
  1374. throw new dist_src/* RequestError */.L(toErrorMessage(octokitResponse.data), status, {
  1375. response: octokitResponse,
  1376. request: requestOptions
  1377. });
  1378. }
  1379. octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body;
  1380. return octokitResponse;
  1381. }
  1382. async function getResponseData(response) {
  1383. const contentType = response.headers.get("content-type");
  1384. if (!contentType) {
  1385. return response.text().catch(() => "");
  1386. }
  1387. const mimetype = (0,fast_content_type_parse.safeParse)(contentType);
  1388. if (isJSONResponse(mimetype)) {
  1389. let text = "";
  1390. try {
  1391. text = await response.text();
  1392. return JSON.parse(text);
  1393. } catch (err) {
  1394. return text;
  1395. }
  1396. } else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") {
  1397. return response.text().catch(() => "");
  1398. } else {
  1399. return response.arrayBuffer().catch(() => new ArrayBuffer(0));
  1400. }
  1401. }
  1402. function isJSONResponse(mimetype) {
  1403. return mimetype.type === "application/json" || mimetype.type === "application/scim+json";
  1404. }
  1405. function toErrorMessage(data) {
  1406. if (typeof data === "string") {
  1407. return data;
  1408. }
  1409. if (data instanceof ArrayBuffer) {
  1410. return "Unknown error";
  1411. }
  1412. if ("message" in data) {
  1413. const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : "";
  1414. return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`;
  1415. }
  1416. return `Unknown error: ${JSON.stringify(data)}`;
  1417. }
  1418.  
  1419. // pkg/dist-src/with-defaults.js
  1420. function dist_bundle_withDefaults(oldEndpoint, newDefaults) {
  1421. const endpoint2 = oldEndpoint.defaults(newDefaults);
  1422. const newApi = function(route, parameters) {
  1423. const endpointOptions = endpoint2.merge(route, parameters);
  1424. if (!endpointOptions.request || !endpointOptions.request.hook) {
  1425. return fetchWrapper(endpoint2.parse(endpointOptions));
  1426. }
  1427. const request2 = (route2, parameters2) => {
  1428. return fetchWrapper(
  1429. endpoint2.parse(endpoint2.merge(route2, parameters2))
  1430. );
  1431. };
  1432. Object.assign(request2, {
  1433. endpoint: endpoint2,
  1434. defaults: dist_bundle_withDefaults.bind(null, endpoint2)
  1435. });
  1436. return endpointOptions.request.hook(request2, endpointOptions);
  1437. };
  1438. return Object.assign(newApi, {
  1439. endpoint: endpoint2,
  1440. defaults: dist_bundle_withDefaults.bind(null, endpoint2)
  1441. });
  1442. }
  1443.  
  1444. // pkg/dist-src/index.js
  1445. var dist_bundle_request = dist_bundle_withDefaults(dist_bundle_endpoint, defaults_default);
  1446.  
  1447.  
  1448. ;// CONCATENATED MODULE: ./node_modules/@octokit/graphql/dist-bundle/index.js
  1449. // pkg/dist-src/index.js
  1450.  
  1451.  
  1452.  
  1453. // pkg/dist-src/version.js
  1454. var graphql_dist_bundle_VERSION = "0.0.0-development";
  1455.  
  1456. // pkg/dist-src/with-defaults.js
  1457.  
  1458.  
  1459. // pkg/dist-src/graphql.js
  1460.  
  1461.  
  1462. // pkg/dist-src/error.js
  1463. function _buildMessageForResponseErrors(data) {
  1464. return `Request failed due to following response errors:
  1465. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  1466. }
  1467. var GraphqlResponseError = class extends Error {
  1468. constructor(request2, headers, response) {
  1469. super(_buildMessageForResponseErrors(response));
  1470. this.request = request2;
  1471. this.headers = headers;
  1472. this.response = response;
  1473. this.errors = response.errors;
  1474. this.data = response.data;
  1475. if (Error.captureStackTrace) {
  1476. Error.captureStackTrace(this, this.constructor);
  1477. }
  1478. }
  1479. name = "GraphqlResponseError";
  1480. errors;
  1481. data;
  1482. };
  1483.  
  1484. // pkg/dist-src/graphql.js
  1485. var NON_VARIABLE_OPTIONS = [
  1486. "method",
  1487. "baseUrl",
  1488. "url",
  1489. "headers",
  1490. "request",
  1491. "query",
  1492. "mediaType",
  1493. "operationName"
  1494. ];
  1495. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  1496. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  1497. function graphql(request2, query, options) {
  1498. if (options) {
  1499. if (typeof query === "string" && "query" in options) {
  1500. return Promise.reject(
  1501. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  1502. );
  1503. }
  1504. for (const key in options) {
  1505. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;
  1506. return Promise.reject(
  1507. new Error(
  1508. `[@octokit/graphql] "${key}" cannot be used as variable name`
  1509. )
  1510. );
  1511. }
  1512. }
  1513. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  1514. const requestOptions = Object.keys(
  1515. parsedOptions
  1516. ).reduce((result, key) => {
  1517. if (NON_VARIABLE_OPTIONS.includes(key)) {
  1518. result[key] = parsedOptions[key];
  1519. return result;
  1520. }
  1521. if (!result.variables) {
  1522. result.variables = {};
  1523. }
  1524. result.variables[key] = parsedOptions[key];
  1525. return result;
  1526. }, {});
  1527. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  1528. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  1529. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  1530. }
  1531. return request2(requestOptions).then((response) => {
  1532. if (response.data.errors) {
  1533. const headers = {};
  1534. for (const key of Object.keys(response.headers)) {
  1535. headers[key] = response.headers[key];
  1536. }
  1537. throw new GraphqlResponseError(
  1538. requestOptions,
  1539. headers,
  1540. response.data
  1541. );
  1542. }
  1543. return response.data.data;
  1544. });
  1545. }
  1546.  
  1547. // pkg/dist-src/with-defaults.js
  1548. function graphql_dist_bundle_withDefaults(request2, newDefaults) {
  1549. const newRequest = request2.defaults(newDefaults);
  1550. const newApi = (query, options) => {
  1551. return graphql(newRequest, query, options);
  1552. };
  1553. return Object.assign(newApi, {
  1554. defaults: graphql_dist_bundle_withDefaults.bind(null, newRequest),
  1555. endpoint: newRequest.endpoint
  1556. });
  1557. }
  1558.  
  1559. // pkg/dist-src/index.js
  1560. var graphql2 = graphql_dist_bundle_withDefaults(dist_bundle_request, {
  1561. headers: {
  1562. "user-agent": `octokit-graphql.js/${graphql_dist_bundle_VERSION} ${getUserAgent()}`
  1563. },
  1564. method: "POST",
  1565. url: "/graphql"
  1566. });
  1567. function withCustomRequest(customRequest) {
  1568. return graphql_dist_bundle_withDefaults(customRequest, {
  1569. method: "POST",
  1570. url: "/graphql"
  1571. });
  1572. }
  1573.  
  1574.  
  1575. ;// CONCATENATED MODULE: ./node_modules/@octokit/auth-token/dist-bundle/index.js
  1576. // pkg/dist-src/is-jwt.js
  1577. var b64url = "(?:[a-zA-Z0-9_-]+)";
  1578. var sep = "\\.";
  1579. var jwtRE = new RegExp(`^${b64url}${sep}${b64url}${sep}${b64url}$`);
  1580. var isJWT = jwtRE.test.bind(jwtRE);
  1581.  
  1582. // pkg/dist-src/auth.js
  1583. async function dist_bundle_auth(token) {
  1584. const isApp = isJWT(token);
  1585. const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_");
  1586. const isUserToServer = token.startsWith("ghu_");
  1587. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  1588. return {
  1589. type: "token",
  1590. token,
  1591. tokenType
  1592. };
  1593. }
  1594.  
  1595. // pkg/dist-src/with-authorization-prefix.js
  1596. function withAuthorizationPrefix(token) {
  1597. if (token.split(/\./).length === 3) {
  1598. return `bearer ${token}`;
  1599. }
  1600. return `token ${token}`;
  1601. }
  1602.  
  1603. // pkg/dist-src/hook.js
  1604. async function dist_bundle_hook(token, request, route, parameters) {
  1605. const endpoint = request.endpoint.merge(
  1606. route,
  1607. parameters
  1608. );
  1609. endpoint.headers.authorization = withAuthorizationPrefix(token);
  1610. return request(endpoint);
  1611. }
  1612.  
  1613. // pkg/dist-src/index.js
  1614. var createTokenAuth = function createTokenAuth2(token) {
  1615. if (!token) {
  1616. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  1617. }
  1618. if (typeof token !== "string") {
  1619. throw new Error(
  1620. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  1621. );
  1622. }
  1623. token = token.replace(/^(token|bearer) +/i, "");
  1624. return Object.assign(dist_bundle_auth.bind(null, token), {
  1625. hook: dist_bundle_hook.bind(null, token)
  1626. });
  1627. };
  1628.  
  1629.  
  1630. ;// CONCATENATED MODULE: ./node_modules/@octokit/core/dist-src/version.js
  1631. const version_VERSION = "6.1.5";
  1632.  
  1633.  
  1634. ;// CONCATENATED MODULE: ./node_modules/@octokit/core/dist-src/index.js
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641. const noop = () => {
  1642. };
  1643. const consoleWarn = console.warn.bind(console);
  1644. const consoleError = console.error.bind(console);
  1645. const userAgentTrail = `octokit-core.js/${version_VERSION} ${getUserAgent()}`;
  1646. class Octokit {
  1647. static VERSION = version_VERSION;
  1648. static defaults(defaults) {
  1649. const OctokitWithDefaults = class extends this {
  1650. constructor(...args) {
  1651. const options = args[0] || {};
  1652. if (typeof defaults === "function") {
  1653. super(defaults(options));
  1654. return;
  1655. }
  1656. super(
  1657. Object.assign(
  1658. {},
  1659. defaults,
  1660. options,
  1661. options.userAgent && defaults.userAgent ? {
  1662. userAgent: `${options.userAgent} ${defaults.userAgent}`
  1663. } : null
  1664. )
  1665. );
  1666. }
  1667. };
  1668. return OctokitWithDefaults;
  1669. }
  1670. static plugins = [];
  1671. /**
  1672. * Attach a plugin (or many) to your Octokit instance.
  1673. *
  1674. * @example
  1675. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  1676. */
  1677. static plugin(...newPlugins) {
  1678. const currentPlugins = this.plugins;
  1679. const NewOctokit = class extends this {
  1680. static plugins = currentPlugins.concat(
  1681. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  1682. );
  1683. };
  1684. return NewOctokit;
  1685. }
  1686. constructor(options = {}) {
  1687. const hook = new before_after_hook.Collection();
  1688. const requestDefaults = {
  1689. baseUrl: dist_bundle_request.endpoint.DEFAULTS.baseUrl,
  1690. headers: {},
  1691. request: Object.assign({}, options.request, {
  1692. // @ts-ignore internal usage only, no need to type
  1693. hook: hook.bind(null, "request")
  1694. }),
  1695. mediaType: {
  1696. previews: [],
  1697. format: ""
  1698. }
  1699. };
  1700. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  1701. if (options.baseUrl) {
  1702. requestDefaults.baseUrl = options.baseUrl;
  1703. }
  1704. if (options.previews) {
  1705. requestDefaults.mediaType.previews = options.previews;
  1706. }
  1707. if (options.timeZone) {
  1708. requestDefaults.headers["time-zone"] = options.timeZone;
  1709. }
  1710. this.request = dist_bundle_request.defaults(requestDefaults);
  1711. this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
  1712. this.log = Object.assign(
  1713. {
  1714. debug: noop,
  1715. info: noop,
  1716. warn: consoleWarn,
  1717. error: consoleError
  1718. },
  1719. options.log
  1720. );
  1721. this.hook = hook;
  1722. if (!options.authStrategy) {
  1723. if (!options.auth) {
  1724. this.auth = async () => ({
  1725. type: "unauthenticated"
  1726. });
  1727. } else {
  1728. const auth = createTokenAuth(options.auth);
  1729. hook.wrap("request", auth.hook);
  1730. this.auth = auth;
  1731. }
  1732. } else {
  1733. const { authStrategy, ...otherOptions } = options;
  1734. const auth = authStrategy(
  1735. Object.assign(
  1736. {
  1737. request: this.request,
  1738. log: this.log,
  1739. // we pass the current octokit instance as well as its constructor options
  1740. // to allow for authentication strategies that return a new octokit instance
  1741. // that shares the same internal state as the current one. The original
  1742. // requirement for this was the "event-octokit" authentication strategy
  1743. // of https://github.com/probot/octokit-auth-probot.
  1744. octokit: this,
  1745. octokitOptions: otherOptions
  1746. },
  1747. options.auth
  1748. )
  1749. );
  1750. hook.wrap("request", auth.hook);
  1751. this.auth = auth;
  1752. }
  1753. const classConstructor = this.constructor;
  1754. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  1755. Object.assign(this, classConstructor.plugins[i](this, options));
  1756. }
  1757. }
  1758. // assigned during constructor
  1759. request;
  1760. graphql;
  1761. log;
  1762. hook;
  1763. // TODO: type `octokit.auth` based on passed options.authStrategy
  1764. auth;
  1765. }
  1766.  
  1767.  
  1768.  
  1769. }),
  1770. 736: (function (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
  1771. __webpack_require__.d(__webpack_exports__, {
  1772. L: () => (RequestError)
  1773. });
  1774. class RequestError extends Error {
  1775. name;
  1776. /**
  1777. * http status code
  1778. */
  1779. status;
  1780. /**
  1781. * Request options that lead to the error.
  1782. */
  1783. request;
  1784. /**
  1785. * Response object if a response was received
  1786. */
  1787. response;
  1788. constructor(message, statusCode, options) {
  1789. super(message);
  1790. this.name = "HttpError";
  1791. this.status = Number.parseInt(statusCode);
  1792. if (Number.isNaN(this.status)) {
  1793. this.status = 0;
  1794. }
  1795. if ("response" in options) {
  1796. this.response = options.response;
  1797. }
  1798. const requestCopy = Object.assign({}, options.request);
  1799. if (options.request.headers.authorization) {
  1800. requestCopy.headers = Object.assign({}, options.request.headers, {
  1801. authorization: options.request.headers.authorization.replace(
  1802. /(?<! ) .*$/,
  1803. " [REDACTED]"
  1804. )
  1805. });
  1806. }
  1807. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  1808. this.request = requestCopy;
  1809. }
  1810. }
  1811.  
  1812.  
  1813.  
  1814. }),
  1815.  
  1816. });
  1817. /************************************************************************/
  1818. // The module cache
  1819. var __webpack_module_cache__ = {};
  1820.  
  1821. // The require function
  1822. function __webpack_require__(moduleId) {
  1823.  
  1824. // Check if module is in cache
  1825. var cachedModule = __webpack_module_cache__[moduleId];
  1826. if (cachedModule !== undefined) {
  1827. return cachedModule.exports;
  1828. }
  1829. // Create a new module (and put it into the cache)
  1830. var module = (__webpack_module_cache__[moduleId] = {
  1831. exports: {}
  1832. });
  1833. // Execute the module function
  1834. __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  1835.  
  1836. // Return the exports of the module
  1837. return module.exports;
  1838.  
  1839. }
  1840.  
  1841. /************************************************************************/
  1842. // webpack/runtime/async_module
  1843. (() => {
  1844. var webpackQueues =
  1845. typeof Symbol === "function"
  1846. ? Symbol("webpack queues")
  1847. : "__webpack_queues__";
  1848. var webpackExports =
  1849. typeof Symbol === "function"
  1850. ? Symbol("webpack exports")
  1851. : "__webpack_exports__";
  1852. var webpackError =
  1853. typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__";
  1854. var resolveQueue = (queue) => {
  1855. if (queue && queue.d < 1) {
  1856. queue.d = 1;
  1857. queue.forEach((fn) => (fn.r--));
  1858. queue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));
  1859. }
  1860. }
  1861. var wrapDeps = (deps) => {
  1862. return deps.map((dep) => {
  1863. if (dep !== null && typeof dep === "object") {
  1864. if (dep[webpackQueues]) return dep;
  1865. if (dep.then) {
  1866. var queue = [];
  1867. queue.d = 0;
  1868. dep.then((r) => {
  1869. obj[webpackExports] = r;
  1870. resolveQueue(queue);
  1871. },(e) => {
  1872. obj[webpackError] = e;
  1873. resolveQueue(queue);
  1874. });
  1875. var obj = {};
  1876. obj[webpackQueues] = (fn) => (fn(queue));
  1877. return obj;
  1878. }
  1879. }
  1880. var ret = {};
  1881. ret[webpackQueues] = function() {};
  1882. ret[webpackExports] = dep;
  1883. return ret;
  1884. });
  1885. };
  1886. __webpack_require__.a = (module, body, hasAwait) => {
  1887. var queue;
  1888. hasAwait && ((queue = []).d = -1);
  1889. var depQueues = new Set();
  1890. var exports = module.exports;
  1891. var currentDeps;
  1892. var outerResolve;
  1893. var reject;
  1894. var promise = new Promise((resolve, rej) => {
  1895. reject = rej;
  1896. outerResolve = resolve;
  1897. });
  1898. promise[webpackExports] = exports;
  1899. promise[webpackQueues] = (fn) => { queue && fn(queue), depQueues.forEach(fn), promise["catch"](function() {}); };
  1900. module.exports = promise;
  1901. body((deps) => {
  1902. currentDeps = wrapDeps(deps);
  1903. var fn;
  1904. var getResult = () => {
  1905. return currentDeps.map((d) => {
  1906. if (d[webpackError]) throw d[webpackError];
  1907. return d[webpackExports];
  1908. });
  1909. }
  1910. var promise = new Promise((resolve) => {
  1911. fn = () => (resolve(getResult));
  1912. fn.r = 0;
  1913. var fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));
  1914. currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
  1915. });
  1916. return fn.r ? promise : getResult();
  1917. }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));
  1918. queue && queue.d < 0 && (queue.d = 0);
  1919. };
  1920. })();
  1921. // webpack/runtime/compat_get_default_export
  1922. (() => {
  1923. // getDefaultExport function for compatibility with non-ESM modules
  1924. __webpack_require__.n = (module) => {
  1925. var getter = module && module.__esModule ?
  1926. () => (module['default']) :
  1927. () => (module);
  1928. __webpack_require__.d(getter, { a: getter });
  1929. return getter;
  1930. };
  1931.  
  1932. })();
  1933. // webpack/runtime/define_property_getters
  1934. (() => {
  1935. __webpack_require__.d = (exports, definition) => {
  1936. for(var key in definition) {
  1937. if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  1938. Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  1939. }
  1940. }
  1941. };
  1942. })();
  1943. // webpack/runtime/has_own_property
  1944. (() => {
  1945. __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  1946. })();
  1947. // webpack/runtime/rspack_version
  1948. (() => {
  1949. __webpack_require__.rv = () => ("1.3.4")
  1950. })();
  1951. // webpack/runtime/rspack_unique_id
  1952. (() => {
  1953. __webpack_require__.ruid = "bundler=rspack@1.3.4";
  1954.  
  1955. })();
  1956. /************************************************************************/
  1957. // startup
  1958. // Load entry module and return exports
  1959. // This entry module used 'module' so it can't be inlined
  1960. var __webpack_exports__ = __webpack_require__(163);
  1961. })()
  1962. ;
  1963. //# sourceMappingURL=bundle.js.map