{"version":3,"file":"static/js/89910.2b925f25.chunk.js","mappings":"oIAGO,MAAMA,EAAYA,KACvB,MAAMC,EAASC,EAAAA,GAAQC,WAAWF,OAElC,IAAIG,EAAa,qBAEjB,GAAIH,IAAWA,EAAOI,SAASD,GAAa,CAC1C,MAAM,WAAEE,GCRVC,KAUA,MAAMC,EAFND,GAHAA,GAHAA,EAAMA,EAAIE,QAGAC,QAAQ,oCAAqC,KAG7CA,QAAQ,UAAW,IAKvBC,EAAcJ,EAAIK,MAAM,6CACxBN,EAAaK,EAAcA,EAAY,GAAKJ,EAKlD,MAAO,CACLM,YAHkBL,IAAeF,EAIjCA,WAAYA,EACb,EDdwBQ,CAAYb,GAE/BK,IACFF,EAAaE,EAEjB,CAEA,OAAOF,CAAU,C","sources":["utils/generic/get-domain.ts","utils/bom-dom-manipulation/is-subdomain.ts"],"sourcesContent":["import { domainCheck } from 'utils/bom-dom-manipulation/is-subdomain';\nimport { GLOBALS } from './global-variables';\n\nexport const getDomain = (): string => {\n  const domain = GLOBALS.appConfigs.domain;\n\n  let mainDomain = 'springbuilder.site';\n\n  if (domain && !domain.includes(mainDomain)) {\n    const { pureDomain } = domainCheck(domain);\n\n    if (pureDomain) {\n      mainDomain = pureDomain;\n    }\n  }\n\n  return mainDomain;\n};\n","export const domainCheck = (\n  url: string\n): { isSubDomain: boolean; pureDomain: string } => {\n  url = url.trim();\n\n  // Remove protocols\n  url = url.replace(/^http:\\/\\/|^https:\\/\\/|^ftp:\\/\\//i, '');\n\n  // Remove 'www.' from the start\n  url = url.replace(/^www\\./i, '');\n\n  const fullDomain = url;\n\n  // Extract pure domain, handling ccTLDs like '.co.uk' or '.uk.com'\n  const domainMatch = url.match(/([a-z0-9-]+\\.[a-z]{2,}(?:\\.[a-z]{2,})?)$/i);\n  const pureDomain = domainMatch ? domainMatch[0] : url;\n\n  // Determine if it's a subdomain\n  const isSubDomain = fullDomain !== pureDomain;\n\n  return {\n    isSubDomain: isSubDomain,\n    pureDomain: pureDomain\n  };\n};\n"],"names":["getDomain","domain","GLOBALS","appConfigs","mainDomain","includes","pureDomain","url","fullDomain","trim","replace","domainMatch","match","isSubDomain","domainCheck"],"sourceRoot":""}