import{__exports as e}from"../../../_virtual/parseJs.mjs";import{__require as t}from"../../typescript/lib/typescript.mjs";import{__require as r}from"./isStyledComponent.mjs";var i;function a(){if(i)return e;i=1;let a=t(),{isStyledComponent:s}=r();function n(e,t,r){let i,s=[];if("templateSpans"in e)for(let t=0;t<e.templateSpans.length;t++){let r=e.templateSpans[t],i=r.pos-2,n=r.literal.end-(r.literal.rawText?.length||0);a.isTemplateTail(r.literal)?n-=1:n-=2,s.push({start:i,end:n})}i=a.isNoSubstitutionTemplateLiteral(e)?e.rawText||"":e.head.rawText||"";let n=t.indexOf(i,e.pos+1),l=e.end-1,{line:o,character:p}=a.getLineAndCharacterOfPosition(r,e.pos);return{css:t.slice(n,l),interpolationRanges:s,rangeStart:n,rangeEnd:l,locationStart:{line:o+1,column:p+2}}}return e.parseJs=function(e,t){let r=[];try{let i=a.createSourceFile(t?.from||"unnamed.ts",e,a.ScriptTarget.Latest);function l(t){if(s(t)){if(a.isTaggedTemplateExpression(t)){let a=n(t.template,e,i);r.push(a)}if(a.isCallExpression(t)&&a.isArrowFunction(t.arguments[0])&&(a.isNoSubstitutionTemplateLiteral(t.arguments[0].body)||a.isTemplateExpression(t.arguments[0].body))){let a=n(t.arguments[0].body,e,i);r.push(a)}}a.forEachChild(t,l)}i.parseDiagnostics?.length>0||l(i)}catch{}return r},e}export{a as __require};