Want to convert this JSONObject into a Hashmap

This is my JSONObject =>
{@@Last Action Taken By@@=Ikshita Sidney Jain, AfilePath=null, @entity_id@=1097, @@Diagram Link@@=View Biz Process : <a class=”imsgLink” style=”cursor: pointer;” id=”5014723″face=”Arial, Helvetica, sans-serif” color=”#FF6633″ href = “https://qaact-g01.tcsion.com:443/LX/INDEXES/AppLaunchSAML?app_id=9505&org_id=13&uid=1&rid=5014723&src=iMessageLogin&isMTOPJS=N&isLoginRequired=1” imsgScrnLink = “https://qaact-g01.tcsion.com:443//UCP/UcpWorkflowLibraryRepresentationAction.do?method=generateDiagramWfLib&etId=150002&srcDiag=WF&dType=4&versionId=1.1&entityId=1097&userId=914047&orgId=13&ucpLaunchKey=527372407909540”>

, @@Delegatee Name@@=Ikshita Sidney Jain, @@Entity Name@@=HRA, RecentOrgTimezone=Asia/Kolkata, creatorID=914047, @@Delegation Status@@=Pending, iMessageLinks=[{“linkLabel”:”Diagram Link”,”webtopUrl”:”/UCP/UcpWorkflowLibraryRepresentationAction.do?methodu003dgenerateDiagramWfLibu0026etIdu003d150002u0026srcDiagu003dWFu0026dTypeu003d4u0026versionIdu003d1.1u0026entityIdu003d1097″,”mTOPUrl”:”N”,”isMTOPJsFunction”:”N”,”isWebtopJsFunction”:”N”,”linkToken”:”Diagram Link”,”linkId”:5014723,”linkType”:”0″,”linkSave”:false,”linkJs”:”NA”,”appId”:9505,”orgId”:13,”isvisibleURL”:”9″,”isLoginRequired”:”1″,”isDiagramLink”:”Y”,”isLabeldynamic”:”0″,”linkHTML”:””,”linkPriority”:”0″}], AfileName=null, @@To Date@@=15-05-2023, @@Last Action Taken On@@=2023-05-14 22:54:26.0, @@Transaction Date@@=14-05-2023 22:54:26, @@From Date@@=15-05-2023, statusName=NEW, @@Solution Name@@=Payroll Solution}

I want a HashMap where keys are starting from @@ or @ and values must be the part after ” = “(equals)

Example :

`*{@@Last Action Taken By@@=Ikshita Sidney Jain,
@entity_id@=1097, 
...,
...,

@@From Date@@=15-05-2023, 
@@Solution Name@@=Payroll Solution
}*`

Please help me to solve this issue.

How to fulfill a JavaScript door unlock requirement using an HTML button?

In this this tutorial, https://www.w3schools.com/nodejs/nodejs_raspberrypi_webserver_websocket.asp , It has even handler that works off of an HTML checkbox. I would like to do the exact same thing, but with a button, so that I can temporarily unlock a door. As long as the button is pressed by the mouse, the door is unlocked. Once the mouse button is released, the door locks. The default position is locked. Below is the code from the link above:

<!DOCTYPE html>
<html>
<body>

<h1>Control LED light</h1>
<p><input type="checkbox" id="light"></p>

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script> <!-- include socket.io client side script -->
<script>
var socket = io(); //load socket.io-client and connect to the host that serves the page
window.addEventListener("load", function(){ //when page loads
  var lightbox = document.getElementById("light");
  lightbox.addEventListener("change", function() { //add event listener for when checkbox changes
    socket.emit("light", Number(this.checked)); //send button status to server (as 1 or 0)
  });
});
socket.on('light', function (data) { //get button status from client
  document.getElementById("light").checked = data; //change checkbox according to push button on Raspberry Pi
  socket.emit("light", data); //send push button status to back to server
});
</script>

</body>
</html> 

Essentially, I would like to use

<input type="button" id="light" value="light">

instead of

<input type="checkbox" id="light">

Thank you!

React onClick doest work correctly on if conditional

I have a problem with React.

