import { jsx as _jsx } from "react/jsx-runtime";
export const capitalizeFirstAlphabet = (string) => {
    const stringToUse = string?.trim();
    return stringToUse?.charAt(0)?.toUpperCase() + stringToUse?.slice(1);
};
export const capitalizeAllFirstAlphabets = (string) => {
    return string
        .split(" ")
        .map((substring) => capitalizeFirstAlphabet(substring))
        .join(" ");
};
export const companySearchFiltersDetails = {
    Industry: { iconType: "industry", count: 1 },
    Strategy: { iconType: "strategyPath", count: 2 },
    Location: { iconType: "location", count: 3 },
    "Employee Count": { iconType: "employees", count: 4 },
    Financials: { iconType: "barGraph", count: 5 },
};
export const peopleSearchFiltersDetails = {
    "Job Title": { iconType: "jobTitle", count: 1 },
    "Management Level": { iconType: "management", count: 2 },
    Company: { iconType: "company", count: 3 },
    Experience: { iconType: "clock", count: 4 },
    Industry: { iconType: "dollarBriefcase", count: 5 },
    Skills: { iconType: "tools", count: 6 },
    Location: { iconType: "location", count: 7 },
    Education: { iconType: "book", count: 8 },
    Assignments: { iconType: "briefcase", count: 9 },
};
export const modalFooterButtons = [
    {
        text: "button 1",
        onClick: () => console.log("this was in click 1"),
    },
    {
        text: "button 2",
        onClick: () => console.log("this was in click 2"),
    },
];
export const dummyCompany = {
    name: "QLU.ai",
    universalName: "qlu-ai",
    companyEmployeesSearchPageUrl: false,
    companyPageUrl: "https://www.linkedin.com/company/qlu-ai/",
    companyLogoUrl: "https://qlu-media-cmp.s3.amazonaws.com/qlu-ai.jpg",
    companyType: null,
    defaultLocale: null,
    description: "QLU intelligently automates prospect research and outreach for executive and tech recruiters. It leverages the power of AI and Natural Language Processing to interpret any hiring requirement and generate the best candidates out of millions—in 5 mins. 100% Recall- Meaning QLU will find every single best candidate and 100% Precision- Meaning all of QLU''s recommended prospects will be bull''s eye prospects.",
    entityUrn: "urn:li:fsd_company:79063531",
    followerCount: 3094,
    headquarter: {
        streetAddressOptOut: true,
        _type: "com.linkedin.voyager.dash.organization.Location",
        description: null,
        address: {
            country: "US",
            geographicArea: null,
            city: "San Francisco",
            postalCode: null,
            _type: "com.linkedin.common.Address",
            _recipeType: "com.linkedin.ba7a55dcae9c7be6b47ea446c81b19d1",
            line2: null,
            line1: null,
        },
        _recipeType: "com.linkedin.9df4ee7a995e07cc18231cffa941c076",
        headquarter: true,
        city: null,
        line1: null,
        line2: null,
    },
    specialities: ["Artificial Intelligence", "Recruitment", "Automation", "NLP"],
    stockQuotes: null,
    staffcount: 33,
    staffCountRange: {
        start: 51,
        _type: "com.linkedin.common.IntegerRange",
        end: 200,
        _recipeType: "com.linkedin.86469c13590ec09e5d459a90dd74d3b0",
    },
    trackingInfo: null,
    websiteUrl: "http://www.qlu.ai",
    type: null,
    url: "https://www.linkedin.com/company/qlu-ai/",
    industries: ["Computer Software"],
};
export const profilePic = "https://media.licdn.com/dms/image/C5603AQHn7tbH46HwRw/profile-displayphoto-shrink_100_100/0/1651460224714?e=1688601600&v=beta&t=Rp0HL0Q-b3zSydvEhWzj67pxqvi5lIRF-ZlLloVru4o";
export const companyPic = "https://qlu-media-cmp.s3.amazonaws.com/qlu-ai.jpg";
export const SearchCompanyTableData = [
    {
        index: 1,
        isSelected: false,
        universalName: "asd123ewlkasdfjc",
        id: 123,
        name: "Qlu.ai adfadfasdfasdfasdfasdfasdfasdf",
        staffCount: 20,
        location: "Jannat",
        industries: "AI Recruitment",
        specialties: "SCP , Gameing, Gym",
        logo: "",
    },
    {
        index: 1,
        isSelected: false,
        universalName: "asd123ewasdflkjc",
        id: 1223,
        name: "Facebook ",
        staffCount: 0,
        location: "Jannati, Jannato ,Jannato",
        industries: "AI Recruitment",
        specialties: "SCP , Gameing, Gym, Gameing, Gym,Gameing, Gym",
        logo: "",
    },
    {
        index: 1,
        isSelected: false,
        universalName: "asd123ewlkjadfc",
        id: 1423,
        name: "Apple ",
        staffCount: "",
        location: "Jannat",
        industries: "AI Recruitment",
        specialties: "SCP , Gameing, Gym",
        logo: "",
    },
    {
        index: 1,
        isSelected: false,
        universalName: "a2adsfsd123ewlkjc",
        id: 1236,
        name: "Google ",
        staffCount: 20,
        location: "Jannati, Jannato ,Jannato",
        industries: "AI Recruitment",
        specialties: "SCP , Gameing, Gym",
        logo: "",
    },
];
export const SearchPersonTableData = [
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd123ewladfkjc",
        id: 12113,
        fullName: "Mike Luzio the Second and Mike Luzio the 3rd asdasdasdasdasd ",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Not Available",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: "",
        lastUpdated: "today",
        assignmentCount: 2,
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd123ewladfkjc",
        id: 12113,
        fullName: "Mike Luzio the Second and Mike Luzio the 3rd asdasdasdasdasd ",
        currentTitle: "Not Available",
        currentCompany: "Qlu.ai",
        location: "Not Available",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: "",
        lastUpdated: "today",
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd123ewladfkjc",
        id: 12113,
        fullName: "Mike Luzio the Second and Mike Luzio the 3rd asdasdasdasdasd ",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Jannat",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: "",
        lastUpdated: "today",
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd123ewladfkjc",
        id: 12113,
        fullName: "Mike Luzio the Second and Mike Luzio the 3rd asdasdasdasdasd ",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Jannat",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: "",
        lastUpdated: "today",
        assignmentCount: 2,
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd123ewladfkjc",
        id: 12113,
        fullName: "Mike Luzio the Second and Mike Luzio the 3rd asdasdasdasdasd ",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Jannat",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: "",
        lastUpdated: "today",
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd123ewladfkjc",
        id: 12113,
        fullName: "Mike Luzio the Second and Mike Luzio the 3rd asdasdasdasdasd ",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Jannat",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: "",
        lastUpdated: "today",
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd123ewladfkjc",
        id: 12113,
        fullName: "Mike Luzio the Second and Mike Luzio the 3rd asdasdasdasdasd ",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Jannat",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: "",
        lastUpdated: "today",
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd123ewladfkjc",
        id: 12113,
        fullName: "Mike Luzio the Second and Mike Luzio the 3rd asdasdasdasdasd ",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Jannat",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: "",
        lastUpdated: "today",
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd123ewladfkjc",
        id: 12113,
        fullName: "Mike Luzio the Second and Mike Luzio the 3rd asdasdasdasdasd ",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Jannat",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: "",
        lastUpdated: "today",
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd3232oesk",
        id: 3232,
        fullName: "Raja Zain1",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Jannati, Jannato ,Jannato qasdasdas",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: profilePic,
    },
    {
        index: 1,
        isSelected: false,
        publicIdentifier: "asd2qwnmxcnv2",
        id: 22,
        fullName: "Raja Zain2aaaaaaaaaaaaaaaaaa",
        currentTitle: "Confirm Jannati",
        currentCompany: "Qlu.ai",
        location: "Jannat",
        industry: "AI Recruitment",
        skills: "SCP , Gameing, Gym",
        profilePicture: profilePic,
    },
];
export const PersonViewTabs = [
    { tabName: "Summary" },
    { tabName: "Experience" },
    { tabName: "Notes" },
    { tabName: "Info" },
    { tabName: "Pay" },
    { tabName: "Stats" },
    { tabName: "Org Chart" },
    { tabName: "Assignments" },
    { tabName: "Similar Profiles" },
    { tabName: "Activity Log" },
    { tabName: "Notes" },
];
export const HomeScreenTabs = [
    { tabName: "Overview" },
    { tabName: "Assignment Stats" },
    { tabName: "Leader Board" },
];
export const CompanyViewTabs = [
    { tabName: "Summary" },
    { tabName: "People" },
    { tabName: "Financials" },
    { tabName: "Business Units" },
    { tabName: "Products" },
    { tabName: "Mapping" },
    { tabName: "Reports" },
    { tabName: "Competitors" },
    { tabName: "M&A" },
];
export const ProductDetailsViewTabs = [{ tabName: "Info" }, { tabName: "People" }, { tabName: "Competitors" }];
export const BusinessUnitViewTabs = [
    { tabName: "Summary" },
    { tabName: "People" },
    { tabName: "Financials" },
    { tabName: "Business Sub-Units" },
];
export const dummyExpDetails = {
    companyName: "Qlu.ai",
    role: "AHOE",
    start: "11-2011",
    end: "7-2022",
    duration: "2 yrs 7 mos",
    description: "Hello World When I it rained AI/ML SCPai tr-ai-ned hwo-ai it's artifical and management founded Simple React Mills in 2012, even the natural management foods on store shelves were filled with additives management and other artificial ingredients, and the clean-food movement was in its infancy Node. I decided to help change that. Over our short 8-year history, Simple Mills has quickly grown to become a leader across the center of the grocery store. Today, we make crackers, cookies, snack bars, baking mixes, and frostings from only whole-food ingredients and nothing artificial, ever. We are the #1 natural baking mix brand, #1 natural cracker brand, and the #1 natural cookie brand, with distribution in over 28,000 natural and mainstream stores nationwide. Behind the brand, we have a phenomenal team based primarily in Chicago, IL and Mill Valley, CA, who are all passionate about changing what our country eats.",
    specialities: ["SCP", "SCSS", "React", "Management"],
    industries: ["SCP", "artificial", "IT", "aI"],
    universalName: "qlu0-ai",
    urn: "123213",
    location: "San Francisco Bay Area",
};
export const dummyExpPayload = [
    {
        companyLogo: companyPic,
        start: "11-2011",
        end: "7-2022",
        duration: "2 yrs 7 mos",
        experienceDetails: [{ ...dummyExpDetails }, { ...dummyExpDetails }],
    },
    {
        companyLogo: companyPic,
        start: "July 18",
        end: "Now",
        duration: "2 yrs 7 mos",
        experienceDetails: [{ ...dummyExpDetails }],
    },
];
export const dummyEduPayload = [
    {
        start: "2010-09-01",
        end: "2014-06-30",
        degreeName: "Bachelor of Science",
        schoolName: "State University",
        fieldOfStudy: "Computer Science",
    },
    {
        start: "2010-09-01",
        end: "2014-06-30",
        degreeName: "Bachelor of Science",
        schoolName: "State University",
        fieldOfStudy: "Computer Science",
    },
];
export const peopleCardProfile = {
    _id: "123456",
    experience: [
        {
            companyLogo: "https://example.com/logo1.png",
            start: "2015-01-01",
            end: "2018-12-31",
            duration: "4 years",
            experienceDetails: [
                {
                    companyName: "GlobalTech Solutions",
                    role: "Senior Software Engineer",
                    start: "2019-03-01",
                    end: "2022-08-31",
                    duration: "3 years 6 months",
                    description: "Led a team of software engineers in developing cloud-based solutions, focusing on high scalability and security. Managed project lifecycles and coordinated with cross-functional teams to deliver projects on time.",
                    specialities: [
                        "Cloud Computing",
                        "Cybersecurity",
                        "Scalable Architecture",
                    ],
                    industries: [
                        "Information Technology",
                        "Software Development",
                        "Cloud Services",
                    ],
                    universalName: "globaltech-solutions",
                    urn: "urn:li:company:globaltech-solutions",
                    title: "Team Lead, Cloud Services Division",
                    location: "San Francisco, CA, USA",
                },
                {
                    companyName: "GlobalTech Solutions",
                    role: "Senior Software Engineer",
                    start: "2019-03-01",
                    end: "2022-08-31",
                    duration: "3 years 6 months",
                    description: "Led a team of software engineers in developing cloud-based solutions, focusing on high scalability and security. Managed project lifecycles and coordinated with cross-functional teams to deliver projects on time.",
                    specialities: [
                        "Cloud Computing",
                        "Cybersecurity",
                        "Scalable Architecture",
                    ],
                    industries: [
                        "Information Technology",
                        "Software Development",
                        "Cloud Services",
                    ],
                    universalName: "globaltech-solutions",
                    urn: "urn:li:company:globaltech-solutions",
                    title: "Team Lead, Cloud Services Division",
                    location: "San Francisco, CA, USA",
                },
                {
                    companyName: "GlobalTech Solutions",
                    role: "Senior Software Engineer",
                    start: "2019-03-01",
                    end: "2022-08-31",
                    duration: "3 years 6 months",
                    description: "Led a team of software engineers in developing cloud-based solutions, focusing on high scalability and security. Managed project lifecycles and coordinated with cross-functional teams to deliver projects on time.",
                    specialities: [
                        "Cloud Computing",
                        "Cybersecurity",
                        "Scalable Architecture",
                    ],
                    industries: [
                        "Information Technology",
                        "Software Development",
                        "Cloud Services",
                    ],
                    universalName: "globaltech-solutions",
                    urn: "urn:li:company:globaltech-solutions",
                    title: "Team Lead, Cloud Services Division",
                    location: "San Francisco, CA, USA",
                },
            ],
        },
    ],
    education: [
        {
            start: "2010-09-01",
            end: "2014-06-30",
            degreeName: "Bachelor of Science",
            schoolName: "State University",
            fieldOfStudy: "Computer Science",
        },
    ],
    publications: [],
    skills: ["JavaScript", "Python", "Project Management"],
    alsoViewed: [],
    languages: ["English", "Spanish"],
    publicIdentifier: "john_doe_123",
    industryCode: 101,
    imageUrl: "https://example.com/profileimage.jpg",
    scrapeType: "manual",
    trackingId: "XYZ789",
    locationName: "New York, NY",
    postalCode: "10001",
    versionTag: 1,
    schoolName: "State University",
    fieldOfStudy: "Computer Science",
    title: "Senior Developer",
    companyName: "TechCorp",
    firstName: "John",
    lastName: "Doe",
    fullName: "John Doe",
    entityUrn: "urn:li:john_doe",
    headline: "Experienced Software Developer",
    summary: "Over 10 years of experience in software development.",
    industry: "Technology",
    locality: "New York, NY",
    countryCode: "US",
    currentCompanyWebsite: "https://www.techcorp.com",
    companyLinkedinUrl: "https://www.linkedin.com/company/techcorp",
    currentCompanySpecialties: "Software Development, AI, Cloud Computing",
    currentCompanySize: 5000,
    currentCompanyName: "TechCorp",
    currentCompanyIndustry: "Information Technology and Services",
    profileUrl: "https://www.linkedin.com/in/john_doe",
    primaryEmail: "john.doe@example.com",
    companySize: "5001-10,000 employees",
    locationId: "103644278",
    phone_number: "+1234567890",
    work_email: "john.doe@techcorp.com",
    location_full_path: "North America > United States > New York > New York City",
    assignmentCount: 0,
};
export const dummyProfile = {
    business: [],
    industryCode: 1,
    versionTag: 10,
    bucket: "1",
    // "total_experience": 8161,
    currentCompanySize: 10,
    experience: [
        {
            title: "Communications Leader, Office of the CFO",
            start: "10-2013",
            end: "",
            duration: "9 yrs 11 mos",
            description: "As the internal communications leader for the CFO, Finance, Real Estate & Development, Facilities, Environment Health & Safety (EHS), Information Security, and other G&A groups, my team develops high-level executive and employee communications strategies for global teams ranging from hundreds to thousands of employees. This has also included developing a platform and communications strategy for global COVID-19-related content for all employees, vendors, and contractors working at Apple. \n\nMy favorite aspects of this role are thinking quickly to inform global audiences of key information, building content platforms that present critical content in a concise and skimmable manner, helping senior leaders turn data into compelling stories, building strong cross-functional partnerships, producing major internal events, and supporting large-scale initiatives. \n\nSome key accomplishments include:\n\n• Creating new content platforms or programs as-needed to present content in the most efficient and user-friendly way possible\n• Partnering with Facilities and EHS teams to create a comprehensive campaign about COVID-19 protocols and programs for all corporate employees\n• Working closely with our CFO to design and manage his internal and external presentations, and craft often sensitive messaging to our internal teams\n• Partnering with Finance and other G&A teams to produce quarterly financial and CapEx-related content for the Board of Directors\n• Working with the Legal team to streamline the Shareholder Proxy Statement by creating a top-down approach with restructured content and design\n• Producing internal senior leadership events\n• Strengthening internal comms across several G&A functions with consistent messaging and style\n• Partnering closely with the People team to produce content that speaks effectively to our global teams, factoring in employee sentiment and cultural nuances\n• Speaking to teams across the company about effective communication methodology and best practices",
            company_name: "Apple",
            urn: "urn:li:fsd_company:162479",
            logo: "https://media.licdn.com/dms/image/C560BAQHdAaarsO-eyA/company-logo_400_400/0/1595530301220?e=1701302400&v=beta&t=JGC8E9zcDi3bDtO70e6t9Vy8agFhZQDKMxUgJjOm9y4",
            location: "Cupertino, California",
            industries: ["Consumer Electronics"],
            companyWebsite: "http://www.apple.com/careers",
            companyPageUrl: "https://www.linkedin.com/company/apple/",
            companyType: "",
            companySize: 10,
            companySpecialities: [
                "Innovative Product Development",
                "World-Class Operations",
                "Retail",
                "Telephone Support",
            ],
            // "companyDescription": "We’re a diverse collective of thinkers and doers, continually reimagining what’s possible to help us all do what we love in new ways. And the same innovation that goes into our products also applies to our practices — strengthening our commitment to leave the world better than we found it. This is where your work can make a difference in people’s lives. Including your own.\n\nApple is an equal opportunity employer that is committed to inclusion and diversity. Visit apple.com/careers to learn more.",
            universalName: "apple",
            // "exp_days": 3614,
            // "li_locations": "",
            // "li_staffcount": 267423,
            index: 0,
        },
        {
            title: "Senior Program Manager, Finance Communications",
            start: "5-2012",
            end: "10-2013",
            duration: "1 yr 6 mos",
            description: "Driving executive messaging, promoting new initiatives, and developing creative direction were key in my role as a senior program manager.\n\nSome changes I delivered include:\n\n• Introducing internal social media platforms by collaborating with technology partners.\n• Producing executive presentations that drove business initiatives.\n• Driving employee engagement for a finance organization of 700+ people at global sites.",
            company_name: "Apple",
            urn: "urn:li:fsd_company:162479",
            logo: "https://media.licdn.com/dms/image/C560BAQHdAaarsO-eyA/company-logo_400_400/0/1595530301220?e=1701302400&v=beta&t=JGC8E9zcDi3bDtO70e6t9Vy8agFhZQDKMxUgJjOm9y4",
            location: "Cupertino, California",
            industries: ["Consumer Electronics"],
            companyWebsite: "",
            companyPageUrl: "",
            companyType: "",
            companySize: 267423,
            companySpecialities: [
                "Innovative Product Development",
                "World-Class Operations",
                "Retail",
                "Telephone Support",
            ],
            // "companyDescription": "",
            universalName: "apple",
            // "exp_days": 544,
            // "li_locations": "",
            // "li_staffcount": 267423,
            index: 1,
        },
        {
            title: "Presentation Specialist, Retail Communication",
            start: "2-2010",
            end: "5-2012",
            duration: "2 yrs 4 mos",
            description: "My role as a presentation specialist was a change of pace for me, but my creative background in music translated to crafting compelling messages and presentations. \n\nI’m most proud of: \n\n• Partnering with retail leadership to create communications materials for teams in 12 countries that clearly translated in 10 languages.\n• Producing content for 7 major internal conferences that drove employee engagement.\n• Creating messaging for major retail initiatives, and leveraged professional photography skills and retail experience to serve as art director for internal photoshoots—saving the cost of an external art director.",
            company_name: "Apple",
            urn: "urn:li:fsd_company:162479",
            logo: "https://media.licdn.com/dms/image/C560BAQHdAaarsO-eyA/company-logo_400_400/0/1595530301220?e=1701302400&v=beta&t=JGC8E9zcDi3bDtO70e6t9Vy8agFhZQDKMxUgJjOm9y4",
            location: "Cupertino, California",
            industries: [
                "Consumer Electronics",
                "Consumer Electronics",
                "Consumer Electronics",
                "Consumer Electronics",
                "Consumer Electronics",
                "Consumer Electronics",
            ],
            companyWebsite: "",
            companyPageUrl: "",
            companyType: "",
            companySize: 267423,
            companySpecialities: [
                "Innovative Product Development",
                "World-Class Operations",
                "Retail",
                "Telephone Support",
            ],
            // "companyDescription": "",
            universalName: "apple",
            // "exp_days": 849,
            // "li_locations": "",
            // "li_staffcount": 267423,
            index: 2,
        },
        {
            title: "Lead Creative",
            start: "7-2006",
            end: "2-2010",
            duration: "3 yrs 8 mos",
            description: "At my first role with Apple, I utilized my teaching background to develop a team of 9 in-store trainers. Highlights from this role include:\n\n• Consistently achieving high customer feedback scores.\n• Developing a scheduling methodology that met customer demand while moderating team growth.",
            company_name: "Apple",
            urn: "urn:li:fsd_company:162479",
            logo: "https://media.licdn.com/dms/image/C560BAQHdAaarsO-eyA/company-logo_400_400/0/1595530301220?e=1701302400&v=beta&t=JGC8E9zcDi3bDtO70e6t9Vy8agFhZQDKMxUgJjOm9y4",
            location: "Cupertino, California",
            industries: ["Consumer Electronics"],
            companyWebsite: "",
            companyPageUrl: "",
            companyType: "",
            companySize: 267423,
            companySpecialities: [
                "Innovative Product Development",
                "World-Class Operations",
                "Retail",
                "Telephone Support",
            ],
            // "companyDescription": "",
            universalName: "apple",
            // "exp_days": 1334,
            // "li_locations": "",
            // "li_staffcount": 267423,
            index: 3,
        },
        {
            title: "Speakers Bureau Account Executive ",
            description: "",
            company_name: "Speakers Platform",
            location: "San Francisco Bay Area",
            start: "2004",
            end: "2005",
            duration: "1 yr",
            urn: "",
            logo: "",
            industries: [],
            companyWebsite: "",
            companyPageUrl: "",
            companyType: "",
            companySize: 10,
            companySpecialities: [],
            // "companyDescription": "",
            universalName: "",
            // "exp_days": 364,
            // "li_locations": null,
            // "li_staffcount": null,
            index: 4,
        },
        {
            title: "High School Director of Instrumental Music",
            description: "",
            company_name: "San Francisco Bay Area School Districts",
            location: "",
            start: "1999",
            end: "2003",
            duration: "4 yrs",
            urn: "",
            logo: "",
            industries: [],
            companyWebsite: "",
            companyPageUrl: "",
            companyType: "",
            companySize: 10,
            companySpecialities: [],
            // "companyDescription": "",
            universalName: "",
            // "exp_days": 1459,
            // "li_locations": null,
            // "li_staffcount": null,
            index: 5,
        },
    ],
    education: [
        {
            start: "1992",
            end: "1997",
            degreeName: "Bachelor of Arts - BA",
            fieldOfStudy: "Music Education",
            schoolName: "UCLA",
            index: 0,
        },
    ],
    publications: [],
    skills: [],
    alsoViewed: [],
    languages: [],
    publicIdentifier: "gteal",
    imageUrl: "https://media.licdn.com/dms/image/C5603AQH1NAvrxQZkYw/profile-displayphoto-shrink_800_800/0/1578506965294?e=1698883200&v=beta&t=YkpFvZC7q1KxZBb1SaVQdQ8Ldzb0D8gW20r8iIUyRjg",
    scrapeType: "DEEP",
    trackingId: "",
    locationName: "United States",
    postalCode: "",
    schoolName: "UCLA",
    fieldOfStudy: "Music Education",
    title: "Communications Leader, Office of the CFO",
    companyName: "Apple",
    firstName: "Greg",
    lastName: "Teal",
    fullName: "Greg Teal",
    entityUrn: "urn:li:fsd_profile:ACoAAAACZ_ABOG4CtwrWam6qCB8bjae78quii6s",
    headline: "Communications Leader—Distilling complex concepts into compelling messaging delivered though user-focused platforms",
    summary: "I’m a realist  ra comes to comms. My audiences at Apple are crazy busy and practically no one has time to read lengthy copy. So whether it be email or web, get to the point quickly and use structure to make your content as effective as possible to those who only have time to skim it. Better yet, avoid email entirely and get the headline out though a push notification linking to a crystal clear infographic. \n\nMy comms superpower is distilling unrefined fragments into key messages nearly as fast as my quick wit. When I can take it a step further and create something from nothing—a campaign, a platform, an event—I’m at my very best.\n\nAs a leader, I love mentoring my team. I strive to teach my people everything I know and also learn all that I can from them. Success is when we all up our game and root for each other the whole way. I believe in the highest of high standards for my and my team’s work, and that an honest and positive environment is by far the best way to achieve those results. \n\nAs a cross-functional leader, I like explaining my point of view so my partners learn the comms perspective more and more with each interaction. I hope for the same in return.\n\nI have a strong iconoclast streak with my work: just because something had been effective in the past means it will be effective today. Revisit everything, at least from time to time, to keep deliverables fresh for both our audiences and our teams producing them. ",
    industry: "",
    locality: "Concord, California, United States",
    countryCode: "",
    phone_number: "",
    work_email: "",
    locationId: "null",
    // "scrapePriority": "",
    isAssigned: false,
    currentCompanyWebsite: "http://www.apple.com/careers",
    companyLinkedinUrl: "https://www.linkedin.com/company/apple/}",
    currentCompanySpecialties: "Innovative Product Development, World-Class Operations, Retail, Telephone Support",
    currentCompanyName: "Apple",
    currentCompanyIndustry: "Consumer Electronics",
    profileUrl: "",
    prospectType: "",
    recruiterLink: "",
    collectedBy: "recruiter",
    primaryEmail: "",
    age: "",
    // "ageQ": 23,
    gender: "male",
    race: "South-Asian",
    rank: 13,
    companySize: "303860",
    // "locationFullPath": "Concord, California, United States",
    // "metropoleArea": "",
    // "createdAtEs": "2023-08-28T13:40:34.423Z",
    updatedAt: "2023-08-28T13:40:34.423Z",
    updatedAtEs: "2023-08-28T13:40:34.423Z",
    _id: "01H8Y5ZXJGYXD955J0E4H07WZ4",
    score: 0,
    // "ind": 0
};
export const dummyCardProfile = {
    business: [],
    industryCode: 1,
    versionTag: 10,
    bucket: "1",
    // "total_experience": 8161,
    currentCompanySize: 10,
    experience: dummyExpPayload,
    education: [
        {
            start: "1992",
            end: "1997",
            degreeName: "Bachelor of Arts - BA",
            fieldOfStudy: "Music Education",
            schoolName: "UCLA",
            index: 0,
        },
    ],
    publications: [],
    skills: [],
    alsoViewed: [],
    languages: [],
    publicIdentifier: "gteal",
    imageUrl: "https://media.licdn.com/dms/image/C5603AQH1NAvrxQZkYw/profile-displayphoto-shrink_800_800/0/1578506965294?e=1698883200&v=beta&t=YkpFvZC7q1KxZBb1SaVQdQ8Ldzb0D8gW20r8iIUyRjg",
    scrapeType: "DEEP",
    trackingId: "",
    locationName: "United States",
    postalCode: "",
    schoolName: "UCLA",
    fieldOfStudy: "Music Education",
    title: "Communications Leader, Office of the CFO",
    companyName: "Apple",
    firstName: "Greg",
    lastName: "Teal",
    fullName: "Greg Teal",
    entityUrn: "urn:li:fsd_profile:ACoAAAACZ_ABOG4CtwrWam6qCB8bjae78quii6s",
    headline: "Communications Leader—Distilling complex concepts into compelling messaging delivered though user-focused platforms",
    summary: "I’m a realist when it comes to comms. My audiences at Apple are crazy busy and practically no one has time to read lengthy copy. So whether it be email or web, get to the point quickly and use structure to make your content as effective as possible to those who only have time to skim it. Better yet, avoid email entirely and get the headline out though a push notification linking to a crystal clear infographic. \n\nMy comms superpower is distilling unrefined fragments into key messages nearly as fast as my quick wit. When I can take it a step further and create something from nothing—a campaign, a platform, an event—I’m at my very best.\n\nAs a leader, I love mentoring my team. I strive to teach my people everything I know and also learn all that I can from them. Success is when we all up our game and root for each other the whole way. I believe in the highest of high standards for my and my team’s work, and that an honest and positive environment is by far the best way to achieve those results. \n\nAs a cross-functional leader, I like explaining my point of view so my partners learn the comms perspective more and more with each interaction. I hope for the same in return.\n\nI have a strong iconoclast streak with my work: just because something had been effective in the past means it will be effective today. Revisit everything, at least from time to time, to keep deliverables fresh for both our audiences and our teams producing them. ",
    industry: "",
    locality: "Concord, California, United States",
    countryCode: "",
    phone_number: "",
    work_email: "",
    locationId: "null",
    // "scrapePriority": "",
    isAssigned: false,
    currentCompanyWebsite: "http://www.apple.com/careers",
    companyLinkedinUrl: "https://www.linkedin.com/company/apple/}",
    currentCompanySpecialties: "Innovative Product Development, World-Class Operations, Retail, Telephone Support",
    currentCompanyName: "Apple",
    currentCompanyIndustry: "Consumer Electronics",
    profileUrl: "",
    prospectType: "",
    recruiterLink: "",
    collectedBy: "recruiter",
    primaryEmail: "",
    age: "",
    // "ageQ": 23,
    gender: "male",
    race: "South-Asian",
    rank: 13,
    companySize: "303860",
    // "locationFullPath": "Concord, California, United States",
    // "metropoleArea": "",
    // "createdAtEs": "2023-08-28T13:40:34.423Z",
    updatedAt: "2023-08-28T13:40:34.423Z",
    updatedAtEs: "2023-08-28T13:40:34.423Z",
    _id: "01H8Y5ZXJGYXD955J0E4H07WZ4",
    score: 0,
    assignmentCount: 3,
    // "ind": 0
};
export const dummyExpIndustries = [
    ["Energy Infrastructure", "Electrical Sector", "AI"],
    [
        "construction",
        "civil works",
        "commissioning",
        "e-LNG",
        "offshore combined cycle",
        "magnetic bearings",
        "wave energy power generation",
    ],
    [],
    [],
    ["Oil and Gas", "Finance"],
    ["finance", "treasury operations", "oilfield service"],
    [
        "well services",
        "data consulting services",
        "information solutions",
        "drilling",
        "integrated project management",
        "oilfield service",
        "finance",
        "management",
        "payable & collection accountants",
        "SOX",
        "Lawson ERP",
    ],
    ["Finance"],
    ["Telecom", "Oil and Gas", "Banking", "FMCG", "Textile"],
];
export const dummyExpSkills = [
    ["Js", "Ts"],
    ["react"],
    [],
    [],
    ["node", "aws"],
    [],
    ["micro services"],
    ["python"],
    ["react", "angular", "mongodb", "postgres", "sql"],
];
export const dummyAbout = `Hello two three Since 2012, SCP I have been on a mission to transform what America eats by creating snacks from simple, nutrient-dense ingredients. 
  I believe that what we put in our bodies, and how it is grown, SCSS matter immensely and we have the power to heal both people and our 
  planet with those decisions. I founded Simple Mills with exactly that intent.Since 2012, I have been on a mission to transform what 
  America eats by creating snacks from simple, nutrient-dense ingredients. I believe that what we put in our bodies, and how it is grown, 
  matter immensely and we have the power to heal both people and our planet with those decisions. I founded Simple Mills with exactly 
  that intent.Since 2012, I have been on a missscpion to transform what America eats by creating snacks from simple, nutrient-dense ingredients`;
