@surething/cockpit 1.0.207 → 1.0.208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next-prod/BUILD_ID +1 -1
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js +1 -1
- package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +1 -18
- package/.next-prod/server/app/_not-found.rsc +16 -15
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +16 -15
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +5 -4
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/search/route.js +1 -1
- package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/load/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next-prod/server/app/page.js +1 -1
- package/.next-prod/server/app/page.js.nft.json +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +1 -1
- package/.next-prod/server/app/project/page.js.nft.json +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page.js +1 -1
- package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/chunks/{9658.js → 3204.js} +7 -24
- package/.next-prod/server/chunks/{554.js → 9755.js} +5 -5
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +1 -18
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/{5660-9053823b3dfa50f5.js → 5660-3d87dfb12f95e96d.js} +2 -2
- package/.next-prod/static/chunks/app/layout-92d5dcd25bad9196.js +1 -0
- package/.next-prod/trace +12 -12
- package/.next-prod/trace-build +1 -1
- package/package.json +1 -1
- package/public/boot.js +20 -0
- package/.next-prod/static/chunks/app/layout-421143dba2c69478.js +0 -1
- /package/.next-prod/static/{Uvhbo45hauczMddOCJnSX → WsSesL2O_jRoZztt2Y5r6}/_buildManifest.js +0 -0
- /package/.next-prod/static/{Uvhbo45hauczMddOCJnSX → WsSesL2O_jRoZztt2Y5r6}/_ssgManifest.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(()=>{var a={};a.id=2951,a.ids=[2951],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1134:(a,b,c)=>{"use strict";c.d(b,{ReviewDropdown:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ReviewDropdown() from the server but ReviewDropdown is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ReviewDropdown.tsx","ReviewDropdown")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},5993:(a,b,c)=>{"use strict";c.d(b,{Q:()=>j});var d=c(48249),e=c(67484),f=c(44384),g=c(208);function h(a){let b=new Date(a),c=Math.floor((new Date().getTime()-b.getTime())/6e4);if(c<1)return g.A.t("common.justNow");if(c<60)return g.A.t("common.minutesAgo",{count:c});let d=Math.floor(c/60);if(d<24)return g.A.t("common.hoursAgo",{count:d});let e=Math.floor(d/24);return e<7?g.A.t("common.daysAgo",{count:e}):b.toLocaleDateString()}let i=(0,e.forwardRef)(function({comment:a,isActive:b,isOwnComment:c,isAdmin:g,currentAuthorId:i,canInteract:j,userNameMap:k,onClick:l,onDelete:m,onEdit:n,onToggleClosed:o,onAddReply:p,onDeleteReply:q,onEditReply:r},s){let{t}=(0,f.Bd)(),u=(a,b)=>k[a]||b,[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(""),H=()=>{let a=v.trim();a&&(p(a),w(""),y(!1))},I=()=>{let b=B.trim();b&&b!==a.content&&n(b),A(!1)},J=()=>{if(!D)return;let b=F.trim(),c=a.replies.find(a=>a.id===D);!b||c&&b===c.content||r(D,b),E(null)},K=a.anchor.selectedText.length>80?a.anchor.selectedText.slice(0,77)+"...":a.anchor.selectedText,L=g||c||j;return a.closed?(0,d.jsxs)("div",{ref:s,className:"rounded-lg border border-border/50 bg-card/50 opacity-60 hover:opacity-80 transition-all cursor-pointer px-3 py-2 flex items-center gap-2",onClick:l,children:[(0,d.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:u(a.authorId,a.author).charAt(0)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground truncate flex-1",children:K}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground/50 flex-shrink-0",children:t("review.closedLabel")}),L&&(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),o(!1)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors flex-shrink-0",title:t("review.reopenReview"),children:t("review.reopen")}),(c&&j||g)&&(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),m()},className:"text-[10px] text-muted-foreground hover:text-red-500 transition-colors flex-shrink-0",title:t("review.deleteComment"),children:t("common.delete")})]}):(0,d.jsxs)("div",{ref:s,className:`rounded-lg border transition-all cursor-pointer ${b?"border-brand bg-brand/5 shadow-sm":"border-border bg-card hover:border-muted-foreground/30"}`,onClick:l,children:[(0,d.jsx)("div",{className:"px-3 pt-3 pb-1",children:(0,d.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:K})}),(0,d.jsxs)("div",{className:"px-3 pt-2 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-5 h-5 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[10px] font-bold flex-shrink-0",children:u(a.authorId,a.author).charAt(0)}),(0,d.jsx)("span",{className:"text-xs font-medium",children:u(a.authorId,a.author)}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:h(a.createdAt)}),(0,d.jsx)("div",{className:"flex-1"}),!z&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[L&&(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),o(!0)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:t("review.closeComment"),children:t("review.closeComment")}),c&&j&&(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),C(a.content),A(!0)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:t("review.editComment"),children:t("common.edit")}),(c&&j||g)&&(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),m()},className:"text-[10px] text-muted-foreground hover:text-red-500 transition-colors",title:t("review.deleteComment"),children:t("common.delete")})]})]}),(0,d.jsx)("div",{className:"px-3 pt-1 pb-2",children:z?(0,d.jsxs)("div",{onClick:a=>a.stopPropagation(),children:[(0,d.jsx)("textarea",{value:B,onChange:a=>C(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||(a.preventDefault(),I()),"Escape"===a.key&&A(!1)},className:"w-full px-2 py-1.5 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:3,autoFocus:!0}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-1",children:[(0,d.jsx)("button",{onClick:()=>A(!1),className:"px-2 py-0.5 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:t("common.cancel")}),(0,d.jsx)("button",{onClick:I,disabled:!B.trim(),className:"px-2 py-0.5 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:t("common.save")})]})]}):(0,d.jsxs)("div",{className:"text-sm whitespace-pre-wrap",children:[a.content,a.edited&&(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:t("review.edited")})]})}),a.replies.length>0&&(0,d.jsx)("div",{className:"mx-3 border-t border-border",children:a.replies.map(a=>(0,d.jsxs)("div",{className:"py-2 border-b border-border last:border-b-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-4 h-4 rounded-full bg-accent text-muted-foreground flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:u(a.authorId,a.author).charAt(0)}),(0,d.jsx)("span",{className:"text-xs font-medium",children:u(a.authorId,a.author)}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:h(a.createdAt)}),(0,d.jsx)("div",{className:"flex-1"}),D!==a.id&&(a.authorId===i&&j||g)&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.authorId===i&&j&&(0,d.jsx)("button",{onClick:b=>{var c;b.stopPropagation(),c=a.id,G(a.content),E(c)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:t("review.editReply"),children:t("common.edit")}),(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),q(a.id)},className:"text-[10px] text-muted-foreground hover:text-red-500 transition-colors",title:t("review.deleteReply"),children:t("common.delete")})]})]}),D===a.id?(0,d.jsxs)("div",{className:"mt-1 pl-6",onClick:a=>a.stopPropagation(),children:[(0,d.jsx)("textarea",{value:F,onChange:a=>G(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||(a.preventDefault(),J()),"Escape"===a.key&&E(null)},className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:2,autoFocus:!0}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-1",children:[(0,d.jsx)("button",{onClick:()=>E(null),className:"px-2 py-0.5 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:t("common.cancel")}),(0,d.jsx)("button",{onClick:J,disabled:!F.trim(),className:"px-2 py-0.5 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:t("common.save")})]})]}):(0,d.jsxs)("div",{className:"text-sm mt-0.5 pl-6 whitespace-pre-wrap",children:[a.content,a.edited&&(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:t("review.edited")})]})]},a.id))}),(0,d.jsx)("div",{className:"px-3 pb-2 pt-1",children:x?(0,d.jsxs)("div",{className:"mt-1",onClick:a=>a.stopPropagation(),children:[(0,d.jsx)("textarea",{value:v,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||(a.preventDefault(),H()),"Escape"===a.key&&y(!1)},placeholder:t("review.replyPlaceholder"),className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:2,autoFocus:!0}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-1",children:[(0,d.jsx)("button",{onClick:()=>y(!1),className:"px-2 py-0.5 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:t("common.cancel")}),(0,d.jsx)("button",{onClick:H,disabled:!v.trim(),className:"px-2 py-0.5 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:t("review.reply")})]})]}):j&&(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),y(!0)},className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:t("review.reply")})})]})});function j({comments:a,activeCommentId:b,currentAuthorId:c,isActive:g,isAdmin:h,userNameMap:k,onCommentClick:l,onNavigateComment:m,onDeleteComment:n,onEditComment:o,onToggleCommentClosed:p,onAddReply:q,onDeleteReply:r,onEditReply:s,scrollToCommentRef:t}){let{t:u}=(0,f.Bd)(),v=(0,e.useRef)(new Map),w=(0,e.useRef)(null);(0,e.useCallback)(a=>{let b=v.current.get(a);b&&b.scrollIntoView({behavior:"smooth",block:"center"})},[]);let x=[...a].sort((a,b)=>a.anchor.startOffset-b.anchor.startOffset);return(0,d.jsxs)("div",{ref:w,className:"h-full flex flex-col bg-card",children:[(0,d.jsxs)("div",{className:"px-4 py-2 bg-secondary border-b border-border flex-shrink-0 flex items-center",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:0===a.length?u("review.selectTextToComment"):b?u("review.commentsNavCount",{current:x.findIndex(a=>a.id===b)+1,total:a.length}):u("review.commentsCount",{count:a.length})}),a.length>0&&(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,d.jsxs)("button",{onClick:()=>m("prev"),className:"px-1.5 py-0.5 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors flex items-center gap-0.5",title:u("review.prevComment"),children:[(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"15 18 9 12 15 6"})}),u("review.prevComment")]}),(0,d.jsxs)("button",{onClick:()=>m("next"),className:"px-1.5 py-0.5 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors flex items-center gap-0.5",title:u("review.nextComment"),children:[u("review.nextComment"),(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"9 18 15 12 9 6"})})]})]})]}),(0,d.jsx)("div",{className:"flex-1 overflow-auto",children:0===x.length?(0,d.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,d.jsx)("div",{children:u("review.selectTextHint")})]})}):(0,d.jsx)("div",{className:"p-3 space-y-3",children:x.map(a=>(0,d.jsx)(i,{ref:b=>{b?v.current.set(a.id,b):v.current.delete(a.id)},comment:a,isActive:a.id===b,isOwnComment:a.authorId===c,isAdmin:h,currentAuthorId:c,canInteract:g,userNameMap:k,onClick:()=>l(a.id),onDelete:()=>n(a.id),onEdit:b=>o(a.id,b),onToggleClosed:b=>p(a.id,b),onAddReply:b=>q(a.id,b),onDeleteReply:b=>r(a.id,b),onEditReply:(b,c)=>s(a.id,b,c)},a.id))})})]})}},6189:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>M,handler:()=>O,routeModule:()=>N});var d=c(7553),e=c(84006),f=c(67798),g=c(34775),h=c(99373),i=c(73461),j=c(1020),k=c(26349),l=c(54365),m=c(16023),n=c(63747),o=c(24235),p=c(23938),q=c(261),r=c(66758),s=c(77243),t=c(26713),u=c(37527),v=c(22820),w=c(88216),x=c(47929),y=c(79551),z=c(71797),A=c(89125),B=c(86439),C=c(77068),D=c(27269),E=c(61287),F=c(81494),G=c(70722),H=c(70753),I=c(43954),J=c(17891),K={};for(let a in E)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(K[a]=()=>E[a]);c.d(b,K);let L={children:["",{children:["review",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,44236)),"/home/runner/work/cockpit/cockpit/src/app/review/[id]/page.tsx"]}]},{"global-error":[()=>Promise.resolve().then(c.bind(c,81227)),"/home/runner/work/cockpit/cockpit/src/app/global-error.tsx"]},[]]},{"global-error":[()=>Promise.resolve().then(c.bind(c,81227)),"/home/runner/work/cockpit/cockpit/src/app/global-error.tsx"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,76537)),"/home/runner/work/cockpit/cockpit/src/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.bind(c,81227)),"/home/runner/work/cockpit/cockpit/src/app/global-error.tsx"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,M={require:c,loadChunk:()=>Promise.resolve()},N=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/review/[id]/page",pathname:"/review/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:L},distDir:".next-prod",relativeProjectDir:""});async function O(a,b,d){var K,P,Q,R,S;d.requestMeta&&(0,h.setRequestMeta)(a,d.requestMeta),N.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let T=!!(0,h.getRequestMeta)(a,"minimalMode"),U="/review/[id]/page";"/index"===U&&(U="/");let V=await N.prepare(a,b,{srcPage:U,multiZoneDraftMode:!1});if(!V)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:W,query:X,params:Y,pageIsDynamic:Z,buildManifest:$,nextFontManifest:_,reactLoadableManifest:aa,serverActionsManifest:ab,clientReferenceManifest:ac,subresourceIntegrityManifest:ad,prerenderManifest:ae,isDraftMode:af,resolvedPathname:ag,revalidateOnlyGenerated:ah,routerServerContext:ai,nextConfig:aj,parsedUrl:ak,interceptionRoutePatterns:al,deploymentId:am,clientAssetToken:an}=V,ao=(0,q.normalizeAppPath)(U),{isOnDemandRevalidate:ap}=V,aq=aj.experimental.ppr&&!aj.cacheComponents&&(0,I.isInterceptionRouteAppPath)(ag)?null:N.match(ag,ae),ar=(null==aq?void 0:aq.route)??null,as=!!ae.routes[ag],at=a.headers["user-agent"]||"",au=(0,t.getBotType)(at),av=(0,p.isHtmlBotRequest)(a),aw=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[s.NEXT_ROUTER_PREFETCH_HEADER],ax=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[s.RSC_HEADER],ay=(0,r.getIsPossibleServerAction)(a),az=(0,m.checkIsAppPPREnabled)(aj.experimental.ppr),aA=a.headers[x.NEXT_RESUME_STATE_LENGTH_HEADER];if(!(0,h.getRequestMeta)(a,"postponed")&&T&&az&&ay&&aA&&"string"==typeof aA){let e=parseInt(aA,10),{maxPostponedStateSize:f,maxPostponedStateSizeBytes:g}=(0,D.getMaxPostponedStateSize)(aj.experimental.maxPostponedStateSize);if(!isNaN(e)&&e>0){if(e>g)return b.statusCode=413,b.end((0,D.getPostponedStateExceededErrorMessage)(f)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let i="1 MB",j=(null==(S=aj.experimental.serverActions)?void 0:S.bodySizeLimit)??i,k=e+(j!==i?c(95726).parse(j):1048576),l=await (0,D.readBodyWithSizeLimit)(a,k);if(null===l)return b.statusCode=413,b.end("Request body exceeded limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;if(l.length>=e){let b=l.subarray(0,e).toString("utf8");(0,h.addRequestMeta)(a,"postponed",b);let c=l.subarray(e);(0,h.addRequestMeta)(a,"actionBody",c)}else throw Object.defineProperty(Error(`invariant: expected ${e} bytes of postponed state but only received ${l.length} bytes`),"__NEXT_ERROR_CODE",{value:"E979",enumerable:!1,configurable:!0})}}if(!(0,h.getRequestMeta)(a,"postponed")&&az&&"1"===a.headers[x.NEXT_RESUME_HEADER]&&"POST"===a.method){let{maxPostponedStateSize:c,maxPostponedStateSizeBytes:e}=(0,D.getMaxPostponedStateSize)(aj.experimental.maxPostponedStateSize),f=await (0,D.readBodyWithSizeLimit)(a,e);if(null===f)return b.statusCode=413,b.end((0,D.getPostponedStateExceededErrorMessage)(c)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let g=f.toString("utf8");(0,h.addRequestMeta)(a,"postponed",g)}let aB=!0===N.isDev||!0===aj.experimental.exposeTestingApiInProductionBuild,aC=aB&&("1"===a.headers[s.NEXT_INSTANT_PREFETCH_HEADER]||void 0===a.headers[s.RSC_HEADER]&&"string"==typeof a.headers.cookie&&a.headers.cookie.includes(s.NEXT_INSTANT_TEST_COOKIE+"=")),aD=(az||aC)&&((null==(K=ae.routes[ao]??ae.dynamicRoutes[ao])?void 0:K.renderingMode)==="PARTIALLY_STATIC"||aC&&(aB||(null==ai?void 0:ai.experimentalTestProxy)===!0)),aE=aC&&aD,aF=aE&&!0===N.isDev,aG=!1,aH=aD?(0,h.getRequestMeta)(a,"postponed"):void 0,aI=null==(P=ae.routes[ag])?void 0:P.prefetchDataRoute,aJ=aD&&ax&&!aw&&!aI;T&&(aJ=aJ&&!!aH);let aK=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aL=(!au||!aD)&&(!at||(0,p.shouldServeStreamingMetadata)(at,aj.htmlLimitedBots)),aM=!!((ar||as||ae.routes[ao])&&!(au&&aD)),aN=aD&&!0===aj.cacheComponents,aO=!0===N.isDev||!aM||"string"==typeof aH||(aN&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aJ&&!T:aJ),aP=!!au&&aD,aQ=(null==ar?void 0:ar.remainingPrerenderableParams)??[],aR=(null==ar?void 0:ar.fallback)===null&&((null==(Q=ar.fallbackRootParams)?void 0:Q.length)??0)>0,aS=null;if(!af&&aM&&!aO&&!ay&&!aH&&!aJ){let a=aq?"string"==typeof(null==ar?void 0:ar.fallback)?ar.fallback:aq.source:null;if(!0===aj.experimental.partialFallbacks&&a&&(null==ar?void 0:ar.fallbackRouteParams)&&!aR){if(aQ.length>0){let b,c=(b=new Map(aQ.map(a=>[a.paramName,a])),a.split("/").map(a=>{let c=(0,J.getSegmentParam)(a);if(!c)return a;let d=b.get(c.paramName);if(!d)return a;let e=null==Y?void 0:Y[d.paramName];if(!e)return a;let f=Array.isArray(e)?e.map(a=>encodeURIComponent(a)).join("/"):encodeURIComponent(e);return a.replace(function(a){let{repeat:b,optional:c}=(0,J.getParamProperties)(a.paramType);return c?`[[...${a.paramName}]]`:b?`[...${a.paramName}]`:`[${a.paramName}]`}(d),f)}).join("/")||"/");aS=c!==a?c:null}}else aS=ag}let aT=aS;!aT&&(N.isDev||aM&&Z&&(null==ar?void 0:ar.fallbackRouteParams)&&!ay)&&(aT=ag),N.isDev||af||!aM||!ax||aJ||(0,k.d)(a.headers);let aU={...E,tree:L,handler:O,routeModule:N,__next_app__:M};ab&&ac&&(0,o.setManifestsSingleton)({page:U,clientReferenceManifest:ac,serverActionsManifest:ab});let aV=a.method||"GET",aW=(0,g.getTracer)(),aX=aW.getActiveScopeSpan(),aY=!!(null==ai?void 0:ai.isWrappedByNextServer),aZ=!0===aj.experimental.partialFallbacks&&aQ.length>0?(null==ar||null==(R=ar.fallbackRouteParams)?void 0:R.filter(a=>!aQ.some(b=>b.paramName===a.paramName)))??[]:[],a$=async()=>((null==ai?void 0:ai.render404)?await ai.render404(a,b,ak,!1):b.end("This page could not be found"),null);try{let k,m=N.getVaryHeader(ag,al);b.setHeader("Vary",m);let o=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return N.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aW.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aV} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a),k&&k!==c&&(k.setAttribute("http.route",d),k.updateName(a))}else c.updateName(`${aV} ${U}`)})},p=(0,h.getRequestMeta)(a,"incrementalCache")||await N.getIncrementalCache(a,aj,ae,T);null==p||p.resetRequestCache(),globalThis.__incrementalCache=p;let q=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let k={query:X,params:Y,page:ao,sharedContext:{buildId:W,deploymentId:am,clientAssetToken:an},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aU,Component:(0,j.T)(aU),params:Y,routeModule:N,page:U,postponed:f,shouldWaitOnAllReady:aP,serveStreamingMetadata:aL,supportsDynamicResponse:"string"==typeof f||aO,buildManifest:$,nextFontManifest:_,reactLoadableManifest:aa,subresourceIntegrityManifest:ad,setCacheStatus:null==ai?void 0:ai.setCacheStatus,setIsrStatus:null==ai?void 0:ai.setIsrStatus,setReactDebugChannel:null==ai?void 0:ai.setReactDebugChannel,sendErrorsToBrowser:null==ai?void 0:ai.sendErrorsToBrowser,dir:c(33873).join(process.cwd(),N.relativeProjectDir),isDraftMode:af,botType:au,isOnDemandRevalidate:ap,isPossibleServerAction:ay,assetPrefix:aj.assetPrefix,nextConfigOutput:aj.output,crossOrigin:aj.crossOrigin,trailingSlash:aj.trailingSlash,images:aj.images,previewProps:ae.preview,enableTainting:aj.experimental.taint,htmlLimitedBots:aj.htmlLimitedBots,reactMaxHeadersLength:aj.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:p,cacheLifeProfiles:aj.cacheLife,basePath:aj.basePath,serverActions:aj.experimental.serverActions,logServerFunctions:"object"==typeof aj.logging&&!!aj.logging.serverFunctions,...aE||aF||aG?{isBuildTimePrerendering:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:aF}:{},cacheComponents:!!aj.cacheComponents,experimental:{isRoutePPREnabled:aD,expireTime:aj.expireTime,staleTimes:aj.experimental.staleTimes,dynamicOnHover:!!aj.experimental.dynamicOnHover,optimisticRouting:!!aj.experimental.optimisticRouting,inlineCss:!!aj.experimental.inlineCss,prefetchInlining:aj.experimental.prefetchInlining??!1,authInterrupts:!!aj.experimental.authInterrupts,cachedNavigations:!!aj.experimental.cachedNavigations,clientTraceMetadata:aj.experimental.clientTraceMetadata||[],clientParamParsingOrigins:aj.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,C.parseMaxPostponedStateSize)(aj.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>N.onRequestError(a,b,d,e,ai),err:(0,h.getRequestMeta)(a,"invokeError")}};i&&(k.renderOpts.supportsDynamicResponse=!1);let l=await o(e,k),{metadata:m}=l,{cacheControl:n,headers:q={},fetchTags:r,fetchMetrics:s}=m;if(r&&(q[x.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,aM&&(null==n?void 0:n.revalidate)===0&&!N.isDev&&!aD){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ag}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
|
|
2
|
-
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:u.CachedRouteKind.APP_PAGE,html:l,headers:q,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},r=async({hasResolved:c,previousCacheEntry:g,isRevalidating:i,span:j,forceStaticRender:k=!1})=>{let l=!1===N.isDev,m=c||b.writableEnded;try{let f;if(ap&&ah&&!g&&!T)return(null==ai?void 0:ai.render404)?await ai.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(ar&&(f=(0,v.parseFallbackField)(ar.fallback)),!0===aj.experimental.partialFallbacks&&(null==ar?void 0:ar.fallback)===null&&!aR&&aQ.length>0&&(f=v.FallbackMode.PRERENDER),f===v.FallbackMode.PRERENDER&&(0,t.isBot)(at)&&(!aD||av)&&(f=v.FallbackMode.BLOCKING_STATIC_RENDER),(null==g?void 0:g.isStale)===-1&&(ap=!0),ap&&(f!==v.FallbackMode.NOT_FOUND||g)&&(f=v.FallbackMode.BLOCKING_STATIC_RENDER),!T&&f!==v.FallbackMode.BLOCKING_STATIC_RENDER&&aT&&!m&&!af&&Z&&(l||!as)){if((l||ar)&&f===v.FallbackMode.NOT_FOUND){if(aj.adapterPath)return await a$();throw new B.NoFallbackError}if(aD&&(aj.cacheComponents?!aJ:!ax)){let b=l&&"string"==typeof(null==ar?void 0:ar.fallback)?ar.fallback:ao,f=(l||aE)&&(null==ar?void 0:ar.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams):aG?(0,n.getFallbackRouteParams)(ao,N):null;aE&&f&&(0,h.addRequestMeta)(a,"fallbackParams",f);let g=await N.handleResponse({cacheKey:b,req:a,nextConfig:aj,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:ae,isRoutePPREnabled:aD,responseGenerator:async()=>q({span:j,postponed:void 0,fallbackRouteParams:f,forceStaticRender:!0}),waitUntil:d.waitUntil,isMinimalMode:T});if(null===g)return null;if(g)return T||!aD||!(aQ.length>0)||!0!==aj.experimental.partialFallbacks||!aS||!p||ap||aG||aB||aC||aw||(0,H.scheduleOnNextTick)(async()=>{let b=N.getResponseCache(a);try{await b.revalidate(aS,p,aD,!1,a=>q({span:a.span,postponed:void 0,fallbackRouteParams:aZ.length>0?(0,n.createOpaqueFallbackRouteParams)(aZ):null,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}),delete g.cacheControl,g}}let o=ap||i||!aH?void 0:aH;if(aN&&!T&&p&&(aJ||ay)&&!k){let b=await p.get(ag,{kind:u.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===u.CachedRouteKind.APP_PAGE&&(o=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,H.scheduleOnNextTick)(async()=>{let b=N.getResponseCache(a);try{await b.revalidate(ag,p,aD,!1,a=>r({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if((aE||aF)&&void 0!==o)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:u.CachedRouteKind.PAGES,html:w.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let s=(l&&(0,h.getRequestMeta)(a,"renderFallbackShell")||aE&&!as)&&(null==ar?void 0:ar.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams):aG?(0,n.getFallbackRouteParams)(ao,N):null;if((l||aE)&&aj.cacheComponents&&!as&&(null==ar?void 0:ar.fallbackRouteParams)){let b=(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams);b&&(0,h.addRequestMeta)(a,"fallbackParams",b)}return q({span:j,postponed:o,fallbackRouteParams:s,forceStaticRender:k})}catch(b){throw(null==g?void 0:g.isStale)&&await N.onRequestError(a,b,{routerKind:"App Router",routePath:U,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aM,isOnDemandRevalidate:ap})},!1,ai),b}},D=async c=>{var f,g,i,j,k;let l,m=await N.handleResponse({cacheKey:aS,responseGenerator:a=>r({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ap,isRoutePPREnabled:aD,req:a,nextConfig:aj,prerenderManifest:ae,waitUntil:d.waitUntil,isMinimalMode:T});if(af&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),N.isDev&&b.setHeader("Cache-Control","no-cache, must-revalidate"),!m){if(aS)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=m.value)?void 0:f.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=m.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let n="string"==typeof m.value.postponed;ax&&!ay&&am&&b.setHeader(x.NEXT_NAV_DEPLOYMENT_ID_HEADER,am),aM&&!aJ&&(!n||aw)&&(T||b.setHeader("x-nextjs-cache",ap?"REVALIDATED":m.isMiss?"MISS":m.isStale?"STALE":"HIT"),b.setHeader(s.NEXT_IS_PRERENDER_HEADER,"1"));let{value:o}=m;if(aH)l={revalidate:0,expire:void 0};else if(aJ)l={revalidate:0,expire:void 0};else if(!N.isDev)if(af)l={revalidate:0,expire:void 0};else if(aM){if(m.cacheControl)if("number"==typeof m.cacheControl.revalidate){if(m.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${m.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:m.cacheControl.revalidate,expire:(null==(j=m.cacheControl)?void 0:j.expire)??aj.expireTime}}else l={revalidate:x.CACHE_ONE_YEAR_SECONDS,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(m.cacheControl=l,"string"==typeof aK&&(null==o?void 0:o.kind)===u.CachedRouteKind.APP_PAGE&&o.segmentData){b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=o.headers)?void 0:k[x.NEXT_CACHE_TAGS_HEADER];T&&aM&&c&&"string"==typeof c&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,c);let d=o.segmentData.get(aK);return void 0!==d?(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.fromStatic(d,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl}):(b.statusCode=204,(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl}))}let p=aN?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(p&&await p(m,{url:(0,h.getRequestMeta)(a,"initURL")??a.url}))return null;if(o.headers){let a={...o.headers};for(let[c,d]of(T&&aM||delete a[x.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let t=null==(g=o.headers)?void 0:g[x.NEXT_CACHE_TAGS_HEADER];if(T&&aM&&t&&"string"==typeof t&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,t),!o.status||ax&&aD||(b.statusCode=o.status),!T&&o.status&&F.RedirectStatusCode[o.status]&&ax&&(b.statusCode=200),n&&!aJ&&b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"1"),ax&&!af){if(void 0===o.rscData){if(o.html.contentType!==s.RSC_CONTENT_TYPE_HEADER)if(aj.cacheComponents)return b.statusCode=404,(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl});else throw Object.defineProperty(new G.InvariantError(`Expected RSC response, got ${o.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:o.html,cacheControl:m.cacheControl})}return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.fromStatic(o.rscData,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl})}let v=o.html;if(aC&&aE){let c=!0===N.isDev?crypto.randomUUID():null;return v.pipeThrough((0,z.createInstantTestScriptInsertionTransformStream)(c)),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})}if(!n||T||ax)return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:m.cacheControl});if(aE||aF)return v.push(new ReadableStream({start(a){a.enqueue(y.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}});let B=new TransformStream;return v.push(B.readable),q({span:c,postponed:o.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(B.writable)}).catch(a=>{B.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})};if(!aY||!aX)return k=aW.getActiveScopeSpan(),await aW.withPropagatedContext(a.headers,()=>aW.trace(i.BaseServerSpan.handleRequest,{spanName:`${aV} ${U}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aV,"http.target":a.url}},D),void 0,!aY);await D(aX)}catch(b){throw b instanceof B.NoFallbackError||await N.onRequestError(a,b,{routerKind:"App Router",routePath:U,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aM,isOnDemandRevalidate:ap})},!1,ai),b}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12629:a=>{"use strict";a.exports=import("web-tree-sitter")},16708:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{W:()=>n});var e=c(48249),f=c(67484),g=c(87844),h=c(24680),i=c(83768),j=c(84835),k=c(84226),l=c(63324),m=c(26188);let a=[j.W];function n({content:b,comments:c,activeCommentId:d,isActive:j,onAddComment:o,onHighlightClick:p,scrollToHighlightRef:q}){let{resolvedTheme:r}=(0,i.D)(),s=(0,f.useRef)(null),t=(0,f.useRef)(null),[u,v]=(0,f.useState)(null),w=(0,f.useMemo)(()=>u?[...c,{id:"__pending__",author:"",authorId:"",content:"",anchor:u.anchor,createdAt:0,replies:[]}]:c,[c,u]),{rects:x,scrollToHighlight:y}=(0,m.useReviewHighlights)(s,t,w,d),z=(0,f.useRef)(x),A=(0,f.useCallback)(a=>{let b=window.getSelection(),c=b&&!b.isCollapsed;if(c&&j&&s.current){let c=b.getRangeAt(0);if(s.current.contains(c.startContainer)&&s.current.contains(c.endContainer)){let d=function(a,b){let c=document.createTreeWalker(a,NodeFilter.SHOW_TEXT),d=0,e=-1,f=-1;for(;c.nextNode();){let a=c.currentNode,g=a.textContent?.length||0;if(a===b.startContainer&&(e=d+b.startOffset),a===b.endContainer){f=d+b.endOffset;break}d+=g}if(-1===e||-1===f||e>=f)return null;let g=a.textContent?.slice(e,f)||"";return g.trim()?{startOffset:e,endOffset:f,selectedText:g}:null}(s.current,c);if(d){let c=t.current??s.current.parentElement,e=c.getBoundingClientRect();v({anchor:d,position:{top:a.clientY-e.top+c.scrollTop+8,left:a.clientX-e.left}}),b.removeAllRanges();return}}}if(!c&&!u){let b=t.current;if(!b)return;let c=b.getBoundingClientRect(),d=a.clientX-c.left+b.scrollLeft,e=a.clientY-c.top+b.scrollTop;for(let a of z.current)if("__pending__"!==a.commentId&&d>=a.left&&d<=a.left+a.width&&e>=a.top&&e<=a.top+a.height)return void p(a.commentId)}},[j,u,p]),B=(0,f.useCallback)(a=>{u&&(o(a,u.anchor),v(null),window.getSelection()?.removeAllRanges())},[u,o]),C=(0,f.useCallback)(()=>{v(null),window.getSelection()?.removeAllRanges()},[]);return(0,e.jsxs)("div",{className:"h-full flex bg-card",children:[(0,e.jsx)(h.l,{content:b,containerRef:t}),(0,e.jsxs)("div",{ref:t,className:"flex-1 overflow-auto relative",onMouseUp:A,children:[(0,e.jsx)("div",{ref:s,className:"p-6 review-markdown-container",children:(0,e.jsx)(g.T,{content:b,rehypePlugins:a})}),(0,e.jsx)(l.u,{rects:x,activeCommentId:d,pendingCommentId:u?"__pending__":null,isDark:"dark"===r}),u&&(0,e.jsx)(k.X,{selectedText:u.anchor.selectedText,position:u.position,onSubmit:B,onCancel:C})]})]})}d()}catch(a){d(a)}})},17891:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/get-segment-param")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20975:(a,b,c)=>{"use strict";c.d(b,{ReviewListPanel:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ReviewListPanel() from the server but ReviewListPanel is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ReviewListPanel.tsx","ReviewListPanel")},26188:(a,b,c)=>{"use strict";c.d(b,{useReviewHighlights:()=>e});var d=c(67484);function e(a,b,c,e){let[f,g]=(0,d.useState)([]),h=(0,d.useRef)(0),i=(0,d.useRef)(c);(0,d.useCallback)(()=>{h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{let c=a.current,d=b.current;if(!c||!d)return;let e=function(a,b,c){let d=[],e=b.getBoundingClientRect(),f=function(a){let b=[],c=document.createTreeWalker(a,NodeFilter.SHOW_TEXT),d=0;for(;c.nextNode();){let a=c.currentNode,e=a.textContent?.length||0;b.push({node:a,start:d,end:d+e}),d+=e}return b}(a);if(0===f.length)return d;for(let a of c){let{startOffset:c,endOffset:g}=a.anchor;if(c>=g)continue;let h=null,i=0,j=null,k=0;for(let{node:a,start:b,end:d}of f)if(!h&&c>=b&&c<d&&(h=a,i=c-b),g>b&&g<=d){j=a,k=g-b;break}if(!h||!j)continue;let l=document.createRange();try{l.setStart(h,i),l.setEnd(j,k)}catch{continue}for(let c of l.getClientRects())c.width<1||c.height<1||d.push({commentId:a.id,top:c.top-e.top+b.scrollTop,left:c.left-e.left+b.scrollLeft,width:c.width,height:c.height})}return d}(c,d,i.current);g(a=>a.length===e.length&&a.every((a,b)=>a.commentId===e[b].commentId&&.5>Math.abs(a.top-e[b].top)&&.5>Math.abs(a.left-e[b].left)&&.5>Math.abs(a.width-e[b].width)&&.5>Math.abs(a.height-e[b].height))?a:e)})},[a,b]);let j=(0,d.useCallback)(a=>{let c=b.current;if(!c)return;let d=f.find(b=>b.commentId===a);if(!d)return;let e=c.clientHeight;c.scrollTo({top:d.top-e/2+d.height/2,behavior:"smooth"})},[b,f]);return{rects:f,scrollToHighlight:j}}},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},28354:a=>{"use strict";a.exports=require("util")},28820:(a,b,c)=>{"use strict";c.d(b,{ReviewPage:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ReviewPage() from the server but ReviewPage is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ReviewPage.tsx","ReviewPage")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29657:(a,b,c)=>{Promise.resolve().then(c.bind(c,26188)),Promise.resolve().then(c.bind(c,79758)),Promise.resolve().then(c.bind(c,61130)),Promise.resolve().then(c.bind(c,12568)),Promise.resolve().then(c.bind(c,45354)),Promise.resolve().then(c.bind(c,94481)),Promise.resolve().then(c.bind(c,67134)),Promise.resolve().then(c.bind(c,47846))},33873:a=>{"use strict";a.exports=require("path")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},42681:(a,b,c)=>{Promise.resolve().then(c.bind(c,73370)),Promise.resolve().then(c.bind(c,61169)),Promise.resolve().then(c.bind(c,63376)),Promise.resolve().then(c.bind(c,1134)),Promise.resolve().then(c.bind(c,42784)),Promise.resolve().then(c.bind(c,20975)),Promise.resolve().then(c.bind(c,28820)),Promise.resolve().then(c.bind(c,74824))},42784:(a,b,c)=>{"use strict";c.d(b,{ReviewIdentitySettings:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ReviewIdentitySettings() from the server but ReviewIdentitySettings is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ReviewIdentitySettings.tsx","ReviewIdentitySettings")},43954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},44236:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h,dynamic:()=>f,generateMetadata:()=>g});var d=c(5735),e=c(28820);let f="force-dynamic";async function g({params:a}){let{id:b}=await a;return{title:`Review - ${b}`}}async function h({params:a}){let{id:b}=await a;return(0,d.jsx)(e.ReviewPage,{reviewId:b})}},45354:(a,b,c)=>{"use strict";c.d(b,{ReviewIdentitySettings:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({identity:a}){let{t:b}=(0,f.Bd)(),[c,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(""),k=(0,e.useRef)(null),l=()=>{let b=i.trim();b&&b!==a.name&&a.confirmName(b),h(!1)};return(0,d.jsxs)("div",{className:"relative",ref:k,children:[(0,d.jsxs)("button",{onClick:()=>{c||j(a.name),h(!c)},className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors flex items-center gap-1",title:b("review.identitySettings"),children:[(0,d.jsx)("span",{className:"w-5 h-5 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[10px] font-bold",children:a.name.charAt(0)}),(0,d.jsx)("span",{className:"text-muted-foreground",children:a.name})]}),c&&(0,d.jsxs)("div",{className:"absolute right-0 top-full mt-1 w-56 bg-card border border-border rounded-lg shadow-lg p-3 z-50",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:b("review.reviewNickname")}),(0,d.jsx)("input",{type:"text",value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.nativeEvent.isComposing||l()},className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded focus:outline-none focus:border-brand",autoFocus:!0}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,d.jsx)("button",{onClick:()=>{a.randomize(),h(!1)},className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("review.random")}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("button",{onClick:()=>h(!1),className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("common.cancel")}),(0,d.jsx)("button",{onClick:l,className:"px-2 py-1 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors",children:b("common.save")})]})]})]})}},55511:a=>{"use strict";a.exports=require("crypto")},61169:(a,b,c)=>{"use strict";c.d(b,{useReviewIdentity:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call useReviewIdentity() from the server but useReviewIdentity is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/hooks/useReviewIdentity.ts","useReviewIdentity")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63324:(a,b,c)=>{"use strict";c.d(b,{u:()=>g});var d=c(48249);c(67484);let e={bg:"rgba(234, 179, 8, 0.15)",bgActive:"rgba(234, 179, 8, 0.4)",bgPending:"rgba(234, 179, 8, 0.3)",border:"rgba(234, 179, 8, 0.7)",borderPending:"rgba(234, 179, 8, 0.9)"},f={bg:"rgba(234, 179, 8, 0.1)",bgActive:"rgba(234, 179, 8, 0.3)",bgPending:"rgba(234, 179, 8, 0.2)",border:"rgba(234, 179, 8, 0.5)",borderPending:"rgba(234, 179, 8, 0.7)"};function g({rects:a,activeCommentId:b,pendingCommentId:c,isDark:h}){if(0===a.length)return null;let i=h?f:e;return(0,d.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:0,overflow:"visible",pointerEvents:"none",zIndex:5},children:a.map((a,e)=>{let f=a.commentId===b,g=a.commentId===c,h=i.bg;return g?h=i.bgPending:f&&(h=i.bgActive),(0,d.jsx)("div",{"data-comment-id":a.commentId,style:{position:"absolute",top:a.top,left:a.left,width:a.width,height:a.height,backgroundColor:h,borderBottom:`1px solid ${g?i.borderPending:i.border}`,borderRadius:1,pointerEvents:"none"}},`${a.commentId}-${e}`)})})}},63376:(a,b,c)=>{"use strict";c.d(b,{ReviewCommentsListModal:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ReviewCommentsListModal() from the server but ReviewCommentsListModal is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ReviewCommentsListModal.tsx","ReviewCommentsListModal")},67134:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{ReviewPage:()=>r});var e=c(48249),f=c(67484),g=c(44384),h=c(16708),i=c(5993),j=c(45354),k=c(94481),l=c(76788),m=c(61130),n=c(79758),o=c(83768),p=c(7833),q=a([h,m]);function r({reviewId:a}){let{t:b}=(0,g.Bd)(),[c,d]=(0,f.useState)(a),[q,s]=(0,f.useState)(null),[t,u]=(0,f.useState)(!0),[v,w]=(0,f.useState)(null),[x,y]=(0,f.useState)(null),[z,A]=(0,f.useState)(!1),B=(0,n.useReviewIdentity)(),{resolvedTheme:C,setTheme:D}=(0,o.D)(),[E,F]=(0,f.useState)({}),[G,H]=(0,f.useState)(!1),[I,J]=(0,f.useState)(!1),K=(0,f.useCallback)(async()=>{try{let a=await fetch("/api/review/users");if(a.ok){let b=await a.json(),c={};for(let[a,d]of Object.entries(b.users))c[a]=d.name;F(c)}}catch{}},[]),L=(0,f.useRef)(void 0),M=(0,f.useRef)(void 0),N=(0,f.useCallback)(a=>{a!==c&&(d(a),w(null),y(null),window.history.replaceState(null,"",`/review/${a}`))},[c]),O=(0,f.useCallback)(async()=>{try{let a=await fetch(`/api/review/${c}`);if(!a.ok)return void(404===a.status?w(b("review.reviewNotExist")):w(b("review.loadFailed")));let d=await a.json();s(d.review),w(null)}catch{w(b("review.networkError"))}finally{u(!1)}},[c]),P=(0,f.useCallback)(async(a,d)=>{if(B.authorId)try{(await fetch(`/api/review/${c}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({author:B.name,authorId:B.authorId,content:a,anchor:d})})).ok&&await O()}catch{(0,p.oR)(b("toast.addCommentFailed"),"error")}},[c,B,O]),Q=(0,f.useCallback)(async a=>{try{(await fetch(`/api/review/${c}/comments?commentId=${a}`,{method:"DELETE"})).ok&&await O()}catch{(0,p.oR)(b("toast.deleteCommentFailed"),"error")}},[c,O]),R=(0,f.useCallback)(async(a,d)=>{try{(await fetch(`/api/review/${c}/comments`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({commentId:a,content:d})})).ok&&await O()}catch{(0,p.oR)(b("toast.editCommentFailed"),"error")}},[c,O]),S=(0,f.useCallback)(async(a,d)=>{try{(await fetch(`/api/review/${c}/comments`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({commentId:a,closed:d})})).ok&&await O()}catch{(0,p.oR)(b("toast.operationFailed"),"error")}},[c,O,b]),T=(0,f.useCallback)(async(a,d)=>{if(B.authorId)try{(await fetch(`/api/review/${c}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commentId:a,author:B.name,authorId:B.authorId,content:d})})).ok&&await O()}catch{(0,p.oR)(b("toast.addReplyFailed"),"error")}},[c,B,O]),U=(0,f.useCallback)(async(a,d)=>{try{(await fetch(`/api/review/${c}/replies?commentId=${a}&replyId=${d}`,{method:"DELETE"})).ok&&await O()}catch{(0,p.oR)(b("toast.deleteReplyFailed"),"error")}},[c,O]),V=(0,f.useCallback)(async(a,d,e)=>{try{(await fetch(`/api/review/${c}/replies`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({commentId:a,replyId:d,content:e})})).ok&&await O()}catch{(0,p.oR)(b("toast.editReplyFailed"),"error")}},[c,O]),W=(0,f.useCallback)(async()=>{try{let a=await fetch("/api/review/share-info"),d=await a.json(),e=d.shareBase?`${d.shareBase}/review/${c}`:window.location.href;await navigator.clipboard.writeText(e),(0,p.oR)(b("toast.linkCopied"),"success")}catch{(0,p.oR)(b("toast.copyFailed"),"error")}},[c]),X=(0,f.useCallback)(a=>{y(a),M.current?.(a)},[]),Y=(0,f.useCallback)(a=>{y(a),L.current?.(a)},[]),Z=(0,f.useCallback)(a=>{let b;if(!q||0===q.comments.length)return;let c=[...q.comments].sort((a,b)=>a.anchor.startOffset-b.anchor.startOffset),d=x?c.findIndex(a=>a.id===x):-1;b="next"===a?d<c.length-1?d+1:0:d>0?d-1:c.length-1;let e=c[b];y(e.id),M.current?.(e.id),L.current?.(e.id)},[q,x]);return(0,e.jsxs)("div",{className:"h-screen flex flex-col bg-background text-foreground overflow-hidden",children:[G&&(0,e.jsx)(l._,{currentName:B.name,onConfirm:a=>{B.confirmName(a),H(!1),K()},onSkip:()=>H(!1)}),q&&(0,e.jsx)(m.ReviewCommentsListModal,{isOpen:I,onClose:()=>J(!1),comments:q.comments,reviewTitle:q.title,userNameMap:E,onCommentClick:a=>{y(a),M.current?.(a),L.current?.(a)}}),q&&(0,e.jsx)("div",{className:"py-2 bg-secondary border-b border-border flex-shrink-0 flex justify-center",children:(0,e.jsxs)("div",{className:"w-full max-w-[1800px] px-4 flex items-center gap-3",children:[(0,e.jsx)("h1",{className:"text-sm font-semibold truncate",children:q.title}),(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground flex-shrink-0",children:b("review.updatedAt",{date:new Date(q.updatedAt||q.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})}),(0,e.jsx)("span",{className:"flex-1"}),!z&&(0,e.jsx)("span",{className:`px-2 py-0.5 text-xs rounded-full ${q.active?"bg-green-500/15 text-green-600 dark:text-green-400":"bg-muted text-muted-foreground"}`,children:q.active?b("review.active"):b("review.closed")}),(0,e.jsxs)("button",{onClick:()=>J(!0),className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground flex items-center gap-1",title:b("review.viewAllComments"),children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,e.jsx)("path",{d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})}),b("review.viewCommentBtn")]}),(0,e.jsx)("button",{onClick:W,className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("review.copyLink")}),(0,e.jsx)("button",{onClick:()=>D("dark"===C?"light":"dark"),className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:"dark"===C?b("settings.switchLight"):b("settings.switchDark"),children:"dark"===C?(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,e.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),(0,e.jsx)("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),(0,e.jsx)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),(0,e.jsx)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),(0,e.jsx)("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),(0,e.jsx)("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),(0,e.jsx)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),(0,e.jsx)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,e.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}),(0,e.jsx)(j.ReviewIdentitySettings,{identity:B})]})}),(0,e.jsx)("div",{className:"flex-1 flex justify-center overflow-hidden",children:(0,e.jsxs)("div",{className:"w-full max-w-[1800px] flex overflow-hidden",children:[(0,e.jsx)(k.ReviewListPanel,{currentReviewId:c,onSelect:N,readOnly:!z,refreshTrigger:q?.comments.length,onViewComments:a=>{a!==c&&N(a),J(!0)}}),t?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("div",{className:"text-muted-foreground",children:b("common.loading")})}):v||!q?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("div",{className:"text-xl mb-2",children:v||b("review.reviewNotFound")}),(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:b("review.checkLink")})]})}):(0,e.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,e.jsx)("div",{className:"flex-1 h-full border-r border-border overflow-hidden",children:(0,e.jsx)(h.W,{content:q.content,comments:q.comments,activeCommentId:x,isActive:q.active,onAddComment:P,onHighlightClick:Y,scrollToHighlightRef:M})}),(0,e.jsx)("div",{className:"w-[360px] h-full overflow-hidden flex-shrink-0",children:(0,e.jsx)(i.Q,{comments:q.comments,activeCommentId:x,currentAuthorId:B.authorId,isActive:q.active,isAdmin:z,userNameMap:E,onCommentClick:X,onNavigateComment:Z,onDeleteComment:Q,onEditComment:R,onToggleCommentClosed:S,onAddReply:T,onDeleteReply:U,onEditReply:V,scrollToCommentRef:L})})]})]})})]})}[h,m]=q.then?(await q)():q,d()}catch(a){d(a)}})},70722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},73136:a=>{"use strict";a.exports=require("node:url")},73370:(a,b,c)=>{"use strict";c.d(b,{useReviewHighlights:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call useReviewHighlights() from the server but useReviewHighlights is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/hooks/useReviewHighlights.ts","useReviewHighlights")},74824:(a,b,c)=>{"use strict";c.d(b,{ShareReviewToggle:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ShareReviewToggle() from the server but ShareReviewToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ShareReviewToggle.tsx","ShareReviewToggle")},76760:a=>{"use strict";a.exports=require("node:path")},76788:(a,b,c)=>{"use strict";c.d(b,{_:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({currentName:a,onConfirm:b,onSkip:c}){let{t:h}=(0,f.Bd)(),[i,j]=(0,e.useState)(a),k=(0,e.useRef)(null),l=()=>{let a=i.trim();a&&b(a)};return(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,d.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-2xl w-80 p-5",children:[(0,d.jsx)("h2",{className:"text-base font-semibold mb-1",children:h("review.setNickname")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:h("review.nicknameHint")}),(0,d.jsx)("input",{ref:k,type:"text",value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.nativeEvent.isComposing||l(),"Escape"===a.key&&c()},placeholder:h("review.nicknamePlaceholder"),maxLength:20,className:"w-full px-3 py-2 text-sm bg-secondary border border-border rounded-lg focus:outline-none focus:border-brand",autoFocus:!0}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2 mt-4",children:[(0,d.jsx)("button",{onClick:c,className:"px-3 py-1.5 text-xs rounded-lg hover:bg-accent transition-colors text-muted-foreground",children:h("review.skipForNow")}),(0,d.jsx)("button",{onClick:l,disabled:!i.trim(),className:"px-4 py-1.5 text-xs rounded-lg bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:h("common.save")})]})]})})}},77068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},78908:a=>{"use strict";a.exports=import("shiki")},79758:(a,b,c)=>{"use strict";c.d(b,{useReviewIdentity:()=>f});var d=c(67484);c(55511);var e=c(208);function f(){let[a,b]=(0,d.useState)(""),[c,f]=(0,d.useState)(""),[g,h]=(0,d.useState)(!1),[i,j]=(0,d.useState)(!0),k=(0,d.useCallback)(a=>{let b=a.trim();b&&(f(b),h(!0),fetch("/api/review/identify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}).catch(()=>{}))},[]);return{authorId:a,name:c,nameConfirmed:g,loading:i,setName:(0,d.useCallback)(a=>{let b=a.trim();b&&(f(b),fetch("/api/review/identify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}).catch(()=>{}))},[]),confirmName:k,randomize:(0,d.useCallback)(()=>{let a,b,c,d;f((a=e.A.t("reviewUtils.adjectives",{returnObjects:!0}),b=e.A.t("reviewUtils.nouns",{returnObjects:!0}),c=a[Math.floor(Math.random()*a.length)],d=b[Math.floor(Math.random()*b.length)],`${c}${d}`))},[])}}},84226:(a,b,c)=>{"use strict";c.d(b,{X:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({selectedText:a,position:b,onSubmit:c,onCancel:h}){let{t:i}=(0,f.Bd)(),[j,k]=(0,e.useState)(""),l=(0,e.useRef)(null),m=(0,e.useRef)(null),n=()=>{let a=j.trim();a&&c(a)},o=a.length>60?a.slice(0,57)+"...":a;return(0,d.jsxs)("div",{ref:m,className:"absolute z-50 w-96 bg-card border border-border rounded-lg shadow-lg",style:{top:b.top,left:Math.max(8,b.left-192)},children:[(0,d.jsxs)("div",{className:"px-3 pt-3 pb-2",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground mb-1",children:i("review.selectedText")}),(0,d.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r truncate",children:o})]}),(0,d.jsx)("div",{className:"px-3 pb-2",children:(0,d.jsx)("textarea",{ref:l,value:j,onChange:a=>k(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||(a.preventDefault(),n())},placeholder:i("review.addCommentPlaceholder"),className:"w-full px-2 py-1.5 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:4})}),(0,d.jsxs)("div",{className:"px-3 pb-3 flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:i("review.enterSubmitHint")}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)("button",{onClick:h,className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:i("common.cancel")}),(0,d.jsx)("button",{onClick:n,disabled:!j.trim(),className:"px-2 py-1 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:i("review.commentBtn")})]})]})]})}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94481:(a,b,c)=>{"use strict";c.d(b,{ReviewListPanel:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({currentReviewId:a,onSelect:b,readOnly:c,refreshTrigger:h,onViewComments:i}){let{t:j}=(0,f.Bd)(),[k,l]=(0,e.useState)([]),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=(0,e.useRef)(null),[v,w]=(0,e.useState)(null);(0,e.useCallback)(async()=>{try{let a=await fetch("/api/review");if(a.ok){let b=await a.json();l(b.reviews||[])}}catch{}},[]);let x=(0,e.useCallback)(async(a,b,c)=>{if(a.stopPropagation(),!o){p(b);try{(await fetch(`/api/review/${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({active:!c})})).ok&&l(a=>a.map(a=>a.id===b?{...a,active:!c}:a))}catch{}p(null)}},[o]),y=(0,e.useCallback)(async(c,d)=>{if(c.stopPropagation(),!m){n(d);try{if((await fetch(`/api/review/${d}`,{method:"DELETE"})).ok&&(l(a=>a.filter(a=>a.id!==d)),d===a)){let a=k.filter(a=>a.id!==d);a.length>0&&b(a[0].id)}}catch{}n(null)}},[m,a,k,b]),z=(0,e.useCallback)((a,b)=>{u.current=b,a.dataTransfer.effectAllowed="move";let c=a.currentTarget;requestAnimationFrame(()=>c.classList.add("opacity-30"))},[]),A=(0,e.useCallback)(a=>{u.current=null,w(null),a.currentTarget instanceof HTMLElement&&a.currentTarget.classList.remove("opacity-30")},[]),B=(0,e.useCallback)((a,b)=>{a.preventDefault(),a.dataTransfer.dropEffect="move",u.current&&u.current!==b&&w(b)},[]),C=(0,e.useCallback)(async(a,b)=>{a.preventDefault(),w(null);let c=u.current;u.current=null,c&&c!==b&&l(a=>{let d=[...a],e=d.findIndex(a=>a.id===c),f=d.findIndex(a=>a.id===b);if(-1===e||-1===f)return a;let[g]=d.splice(e,1);return d.splice(f,0,g),fetch("/api/review/order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:d.map(a=>a.id)})}).catch(()=>{}),d})},[]),D=c?k.filter(a=>a.active):k,E=!c;return q?(0,d.jsxs)("div",{className:"h-full flex flex-col items-center bg-secondary/50 w-9 flex-shrink-0 border-r border-border",children:[(0,d.jsx)("button",{onClick:()=>r(!1),className:"p-1.5 mt-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:j("review.expandList"),children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"9 18 15 12 9 6"})})}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground/50 mt-2",style:{writingMode:"vertical-rl"},children:c?j("review.nDocs",{count:D.length}):j("review.nReviews",{count:D.length})})]}):(0,d.jsxs)("div",{className:"h-full flex flex-col bg-secondary/50 w-[200px] flex-shrink-0 border-r border-border",children:[(0,d.jsxs)("div",{className:"px-3 py-2 border-b border-border flex-shrink-0 flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:c?j("review.docList"):j("review.allReviewsList")}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 ml-1.5",children:D.length})]}),(0,d.jsx)("button",{onClick:()=>r(!0),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:j("review.collapseList"),children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"15 18 9 12 15 6"})})})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[D.map(e=>(0,d.jsxs)("div",{draggable:E,onDragStart:E?a=>z(a,e.id):void 0,onDragEnd:E?A:void 0,onDragOver:E?a=>B(a,e.id):void 0,onDrop:E?a=>C(a,e.id):void 0,onMouseEnter:a=>{let b=a.currentTarget.getBoundingClientRect();t({id:e.id,text:e.title,top:b.top+b.height/2,left:b.right})},onMouseLeave:()=>t(a=>a?.id===e.id?null:a),onClick:()=>b(e.id),className:`group px-3 py-2 cursor-pointer border-b transition-colors ${v===e.id?"border-b-brand border-t border-t-transparent":"border-b-border/50"} ${e.id===a?"bg-accent/60":"hover:bg-accent/30"}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[!c&&(0,d.jsx)("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${e.active?"bg-green-500":"bg-muted-foreground/40"}`}),(0,d.jsx)("span",{className:"text-xs truncate flex-1",children:e.title}),e.commentCount>0&&i&&(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),i(e.id)},className:"flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-brand hover:!bg-brand/10 transition-colors",title:j("review.viewComments"),children:(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})})}),!c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:a=>x(a,e.id,e.active),className:`flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-foreground hover:!bg-accent transition-colors ${o===e.id?"opacity-50 pointer-events-none":""}`,title:e.active?j("review.closeReview"):j("review.reopenReview"),children:e.active?(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),(0,d.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}):(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M18.36 6.64A9 9 0 0 1 12 21 9 9 0 0 1 5.64 6.64"}),(0,d.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]})}),(0,d.jsx)("button",{onClick:a=>y(a,e.id),className:`flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-red-500 hover:!bg-red-500/10 transition-colors ${m===e.id?"opacity-50 pointer-events-none":""}`,title:j("review.deleteReview"),children:(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,d.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),e.commentCount>0&&(0,d.jsx)("div",{className:`text-[10px] text-muted-foreground/50 mt-0.5 ${c?"":"pl-3"}`,children:j("review.nComments",{count:e.commentCount})})]},e.id)),0===D.length&&(0,d.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground/50 text-center",children:c?j("review.noOpenDocs"):j("review.noReviews")})]}),s&&(0,d.jsx)("div",{className:"fixed z-50 px-2 py-1 text-xs bg-popover text-popover-foreground border border-border rounded shadow-md whitespace-nowrap pointer-events-none",style:{top:s.top,left:s.left+8,transform:"translateY(-50%)"},children:s.text})]})}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,8465,554,9658],()=>b(b.s=6189));module.exports=c})();
|
|
2
|
+
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:u.CachedRouteKind.APP_PAGE,html:l,headers:q,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},r=async({hasResolved:c,previousCacheEntry:g,isRevalidating:i,span:j,forceStaticRender:k=!1})=>{let l=!1===N.isDev,m=c||b.writableEnded;try{let f;if(ap&&ah&&!g&&!T)return(null==ai?void 0:ai.render404)?await ai.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(ar&&(f=(0,v.parseFallbackField)(ar.fallback)),!0===aj.experimental.partialFallbacks&&(null==ar?void 0:ar.fallback)===null&&!aR&&aQ.length>0&&(f=v.FallbackMode.PRERENDER),f===v.FallbackMode.PRERENDER&&(0,t.isBot)(at)&&(!aD||av)&&(f=v.FallbackMode.BLOCKING_STATIC_RENDER),(null==g?void 0:g.isStale)===-1&&(ap=!0),ap&&(f!==v.FallbackMode.NOT_FOUND||g)&&(f=v.FallbackMode.BLOCKING_STATIC_RENDER),!T&&f!==v.FallbackMode.BLOCKING_STATIC_RENDER&&aT&&!m&&!af&&Z&&(l||!as)){if((l||ar)&&f===v.FallbackMode.NOT_FOUND){if(aj.adapterPath)return await a$();throw new B.NoFallbackError}if(aD&&(aj.cacheComponents?!aJ:!ax)){let b=l&&"string"==typeof(null==ar?void 0:ar.fallback)?ar.fallback:ao,f=(l||aE)&&(null==ar?void 0:ar.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams):aG?(0,n.getFallbackRouteParams)(ao,N):null;aE&&f&&(0,h.addRequestMeta)(a,"fallbackParams",f);let g=await N.handleResponse({cacheKey:b,req:a,nextConfig:aj,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:ae,isRoutePPREnabled:aD,responseGenerator:async()=>q({span:j,postponed:void 0,fallbackRouteParams:f,forceStaticRender:!0}),waitUntil:d.waitUntil,isMinimalMode:T});if(null===g)return null;if(g)return T||!aD||!(aQ.length>0)||!0!==aj.experimental.partialFallbacks||!aS||!p||ap||aG||aB||aC||aw||(0,H.scheduleOnNextTick)(async()=>{let b=N.getResponseCache(a);try{await b.revalidate(aS,p,aD,!1,a=>q({span:a.span,postponed:void 0,fallbackRouteParams:aZ.length>0?(0,n.createOpaqueFallbackRouteParams)(aZ):null,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}),delete g.cacheControl,g}}let o=ap||i||!aH?void 0:aH;if(aN&&!T&&p&&(aJ||ay)&&!k){let b=await p.get(ag,{kind:u.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===u.CachedRouteKind.APP_PAGE&&(o=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,H.scheduleOnNextTick)(async()=>{let b=N.getResponseCache(a);try{await b.revalidate(ag,p,aD,!1,a=>r({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if((aE||aF)&&void 0!==o)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:u.CachedRouteKind.PAGES,html:w.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let s=(l&&(0,h.getRequestMeta)(a,"renderFallbackShell")||aE&&!as)&&(null==ar?void 0:ar.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams):aG?(0,n.getFallbackRouteParams)(ao,N):null;if((l||aE)&&aj.cacheComponents&&!as&&(null==ar?void 0:ar.fallbackRouteParams)){let b=(0,n.createOpaqueFallbackRouteParams)(ar.fallbackRouteParams);b&&(0,h.addRequestMeta)(a,"fallbackParams",b)}return q({span:j,postponed:o,fallbackRouteParams:s,forceStaticRender:k})}catch(b){throw(null==g?void 0:g.isStale)&&await N.onRequestError(a,b,{routerKind:"App Router",routePath:U,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aM,isOnDemandRevalidate:ap})},!1,ai),b}},D=async c=>{var f,g,i,j,k;let l,m=await N.handleResponse({cacheKey:aS,responseGenerator:a=>r({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ap,isRoutePPREnabled:aD,req:a,nextConfig:aj,prerenderManifest:ae,waitUntil:d.waitUntil,isMinimalMode:T});if(af&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),N.isDev&&b.setHeader("Cache-Control","no-cache, must-revalidate"),!m){if(aS)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=m.value)?void 0:f.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=m.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let n="string"==typeof m.value.postponed;ax&&!ay&&am&&b.setHeader(x.NEXT_NAV_DEPLOYMENT_ID_HEADER,am),aM&&!aJ&&(!n||aw)&&(T||b.setHeader("x-nextjs-cache",ap?"REVALIDATED":m.isMiss?"MISS":m.isStale?"STALE":"HIT"),b.setHeader(s.NEXT_IS_PRERENDER_HEADER,"1"));let{value:o}=m;if(aH)l={revalidate:0,expire:void 0};else if(aJ)l={revalidate:0,expire:void 0};else if(!N.isDev)if(af)l={revalidate:0,expire:void 0};else if(aM){if(m.cacheControl)if("number"==typeof m.cacheControl.revalidate){if(m.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${m.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:m.cacheControl.revalidate,expire:(null==(j=m.cacheControl)?void 0:j.expire)??aj.expireTime}}else l={revalidate:x.CACHE_ONE_YEAR_SECONDS,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(m.cacheControl=l,"string"==typeof aK&&(null==o?void 0:o.kind)===u.CachedRouteKind.APP_PAGE&&o.segmentData){b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=o.headers)?void 0:k[x.NEXT_CACHE_TAGS_HEADER];T&&aM&&c&&"string"==typeof c&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,c);let d=o.segmentData.get(aK);return void 0!==d?(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.fromStatic(d,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl}):(b.statusCode=204,(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl}))}let p=aN?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(p&&await p(m,{url:(0,h.getRequestMeta)(a,"initURL")??a.url}))return null;if(o.headers){let a={...o.headers};for(let[c,d]of(T&&aM||delete a[x.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let t=null==(g=o.headers)?void 0:g[x.NEXT_CACHE_TAGS_HEADER];if(T&&aM&&t&&"string"==typeof t&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,t),!o.status||ax&&aD||(b.statusCode=o.status),!T&&o.status&&F.RedirectStatusCode[o.status]&&ax&&(b.statusCode=200),n&&!aJ&&b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"1"),ax&&!af){if(void 0===o.rscData){if(o.html.contentType!==s.RSC_CONTENT_TYPE_HEADER)if(aj.cacheComponents)return b.statusCode=404,(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl});else throw Object.defineProperty(new G.InvariantError(`Expected RSC response, got ${o.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:o.html,cacheControl:m.cacheControl})}return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:w.default.fromStatic(o.rscData,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl})}let v=o.html;if(aC&&aE){let c=!0===N.isDev?crypto.randomUUID():null;return v.pipeThrough((0,z.createInstantTestScriptInsertionTransformStream)(c)),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})}if(!n||T||ax)return(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:m.cacheControl});if(aE||aF)return v.push(new ReadableStream({start(a){a.enqueue(y.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}});let B=new TransformStream;return v.push(B.readable),q({span:c,postponed:o.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(B.writable)}).catch(a=>{B.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,A.sendRenderResult)({req:a,res:b,generateEtags:aj.generateEtags,poweredByHeader:aj.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})};if(!aY||!aX)return k=aW.getActiveScopeSpan(),await aW.withPropagatedContext(a.headers,()=>aW.trace(i.BaseServerSpan.handleRequest,{spanName:`${aV} ${U}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aV,"http.target":a.url}},D),void 0,!aY);await D(aX)}catch(b){throw b instanceof B.NoFallbackError||await N.onRequestError(a,b,{routerKind:"App Router",routePath:U,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aM,isOnDemandRevalidate:ap})},!1,ai),b}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12629:a=>{"use strict";a.exports=import("web-tree-sitter")},16708:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{W:()=>n});var e=c(48249),f=c(67484),g=c(87844),h=c(24680),i=c(83768),j=c(84835),k=c(84226),l=c(63324),m=c(26188);let a=[j.W];function n({content:b,comments:c,activeCommentId:d,isActive:j,onAddComment:o,onHighlightClick:p,scrollToHighlightRef:q}){let{resolvedTheme:r}=(0,i.D)(),s=(0,f.useRef)(null),t=(0,f.useRef)(null),[u,v]=(0,f.useState)(null),w=(0,f.useMemo)(()=>u?[...c,{id:"__pending__",author:"",authorId:"",content:"",anchor:u.anchor,createdAt:0,replies:[]}]:c,[c,u]),{rects:x,scrollToHighlight:y}=(0,m.useReviewHighlights)(s,t,w,d),z=(0,f.useRef)(x),A=(0,f.useCallback)(a=>{let b=window.getSelection(),c=b&&!b.isCollapsed;if(c&&j&&s.current){let c=b.getRangeAt(0);if(s.current.contains(c.startContainer)&&s.current.contains(c.endContainer)){let d=function(a,b){let c=document.createTreeWalker(a,NodeFilter.SHOW_TEXT),d=0,e=-1,f=-1;for(;c.nextNode();){let a=c.currentNode,g=a.textContent?.length||0;if(a===b.startContainer&&(e=d+b.startOffset),a===b.endContainer){f=d+b.endOffset;break}d+=g}if(-1===e||-1===f||e>=f)return null;let g=a.textContent?.slice(e,f)||"";return g.trim()?{startOffset:e,endOffset:f,selectedText:g}:null}(s.current,c);if(d){let c=t.current??s.current.parentElement,e=c.getBoundingClientRect();v({anchor:d,position:{top:a.clientY-e.top+c.scrollTop+8,left:a.clientX-e.left}}),b.removeAllRanges();return}}}if(!c&&!u){let b=t.current;if(!b)return;let c=b.getBoundingClientRect(),d=a.clientX-c.left+b.scrollLeft,e=a.clientY-c.top+b.scrollTop;for(let a of z.current)if("__pending__"!==a.commentId&&d>=a.left&&d<=a.left+a.width&&e>=a.top&&e<=a.top+a.height)return void p(a.commentId)}},[j,u,p]),B=(0,f.useCallback)(a=>{u&&(o(a,u.anchor),v(null),window.getSelection()?.removeAllRanges())},[u,o]),C=(0,f.useCallback)(()=>{v(null),window.getSelection()?.removeAllRanges()},[]);return(0,e.jsxs)("div",{className:"h-full flex bg-card",children:[(0,e.jsx)(h.l,{content:b,containerRef:t}),(0,e.jsxs)("div",{ref:t,className:"flex-1 overflow-auto relative",onMouseUp:A,children:[(0,e.jsx)("div",{ref:s,className:"p-6 review-markdown-container",children:(0,e.jsx)(g.T,{content:b,rehypePlugins:a})}),(0,e.jsx)(l.u,{rects:x,activeCommentId:d,pendingCommentId:u?"__pending__":null,isDark:"dark"===r}),u&&(0,e.jsx)(k.X,{selectedText:u.anchor.selectedText,position:u.position,onSubmit:B,onCancel:C})]})]})}d()}catch(a){d(a)}})},17891:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/get-segment-param")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20975:(a,b,c)=>{"use strict";c.d(b,{ReviewListPanel:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ReviewListPanel() from the server but ReviewListPanel is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ReviewListPanel.tsx","ReviewListPanel")},26188:(a,b,c)=>{"use strict";c.d(b,{useReviewHighlights:()=>e});var d=c(67484);function e(a,b,c,e){let[f,g]=(0,d.useState)([]),h=(0,d.useRef)(0),i=(0,d.useRef)(c);(0,d.useCallback)(()=>{h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{let c=a.current,d=b.current;if(!c||!d)return;let e=function(a,b,c){let d=[],e=b.getBoundingClientRect(),f=function(a){let b=[],c=document.createTreeWalker(a,NodeFilter.SHOW_TEXT),d=0;for(;c.nextNode();){let a=c.currentNode,e=a.textContent?.length||0;b.push({node:a,start:d,end:d+e}),d+=e}return b}(a);if(0===f.length)return d;for(let a of c){let{startOffset:c,endOffset:g}=a.anchor;if(c>=g)continue;let h=null,i=0,j=null,k=0;for(let{node:a,start:b,end:d}of f)if(!h&&c>=b&&c<d&&(h=a,i=c-b),g>b&&g<=d){j=a,k=g-b;break}if(!h||!j)continue;let l=document.createRange();try{l.setStart(h,i),l.setEnd(j,k)}catch{continue}for(let c of l.getClientRects())c.width<1||c.height<1||d.push({commentId:a.id,top:c.top-e.top+b.scrollTop,left:c.left-e.left+b.scrollLeft,width:c.width,height:c.height})}return d}(c,d,i.current);g(a=>a.length===e.length&&a.every((a,b)=>a.commentId===e[b].commentId&&.5>Math.abs(a.top-e[b].top)&&.5>Math.abs(a.left-e[b].left)&&.5>Math.abs(a.width-e[b].width)&&.5>Math.abs(a.height-e[b].height))?a:e)})},[a,b]);let j=(0,d.useCallback)(a=>{let c=b.current;if(!c)return;let d=f.find(b=>b.commentId===a);if(!d)return;let e=c.clientHeight;c.scrollTo({top:d.top-e/2+d.height/2,behavior:"smooth"})},[b,f]);return{rects:f,scrollToHighlight:j}}},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},28354:a=>{"use strict";a.exports=require("util")},28820:(a,b,c)=>{"use strict";c.d(b,{ReviewPage:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ReviewPage() from the server but ReviewPage is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ReviewPage.tsx","ReviewPage")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29657:(a,b,c)=>{Promise.resolve().then(c.bind(c,26188)),Promise.resolve().then(c.bind(c,79758)),Promise.resolve().then(c.bind(c,61130)),Promise.resolve().then(c.bind(c,12568)),Promise.resolve().then(c.bind(c,45354)),Promise.resolve().then(c.bind(c,94481)),Promise.resolve().then(c.bind(c,67134)),Promise.resolve().then(c.bind(c,47846))},33873:a=>{"use strict";a.exports=require("path")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},42681:(a,b,c)=>{Promise.resolve().then(c.bind(c,73370)),Promise.resolve().then(c.bind(c,61169)),Promise.resolve().then(c.bind(c,63376)),Promise.resolve().then(c.bind(c,1134)),Promise.resolve().then(c.bind(c,42784)),Promise.resolve().then(c.bind(c,20975)),Promise.resolve().then(c.bind(c,28820)),Promise.resolve().then(c.bind(c,74824))},42784:(a,b,c)=>{"use strict";c.d(b,{ReviewIdentitySettings:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ReviewIdentitySettings() from the server but ReviewIdentitySettings is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ReviewIdentitySettings.tsx","ReviewIdentitySettings")},43954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},44236:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h,dynamic:()=>f,generateMetadata:()=>g});var d=c(5735),e=c(28820);let f="force-dynamic";async function g({params:a}){let{id:b}=await a;return{title:`Review - ${b}`}}async function h({params:a}){let{id:b}=await a;return(0,d.jsx)(e.ReviewPage,{reviewId:b})}},45354:(a,b,c)=>{"use strict";c.d(b,{ReviewIdentitySettings:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({identity:a}){let{t:b}=(0,f.Bd)(),[c,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(""),k=(0,e.useRef)(null),l=()=>{let b=i.trim();b&&b!==a.name&&a.confirmName(b),h(!1)};return(0,d.jsxs)("div",{className:"relative",ref:k,children:[(0,d.jsxs)("button",{onClick:()=>{c||j(a.name),h(!c)},className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors flex items-center gap-1",title:b("review.identitySettings"),children:[(0,d.jsx)("span",{className:"w-5 h-5 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[10px] font-bold",children:a.name.charAt(0)}),(0,d.jsx)("span",{className:"text-muted-foreground",children:a.name})]}),c&&(0,d.jsxs)("div",{className:"absolute right-0 top-full mt-1 w-56 bg-card border border-border rounded-lg shadow-lg p-3 z-50",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:b("review.reviewNickname")}),(0,d.jsx)("input",{type:"text",value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.nativeEvent.isComposing||l()},className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded focus:outline-none focus:border-brand",autoFocus:!0}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,d.jsx)("button",{onClick:()=>{a.randomize(),h(!1)},className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("review.random")}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("button",{onClick:()=>h(!1),className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("common.cancel")}),(0,d.jsx)("button",{onClick:l,className:"px-2 py-1 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors",children:b("common.save")})]})]})]})}},55511:a=>{"use strict";a.exports=require("crypto")},61169:(a,b,c)=>{"use strict";c.d(b,{useReviewIdentity:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call useReviewIdentity() from the server but useReviewIdentity is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/hooks/useReviewIdentity.ts","useReviewIdentity")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63324:(a,b,c)=>{"use strict";c.d(b,{u:()=>g});var d=c(48249);c(67484);let e={bg:"rgba(234, 179, 8, 0.15)",bgActive:"rgba(234, 179, 8, 0.4)",bgPending:"rgba(234, 179, 8, 0.3)",border:"rgba(234, 179, 8, 0.7)",borderPending:"rgba(234, 179, 8, 0.9)"},f={bg:"rgba(234, 179, 8, 0.1)",bgActive:"rgba(234, 179, 8, 0.3)",bgPending:"rgba(234, 179, 8, 0.2)",border:"rgba(234, 179, 8, 0.5)",borderPending:"rgba(234, 179, 8, 0.7)"};function g({rects:a,activeCommentId:b,pendingCommentId:c,isDark:h}){if(0===a.length)return null;let i=h?f:e;return(0,d.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:0,overflow:"visible",pointerEvents:"none",zIndex:5},children:a.map((a,e)=>{let f=a.commentId===b,g=a.commentId===c,h=i.bg;return g?h=i.bgPending:f&&(h=i.bgActive),(0,d.jsx)("div",{"data-comment-id":a.commentId,style:{position:"absolute",top:a.top,left:a.left,width:a.width,height:a.height,backgroundColor:h,borderBottom:`1px solid ${g?i.borderPending:i.border}`,borderRadius:1,pointerEvents:"none"}},`${a.commentId}-${e}`)})})}},63376:(a,b,c)=>{"use strict";c.d(b,{ReviewCommentsListModal:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ReviewCommentsListModal() from the server but ReviewCommentsListModal is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ReviewCommentsListModal.tsx","ReviewCommentsListModal")},67134:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{ReviewPage:()=>r});var e=c(48249),f=c(67484),g=c(44384),h=c(16708),i=c(5993),j=c(45354),k=c(94481),l=c(76788),m=c(61130),n=c(79758),o=c(83768),p=c(7833),q=a([h,m]);function r({reviewId:a}){let{t:b}=(0,g.Bd)(),[c,d]=(0,f.useState)(a),[q,s]=(0,f.useState)(null),[t,u]=(0,f.useState)(!0),[v,w]=(0,f.useState)(null),[x,y]=(0,f.useState)(null),[z,A]=(0,f.useState)(!1),B=(0,n.useReviewIdentity)(),{resolvedTheme:C,setTheme:D}=(0,o.D)(),[E,F]=(0,f.useState)({}),[G,H]=(0,f.useState)(!1),[I,J]=(0,f.useState)(!1),K=(0,f.useCallback)(async()=>{try{let a=await fetch("/api/review/users");if(a.ok){let b=await a.json(),c={};for(let[a,d]of Object.entries(b.users))c[a]=d.name;F(c)}}catch{}},[]),L=(0,f.useRef)(void 0),M=(0,f.useRef)(void 0),N=(0,f.useCallback)(a=>{a!==c&&(d(a),w(null),y(null),window.history.replaceState(null,"",`/review/${a}`))},[c]),O=(0,f.useCallback)(async()=>{try{let a=await fetch(`/api/review/${c}`);if(!a.ok)return void(404===a.status?w(b("review.reviewNotExist")):w(b("review.loadFailed")));let d=await a.json();s(d.review),w(null)}catch{w(b("review.networkError"))}finally{u(!1)}},[c]),P=(0,f.useCallback)(async(a,d)=>{if(B.authorId)try{(await fetch(`/api/review/${c}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({author:B.name,authorId:B.authorId,content:a,anchor:d})})).ok&&await O()}catch{(0,p.oR)(b("toast.addCommentFailed"),"error")}},[c,B,O]),Q=(0,f.useCallback)(async a=>{try{(await fetch(`/api/review/${c}/comments?commentId=${a}`,{method:"DELETE"})).ok&&await O()}catch{(0,p.oR)(b("toast.deleteCommentFailed"),"error")}},[c,O]),R=(0,f.useCallback)(async(a,d)=>{try{(await fetch(`/api/review/${c}/comments`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({commentId:a,content:d})})).ok&&await O()}catch{(0,p.oR)(b("toast.editCommentFailed"),"error")}},[c,O]),S=(0,f.useCallback)(async(a,d)=>{try{(await fetch(`/api/review/${c}/comments`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({commentId:a,closed:d})})).ok&&await O()}catch{(0,p.oR)(b("toast.operationFailed"),"error")}},[c,O,b]),T=(0,f.useCallback)(async(a,d)=>{if(B.authorId)try{(await fetch(`/api/review/${c}/replies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commentId:a,author:B.name,authorId:B.authorId,content:d})})).ok&&await O()}catch{(0,p.oR)(b("toast.addReplyFailed"),"error")}},[c,B,O]),U=(0,f.useCallback)(async(a,d)=>{try{(await fetch(`/api/review/${c}/replies?commentId=${a}&replyId=${d}`,{method:"DELETE"})).ok&&await O()}catch{(0,p.oR)(b("toast.deleteReplyFailed"),"error")}},[c,O]),V=(0,f.useCallback)(async(a,d,e)=>{try{(await fetch(`/api/review/${c}/replies`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({commentId:a,replyId:d,content:e})})).ok&&await O()}catch{(0,p.oR)(b("toast.editReplyFailed"),"error")}},[c,O]),W=(0,f.useCallback)(async()=>{try{let a=await fetch("/api/review/share-info"),d=await a.json(),e=d.shareBase?`${d.shareBase}/review/${c}`:window.location.href;await navigator.clipboard.writeText(e),(0,p.oR)(b("toast.linkCopied"),"success")}catch{(0,p.oR)(b("toast.copyFailed"),"error")}},[c]),X=(0,f.useCallback)(a=>{y(a),M.current?.(a)},[]),Y=(0,f.useCallback)(a=>{y(a),L.current?.(a)},[]),Z=(0,f.useCallback)(a=>{let b;if(!q||0===q.comments.length)return;let c=[...q.comments].sort((a,b)=>a.anchor.startOffset-b.anchor.startOffset),d=x?c.findIndex(a=>a.id===x):-1;b="next"===a?d<c.length-1?d+1:0:d>0?d-1:c.length-1;let e=c[b];y(e.id),M.current?.(e.id),L.current?.(e.id)},[q,x]);return(0,e.jsxs)("div",{className:"h-screen flex flex-col bg-background text-foreground overflow-hidden",children:[G&&(0,e.jsx)(l._,{currentName:B.name,onConfirm:a=>{B.confirmName(a),H(!1),K()},onSkip:()=>H(!1)}),q&&(0,e.jsx)(m.ReviewCommentsListModal,{isOpen:I,onClose:()=>J(!1),comments:q.comments,reviewTitle:q.title,userNameMap:E,onCommentClick:a=>{y(a),M.current?.(a),L.current?.(a)}}),q&&(0,e.jsx)("div",{className:"py-2 bg-secondary border-b border-border flex-shrink-0 flex justify-center",children:(0,e.jsxs)("div",{className:"w-full max-w-[1800px] px-4 flex items-center gap-3",children:[(0,e.jsx)("h1",{className:"text-sm font-semibold truncate",children:q.title}),(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground flex-shrink-0",children:b("review.updatedAt",{date:new Date(q.updatedAt||q.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})}),(0,e.jsx)("span",{className:"flex-1"}),!z&&(0,e.jsx)("span",{className:`px-2 py-0.5 text-xs rounded-full ${q.active?"bg-green-500/15 text-green-600 dark:text-green-400":"bg-muted text-muted-foreground"}`,children:q.active?b("review.active"):b("review.closed")}),(0,e.jsxs)("button",{onClick:()=>J(!0),className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground flex items-center gap-1",title:b("review.viewAllComments"),children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,e.jsx)("path",{d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})}),b("review.viewCommentBtn")]}),(0,e.jsx)("button",{onClick:W,className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("review.copyLink")}),(0,e.jsx)("button",{onClick:()=>D("dark"===C?"light":"dark"),className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:"dark"===C?b("settings.switchLight"):b("settings.switchDark"),children:"dark"===C?(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,e.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),(0,e.jsx)("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),(0,e.jsx)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),(0,e.jsx)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),(0,e.jsx)("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),(0,e.jsx)("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),(0,e.jsx)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),(0,e.jsx)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,e.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}),(0,e.jsx)(j.ReviewIdentitySettings,{identity:B})]})}),(0,e.jsx)("div",{className:"flex-1 flex justify-center overflow-hidden",children:(0,e.jsxs)("div",{className:"w-full max-w-[1800px] flex overflow-hidden",children:[(0,e.jsx)(k.ReviewListPanel,{currentReviewId:c,onSelect:N,readOnly:!z,refreshTrigger:q?.comments.length,onViewComments:a=>{a!==c&&N(a),J(!0)}}),t?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("div",{className:"text-muted-foreground",children:b("common.loading")})}):v||!q?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("div",{className:"text-xl mb-2",children:v||b("review.reviewNotFound")}),(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:b("review.checkLink")})]})}):(0,e.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,e.jsx)("div",{className:"flex-1 h-full border-r border-border overflow-hidden",children:(0,e.jsx)(h.W,{content:q.content,comments:q.comments,activeCommentId:x,isActive:q.active,onAddComment:P,onHighlightClick:Y,scrollToHighlightRef:M})}),(0,e.jsx)("div",{className:"w-[360px] h-full overflow-hidden flex-shrink-0",children:(0,e.jsx)(i.Q,{comments:q.comments,activeCommentId:x,currentAuthorId:B.authorId,isActive:q.active,isAdmin:z,userNameMap:E,onCommentClick:X,onNavigateComment:Z,onDeleteComment:Q,onEditComment:R,onToggleCommentClosed:S,onAddReply:T,onDeleteReply:U,onEditReply:V,scrollToCommentRef:L})})]})]})})]})}[h,m]=q.then?(await q)():q,d()}catch(a){d(a)}})},70722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},73136:a=>{"use strict";a.exports=require("node:url")},73370:(a,b,c)=>{"use strict";c.d(b,{useReviewHighlights:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call useReviewHighlights() from the server but useReviewHighlights is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/hooks/useReviewHighlights.ts","useReviewHighlights")},74824:(a,b,c)=>{"use strict";c.d(b,{ShareReviewToggle:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ShareReviewToggle() from the server but ShareReviewToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/review/src/client/ShareReviewToggle.tsx","ShareReviewToggle")},76760:a=>{"use strict";a.exports=require("node:path")},76788:(a,b,c)=>{"use strict";c.d(b,{_:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({currentName:a,onConfirm:b,onSkip:c}){let{t:h}=(0,f.Bd)(),[i,j]=(0,e.useState)(a),k=(0,e.useRef)(null),l=()=>{let a=i.trim();a&&b(a)};return(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,d.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-2xl w-80 p-5",children:[(0,d.jsx)("h2",{className:"text-base font-semibold mb-1",children:h("review.setNickname")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:h("review.nicknameHint")}),(0,d.jsx)("input",{ref:k,type:"text",value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.nativeEvent.isComposing||l(),"Escape"===a.key&&c()},placeholder:h("review.nicknamePlaceholder"),maxLength:20,className:"w-full px-3 py-2 text-sm bg-secondary border border-border rounded-lg focus:outline-none focus:border-brand",autoFocus:!0}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2 mt-4",children:[(0,d.jsx)("button",{onClick:c,className:"px-3 py-1.5 text-xs rounded-lg hover:bg-accent transition-colors text-muted-foreground",children:h("review.skipForNow")}),(0,d.jsx)("button",{onClick:l,disabled:!i.trim(),className:"px-4 py-1.5 text-xs rounded-lg bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:h("common.save")})]})]})})}},77068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},78908:a=>{"use strict";a.exports=import("shiki")},79758:(a,b,c)=>{"use strict";c.d(b,{useReviewIdentity:()=>f});var d=c(67484);c(55511);var e=c(208);function f(){let[a,b]=(0,d.useState)(""),[c,f]=(0,d.useState)(""),[g,h]=(0,d.useState)(!1),[i,j]=(0,d.useState)(!0),k=(0,d.useCallback)(a=>{let b=a.trim();b&&(f(b),h(!0),fetch("/api/review/identify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}).catch(()=>{}))},[]);return{authorId:a,name:c,nameConfirmed:g,loading:i,setName:(0,d.useCallback)(a=>{let b=a.trim();b&&(f(b),fetch("/api/review/identify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})}).catch(()=>{}))},[]),confirmName:k,randomize:(0,d.useCallback)(()=>{let a,b,c,d;f((a=e.A.t("reviewUtils.adjectives",{returnObjects:!0}),b=e.A.t("reviewUtils.nouns",{returnObjects:!0}),c=a[Math.floor(Math.random()*a.length)],d=b[Math.floor(Math.random()*b.length)],`${c}${d}`))},[])}}},84226:(a,b,c)=>{"use strict";c.d(b,{X:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({selectedText:a,position:b,onSubmit:c,onCancel:h}){let{t:i}=(0,f.Bd)(),[j,k]=(0,e.useState)(""),l=(0,e.useRef)(null),m=(0,e.useRef)(null),n=()=>{let a=j.trim();a&&c(a)},o=a.length>60?a.slice(0,57)+"...":a;return(0,d.jsxs)("div",{ref:m,className:"absolute z-50 w-96 bg-card border border-border rounded-lg shadow-lg",style:{top:b.top,left:Math.max(8,b.left-192)},children:[(0,d.jsxs)("div",{className:"px-3 pt-3 pb-2",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground mb-1",children:i("review.selectedText")}),(0,d.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r truncate",children:o})]}),(0,d.jsx)("div",{className:"px-3 pb-2",children:(0,d.jsx)("textarea",{ref:l,value:j,onChange:a=>k(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||(a.preventDefault(),n())},placeholder:i("review.addCommentPlaceholder"),className:"w-full px-2 py-1.5 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:4})}),(0,d.jsxs)("div",{className:"px-3 pb-3 flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:i("review.enterSubmitHint")}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)("button",{onClick:h,className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:i("common.cancel")}),(0,d.jsx)("button",{onClick:n,disabled:!j.trim(),className:"px-2 py-1 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:i("review.commentBtn")})]})]})]})}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94481:(a,b,c)=>{"use strict";c.d(b,{ReviewListPanel:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({currentReviewId:a,onSelect:b,readOnly:c,refreshTrigger:h,onViewComments:i}){let{t:j}=(0,f.Bd)(),[k,l]=(0,e.useState)([]),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=(0,e.useRef)(null),[v,w]=(0,e.useState)(null);(0,e.useCallback)(async()=>{try{let a=await fetch("/api/review");if(a.ok){let b=await a.json();l(b.reviews||[])}}catch{}},[]);let x=(0,e.useCallback)(async(a,b,c)=>{if(a.stopPropagation(),!o){p(b);try{(await fetch(`/api/review/${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({active:!c})})).ok&&l(a=>a.map(a=>a.id===b?{...a,active:!c}:a))}catch{}p(null)}},[o]),y=(0,e.useCallback)(async(c,d)=>{if(c.stopPropagation(),!m){n(d);try{if((await fetch(`/api/review/${d}`,{method:"DELETE"})).ok&&(l(a=>a.filter(a=>a.id!==d)),d===a)){let a=k.filter(a=>a.id!==d);a.length>0&&b(a[0].id)}}catch{}n(null)}},[m,a,k,b]),z=(0,e.useCallback)((a,b)=>{u.current=b,a.dataTransfer.effectAllowed="move";let c=a.currentTarget;requestAnimationFrame(()=>c.classList.add("opacity-30"))},[]),A=(0,e.useCallback)(a=>{u.current=null,w(null),a.currentTarget instanceof HTMLElement&&a.currentTarget.classList.remove("opacity-30")},[]),B=(0,e.useCallback)((a,b)=>{a.preventDefault(),a.dataTransfer.dropEffect="move",u.current&&u.current!==b&&w(b)},[]),C=(0,e.useCallback)(async(a,b)=>{a.preventDefault(),w(null);let c=u.current;u.current=null,c&&c!==b&&l(a=>{let d=[...a],e=d.findIndex(a=>a.id===c),f=d.findIndex(a=>a.id===b);if(-1===e||-1===f)return a;let[g]=d.splice(e,1);return d.splice(f,0,g),fetch("/api/review/order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:d.map(a=>a.id)})}).catch(()=>{}),d})},[]),D=c?k.filter(a=>a.active):k,E=!c;return q?(0,d.jsxs)("div",{className:"h-full flex flex-col items-center bg-secondary/50 w-9 flex-shrink-0 border-r border-border",children:[(0,d.jsx)("button",{onClick:()=>r(!1),className:"p-1.5 mt-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:j("review.expandList"),children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"9 18 15 12 9 6"})})}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground/50 mt-2",style:{writingMode:"vertical-rl"},children:c?j("review.nDocs",{count:D.length}):j("review.nReviews",{count:D.length})})]}):(0,d.jsxs)("div",{className:"h-full flex flex-col bg-secondary/50 w-[200px] flex-shrink-0 border-r border-border",children:[(0,d.jsxs)("div",{className:"px-3 py-2 border-b border-border flex-shrink-0 flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:c?j("review.docList"):j("review.allReviewsList")}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 ml-1.5",children:D.length})]}),(0,d.jsx)("button",{onClick:()=>r(!0),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:j("review.collapseList"),children:(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("polyline",{points:"15 18 9 12 15 6"})})})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[D.map(e=>(0,d.jsxs)("div",{draggable:E,onDragStart:E?a=>z(a,e.id):void 0,onDragEnd:E?A:void 0,onDragOver:E?a=>B(a,e.id):void 0,onDrop:E?a=>C(a,e.id):void 0,onMouseEnter:a=>{let b=a.currentTarget.getBoundingClientRect();t({id:e.id,text:e.title,top:b.top+b.height/2,left:b.right})},onMouseLeave:()=>t(a=>a?.id===e.id?null:a),onClick:()=>b(e.id),className:`group px-3 py-2 cursor-pointer border-b transition-colors ${v===e.id?"border-b-brand border-t border-t-transparent":"border-b-border/50"} ${e.id===a?"bg-accent/60":"hover:bg-accent/30"}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[!c&&(0,d.jsx)("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${e.active?"bg-green-500":"bg-muted-foreground/40"}`}),(0,d.jsx)("span",{className:"text-xs truncate flex-1",children:e.title}),e.commentCount>0&&i&&(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),i(e.id)},className:"flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-brand hover:!bg-brand/10 transition-colors",title:j("review.viewComments"),children:(0,d.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,d.jsx)("path",{d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})})}),!c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:a=>x(a,e.id,e.active),className:`flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-foreground hover:!bg-accent transition-colors ${o===e.id?"opacity-50 pointer-events-none":""}`,title:e.active?j("review.closeReview"):j("review.reopenReview"),children:e.active?(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),(0,d.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}):(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("path",{d:"M18.36 6.64A9 9 0 0 1 12 21 9 9 0 0 1 5.64 6.64"}),(0,d.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]})}),(0,d.jsx)("button",{onClick:a=>y(a,e.id),className:`flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-red-500 hover:!bg-red-500/10 transition-colors ${m===e.id?"opacity-50 pointer-events-none":""}`,title:j("review.deleteReview"),children:(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,d.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),e.commentCount>0&&(0,d.jsx)("div",{className:`text-[10px] text-muted-foreground/50 mt-0.5 ${c?"":"pl-3"}`,children:j("review.nComments",{count:e.commentCount})})]},e.id)),0===D.length&&(0,d.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground/50 text-center",children:c?j("review.noOpenDocs"):j("review.noReviews")})]}),s&&(0,d.jsx)("div",{className:"fixed z-50 px-2 py-1 text-xs bg-popover text-popover-foreground border border-border rounded shadow-md whitespace-nowrap pointer-events-none",style:{top:s.top,left:s.left+8,transform:"translateY(-50%)"},children:s.text})]})}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,8465,9755,3204],()=>b(b.s=6189));module.exports=c})();
|