I wrote a function:

   function click(event) {
    let element = event.currentTarget.querySelector(".infos__content");
    if (element.style.display) {
        alert("test")
        element.style.display = "none";
    }
    else {
        alert("test1")
        element.style.display = "block";
    }
}

and i called this function successfully in a DIV Container on the “onClick” attribute but it works for just one time, when i click on my div Container again, my if conditional always is true, does anyone know why?

I have google it already but cant find a solution for this

How to avoid reinitializing a useState variable in React Native

I am working on a music app in React Native. This page will be re-opened several times, but I do not want the trackList to reset to [] everything the page is re-rendered, but instead to retain its values. I have included a simplified version of my code:

export default function Host({ navigation }) {
  const [trackList, setTrackList] = useState([]);

  if (!existsTrackListener) {
    setTrackListener(roomID, (t) => {
      if (t != null) {
        const newArray = [...trackList, t.name];
        setTrackList(newArray);
      }
    });
    existsTrackListener = true;
  }

  return (
    <View style={styles.container}>
      <FlatList
        data={trackList}
        renderItem={({ item }) => <Text style={styles.item}>{item}</Text>}
      />
    </View>
  );
}

Calling a returned function gives “not a function”

I have this fake wordle game
I think that the problem is with fetching the api and returning the functions for validation. I get an error that “getData(...).isCorrect is not a function” whenever I press submit and when I try without the parenthesis in index.html, the game won’t display anything. Is there another way to do this, or is this just a simple bug in my code?

async function getData() {
  var response = await fetch("https://all-wordle-words.kobyk1.repl.co/script.js");
  var data = await response.json();

  const wordsArray = data;
  const words = new Set(wordsArray);
  const chosen = wordsArray[Math.floor(Math.random() * wordsArray.length)];

  function check(word) {
    let result = Array(5).fill("gray");
    let chosenChars = [...chosen];
    for (let i = 0; i < 5; i++) {
      if (word[i] === chosenChars[i]) {
        result[i] = "green";
        chosenChars[i] = "G";
      } else {
        for (let j = 0; j < 5; j++) {
          if (word[i] === chosenChars[j]) {
            result[i] = "yellow";
            chosenChars[j] = "Y";
          }
        }
      }
    }
    return result;
  }

  function isCorrect() {
    let word = document.getElementById("guess").value.toLowerCase();

    if (words.has(word)) {
      result = check(word);
      let element = document.getElementById("guesses");
      element.innerHTML += colorResult(word, result);
      if (chosen === word) {
        alert("You found the word!");
      }
    } else {
      alert("Sorry, that word is not in our dictionary!");
    }
  }

  function colorResult(word, result) {
    word = word.toUpperCase();
    let columns = "";
    for (let i = 0; i < 5; i++) {
      columns += `<td style="background-color: ${result[i]};">${word[i]}</td>`;
    }
    return "<tr>" + columns + "</tr>";
  }

  return {
    check,
    isCorrect,
    colorResult
  }
}
<h1>KORDLE</h1>
<table id="guesses">
  <tr></tr>
</table>

<br>

<input type="text" id="guess">
<button onclick="getData().isCorrect()">Submit</button>

How to embed mjpg streams with tag without browser getting out of memory

The reason I’m using an <img> tag for the mjpg stream is that I’m able to size the image with css. However, after letting it run for a while, the browser crashes becuase it’s getting out of memory.

I’m currently using URL.revokeObjectURL(mjpgURLwithOutdatedRandomParam) and add a new random param to the URL every few seconds. But unfortunately, the browser still crashes with Out of Memory.

What simple/optimal solution is there?

PS: I don’t understand how a browser can support mjpg (within an <img> tag) but not be prepared to handle the memory…

Shared resource handling with NodeJS?

Event loops etc. is explained in various places but can someone who knows c++ concurrency concepts explain how do we protect our shared resources in let’s say express web server?

Do we need to make sure every asynchronous operation from custom to library have javascript equivalent of MUTEX if such a thing exists?

Here is an answer about express concurrent example and explanation of concurrent request handling, but it does not clarify shared resource problems/protections of those below C++ threads.