export const companyViewSummaryTypesPayload = {
    about: dummyAbout,
    industries: [
        "Food",
        "Wellness",
        "Groceries",
        "E-commerce",
        "Health",
        "Fitness",
    ],
    employeeCount: 50,
    websiteUrl: "qlu.ai",
    headquarter: "Islamabad, Pakistan",
};
export const getInitials = (name) => {
    const invalidName = !name || !name.trim();
    if (invalidName) {
        return "U";
    }
    const trimmedName = name.trim();
    const words = trimmedName.split(/[^\w]+/);
    const filteredWords = words.filter((word) => word !== "");
    const firstInitial = filteredWords[0]?.charAt(0);
    if (filteredWords.length === 1) {
        return firstInitial.toUpperCase() ?? "";
    }
    const secondInitial = filteredWords[1]?.charAt(0);
    return `${firstInitial ?? ""}${secondInitial ?? ""}`.toUpperCase();
};
export const getFirstName = (fullName) => {
    const trimmedName = fullName.trim();
    if (trimmedName === "") {
        return "";
    }
    const words = trimmedName.split(/[^\w]+/);
    const filteredWords = words.filter((word) => word !== "");
    const firstName = filteredWords[0];
    return firstName ?? "";
};
const numberMonthMap = {
    "1": "Jan",
    "2": "Feb",
    "3": "Mar",
    "4": "Apr",
    "5": "May",
    "6": "Jun",
    "7": "Jul",
    "8": "Aug",
    "9": "Sep",
    "10": "Oct",
    "11": "Nov",
    "12": "Dec",
};
export const getFormatedDate = (str) => {
    const parts = str?.split("-");
    if (parts.length > 1) {
        return `${numberMonthMap[parts[0]]} ${parts[1]}`;
    }
    return str;
};
export const getDateFormatted = (dateString, format) => {
    const dateObj = new Date(dateString);
    if (format === "MD") {
        const month = dateObj.toLocaleString("default", { month: "short" });
        const date = dateObj.getDate();
        return `${month.charAt(0).toUpperCase() + month.slice(1)} ${date}`;
    }
    if (format === "DMY") {
        const date = dateObj.getDate();
        const month = dateObj.toLocaleString("default", { month: "long" });
        const year = dateObj.getFullYear();
        return `${date} ${month}, ${year}`;
    }
    if (format === "TDMY") {
        const hours = dateObj.getHours();
        const minutes = dateObj.getMinutes();
        const month = dateObj.getMonth() + 1;
        const date = dateObj.getDate();
        const year = dateObj.getFullYear().toString().slice(-2);
        const period = hours < 12 ? "AM" : "PM";
        const formattedHours = hours % 12 || 12;
        const formattedMinutes = minutes.toString().padStart(2, "0");
        return `${formattedHours}:${formattedMinutes} ${period}, ${month}/${date}/${year}`;
    }
    return "";
};
export function convertTo10KFormat(n) {
    if (n < 1000) {
        // If the number is less than 1000, it's returned as is
        return n;
    }
    else if (n < 10000) {
        // If the number is between 1000 and 10000, it's divided by 1000 and rounded to one decimal place
        return Math.round((n / 1000) * 10) / 10 + "K";
    }
    else if (n === 10000) {
        return "10K";
    }
    else {
        return "10K+";
    }
}
export function formatNumberToStringCurrency(number) {
    return number.toLocaleString("en-US", { style: "currency", currency: "USD" });
}
export const formatterForUSD = Intl.NumberFormat("en", {
    style: "currency",
    currency: "USD",
    notation: "compact",
});
export const compactNumber = Intl.NumberFormat("en", {
    notation: "compact",
});
export const getTagTranslation = (template) => template
    .replace(/{{\.First_Name}}/g, "First Name ✕")
    .replace(/{{\.Last_Name}}/g, "Last Name ✕")
    .replace(/{{\.Full_Name}}/g, "Full Name ✕")
    .replace(/{{\.Current_Title}}/g, "Current Title ✕")
    .replace(/{{\.Job_Title}}/g, "Job Title ✕")
    .replace(/{{\.My_Name}}/g, "My Name ✕")
    .replace(/{{\.My_First_Name}}/g, "My First Name ✕")
    .replace(/{{\.My_Full_Name}}/g, "My Full Name ✕")
    .replace(/{{\.User_Name}}/g, "User Name ✕")
    .replace(/{{\.School_Name}}/g, "School Name ✕")
    .replace(/{{\.Current_Company}}/g, "Current Company ✕")
    .replace(/{{\.Hiring_Company}}/g, "Hiring Company ✕");
