performance.mark("js-parse-end:27282-c55195c442b4dd67.js"); "use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["27282"],{18813(e,t,n){n.d(t,{B:()=>C,C:()=>b});var l=n(74848),i=n(16522),a=n(34164),r=n(38621),s=n(83223),d=n(26108),o=n(89823),c=n(55717),u=n(82845),f=n(17252),m=n(96540),h=n(45360);let x="DiffFileHeader-module__hide-on-mobile__Re_VJ";var _=n(14864);function p(e,t=41){if(!e||e.length<=t)return{text:e??"",truncated:!1};let n=e.slice(-(t-1));return{text:`\u{2026}${n}`,truncated:!0}}let E=new Set;function N(e){let t,n,a,s,d=(0,i.c)(10),{oldPath:o,newPath:c,oldPathTruncated:u,newPathTruncated:f}=e;return d[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)(r.ArrowRightIcon,{}),d[0]=t):t=d[0],d[1]!==f||d[2]!==u?(n=(0,l.jsxs)("span",{"aria-hidden":"true",children:["\u200E",u,"\u200E ",t," \u200E",f,"\u200E"]}),d[1]=f,d[2]=u,d[3]=n):n=d[3],d[4]!==c||d[5]!==o?(a=(0,l.jsxs)("span",{className:"sr-only",children:[o," renamed to ",c," "]}),d[4]=c,d[5]=o,d[6]=a):a=d[6],d[7]!==n||d[8]!==a?(s=(0,l.jsxs)("code",{children:[n,a]}),d[7]=n,d[8]=a,d[9]=s):s=d[9],s}function j(e){let t,n=(0,i.c)(2),{path:a}=e;return n[0]!==a?(t=(0,l.jsxs)("code",{children:["\u200E",a,"\u200E"]}),n[0]=a,n[1]=t):t=n[1],t}function v(e){let t,n,r,d,o,u=(0,i.c)(25),{headingId:f,fileLinkHref:h,onHeaderClick:x,fileLinkRef:_,newPath:E,oldPath:v,patchStatus:C}=e,b=(0,m.useRef)(null),D=function(e){let t,n,l=(0,i.c)(3),[a,r]=(0,m.useState)(!1);return l[0]!==e?(t=()=>{let t=e.current;if(!t)return;let n=()=>{r(t.scrollWidth>t.offsetWidth)},l=()=>n(),i=()=>r(!1),a=()=>n(),s=()=>r(!1);return t.addEventListener("focus",l),t.addEventListener("blur",i),t.addEventListener("mouseenter",a),t.addEventListener("mouseleave",s),()=>{t.removeEventListener("focus",l),t.removeEventListener("blur",i),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseleave",s)}},n=[e],l[0]=e,l[1]=t,l[2]=n):(t=l[1],n=l[2]),(0,m.useEffect)(t,n),a}(b);u[0]!==E||u[1]!==v||u[2]!==C?(t=function({newPath:e,oldPath:t,status:n}){if("RENAMED"===n){let n=p(t),l=p(e);return{text:`${t} renamed to ${e}`,truncated:n.truncated||l.truncated,oldPathTruncated:n.text,newPathTruncated:l.text}}return"DELETED"===n||"REMOVED"===n?{text:t??"",truncated:!1}:{text:e??"",truncated:!1}}({newPath:E,oldPath:v,status:C}),u[0]=E,u[1]=v,u[2]=C,u[3]=t):t=u[3];let y=t;u[4]!==y.newPathTruncated||u[5]!==y.oldPathTruncated||u[6]!==y.text||u[7]!==E||u[8]!==v||u[9]!==C?(n="RENAMED"===C?(0,l.jsx)(N,{oldPath:v,newPath:E,oldPathTruncated:y.oldPathTruncated,newPathTruncated:y.newPathTruncated}):(0,l.jsx)(j,{path:y.text}),u[4]=y.newPathTruncated,u[5]=y.oldPathTruncated,u[6]=y.text,u[7]=E,u[8]=v,u[9]=C,u[10]=n):n=u[10];let T=n,g="RENAMED"!==C&&"DiffFileHeader-module__file-name-truncate__NBVtv";return u[11]!==g?(r=(0,a.$)("DiffFileHeader-module__file-name__VVXpg",g),u[11]=g,u[12]=r):r=u[12],u[13]!==y.text||u[14]!==y.truncated||u[15]!==h||u[16]!==_||u[17]!==T||u[18]!==x||u[19]!==D?(d=D||y.truncated?(0,l.jsx)(c.m,{text:y.text,direction:"s",children:(0,l.jsx)(s.A,{className:"Link--primary",href:h,onClick:x,ref:_,children:T})}):(0,l.jsx)(s.A,{className:"Link--primary",href:h,onClick:x,ref:_,children:T}),u[13]=y.text,u[14]=y.truncated,u[15]=h,u[16]=_,u[17]=T,u[18]=x,u[19]=D,u[20]=d):d=u[20],u[21]!==f||u[22]!==r||u[23]!==d?(o=(0,l.jsx)("h3",{id:f,className:r,ref:b,children:d}),u[21]=f,u[22]=r,u[23]=d,u[24]=o):o=u[24],o}function C(e){let t,n,s,m,p,N,j,C,b,D,y,T,g,I,w,L,k=(0,i.c)(65),{additionalLeftSideContent:F,areLinesExpanded:H,canExpandOrCollapseLines:R,className:A,diffStatsProps:P,hiddenFeatures:$,isBinary:S,isSubmodule:O,isCollapsed:M,canToggleRichDiff:V,headingId:z,linesAdded:B,linesChanged:J,linesDeleted:K,fileLinkHref:Y,fileLinkRef:X,newMode:Z,newPath:U,oldMode:W,oldPath:G,onCopyPath:q,onHeaderClick:Q,onToggleDiffDisplay:ee,onToggleExpandAllLines:et,onToggleFileCollapsed:en,patchStatus:el,path:ei,rightSideContent:ea,size:er,showRichDiff:es,isInSingleFileMode:ed}=e,eo=void 0===$?E:$,ec=er&&"-"===er[0],eu=M?"DiffFileHeader-module__collapsed__ZY5uc":"";k[0]!==A||k[1]!==eu?(t=(0,a.$)("DiffFileHeader-module__diff-file-header__UuNN4",eu,"DiffFileHeader-module__container-flex-wrap__BZ51_",A),k[0]=A,k[1]=eu,k[2]=t):t=k[2],k[3]!==M||k[4]!==ed||k[5]!==en?(n=!ed&&(0,l.jsx)("div",{className:"d-flex flex-shrink-0 flex-order-1",style:{width:"28px",justifyContent:"center"},children:(0,l.jsx)(d.K,{onClick:en,"aria-label":M?"Expand file":"Collapse file",icon:M?r.ChevronRightIcon:r.ChevronDownIcon,size:"small",variant:"invisible"})}),k[3]=M,k[4]=ed,k[5]=en,k[6]=n):n=k[6];let ef="RENAMED"!==el&&"flex-1";k[7]!==ef?(s=(0,a.$)("d-flex px-1 flex-items-center overflow-hidden","DiffFileHeader-module__container-flex-order-reverse__JTghH","DiffFileHeader-module__file-path-section__ZcmB1",ef),k[7]=ef,k[8]=s):s=k[8],k[9]!==Y||k[10]!==X||k[11]!==z||k[12]!==U||k[13]!==G||k[14]!==Q||k[15]!==el?(m=(0,l.jsx)(v,{headingId:z,fileLinkHref:Y,onHeaderClick:Q,fileLinkRef:X,newPath:U,oldPath:G,patchStatus:el}),k[9]=Y,k[10]=X,k[11]=z,k[12]=U,k[13]=G,k[14]=Q,k[15]=el,k[16]=m):m=k[16],k[17]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.$)("ml-2 flex-shrink-0",x),k[17]=p):p=k[17];let em=U??G??"";return k[18]===Symbol.for("react.memo_cache_sentinel")?(N={direction:"s"},k[18]=N):N=k[18],k[19]!==q||k[20]!==em?(j=(0,l.jsx)(h.T,{className:p,textToCopy:em,ariaLabel:"Copy file name to clipboard",tooltipProps:N,onCopy:q,size:"small"}),k[19]=q,k[20]=em,k[21]=j):j=k[21],k[22]!==Z||k[23]!==W||k[24]!==el?(C=(0,u.AL)(el,W,Z)&&(0,l.jsxs)("div",{className:"p-2",children:[(0,l.jsx)("code",{children:W}),(0,l.jsx)(r.ArrowRightIcon,{className:"mx-1"}),(0,l.jsx)("code",{children:Z})]}),k[22]=Z,k[23]=W,k[24]=el,k[25]=C):C=k[25],k[26]!==H||k[27]!==R||k[28]!==eo||k[29]!==et||k[30]!==ei?(b=!eo.has(_.YR.expandLines)&&R&&et&&(0,l.jsx)(c.m,{text:H?`Collapse non-diff lines: ${ei}`:`Expand all lines: ${ei}`,direction:"s",children:(0,l.jsx)(d.K,{onClick:et,"aria-label":H?`Collapse non-diff lines: ${ei}`:`Expand all lines: ${ei}`,icon:H?r.FoldIcon:r.UnfoldIcon,size:"small",variant:"invisible","data-file-path":ei,className:(0,a.$)("flex-shrink-0",!H&&"js-expand-all-difflines-button",x)})}),k[26]=H,k[27]=R,k[28]=eo,k[29]=et,k[30]=ei,k[31]=b):b=k[31],k[32]!==j||k[33]!==C||k[34]!==b||k[35]!==s||k[36]!==m?(D=(0,l.jsxs)("div",{className:s,children:[m,j,C,b]}),k[32]=j,k[33]=C,k[34]=b,k[35]=s,k[36]=m,k[37]=D):D=k[37],k[38]===Symbol.for("react.memo_cache_sentinel")?(y=(0,a.$)("d-flex flex-row flex-justify-end flex-items-center gap-2 flex-1","DiffFileHeader-module__container-flex-order__H9ZsN"),k[38]=y):y=k[38],k[39]!==P||k[40]!==eo||k[41]!==O||k[42]!==B||k[43]!==J||k[44]!==K?(T=!eo.has(_.YR.diffStats)&&(0,l.jsx)("div",{className:"d-flex flex-justify-end flex-items-center",children:!O&&(0,l.jsx)("div",{className:x,children:(0,l.jsx)(f.z,{linesAdded:B,linesDeleted:K,linesChanged:J,...P})})}),k[39]=P,k[40]=eo,k[41]=O,k[42]=B,k[43]=J,k[44]=K,k[45]=T):T=k[45],k[46]!==S||k[47]!==ec||k[48]!==er?(g=S&&(0,l.jsx)("div",{className:"d-flex flex-items-center",children:(0,l.jsx)("code",{className:(0,a.$)("px-2",ec&&"fgColor-danger",!ec&&"fgColor-success"),children:`${er}`})}),k[46]=S,k[47]=ec,k[48]=er,k[49]=g):g=k[49],k[50]!==V||k[51]!==ee||k[52]!==es?(I=V&&(0,l.jsxs)(o.I,{"aria-label":"File view",size:"small",className:"DiffFileHeader-module__hide-on-small__XO_uy",onChange:ee?e=>ee(1===e):void 0,children:[(0,l.jsx)(o.I.IconButton,{"aria-label":"Display the source diff",selected:!es,icon:r.CodeIcon}),(0,l.jsx)(o.I.IconButton,{"aria-label":"Display the rich diff",selected:es,icon:r.FileIcon})]}),k[50]=V,k[51]=ee,k[52]=es,k[53]=I):I=k[53],k[54]!==ea||k[55]!==T||k[56]!==g||k[57]!==I?(w=(0,l.jsxs)("div",{className:y,children:[T,g,I,ea]}),k[54]=ea,k[55]=T,k[56]=g,k[57]=I,k[58]=w):w=k[58],k[59]!==F||k[60]!==D||k[61]!==w||k[62]!==t||k[63]!==n?(L=(0,l.jsxs)("div",{className:t,children:[n,F,D,w]}),k[59]=F,k[60]=D,k[61]=w,k[62]=t,k[63]=n,k[64]=L):L=k[64],L}function b(e){let t,n,r=(0,i.c)(6),{children:s,isAddition:d,className:o}=e,c=d?"fgColor-success":"fgColor-danger";return r[0]!==o||r[1]!==c?(t=(0,a.$)("ml-1 text-small text-bold",c,o),r[0]=o,r[1]=c,r[2]=t):t=r[2],r[3]!==s||r[4]!==t?(n=(0,l.jsx)("div",{className:t,children:s}),r[3]=s,r[4]=t,r[5]=n):n=r[5],n}N.displayName="RenamedFileName",j.displayName="FileName",v.displayName="HeadingFileName",C.displayName="DiffFileHeader",b.displayName="LinesChangedCounterLabel"},82845(e,t,n){function l(e){return void 0!==e.linesChanged&&0!==e.linesChanged}function i(e,t,n){return"MODIFIED"===e&&t!==n}function a(e,t,n,i){return"MODIFIED"===t&&n!==i&&!l(e)}function r(e){return"COPIED"===e.status&&!l(e)}function s(e){return"RENAMED"===e.status&&!l(e)}function d(e){return!!e.oldTreeEntry&&null===e.newTreeEntry}function o(e){return!!e.truncatedReason}n.d(t,{AL:()=>i,HI:()=>o,Jc:()=>r,Sn:()=>a,dK:()=>s,lO:()=>d,l_:()=>f,s8:()=>h,xW:()=>m});let c=["maximum diff size exceeded.","maximum number of lines exceeded."],u=/^maximum file count exceeded/;function f(e){let t=e;return c.includes(e)?t="This diff could not be loaded automatically because of too many other changes.":u.test(e)&&(t="This diff could not be loaded automatically because of too many other files to display."),t}function m(e){return!!e.newTreeEntry?.isGenerated}function h(e){return 0===e.linesChanged}},14864(e,t,n){n.d(t,{JF:()=>i,YR:()=>a,w$:()=>l});let l={Addition:"ADDITION",Context:"CONTEXT",Deletion:"DELETION",Hunk:"HUNK",InjectedContext:"INJECTED_CONTEXT",Empty:"EMPTY"},i={[l.Addition]:"+",[l.Deletion]:"-",[l.Context]:" ",[l.Hunk]:"@",[l.InjectedContext]:"~"},a={diffStats:"diffStats",expandLines:"expandLines",markAsViewed:"markAsViewed"}},1325(e,t,n){n.d(t,{K:()=>a});var l=n(16522),i=n(96540);let a=e=>{let t,n,a,r=(0,l.c)(4),s=(0,i.useRef)(e);return r[0]!==e?(t=()=>(s.current=e,()=>s.current=null),n=[e],r[0]=e,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,i.useLayoutEffect)(t,n),r[3]===Symbol.for("react.memo_cache_sentinel")?(a=(...e)=>{if(null===s.current)throw Error("useStableCallback: Cannot call callback after component has unmounted");return s.current(...e)},r[3]=a):a=r[3],a}}}]); //# sourceMappingURL=27282-c55195c442b4dd67-ea9afc874b9080cb.js.map