Thanks in advance.

IndexedDB – Adding a store to an existing database?

I am attempting to create a simple key/value store (akin to localStorage) that is powered by IndexedDB.

class LocalStorageAsync {
  constructor(storeName?: string)
  getItem(key: string): Promise<string>
  setItem(key: string, value: string): Promise<void>
}

When instantiated, the constructor creates the database with a default store name if unspecified.

class LocalStorageAsync {
  //...

  constructor(storeName = 'default') {
    const openRequest = indexedDB.open('LocalStorageAsync')

    openRequest.onupgradeneeded = () => {
      const db = oRequest.result
      db.createObjectStore(storeKey)
    }

    this.#database = new Promise(resolve =>
      openRequest.onsuccess = () => resolve(oRequest.result)
  }

  //...
}

I want to be able to partition the database using store names so it has to create a store if it doesn’t exist in the database.

new LocalStorageAsync() // will create `LocalStorageAsync.default`
new LocalStorageAsync('foo') // will create `LocalStorageAsync.foo`

Initially, I attempted to do this within the onsuccess callback.

class LocalStorageAsync {
  //...

  constructor(storeName = 'default') {
    const openRequest = indexedDB.open('LocalStorageAsync')

    this.#database = new Promise(resolve => {
      openRequest.onsuccess = () => {
        if (!db.objectStoreNames.contains(storeKey)) {
          // This cannot be called in "onsuccess"
          db.createObjectStore(storeKey)
        }

        resolve(oRequest.result)
      }
    }
  }

  //...
}

I came to realise that db.createObjectStore() can only be called from within the onupgradeneeded callback which is only triggered when there is a version bump to the database or when the database is newly created.

The database versions are not important to me but I still need to trigger the onupgradeneeded callback to add a store.

Is it possible to trigger the onupgradeneeded from the onsuccess callback? Perhaps by naively incrementing a database version bump?

openRequest.onsuccess = () => {
  if (!db.objectStoreNames.contains(storeKey)) {
    // not a real method
    db.bumpVersion(db.version + 1)
  }
}

Am I better off just creating a new database entirely with a concatenated name (LocalStorageAsync.${storeName})?

RegEx to capture all printable ASCII characters/lines between the current and the next command in a text file. How?

I am trying to parse text from what I believe to be a simple document structure. I just wanted some feedback on the RegEx I’ve come up with to make sure it accounts for all cases.

The document Structure:

.START

.AA
Content in between

.AA
Content in between

.AA
Content in between

.END

Regular Expression Overview:

This regular expression matches a pattern that starts with a period followed by two uppercase letters, then one or more whitespace characters, and captures everything (including newlines) until it encounters two consecutive newline characters.

The Regular Expression:

.[A-Z]{2}s+([sS]*?)nn

The RegEx playground Example:

https://regex101.com/r/uBmtfC/1

My questions is, am I doing it right?

Axios POST returning :ERR_EMPTY_RESPONSE after API call

I am attempting to create a signup form in my Node.JS application.

When I make AXIOS post request, the data is persisted to my database but the actual promise still returns undefined. The payload is properly populated. What is even more confusing is that I’ve essentially mirrored the code for my login in functionality and that works perfectly.

Code below is for the signup.

import axios from 'axios';
import { showAlert } from './alerts';

export const signup = async (name, email, password, passwordConfirm) => {
  try {
    const res = await axios({
      method: 'POST',
      url: 'http://127.0.0.1:3000/api/v1/users/signup',
      data: {
        name,
        email,
        password,
        passwordConfirm,
      },
    }).then(console.log('hello world', res, 'hello')); // res returns undefined.

    if (res.data.status === 'success') {
      showAlert('success', 'Signed up successfully!');
      window.setTimeout(() => {
        location.assign('/login');
      }, 1500);
    }
  } catch (err) {
    showAlert('error', err.response.data.message);
  }
};

This is my user router, located at http://127.0.0.1:3000/api/v1/users

const authController = require('./../controllers/authController');
// const reviewController = require('./../controllers/reviewController');

const router = express.Router();