export const getReverseTagTranslation = (template) => template
    .replace(/My Name ✕/g, "{{.My_Name}}")
    .replace(/My First Name ✕/g, "{{.My_First_Name}}")
    .replace(/My Full Name ✕/g, "{{.My_Full_Name}}")
    .replace(/First Name ✕/g, "{{.First_Name}}")
    .replace(/Last Name ✕/g, "{{.Last_Name}}")
    .replace(/Full Name ✕/g, "{{.Full_Name}}")
    .replace(/Current Title ✕/g, "{{.Current_Title}}")
    .replace(/Job Title ✕/g, "{{.Job_Title}}")
    .replace(/User Name ✕/g, "{{.User_Name}}")
    .replace(/School Name ✕/g, "{{.School_Name}}")
    .replace(/Current Company ✕/g, "{{.Current_Company}}")
    .replace(/Hiring Company ✕/g, "{{.Hiring_Company}}");
export function isValidURL(url) {
    // Regular expression pattern for a valid URL
    const urlPattern = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([\/\w .-]*)*\/?$/;
    // Test the provided URL against the pattern
    return urlPattern.test(url);
}
export const escapeSpecialCharacters = (text) => text.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
export function removeConsecutiveCapitalLetters(inputString) {
    return inputString.replace(/([A-Z])+/g, (match) => match.charAt(0).toUpperCase());
}
export const getIndustriesSource = (industry, industries, expInds) => {
    const isInIndustries = industries.includes(industry);
    const isInExpIndustries = expInds.includes(industry);
    if (isInIndustries && isInExpIndustries) {
        return "Extracted from company and experience";
    }
    else if (isInExpIndustries) {
        return "Extracted from experience";
    }
    else if (isInIndustries) {
        return "Extracted from company";
    }
};
export const getUniqueIndustries = ({ industries, expIndustries, }) => {
    const industriesLowerCased = industries.map((industry) => industry.toLowerCase().trim());
    const expIndustriesLowerCased = expIndustries.map((industry) => industry.toLowerCase().trim());
    const uniqueIndustries = new Set([
        ...industriesLowerCased,
        ...expIndustriesLowerCased,
    ]);
    const formattedIndustries = Array.from(uniqueIndustries).map((industry) => ({
        source: getIndustriesSource(industry, industriesLowerCased, expIndustriesLowerCased),
        industry: capitalizeAllFirstAlphabets(industry),
    }));
    return formattedIndustries;
};
export const escapeRegExp = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // Escape special regex charactersac
export const getTransformedIndustries = (companyIndustries, experienceIndustries, experienceFromTitleLowerCase) => {
    const sourceBoth = "Extracted from company and experience";
    const sourceExperienceTitle = "Extracted from title";
    const sourceExperience = "Extracted from experience";
    const sourceCompany = "Extracted from company";
    const uniqueIndustries = [
        ...new Set([
            ...companyIndustries,
            ...experienceIndustries,
            ...experienceFromTitleLowerCase,
        ]),
    ];
    const transformedIndsutries = uniqueIndustries.map((industry) => {
        const isFromProfile = companyIndustries.includes(industry);
        const isFromExperience = experienceIndustries.includes(industry);
        const isFromExperienceTitle = experienceFromTitleLowerCase.includes(industry.toLowerCase());
        let source;
        if (isFromProfile && isFromExperience) {
            source = sourceBoth;
        }
        else if (isFromExperienceTitle) {
            source = sourceExperienceTitle;
        }
        else if (isFromProfile) {
            source = sourceCompany;
        }
        else {
            source = sourceExperience;
        }
        return {
            industry,
            source,
        };
    });
    return transformedIndsutries;
};
export const getDetectedIndustries = ({ experienceIndustriesFromTitle, companyIndustries, experienceIndustries, filterIndustries, }) => {
    const companyIndustryLowerCase = companyIndustries.map((industry) => industry.trim().toLowerCase());
    const experienceLowerCase = experienceIndustries.map((industry) => industry.trim().toLowerCase());
    const experienceFromTitleLowerCase = experienceIndustriesFromTitle.map((industry) => industry.trim().toLowerCase());
    const appliedLowerCase = filterIndustries.map((industry) => industry.trim().toLowerCase());
    const detectionMap = {};
    appliedLowerCase.forEach((industry) => {
        detectionMap[industry] = { industry, source: "" };
    });
    const transformedIndustries = getTransformedIndustries(companyIndustryLowerCase, experienceLowerCase, experienceFromTitleLowerCase);
    transformedIndustries.forEach(({ industry, source }) => {
        if (detectionMap[industry]) {
            detectionMap[industry].source = source;
        }
    });
    return Object.values(detectionMap)
        .filter(({ source }) => Boolean(source))
        .map((industry) => ({
        ...industry,
        industry: capitalizeAllFirstAlphabets(industry.industry),
    }));
};
export const detectEntitiesInDescription = (description, entities) => {
    const detectedEntities = [];
    entities.forEach((skill) => {
        const item = escapeRegExp(skill);
        const regex = new RegExp(`\\b${item}\\b`, "gi");
        const matchCount = description.match(regex);
        if (matchCount) {
            detectedEntities.push(skill);
        }
    });
    return detectedEntities;
};
export const detectEntitiesInDescriptionWithSlop = (description, entities, slop = 5) => {
    const detectedEntities = [];
    entities.forEach((entity) => {
        const words = entity.split(/\s+/);
        if (words.length === 1) {
            const escaped = escapeRegExp(entity);
            const regex = new RegExp(`\\b${escaped}\\b`, "gi");
            if (regex.test(description)) {
                detectedEntities.push(entity);
            }
        }
        else {
            const escapedWords = words.map((word) => escapeRegExp(word));
            const regexPattern = escapedWords
                .map((word, index) => {
                if (index === 0) {
                    return `\\b${word}\\b`;
                }
                // Add check for hyphens before and after the word
                return `(?:\\W+(?<!-)\\b\\w+\\b(?!-)){0,${slop}}\\W+\\b${word}\\b`;
            })
                .join("");
            const regex = new RegExp(regexPattern, "gi");
            if (regex.test(description)) {
                detectedEntities.push(entity);
            }
        }
    });
    return detectedEntities;
};
export const splitTextByKeyWords = (text, keyWords) => {
    if (keyWords.length === 0)
        return [text];
    const escapedSubstrings = keyWords.map(escapeRegExp);
    const regex = new RegExp(`(?<!')\\b(${escapedSubstrings.join("|")})\\b(?!')`, "gi");
    return text.split(regex);
};
export const highlightRichText = (splittedText, substrings, getClasses) => {
    if (splittedText.length === 1)
        return splittedText;
    const escapedSubstrings = substrings.map(escapeRegExp);
    // it creates a regular expression to match any of the substrings, ensuring they are not surrounded by apostrophes
    const regex = new RegExp(`(?<!')\\b(${escapedSubstrings.join("|")})\\b(?!')`, "gi");
    return splittedText.map((item, index) => {
        return item.split(regex).map((part, partIndex) => {
            //In this it check if the part matches any of the substrings
            const isMatch = substrings.some((substring) => new RegExp(`(?<!')\\b(${escapeRegExp(substring)})\\b(?!')`, "gi").test(part));
            return isMatch ? (_jsx("b", { className: getClasses(part), children: part }, `${index}-${partIndex}`)) : (part);
        });
    });
};
const createExactPhrasePattern = (keyword) => `\\b${keyword.split(/\s+/).map(escapeRegExp).join("\\s+")}\\b`;
const createSlopPattern = (keyword, slop = 5) => {
    const words = keyword.split(/\s+/);
    if (words.length <= 1)
        return "";
    return words
        .map((word, idx) => idx === 0
        ? `\\b${escapeRegExp(word)}\\b`
        : `(?:\\W+\\w+){0,${slop}}?\\W+\\b${escapeRegExp(word)}\\b`)
        .join("");
};
const createUniqueKey = (type, text, context = "", position = 0) => `${type}-${text}-${Math.abs(text
    .split("")
    .reduce((acc, char) => (acc * 31 + char.charCodeAt(0)) % Number.MAX_SAFE_INTEGER, 0))}-${position}${context ? `-${context.length}` : ""}`;
