trident-git 0.24.0 → 0.25.0

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.
Files changed (164) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +5 -5
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/server/app/_global-error.html +2 -2
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/server/app/api/credentials/github/repos/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/credentials/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/custom-scripts/route.js +2 -2
  26. package/.next/server/app/api/custom-scripts/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/fs/open/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/fs/open-terminal/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/fs/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/git/action/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/git/branches/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/git/log/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/git/status/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/repos/clone/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/repos/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/credentials/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/credentials.html +1 -1
  40. package/.next/server/app/credentials.rsc +3 -3
  41. package/.next/server/app/credentials.segments/_full.segment.rsc +3 -3
  42. package/.next/server/app/credentials.segments/_head.segment.rsc +1 -1
  43. package/.next/server/app/credentials.segments/_index.segment.rsc +2 -2
  44. package/.next/server/app/credentials.segments/_tree.segment.rsc +2 -2
  45. package/.next/server/app/credentials.segments/credentials/__PAGE__.segment.rsc +2 -2
  46. package/.next/server/app/credentials.segments/credentials.segment.rsc +1 -1
  47. package/.next/server/app/index.html +1 -1
  48. package/.next/server/app/index.rsc +4 -4
  49. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  50. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  51. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  52. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  53. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/workspace/changes/page.js +1 -1
  56. package/.next/server/app/workspace/changes/page.js.nft.json +1 -1
  57. package/.next/server/app/workspace/changes/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/workspace/changes.html +1 -1
  59. package/.next/server/app/workspace/changes.rsc +20 -17
  60. package/.next/server/app/workspace/changes.segments/_full.segment.rsc +20 -17
  61. package/.next/server/app/workspace/changes.segments/_head.segment.rsc +1 -1
  62. package/.next/server/app/workspace/changes.segments/_index.segment.rsc +2 -2
  63. package/.next/server/app/workspace/changes.segments/_tree.segment.rsc +2 -2
  64. package/.next/server/app/workspace/changes.segments/workspace/changes/__PAGE__.segment.rsc +1 -1
  65. package/.next/server/app/workspace/changes.segments/workspace/changes.segment.rsc +1 -1
  66. package/.next/server/app/workspace/changes.segments/workspace.segment.rsc +9 -6
  67. package/.next/server/app/workspace/conflicts/page.js +1 -1
  68. package/.next/server/app/workspace/conflicts/page.js.nft.json +1 -1
  69. package/.next/server/app/workspace/conflicts/page_client-reference-manifest.js +1 -1
  70. package/.next/server/app/workspace/conflicts.html +1 -1
  71. package/.next/server/app/workspace/conflicts.rsc +20 -17
  72. package/.next/server/app/workspace/conflicts.segments/_full.segment.rsc +20 -17
  73. package/.next/server/app/workspace/conflicts.segments/_head.segment.rsc +1 -1
  74. package/.next/server/app/workspace/conflicts.segments/_index.segment.rsc +2 -2
  75. package/.next/server/app/workspace/conflicts.segments/_tree.segment.rsc +2 -2
  76. package/.next/server/app/workspace/conflicts.segments/workspace/conflicts/__PAGE__.segment.rsc +1 -1
  77. package/.next/server/app/workspace/conflicts.segments/workspace/conflicts.segment.rsc +1 -1
  78. package/.next/server/app/workspace/conflicts.segments/workspace.segment.rsc +9 -6
  79. package/.next/server/app/workspace/custom-scripts/page.js +1 -1
  80. package/.next/server/app/workspace/custom-scripts/page.js.nft.json +1 -1
  81. package/.next/server/app/workspace/custom-scripts/page_client-reference-manifest.js +1 -1
  82. package/.next/server/app/workspace/custom-scripts.html +1 -1
  83. package/.next/server/app/workspace/custom-scripts.rsc +20 -17
  84. package/.next/server/app/workspace/custom-scripts.segments/_full.segment.rsc +20 -17
  85. package/.next/server/app/workspace/custom-scripts.segments/_head.segment.rsc +1 -1
  86. package/.next/server/app/workspace/custom-scripts.segments/_index.segment.rsc +2 -2
  87. package/.next/server/app/workspace/custom-scripts.segments/_tree.segment.rsc +2 -2
  88. package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts/__PAGE__.segment.rsc +1 -1
  89. package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts.segment.rsc +1 -1
  90. package/.next/server/app/workspace/custom-scripts.segments/workspace.segment.rsc +9 -6
  91. package/.next/server/app/workspace/history/page.js +1 -1
  92. package/.next/server/app/workspace/history/page.js.nft.json +1 -1
  93. package/.next/server/app/workspace/history/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/workspace/history.html +1 -1
  95. package/.next/server/app/workspace/history.rsc +20 -17
  96. package/.next/server/app/workspace/history.segments/_full.segment.rsc +20 -17
  97. package/.next/server/app/workspace/history.segments/_head.segment.rsc +1 -1
  98. package/.next/server/app/workspace/history.segments/_index.segment.rsc +2 -2
  99. package/.next/server/app/workspace/history.segments/_tree.segment.rsc +2 -2
  100. package/.next/server/app/workspace/history.segments/workspace/history/__PAGE__.segment.rsc +2 -2
  101. package/.next/server/app/workspace/history.segments/workspace/history.segment.rsc +1 -1
  102. package/.next/server/app/workspace/history.segments/workspace.segment.rsc +9 -6
  103. package/.next/server/app/workspace/page.js +1 -1
  104. package/.next/server/app/workspace/page.js.nft.json +1 -1
  105. package/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
  106. package/.next/server/app/workspace/settings/page.js +1 -1
  107. package/.next/server/app/workspace/settings/page.js.nft.json +1 -1
  108. package/.next/server/app/workspace/settings/page_client-reference-manifest.js +1 -1
  109. package/.next/server/app/workspace/settings.html +1 -1
  110. package/.next/server/app/workspace/settings.rsc +20 -17
  111. package/.next/server/app/workspace/settings.segments/_full.segment.rsc +20 -17
  112. package/.next/server/app/workspace/settings.segments/_head.segment.rsc +1 -1
  113. package/.next/server/app/workspace/settings.segments/_index.segment.rsc +2 -2
  114. package/.next/server/app/workspace/settings.segments/_tree.segment.rsc +2 -2
  115. package/.next/server/app/workspace/settings.segments/workspace/settings/__PAGE__.segment.rsc +2 -2
  116. package/.next/server/app/workspace/settings.segments/workspace/settings.segment.rsc +1 -1
  117. package/.next/server/app/workspace/settings.segments/workspace.segment.rsc +9 -6
  118. package/.next/server/app/workspace/stashes/page.js +1 -1
  119. package/.next/server/app/workspace/stashes/page.js.nft.json +1 -1
  120. package/.next/server/app/workspace/stashes/page_client-reference-manifest.js +1 -1
  121. package/.next/server/app/workspace/stashes.html +1 -1
  122. package/.next/server/app/workspace/stashes.rsc +20 -17
  123. package/.next/server/app/workspace/stashes.segments/_full.segment.rsc +20 -17
  124. package/.next/server/app/workspace/stashes.segments/_head.segment.rsc +1 -1
  125. package/.next/server/app/workspace/stashes.segments/_index.segment.rsc +2 -2
  126. package/.next/server/app/workspace/stashes.segments/_tree.segment.rsc +2 -2
  127. package/.next/server/app/workspace/stashes.segments/workspace/stashes/__PAGE__.segment.rsc +1 -1
  128. package/.next/server/app/workspace/stashes.segments/workspace/stashes.segment.rsc +1 -1
  129. package/.next/server/app/workspace/stashes.segments/workspace.segment.rsc +9 -6
  130. package/.next/server/app/workspace.html +1 -1
  131. package/.next/server/app/workspace.rsc +20 -17
  132. package/.next/server/app/workspace.segments/_full.segment.rsc +20 -17
  133. package/.next/server/app/workspace.segments/_head.segment.rsc +1 -1
  134. package/.next/server/app/workspace.segments/_index.segment.rsc +2 -2
  135. package/.next/server/app/workspace.segments/_tree.segment.rsc +2 -2
  136. package/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +2 -2
  137. package/.next/server/app/workspace.segments/workspace.segment.rsc +9 -6
  138. package/.next/server/app-paths-manifest.json +5 -5
  139. package/.next/server/chunks/547.js +3 -0
  140. package/.next/server/chunks/809.js +4 -6
  141. package/.next/server/pages/404.html +1 -1
  142. package/.next/server/pages/500.html +2 -2
  143. package/.next/server/server-reference-manifest.json +1 -1
  144. package/.next/static/chunks/2944-f1ff2d4c47ff4526.js +9 -0
  145. package/.next/static/chunks/5339-ca68fa145d0a2846.js +1 -0
  146. package/.next/static/chunks/8437-1595797761bfca7e.js +3 -0
  147. package/.next/static/chunks/8500-41fa79ac743d83f1.js +1 -0
  148. package/.next/static/chunks/app/credentials/{page-d51d732ad4097a30.js → page-dc339cc85e245f51.js} +1 -1
  149. package/.next/static/chunks/app/{page-f70ad056251205db.js → page-5d57a164d0ccbc1c.js} +1 -1
  150. package/.next/static/chunks/app/workspace/history/{page-129b26f37afaa901.js → page-a0e3a6cb9d500c68.js} +1 -1
  151. package/.next/static/chunks/app/workspace/layout-6735475bf8f9495d.js +3 -0
  152. package/.next/static/chunks/app/workspace/{page-eedbdc109eb4c456.js → page-fed5e33814bce518.js} +1 -1
  153. package/.next/static/chunks/app/workspace/settings/{page-0005c551f1ec5a0c.js → page-ce7778dcc2594d60.js} +1 -1
  154. package/.next/static/css/04da82c464d41917.css +1 -0
  155. package/package.json +1 -1
  156. package/.next/server/chunks/835.js +0 -1
  157. package/.next/static/chunks/1020-cb5039aef84888fb.js +0 -1
  158. package/.next/static/chunks/2944-b5f59650ca6ea2d3.js +0 -10
  159. package/.next/static/chunks/8437-52a241bc3ae6493f.js +0 -3
  160. package/.next/static/chunks/8500-56d73fda531c15d6.js +0 -1
  161. package/.next/static/chunks/app/workspace/layout-b4f407d0cfce9de1.js +0 -1
  162. package/.next/static/css/5e1f32a28bcc1d33.css +0 -1
  163. /package/.next/static/{vkGKVXpuNXVfjZbXUL1TF → Z2jcv8BWFnY_uJuEr8xah}/_buildManifest.js +0 -0
  164. /package/.next/static/{vkGKVXpuNXVfjZbXUL1TF → Z2jcv8BWFnY_uJuEr8xah}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5339],{460:(e,t,n)=>{n.d(t,{D:()=>l,N:()=>c});var r=n(2115),o=(e,t,n,r,o,i,a,s)=>{let u=document.documentElement,l=["light","dark"];function c(t){var n;(Array.isArray(e)?e:[e]).forEach(e=>{let n="class"===e,r=n&&i?o.map(e=>i[e]||e):o;n?(u.classList.remove(...r),u.classList.add(i&&i[t]?i[t]:t)):u.setAttribute(e,t)}),n=t,s&&l.includes(n)&&(u.style.colorScheme=n)}if(r)c(r);else try{let e=localStorage.getItem(t)||n,r=a&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(r)}catch(e){}},i=["light","dark"],a="(prefers-color-scheme: dark)",s=r.createContext(void 0),u={setTheme:e=>{},themes:[]},l=()=>{var e;return null!=(e=r.useContext(s))?e:u},c=e=>r.useContext(s)?r.createElement(r.Fragment,null,e.children):r.createElement(f,{...e}),d=["light","dark"],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:o=!0,storageKey:u="theme",themes:l=d,defaultTheme:c=n?"system":"light",attribute:f="data-theme",value:v,children:g,nonce:b,scriptProps:k})=>{let[S,w]=r.useState(()=>p(u,c)),[T,j]=r.useState(()=>"system"===S?m():S),x=v?Object.values(v):l,_=r.useCallback(e=>{let r=e;if(!r)return;"system"===e&&n&&(r=m());let a=v?v[r]:r,s=t?y(b):null,u=document.documentElement,l=e=>{"class"===e?(u.classList.remove(...x),a&&u.classList.add(a)):e.startsWith("data-")&&(a?u.setAttribute(e,a):u.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),o){let e=i.includes(c)?c:null,t=i.includes(r)?r:e;u.style.colorScheme=t}null==s||s()},[b]),C=r.useCallback(e=>{let t="function"==typeof e?e(S):e;w(t);try{localStorage.setItem(u,t)}catch(e){}},[S]),N=r.useCallback(t=>{j(m(t)),"system"===S&&n&&!e&&_("system")},[S,e]);r.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(N),N(e),()=>e.removeListener(N)},[N]),r.useEffect(()=>{let e=e=>{e.key===u&&(e.newValue?w(e.newValue):C(c))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[C]),r.useEffect(()=>{_(null!=e?e:S)},[e,S]);let A=r.useMemo(()=>({theme:S,setTheme:C,forcedTheme:e,resolvedTheme:"system"===S?T:S,themes:n?[...l,"system"]:l,systemTheme:n?T:void 0}),[S,C,e,T,n,l]);return r.createElement(s.Provider,{value:A},r.createElement(h,{forcedTheme:e,storageKey:u,attribute:f,enableSystem:n,enableColorScheme:o,defaultTheme:c,value:v,themes:l,nonce:b,scriptProps:k}),g)},h=r.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:i,enableColorScheme:a,defaultTheme:s,value:u,themes:l,nonce:c,scriptProps:d})=>{let f=JSON.stringify([n,t,s,e,l,u,i,a]).slice(1,-1);return r.createElement("script",{...d,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:`(${o.toString()})(${f})`}})}),p=(e,t)=>{let n;try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t},y=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},m=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light")},1112:(e,t,n)=>{function r({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(1980)},1172:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let r=n(2115);function o(e,t){let n=(0,r.useRef)(null),o=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(n.current=i(e,r)),t&&(o.current=i(t,r))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1957:(e,t,n)=>{function r({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(5155),n(7650),n(5214),n(2451),n(3887)},2377:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function i(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 a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(s)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.d(t,{_:()=>J,cx:()=>I});var u={margin:["margin-top","margin-right","margin-bottom","margin-left","margin-inline-start","margin-inline-end","margin-block-start","margin-block-end"],padding:["padding-top","padding-right","padding-bottom","padding-left","padding-inline-start","padding-inline-end","padding-block-start","padding-block-end"],inset:["top","right","bottom","left"],gap:["row-gap","column-gap"],overflow:["overflow-x","overflow-y"],"border-width":["border-top-width","border-right-width","border-bottom-width","border-left-width"],"border-style":["border-top-style","border-right-style","border-bottom-style","border-left-style"],"border-color":["border-top-color","border-right-color","border-bottom-color","border-left-color"],"border-top":["border-top-width","border-top-style","border-top-color"],"border-right":["border-right-width","border-right-style","border-right-color"],"border-bottom":["border-bottom-width","border-bottom-style","border-bottom-color"],"border-left":["border-left-width","border-left-style","border-left-color"],border:["border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-image","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],"border-radius":["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],outline:["outline-width","outline-style","outline-color"],background:["background-color","background-image","background-position","background-size","background-repeat","background-attachment","background-origin","background-clip"],font:["font-style","font-variant","font-weight","font-size","font-family","line-height"],flex:["flex-grow","flex-shrink","flex-basis"],"text-decoration":["text-decoration-line","text-decoration-style","text-decoration-color","text-decoration-thickness"]};function l(e){var t=u[e];return t?[e].concat(t):[e]}var c={margin:"box",padding:"box",inset:"box","border-width":"box","border-style":"box","border-color":"box",gap:"pair",overflow:"pair","border-radius":"corners"};function d(e){return[].concat(e)}function f(e){return e.startsWith(":")}function h(e){return m(e)&&("*"===e||e.length>1&&":>~.+*".includes(e.slice(0,1))||v(e))}function p(e,t){return(m(t)||"number"==typeof t)&&"--"!==e&&!f(e)&&!y(e)}function y(e){return e.startsWith("@media")}function m(e){return e+""===e}function v(e){return m(e)&&(e.startsWith("&")||f(e))}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.filter(Boolean).join(t)}function b(e,t){var n=0;if(0===t.length)return n.toString();for(var r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r),n&=n;return"".concat(null!=e?e:"cl","_").concat(n.toString(36))}function k(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function S(e,t){return"".concat(e,":").concat(t)}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ";return e?"".concat(e).concat(n).concat(t):t}function T(e){var t=e.replace(/[^A-Za-z0-9-]/g,function(e){return"_".concat(e.charCodeAt(0).toString(16),"_")});return/^[0-9]/.test(t)||/^-[0-9]/.test(t)?"_".concat(t):t}var j=function(){function e(t,n,r,i){o(this,e),this.sheet=t,this.property=n,this.value=r,this.selector=i,this.property=n,this.value=r,this.joined=S(k(n),r);var a=this.selector.preconditions.join("\0"),s=this.selector.postconditions.join("\0"),u=this.selector.atRules.join("|"),l=this.selector.hasConditions?this.selector.scopeClassName:"";this.key=[this.joined,a,s,u,l].join("\0"),this.hash=this.buildHash(u)}return a(e,[{key:"getConflictKeys",value:function(){var e=this.selector.preconditions.join(","),t=this.selector.postconditions.join(","),n=this.selector.atRules.join("|");return l(k(this.property)).map(function(r){return[r,e,t,n].join("\0")})}},{key:"buildHash",value:function(e){return this.selector.hasConditions||e?b(T(this.sheet.name),this.key):b(T(this.sheet.name),this.joined)}},{key:"toString",value:function(){var t=x(this.selector.preconditions,{right:this.hash});return t=x(this.selector.postconditions,{left:t}),"".concat(t," {").concat(e.genRule(this.property,this.value),"}")}}],[{key:"genRule",value:function(e,t){return S(k(e),"content"===e?'"'.concat(t,'"'):t)+";"}}]),e}();function x(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.left,o=n.right,i=e.reduce(function(e,t){return f(t)?e+t:v(t)?e+t.slice(1):g([e,t]," ")},void 0===r?"":r);return g([i,(t=void 0===o?"":o)?".".concat(t):""]," ")}var _=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.preconditions,a=r.postconditions,s=r.atRules;o(this,e),this.sheet=t,this.preconditions=[],this.scopeClassName=null,this.scopeName=null,this.postconditions=[],this.atRules=[],this.preconditions=i?d(i):[],this.postconditions=a?d(a):[],this.atRules=s?s.slice():[],this.setScope(n)}return a(e,[{key:"setScope",value:function(e){return e&&(this.scopeClassName||(this.scopeName=e,this.scopeClassName=b(T(this.sheet.name),e+"\0"+this.sheet.count))),this}},{key:"hasConditions",get:function(){return this.preconditions.length>0||this.postconditions.length>0}},{key:"addScope",value:function(t){return new e(this.sheet,t,{preconditions:this.preconditions,postconditions:this.postconditions,atRules:this.atRules})}},{key:"addPrecondition",value:function(t){return new e(this.sheet,this.scopeClassName,{postconditions:this.postconditions,preconditions:this.preconditions.concat(t),atRules:this.atRules})}},{key:"addPostcondition",value:function(t){return new e(this.sheet,this.scopeClassName,{preconditions:this.preconditions,postconditions:this.postconditions.concat(t),atRules:this.atRules})}},{key:"addAtRule",value:function(t){var n=new e(this.sheet,null,{preconditions:this.preconditions,postconditions:this.postconditions,atRules:this.atRules.concat(t)});return n.scopeClassName=this.scopeClassName,n.scopeName=this.scopeName,n}},{key:"createRule",value:function(e,t){return new j(this.sheet,e,t,this)}}]),e}();function C(e,t){for(var n in e)t(n.trim(),e[n])}function N(e,t,n){var r;return"".concat(T(e),"_").concat(t,"_").concat((r=n.replace(/[^a-zA-Z0-9_-]/g,"_"),/^[0-9]/.test(r)||/^-[0-9]/.test(r)?"_".concat(r):r))}function A(e,t){var n="@keyframes ".concat(e," {");return C(t,function(e,t){var r,o,i,a;r=n,o=e,i=t,a="".concat(r,"\n").concat(o," {"),C(i,function(e,t){p(e,t)&&(a="".concat(a," ").concat(j.genRule(e,t)))}),n="".concat(a," }")}),"".concat(n,"\n}")}var E=new Map;function R(e,t){var n=E.get(e);n?t.forEach(function(e){return n.add(e)}):E.set(e,new Set(t))}var O=/^\.([A-Za-z0-9_-]+)\s*\{\s*(.+?)\s*\}\s*$/,P=/^@keyframes\s+([A-Za-z0-9_-]+)\s*\{$/,M=function(){function e(t,n){o(this,e),this.name=t,this.storedStyles={},this.storedClasses={},this.adoptedTexts=new Set,this.adoptedKeyframes=new Map,this.usedKeyframeNames=new Set,this.style="",this.keyframesCount=0,this.count=0,this.id="flairup-".concat(t);var r=L(n);this.rootNode=r.rootNode,this.nonce=r.nonce,this.styleTag=this.createStyleTag()}return a(e,[{key:"getStyle",value:function(){return this.style}},{key:"append",value:function(e){this.style=w(this.style,e,"\n")}},{key:"appendInline",value:function(e){this.style=w(this.style,e)}},{key:"seq",value:function(){return this.count++}},{key:"keyframeSeq",value:function(){return this.keyframesCount++}},{key:"getLength",value:function(){return this.style.length}},{key:"truncate",value:function(e){this.style=this.style.slice(0,e)}},{key:"apply",value:function(){this.seq(),this.styleTag&&(this.styleTag.innerHTML=this.style)}},{key:"isApplied",value:function(){return!!this.styleTag}},{key:"isDetached",value:function(){return void 0!==this.styleTag&&!this.styleTag.isConnected}},{key:"getNonce",value:function(){return this.nonce}},{key:"setNonce",value:function(e){this.nonce=e,this.styleTag&&e&&this.styleTag.setAttribute("nonce",e)}},{key:"adoptedRuleText",value:function(e){return this.adoptedTexts.has(e.trim())}},{key:"adoptedKeyframeBody",value:function(e){return this.adoptedKeyframes.get(e)}},{key:"isKeyframeNameTaken",value:function(e){return this.adoptedKeyframes.has(e)||this.usedKeyframeNames.has(e)}},{key:"markKeyframeNameUsed",value:function(e){this.usedKeyframeNames.add(e)}},{key:"createStyleTag",value:function(){var e;return"u"<typeof document||this.isApplied()||null===this.rootNode?this.styleTag:null!=(e=this.adoptStyleTag())?e:this.mountStyleTag()}},{key:"addRule",value:function(e){var t=this.storedClasses[e.key];if(m(t))return t;var n=this.resolveHash(e);return this.commitRule(e,n),n}},{key:"resolveHash",value:function(e){for(var t=e.hash,n=0;this.isHashTaken(t,e);)n+=1,t="".concat(e.hash,"_").concat(n);return t}},{key:"isHashTaken",value:function(e,t){var n=this.storedStyles[e];return void 0!==n&&(n[0]!==t.property||n[1]!==t.value)}},{key:"commitRule",value:function(e,t){e.hash=t,this.storedClasses[e.key]=t,this.storedStyles[t]=[e.property,e.value],R(t,e.getConflictKeys()),this.appendUnlessAdopted(e)}},{key:"appendUnlessAdopted",value:function(e){var t=e.toString();this.adoptedTexts.has(t.trim())||this.append(t)}},{key:"adoptStyleTag",value:function(){var e=this.findExistingStyleTag();if(e){var t=e.innerHTML;return this.style=t,this.applyNonce(e),this.hydrateFromStyle(t),e}}},{key:"hydrateFromStyle",value:function(e){for(var t=e.split("\n"),n=[],r=0;r<t.length;){var o=t[r];if(void 0===o)break;r=this.hydrateLine(t,o.trim(),n,r)}}},{key:"hydrateLine",value:function(e,t,n,r){return t.startsWith("@keyframes")&&P.test(t)?this.adoptKeyframesBlock(e,r):(this.trackStructure(t,n)||this.adoptRuleLine(t,n.join("|")),r+1)}},{key:"trackStructure",value:function(e,t){var n;return(n=e).endsWith("{")&&y(K(n))?(t.push(K(e)),!0):"}"===e&&(t.pop(),!0)}},{key:"adoptRuleLine",value:function(e,t){if(e){this.adoptedTexts.add(e);var n=function(e,t){var n,r,o=O.exec(e),i=null==o?void 0:o[1],a=null==o?void 0:o[2];if(i&&a&&(n=i,r=t,n.startsWith("".concat(T(r),"_")))){var s=function(e){var t=e.split(";").map(function(e){return e.trim()}).filter(function(e){return""!==e}),n=t[0];if(1===t.length&&n){var r=n.indexOf(":");if(!(r<0))return[n.slice(0,r).trim(),n.slice(r+1).trim()]}}(a);if(s)return{hash:i,prop:s[0],value:s[1]}}}(e,this.name);n&&this.storeAdoptedRule(n,t)}}},{key:"storeAdoptedRule",value:function(e,t){var n="".concat(e.prop,":").concat(e.value);this.storedClasses[[n,"",t,""].join("\0")]=e.hash,this.storedStyles[e.hash]=[e.prop,e.value],R(e.hash,l(e.prop).map(function(e){return[e,"\0",t].join("\0")}))}},{key:"adoptKeyframesBlock",value:function(e,t){var n,r,o,i=function(e,t){for(var n,r=t+1;r<e.length;r++)if((null==(n=e[r])?void 0:n.trim())==="}")return r;return -1}(e,t);if(i<0)return t+1;var a=e[t],s=void 0===a?"":(n=a.trim(),null!=(r=null==(o=P.exec(n))?void 0:o[1])?r:"");return s&&this.adoptedKeyframes.set(s,e.slice(t,i+1).join("\n").replace(/\s+/g,"")),i+1}},{key:"mountStyleTag",value:function(){var e=document.createElement("style");return e.type="text/css",e.id=this.id,this.applyNonce(e),this.getMountTarget().appendChild(e),e}},{key:"getMountTarget",value:function(){var e;return null!=(e=this.rootNode)?e:document.head}},{key:"findExistingStyleTag",value:function(){var e,t=null!=(e=this.rootNode)?e:document;return"function"==typeof t.getElementsByTagName?this.findTagById(t.getElementsByTagName("style")):function e(t,n){for(var r=t.childNodes,o=0;o<r.length;o++){var i=function(t,n){if(t)return"STYLE"===t.tagName&&t.id===n?t:e(t,n)}(r[o],n);if(i)return i}}(t,this.id)}},{key:"findTagById",value:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n&&n.id===this.id&&"STYLE"===n.tagName)return n}}},{key:"applyNonce",value:function(e){this.nonce&&e.setAttribute("nonce",this.nonce)}}]),e}();function L(e){return e&&"number"!=typeof e.nodeType?{rootNode:e.rootNode,nonce:e.nonce}:{rootNode:e,nonce:void 0}}function K(e){return e.slice(0,-1).trim()}function I(){for(var e,t,n,r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=[];return z(o,a),e=a,t=new Set,n=e.map(function(){return!1}),function(e,t,n){for(var r=e.length-1;r>=0;r--)!function(e,t,n,r){var o,i,a=e[r],s=null!==(i=(o=E.get(a))?Array.from(o):void 0)&&void 0!==i?i:[a];s.some(function(e){return n.has(e)})||(t[r]=!0,s.forEach(function(e){return n.add(e)}))}(e,t,n,r)}(e,n,t),e.filter(function(e,t){return n[t]}).join(" ")}function z(e,t){e.forEach(function(e){return function e(t,n){"string"==typeof t?B(t,n):t&&(void 0===t?"undefined":t&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)=="object"&&function(t,n){var r,o,i;(null!=(r=Set)&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](t):t instanceof r)?t.forEach(function(t){return e(t,n)}):Array.isArray(t)?z(t,n):(o=t,i=n,Object.entries(o).forEach(function(e){var t=s(e,2),n=t[0];t[1]&&B(n,i)}))}(t,n)}(e,t)})}function B(e,t){e.split(/\s+/).forEach(function(e){e&&t.push(e)})}function H(e,t){return e.forEach(function(e){return t.add(e)}),t}function W(e){return"box"===e.kind?e.longhands.slice(0,4):e.longhands}var $={1:[0,0,0,0],2:[0,1,0,1],3:[0,1,2,1],4:[0,1,2,3]},q={2:[0,1]};function D(e){for(var t=0,n=0;n<e.length;n++){var r=e[n];if(0===(t=Math.max(0,t+V(r)))&&"/"===r)return n}return -1}function F(e){var t=$[e.length];if(t)return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=e[a.value];if(void 0===u)return;n.push(u)}}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)}function U(e,t){return t?"".concat(e," !important"):e}function Z(e){var t=e.trim(),n=/^(var|env|attr)\(/i.exec(t);return!!n&&function(e,t){for(var n=0,r=t;r<e.length;r++)if(0===(n=Math.max(0,n+V(e[r]))))return r===e.length-1;return!0}(t,n[0].length-1)}function V(e){return"("===e?1:")"===e?-1:0}function G(e){var t=[],n={current:"",depth:0,slash:!1},r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;!function(e,t,n){var r;(e.depth=Math.max(0,e.depth+V(t)),0===e.depth&&(r=t," "===r||" "===r||"\n"===r||"\r"===r))?Y(n,e):(0===e.depth&&"/"===t&&(e.slash=!0),e.current+=t)}(n,u,t)}}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return Y(t,n),{tokens:t,slash:n.slash}}function Y(e,t){t.current&&(e.push(t.current),t.current="")}function J(e,t){var n,r,o,i,a,l,f=(n=e,(i=(o=L(r=t)).rootNode,"u">typeof document&&null!==i)?function(e,t,n,r){var o,i,a,s,u,l,c,d,f,h,p=void 0===(o=n)&&"u">typeof document?document.head:o,y=function(e,t){if(void 0===t)return X.get(e);var n=Q.get(t);return null==n?void 0:n.get(e)}(e,p);if(y&&!y.isDetached()){return i=y,void 0!==(a=r)&&a!==i.getNonce()&&i.setNonce(a),y}var m=new M(e,t);return s=e,u=p,l=m,void 0===u?X.set(s,l):(c=u,d=s,f=l,(h=Q.get(c))||(h=new Map,Q.set(c,h)),h.set(d,f)),m}(n,r,o.rootNode,o.nonce):new M(n,r));return{create:(a=f,function(e){var t={};return(function e(t,n,r){var o={preconditions:[]};return C(n,function(i,a){return h(i)?e(t,a,r.addPrecondition(i)).preconditions.forEach(function(e){return o.preconditions.push(e)}):o.preconditions.push([i,n[i],r.addScope(i)]),o}),o})(a,e,new _(a)).preconditions.forEach(function(e){var n=s(e,3),r=n[0];(function e(t,n,r){var o=new Set;return C(n,function(n,i){var a,l,f,m,v,g,b,S,w,T,_,N,A,E,R,O,P,M,L,K,I,z=[];if(h(n))z=e(t,i,r.addPostcondition(n));else if("."===n)z=d(i);else if(y(n)){a=t,l=i,f=n,m=r,v=a.getLength(),a.append(f+" {"),g=a.getLength(),b=e(a,l,m.addAtRule(f)),a.getLength()===g?a.truncate(v):a.append("}"),z=b}else if("--"===n){S=t,w=i,T=r,_=new Set,N=[],A=T.scopeClassName,C(w,function(t,n){if(p(t,n)){if(A){var r=T.createRule(t,n);_.add(S.addRule(r));return}N.push(j.genRule(t,n));return}H(e(S,null!=n?n:{},T),_)}),!A&&N.length&&(E=S,R=N.join(" "),P=x((O=T).preconditions,{}),(P=x(O.postconditions,{left:P}))&&E.append("".concat(P," {").concat(R,"}"))),z=_}else{p(n,i)&&(M=r,(I=function(e,t){var n,r,o,i,a=function(e,t){var n=function(e){var t=c[e],n=t?u[e]:void 0;if(t&&n)return{kind:t,longhands:n}}(k(e));if(n)return function(e,t){var n,r,o,i=(n=t,(o=/^(.*?)\s*!important\s*$/i.exec(n))?{text:(null!=(r=o[1])?r:"").trim(),important:!0}:{text:n,important:!1}),a=i.text,s=i.important,u=G(a),l=u.tokens,c=u.slash;if(!(0===l.length||l.some(Z)))return{kind:e.kind,longhands:e.longhands,tokens:l,slash:c,important:s,text:a}}(n,String(t))}(e,t);if(a){return r=(n=a).kind,o=n.slash,i=n.tokens,"corners"===r&&o?function(e){var t=function(e){var t=D(e);if(!(t<0)){var n=e.slice(0,t).trim(),r=e.slice(t+1).trim();if(!(!n||!r||D(r)>=0))return{horizontal:n,vertical:r}}}(e.text);if(t){var n,r,o,i,a=F(G(t.horizontal).tokens),s=F(G(t.vertical).tokens);if(a&&s){return n=e,r=a,o=s,i=[],n.longhands.forEach(function(e,t){var a=r[t],s=o[t];void 0!==a&&void 0!==s&&i.push([e,U("".concat(a," ").concat(s),n.important)])}),i}}}(n):1===i.length?function(e){var t=e.tokens,n=e.important,r=t[0];if(r)return W(e).map(function(e){return[e,U(r,n)]})}(n):function(e){var t=e.kind,n=e.tokens,r=e.slash,o=e.important;if(!r){var i,a,s,u,l,c="pair"===t?q[n.length]:$[n.length];if(c){return i=W(e),a=c,s=n,u=o,l=[],a.forEach(function(e,t){var n=i[t],r=s[e];void 0!==n&&void 0!==r&&l.push([n,U(r,u)])}),l}}}(n)}}(L=n,K=i))?I.map(function(e){var t=s(e,2),n=t[0],r=t[1];return M.createRule(n,r)}):[M.createRule(L,K)]).forEach(function(e){t.addRule(e),o.add(e.hash)})}return H(z,o)}),o})(a,n[1],n[2]).forEach(function(e){var n,o,i;n=r,o=e,t[n]=null!=(i=t[n])?i:new Set,t[n].add(o)})}),a.apply(),t}),keyframes:(l=f,function(e){var t,n=(t={},C(e,function(e,n){var r,o,i,a,s,u;t[e]=(r=l,o=e,i=n,a=r.keyframeSeq(),u=A(s=N(r.name,a,o),i),r.adoptedKeyframeBody(s)===u.replace(/\s+/g,"")?s:function(e,t,n,r){for(var o=r,i=N(e.name,o,t);e.isKeyframeNameTaken(i);)o+=1,i=N(e.name,o,t);return e.append(A(i,n)),e.markKeyframeNameUsed(i),i}(r,o,i,a))}),t);return l.apply(),n}),getStyle:f.getStyle.bind(f),isApplied:f.isApplied.bind(f)}}var X=new Map,Q=new WeakMap},4054:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={bindSnapshot:function(){return u},createAsyncLocalStorage:function(){return s},createSnapshot:function(){return l}};for(var r in n)Object.defineProperty(t,r,{enumerable:!0,get:n[r]});let o=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class i{disable(){throw o}getStore(){}run(){throw o}exit(){throw o}enterWith(){throw o}static bind(e){return e}}let a="u">typeof globalThis&&globalThis.AsyncLocalStorage;function s(){return a?new a:new i}function u(e){return a?a.bind(e):i.bind(e)}function l(){return a?a.snapshot():function(e,...t){return e(...t)}}},5214:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(7828)},5707:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(3623)._(n(8635));function o(e,t){let n={};"function"==typeof e&&(n.loader=e);let o={...n,...t};return(0,r.default)({...o,modules:o.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5772:(e,t,n)=>{n.d(t,{default:()=>o.a});var r=n(7651),o=n.n(r)},7206:(e,t,n)=>{n.d(t,{default:()=>o.a});var r=n(5707),o=n.n(r)},7651:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={default:function(){return c},getImageProps:function(){return l}};for(var o in r)Object.defineProperty(t,o,{enumerable:!0,get:r[o]});let i=n(3623),a=n(5413),s=n(8437),u=i._(n(6095));function l(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:u.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let c=s.Image},7828:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(4054).createAsyncLocalStorage)()},8635:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(5155),o=n(2115),i=n(1112);function a(e){return{default:e&&"default"in e?e.default:e}}n(1957);let s={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},u=function(e){let t={...s,...e},n=(0,o.lazy)(()=>t.loader().then(a)),u=t.loading;function l(e){let a=u?(0,r.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,l=s?o.Suspense:o.Fragment,c=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(i.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(l,{...s?{fallback:a}:{},children:c})}return l.displayName="LoadableComponent",l}}}]);