router.post('/signup', authController.signup);

And this is my authController with the signup function.


const signToken = (id) => {
  return jwt.sign({ id: id }, process.env.JWT_SECRET, {
    expiresIn: process.env.JWT_EXPIRES_IN,
  });
};

const createSendToken = (user, statusCode, res) => {
  const token = signToken(user._id);
  const cookieOptions = {
    expires: new Date(
      Date.now() + process.env.JWT_COOKIE_EXPIRES_IN * 24 * 60 * 60 * 1000
    ),
    httpOnly: true,
  };

  if (process.env.NODE_ENV === 'production') cookieOptions.secure = true;

  res.cookie('jwt', token, cookieOptions);

  // Remove password from output
  user.password = undefined;

  res.status(statusCode).json({
    status: 'success',
    token,
    data: {
      user,
    },
  });
};

exports.signup = catchAsync(async (req, res, next) => {
  const newUser = await User.create({
    name: req.body.name,
    email: req.body.email,
    password: req.body.password,
    passwordConfirm: req.body.passwordConfirm,
    passwordChangedAt: req.body.passwordChangedAt,
    role: req.body.role,
  });
  const url = `${req.protocol}://${req.get('host')}/me`;
  await new Email(newUser, url).sendWelcome();

  createSendToken(newUser, 201, res);
});

Thanks so much.

It seems to me that since my auth controller is sending a 201 response, this shouldn’t be happening.

I am trying to display a marquee widget from coin market cap in react but it is not working

I am making an investment website using react and I am trying to use widgets from coinmarketcap but it seems not to be doing anything

import React from 'react'

const Coinwidget = () => {
return (
<>
<script
type="text/javascript"
src="``https://files.coinmarketcap.com/static/widget/currency.js``"
></script>
<div
class="coinmarketcap-currency-widget"
data-currencyid="1"
data-base="USD"
data-secondary=""
data-ticker="true"
data-rank="true"
data-marketcap="true"
data-volume="true"
data-statsticker="true"
data-stats="USD"
></div>
</>
);
}

export default Coinwidget

Run function depending on focus using “vue shortkey”

I use the “Vue shortkey” library since the scope of the shortcuts is global but a detail arises

I am trying to execute two different functions using the same keyCode depending on their focus or their position.

and I need them to be executed according to the order, first the child and then the father

I have this:


<div v-shortkey="['esc']" @shortkey="closeModal">
    ...
    <div v-shortkey="['esc']" @shortkey="closeMenu">
         ...
     </div>
</div>

what I get is that the child is always executed leaving the parent aside.

Is there a way to execute the functions using the same keyCode?

How to Implement Search Query in Javascript?

I use HTML/CSS to make the frontend, and wrote a Javascript functions to enable search functions and tab open functions. I also created a search bar that allows users to input names in the search bar. However, I am trying to get the search string query and automatically opens a tab with the name filled by the user (e.g. John Smith), should open a link like the following: https://ycor-reey.gov.yk.ca/search?name=John+smith&reference=.

Here is my code:

function displayPersonOrCompanySearchFields(){
    let person = document.getElementById("person-subject");
    let company = document.getElementById("company-subject");
    let person_states = document.getElementById("person-search-states");
    let company_states = document.getElementById("company-search-states");
    let person_field = document.getElementById("person-search-field");
    let company_field = document.getElementById("company-search-field");
    
    if(person.checked === true){
      person_states.style.display = "block";
      person_field.style.display = "block";
      company_states.style.display = "none";
      company_field.style.display = "none";
    }else{
      company_states.style.display = "block";
      company_field.style.display = "block";
      person_states.style.display = "none";
      person_field.style.display = "none";
    }
  }

const openCorporateRecordTabs = () => {
  const selectedStateName = document.querySelector('input[name="state-name"]:checked').value;
  const selectedStateUrls = corporaterecordsUrls[selectedStateName];
  selectedStateUrls.forEach(url => window.open(url));
}