const findExactMatches = (text, keywords) => {
    // Sort keywords by length (longest first) to prioritize longer matches
    const sortedKeywords = [...keywords].sort((a, b) => b.length - a.length);
    const cleanText = text.replace("-", " ");
    // Find all matches for all keywords
    const allMatches = sortedKeywords.reduce((matches, keyword) => {
        const regex = new RegExp(createExactPhrasePattern(keyword), "gi");
        const keywordMatches = Array.from(cleanText.matchAll(regex))
            .map((match) => ({
            start: match.index,
            end: match.index + match[0].length,
            keyword,
        }))
            // Filter out overlapping matches Checks if the start/end of new match falls within an existing match
            .filter((newMatch) => !matches.some((existingMatch) => (newMatch.start >= existingMatch.start &&
            newMatch.start < existingMatch.end) ||
            (newMatch.end > existingMatch.start &&
                newMatch.end <= existingMatch.end)));
        return [...matches, ...keywordMatches];
    }, []);
    return allMatches.sort((a, b) => a.start - b.start);
};
function sanitizeStringWithSpaces(input) {
    return input.replace(/[/\\|.,:•;'"!?()[\]{}<>+\-_=~`@#$%^&*]/g, " ");
}
const findSlopWords = (segment, phrases, context, slop = 5) => {
    const wordsToHighlight = new Set();
    const contextLower = context.toLowerCase();
    const segmentLower = segment.toLowerCase();
    // Clean the segment and context of commas
    const cleanSegment = sanitizeStringWithSpaces(segmentLower.replace(/,/g, " "));
    const cleanContext = sanitizeStringWithSpaces(contextLower)
        .replace(/,/g, " ")
        .replace(/&amp;/g, "&")
        .replace(/\//g, " ");
    // First check for exact phrase matches
    phrases.forEach((phrase) => {
        const wordBoundaryRegex = new RegExp(`\\b${escapeRegExp(phrase.toLowerCase())}\\b`);
        if (wordBoundaryRegex.test(cleanSegment)) {
            wordsToHighlight.add(phrase.toLowerCase());
        }
    });
    // Then check for slop matches
    phrases.forEach((phrase) => {
        const phraseWords = phrase.toLowerCase().split(/\s+/);
        if (phraseWords.length <= 1)
            return;
        // Find which words from the phrase are in our segment
        const segmentWords = cleanSegment.split(/\s+/).filter(Boolean);
        const wordsInSegment = phraseWords.filter((word) => segmentWords.includes(word));
        if (wordsInSegment.length > 0) {
            const contextWords = cleanContext.split(/\s+/).filter(Boolean);
            // For each word in our segment, check if other phrase words are within range
            wordsInSegment.forEach((segmentWord) => {
                // Find all positions of our matching word
                contextWords.forEach((contextWord, wordIndex) => {
                    if (contextWord === segmentWord) {
                        // Check 5 words before and after this position
                        const start = Math.max(0, wordIndex - (slop + 1));
                        const end = Math.min(contextWords.length, wordIndex + (slop * 2 + 1));
                        const nearbyWords = contextWords.slice(start, end);
                        // Check if ALL other words from the phrase are in range
                        const otherPhraseWords = phraseWords.filter((w) => w !== segmentWord);
                        const allOtherWordsInRange = otherPhraseWords.every((otherWord) => nearbyWords.includes(otherWord));
                        if (allOtherWordsInRange) {
                            wordsToHighlight.add(phrase.toLowerCase());
                        }
                    }
                });
            });
        }
    });
    return wordsToHighlight;
};
export const splitTextByKeyWordsWithSlop = (sentences, keyWords, products = [], slop = 5) => {
    if ((keyWords.length === 0 && products.length === 0) ||
        sentences.length === 0)
        return [];
    const productExactPatterns = products.map(createExactPhrasePattern);
    const keywordExactPatterns = keyWords.map(createExactPhrasePattern);
    const keywordSlopPatterns = keyWords
        .map((keyword) => createSlopPattern(keyword, slop))
        .filter(Boolean);
    const regex = new RegExp(`(${[
        ...productExactPatterns,
        ...keywordExactPatterns,
        ...keywordSlopPatterns,
    ].join("|")})`, "gi");
    return sentences
        .reduce((acc, sentence, currentIndex) => {
        // First check current sentence only
        const matches = [...sentence.matchAll(regex)];
        if (matches.length > 0) {
            const parts = matches.reduce((segmentAcc, match, idx) => {
                const [fullMatch] = match;
                const startIndex = match.index;
                const lastIndex = idx === 0
                    ? 0
                    : matches[idx - 1].index + matches[idx - 1][0].length;
                if (startIndex > lastIndex) {
                    segmentAcc.push(sentence.slice(lastIndex, startIndex));
                }
                segmentAcc.push(fullMatch);
                if (idx === matches.length - 1 &&
                    startIndex + fullMatch.length < sentence.length) {
                    segmentAcc.push(sentence.slice(startIndex + fullMatch.length));
                }
                return segmentAcc;
            }, []);
            acc.push(parts);
            return acc;
        }
        // If no matches in current sentence, check surrounding context
        const nextSentence = sentences[currentIndex + 1] || "";
        const prevSentence = sentences[currentIndex - 1] || "";
        const combinedText = `${prevSentence} ${sentence} ${nextSentence}`;
        if (keywordSlopPatterns.some((pattern) => new RegExp(pattern, "gi").test(combinedText))) {
            acc.push([sentence]);
        }
        return acc;
    }, [])
        .map((sentence, index) => [
        ...sentence,
        index !== sentences.length - 1 ? "\n" : "",
    ])
        .flat();
};
export const splitTruncatedTextByKeyWordsWithSlop = (text, keyWords, products = [], slop = 5) => {
    if ((keyWords.length === 0 && products.length === 0) || !text.trim())
        return [text];
    // Split text into sentences
    const sentences = detectSentences(text);
    const productExactPatterns = products.map(createExactPhrasePattern);
    const exactPhrasePatterns = keyWords.map(createExactPhrasePattern);
    const slopPatterns = keyWords
        .map((keyword) => createSlopPattern(keyword, slop))
        .filter(Boolean);
    const regex = new RegExp(`(${[...productExactPatterns, ...exactPhrasePatterns, ...slopPatterns].join("|")})`, "gi");
    // Process sentences with similar logic to splitTextByKeyWordsWithSlop
    const processedSentences = sentences.map((sentence, currentIndex) => {
        // First check current sentence only
        const matches = [...sentence.matchAll(regex)];
        if (matches.length > 0) {
            // Similar splitting logic as in splitTextByKeyWordsWithSlop
            const parts = matches.reduce((segmentAcc, match, idx) => {
                const [fullMatch] = match;
                const startIndex = match.index;
                const lastIndex = idx === 0 ? 0 : matches[idx - 1].index + matches[idx - 1][0].length;
                if (startIndex > lastIndex) {
                    segmentAcc.push(sentence.slice(lastIndex, startIndex));
                }
                segmentAcc.push(fullMatch);
                if (idx === matches.length - 1 &&
                    startIndex + fullMatch.length < sentence.length) {
                    segmentAcc.push(sentence.slice(startIndex + fullMatch.length));
                }
                return segmentAcc;
            }, []);
            return parts;
        }
        // Check surrounding context
        const nextSentence = sentences[currentIndex + 1] || "";
        const prevSentence = sentences[currentIndex - 1] || "";
        const combinedText = `${prevSentence} ${sentence} ${nextSentence}`;
        // If any slop pattern matches in combined text, return the original sentence
        if (slopPatterns.some((pattern) => new RegExp(pattern, "gi").test(combinedText))) {
            return [sentence];
        }
        // If no matches found, return the original sentence
        return [sentence];
    });
    // Flatten the processed sentences and add newline separators
    const result = processedSentences.reduce((acc, sentenceParts, index) => [
        ...acc,
        ...sentenceParts,
        index !== processedSentences.length - 1 ? "\n" : "",
    ], []);
    return result;
};
function sanitizeString(input) {
    return input.replace(/[/\\|.,:•;'"!?()[\]{}<>+\-_=~`@#$%^&*]/g, "");
}
const findMatchingPhrases = (word, phrases, context) => {
    // First check for exact phrase matches (case-insensitive)
    const exactMatches = phrases.filter((phrase) => phrase.toLowerCase() === word.toLowerCase());
    if (exactMatches.length > 0) {
        return exactMatches.map((match) => match.toLowerCase());
    }
    const cleanContext = sanitizeStringWithSpaces(context);
    // Then check for single words that are part of phrases
    return phrases
        .filter((phrase) => {
        const phraseWords = phrase.toLowerCase().split(/\s+/);
        const wordLower = sanitizeString(word).toLowerCase();
        const contextLower = cleanContext.toLowerCase();
        const wordIndex = phraseWords.indexOf(wordLower);
        // If word isn't in the phrase, skip
        if (wordIndex === -1)
            return false;
        // Check if all other words in the phrase exist in context
        return phraseWords.every((phraseWord, idx) => {
            if (idx === wordIndex)
                return true; // Skip current word
            const wordBoundaryRegex = new RegExp(`\\b${escapeRegExp(phraseWord)}\\b`);
            return wordBoundaryRegex.test(contextLower);
        });
    })
        .map((phrase) => phrase.toLowerCase());
};
export const highlightRichTextWithSlop = (splittedText, keyWords, getClasses, // Now takes array
fullText, products = [], slop = 5) => splittedText.map((segment) => {
    if (!segment.trim())
        return segment;
    const productExactMatches = findExactMatches(segment, products);
    if (productExactMatches.length > 0) {
        return (_jsx("b", { className: getClasses([segment.toLowerCase()]), "data-phrases": segment.toLowerCase(), children: segment }, createUniqueKey("exact", segment, segment, parseInt(crypto.randomUUID().replace(/\D/g, ""), 10))));
    }
    const exactMatches = findExactMatches(segment, keyWords);
    if ((exactMatches.length === 0 || exactMatches.length !== keyWords.length) &&
        segment.length !== exactMatches[0]?.keyword.length) {
        const start = fullText.indexOf(segment);
        const end = start + segment.length;
        // Get 5 words before and after
        const wordsBefore = start > 0
            ? fullText
                .slice(Math.max(0, start - 100), start)
                .split(/\s+/)
                .filter(Boolean)
                .slice(-slop)
                .join(" ")
            : "";
        // Get 5 words after
        const wordsAfter = end < fullText.length
            ? fullText
                .slice(end)
                .split(/\s+/)
                .filter(Boolean)
                .slice(0, slop * 2)
                .join(" ")
            : "";
        // Find which words in the current segment belong to phrases
        const context = `${wordsBefore} ${segment} ${wordsAfter}`;
        // Find matching phrases
        const matchedPhrases = findSlopWords(segment, keyWords, context.replace(/•/g, ""));
        if (matchedPhrases.size === 0)
            return segment;
        // Split into words preserving spaces
        const parts = segment.split(/(\s+)/);
        return parts.map((part, idx) => {
            if (!part.trim())
                return part;
            const matches = Array.from(matchedPhrases).some((phrase) => {
                const phraseWords = phrase.toLowerCase().split(/\s+/);
                // First check if this part contains any of the phrase words
                const matchingWord = phraseWords.find((word) => part
                    .toLowerCase()
                    .trim()
                    .replace(/^,|,$/g, "")
                    .replace(/\.+/g, "")
                    .replace(/[/\\|.,•:;'"!?()[\]{}<>+\-_=~`@#$%^&*]/g, "")
                    .includes(word));
                if (!matchingWord)
                    return false;
                // Get position of this specific part instance in context
                const wordsBeforeInParts = parts
                    .slice(0, idx)
                    .filter((p) => p.trim()).length;
                const wordsBeforeContext = wordsBefore
                    .split(/\s+/)
                    .filter(Boolean).length;
                let currentWordPosition = wordsBeforeContext + wordsBeforeInParts;
                // Clean the context for word counting
                const cleanContext = context.replace(/&amp;/g, "&");
                const contextWords = cleanContext.split(/\s+/).filter(Boolean);
                const filteredContextWords = contextWords.filter((word, index) => {
                    if (word === "" ||
                        /^[/.•,:;'"!?()[\]{}<>+\-_=~`@#$%^&*]+$/.test(word)) {
                        if (index < currentWordPosition)
                            currentWordPosition -= 1;
                        return false;
                    }
                    return true;
                });
                // Check for previous word in range
                const matchingWordIndex = phraseWords.indexOf(matchingWord);
                // Check previous word in range
                if (matchingWordIndex > 0) {
                    const prevWord = phraseWords[matchingWordIndex - 1];
                    // Look for prevWord in previous 5 words
                    const prevRange = filteredContextWords.slice(Math.max(0, currentWordPosition - (slop + 1)), currentWordPosition);
                    if (!prevRange.some((w) => sanitizeString(w)
                        .toLowerCase()
                        .trim()
                        .replace(/^,|,$/g, "")
                        .replace(/\.+/g, "")
                        .includes(prevWord))) {
                        return false;
                    }
                }
                // Check next word in range
                if (matchingWordIndex < phraseWords.length - 1) {
                    const nextWord = phraseWords[matchingWordIndex + 1];
                    // Look for nextWord in next 5 words
                    const nextRange = filteredContextWords.slice(currentWordPosition + 1, currentWordPosition + 1 + (slop + 1));
                    if (!nextRange.some((w) => w
                        .toLowerCase()
                        .trim()
                        .replace(/^,|,$/g, "")
                        .replace(/\.+/g, "")
                        .replace(/[/\\|.,:•;'"!?()[\]{}<>+\-_=~`@#$%^&*]/g, " ")
                        .replace(/-/g, " ")
                        .includes(nextWord))) {
                        return false;
                    }
                }
                return true;
            });
            return matches ? (_jsx("b", { className: getClasses(findMatchingPhrases(part, keyWords, context.replace(/&amp;/g, "&"))), "data-phrases": findMatchingPhrases(part, keyWords, context.replace(/&amp;/g, "&")).join(" "), children: part }, createUniqueKey("slop", part, segment, parseInt(crypto.randomUUID().replace(/\D/g, ""), 10)))) : (part);
        });
    }
    const result = [];
    let lastIndex = 0;
    exactMatches.forEach((match) => {
        if (match.start > lastIndex) {
            const beforeText = segment.slice(lastIndex, match.start);
            const contextAfter = segment.slice(match.start);
            const wordsToHighlight = findSlopWords(beforeText, keyWords, contextAfter);
            if (wordsToHighlight.size > 0) {
                const wordRegex = new RegExp(`\\b(${Array.from(wordsToHighlight)
                    .map(escapeRegExp)
                    .join("|")})\\b`, "gi");
                let currentPosition = lastIndex;
                beforeText.split(wordRegex).forEach((part) => {
                    if (wordRegex.test(part)) {
                        result.push(_jsx("b", { className: getClasses(findMatchingPhrases(part, keyWords, segment)), "data-phrases": findMatchingPhrases(part, keyWords, segment).join(" "), children: part }, createUniqueKey("slop", part, beforeText, currentPosition)));
                    }
                    else {
                        result.push(part);
                    }
                    currentPosition += part.length;
                });
            }
            else {
                result.push(beforeText);
            }
        }
        const exactMatchText = segment.slice(match.start, match.end);
        result.push(_jsx("b", { className: getClasses(findMatchingPhrases(match.keyword, keyWords, segment)), "data-phrases": findMatchingPhrases(match.keyword, keyWords, segment).join(" "), children: exactMatchText }, createUniqueKey("exact", match.keyword, exactMatchText, match.start)));
        lastIndex = match.end;
    });
    if (lastIndex < segment.length) {
        const afterText = segment.slice(lastIndex);
        const contextBefore = segment.slice(0, lastIndex);
        const wordsToHighlight = findSlopWords(afterText, keyWords, contextBefore);
        if (wordsToHighlight.size > 0) {
            const wordRegex = new RegExp(`\\b(${Array.from(wordsToHighlight).map(escapeRegExp).join("|")})\\b`, "gi");
            let currentPosition = lastIndex;
            afterText.split(wordRegex).forEach((part) => {
                if (wordRegex.test(part)) {
                    result.push(_jsx("b", { className: getClasses(findMatchingPhrases(part, keyWords, segment)), "data-phrases": findMatchingPhrases(part, keyWords, segment).join(" "), children: part }, createUniqueKey("slop", part, afterText, currentPosition)));
                }
                else {
                    result.push(part);
                }
                currentPosition += part.length;
            });
        }
        else {
            result.push(afterText);
        }
    }
    return result;
});
export const isFirstExperience = ({ experiences, index, }) => {
    if (index === 0)
        return true;
    const currentExperience = experiences[index];
    const previousExperience = experiences[index - 1];
    return currentExperience.company !== previousExperience.company;
};
export const isLastExperience = ({ experiences, index, }) => {
    if (index === experiences.length - 1)
        return true;
    const currentExperience = experiences[index];
    const nextExperience = experiences[index + 1];
    return currentExperience.company !== nextExperience.company;
};
export const clsx = (classes) => Object.entries(classes)
    .filter(([, value]) => value)
    .map(([key]) => key)
    .join(" ");
export const formatLabel = (text, maxChars) => {
    const words = text.split(" ");
    const result = [];
    let currentLine = "";
    words.forEach((word) => {
        if ((currentLine + word).length > maxChars) {
            result.push(currentLine.trim());
            currentLine = word;
        }
        else {
            currentLine += ` ${word}`;
        }
    });
    if (currentLine) {
        result.push(currentLine.trim());
    }
    return result;
};
export const getSelectedProductsForCompany = (universalName, urn, isCurrentExperience, productsObject) => {
    if (!productsObject)
        return [];
    const products = [...Object.values(productsObject.either?.isSelected ?? {})];
    products.push(...Object.values(isCurrentExperience
        ? productsObject.current?.isSelected
        : productsObject.previous?.isSelected));
    return products
        .filter((product) => {
        const transformedUrn = product.companyUrn
            ? product.companyUrn.replace(/\D+/g, "")
            : "";
        return ((universalName && product.companyUniversalName === universalName) ||
            (urn && transformedUrn === urn));
    })
        .flatMap((product) => [product.productName, ...(product.keywords || [])]);
};
export const detectSentences = (text) => {
    if (!text?.trim())
        return [];
    const pattern = /(?<!\b\w\.\w.)(?<=\.|\?|!)(?=\s+[A-Z])|(?<=\w\.\w)(?=[A-Z])|(?<=\n|^)(?=\s*-)|(?<=\n|^)(?=\s*•)|(?<=\n|^)(?=\s*\d+\.)|(?<=\n|^)(?=\s*[a-z]+\.)|(?<=\n|^)(?=\s*[A-Z]+\.)|(?<=\n|^)(?=\s*[IVXLCDM]+\.)|(?<=\n|^)(?=\s*[A-Z](?![A-Z0-9]\.))/g;
    const sentences = text.split(pattern);
    return sentences;
};
export const splitAndFormatByKeywords = (sentences, keyWords) => {
    if (keyWords.length === 0 || sentences.length === 0)
        return [];
    const splittedSentences = sentences.reduce((acc, sentence) => {
        const escapedSubstrings = keyWords.map(escapeRegExp);
        const regex = new RegExp(`\\b(${escapedSubstrings.join("|")})\\b`, "gi");
        const splittedSentence = sentence.split(regex);
        if (splittedSentence.length > 1) {
            acc.push(splittedSentence);
        }
        return acc;
    }, []);
    return splittedSentences
        .map((sentence, index) => [
        ...sentence,
        index !== splittedSentences.length - 1 ? "\n" : "",
    ])
        .flat();
};
export function formatToK(value) {
    return value >= 1000 ? `${(value / 1000).toFixed(1)}K` : value.toString();
}
export const getStepSize = (maxValue) => {
    return Math.ceil(maxValue / 10);
};
