"use strict";const re=require("../../../../../@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs.js"),F=require("../../../../../@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/toConsumableArray.cjs.js"),ae=require("../../../../../@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs.js"),S=require("react"),se=require("./create-element.cjs.js"),le=require("./checkForListedLanguage.cjs.js");var ie=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function M(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function y(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?M(Object(t),!0).forEach(function(n){ae(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):M(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var oe=/\n/g;function ue(e){return e.match(oe)}function ce(e){var r=e.lines,t=e.startingLineNumber,n=e.style;return r.map(function(a,s){var i=s+t;return S.createElement("span",{key:"line-".concat(s),className:"react-syntax-highlighter-line-number",style:typeof n=="function"?n(i):n},"".concat(i,`
`))})}function ge(e){var r=e.codeString,t=e.codeStyle,n=e.containerStyle,a=n===void 0?{float:"left",paddingRight:"10px"}:n,s=e.numberStyle,i=s===void 0?{}:s,c=e.startingLineNumber;return S.createElement("code",{style:Object.assign({},t,a)},ce({lines:r.replace(/\n$/,"").split(`
`),style:i,startingLineNumber:c}))}function me(e){return"".concat(e.toString().length,".25em")}function Q(e,r){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:r},children:[{type:"text",value:e}]}}function X(e,r,t){var n={display:"inline-block",minWidth:me(t),paddingRight:"1em",textAlign:"right",userSelect:"none"},a=typeof e=="function"?e(r):e,s=y(y({},n),a);return s}function B(e){var r=e.children,t=e.lineNumber,n=e.lineNumberStyle,a=e.largestLineNumber,s=e.showInlineLineNumbers,i=e.lineProps,c=i===void 0?{}:i,f=e.className,p=f===void 0?[]:f,u=e.showLineNumbers,g=e.wrapLongLines,v=e.wrapLines,l=v===void 0?!1:v,h=l?y({},typeof c=="function"?c(t):c):{};if(h.className=h.className?[].concat(F(h.className.trim().split(/\s+/)),F(p)):p,t&&s){var w=X(n,t,a);r.unshift(Q(t,w))}return g&u&&(h.style=y({display:"flex"},h.style)),{type:"element",tagName:"span",properties:h,children:r}}function Y(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];e.length===void 0&&(e=[e]);for(var n=0;n<e.length;n++){var a=e[n];if(a.type==="text")t.push(B({children:[a],className:F(new Set(r))}));else if(a.children){var s,i=r.concat(((s=a.properties)===null||s===void 0?void 0:s.className)||[]);Y(a.children,i).forEach(function(c){return t.push(c)})}}return t}function de(e,r,t,n,a,s,i,c,f){var p,u=Y(e.value),g=[],v=-1,l=0;function h(m,o){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return B({children:m,lineNumber:o,lineNumberStyle:c,largestLineNumber:i,showInlineLineNumbers:a,lineProps:t,className:d,showLineNumbers:n,wrapLongLines:f,wrapLines:r})}function w(m,o){if(n&&o&&a){var d=X(c,o,i);m.unshift(Q(o,d))}return m}function b(m,o){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return r||d.length>0?h(m,o,d):w(m,o)}for(var E=function(){var o=u[l],d=o.children[0].value,q=ue(d);if(q){var O=d.split(`
`);O.forEach(function(T,j){var $=n&&g.length+s,G={type:"text",value:"".concat(T,`
`)};if(j===0){var x=u.slice(v+1,l).concat(B({children:[G],className:o.properties.className})),R=b(x,$);g.push(R)}else if(j===O.length-1){var D=u[l+1]&&u[l+1].children&&u[l+1].children[0],I={type:"text",value:"".concat(T)};if(D){var W=B({children:[I],className:o.properties.className});u.splice(l+1,0,W)}else{var V=[I],N=b(V,$,o.properties.className);g.push(N)}}else{var L=[G],C=b(L,$,o.properties.className);g.push(C)}}),v=l}l++};l<u.length;)E();if(v!==u.length-1){var P=u.slice(v+1,u.length);if(P&&P.length){var k=n&&g.length+s,A=b(P,k);g.push(A)}}return r?g:(p=[]).concat.apply(p,g)}function pe(e){var r=e.rows,t=e.stylesheet,n=e.useInlineStyles;return r.map(function(a,s){return se.default({node:a,stylesheet:t,useInlineStyles:n,key:"code-segment-".concat(s)})})}function Z(e){return e&&typeof e.highlightAuto<"u"}function he(e){var r=e.astGenerator,t=e.language,n=e.code,a=e.defaultCodeValue;if(Z(r)){var s=le(r,t);return t==="text"?{value:a,language:"text"}:s?r.highlight(t,n):r.highlightAuto(n)}try{return t&&t!=="text"?{value:r.highlight(n,t)}:{value:a}}catch{return{value:a}}}function ve(e,r){return function(n){var a,s,i=n.language,c=n.children,f=n.style,p=f===void 0?r:f,u=n.customStyle,g=u===void 0?{}:u,v=n.codeTagProps,l=v===void 0?{className:i?"language-".concat(i):void 0,style:y(y({},p['code[class*="language-"]']),p['code[class*="language-'.concat(i,'"]')])}:v,h=n.useInlineStyles,w=h===void 0?!0:h,b=n.showLineNumbers,E=b===void 0?!1:b,P=n.showInlineLineNumbers,k=P===void 0?!0:P,A=n.startingLineNumber,m=A===void 0?1:A,o=n.lineNumberContainerStyle,d=n.lineNumberStyle,q=d===void 0?{}:d,O=n.wrapLines,T=n.wrapLongLines,j=T===void 0?!1:T,$=n.lineProps,G=$===void 0?{}:$,x=n.renderer,R=n.PreTag,D=R===void 0?"pre":R,I=n.CodeTag,W=I===void 0?"code":I,V=n.code,N=V===void 0?(Array.isArray(c)?c[0]:c)||"":V,L=n.astGenerator,C=re(n,ie);L=L||e;var J=E?S.createElement(ge,{containerStyle:o,codeStyle:l.style||{},numberStyle:q,startingLineNumber:m,codeString:N}):null,_=p.hljs||p['pre[class*="language-"]']||{backgroundColor:"#fff"},K=Z(L)?"hljs":"prismjs",U=w?Object.assign({},C,{style:Object.assign({},_,g)}):Object.assign({},C,{className:C.className?"".concat(K," ").concat(C.className):K,style:Object.assign({},g)});if(j?l.style=y({whiteSpace:"pre-wrap"},l.style):l.style=y({whiteSpace:"pre"},l.style),!L)return S.createElement(D,U,J,S.createElement(W,l,N));(O===void 0&&x||j)&&(O=!0),x=x||pe;var z=[{type:"text",value:N}],H=he({astGenerator:L,language:i,code:N,defaultCodeValue:z});H.language===null&&(H.value=z);var ee=(a=(s=N.match(/\n/g))===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:0,ne=m+ee,te=de(H,O,G,E,k,m,ne,q,j);return S.createElement(D,U,S.createElement(W,l,!k&&J,x({rows:te,stylesheet:p,useInlineStyles:w})))}}module.exports=ve;
//# sourceMappingURL=highlight.cjs.js.map