const corporaterecordsUrls = {
    "federal-level": ["https://www.ic.gc.ca/app/scr/cc/CorporationsCanada/fdrlCrpSrch.html?locale=en_CA"],
    "alberta": ["https://beta.canadasbusinessregistries.ca/search"],
    "british-columbia": ["https://beta.canadasbusinessregistries.ca/search", "https://www.bccourts.ca/search_judgments.aspx", "https://www.provincialcourt.bc.ca/judgments.php?link=https://www.canlii.org/en/bc/bcpc/"],
    "manitoba": ["https://beta.canadasbusinessregistries.ca/search", "https://companiesonline.gov.mb.ca/"],
    "new-brunswick": ["https://opencorporates.com/", "https://www.pxw2.snb.ca/"],
    "newfoundland-and-labrador": ["https://opencorporates.com/"],
    "nova-scotia": ["https://opencorporates.com/", "https://rjsc.novascotia.ca/?__cf_chl_jschl_tk__=c123b354ac59e279f1af733e938177f6c5426b4a-1618521288-0-AUxWaXpKmCqfw-_YAUdjtk9Q2Cbm53t55RP0T100hw2a-m7_3UjG_TDZ-Om5CGN9UH6sEha24sil5RRjdqN2Pbasm6aYHl-j71DEpm6LtYb3nGs3QeAcHtzo4c01CRDqUPYwGLqDqIoX7C3PQU6OigVbBEOCD9-gOgBNI8bqNTqV7LEQZ1nKpbwhqOdF7RpW5EfMA4r7fCDWekXEjsNRdUxOOmLCI2oUMhF4PlclYnaRp7FmMr4FrdNCOm9Ch5O2YUogg6qxaT0GmrMVTUz8Y1rbdAH4VKcANUaK6x9HXjzveieEkSd65Dcrn7ezVPTP12S3r43_J9O1eDlIYb961XlVfsHPB2I9K1rG_2c8S-H97YS4gKEpI4M4uu_CqfF0L0l_PamEKWc-pG-yuqhsNPxLIfa9YrVkLUBJs-BHQ_Hhyt9YB6F0YrP8NNs6rTvraw"],
    "ontario": ["https://beta.canadasbusinessregistries.ca/search", "https://www.eservicecorp.ca/"],
    "prince-edward-island": ["https://opencorporates.com/", "https://www.princeedwardisland.ca/en/feature/pei-business-corporate-registry#/home/BusinessAPI/BusinessAPI"],
    "quebec": ["https://beta.canadasbusinessregistries.ca/search", "http://www.registreentreprises.gouv.qc.ca/en/"],
    "saskatchewan": ["https://beta.canadasbusinessregistries.ca/search", "https://corporateregistry.isc.ca/"],
    "northwest-territories": ["https://decisia.lexum.com/nwtcourts-courstno/en/nav.do"],
    "nunavut": ["https://nni.gov.nu.ca/business/search/name"],
    "yukon": ["https://ycor-reey.gov.yk.ca/search"],
}
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="/canada.css"> 
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
        <script defer src="/canada.js"></script>
        <title>MESA Canada</title>
    </head>
    <body>
        <div class="container">
            <p class="title">MESA Canada</p>
        </div>
        <div id="company-search-field">
          <input id="company-name" name="company-name" style="background-color: white; margin-left: 1rem; width: 300px; line-height: 5;" placeholder="Insert company name here" />
        </div>
        <div id="person-search-field" style="display: none;">
          <input id="first-name" name="first-name" style="background-color: white; margin-left: 1rem; width: 300px; line-height: 5;" placeholder="Insert person first name here" />
          <input id="last-name" name="last-name" style="background-color: white; margin-left: 1rem; width: 300px; line-height: 5;" placeholder="Insert person last name here" />
        </div>
        <br>
        <div class="search-subject" style="margin-left: 1rem;">
          <input type="radio" onclick="displayPersonOrCompanySearchFields()" id="company-subject" name="subject-type" value="company-subject" checked>
          <label for="company-subject">Company</label>
          <input type="radio" onclick="displayPersonOrCompanySearchFields()" id="person-subject" name="subject-type" value="person-subject">
          <label for="person-subject">Person</label>
        </div>
        <br></br>
        <!-- WHEN COMPANY IS SELECTED -->
        <div id="company-search-states">
          <div class="states-dropdown-list">
            <form action="" onsubmit="return false;" style="width: 620px; border-right: solid; line-height: 2rem; border-color: darkgreen;">
                <b style="margin-left: 1rem;"><span style="color: darkgreen;">Corporate Records</span> and <span style="color: darkgreen;">Litigation</span> Research</b>
                <div style="border-radius: 25px; width: 30px; height: 30px; flex: auto; margin-top: -2rem; margin-left: 26rem; background-color: black;">
                    <svg style="color: white; background-color: transparent; margin-left: 0.4rem; margin-top: 0.4rem;" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-geo" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M8 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM4 4a4 4 0 1 1 4.5 3.969V13.5a.5.5 0 0 1-1 0V7.97A4 4 0 0 1 4 3.999zm2.493 8.574a.5.5 0 0 1-.411.575c-.712.118-1.28.295-1.655.493a1.319 1.319 0 0 0-.37.265.301.301 0 0 0-.057.09V14l.002.008a.147.147 0 0 0 .016.033.617.617 0 0 0 .145.15c.165.13.435.27.813.395.751.25 1.82.414 3.024.414s2.273-.163 3.024-.414c.378-.126.648-.265.813-.395a.619.619 0 0 0 .146-.15.148.148 0 0 0 .015-.033L12 14v-.004a.301.301 0 0 0-.057-.09 1.318 1.318 0 0 0-.37-.264c-.376-.198-.943-.375-1.655-.493a.5.5 0 1 1 .164-.986c.77.127 1.452.328 1.957.594C12.5 13 13 13.4 13 14c0 .426-.26.752-.544.977-.29.228-.68.413-1.116.558-.878.293-2.059.465-3.34.465-1.281 0-2.462-.172-3.34-.465-.436-.145-.826-.33-1.116-.558C3.26 14.752 3 14.426 3 14c0-.599.5-1 .961-1.243.505-.266 1.187-.467 1.957-.594a.5.5 0 0 1 .575.411z" fill="white"></path> 
                    </svg>
                </div>
                <ul class="states-dropdown" style="list-style: none; margin-left: -1.5rem; column-count: 2; -webkit-column-count: 2; -moz-column-count: 2; width: 600px;">
                    <li><label><input type="checkbox" name="state-name" class="state" value="federal-level" checked>Federal Level</label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="alberta">Alberta<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="british-columbia">British Columbia<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="manitoba">Manitoba<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="new-brunswick">New Brunswick<sup style="font-size: x-small;">*</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="newfoundland-and-labrador">Newfoundland and Labrador<sup style="font-size: x-small;">*</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="nova-scotia">Nova Scotia<sup style="font-size: x-small;">*</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="ontario">Ontario<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="prince-edward-island">Prince Edward Island<sup style="font-size: x-small;">*</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="quebec">Quebec<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="saskatchewan">Saskatchewan<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="northwest-territories">Northwest Territories</label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="nunavut">Nunavut</label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="yukon">Yukon</label></li>
                </ul>
                <span style="font-size: x-small; position: absolute; padding: 0.5rem;">*OpenCorporates will open</span>
                <br>
                <span style="font-size: x-small; position: absolute; padding: 0.5rem;">**Canada's Business Registries will open</span>
                <br></br>
                <button style="background-color: darkgreen; color: white; border: none; border-radius: 4px; height: 34px; width: 220px; cursor: pointer; margin-left: 1rem;" onclick="openCorporateRecordTabs();">
                    <svg class="svg-icon" viewBox="0 -3 20 20" style="width: 15px; height: 15px; margin-left: 2px; background-color: transparent; padding-top: 6px;">
                        <path fill="white" d="M18.109,17.776l-3.082-3.081c-0.059-0.059-0.135-0.077-0.211-0.087c1.373-1.38,2.221-3.28,2.221-5.379c0-4.212-3.414-7.626-7.625-7.626c-4.212,0-7.626,3.414-7.626,7.626s3.414,7.627,7.626,7.627c1.918,0,3.665-0.713,5.004-1.882c0.006,0.085,0.033,0.17,0.098,0.234l3.082,3.081c0.143,0.142,0.371,0.142,0.514,0C18.25,18.148,18.25,17.918,18.109,17.776zM9.412,16.13c-3.811,0-6.9-3.089-6.9-6.9c0-3.81,3.089-6.899,6.9-6.899c3.811,0,6.901,3.09,6.901,6.899C16.312,13.041,13.223,16.13,9.412,16.13z"></path>
                    </svg>
                    Search Corporate Records</button>
                <br></br>
                <button style="background-color: darkgreen; color: white; border: none; border-radius: 4px; height: 34px; width: 210px; cursor: pointer; margin-top: -4.15rem; float: right; margin-right: 5rem;" onclick="openSelectedStateTabs();">
                    <svg class="svg-icon" viewBox="0 -3 20 20" style="width: 15px; height: 15px; margin-left: 2px; background-color: transparent; padding-top: 6px;">
                        <path fill="white" d="M18.109,17.776l-3.082-3.081c-0.059-0.059-0.135-0.077-0.211-0.087c1.373-1.38,2.221-3.28,2.221-5.379c0-4.212-3.414-7.626-7.625-7.626c-4.212,0-7.626,3.414-7.626,7.626s3.414,7.627,7.626,7.627c1.918,0,3.665-0.713,5.004-1.882c0.006,0.085,0.033,0.17,0.098,0.234l3.082,3.081c0.143,0.142,0.371,0.142,0.514,0C18.25,18.148,18.25,17.918,18.109,17.776zM9.412,16.13c-3.811,0-6.9-3.089-6.9-6.9c0-3.81,3.089-6.899,6.9-6.899c3.811,0,6.901,3.09,6.901,6.899C16.312,13.041,13.223,16.13,9.412,16.13z"></path>
                    </svg>
                    Search Litigation Cases</button>
            </form>
          </div>
        </div>
        <!-- WHEN PERSON IS SELECTED -->
        <div id="person-search-states" style="display: none;">
          <div class="states-dropdown-list">
            <form action="" onsubmit="return false;" style="width: 620px; border-right: solid; line-height: 2rem; border-color: darkgreen;;">
                <b style="margin-left: 1rem;"><span style="color: darkgreen;">Corporate Affiliations</span> and <span style="color: darkgreen;">Litigation</span> Research</b>
                <div style="border-radius: 25px; width: 30px; height: 30px; flex: auto; margin-top: -2rem; margin-left: 28rem; background-color: black;">
                    <svg style="color: white; background-color: transparent; margin-left: 0.4rem; margin-top: 0.4rem;" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-geo" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M8 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM4 4a4 4 0 1 1 4.5 3.969V13.5a.5.5 0 0 1-1 0V7.97A4 4 0 0 1 4 3.999zm2.493 8.574a.5.5 0 0 1-.411.575c-.712.118-1.28.295-1.655.493a1.319 1.319 0 0 0-.37.265.301.301 0 0 0-.057.09V14l.002.008a.147.147 0 0 0 .016.033.617.617 0 0 0 .145.15c.165.13.435.27.813.395.751.25 1.82.414 3.024.414s2.273-.163 3.024-.414c.378-.126.648-.265.813-.395a.619.619 0 0 0 .146-.15.148.148 0 0 0 .015-.033L12 14v-.004a.301.301 0 0 0-.057-.09 1.318 1.318 0 0 0-.37-.264c-.376-.198-.943-.375-1.655-.493a.5.5 0 1 1 .164-.986c.77.127 1.452.328 1.957.594C12.5 13 13 13.4 13 14c0 .426-.26.752-.544.977-.29.228-.68.413-1.116.558-.878.293-2.059.465-3.34.465-1.281 0-2.462-.172-3.34-.465-.436-.145-.826-.33-1.116-.558C3.26 14.752 3 14.426 3 14c0-.599.5-1 .961-1.243.505-.266 1.187-.467 1.957-.594a.5.5 0 0 1 .575.411z" fill="white"></path> 
                    </svg>
                </div>
                <ul class="states-dropdown" id="provinces-list" style="list-style: none; margin-left: -1.5rem; column-count: 2; -webkit-column-count: 2; -moz-column-count: 2; width: 600px;">
                    <li><label><input type="checkbox" name="state-name" class="state" value="federal-level" checked>Federal Level</label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="alberta">Alberta<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="british-columbia">British Columbia<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="manitoba">Manitoba<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="new-brunswick">New Brunswick<sup style="font-size: x-small;">*</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="newfoundland-and-labrador">Newfoundland and Labrador<sup style="font-size: x-small;">*</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="nova-scotia">Nova Scotia<sup style="font-size: x-small;">*</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="ontario">Ontario<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="prince-edward-island">Prince Edward Island<sup style="font-size: x-small;">*</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="quebec">Quebec<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="saskatchewan">Saskatchewan<sup style="font-size: x-small;">**</sup></label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="northwest-territories">Northwest Territories</label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="nunavut">Nunavut</label></li>
                    <li><label><input type="checkbox" name="state-name" class="state" value="yukon">Yukon</label></li>
                </ul>
                <span style="font-size: x-small; position: absolute; padding: 0.5rem;">*OpenCorporates will open</span>
                <br>
                <span style="font-size: x-small; position: absolute; padding: 0.5rem;">**Canada's Business Registries will open</span>
                <br></br>
                <button style="background-color: darkgreen; color: white; border: none; border-radius: 4px; height: 34px; width: 220px; cursor: pointer; margin-left: 1rem;" onclick="openCorporateRecordTabs();">
                    <svg class="svg-icon" viewBox="0 -3 20 20" style="width: 15px; height: 15px; margin-left: 2px; background-color: transparent; padding-top: 6px;">
                        <path fill="white" d="M18.109,17.776l-3.082-3.081c-0.059-0.059-0.135-0.077-0.211-0.087c1.373-1.38,2.221-3.28,2.221-5.379c0-4.212-3.414-7.626-7.625-7.626c-4.212,0-7.626,3.414-7.626,7.626s3.414,7.627,7.626,7.627c1.918,0,3.665-0.713,5.004-1.882c0.006,0.085,0.033,0.17,0.098,0.234l3.082,3.081c0.143,0.142,0.371,0.142,0.514,0C18.25,18.148,18.25,17.918,18.109,17.776zM9.412,16.13c-3.811,0-6.9-3.089-6.9-6.9c0-3.81,3.089-6.899,6.9-6.899c3.811,0,6.901,3.09,6.901,6.899C16.312,13.041,13.223,16.13,9.412,16.13z"></path>
                    </svg>
                    Search Corporate Records</button>
                <br></br>
                <button style="background-color: darkgreen; color: white; border: none; border-radius: 4px; height: 34px; width: 210px; cursor: pointer; margin-top: -4.15rem; float: right; margin-right: 5rem;" onclick="openSelectedStateTabs();">
                    <svg class="svg-icon" viewBox="0 -3 20 20" style="width: 15px; height: 15px; margin-left: 2px; background-color: transparent; padding-top: 6px;">
                        <path fill="white" d="M18.109,17.776l-3.082-3.081c-0.059-0.059-0.135-0.077-0.211-0.087c1.373-1.38,2.221-3.28,2.221-5.379c0-4.212-3.414-7.626-7.625-7.626c-4.212,0-7.626,3.414-7.626,7.626s3.414,7.627,7.626,7.627c1.918,0,3.665-0.713,5.004-1.882c0.006,0.085,0.033,0.17,0.098,0.234l3.082,3.081c0.143,0.142,0.371,0.142,0.514,0C18.25,18.148,18.25,17.918,18.109,17.776zM9.412,16.13c-3.811,0-6.9-3.089-6.9-6.9c0-3.81,3.089-6.899,6.9-6.899c3.811,0,6.901,3.09,6.901,6.899C16.312,13.041,13.223,16.13,9.412,16.13z"></path>
                    </svg>
                    Search Litigation Cases</button>
            </form>
          </div>
        </div>