@@ -0,0 +1,3 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8437],{751:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return i}});let i=r(3623)._(r(2115)).default.createContext(null)},2590:(e,t)=>{function r({widthInt:e,heightInt:t,blurWidth:r,blurHeight:i,blurDataURL:n,objectFit:o}){let a=r?40*r:e,l=i?40*i:t,s=a&&l?`viewBox='0 0 ${a} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${s}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${s?"none":"contain"===o?"xMidYMid":"cover"===o?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${n}'/%3E%3C/svg%3E`}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},5413:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return u}}),r(7284);let i=r(3887),n=r(2590),o=r(5762),a=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function s(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function u({src:e,sizes:t,unoptimized:r=!1,priority:u=!1,preload:d=!1,loading:c,className:f,quality:p,width:g,height:m,fill:h=!1,style:b,overrideSrc:y,onLoad:_,onLoadingComplete:v,placeholder:w="empty",blurDataURL:j,fetchPriority:P,decoding:x="async",layout:C,objectFit:E,objectPosition:O,lazyBoundary:S,lazyRoot:R,...z},M){var $;let I,D,k,{imgConf:A,showAltText:N,blurComplete:T,defaultLoader:F}=M,L=A||o.imageConfigDefault;if("allSizes"in L)I=L;else{let e=[...L.deviceSizes,...L.imageSizes].sort((e,t)=>e-t),t=L.deviceSizes.sort((e,t)=>e-t),r=L.qualities?.sort((e,t)=>e-t);I={...L,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===F)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let U=z.loader||F;delete z.loader,delete z.srcSet;let q="__next_img_default"in U;if(q){if("custom"===I.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
2
+ Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=U;U=t=>{let{config:r,...i}=t;return e(i)}}if(C){"fill"===C&&(h=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[C];e&&(b={...b,...e});let r={responsive:"100vw",fill:"100vw"}[C];r&&!t&&(t=r)}let B="",W=s(g),G=s(m);if(($=e)&&"object"==typeof $&&(l($)||void 0!==$.src)){let t=l(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(D=t.blurWidth,k=t.blurHeight,j=j||t.blurDataURL,B=t.src,!h)if(W||G){if(W&&!G){let e=W/t.width;G=Math.round(t.height*e)}else if(!W&&G){let e=G/t.height;W=Math.round(t.width*e)}}else W=t.width,G=t.height}let X=!u&&!d&&("lazy"===c||void 0===c);(!(e="string"==typeof e?e:B)||e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,X=!1),I.unoptimized&&(r=!0),q&&!I.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(r=!0);let H=s(p),V=Object.assign(h?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:E,objectPosition:O}:{},N?{}:{color:"transparent"},b),J=T||"empty"===w?null:"blur"===w?`url("data:image/svg+xml;charset=utf-8,${(0,n.getImageBlurSvg)({widthInt:W,heightInt:G,blurWidth:D,blurHeight:k,blurDataURL:j||"",objectFit:V.objectFit})}")`:`url("${w}")`,Q=a.includes(V.objectFit)?"fill"===V.objectFit?"100% 100%":"cover":V.objectFit,Y=J?{backgroundSize:Q,backgroundPosition:V.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:J}:{},K=function({config:e,src:t,unoptimized:r,width:n,quality:o,sizes:a,loader:l}){if(r){let e=(0,i.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")&&e){let r=t.includes("?")?"&":"?";t=`${t}${r}dpl=${e}`}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:s,kind:u}=function({deviceSizes:e,allSizes:t},r,i){if(i){let r=/(^|\s)(1?\d?\d)vw/g,n=[];for(let e;e=r.exec(i);)n.push(parseInt(e[2]));if(n.length){let r=.01*Math.min(...n);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,n,a),d=s.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:s.map((r,i)=>`${l({config:e,src:t,quality:o,width:r})} ${"w"===u?r:i+1}${u}`).join(", "),src:l({config:e,src:t,quality:o,width:s[d]})}}({config:I,src:e,unoptimized:r,width:W,quality:H,sizes:t,loader:U}),Z=X?"lazy":c;return{props:{...z,loading:Z,fetchPriority:P,width:W,height:G,decoding:x,className:f,style:{...V,...Y},sizes:K.sizes,srcSet:K.srcSet,src:y||K.src},meta:{unoptimized:r,preload:d||u,placeholder:w,fill:h}}}},5762:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return n},imageConfigDefault:function(){return o}};for(var i in r)Object.defineProperty(t,i,{enumerable:!0,get:r[i]});let n=["default","imgix","cloudinary","akamai","custom"],o={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1}},6095:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let i=r(8857),n=r(3887);function o({config:e,src:t,width:r,quality:o}){if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
3
+ Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let a=(0,i.findClosestQuality)(o,e),l=(0,n.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${a}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}o.__next_img_default=!0;let a=o},6686:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var i={default:function(){return m},defaultHead:function(){return c}};for(var n in i)Object.defineProperty(t,n,{enumerable:!0,get:i[n]});let o=r(3623),a=r(6388),l=r(5155),s=a._(r(2115)),u=o._(r(6899)),d=r(5368);function c(){return[(0,l.jsx)("meta",{charSet:"utf-8"},"charset"),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===s.default.Fragment?e.concat(s.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}r(7284);let p=["name","httpEquiv","charSet","itemProp"];function g(e){let t,r,i,n;return e.reduce(f,[]).reverse().concat(c().reverse()).filter((t=new Set,r=new Set,i=new Set,n={},e=>{let o=!0,a=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){a=!0;let r=e.key.slice(e.key.indexOf("$")+1);t.has(r)?o=!1:t.add(r)}switch(e.type){case"title":case"base":r.has(e.type)?o=!1:r.add(e.type);break;case"meta":for(let t=0,r=p.length;t<r;t++){let r=p[t];if(e.props.hasOwnProperty(r))if("charSet"===r)i.has(r)?o=!1:i.add(r);else{let t=e.props[r],i=n[r]||new Set;("name"!==r||!a)&&i.has(t)?o=!1:(i.add(t),n[r]=i)}}}return o})).reverse().map((e,t)=>{let r=e.key||t;return s.default.cloneElement(e,{key:r})})}let m=function({children:e}){let t=(0,s.useContext)(d.HeadManagerContext);return(0,l.jsx)(u.default,{reduceComponentsToState:g,headManager:t,children:e})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6899:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let i=r(2115),n=i.useLayoutEffect,o=i.useEffect;function a(e){let{headManager:t,reduceComponentsToState:r}=e;function a(){if(t&&t.mountedInstances){let e=i.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return n(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),n(()=>(t&&(t._pendingUpdate=a),()=>{t&&(t._pendingUpdate=a)})),o(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},7150:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return o}});let i=r(3623)._(r(2115)),n=r(5762),o=i.default.createContext(n.imageConfigDefault)},8437:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return v}});let i=r(3623),n=r(6388),o=r(5155),a=n._(r(2115)),l=i._(r(7650)),s=i._(r(6686)),u=r(5413),d=r(5762),c=r(7150);r(7284);let f=r(751),p=i._(r(6095)),g=r(1172),m={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function h(e,t,r,i,n,o,a){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&n(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let i=!1,n=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>i,isPropagationStopped:()=>n,persist:()=>{},preventDefault:()=>{i=!0,t.preventDefault()},stopPropagation:()=>{n=!0,t.stopPropagation()}})}i?.current&&i.current(e)}}))}function b(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}let y=(0,a.forwardRef)(({src:e,srcSet:t,sizes:r,height:i,width:n,decoding:l,className:s,style:u,fetchPriority:d,placeholder:c,loading:f,unoptimized:p,fill:m,onLoadRef:y,onLoadingCompleteRef:_,setBlurComplete:v,setShowAltText:w,sizesInput:j,onLoad:P,onError:x,...C},E)=>{let O=(0,a.useCallback)(e=>{e&&(x&&(e.src=e.src),e.complete&&h(e,c,y,_,v,p,j))},[e,c,y,_,v,x,p,j]),S=(0,g.useMergedRef)(E,O);return(0,o.jsx)("img",{...C,...b(d),loading:f,width:n,height:i,decoding:l,"data-nimg":m?"fill":"1",className:s,style:u,sizes:r,srcSet:t,src:e,ref:S,onLoad:e=>{h(e.currentTarget,c,y,_,v,p,j)},onError:e=>{w(!0),"empty"!==c&&v(!0),x&&x(e)}})});function _({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...b(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,r),null):(0,o.jsx)(s.default,{children:(0,o.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let v=(0,a.forwardRef)((e,t)=>{let r=(0,a.useContext)(f.RouterContext),i=(0,a.useContext)(c.ImageConfigContext),n=(0,a.useMemo)(()=>{let e=m||i||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),n=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:n,localPatterns:e.localPatterns}},[i]),{onLoad:l,onLoadingComplete:s}=e,g=(0,a.useRef)(l);(0,a.useEffect)(()=>{g.current=l},[l]);let h=(0,a.useRef)(s);(0,a.useEffect)(()=>{h.current=s},[s]);let[b,v]=(0,a.useState)(!1),[w,j]=(0,a.useState)(!1),{props:P,meta:x}=(0,u.getImgProps)(e,{defaultLoader:p.default,imgConf:n,blurComplete:b,showAltText:w});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y,{...P,unoptimized:x.unoptimized,placeholder:x.placeholder,fill:x.fill,onLoadRef:g,onLoadingCompleteRef:h,setBlurComplete:v,setShowAltText:j,sizesInput:e.sizes,ref:t}),x.preload?(0,o.jsx)(_,{isAppRouter:!r,imgAttributes:P}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8857:(e,t)=>{function r(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e,0):r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"findClosestQuality",{enumerable:!0,get:function(){return r}})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8500],{91:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});let u=r(6388)._(r(1393)),a=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",i=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(u.urlQueryToSearchParams(l)));let f=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==c?(c="//"+(c||""),o&&"/"!==o[0]&&(o="/"+o)):c||(c=""),i&&"#"!==i[0]&&(i="#"+i),f&&"?"!==f[0]&&(f="?"+f),o=o.replace(/[?#]/g,encodeURIComponent),f=f.replace("#","%23"),`${n}${c}${o}${f}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return i(e)}},857:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return P},MissingStaticPage:function(){return v},NormalizeError:function(){return m},PageNotFoundError:function(){return b},SP:function(){return h},ST:function(){return y},WEB_VITALS:function(){return o},execOnce:function(){return u},getDisplayName:function(){return f},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return i},isResSent:function(){return s},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return _}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let o=["CLS","FCP","FID","INP","LCP","TTFB"];function u(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let a=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=e=>a.test(e);function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function d(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await d(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&s(r))return n;if(!n)throw Object.defineProperty(Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let h="u">typeof performance,y=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class m extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class P extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function _(e){return JSON.stringify({message:e.message,stack:e.stack})}},1172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=r(2115);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=u(e,n)),t&&(o.current=u(t,n))},[e,t])}function u(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1393:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={assign:function(){return i},searchParamsToUrlQuery:function(){return o},urlQueryToSearchParams:function(){return a}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});function o(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function u(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function a(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,u(e));else t.set(r,u(n));return t}function i(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},8500:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return m},useLinkStatus:function(){return v}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});let u=r(6388),a=r(5155),i=u._(r(2115)),l=r(91),c=r(2909),f=r(1172),s=r(857),p=r(127);r(7284);let d=r(4972),h=r(9470),y=r(7565);function g(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function m(e){var t;let n,o,u,[l,m]=(0,i.useOptimistic)(d.IDLE_LINK_STATUS),v=(0,i.useRef)(null),{href:P,as:_,children:E,prefetch:O=null,passHref:j,replace:S,shallow:C,scroll:T,onClick:N,onMouseEnter:R,onTouchStart:L,legacyBehavior:k=!1,onNavigate:x,ref:M,unstable_dynamicOnHover:w,...$}=e;n=E,k&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let A=i.default.useContext(c.AppRouterContext),I=!1!==O,U=!1!==O?null===(t=O)||"auto"===t?y.FetchStrategy.PPR:y.FetchStrategy.Full:y.FetchStrategy.PPR,{href:F,as:D}=i.default.useMemo(()=>{let e=g(P);return{href:e,as:_?g(_):e}},[P,_]);if(k){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=i.default.Children.only(n)}let B=k?o&&"object"==typeof o&&o.ref:M,K=i.default.useCallback(e=>(null!==A&&(v.current=(0,d.mountLinkInstance)(e,F,A,U,I,m)),()=>{v.current&&((0,d.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,d.unmountPrefetchableInstance)(e)}),[I,F,A,U,m]),z={ref:(0,f.useMergedRef)(K,B),onClick(e){k||"function"!=typeof N||N(e),k&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(e),!A||e.defaultPrevented||function(e,t,n,o,u,a,l){{let c,{nodeName:f}=e.currentTarget;if("A"===f.toUpperCase()&&((c=e.currentTarget.getAttribute("target"))&&"_self"!==c||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(t)){u&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:s}=r(156);i.default.startTransition(()=>{s(n||t,u?"replace":"push",a??!0,o.current)})}}(e,F,D,v,S,T,x)},onMouseEnter(e){k||"function"!=typeof R||R(e),k&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),A&&I&&(0,d.onNavigationIntent)(e.currentTarget,!0===w)},onTouchStart:function(e){k||"function"!=typeof L||L(e),k&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),A&&I&&(0,d.onNavigationIntent)(e.currentTarget,!0===w)}};return(0,s.isAbsoluteUrl)(D)?z.href=D:k&&!j&&("a"!==o.type||"href"in o.props)||(z.href=(0,p.addBasePath)(D)),u=k?i.default.cloneElement(o,z):(0,a.jsx)("a",{...$,...z,children:n}),(0,a.jsx)(b.Provider,{value:l,children:u})}r(9842);let b=(0,i.createContext)(d.IDLE_LINK_STATUS),v=()=>(0,i.useContext)(b);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9470:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return u}});let n=r(857),o=r(8512);function u(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},9842:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[871],{302:(e,s,t)=>{"use strict";t.d(s,{v:()=>c});var a=t(2115);let n=[],l=0,i=!1;function r(e){let s,t=(s=n[n.length-1])||null;if(t){if("Escape"===e.key){e.preventDefault(),t.onEscape();return}"Enter"===e.key&&t.onEnter&&!function(e){if(e.defaultPrevented||e.repeat||e.isComposing||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return!0;let s=e.target;if(!s)return!1;if(s.isContentEditable)return!0;let t=s.tagName;return"TEXTAREA"===t||"BUTTON"===t||"SELECT"===t||"OPTION"===t||"A"===t}(e)&&(e.preventDefault(),t.onEnter())}}function c(e,s,t){let c=(0,a.useRef)(s),d=(0,a.useRef)(t);(0,a.useEffect)(()=>{c.current=s},[s]),(0,a.useEffect)(()=>{d.current=t},[t]),(0,a.useEffect)(()=>{if(!e)return;let s=++l;return n.push({id:s,onEscape:()=>c.current(),onEnter:()=>d.current?.()}),!i&&"u">typeof document&&(document.addEventListener("keydown",r),i=!0),()=>{let e=n.findIndex(e=>e.id===s);e>=0&&n.splice(e,1),i&&"u">typeof document&&!(n.length>0)&&(document.removeEventListener("keydown",r),i=!1)}},[e])}},3543:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>m});var a=t(5155),n=t(2115),l=t(7702),i=t(5772),r=t(8500),c=t.n(r),d=t(302);let o={github:"https://www.google.com/s2/favicons?domain=github.com&sz=64",gitlab:"https://www.google.com/s2/favicons?domain=gitlab.com&sz=64"};function u({type:e,size:s,className:t=""}){return(0,a.jsx)(i.default,{src:o[e],alt:`${"github"===e?"GitHub":"GitLab"} icon`,width:s,height:s,className:t,unoptimized:!0})}function m(){let{data:e,isLoading:s,error:t}=(0,l.aX)(),i=(0,l.Lv)(),r=(0,l.sX)(),o=(0,l.Ii)(),[m,h]=(0,n.useState)(null),[b,p]=(0,n.useState)(null),[g,j]=(0,n.useState)(null),[f,N]=(0,n.useState)(""),[y,v]=(0,n.useState)(""),[w,k]=(0,n.useState)(!1),[E,C]=(0,n.useState)(null),S=(0,n.useRef)(null),L=()=>{h(null),p(null),N(""),v(""),k(!1),C(null)},T=e=>{L(),h(e)},G=async e=>{e.preventDefault(),C(null);try{b?await r.mutateAsync({id:b.id,token:f}):"github"===m?await i.mutateAsync({type:"github",token:f}):"gitlab"===m&&await i.mutateAsync({type:"gitlab",serverUrl:y,token:f}),L()}catch(e){C(e.message)}},F=async()=>{if(g)try{await o.mutateAsync(g.id),j(null)}catch(e){console.error("Failed to delete credential:",e)}},P=i.isPending||r.isPending;return(0,d.v)(null!==m,L,()=>{P||S.current?.requestSubmit()}),(0,d.v)(null!==g,()=>j(null),()=>{g&&!o.isPending&&F()}),(0,a.jsxs)("main",{className:"min-h-screen bg-base-100",children:[(0,a.jsxs)("div",{className:"container mx-auto max-w-4xl py-12 px-6",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-8",children:(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(c(),{href:"/",className:"btn btn-ghost btn-square",children:(0,a.jsx)("i",{className:"iconoir-arrow-left text-[20px]","aria-hidden":"true"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:"Credentials"}),(0,a.jsx)("p",{className:"text-sm opacity-70 mt-1",children:"Manage your remote repository credentials"})]})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-8",children:[(0,a.jsx)("div",{className:"card bg-base-100 shadow-lg hover:shadow-xl transition-shadow cursor-pointer border border-base-200",onClick:()=>T("github"),children:(0,a.jsxs)("div",{className:"card-body p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"p-2 bg-base-200 rounded-lg",children:(0,a.jsx)(u,{type:"github",size:24,className:"h-6 w-6 rounded-sm"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"card-title text-base",children:"GitHub"}),(0,a.jsx)("p",{className:"text-xs opacity-70",children:"Personal Access Token"})]})]}),(0,a.jsxs)("button",{className:"btn btn-sm w-full gap-2",children:[(0,a.jsx)("i",{className:"iconoir-plus text-[16px]","aria-hidden":"true"}),"Add GitHub"]})]})}),(0,a.jsx)("div",{className:"card bg-base-100 shadow-lg hover:shadow-xl transition-shadow cursor-pointer border border-base-200",onClick:()=>T("gitlab"),children:(0,a.jsxs)("div",{className:"card-body p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"p-2 bg-base-200 rounded-lg",children:(0,a.jsx)(u,{type:"gitlab",size:24,className:"h-6 w-6 rounded-sm"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"card-title text-base",children:"GitLab"}),(0,a.jsx)("p",{className:"text-xs opacity-70",children:"Server URL + Personal Access Token"})]})]}),(0,a.jsxs)("button",{className:"btn btn-sm w-full gap-2",children:[(0,a.jsx)("i",{className:"iconoir-plus text-[16px]","aria-hidden":"true"}),"Add GitLab Server"]})]})})]}),(0,a.jsxs)("div",{className:"border border-base-200 rounded-lg overflow-hidden bg-base-100",children:[(0,a.jsx)("div",{className:"px-6 py-3 bg-base-200/50 border-b border-base-200",children:(0,a.jsx)("h2",{className:"text-sm font-bold opacity-70",children:"Saved Credentials"})}),s?(0,a.jsxs)("div",{className:"p-12 text-center opacity-70",children:[(0,a.jsx)("span",{className:"loading loading-spinner"}),(0,a.jsx)("p",{className:"mt-2 text-sm",children:"Loading credentials..."})]}):t?(0,a.jsx)("div",{className:"p-12 text-center text-error",children:(0,a.jsx)("p",{children:"Failed to load credentials"})}):e?.length===0?(0,a.jsxs)("div",{className:"p-12 text-center opacity-50",children:[(0,a.jsx)("i",{className:"iconoir-key text-[40px] mx-auto","aria-hidden":"true"}),(0,a.jsx)("p",{className:"font-bold mt-2",children:"No credentials saved yet."}),(0,a.jsx)("p",{className:"text-xs mt-1",children:"Add your first credential using the cards above."})]}):(0,a.jsx)("div",{className:"divide-y divide-base-200",children:e?.map(e=>(0,a.jsx)(x,{credential:e,onEdit:()=>{p(e),h(e.type),N(""),"gitlab"===e.type&&v(e.serverUrl)},onDelete:()=>j(e)},e.id))})]})]}),null!==m&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box",children:[(0,a.jsx)("h3",{className:"font-bold text-lg flex items-center gap-2",children:"github"===m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u,{type:"github",size:20,className:"h-5 w-5 rounded-sm"}),"GitHub Credential"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u,{type:"gitlab",size:20,className:"h-5 w-5 rounded-sm"}),"GitLab Credential"]})}),(0,a.jsx)("p",{className:"py-4 text-sm opacity-70",children:b?"Enter a new personal access token to update this credential.":"github"===m?"Enter your GitHub personal access token. This will be stored securely in your system keychain.":"Enter your GitLab server URL and personal access token."}),(0,a.jsxs)("form",{ref:S,onSubmit:G,className:"flex flex-col gap-4",children:["gitlab"===m&&!b&&(0,a.jsxs)("div",{className:"form-control w-full",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Server URL"})}),(0,a.jsx)("input",{type:"url",placeholder:"https://gitlab.example.com",value:y,onChange:e=>v(e.target.value),required:!0,className:"input input-bordered w-full",autoFocus:!0}),(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"Enter the full URL of your GitLab server"})})]}),"gitlab"===m&&b&&(0,a.jsxs)("div",{className:"form-control w-full",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Server URL"})}),(0,a.jsxs)("div",{className:"p-3 bg-base-200 rounded-lg text-sm font-mono flex items-center gap-2 min-w-0 break-all",children:[(0,a.jsx)(u,{type:"gitlab",size:16,className:"h-4 w-4 shrink-0 rounded-sm"}),b.serverUrl]})]}),(0,a.jsxs)("div",{className:"form-control w-full",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Personal Access Token"})}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:w?"text":"password",placeholder:b?"Enter new token":"ghp_xxxxxxxxxxxx or glpat-xxxxx",value:f,onChange:e=>N(e.target.value),className:"input input-bordered w-full pr-10",required:!0,autoFocus:!("gitlab"===m&&!b)}),(0,a.jsx)("button",{type:"button",className:"absolute right-2 top-2 btn btn-ghost btn-xs btn-square",onClick:()=>k(!w),children:w?(0,a.jsx)("i",{className:"iconoir-eye-closed text-[16px]","aria-hidden":"true"}):(0,a.jsx)("i",{className:"iconoir-eye text-[16px]","aria-hidden":"true"})})]}),(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"github"===m?(0,a.jsxs)(a.Fragment,{children:["Token needs repo scope."," ",(0,a.jsx)("a",{href:"https://github.com/settings/tokens/new?description=Trident&scopes=repo,user,notifications,workflow",target:"_blank",rel:"noreferrer",className:"link link-primary",children:"Create new token"})]}):"Token needs api scope for GitLab access"})})]}),E&&(0,a.jsx)("div",{className:"alert alert-error text-sm",children:(0,a.jsx)("span",{children:E})}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{type:"button",className:"btn",onClick:L,disabled:P,children:"Cancel"}),(0,a.jsxs)("button",{type:"submit",className:"btn btn-primary",disabled:P,children:[P&&(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),b?"Update":"Verify & Save"]})]})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:L,children:"close"})})]}),null!==g&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box",children:[(0,a.jsx)("h3",{className:"font-bold text-lg",children:"Delete Credential"}),(0,a.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to delete this ",g?.type==="github"?"GitHub":"GitLab"," ","credential for ",(0,a.jsx)("strong",{className:"break-all",children:g?.username}),"? This action cannot be undone."]}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{className:"btn",onClick:()=>j(null),children:"Cancel"}),(0,a.jsxs)("button",{className:"btn btn-error",onClick:F,disabled:o.isPending,children:[o.isPending&&(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Delete"]})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:()=>j(null),children:"close"})})]})]})}function x({credential:e,onEdit:s,onDelete:t}){let n="gitlab"===e.type;return(0,a.jsxs)("div",{className:"px-6 py-4 flex items-center justify-between hover:bg-base-200/30 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"p-2 bg-base-200 rounded-lg",children:n?(0,a.jsx)(u,{type:"gitlab",size:20,className:"h-5 w-5 rounded-sm"}):(0,a.jsx)(u,{type:"github",size:20,className:"h-5 w-5 rounded-sm"})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-bold text-sm",children:n?"GitLab":"GitHub"}),n&&(0,a.jsx)("span",{className:"text-xs opacity-70 font-mono bg-base-200 px-1.5 py-0.5 rounded",children:e.serverUrl.replace(/^https?:\/\//,"")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs opacity-70 mt-1",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("i",{className:"iconoir-user text-[14px]","aria-hidden":"true"}),e.username]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("i",{className:"iconoir-calendar text-[14px]","aria-hidden":"true"}),new Date(e.updatedAt).toLocaleDateString()]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:s,title:"Edit",children:(0,a.jsx)("i",{className:"iconoir-edit-pencil text-[16px]","aria-hidden":"true"})}),(0,a.jsx)("button",{className:"btn btn-ghost btn-sm btn-square text-error hover:bg-error/10",onClick:t,title:"Delete",children:(0,a.jsx)("i",{className:"iconoir-trash text-[16px]","aria-hidden":"true"})})]})]})}},5772:(e,s,t)=>{"use strict";t.d(s,{default:()=>n.a});var a=t(7651),n=t.n(a)},7638:(e,s,t)=>{Promise.resolve().then(t.bind(t,3543))},7651:(e,s,t)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a={default:function(){return o},getImageProps:function(){return d}};for(var n in a)Object.defineProperty(s,n,{enumerable:!0,get:a[n]});let l=t(3623),i=t(5413),r=t(8437),c=l._(t(6095));function d(e){let{props:s}=(0,i.getImgProps)(e,{defaultLoader:c.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,t]of Object.entries(s))void 0===t&&delete s[e];return{props:s}}let o=r.Image},7702:(e,s,t)=>{"use strict";t.d(s,{Ii:()=>b,Lv:()=>u,Rp:()=>d,aX:()=>r,sX:()=>x});var a=t(4109),n=t(5625),l=t(8934);async function i(){let e=await fetch("/api/credentials");if(!e.ok)throw Error("Failed to fetch credentials");return e.json()}function r(){return(0,a.I)({queryKey:["credentials"],queryFn:i})}async function c(e){let s=await fetch(`/api/credentials/github/repos?credentialId=${encodeURIComponent(e)}`),t=await s.json().catch(()=>({}));if(!s.ok)throw Error(t.error||"Failed to fetch GitHub repositories");return t}function d(e){return(0,a.I)({queryKey:["credentials","github-repos",e],queryFn:()=>c(e),enabled:!!e})}async function o(e){let s=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await s.json();if(!s.ok)throw Error(t.error||"Failed to create credential");return t}function u(){let e=(0,n.jE)();return(0,l.n)({mutationFn:o,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function m(e){let s=await fetch("/api/credentials",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await s.json();if(!s.ok)throw Error(t.error||"Failed to update credential");return t}function x(){let e=(0,n.jE)();return(0,l.n)({mutationFn:m,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function h(e){let s=await fetch("/api/credentials",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}),t=await s.json();if(!s.ok)throw Error(t.error||"Failed to delete credential")}function b(){let e=(0,n.jE)();return(0,l.n)({mutationFn:h,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}}},e=>{e.O(0,[2176,8437,8500,8441,3794,7358],()=>e(e.s=7638)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[871],{302:(e,s,t)=>{"use strict";t.d(s,{v:()=>c});var a=t(2115);let n=[],l=0,i=!1;function r(e){let s,t=(s=n[n.length-1])||null;if(t){if("Escape"===e.key){e.preventDefault(),t.onEscape();return}"Enter"===e.key&&t.onEnter&&!function(e){if(e.defaultPrevented||e.repeat||e.isComposing||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return!0;let s=e.target;if(!s)return!1;if(s.isContentEditable)return!0;let t=s.tagName;return"TEXTAREA"===t||"BUTTON"===t||"SELECT"===t||"OPTION"===t||"A"===t}(e)&&(e.preventDefault(),t.onEnter())}}function c(e,s,t){let c=(0,a.useRef)(s),d=(0,a.useRef)(t);(0,a.useEffect)(()=>{c.current=s},[s]),(0,a.useEffect)(()=>{d.current=t},[t]),(0,a.useEffect)(()=>{if(!e)return;let s=++l;return n.push({id:s,onEscape:()=>c.current(),onEnter:()=>d.current?.()}),!i&&"u">typeof document&&(document.addEventListener("keydown",r),i=!0),()=>{let e=n.findIndex(e=>e.id===s);e>=0&&n.splice(e,1),i&&"u">typeof document&&!(n.length>0)&&(document.removeEventListener("keydown",r),i=!1)}},[e])}},3543:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>m});var a=t(5155),n=t(2115),l=t(7702),i=t(5772),r=t(8500),c=t.n(r),d=t(302);let o={github:"https://www.google.com/s2/favicons?domain=github.com&sz=64",gitlab:"https://www.google.com/s2/favicons?domain=gitlab.com&sz=64"};function u({type:e,size:s,className:t=""}){return(0,a.jsx)(i.default,{src:o[e],alt:`${"github"===e?"GitHub":"GitLab"} icon`,width:s,height:s,className:t,unoptimized:!0})}function m(){let{data:e,isLoading:s,error:t}=(0,l.aX)(),i=(0,l.Lv)(),r=(0,l.sX)(),o=(0,l.Ii)(),[m,h]=(0,n.useState)(null),[b,p]=(0,n.useState)(null),[g,j]=(0,n.useState)(null),[f,N]=(0,n.useState)(""),[y,v]=(0,n.useState)(""),[w,k]=(0,n.useState)(!1),[E,C]=(0,n.useState)(null),S=(0,n.useRef)(null),L=()=>{h(null),p(null),N(""),v(""),k(!1),C(null)},T=e=>{L(),h(e)},G=async e=>{e.preventDefault(),C(null);try{b?await r.mutateAsync({id:b.id,token:f}):"github"===m?await i.mutateAsync({type:"github",token:f}):"gitlab"===m&&await i.mutateAsync({type:"gitlab",serverUrl:y,token:f}),L()}catch(e){C(e.message)}},F=async()=>{if(g)try{await o.mutateAsync(g.id),j(null)}catch(e){console.error("Failed to delete credential:",e)}},P=i.isPending||r.isPending;return(0,d.v)(null!==m,L,()=>{P||S.current?.requestSubmit()}),(0,d.v)(null!==g,()=>j(null),()=>{g&&!o.isPending&&F()}),(0,a.jsxs)("main",{className:"min-h-screen bg-base-100",children:[(0,a.jsxs)("div",{className:"container mx-auto max-w-4xl py-12 px-6",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-8",children:(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(c(),{href:"/",className:"btn btn-ghost btn-square",children:(0,a.jsx)("i",{className:"iconoir-arrow-left text-[20px]","aria-hidden":"true"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:"Credentials"}),(0,a.jsx)("p",{className:"text-sm opacity-70 mt-1",children:"Manage your remote repository credentials"})]})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-8",children:[(0,a.jsx)("div",{className:"card bg-base-100 shadow-lg hover:shadow-xl transition-shadow cursor-pointer border border-base-200",onClick:()=>T("github"),children:(0,a.jsxs)("div",{className:"card-body p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"p-2 bg-base-200 rounded-lg",children:(0,a.jsx)(u,{type:"github",size:24,className:"h-6 w-6 rounded-sm"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"card-title text-base",children:"GitHub"}),(0,a.jsx)("p",{className:"text-xs opacity-70",children:"Personal Access Token"})]})]}),(0,a.jsxs)("button",{className:"btn btn-sm w-full gap-2",children:[(0,a.jsx)("i",{className:"iconoir-plus text-[16px]","aria-hidden":"true"}),"Add GitHub"]})]})}),(0,a.jsx)("div",{className:"card bg-base-100 shadow-lg hover:shadow-xl transition-shadow cursor-pointer border border-base-200",onClick:()=>T("gitlab"),children:(0,a.jsxs)("div",{className:"card-body p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"p-2 bg-base-200 rounded-lg",children:(0,a.jsx)(u,{type:"gitlab",size:24,className:"h-6 w-6 rounded-sm"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"card-title text-base",children:"GitLab"}),(0,a.jsx)("p",{className:"text-xs opacity-70",children:"Server URL + Personal Access Token"})]})]}),(0,a.jsxs)("button",{className:"btn btn-sm w-full gap-2",children:[(0,a.jsx)("i",{className:"iconoir-plus text-[16px]","aria-hidden":"true"}),"Add GitLab Server"]})]})})]}),(0,a.jsxs)("div",{className:"border border-base-200 rounded-lg overflow-hidden bg-base-100",children:[(0,a.jsx)("div",{className:"px-6 py-3 bg-base-200/50 border-b border-base-200",children:(0,a.jsx)("h2",{className:"text-sm font-bold opacity-70",children:"Saved Credentials"})}),s?(0,a.jsxs)("div",{className:"p-12 text-center opacity-70",children:[(0,a.jsx)("span",{className:"loading loading-spinner"}),(0,a.jsx)("p",{className:"mt-2 text-sm",children:"Loading credentials..."})]}):t?(0,a.jsx)("div",{className:"p-12 text-center text-error",children:(0,a.jsx)("p",{children:"Failed to load credentials"})}):e?.length===0?(0,a.jsxs)("div",{className:"p-12 text-center opacity-50",children:[(0,a.jsx)("i",{className:"iconoir-key text-[40px] mx-auto","aria-hidden":"true"}),(0,a.jsx)("p",{className:"font-bold mt-2",children:"No credentials saved yet."}),(0,a.jsx)("p",{className:"text-xs mt-1",children:"Add your first credential using the cards above."})]}):(0,a.jsx)("div",{className:"divide-y divide-base-200",children:e?.map(e=>(0,a.jsx)(x,{credential:e,onEdit:()=>{p(e),h(e.type),N(""),"gitlab"===e.type&&v(e.serverUrl)},onDelete:()=>j(e)},e.id))})]})]}),null!==m&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box",children:[(0,a.jsx)("h3",{className:"font-bold text-lg flex items-center gap-2",children:"github"===m?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u,{type:"github",size:20,className:"h-5 w-5 rounded-sm"}),"GitHub Credential"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u,{type:"gitlab",size:20,className:"h-5 w-5 rounded-sm"}),"GitLab Credential"]})}),(0,a.jsx)("p",{className:"py-4 text-sm opacity-70",children:b?"Enter a new personal access token to update this credential.":"github"===m?"Enter your GitHub personal access token. This will be stored securely in your system keychain.":"Enter your GitLab server URL and personal access token."}),(0,a.jsxs)("form",{ref:S,onSubmit:G,className:"flex flex-col gap-4",children:["gitlab"===m&&!b&&(0,a.jsxs)("div",{className:"form-control w-full",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Server URL"})}),(0,a.jsx)("input",{type:"url",placeholder:"https://gitlab.example.com",value:y,onChange:e=>v(e.target.value),required:!0,className:"input input-bordered w-full",autoFocus:!0}),(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"Enter the full URL of your GitLab server"})})]}),"gitlab"===m&&b&&(0,a.jsxs)("div",{className:"form-control w-full",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Server URL"})}),(0,a.jsxs)("div",{className:"p-3 bg-base-200 rounded-lg text-sm font-mono flex items-center gap-2 min-w-0 break-all",children:[(0,a.jsx)(u,{type:"gitlab",size:16,className:"h-4 w-4 shrink-0 rounded-sm"}),b.serverUrl]})]}),(0,a.jsxs)("div",{className:"form-control w-full",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Personal Access Token"})}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:w?"text":"password",placeholder:b?"Enter new token":"ghp_xxxxxxxxxxxx or glpat-xxxxx",value:f,onChange:e=>N(e.target.value),className:"input input-bordered w-full pr-10",required:!0,autoFocus:!("gitlab"===m&&!b)}),(0,a.jsx)("button",{type:"button",className:"absolute right-2 top-2 btn btn-ghost btn-xs btn-square",onClick:()=>k(!w),children:w?(0,a.jsx)("i",{className:"iconoir-eye-closed text-[16px]","aria-hidden":"true"}):(0,a.jsx)("i",{className:"iconoir-eye text-[16px]","aria-hidden":"true"})})]}),(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"github"===m?(0,a.jsxs)(a.Fragment,{children:["Token needs repo scope."," ",(0,a.jsx)("a",{href:"https://github.com/settings/tokens/new?description=Trident&scopes=repo,user,notifications,workflow",target:"_blank",rel:"noreferrer",className:"link link-primary",children:"Create new token"})]}):"Token needs api scope for GitLab access"})})]}),E&&(0,a.jsx)("div",{className:"alert alert-error text-sm",children:(0,a.jsx)("span",{children:E})}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{type:"button",className:"btn",onClick:L,disabled:P,children:"Cancel"}),(0,a.jsxs)("button",{type:"submit",className:"btn btn-primary",disabled:P,children:[P&&(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),b?"Update":"Verify & Save"]})]})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:L,children:"close"})})]}),null!==g&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box",children:[(0,a.jsx)("h3",{className:"font-bold text-lg",children:"Delete Credential"}),(0,a.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to delete this ",g?.type==="github"?"GitHub":"GitLab"," ","credential for ",(0,a.jsx)("strong",{className:"break-all",children:g?.username}),"? This action cannot be undone."]}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{className:"btn",onClick:()=>j(null),children:"Cancel"}),(0,a.jsxs)("button",{className:"btn btn-error",onClick:F,disabled:o.isPending,children:[o.isPending&&(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Delete"]})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:()=>j(null),children:"close"})})]})]})}function x({credential:e,onEdit:s,onDelete:t}){let n="gitlab"===e.type;return(0,a.jsxs)("div",{className:"px-6 py-4 flex items-center justify-between hover:bg-base-200/30 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"p-2 bg-base-200 rounded-lg",children:n?(0,a.jsx)(u,{type:"gitlab",size:20,className:"h-5 w-5 rounded-sm"}):(0,a.jsx)(u,{type:"github",size:20,className:"h-5 w-5 rounded-sm"})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-bold text-sm",children:n?"GitLab":"GitHub"}),n&&(0,a.jsx)("span",{className:"text-xs opacity-70 font-mono bg-base-200 px-1.5 py-0.5 rounded",children:e.serverUrl.replace(/^https?:\/\//,"")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs opacity-70 mt-1",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("i",{className:"iconoir-user text-[14px]","aria-hidden":"true"}),e.username]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("i",{className:"iconoir-calendar text-[14px]","aria-hidden":"true"}),new Date(e.updatedAt).toLocaleDateString()]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:s,title:"Edit",children:(0,a.jsx)("i",{className:"iconoir-edit-pencil text-[16px]","aria-hidden":"true"})}),(0,a.jsx)("button",{className:"btn btn-ghost btn-sm btn-square text-error hover:bg-error/10",onClick:t,title:"Delete",children:(0,a.jsx)("i",{className:"iconoir-trash text-[16px]","aria-hidden":"true"})})]})]})}},5772:(e,s,t)=>{"use strict";t.d(s,{default:()=>n.a});var a=t(7651),n=t.n(a)},7638:(e,s,t)=>{Promise.resolve().then(t.bind(t,3543))},7651:(e,s,t)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a={default:function(){return o},getImageProps:function(){return d}};for(var n in a)Object.defineProperty(s,n,{enumerable:!0,get:a[n]});let l=t(3623),i=t(5413),r=t(8437),c=l._(t(6095));function d(e){let{props:s}=(0,i.getImgProps)(e,{defaultLoader:c.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,t]of Object.entries(s))void 0===t&&delete s[e];return{props:s}}let o=r.Image},7702:(e,s,t)=>{"use strict";t.d(s,{Ii:()=>b,Lv:()=>u,Rp:()=>d,aX:()=>r,sX:()=>x});var a=t(4109),n=t(5625),l=t(8934);async function i(){let e=await fetch("/api/credentials");if(!e.ok)throw Error("Failed to fetch credentials");return e.json()}function r(){return(0,a.I)({queryKey:["credentials"],queryFn:i})}async function c(e){let s=await fetch(`/api/credentials/github/repos?credentialId=${encodeURIComponent(e)}`),t=await s.json().catch(()=>({}));if(!s.ok)throw Error(t.error||"Failed to fetch GitHub repositories");return t}function d(e){return(0,a.I)({queryKey:["credentials","github-repos",e],queryFn:()=>c(e),enabled:!!e})}async function o(e){let s=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await s.json();if(!s.ok)throw Error(t.error||"Failed to create credential");return t}function u(){let e=(0,n.jE)();return(0,l.n)({mutationFn:o,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function m(e){let s=await fetch("/api/credentials",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await s.json();if(!s.ok)throw Error(t.error||"Failed to update credential");return t}function x(){let e=(0,n.jE)();return(0,l.n)({mutationFn:m,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function h(e){let s=await fetch("/api/credentials",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}),t=await s.json();if(!s.ok)throw Error(t.error||"Failed to delete credential")}function b(){let e=(0,n.jE)();return(0,l.n)({mutationFn:h,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}}},e=>{e.O(0,[2176,8500,8437,8441,3794,7358],()=>e(e.s=7638)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{3411:(e,t,s)=>{"use strict";s.d(t,{RepoList:()=>j});var a=s(5155),n=s(696),i=s(7702),r=s(2115),l=s(8500),o=s.n(l),c=s(3321),d=s(6848),p=s(6695),u=s(4131),h=s(8599),m=s(302);function x(e){try{if(e.startsWith("git@")){let t=e.match(/^git@([^:]+):/);return t?t[1]:null}return new URL(e).hostname}catch{return null}}function b(e){let t=e.trim().replace(/[?#].*$/,"").replace(/\/+$/,"");if(!t)return null;let s=Math.max(t.lastIndexOf("/"),t.lastIndexOf(":")),a=s>=0?t.slice(s+1):t,n=(a.endsWith(".git")?a.slice(0,-4):a).trim();return n.length>0?n:null}function f(e){return"github"===e.type?`GitHub (${e.username})`:`GitLab (${new URL(e.serverUrl).hostname} - ${e.username})`}function j(){let{data:e,isLoading:t}=(0,n.uG)(),{data:s}=(0,i.aX)(),l=(0,n.F3)(),j=(0,n.fr)(),y=(0,n.X0)(),[g,N]=(0,r.useState)(!1),[v,w]=(0,r.useState)(!1),[k,C]=(0,r.useState)(!1),[R,S]=(0,r.useState)(!1),[P,F]=(0,r.useState)(!1),[U,E]=(0,r.useState)(null),[I,$]=(0,r.useState)(null),[q,L]=(0,r.useState)(!1),[O,A]=(0,r.useState)(void 0),[D,T]=(0,r.useState)(""),[G,K]=(0,r.useState)(""),[z,M]=(0,r.useState)(""),[_,X]=(0,r.useState)(!1),[H,J]=(0,r.useState)("auto"),Q=(0,c.useRouter)(),W=()=>{C(!1),w(!1)};(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();A(t.resolvedDefaultFolder)}}catch(e){console.error("Failed to load settings:",e)}})()},[]);let Y=(0,r.useMemo)(()=>{if(!s?.length||!D.trim())return[];let e=x(D.trim());return e?s.filter(t=>"github"===t.type?"github.com"===e:x(t.serverUrl)===e):[]},[s,D]),B=Y[0]??null,V=(0,r.useMemo)(()=>{if(!s)return[];let e=new Set(Y.map(e=>e.id));return[...Y,...s.filter(t=>!e.has(t.id))]},[s,Y]),Z=(0,r.useMemo)(()=>"auto"===H?null:V.find(e=>e.id===H)??null,[H,V]),ee=Z?.type==="github"?Z.id:null,{data:et,isLoading:es,error:ea}=(0,i.Rp)(ee),en=async e=>{if(e)try{await l.mutateAsync({path:e}),Q.push(`/workspace?path=${encodeURIComponent(e)}`)}catch(t){let e=t instanceof Error?t.message:"Unknown error";e.includes("already exists")?(0,p.oR)({type:"warning",title:"Repository already added",description:"This repository is already in your list. Select it from the list to open it."}):(0,p.oR)({type:"error",title:"Failed to add repository",description:e})}},ei=async()=>{if(U)try{await l.mutateAsync({path:U,initializeIfNeeded:!0}),F(!1),E(null),Q.push(`/workspace?path=${encodeURIComponent(U)}`)}catch(t){let e=t instanceof Error?t.message:"Unknown error";(0,p.oR)({type:"error",title:"Failed to initialize repository",description:e})}},er=()=>{F(!1),E(null),N(!0)},el=e=>{T(e),_||M(b(e)??"")},eo=async()=>{let e=D.trim(),t=G.trim(),a=z.trim();if(!e)return void(0,p.oR)({type:"error",title:"Repository URL is required",description:"Enter a repository URL to clone."});if(!t)return void(0,p.oR)({type:"error",title:"Destination folder is required",description:"Select a local destination folder first."});let n=a||b(e);if(!n)return void(0,p.oR)({type:"error",title:"Folder name is required",description:"Provide a destination folder name for this clone."});try{let a=await j.mutateAsync({repoUrl:e,destinationParent:t,folderName:n,credentialId:"auto"===H?null:H}),i=s?.find(e=>e.id===a.usedCredentialId);(0,p.oR)({type:"success",title:"Repository cloned",description:i?`Cloned with ${f(i)}`:"Clone completed successfully."}),w(!1),C(!1),Q.push(`/workspace?path=${encodeURIComponent(a.path)}`)}catch(t){let e=t instanceof Error?t.message:"Unknown error";(0,p.oR)({type:"error",title:"Failed to clone repository",description:e})}},ec=async e=>{if(I)try{await y.mutateAsync({path:I.path,deleteLocalFolder:e}),S(!1),$(null)}catch(t){let e=t instanceof Error?t.message:"Unknown error";(0,p.oR)({type:"error",title:"Failed to delete repository",description:e})}};return((0,m.v)(R,()=>S(!1),()=>{y.isPending||ec(!1)}),(0,m.v)(v,W,()=>{j.isPending||eo()}),(0,m.v)(P,()=>{F(!1),E(null),N(!0)},()=>{l.isPending||ei()}),t)?(0,a.jsx)("div",{className:"p-12 text-center opacity-70",children:"Loading repositories..."}):(0,a.jsxs)("div",{className:"container mx-auto max-w-5xl py-12 px-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:"Repositories"}),(0,a.jsx)("p",{className:"text-sm opacity-70 mt-1",children:"Manage your git repositories."})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{className:"btn btn-square btn-ghost",onClick:()=>L(!0),title:"Settings",children:(0,a.jsx)("i",{className:"iconoir-ios-settings text-[20px]","aria-hidden":"true"})}),(0,a.jsxs)(o(),{href:"/credentials",className:"btn gap-2",children:[(0,a.jsx)("i",{className:"iconoir-key text-[20px]","aria-hidden":"true"}),"Credentials"]}),(0,a.jsxs)("button",{onClick:()=>{T(""),M(""),X(!1),J("auto"),K(O||""),w(!0)},className:"btn gap-2",children:[(0,a.jsx)("i",{className:"iconoir-git-fork text-[20px]","aria-hidden":"true"}),"Clone"]}),(0,a.jsxs)("button",{onClick:()=>N(!0),className:"btn btn-accent gap-2",children:[(0,a.jsx)("i",{className:"iconoir-plus-circle text-[20px]","aria-hidden":"true"}),"Add Repository"]})]})]}),(0,a.jsx)("div",{className:"overflow-x-auto border border-base-300 rounded-lg bg-base-100",children:(0,a.jsxs)("table",{className:"table w-full",children:[(0,a.jsx)("thead",{className:"bg-base-200/50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Name"}),(0,a.jsx)("th",{children:"Path"}),(0,a.jsx)("th",{className:"text-right",children:"Action"})]})}),(0,a.jsxs)("tbody",{children:[e?.length===0&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:3,className:"text-center py-12 text-muted-foreground",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.jsx)("p",{children:"No repositories found."}),(0,a.jsx)("button",{className:"btn btn-link",onClick:()=>N(!0),children:"Add your first repository"})]})})}),e?.map(e=>{let t=(0,h.iu)(e);return(0,a.jsxs)("tr",{className:"hover:bg-base-200/30 cursor-pointer group",onClick:()=>Q.push(`/workspace?path=${encodeURIComponent(e.path)}`),children:[(0,a.jsx)("td",{children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[e.icon?(0,a.jsx)("span",{className:"text-[20px] leading-none w-5 text-center","aria-hidden":"true",children:e.icon}):(0,a.jsx)("i",{className:"iconoir-bookmark text-[20px] opacity-70 group-hover:text-primary transition-colors","aria-hidden":"true"}),(0,a.jsx)("span",{className:"font-bold text-sm",children:t})]})}),(0,a.jsx)("td",{className:"text-sm opacity-70 font-mono truncate max-w-xs",title:e.path,children:e.path}),(0,a.jsx)("td",{className:"text-right",children:(0,a.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,a.jsx)(o(),{href:`/workspace?path=${encodeURIComponent(e.path)}`,className:"btn btn-ghost btn-sm btn-square",onClick:e=>e.stopPropagation(),children:(0,a.jsx)("i",{className:"iconoir-arrow-right text-[16px]","aria-hidden":"true"})}),(0,a.jsx)("button",{className:"btn btn-ghost btn-sm btn-square text-error hover:bg-error/10",onClick:s=>{var a;return a={path:e.path,displayName:t},void(s.stopPropagation(),$(a),S(!0))},children:(0,a.jsx)("i",{className:"iconoir-trash text-[16px]","aria-hidden":"true"})})]})})]},e.path)})]})]})}),(0,a.jsx)(d.K,{open:g,onOpenChange:N,onSelect:(e,t)=>{if(e){if(t.isRepo)return void en(e);E(e),F(!0)}},initialPath:O}),(0,a.jsx)(u.g,{open:q,onOpenChange:L,onSettingsChange:e=>A(e.resolvedDefaultFolder)}),v&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box max-w-2xl",children:[(0,a.jsx)("h3",{className:"font-bold text-lg",children:"Clone Repository"}),(0,a.jsx)("p",{className:"py-2 text-sm opacity-70",children:"Clone a remote repository into a local folder and add it to your repository list."}),(0,a.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Repository URL"})}),(0,a.jsx)("input",{type:"text",className:"input input-bordered w-full",placeholder:"https://github.com/org/repo.git",value:D,onChange:e=>el(e.target.value)})]}),(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Destination Parent Folder"})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm",value:G,onChange:e=>K(e.target.value),placeholder:O||"/path/to/folder"}),(0,a.jsx)("button",{type:"button",className:"btn btn-outline",onClick:()=>C(!0),children:"Browse"})]})]}),(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Destination Folder Name"})}),(0,a.jsx)("input",{type:"text",className:"input input-bordered w-full",value:z,onChange:e=>{X(!0),M(e.target.value)},placeholder:b(D)||"repository-name"})]}),(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Credential"})}),(0,a.jsxs)("select",{className:"select select-bordered w-full",value:H,onChange:e=>J(e.target.value),children:[(0,a.jsx)("option",{value:"auto",children:B?`Auto detect (${f(B)})`:"Auto detect"}),V.map(e=>(0,a.jsx)("option",{value:e.id,children:f(e)},e.id))]}),D.trim()&&0===Y.length&&(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"No matching credential found for this URL. Clone will run without stored credentials unless you pick one."})}),ee&&(0,a.jsxs)("div",{className:"mt-3 border border-base-300 rounded-lg bg-base-200/30 p-2",children:[(0,a.jsx)("p",{className:"text-xs font-bold opacity-70 px-2 pb-2",children:"Your GitHub repositories (recently updated first)"}),es&&(0,a.jsx)("div",{className:"px-2 py-3 text-sm opacity-70",children:"Loading repositories..."}),!es&&ea&&(0,a.jsx)("div",{className:"px-2 py-3 text-sm text-error",children:ea instanceof Error?ea.message:"Failed to load repositories"}),!es&&!ea&&et?.length===0&&(0,a.jsx)("div",{className:"px-2 py-3 text-sm opacity-70",children:"No accessible repositories found for this account."}),!es&&!ea&&(et?.length??0)>0&&(0,a.jsx)("div",{className:"max-h-56 overflow-y-auto",children:et?.map(e=>(0,a.jsxs)("button",{type:"button",className:`w-full text-left px-2 py-2 rounded-md hover:bg-base-300/60 transition-colors ${D.trim()===e.cloneUrl?"bg-base-300/60":""}`,onClick:()=>el(e.cloneUrl),title:e.cloneUrl,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:e.fullName}),e.private&&(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-wide opacity-70",children:"Private"})]}),(0,a.jsx)("div",{className:"text-xs font-mono opacity-60 truncate",children:e.cloneUrl})]},e.id))})]})]})]}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{className:"btn",onClick:W,disabled:j.isPending,children:"Cancel"}),(0,a.jsx)("button",{className:"btn btn-primary",onClick:eo,disabled:j.isPending,children:j.isPending?(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Cloning..."]}):"Clone"})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:W,children:"close"})})]}),(0,a.jsx)(d.K,{open:k,onOpenChange:C,onSelect:e=>K(e),initialPath:G||O,title:"Select Destination Folder",selectionMode:"folder"}),P&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box max-w-xl",children:[(0,a.jsx)("h3",{className:"font-bold text-lg",children:"Initialize New Repository?"}),(0,a.jsxs)("p",{className:"py-4",children:[(0,a.jsx)("span",{className:"break-all font-mono text-sm",children:U}),(0,a.jsx)("br",{}),"This folder is not a Git repository. Initialize it as a new local Git repository and open it in workspace?"]}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{className:"btn",onClick:er,disabled:l.isPending,children:"No"}),(0,a.jsx)("button",{className:"btn btn-primary",onClick:ei,disabled:l.isPending,children:l.isPending?(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Initializing..."]}):"Yes, Initialize"})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:er,children:"close"})})]}),R&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box",children:[(0,a.jsx)("h3",{className:"font-bold text-lg",children:"Delete Repository"}),(0,a.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to remove ",(0,a.jsx)("strong",{className:"break-all",children:I?.displayName})," from the list? Choose whether to only remove it from your repository list, or also delete its local folder."]}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{className:"btn",onClick:()=>S(!1),disabled:y.isPending,children:"Cancel"}),(0,a.jsx)("button",{className:"btn btn-error btn-outline",onClick:()=>ec(!1),disabled:y.isPending,children:"Delete Repo"}),(0,a.jsx)("button",{className:"btn btn-error",onClick:()=>ec(!0),disabled:y.isPending,children:"Delete Repo & Folder"})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:()=>S(!1),children:"close"})})]})]})}},7702:(e,t,s)=>{"use strict";s.d(t,{Ii:()=>x,Lv:()=>p,Rp:()=>c,aX:()=>l,sX:()=>h});var a=s(4109),n=s(5625),i=s(8934);async function r(){let e=await fetch("/api/credentials");if(!e.ok)throw Error("Failed to fetch credentials");return e.json()}function l(){return(0,a.I)({queryKey:["credentials"],queryFn:r})}async function o(e){let t=await fetch(`/api/credentials/github/repos?credentialId=${encodeURIComponent(e)}`),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Failed to fetch GitHub repositories");return s}function c(e){return(0,a.I)({queryKey:["credentials","github-repos",e],queryFn:()=>o(e),enabled:!!e})}async function d(e){let t=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to create credential");return s}function p(){let e=(0,n.jE)();return(0,i.n)({mutationFn:d,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function u(e){let t=await fetch("/api/credentials",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to update credential");return s}function h(){let e=(0,n.jE)();return(0,i.n)({mutationFn:u,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function m(e){let t=await fetch("/api/credentials",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to delete credential")}function x(){let e=(0,n.jE)();return(0,i.n)({mutationFn:m,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}},8453:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,8437,23)),Promise.resolve().then(s.bind(s,3411))}},e=>{e.O(0,[2176,2785,8437,8500,8645,4131,8441,3794,7358],()=>e(e.s=8453)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{3411:(e,t,s)=>{"use strict";s.d(t,{RepoList:()=>j});var a=s(5155),n=s(696),i=s(7702),r=s(2115),l=s(8500),o=s.n(l),c=s(3321),d=s(6848),p=s(6695),u=s(4131),h=s(8599),m=s(302);function x(e){try{if(e.startsWith("git@")){let t=e.match(/^git@([^:]+):/);return t?t[1]:null}return new URL(e).hostname}catch{return null}}function b(e){let t=e.trim().replace(/[?#].*$/,"").replace(/\/+$/,"");if(!t)return null;let s=Math.max(t.lastIndexOf("/"),t.lastIndexOf(":")),a=s>=0?t.slice(s+1):t,n=(a.endsWith(".git")?a.slice(0,-4):a).trim();return n.length>0?n:null}function f(e){return"github"===e.type?`GitHub (${e.username})`:`GitLab (${new URL(e.serverUrl).hostname} - ${e.username})`}function j(){let{data:e,isLoading:t}=(0,n.uG)(),{data:s}=(0,i.aX)(),l=(0,n.F3)(),j=(0,n.fr)(),y=(0,n.X0)(),[g,N]=(0,r.useState)(!1),[v,w]=(0,r.useState)(!1),[k,C]=(0,r.useState)(!1),[R,S]=(0,r.useState)(!1),[P,F]=(0,r.useState)(!1),[U,E]=(0,r.useState)(null),[I,$]=(0,r.useState)(null),[q,L]=(0,r.useState)(!1),[O,A]=(0,r.useState)(void 0),[D,T]=(0,r.useState)(""),[G,K]=(0,r.useState)(""),[z,M]=(0,r.useState)(""),[_,X]=(0,r.useState)(!1),[H,J]=(0,r.useState)("auto"),Q=(0,c.useRouter)(),W=()=>{C(!1),w(!1)};(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();A(t.resolvedDefaultFolder)}}catch(e){console.error("Failed to load settings:",e)}})()},[]);let Y=(0,r.useMemo)(()=>{if(!s?.length||!D.trim())return[];let e=x(D.trim());return e?s.filter(t=>"github"===t.type?"github.com"===e:x(t.serverUrl)===e):[]},[s,D]),B=Y[0]??null,V=(0,r.useMemo)(()=>{if(!s)return[];let e=new Set(Y.map(e=>e.id));return[...Y,...s.filter(t=>!e.has(t.id))]},[s,Y]),Z=(0,r.useMemo)(()=>"auto"===H?null:V.find(e=>e.id===H)??null,[H,V]),ee=Z?.type==="github"?Z.id:null,{data:et,isLoading:es,error:ea}=(0,i.Rp)(ee),en=async e=>{if(e)try{await l.mutateAsync({path:e}),Q.push(`/workspace?path=${encodeURIComponent(e)}`)}catch(t){let e=t instanceof Error?t.message:"Unknown error";e.includes("already exists")?(0,p.oR)({type:"warning",title:"Repository already added",description:"This repository is already in your list. Select it from the list to open it."}):(0,p.oR)({type:"error",title:"Failed to add repository",description:e})}},ei=async()=>{if(U)try{await l.mutateAsync({path:U,initializeIfNeeded:!0}),F(!1),E(null),Q.push(`/workspace?path=${encodeURIComponent(U)}`)}catch(t){let e=t instanceof Error?t.message:"Unknown error";(0,p.oR)({type:"error",title:"Failed to initialize repository",description:e})}},er=()=>{F(!1),E(null),N(!0)},el=e=>{T(e),_||M(b(e)??"")},eo=async()=>{let e=D.trim(),t=G.trim(),a=z.trim();if(!e)return void(0,p.oR)({type:"error",title:"Repository URL is required",description:"Enter a repository URL to clone."});if(!t)return void(0,p.oR)({type:"error",title:"Destination folder is required",description:"Select a local destination folder first."});let n=a||b(e);if(!n)return void(0,p.oR)({type:"error",title:"Folder name is required",description:"Provide a destination folder name for this clone."});try{let a=await j.mutateAsync({repoUrl:e,destinationParent:t,folderName:n,credentialId:"auto"===H?null:H}),i=s?.find(e=>e.id===a.usedCredentialId);(0,p.oR)({type:"success",title:"Repository cloned",description:i?`Cloned with ${f(i)}`:"Clone completed successfully."}),w(!1),C(!1),Q.push(`/workspace?path=${encodeURIComponent(a.path)}`)}catch(t){let e=t instanceof Error?t.message:"Unknown error";(0,p.oR)({type:"error",title:"Failed to clone repository",description:e})}},ec=async e=>{if(I)try{await y.mutateAsync({path:I.path,deleteLocalFolder:e}),S(!1),$(null)}catch(t){let e=t instanceof Error?t.message:"Unknown error";(0,p.oR)({type:"error",title:"Failed to delete repository",description:e})}};return((0,m.v)(R,()=>S(!1),()=>{y.isPending||ec(!1)}),(0,m.v)(v,W,()=>{j.isPending||eo()}),(0,m.v)(P,()=>{F(!1),E(null),N(!0)},()=>{l.isPending||ei()}),t)?(0,a.jsx)("div",{className:"p-12 text-center opacity-70",children:"Loading repositories..."}):(0,a.jsxs)("div",{className:"container mx-auto max-w-5xl py-12 px-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:"Repositories"}),(0,a.jsx)("p",{className:"text-sm opacity-70 mt-1",children:"Manage your git repositories."})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{className:"btn btn-square btn-ghost",onClick:()=>L(!0),title:"Settings",children:(0,a.jsx)("i",{className:"iconoir-ios-settings text-[20px]","aria-hidden":"true"})}),(0,a.jsxs)(o(),{href:"/credentials",className:"btn gap-2",children:[(0,a.jsx)("i",{className:"iconoir-key text-[20px]","aria-hidden":"true"}),"Credentials"]}),(0,a.jsxs)("button",{onClick:()=>{T(""),M(""),X(!1),J("auto"),K(O||""),w(!0)},className:"btn gap-2",children:[(0,a.jsx)("i",{className:"iconoir-git-fork text-[20px]","aria-hidden":"true"}),"Clone"]}),(0,a.jsxs)("button",{onClick:()=>N(!0),className:"btn btn-accent gap-2",children:[(0,a.jsx)("i",{className:"iconoir-plus-circle text-[20px]","aria-hidden":"true"}),"Add Repository"]})]})]}),(0,a.jsx)("div",{className:"overflow-x-auto border border-base-300 rounded-lg bg-base-100",children:(0,a.jsxs)("table",{className:"table w-full",children:[(0,a.jsx)("thead",{className:"bg-base-200/50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Name"}),(0,a.jsx)("th",{children:"Path"}),(0,a.jsx)("th",{className:"text-right",children:"Action"})]})}),(0,a.jsxs)("tbody",{children:[e?.length===0&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:3,className:"text-center py-12 text-muted-foreground",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.jsx)("p",{children:"No repositories found."}),(0,a.jsx)("button",{className:"btn btn-link",onClick:()=>N(!0),children:"Add your first repository"})]})})}),e?.map(e=>{let t=(0,h.iu)(e);return(0,a.jsxs)("tr",{className:"hover:bg-base-200/30 cursor-pointer group",onClick:()=>Q.push(`/workspace?path=${encodeURIComponent(e.path)}`),children:[(0,a.jsx)("td",{children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[e.icon?(0,a.jsx)("span",{className:"text-[20px] leading-none w-5 text-center","aria-hidden":"true",children:e.icon}):(0,a.jsx)("i",{className:"iconoir-bookmark text-[20px] opacity-70 group-hover:text-primary transition-colors","aria-hidden":"true"}),(0,a.jsx)("span",{className:"font-bold text-sm",children:t})]})}),(0,a.jsx)("td",{className:"text-sm opacity-70 font-mono truncate max-w-xs",title:e.path,children:e.path}),(0,a.jsx)("td",{className:"text-right",children:(0,a.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,a.jsx)(o(),{href:`/workspace?path=${encodeURIComponent(e.path)}`,className:"btn btn-ghost btn-sm btn-square",onClick:e=>e.stopPropagation(),children:(0,a.jsx)("i",{className:"iconoir-arrow-right text-[16px]","aria-hidden":"true"})}),(0,a.jsx)("button",{className:"btn btn-ghost btn-sm btn-square text-error hover:bg-error/10",onClick:s=>{var a;return a={path:e.path,displayName:t},void(s.stopPropagation(),$(a),S(!0))},children:(0,a.jsx)("i",{className:"iconoir-trash text-[16px]","aria-hidden":"true"})})]})})]},e.path)})]})]})}),(0,a.jsx)(d.K,{open:g,onOpenChange:N,onSelect:(e,t)=>{if(e){if(t.isRepo)return void en(e);E(e),F(!0)}},initialPath:O}),(0,a.jsx)(u.g,{open:q,onOpenChange:L,onSettingsChange:e=>A(e.resolvedDefaultFolder)}),v&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box max-w-2xl",children:[(0,a.jsx)("h3",{className:"font-bold text-lg",children:"Clone Repository"}),(0,a.jsx)("p",{className:"py-2 text-sm opacity-70",children:"Clone a remote repository into a local folder and add it to your repository list."}),(0,a.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Repository URL"})}),(0,a.jsx)("input",{type:"text",className:"input input-bordered w-full",placeholder:"https://github.com/org/repo.git",value:D,onChange:e=>el(e.target.value)})]}),(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Destination Parent Folder"})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm",value:G,onChange:e=>K(e.target.value),placeholder:O||"/path/to/folder"}),(0,a.jsx)("button",{type:"button",className:"btn btn-outline",onClick:()=>C(!0),children:"Browse"})]})]}),(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Destination Folder Name"})}),(0,a.jsx)("input",{type:"text",className:"input input-bordered w-full",value:z,onChange:e=>{X(!0),M(e.target.value)},placeholder:b(D)||"repository-name"})]}),(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Credential"})}),(0,a.jsxs)("select",{className:"select select-bordered w-full",value:H,onChange:e=>J(e.target.value),children:[(0,a.jsx)("option",{value:"auto",children:B?`Auto detect (${f(B)})`:"Auto detect"}),V.map(e=>(0,a.jsx)("option",{value:e.id,children:f(e)},e.id))]}),D.trim()&&0===Y.length&&(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"No matching credential found for this URL. Clone will run without stored credentials unless you pick one."})}),ee&&(0,a.jsxs)("div",{className:"mt-3 border border-base-300 rounded-lg bg-base-200/30 p-2",children:[(0,a.jsx)("p",{className:"text-xs font-bold opacity-70 px-2 pb-2",children:"Your GitHub repositories (recently updated first)"}),es&&(0,a.jsx)("div",{className:"px-2 py-3 text-sm opacity-70",children:"Loading repositories..."}),!es&&ea&&(0,a.jsx)("div",{className:"px-2 py-3 text-sm text-error",children:ea instanceof Error?ea.message:"Failed to load repositories"}),!es&&!ea&&et?.length===0&&(0,a.jsx)("div",{className:"px-2 py-3 text-sm opacity-70",children:"No accessible repositories found for this account."}),!es&&!ea&&(et?.length??0)>0&&(0,a.jsx)("div",{className:"max-h-56 overflow-y-auto",children:et?.map(e=>(0,a.jsxs)("button",{type:"button",className:`w-full text-left px-2 py-2 rounded-md hover:bg-base-300/60 transition-colors ${D.trim()===e.cloneUrl?"bg-base-300/60":""}`,onClick:()=>el(e.cloneUrl),title:e.cloneUrl,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:e.fullName}),e.private&&(0,a.jsx)("span",{className:"text-[10px] uppercase tracking-wide opacity-70",children:"Private"})]}),(0,a.jsx)("div",{className:"text-xs font-mono opacity-60 truncate",children:e.cloneUrl})]},e.id))})]})]})]}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{className:"btn",onClick:W,disabled:j.isPending,children:"Cancel"}),(0,a.jsx)("button",{className:"btn btn-primary",onClick:eo,disabled:j.isPending,children:j.isPending?(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Cloning..."]}):"Clone"})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:W,children:"close"})})]}),(0,a.jsx)(d.K,{open:k,onOpenChange:C,onSelect:e=>K(e),initialPath:G||O,title:"Select Destination Folder",selectionMode:"folder"}),P&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box max-w-xl",children:[(0,a.jsx)("h3",{className:"font-bold text-lg",children:"Initialize New Repository?"}),(0,a.jsxs)("p",{className:"py-4",children:[(0,a.jsx)("span",{className:"break-all font-mono text-sm",children:U}),(0,a.jsx)("br",{}),"This folder is not a Git repository. Initialize it as a new local Git repository and open it in workspace?"]}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{className:"btn",onClick:er,disabled:l.isPending,children:"No"}),(0,a.jsx)("button",{className:"btn btn-primary",onClick:ei,disabled:l.isPending,children:l.isPending?(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Initializing..."]}):"Yes, Initialize"})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:er,children:"close"})})]}),R&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box",children:[(0,a.jsx)("h3",{className:"font-bold text-lg",children:"Delete Repository"}),(0,a.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to remove ",(0,a.jsx)("strong",{className:"break-all",children:I?.displayName})," from the list? Choose whether to only remove it from your repository list, or also delete its local folder."]}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{className:"btn",onClick:()=>S(!1),disabled:y.isPending,children:"Cancel"}),(0,a.jsx)("button",{className:"btn btn-error btn-outline",onClick:()=>ec(!1),disabled:y.isPending,children:"Delete Repo"}),(0,a.jsx)("button",{className:"btn btn-error",onClick:()=>ec(!0),disabled:y.isPending,children:"Delete Repo & Folder"})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:()=>S(!1),children:"close"})})]})]})}},7702:(e,t,s)=>{"use strict";s.d(t,{Ii:()=>x,Lv:()=>p,Rp:()=>c,aX:()=>l,sX:()=>h});var a=s(4109),n=s(5625),i=s(8934);async function r(){let e=await fetch("/api/credentials");if(!e.ok)throw Error("Failed to fetch credentials");return e.json()}function l(){return(0,a.I)({queryKey:["credentials"],queryFn:r})}async function o(e){let t=await fetch(`/api/credentials/github/repos?credentialId=${encodeURIComponent(e)}`),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Failed to fetch GitHub repositories");return s}function c(e){return(0,a.I)({queryKey:["credentials","github-repos",e],queryFn:()=>o(e),enabled:!!e})}async function d(e){let t=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to create credential");return s}function p(){let e=(0,n.jE)();return(0,i.n)({mutationFn:d,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function u(e){let t=await fetch("/api/credentials",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to update credential");return s}function h(){let e=(0,n.jE)();return(0,i.n)({mutationFn:u,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function m(e){let t=await fetch("/api/credentials",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}),s=await t.json();if(!t.ok)throw Error(s.error||"Failed to delete credential")}function x(){let e=(0,n.jE)();return(0,i.n)({mutationFn:m,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}},8453:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,8437,23)),Promise.resolve().then(s.bind(s,3411))}},e=>{e.O(0,[2176,2785,8500,8437,8645,4131,8441,3794,7358],()=>e(e.s=8453)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3411],{2972:(e,s,a)=>{Promise.resolve().then(a.bind(a,6147))},6147:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>u});var n=a(5155),r=a(3321),i=a(2944),t=a(2115),l=a(6534);function c(){let e=(0,r.useSearchParams)().get("path");return((0,l.J)(e,"History"),e)?(0,n.jsx)(i.u,{repoPath:e}):(0,n.jsx)("div",{className:"p-8",children:"No repository path specified."})}function u(){return(0,n.jsx)(t.Suspense,{fallback:(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("span",{className:"loading loading-spinner"})}),children:(0,n.jsx)(c,{})})}}},e=>{e.O(0,[5508,2176,2785,4841,8645,8790,2944,8441,3794,7358],()=>e(e.s=2972)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3411],{2972:(e,s,a)=>{Promise.resolve().then(a.bind(a,6147))},6147:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>u});var n=a(5155),r=a(3321),i=a(2944),t=a(2115),l=a(6534);function c(){let e=(0,r.useSearchParams)().get("path");return((0,l.J)(e,"History"),e)?(0,n.jsx)(i.u,{repoPath:e}):(0,n.jsx)("div",{className:"p-8",children:"No repository path specified."})}function u(){return(0,n.jsx)(t.Suspense,{fallback:(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("span",{className:"loading loading-spinner"})}),children:(0,n.jsx)(c,{})})}}},e=>{e.O(0,[5508,2176,2785,8500,4841,8645,8790,2944,8441,3794,7358],()=>e(e.s=2972)),_N_E=e.O()}]);
@@ -0,0 +1,3 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1807],{236:(e,t,s)=>{Promise.resolve().then(s.bind(s,6204)),Promise.resolve().then(s.bind(s,1464)),Promise.resolve().then(s.bind(s,7185)),Promise.resolve().then(s.bind(s,9128)),Promise.resolve().then(s.bind(s,3278))},1464:(e,t,s)=>{"use strict";s.d(t,{ScriptModal:()=>c});var n=s(5155),a=s(2115),i=s(3278),r=s(8599);async function l(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(t)}}}function c(){let{activeModalExecution:e,minimizeModal:t,cancelScript:s,dismissExecution:c}=(0,i.C)(),[o,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),p=(0,a.useRef)(null);(0,a.useEffect)(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[e?.output]),(0,a.useEffect)(()=>{if(!e)return;let s=e=>{"Escape"===e.key&&(e.preventDefault(),t())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]);let h=(0,a.useCallback)(async()=>{if(!e||u)return;m(!0);let t=await l(e.output);m(!1),d(t),t&&setTimeout(()=>d(!1),1500)},[e,u]);if(!e)return null;let x="starting"===e.status||"running"===e.status,b="completed"===e.status||"failed"===e.status||"canceled"===e.status;return(0,n.jsxs)("dialog",{className:"modal modal-open z-50",children:[(0,n.jsxs)("div",{className:"modal-box max-w-4xl max-h-[85vh] flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("h3",{className:"font-bold text-lg truncate",children:["Custom Script: ",e.scriptName]}),(0,n.jsxs)("p",{className:"text-xs opacity-70 mt-1 break-all",children:["Ref: ",e.branchRef]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,n.jsxs)("span",{className:(0,r.cn)("badge badge-sm shrink-0",x?"badge-info":"completed"===e.status?"badge-success":"failed"===e.status?"badge-error":"canceled"===e.status?"badge-warning":"badge-ghost"),children:[x&&(0,n.jsx)("span",{className:"loading loading-spinner loading-xs mr-1"}),e.status]}),(0,n.jsx)("button",{className:"btn btn-ghost btn-xs btn-circle",onClick:t,title:"Minimize to bottom-right corner","aria-label":"Minimize",children:(0,n.jsx)("i",{className:"iconoir-minus text-[16px]","aria-hidden":"true"})})]})]}),(0,n.jsx)("div",{className:"mt-4 border border-base-300 rounded bg-base-200/40 flex-1 overflow-hidden flex flex-col",children:(0,n.jsx)("pre",{ref:p,className:"p-3 font-mono text-xs overflow-auto max-h-[50vh] whitespace-pre-wrap break-words flex-1",children:e.output||"Waiting for output..."})}),e.error&&(0,n.jsx)("div",{className:"alert alert-error py-2 mt-3 text-xs",children:(0,n.jsx)("span",{children:e.error})}),(0,n.jsxs)("div",{className:"modal-action mt-4 flex items-center justify-between",children:[(0,n.jsxs)("button",{type:"button",className:"btn btn-ghost btn-sm gap-1.5",onClick:t,title:"Minimize dialog and keep running in bottom right",children:[(0,n.jsx)("i",{className:"iconoir-minus text-[14px]","aria-hidden":"true"}),"Dock / Minimize"]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[x&&(0,n.jsx)(n.Fragment,{children:e.isCanceling?(0,n.jsxs)("button",{type:"button",className:"btn btn-error btn-sm",onClick:()=>void s(e.id,!0),title:"Force terminate immediately",children:[(0,n.jsx)("span",{className:"loading loading-spinner loading-xs mr-1"}),"Force Kill"]}):(0,n.jsx)("button",{type:"button",className:"btn btn-warning btn-sm",onClick:()=>void s(e.id,!1),children:"Cancel"})}),(0,n.jsxs)("button",{type:"button",className:"btn btn-outline btn-sm",onClick:()=>void h(),disabled:u,children:[u&&(0,n.jsx)("span",{className:"loading loading-spinner loading-xs mr-1"}),o?"Copied":"Copy"]}),b?(0,n.jsx)("button",{type:"button",className:"btn btn-primary btn-sm",onClick:()=>{c(e.id)},children:"Done"}):(0,n.jsx)("button",{type:"button",className:"btn btn-neutral btn-sm",onClick:t,children:"Hide"})]})]})]}),(0,n.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,n.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),t()},children:"close"})})]})}},3278:(e,t,s)=>{"use strict";s.d(t,{C:()=>c,CustomScriptExecutionProvider:()=>l});var n=s(5155),a=s(2115),i=s(5625);let r=(0,a.createContext)(null);function l({children:e}){let t=(0,i.jE)(),[s,l]=(0,a.useState)([]),c=(0,a.useRef)(s);c.current=s;let o=(0,a.useCallback)(async({repoPath:e,branchRef:t,script:s})=>{let n=`temp-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,a={id:n,repoPath:e,branchRef:t,scriptName:s.name,scriptContent:s.content,status:"starting",output:"",error:null,startedAt:new Date().toISOString(),finishedAt:null,isCanceling:!1,isForceCanceling:!1,isModalOpen:!0};l(e=>[...e.map(e=>e.isModalOpen?{...e,isModalOpen:!1}:e),a]);try{let a=await fetch("/api/custom-scripts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:"start",repoPath:e,branchRef:t,scriptContent:s.content})}),i=await a.json();if(!a.ok)throw Error(i.error||"Failed to start script execution");let r=[];return i.previousBranch&&i.checkedOutBranch&&i.previousBranch!==i.checkedOutBranch&&r.push(`[info] Checked out ${i.checkedOutBranch} (from ${i.previousBranch})`),l(e=>e.map(e=>e.id===n?{...e,id:i.executionId,output:[r.join("\n"),i.output].filter(Boolean).join("\n"),status:i.status,error:null}:e)),i.executionId}catch(t){let e=t.message||"Failed to start script";return l(t=>t.map(t=>t.id===n?{...t,status:"failed",error:e,output:t.output?`${t.output}
2
+ [error] ${e}`:`[error] ${e}`,finishedAt:new Date().toISOString()}:t)),n}},[]),d=(0,a.useCallback)(async(e,t)=>{if(c.current.find(t=>t.id===e)){l(s=>s.map(s=>s.id===e?{...s,isCanceling:!0,isForceCanceling:!!t||s.isForceCanceling}:s));try{let s=await fetch("/api/custom-scripts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:"cancel",executionId:e,force:!!t})}),n=await s.json();if(!s.ok)throw Error(n.error||"Failed to cancel script");l(t=>t.map(t=>{if(t.id===e){let e=n.status;return{...t,output:n.output,status:e,isCanceling:"running"===e||"starting"===e,isForceCanceling:!1,finishedAt:n.finishedAt||t.finishedAt}}return t}))}catch(t){l(s=>s.map(s=>s.id===e?{...s,isCanceling:!1,isForceCanceling:!1,output:`${s.output}
3
+ [error] ${t.message}`}:s))}}},[]),u=(0,a.useCallback)(e=>{l(t=>t.map(t=>({...t,isModalOpen:t.id===e})))},[]),m=(0,a.useCallback)(()=>{l(e=>e.map(e=>e.isModalOpen?{...e,isModalOpen:!1}:e))},[]),p=(0,a.useCallback)(e=>{l(t=>t.filter(t=>t.id!==e))},[]);(0,a.useEffect)(()=>{if(0===s.filter(e=>"running"===e.status||"starting"===e.status).length)return;let e=!1,n=null,a=async()=>{let s=c.current.filter(e=>"running"===e.status&&!e.id.startsWith("temp-"));0!==s.length&&(await Promise.all(s.map(async s=>{try{let n=await fetch("/api/custom-scripts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:"status",executionId:s.id})}),a=await n.json();if(!n.ok||e)return;let i=a.status;l(e=>e.map(e=>e.id===s.id?{...e,output:a.output,status:i,finishedAt:a.finishedAt||e.finishedAt,isCanceling:"running"===i&&e.isCanceling}:e)),("completed"===i||"failed"===i||"canceled"===i)&&t.invalidateQueries({queryKey:["git",s.repoPath]})}catch{}})),e||(n=setTimeout(a,500)))};return n=setTimeout(a,500),()=>{e=!0,n&&clearTimeout(n)}},[s,t]);let h=(0,a.useMemo)(()=>s.find(e=>e.isModalOpen)||null,[s]);return(0,n.jsx)(r.Provider,{value:{executions:s,activeModalExecution:h,startScript:o,cancelScript:d,openModal:u,minimizeModal:m,dismissExecution:p},children:e})}function c(){let e=(0,a.useContext)(r);if(!e)throw Error("useCustomScriptExecution must be used within a CustomScriptExecutionProvider");return e}},6204:(e,t,s)=>{"use strict";s.d(t,{ScriptDock:()=>r});var n=s(5155);s(2115);var a=s(3278),i=s(8599);function r(){let{executions:e,openModal:t,cancelScript:s,dismissExecution:r}=(0,a.C)(),l=e.filter(e=>!e.isModalOpen);return 0===l.length?null:(0,n.jsx)("div",{className:"fixed bottom-4 right-4 z-40 flex flex-col gap-2 max-w-sm pointer-events-none",children:l.map(e=>{let a="starting"===e.status||"running"===e.status;return(0,n.jsxs)("div",{className:(0,i.cn)("pointer-events-auto bg-base-100 shadow-xl border rounded-lg p-3 w-84 text-xs transition-all flex flex-col gap-2",a?"border-primary/40 shadow-primary/5":"border-base-300"),children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"font-semibold truncate text-sm",title:e.scriptName,children:e.scriptName}),(0,n.jsx)("div",{className:"text-[11px] opacity-60 truncate mt-0.5",title:e.branchRef,children:e.branchRef})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,n.jsxs)("span",{className:(0,i.cn)("badge badge-xs font-medium",a?"badge-info animate-pulse":"completed"===e.status?"badge-success":"failed"===e.status?"badge-error":"canceled"===e.status?"badge-warning":"badge-ghost"),children:[a&&(0,n.jsx)("span",{className:"loading loading-spinner loading-xs mr-1 scale-75"}),e.status]}),!a&&(0,n.jsx)("button",{className:"btn btn-ghost btn-xs btn-circle text-base-content/60 hover:text-base-content",onClick:()=>r(e.id),title:"Dismiss","aria-label":"Dismiss",children:(0,n.jsx)("i",{className:"iconoir-xmark text-[14px]","aria-hidden":"true"})})]})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1 border-t border-base-200",children:[(0,n.jsxs)("button",{type:"button",className:"btn btn-ghost btn-xs gap-1 font-normal text-xs",onClick:()=>t(e.id),title:"View terminal logs",children:[(0,n.jsx)("i",{className:"iconoir-open-new-window text-[13px]","aria-hidden":"true"}),"View Logs"]}),(0,n.jsx)("div",{className:"flex items-center gap-1",children:a&&(0,n.jsx)(n.Fragment,{children:e.isCanceling?(0,n.jsxs)("button",{type:"button",className:"btn btn-error btn-xs",onClick:()=>void s(e.id,!0),title:"Force kill process immediately",children:[(0,n.jsx)("span",{className:"loading loading-spinner loading-xs mr-1 scale-75"}),"Force Kill"]}):(0,n.jsxs)("button",{type:"button",className:"btn btn-warning btn-xs gap-1",onClick:()=>void s(e.id,!1),title:"Stop process",children:[(0,n.jsx)("i",{className:"iconoir-square text-[11px]","aria-hidden":"true"}),"Stop"]})})})]})]},e.id)})})}},7185:(e,t,s)=>{"use strict";s.d(t,{Sidebar:()=>u});var n=s(5155),a=s(8599),i=s(8500),r=s.n(i),l=s(4131),c=s(3321),o=s(2115),d=s(696);function u({className:e,initialCollapsed:t=!1}){let s=(0,c.usePathname)(),i=(0,c.useSearchParams)(),u=(0,c.useRouter)(),m=i.get("path")||"",p=(0,d.GK)(m||null),[h,x]=(0,o.useState)(t),[b,f]=(0,o.useState)(!1),[g,j]=(0,o.useState)(!1),N=(0,d.Y5)(),{data:y}=(0,d.en)(m||null),v=y?.conflicted?.length??0,w=y?.current?.trim(),C=p?(0,a.iu)(p):m?(0,a.kj)(m):"";(0,o.useEffect)(()=>{let e=null,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>{f(!0)})});return()=>{cancelAnimationFrame(t),null!==e&&cancelAnimationFrame(e)}},[]),(0,o.useEffect)(()=>{localStorage.setItem("workspace-sidebar-collapsed",String(h))},[h]);let k=(0,o.useCallback)(()=>{let e=!h;x(e),N.mutate({sidebarCollapsed:e})},[h,N]),S=(e="")=>{let t=new URLSearchParams(i.toString());return t.delete("tab"),m&&w?t.set("branch",w):m||t.delete("branch"),`/workspace${e}?${t.toString()}`},O=e=>"history"===e?"/workspace"===s||s.startsWith("/workspace/history"):"conflicts"===e?s.startsWith("/workspace/conflicts"):"custom-scripts"===e?s.startsWith("/workspace/custom-scripts"):"settings"===e?s.startsWith("/workspace/settings"):"stashes"===e&&s.startsWith("/workspace/stashes"),E=h?64:256;return(0,n.jsxs)("div",{style:{width:E},className:(0,a.cn)("pb-12 border-r border-base-300 min-h-screen bg-base-100 relative",b&&"transition-all duration-300",e),children:[(0,n.jsx)("div",{className:"space-y-4 py-4",children:(0,n.jsxs)("div",{className:(0,a.cn)("px-3 py-2",h&&"px-2"),children:[(0,n.jsxs)("div",{className:(0,a.cn)("mb-6 flex items-center",h?"flex-col gap-2 px-0":"justify-between px-4"),children:[!h&&(0,n.jsxs)("a",{href:"/",onClick:e=>{e.metaKey||e.ctrlKey||(e.preventDefault(),u.push("/"))},className:"flex items-center gap-2 hover:opacity-80 transition-opacity cursor-pointer text-base-content overflow-hidden",title:C?`${C} - Go to Home`:"Go to Home",children:[p?.icon?(0,n.jsx)("span",{className:"h-5 w-5 flex-shrink-0 flex items-center justify-center text-base leading-none","aria-hidden":"true",children:p.icon}):(0,n.jsx)("img",{src:"/icon.png",alt:"Trident",className:"h-5 w-5 flex-shrink-0"}),(0,n.jsx)("h2",{className:"text-lg font-bold tracking-tight truncate",children:C||"Trident"})]}),h&&(0,n.jsx)("a",{href:"/",onClick:e=>{e.metaKey||e.ctrlKey||(e.preventDefault(),u.push("/"))},className:"flex items-center justify-center h-8 w-8 hover:opacity-80 transition-opacity cursor-pointer",title:C?`${C} - Go to Home`:"Go to Home",children:p?.icon?(0,n.jsx)("span",{className:"h-5 w-5 flex items-center justify-center text-base leading-none","aria-hidden":"true",children:p.icon}):(0,n.jsx)("img",{src:"/icon.png",alt:C||"Trident",className:"h-5 w-5"})}),(0,n.jsx)("div",{className:(0,a.cn)("flex items-center gap-1",h&&"flex-col"),children:(0,n.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:k,title:h?"Expand sidebar":"Collapse sidebar",children:h?(0,n.jsx)("i",{className:"iconoir-fast-arrow-right text-[16px]","aria-hidden":"true"}):(0,n.jsx)("i",{className:"iconoir-fast-arrow-left text-[16px]","aria-hidden":"true"})})})]}),!h&&m&&(0,n.jsx)("div",{className:"px-4 mb-6",children:(0,n.jsx)("p",{className:"text-[10px] font-mono opacity-60 break-all border border-base-300 rounded p-2 bg-base-200/30",title:m,children:m})}),(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)(r(),{href:S(),className:(0,a.cn)("btn btn-ghost w-full justify-start font-normal",h?"px-0 justify-center":"",O("history")&&"btn-active font-medium"),title:h?"History":void 0,children:[(0,n.jsx)("i",{className:(0,a.cn)("iconoir-git-fork text-[20px]",!h&&"mr-2"),"aria-hidden":"true"}),!h&&"History"]}),(0,n.jsxs)(r(),{href:S("/conflicts"),className:(0,a.cn)("btn btn-ghost w-full justify-start font-normal",h?"px-0 justify-center":"",O("conflicts")&&"btn-active font-medium"),title:h?`Conflicts${v>0?` (${v})`:""}`:void 0,children:[(0,n.jsxs)("div",{className:(0,a.cn)("relative flex items-center",!h&&"mr-2"),children:[(0,n.jsx)("i",{className:"iconoir-warning-triangle text-[20px]","aria-hidden":"true"}),h&&v>0&&(0,n.jsx)("span",{className:"absolute -top-1 -right-1 badge badge-error badge-xs scale-75",children:v>99?"99+":v})]}),!h&&(0,n.jsxs)("span",{className:"flex-1 flex justify-between items-center",children:["Conflicts",v>0&&(0,n.jsx)("span",{className:"badge badge-sm badge-error",children:v})]})]}),(0,n.jsxs)(r(),{href:S("/stashes"),className:(0,a.cn)("btn btn-ghost w-full justify-start font-normal",h?"px-0 justify-center":"",O("stashes")&&"btn-active font-medium"),title:h?"Stashes":void 0,children:[(0,n.jsx)("i",{className:(0,a.cn)("iconoir-download-square text-[20px]",!h&&"mr-2"),"aria-hidden":"true"}),!h&&"Stashes"]}),(0,n.jsxs)(r(),{href:S("/custom-scripts"),className:(0,a.cn)("btn btn-ghost w-full justify-start font-normal",h?"px-0 justify-center":"",O("custom-scripts")&&"btn-active font-medium"),title:h?"Custom scripts":void 0,children:[(0,n.jsx)("i",{className:(0,a.cn)("iconoir-terminal text-[20px]",!h&&"mr-2"),"aria-hidden":"true"}),!h&&"Custom scripts"]}),(0,n.jsxs)(r(),{href:S("/settings"),className:(0,a.cn)("btn btn-ghost w-full justify-start font-normal",h?"px-0 justify-center":"",O("settings")&&"btn-active font-medium"),title:h?"Settings":void 0,children:[(0,n.jsx)("i",{className:(0,a.cn)("iconoir-settings text-[20px]",!h&&"mr-2"),"aria-hidden":"true"}),!h&&"Settings"]})]})]})}),(0,n.jsx)("div",{className:(0,a.cn)("absolute bottom-4 left-0 w-full",h?"px-2":"px-6"),children:(0,n.jsxs)("div",{className:(0,a.cn)("flex items-center",h?"justify-center":"gap-2"),children:[(0,n.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>j(!0),title:h?"Preferences":void 0,children:(0,n.jsx)("i",{className:"iconoir-ios-settings text-[20px]","aria-hidden":"true"})}),!h&&(0,n.jsx)("span",{className:"text-xs opacity-70",children:"Preferences"})]})}),(0,n.jsx)(l.g,{open:g,onOpenChange:j})]})}},9128:(e,t,s)=>{"use strict";s.d(t,{WorkspaceRepoOpenTracker:()=>r});var n=s(2115),a=s(3321),i=s(696);function r(){let e=(0,a.usePathname)(),t=(0,a.useSearchParams)().get("path"),{data:s}=(0,i.uG)(),r=(0,i.Lp)(),l=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!e.startsWith("/workspace")){l.current=null;return}t&&s?.some(e=>e.path===t)&&l.current!==t&&(l.current=t,r.mutate({path:t,updates:{lastOpenedAt:new Date().toISOString()}}))},[e,t,s,r]),null}}},e=>{e.O(0,[2176,2785,8500,8645,4131,8441,3794,7358],()=>e(e.s=236)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6364],{4375:(e,s,a)=>{Promise.resolve().then(a.bind(a,9176))},9176:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>u});var n=a(5155),r=a(3321),i=a(2944),t=a(2115),l=a(6534);function c(){let e=(0,r.useSearchParams)().get("path");return((0,l.J)(e,"History"),e)?(0,n.jsx)(i.u,{repoPath:e}):(0,n.jsx)("div",{className:"p-8",children:"No repository path specified."})}function u(){return(0,n.jsx)(t.Suspense,{fallback:(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("span",{className:"loading loading-spinner"})}),children:(0,n.jsx)(c,{})})}}},e=>{e.O(0,[5508,2176,2785,4841,8645,8790,2944,8441,3794,7358],()=>e(e.s=4375)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6364],{4375:(e,s,a)=>{Promise.resolve().then(a.bind(a,9176))},9176:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>u});var n=a(5155),r=a(3321),i=a(2944),t=a(2115),l=a(6534);function c(){let e=(0,r.useSearchParams)().get("path");return((0,l.J)(e,"History"),e)?(0,n.jsx)(i.u,{repoPath:e}):(0,n.jsx)("div",{className:"p-8",children:"No repository path specified."})}function u(){return(0,n.jsx)(t.Suspense,{fallback:(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("span",{className:"loading loading-spinner"})}),children:(0,n.jsx)(c,{})})}}},e=>{e.O(0,[5508,2176,2785,8500,4841,8645,8790,2944,8441,3794,7358],()=>e(e.s=4375)),_N_E=e.O()}]);
@@ -18,4 +18,4 @@
18
18
  absolute left-0 mt-3 z-50
19
19
  rounded-2xl shadow-2xl border border-base-300 bg-base-100
20
20
  overflow-hidden animate-in fade-in-0 zoom-in-95 duration-150
21
- `,style:{width:"min(380px, 92vw)"},children:[(0,a.jsxs)("div",{className:"px-4 py-3 border-b border-base-200 flex items-center justify-between bg-base-200/40",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-lg",children:"✨"}),(0,a.jsx)("span",{className:"font-semibold text-sm",children:"Select Repository Icon"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>l(!1),className:"btn btn-ghost btn-xs btn-square text-base-content/60 hover:text-base-content","aria-label":"Close",children:"✕"})]}),(0,a.jsx)("div",{className:"p-1 [&_.epr-main]:!border-none [&_.epr-main]:!bg-transparent",children:(0,a.jsx)(p,{onEmojiClick:e=>{t(e.emoji),l(!1)},theme:m,emojiStyle:h.EmojiStyle.NATIVE,lazyLoadEmojis:!0,searchPlaceHolder:"Search emoji by name or keyword...",width:"100%",height:380,previewConfig:{showPreview:!1},skinTonesDisabled:!1})})]})]})}function j(e){try{if(e.startsWith("git@")){let t=e.match(/git@([^:]+):/);return t?t[1]:null}return new URL(e).hostname}catch{return null}}function f(){let e=(0,n.useSearchParams)().get("path");(0,i.J)(e,"Settings");let{data:t,isLoading:s}=(0,l.uG)(),{data:m,isLoading:u}=(0,o.aX)(),{data:h,isLoading:p}=(0,l._6)(e),x=(0,l.Lp)(),f=(0,r.useMemo)(()=>t?.find(t=>t.path===e),[t,e]),[y,g]=(0,r.useState)({path:null,value:"",isDirty:!1}),[v,N]=(0,r.useState)({path:null,value:"",isDirty:!1}),w=(0,r.useMemo)(()=>{if(!m||!h?.remoteUrls)return[];let e=new Set(Object.values(h.remoteUrls).map(j).filter(Boolean));return m.filter(t=>{if("github"===t.type)return e.has("github.com");if("gitlab"===t.type&&t.serverUrl){let s=j(t.serverUrl);return s&&e.has(s)}return!1})},[m,h]);if(s||u||p)return(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsx)("span",{className:"loading loading-spinner"})});if(!e||!f)return(0,a.jsx)("div",{className:"p-8",children:"Repository not found."});let k=y.path===e&&y.isDirty?y.value:f.displayName??"",C=f.displayName?.trim()??"",E=k.trim(),S=E!==C,D=(0,d.iu)({path:f.path,name:f.name,displayName:k}),L=(0,d.kj)(f.path),P=v.path===e&&v.isDirty?v.value:f.icon??"",R=f.icon?.trim()??"",I=P.trim(),T=I!==R,U=()=>{g({path:e,value:k,isDirty:!1}),x.mutate({path:e,updates:{displayName:k}})};return(0,a.jsxs)("div",{className:"p-8 max-w-2xl mx-auto",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"Workspace Settings"}),(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,a.jsxs)("div",{className:"card-body",children:[(0,a.jsx)("h2",{className:"card-title",children:"Repository Icon"}),(0,a.jsx)("p",{className:"text-sm opacity-70",children:"Set an emoji to represent this repository in the sidebar and repository list."}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("label",{className:"label pt-0 pb-2",children:(0,a.jsx)("span",{className:"label-text font-medium text-xs uppercase tracking-wider text-base-content/60",children:"Repository Icon"})}),(0,a.jsx)(b,{value:P,onChange:t=>{N({path:e,value:t,isDirty:!0})},onClear:()=>{N({path:e,value:"",isDirty:!0})},disabled:x.isPending})]}),(0,a.jsxs)("div",{className:"mt-4 p-3 rounded-xl bg-base-200/40 border border-base-200 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-xs uppercase font-semibold text-base-content/50 tracking-wider shrink-0",children:"Preview:"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-1 rounded-lg bg-base-100 border border-base-200 shadow-2xs text-sm truncate",children:[P?(0,a.jsx)("span",{className:"text-base leading-none shrink-0",children:P}):(0,a.jsx)(c.default,{src:"/icon.png",alt:"Trident",width:16,height:16,className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"font-medium truncate",children:D})]})]}),T&&(0,a.jsxs)("span",{className:"text-xs text-warning flex items-center gap-1.5 font-medium shrink-0",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-warning animate-pulse"}),"Unsaved changes"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-4 pt-3 border-t border-base-200",children:[(0,a.jsxs)("button",{type:"button",className:"btn btn-primary btn-sm gap-1.5",onClick:()=>{N({path:e,value:P,isDirty:!1}),x.mutate({path:e,updates:{icon:P}})},disabled:!T||x.isPending,children:[x.isPending&&(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Save Icon"]}),(0,a.jsx)("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>{N({path:e,value:"",isDirty:!1}),x.mutate({path:e,updates:{icon:null}})},disabled:!I&&!f.icon||x.isPending,children:"Reset"})]})]})}),(0,a.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,a.jsxs)("div",{className:"card-body",children:[(0,a.jsx)("h2",{className:"card-title",children:"Repository Display Name"}),(0,a.jsx)("p",{className:"text-sm opacity-70",children:"Set a custom name for this repository in the workspace UI."}),(0,a.jsxs)("div",{className:"form-control w-full mt-4",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Display Name"})}),(0,a.jsx)("input",{type:"text",className:"input input-bordered w-full",placeholder:L,value:k,onChange:t=>{g({path:e,value:t.target.value,isDirty:!0})},onKeyDown:e=>{"Enter"===e.key&&S&&!x.isPending&&(e.preventDefault(),U())}}),(0,a.jsx)("label",{className:"label",children:(0,a.jsxs)("span",{className:"label-text-alt opacity-70",children:["Preview: ",(0,a.jsx)("span",{className:"font-medium",children:D})]})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)("button",{type:"button",className:"btn btn-primary btn-sm",onClick:U,disabled:!S||x.isPending,children:"Save Name"}),(0,a.jsx)("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>{g({path:e,value:"",isDirty:!1}),x.mutate({path:e,updates:{displayName:null}})},disabled:!E&&!f.displayName||x.isPending,children:"Reset"})]})]})}),(0,a.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,a.jsxs)("div",{className:"card-body",children:[(0,a.jsx)("h2",{className:"card-title",children:"Repository Credentials"}),(0,a.jsx)("p",{className:"text-sm opacity-70",children:"Associate a credential with this repository to authenticate with remote servers."}),(0,a.jsxs)("div",{className:"form-control w-full mt-4",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Associated Credential"})}),(0,a.jsxs)("select",{className:"select select-bordered w-full",value:f.credentialId||"none",onChange:t=>{let s=t.target.value;x.mutate({path:e,updates:{credentialId:"none"===s?null:s}})},children:[(0,a.jsx)("option",{value:"none",children:"None"}),w.map(e=>(0,a.jsxs)("option",{value:e.id,children:["github"===e.type?"GitHub":"GitLab","gitlab"===e.type&&` (${new URL(e.serverUrl).hostname})`," - ","github"===e.type?"Account":"Token"]},e.id))]}),0===w.length&&(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"No matching credentials found for this repository's remotes. Add credentials in the Credentials page."})})]})]})})]})]})}function y(){return(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsx)("span",{className:"loading loading-spinner"})}),children:(0,a.jsx)(f,{})})}}},e=>{e.O(0,[2666,2176,2785,8437,1020,8645,8441,3794,7358],()=>e(e.s=47)),_N_E=e.O()}]);
21
+ `,style:{width:"min(380px, 92vw)"},children:[(0,a.jsxs)("div",{className:"px-4 py-3 border-b border-base-200 flex items-center justify-between bg-base-200/40",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-lg",children:"✨"}),(0,a.jsx)("span",{className:"font-semibold text-sm",children:"Select Repository Icon"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>l(!1),className:"btn btn-ghost btn-xs btn-square text-base-content/60 hover:text-base-content","aria-label":"Close",children:"✕"})]}),(0,a.jsx)("div",{className:"p-1 [&_.epr-main]:!border-none [&_.epr-main]:!bg-transparent",children:(0,a.jsx)(p,{onEmojiClick:e=>{t(e.emoji),l(!1)},theme:m,emojiStyle:h.EmojiStyle.NATIVE,lazyLoadEmojis:!0,searchPlaceHolder:"Search emoji by name or keyword...",width:"100%",height:380,previewConfig:{showPreview:!1},skinTonesDisabled:!1})})]})]})}function j(e){try{if(e.startsWith("git@")){let t=e.match(/git@([^:]+):/);return t?t[1]:null}return new URL(e).hostname}catch{return null}}function f(){let e=(0,n.useSearchParams)().get("path");(0,i.J)(e,"Settings");let{data:t,isLoading:s}=(0,l.uG)(),{data:m,isLoading:u}=(0,o.aX)(),{data:h,isLoading:p}=(0,l._6)(e),x=(0,l.Lp)(),f=(0,r.useMemo)(()=>t?.find(t=>t.path===e),[t,e]),[y,g]=(0,r.useState)({path:null,value:"",isDirty:!1}),[v,N]=(0,r.useState)({path:null,value:"",isDirty:!1}),w=(0,r.useMemo)(()=>{if(!m||!h?.remoteUrls)return[];let e=new Set(Object.values(h.remoteUrls).map(j).filter(Boolean));return m.filter(t=>{if("github"===t.type)return e.has("github.com");if("gitlab"===t.type&&t.serverUrl){let s=j(t.serverUrl);return s&&e.has(s)}return!1})},[m,h]);if(s||u||p)return(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsx)("span",{className:"loading loading-spinner"})});if(!e||!f)return(0,a.jsx)("div",{className:"p-8",children:"Repository not found."});let k=y.path===e&&y.isDirty?y.value:f.displayName??"",C=f.displayName?.trim()??"",E=k.trim(),S=E!==C,D=(0,d.iu)({path:f.path,name:f.name,displayName:k}),L=(0,d.kj)(f.path),P=v.path===e&&v.isDirty?v.value:f.icon??"",R=f.icon?.trim()??"",I=P.trim(),T=I!==R,U=()=>{g({path:e,value:k,isDirty:!1}),x.mutate({path:e,updates:{displayName:k}})};return(0,a.jsxs)("div",{className:"p-8 max-w-2xl mx-auto",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"Workspace Settings"}),(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,a.jsxs)("div",{className:"card-body",children:[(0,a.jsx)("h2",{className:"card-title",children:"Repository Icon"}),(0,a.jsx)("p",{className:"text-sm opacity-70",children:"Set an emoji to represent this repository in the sidebar and repository list."}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("label",{className:"label pt-0 pb-2",children:(0,a.jsx)("span",{className:"label-text font-medium text-xs uppercase tracking-wider text-base-content/60",children:"Repository Icon"})}),(0,a.jsx)(b,{value:P,onChange:t=>{N({path:e,value:t,isDirty:!0})},onClear:()=>{N({path:e,value:"",isDirty:!0})},disabled:x.isPending})]}),(0,a.jsxs)("div",{className:"mt-4 p-3 rounded-xl bg-base-200/40 border border-base-200 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-xs uppercase font-semibold text-base-content/50 tracking-wider shrink-0",children:"Preview:"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-1 rounded-lg bg-base-100 border border-base-200 shadow-2xs text-sm truncate",children:[P?(0,a.jsx)("span",{className:"text-base leading-none shrink-0",children:P}):(0,a.jsx)(c.default,{src:"/icon.png",alt:"Trident",width:16,height:16,className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"font-medium truncate",children:D})]})]}),T&&(0,a.jsxs)("span",{className:"text-xs text-warning flex items-center gap-1.5 font-medium shrink-0",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-warning animate-pulse"}),"Unsaved changes"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-4 pt-3 border-t border-base-200",children:[(0,a.jsxs)("button",{type:"button",className:"btn btn-primary btn-sm gap-1.5",onClick:()=>{N({path:e,value:P,isDirty:!1}),x.mutate({path:e,updates:{icon:P}})},disabled:!T||x.isPending,children:[x.isPending&&(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Save Icon"]}),(0,a.jsx)("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>{N({path:e,value:"",isDirty:!1}),x.mutate({path:e,updates:{icon:null}})},disabled:!I&&!f.icon||x.isPending,children:"Reset"})]})]})}),(0,a.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,a.jsxs)("div",{className:"card-body",children:[(0,a.jsx)("h2",{className:"card-title",children:"Repository Display Name"}),(0,a.jsx)("p",{className:"text-sm opacity-70",children:"Set a custom name for this repository in the workspace UI."}),(0,a.jsxs)("div",{className:"form-control w-full mt-4",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Display Name"})}),(0,a.jsx)("input",{type:"text",className:"input input-bordered w-full",placeholder:L,value:k,onChange:t=>{g({path:e,value:t.target.value,isDirty:!0})},onKeyDown:e=>{"Enter"===e.key&&S&&!x.isPending&&(e.preventDefault(),U())}}),(0,a.jsx)("label",{className:"label",children:(0,a.jsxs)("span",{className:"label-text-alt opacity-70",children:["Preview: ",(0,a.jsx)("span",{className:"font-medium",children:D})]})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)("button",{type:"button",className:"btn btn-primary btn-sm",onClick:U,disabled:!S||x.isPending,children:"Save Name"}),(0,a.jsx)("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>{g({path:e,value:"",isDirty:!1}),x.mutate({path:e,updates:{displayName:null}})},disabled:!E&&!f.displayName||x.isPending,children:"Reset"})]})]})}),(0,a.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,a.jsxs)("div",{className:"card-body",children:[(0,a.jsx)("h2",{className:"card-title",children:"Repository Credentials"}),(0,a.jsx)("p",{className:"text-sm opacity-70",children:"Associate a credential with this repository to authenticate with remote servers."}),(0,a.jsxs)("div",{className:"form-control w-full mt-4",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Associated Credential"})}),(0,a.jsxs)("select",{className:"select select-bordered w-full",value:f.credentialId||"none",onChange:t=>{let s=t.target.value;x.mutate({path:e,updates:{credentialId:"none"===s?null:s}})},children:[(0,a.jsx)("option",{value:"none",children:"None"}),w.map(e=>(0,a.jsxs)("option",{value:e.id,children:["github"===e.type?"GitHub":"GitLab","gitlab"===e.type&&` (${new URL(e.serverUrl).hostname})`," - ","github"===e.type?"Account":"Token"]},e.id))]}),0===w.length&&(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"No matching credentials found for this repository's remotes. Add credentials in the Credentials page."})})]})]})})]})]})}function y(){return(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsx)("span",{className:"loading loading-spinner"})}),children:(0,a.jsx)(f,{})})}}},e=>{e.O(0,[2666,2176,2785,8437,5339,8645,8441,3794,7358],()=>e(e.s=47)),_N_E=e.O()}]);