import{i as r,e as i}from"./index-tiSqwqFl.js";const c=new Set(["token","mint","address","ca","contract","tokenaddress","token_address","asset","coin","output","input","outputmint","inputmint","target"]);function u(o){for(const[e,n]of o.searchParams.entries()){const t=e.toLowerCase().replace(/-/g,"_");if(!c.has(t)&&!c.has(e.toLowerCase()))continue;const s=n.trim();if(r(s)||i(s))return!0}return!1}function l(o){const e=o.match(/^\/([^/]+)\/([^/?#]+)\/?$/);if(!e)return!1;const[,n,t]=e,s=n.toLowerCase();return["search","watchlist","multicharts","portfolio"].includes(s)?!1:r(t)||i(t)}function d(o,e){return`${o}${e}`.match(/(?:^|[/?#])(?:token|coin|asset|mint|ca|contract)\/(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})(?:[/?#]|$)/i)?!0:o.split("/").filter(Boolean).filter(a=>r(a)||i(a)).length===1}function k(o){let e;try{e=new URL(o)}catch{return"browse"}if(u(e))return"token-detail";const n=e.hostname.toLowerCase(),t=e.pathname;return n.includes("dexscreener.com")?l(t)?"token-detail":"browse":n.includes("gmgn.ai")?/\/(?:sol|bsc|eth|ethereum|base|arb|op|robinhood)\/token\/[^/?#]+/i.test(t)?"token-detail":"browse":n.includes("pump.fun")?/\/(?:coin\/)?[1-9A-HJ-NP-Za-km-z]{32,44}/i.test(t)?"token-detail":"browse":n.includes("geckoterminal.com")?/\/(?:solana|bsc|eth|base|arbitrum|optimism|robinhood)(?:_|\/)?(?:tokens|pools)\/[^/?#]+/i.test(t)?"token-detail":"browse":n.includes("dextools.io")?/pair-explorer\/0x[a-fA-F0-9]{40}/i.test(t)?"token-detail":"browse":n.includes("birdeye.so")||n.includes("solscan.io")?/\/token\/[^/?#]+/i.test(t)?"token-detail":"browse":n.includes("axiom.trade")?/\/t\/[^/?#]+/i.test(t)?"token-detail":"browse":d(t,e.hash)?"token-detail":"browse"}const m=new Set(["x.com","twitter.com","mobile.twitter.com","www.twitter.com"]);function f(o){try{const e=new URL(o).hostname.toLowerCase();return m.has(e)?!0:e.endsWith(".twitter.com")}catch{return!1}}function b(o,e){return e==="token-detail"?!0:f(o)}export{k as g,f as i,b as s};
