/* Socket Lib - Built with esbuild */
var f=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var b=(e,n)=>{for(var t in n)f(e,t,{get:n[t],enumerable:!0})},S=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of C(n))!_.call(e,i)&&i!==t&&f(e,i,{get:()=>n[i],enumerable:!(r=m(n,i))||r.enumerable});return e};var A=e=>S(f({},"__esModule",{value:!0}),e);var W={};b(W,{ansiRegex:()=>p.ansiRegex,applyLinePrefix:()=>y,camelToKebab:()=>k,centerText:()=>N,fromCharCode:()=>x,indentString:()=>P,isBlankString:()=>w,isNonEmptyString:()=>E,repeatString:()=>M,search:()=>I,stringWidth:()=>O,stripAnsi:()=>p.stripAnsi,stripBom:()=>$,toKebabCase:()=>R,trimNewlines:()=>L});module.exports=A(W);var p=require("./ansi"),l=require("./external/get-east-asian-width");const x=String.fromCharCode;function y(e,n){const{prefix:t=""}={__proto__:null,...n};return t.length?`${t}${e.includes(`
`)?e.replace(/\n/g,`
${t}`):e}`:e}function k(e){const{length:n}=e;if(!n)return"";let t="",r=0;for(;r<n;){const i=e[r];if(!i)break;const c=i.charCodeAt(0);if(c>=65&&c<=90)for(t.length>0&&(t+="-");r<n;){const s=e[r];if(!s)break;const a=s.charCodeAt(0);if(a>=65&&a<=90)t+=x(a+32),r+=1;else break}else t+=i,r+=1}return t}function P(e,n){const{count:t=1}={__proto__:null,...n};return e.replace(/^(?!\s*$)/gm," ".repeat(t))}function w(e){return typeof e=="string"&&(!e.length||/^\s+$/.test(e))}function E(e){return typeof e=="string"&&e.length>0}function I(e,n,t){const{fromIndex:r=0}={__proto__:null,...t},{length:i}=e;if(r>=i)return-1;if(r===0)return e.search(n);const c=r<0?Math.max(i+r,0):r,o=e.slice(c).search(n);return o===-1?-1:o+c}function $(e){return e.length>0&&e.charCodeAt(0)===65279?e.slice(1):e}const B=new Intl.Segmenter;let u,d,h;try{u=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),d=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),h=new RegExp("^\\p{RGI_Emoji}$","v")}catch{u=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark})+$","u"),d=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}]+/u,h=new RegExp("^\\p{Extended_Pictographic}$","u")}function O(e){if(typeof e!="string"||!e.length)return 0;const n=(0,p.stripAnsi)(e);if(!n.length)return 0;let t=0;const r={ambiguousAsWide:!1};for(const{segment:i}of B.segment(n)){if(u.test(i))continue;if(h.test(i)){t+=2;continue}const o=i.replace(d,"").codePointAt(0);if(o!==void 0&&(t+=(0,l.eastAsianWidth)(o,r),i.length>1))for(const s of i.slice(1)){const a=s.charCodeAt(0);if(a>=65280&&a<=65519){const g=s.codePointAt(0);g!==void 0&&(t+=(0,l.eastAsianWidth)(g,r))}}}return t}function R(e){return e.length?e.replace(/([a-z]+[0-9]*)([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase():e}function L(e){const{length:n}=e;if(n===0)return e;const t=e.charCodeAt(0),r=t!==13&&t!==10;if(n===1)return r?e:"";const i=e.charCodeAt(n-1);if(r&&(i!==13&&i!==10))return e;let o=0,s=n;for(;o<s;){const a=e.charCodeAt(o);if(a!==13&&a!==10)break;o+=1}for(;s>o;){const a=e.charCodeAt(s-1);if(a!==13&&a!==10)break;s-=1}return o===0&&s===n?e:e.slice(o,s)}function M(e,n){return n<=0?"":e.repeat(n)}function N(e,n){const t=(0,p.stripAnsi)(e).length;if(t>=n)return e;const r=n-t,i=Math.floor(r/2),c=r-i;return" ".repeat(i)+e+" ".repeat(c)}0&&(module.exports={ansiRegex,applyLinePrefix,camelToKebab,centerText,fromCharCode,indentString,isBlankString,isNonEmptyString,repeatString,search,stringWidth,stripAnsi,stripBom,toKebabCase,trimNewlines});
//# sourceMappingURL=strings.js.map
