Home Artificial Intelligence Creating Synthetic User Research: Using Persona Prompting and Autonomous Agents Persona Prompting — Emulating People The How — Implementing Synthetic User Research Creating Actionable Outcomes — Summary Agent What’s Next — What Else Could We Do The Way forward for User Research Enjoyed This Story?

Creating Synthetic User Research: Using Persona Prompting and Autonomous Agents Persona Prompting — Emulating People The How — Implementing Synthetic User Research Creating Actionable Outcomes — Summary Agent What’s Next — What Else Could We Do The Way forward for User Research Enjoyed This Story?

0
Creating Synthetic User Research: Using Persona Prompting and Autonomous Agents
Persona Prompting — Emulating People
The How — Implementing Synthetic User Research
Creating Actionable Outcomes — Summary Agent
What’s Next — What Else Could We Do
The Way forward for User Research
Enjoyed This Story?

The method begins with scaffolding the autonomous agents using Autogen, a tool that simplifies the creation and orchestration of those digital personas. We will install the autogen pypi package using py

pip install pyautogen

Format the output (optional)— That is to make sure word wrap for readability depending in your IDE equivalent to when using Google Collab to run your notebook for this exercise.

from IPython.display import HTML, display

def set_css():
display(HTML('''

'''))
get_ipython().events.register('pre_run_cell', set_css)

Now we go ahead and get the environment setup by importing the packages and organising the Autogen configuration — together with our LLM (Large Language Model) and API keys. You need to use other local LLM’s using services that are backwards compatible with OpenAI REST service — LocalAI is a service that may act as a gateway to your locally running open-source LLMs.

I actually have tested this each on GPT3.5 gpt-3.5-turbo and GPT4 gpt-4-turbo-preview from OpenAI. You’ll need to contemplate deeper responses from GPT4 nevertheless longer query time.

import json
import os
import autogen
from autogen import GroupChat, Agent
from typing import Optional

# Setup LLM model and API keys
os.environ["OAI_CONFIG_LIST"] = json.dumps([
{
'model': 'gpt-3.5-turbo',
'api_key': '<>',
}
])

# Setting configurations for autogen
config_list = autogen.config_list_from_json(
"OAI_CONFIG_LIST",
filter_dict={
"model": {
"gpt-3.5-turbo"
}
}
)

We then must configure our LLM instance — which we’ll tie to every of the agents. This enables us if required to generate unique LLM configurations per agent, i.e. if we wanted to make use of different models for various agents.

# Define the LLM configuration settings
llm_config = {
# Seed for consistent output, used for testing. Remove in production.
# "seed": 42,
"cache_seed": None,
# Setting cache_seed = None ensure's caching is disabled
"temperature": 0.5,
"config_list": config_list,
}

Defining our researcher — That is the persona that may facilitate the session on this simulated user research scenario. The system prompt used for that persona includes a number of key things:

  • Purpose: Your role is to ask questions on products and gather insights from individual customers like Emily.
  • Grounding the simulation: Before you begin the duty breakdown the list of panelists and the order you wish them to talk, avoid the panelists speaking with one another and creating confirmation bias.
  • Ending the simulation: Once the conversation is ended and the research is accomplished please end your message with `TERMINATE` to finish the research session, that is generated from the generate_notice function which is used to align system prompts for various agents. You may even notice the researcher agent has the is_termination_msg set to honor the termination.

We also add the llm_config which is used to tie this back to the language model configuration with the model version, keys and hyper-parameters to make use of. We’ll use the identical config with all our agents.

# Avoid agents thanking one another and ending up in a loop
# Helper agent for the system prompts
def generate_notice(role="researcher"):
# Base notice for everybody, add your individual additional prompts here
base_notice = (
'nn'
)

# Notice for non-personas (manager or researcher)
non_persona_notice = (
'Don't show appreciation in your responses, say only what's obligatory. '
'if "Thanks" or "You are welcome" are said within the conversation, then say TERMINATE '
'to point the conversation is finished and that is your last message.'
)

# Custom notice for personas
persona_notice = (
' Act as {role} when responding to queries, providing feedback, asked on your personal opinion '
'or participating in discussions.'
)

# Check if the role is "researcher"
if role.lower() in ["manager", "researcher"]:
# Return the total termination notice for non-personas
return base_notice + non_persona_notice
else:
# Return the modified notice for personas
return base_notice + persona_notice.format(role=role)

# Researcher agent definition
name = "Researcher"
researcher = autogen.AssistantAgent(
name=name,
llm_config=llm_config,
system_message="""Researcher. You might be a top product reasearcher with a Phd in behavioural psychology and have worked within the research and insights industry for the last 20 years with top creative, media and business consultancies. Your role is to ask questions on products and gather insights from individual customers like Emily. Frame inquiries to uncover customer preferences, challenges, and feedback. Before you begin the duty breakdown the list of panelists and the order you wish them to talk, avoid the panelists speaking with one another and creating comfirmation bias. If the session is terminating at the tip, please provide a summary of the outcomes of the reasearch study in clear concise notes not firstly.""" + generate_notice(),
is_termination_msg=lambda x: True if "TERMINATE" in x.get("content") else False,
)

Define our individuals — to place into the research, borrowing from the previous process we are able to use the persona’s generated. I actually have manually adjusted the prompts for this text to remove references to the most important supermarket brand that was used for this simulation.

I actually have also included a “Act as Emily when responding to queries, providing feedback, or participating in discussions.” style prompt at the tip of every system prompt to make sure the synthetic persona’s stay on task which is being generated from the generate_notice function.

# Emily - Customer Persona
name = "Emily"
emily = autogen.AssistantAgent(
name=name,
llm_config=llm_config,
system_message="""Emily. You might be a 35-year-old elementary school teacher living in Sydney, Australia. You might be married with two kids aged 8 and 5, and you've gotten an annual income of AUD 75,000. You might be introverted, high in conscientiousness, low in neuroticism, and revel in routine. When shopping on the supermarket, you favor organic and locally sourced produce. You value convenience and use a web-based shopping platform. Resulting from your limited time from work and family commitments, you seek quick and nutritious meal planning solutions. Your goals are to purchase high-quality produce inside your budget and to search out recent recipe inspiration. You might be a frequent shopper and use loyalty programs. Your chosen methods of communication are email and mobile app notifications. You've got been shopping at a supermarket for over 10 years but in addition price-compare with others.""" + generate_notice(name),
)

# John - Customer Persona
name="John"
john = autogen.AssistantAgent(
name=name,
llm_config=llm_config,
system_message="""John. You might be a 28-year-old software developer based in Sydney, Australia. You might be single and have an annual income of AUD 100,000. You are extroverted, tech-savvy, and have a high level of openness. When shopping on the supermarket, you primarily buy snacks and ready-made meals, and you employ the mobile app for quick pickups. Your fundamental goals are quick and convenient shopping experiences. You occasionally shop on the supermarket and aren't a part of any loyalty program. You furthermore may shop at Aldi for discounts. Your chosen approach to communication is in-app notifications.""" + generate_notice(name),
)

# Sarah - Customer Persona
name="Sarah"
sarah = autogen.AssistantAgent(
name=name,
llm_config=llm_config,
system_message="""Sarah. You might be a 45-year-old freelance journalist living in Sydney, Australia. You might be divorced with no kids and earn AUD 60,000 per yr. You might be introverted, high in neuroticism, and really health-conscious. When shopping on the supermarket, you search for organic produce, non-GMO, and gluten-free items. You've got a limited budget and specific dietary restrictions. You might be a frequent shopper and use loyalty programs. Your chosen approach to communication is email newsletters. You exclusively shop for groceries.""" + generate_notice(name),
)

# Tim - Customer Persona
name="Tim"
tim = autogen.AssistantAgent(
name=name,
llm_config=llm_config,
system_message="""Tim. You might be a 62-year-old retired police officer residing in Sydney, Australia. You might be married and a grandparent of three. Your annual income comes from a pension and is AUD 40,000. You might be highly conscientious, low in openness, and like routine. You purchase staples like bread, milk, and canned goods in bulk. Resulting from mobility issues, you would like assistance with heavy items. You might be a frequent shopper and are a part of the senior citizen discount program. Your chosen approach to communication is unsolicited mail flyers. You've got been shopping here for over 20 years.""" + generate_notice(name),
)

# Lisa - Customer Persona
name="Lisa"
lisa = autogen.AssistantAgent(
name=name,
llm_config=llm_config,
system_message="""Lisa. You might be a 21-year-old university student living in Sydney, Australia. You might be single and work part-time, earning AUD 20,000 per yr. You might be highly extroverted, low in conscientiousness, and value social interactions. You shop here for popular brands, snacks, and alcoholic beverages, mostly for social events. You've got a limited budget and are at all times in search of sales and discounts. You aren't a frequent shopper but are considering joining a loyalty program. Your chosen approach to communication is social media and SMS. You shop wherever there are sales or promotions.""" + generate_notice(name),
)

Define the simulated environment and rules for who can speak — We’re allowing all of the agents we have now defined to sit down throughout the same simulated environment (group chat). We will create more complex scenarios where we are able to set how and when next speakers are chosen and defined so we have now a straightforward function defined for speaker selection tied to the group chat which is able to make the researcher the lead and ensure we go around the room to ask everyone a number of times for his or her thoughts.

# def custom_speaker_selection(last_speaker, group_chat):
# """
# Custom function to pick out which agent speaks next within the group chat.
# """
# # List of agents excluding the last speaker
# next_candidates = [agent for agent in group_chat.agents if agent.name != last_speaker.name]

# # Select the following agent based in your custom logic
# # For simplicity, we're just rotating through the candidates here
# next_speaker = next_candidates[0] if next_candidates else None

# return next_speaker

def custom_speaker_selection(last_speaker: Optional[Agent], group_chat: GroupChat) -> Optional[Agent]:
"""
Custom function to make sure the Researcher interacts with each participant 2-3 times.
Alternates between the Researcher and participants, tracking interactions.
"""
# Define participants and initialize or update their interaction counters
if not hasattr(group_chat, 'interaction_counters'):
group_chat.interaction_counters = {agent.name: 0 for agent in group_chat.agents if agent.name != "Researcher"}

# Define a maximum variety of interactions per participant
max_interactions = 6

# If the last speaker was the Researcher, find the following participant who has spoken the least
if last_speaker and last_speaker.name == "Researcher":
next_participant = min(group_chat.interaction_counters, key=group_chat.interaction_counters.get)
if group_chat.interaction_counters[next_participant] < max_interactions:
group_chat.interaction_counters[next_participant] += 1
return next((agent for agent in group_chat.agents if agent.name == next_participant), None)
else:
return None # End the conversation if all participants have reached the utmost interactions
else:
# If the last speaker was a participant, return the Researcher for the following turn
return next((agent for agent in group_chat.agents if agent.name == "Researcher"), None)

# Adding the Researcher and Customer Persona agents to the group chat
groupchat = autogen.GroupChat(
agents=[researcher, emily, john, sarah, tim, lisa],
speaker_selection_method = custom_speaker_selection,
messages=[],
max_round=30
)

Define the manager to pass instructions into and manage our simulation — Once we start things off we’ll speak only to the manager who will speak to the researcher and panelists. This uses something called GroupChatManager in Autogen.

# Initialise the manager
manager = autogen.GroupChatManager(
groupchat=groupchat,
llm_config=llm_config,
system_message="You might be a reasearch manager agent that may manage a gaggle chat of multiple agents made up of a reasearcher agent and plenty of people made up of a panel. You'll limit the discussion between the panelists and help the researcher in asking the questions. Please ask the researcher first on how they wish to conduct the panel." + generate_notice(),
is_termination_msg=lambda x: True if "TERMINATE" in x.get("content") else False,
)

We set the human interaction — allowing us to pass instructions to the varied agents we have now began. We give it the initial prompt and we are able to start things off.

# create a UserProxyAgent instance named "user_proxy"
user_proxy = autogen.UserProxyAgent(
name="user_proxy",
code_execution_config={"last_n_messages": 2, "work_dir": "groupchat"},
system_message="A human admin.",
human_input_mode="TERMINATE"
)
# start the reasearch simulation by giving instruction to the manager
# manager <-> reasearcher <-> panelists
user_proxy.initiate_chat(
manager,
message="""
Gather customer insights on a supermarket grocery delivery services. Discover pain points, preferences, and suggestions for improvement from different customer personas. Could you all please give your individual personal oponions before sharing more with the group and discussing. As a reasearcher your job is to make sure that you gather unbiased information from the participants and supply a summary of the outcomes of this study back to the super market brand.
""",
)

Once we run the above we get the output available live inside your python environment, you will note the messages being passed around between the varied agents.

Live python output — Our researcher talking to panelists

Now that our simulated research study has been concluded we’d like to get some more actionable insights. We will create a summary agent to support us with this task and likewise use this in a Q&A scenario. Here just watch out of very large transcripts would wish a language model that supports a bigger input (context window).

We want grab all of the conversations — in our simulated panel discussion from earlier to make use of because the user prompt (input) to our summary agent.

# Get response from the groupchat for user prompt
messages = [msg["content"] for msg in groupchat.messages]
user_prompt = "Here is the transcript of the study ```{customer_insights}```".format(customer_insights="n>>>n".join(messages))

Lets craft the system prompt (instructions) for our summary agent — This agent will deal with creating us a tailored report card from the previous transcripts and provides us clear suggestions and actions.

# Generate system prompt for the summary agent
summary_prompt = """
You might be an authority reasearcher in behaviour science and are tasked with summarising a reasearch panel. Please provide a structured summary of the important thing findings, including pain points, preferences, and suggestions for improvement.
This needs to be within the format based on the next format:

```
Reasearch Study: <></p><p>Subjects:<br><<Overview of the subjects and number, any other key information>></p><p>Summary:<br><<Summary of the study, include detailed analysis as an export>></p><p>Pain Points:<br>- <<List of Pain Points - Be as clear and prescriptive as required. I expect detailed response that can be used by the brand directly to make changes. Give a short paragraph per pain point.>></p><p>Suggestions/Actions:<br>- <<List of Adctions - Be as clear and prescriptive as required. I expect detailed response that can be used by the brand directly to make changes. Give a short paragraph per reccomendation.>><br>```<br>"""</p></span></pre> <p id="8599" class="pw-post-body-paragraph oc od gu oe b hs of og oh hv oi oj ok ol om on oo op oq or os ot ou ov ow ox gn bj"><strong class="oe gv">Define the summary agent and its environment</strong> — Lets create a mini environment for the summary agent to run. This can need it’s own proxy (<em class="qn">environment</em>) and the initiate command which is able to pull the transcripts (<em class="qn">user_prompt</em>) because the input.</p> <pre class="nr ns nt nu nv rh ri rj bo rk ba bj"><span id="90e9" class="rl ph gu ri b bf rm rn l ro rp">summary_agent = autogen.AssistantAgent(<br>name="SummaryAgent",<br>llm_config=llm_config,<br>system_message=summary_prompt + generate_notice(),<br>)<br>summary_proxy = autogen.UserProxyAgent(<br>name="summary_proxy",<br>code_execution_config={"last_n_messages": 2, "work_dir": "groupchat"},<br>system_message="A human admin.",<br>human_input_mode="TERMINATE"<br>)<br>summary_proxy.initiate_chat(<br>summary_agent,<br>message=user_prompt,<br>)</span></pre> <p id="1b93" class="pw-post-body-paragraph oc od gu oe b hs of og oh hv oi oj ok ol om on oo op oq or os ot ou ov ow ox gn bj">This offers us an output in the shape of a report card in Markdown, together with the flexibility to ask further questions in a Q&A mode chat-bot on-top of the findings.</p> <figure class="nr ns nt nu nv nw no np paragraph-image"> <div role="button" tabindex="0" class="nx ny fi nz bg oa"> <div class="no np si"><picture><source srcset="https://miro.medium.com/v2/resize:fit:640/format:webp/1*8pdQPGomkUpgtdry-thK2w.png 640w, https://miro.medium.com/v2/resize:fit:720/format:webp/1*8pdQPGomkUpgtdry-thK2w.png 720w, https://miro.medium.com/v2/resize:fit:750/format:webp/1*8pdQPGomkUpgtdry-thK2w.png 750w, https://miro.medium.com/v2/resize:fit:786/format:webp/1*8pdQPGomkUpgtdry-thK2w.png 786w, https://miro.medium.com/v2/resize:fit:828/format:webp/1*8pdQPGomkUpgtdry-thK2w.png 828w, https://miro.medium.com/v2/resize:fit:1100/format:webp/1*8pdQPGomkUpgtdry-thK2w.png 1100w, https://miro.medium.com/v2/resize:fit:1400/format:webp/1*8pdQPGomkUpgtdry-thK2w.png 1400w" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px" type="image/webp"></source><source data-testid="og" srcset="https://miro.medium.com/v2/resize:fit:640/1*8pdQPGomkUpgtdry-thK2w.png 640w, https://miro.medium.com/v2/resize:fit:720/1*8pdQPGomkUpgtdry-thK2w.png 720w, https://miro.medium.com/v2/resize:fit:750/1*8pdQPGomkUpgtdry-thK2w.png 750w, https://miro.medium.com/v2/resize:fit:786/1*8pdQPGomkUpgtdry-thK2w.png 786w, https://miro.medium.com/v2/resize:fit:828/1*8pdQPGomkUpgtdry-thK2w.png 828w, https://miro.medium.com/v2/resize:fit:1100/1*8pdQPGomkUpgtdry-thK2w.png 1100w, https://miro.medium.com/v2/resize:fit:1400/1*8pdQPGomkUpgtdry-thK2w.png 1400w" sizes="(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px"></source><img alt="" class="bg mv ob c" width="700" height="456" loading="lazy" role="presentation"></picture></div> </div><figcaption class="qi fe qj no np qk ql be b bf z dt">Live output of a report card from Summary Agent followed by open Q&A</figcaption></figure> </div> </div> <footer> <div class="td-block-row td-post-next-prev"> <div class="td-block-span6 td-post-prev-post"> <div class="td-post-next-prev-content"> <span>Previous article</span> <a href="https://aiguido.com/2024/03/a-full-guide-to-tremendous-tuning-large-language-models/">A Full Guide to Tremendous-Tuning Large Language Models</a> </div> </div> <div class="td-next-prev-separator"></div> <div class="td-block-span6 td-post-next-post"> <div class="td-post-next-prev-content"> <span>Next article</span> <a href="https://aiguido.com/2024/03/sora-first-impressions/">Sora: First Impressions</a> </div> </div> </div> <!-- author box --> <div class="author-box-wrap"> <a href="https://aiguido.com/author/admin/"> <img alt='' src='https://secure.gravatar.com/avatar/4827b301cebf256c159050bdb5b5d8129e293378a13cef2a9b306699df2c0438?s=96&d=mm&r=g' srcset='https://secure.gravatar.com/avatar/4827b301cebf256c159050bdb5b5d8129e293378a13cef2a9b306699df2c0438?s=192&d=mm&r=g 2x' class='avatar avatar-96 photo' height='96' width='96' decoding='async'/> </a> <div class="desc"> <div class="td-author-name vcard author"><span class="fn"> <a href="https://aiguido.com/author/admin/">admin</a> </span></div> <div class="td-author-url"><a href="https://aiguido.com">https://aiguido.com</a></div> <div class="td-author-description"> </div> <div class="clearfix"></div> </div> </div> </footer> </div> </article> <div class="comments" id="comments"> <div id="respond" class="comment-respond"> <h3 id="reply-title" class="comment-reply-title">LEAVE A REPLY <small><a rel="nofollow" id="cancel-comment-reply-link" href="/2024/03/creating-synthetic-user-research-using-persona-prompting-and-autonomous-agentspersona-prompting-emulating-peoplethe-how-implementing-synthetic-user-researchcreating-actionable/#respond" style="display:none;">Cancel reply</a></small></h3><form action="https://aiguido.com/wp-comments-post.php" method="post" id="commentform" class="comment-form"><div class="clearfix"></div> <div class="comment-form-input-wrap td-form-comment"> <textarea placeholder="Comment:" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea> <div class="td-warning-comment">Please enter your comment!</div> </div> <div class="comment-form-input-wrap td-form-author"> <input class="" id="author" name="author" placeholder="Name:*" type="text" value="" size="30" aria-required='true' /> <div class="td-warning-author">Please enter your name here</div> </div> <div class="comment-form-input-wrap td-form-email"> <input class="" id="email" name="email" placeholder="Email:*" type="text" value="" size="30" aria-required='true' /> <div class="td-warning-email-error">You have entered an incorrect email address!</div> <div class="td-warning-email">Please enter your email address here</div> </div> <div class="comment-form-input-wrap td-form-url"> <input class="" id="url" name="url" placeholder="Website:" type="text" value="" size="30" /> </div> <p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" /><label for="wp-comment-cookies-consent">Save my name, email, and website in this browser for the next time I comment.</label></p> <p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="Post Comment" /> <input type='hidden' name='comment_post_ID' value='13528' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> </p></form> </div><!-- #respond --> </div> <!-- /.content --> </div> </div> </div> </div> </div> <div class="td-footer-page td-footer-container td-container-wrap"> <div class="td-sub-footer-container td-container-wrap"> <div class="td-container"> <div class="td-pb-row"> <div class="td-pb-span td-sub-footer-menu"> </div> <div class="td-pb-span td-sub-footer-copy"> © Newspaper WordPress Theme by TagDiv </div> </div> </div> </div> </div> </div><!--close td-outer-wrap--> <script type="speculationrules"> {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/wp-content/uploads/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/Newspaper/*","/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} </script> <script id="tagdiv-theme-js-js" src="https://aiguido.com/wp-content/themes/Newspaper/includes/js/tagdiv-theme.min.js?ver=12.3.1"></script> <script async data-wp-strategy="async" fetchpriority="low" id="comment-reply-js" src="https://aiguido.com/wp-includes/js/comment-reply.min.js?ver=7.1.5"></script> <script id="wp-emoji-settings" type="application/json"> {"baseUrl":"https://s.w.org/images/core/emoji/17.0.2/72x72/","ext":".png","svgUrl":"https://s.w.org/images/core/emoji/17.0.2/svg/","svgExt":".svg","source":{"concatemoji":"https://aiguido.com/wp-includes/js/wp-emoji-release.min.js?ver=7.1.5"}} </script> <script type="module"> /*! This file is auto-generated */ var e="script#wp-emoji-settings",t=document.querySelector(e);if(!(t instanceof HTMLScriptElement))throw new Error("Element missing: "+e);const r=JSON.parse(t.text),s=(window._wpemojiSettings=r,"wpEmojiSettingsSupports"),o=["flag","emoji"];function i(e){try{var t={supportTests:e,timestamp:(new Date).valueOf()};sessionStorage.setItem(s,JSON.stringify(t))}catch(e){}}function c(e,t,n){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);t=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(n,0,0);const r=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);return t.every((e,t)=>e===r[t])}function p(e,t){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);var n=e.getImageData(16,16,1,1);for(let e=0;e<n.data.length;e++)if(0!==n.data[e])return!1;return!0}function u(e,t,n,r){switch(t){case"flag":return n(e,"\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f","\ud83c\udff3\ufe0f\u200b\u26a7\ufe0f")?!1:!n(e,"\ud83c\udde8\ud83c\uddf6","\ud83c\udde8\u200b\ud83c\uddf6")&&!n(e,"\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f","\ud83c\udff4\u200b\udb40\udc67\u200b\udb40\udc62\u200b\udb40\udc65\u200b\udb40\udc6e\u200b\udb40\udc67\u200b\udb40\udc7f");case"emoji":return!r(e,"\ud83e\u1fac8")}return!1}function f(e,t,n,r){let a;const s=(a="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?new OffscreenCanvas(300,150):document.createElement("canvas")).getContext("2d",{willReadFrequently:!0}),o=(s.textBaseline="top",s.font="600 32px Arial",{});return e.forEach(e=>{o[e]=t(s,e,n,r)}),o}function a(e){var t=document.createElement("script");t.src=e,t.defer=!0,document.head.appendChild(t)}r.supports={everything:!0,everythingExceptFlag:!0},new Promise(t=>{let n=function(){try{var e=JSON.parse(sessionStorage.getItem(s));if("object"==typeof e&&"number"==typeof e.timestamp&&(new Date).valueOf()<e.timestamp+604800&&"object"==typeof e.supportTests)return e.supportTests}catch(e){}return null}();if(!n){if("undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas&&"undefined"!=typeof URL&&URL.createObjectURL&&"undefined"!=typeof Blob)try{var e="postMessage("+f.toString()+"("+[JSON.stringify(o),u.toString(),c.toString(),p.toString()].join(",")+"));",r=new Blob([e],{type:"text/javascript"});const a=new Worker(URL.createObjectURL(r),{name:"wpTestEmojiSupports"});return void(a.onmessage=e=>{i(n=e.data),a.terminate(),t(n)})}catch(e){}i(n=f(o,u,c,p))}t(n)}).then(e=>{for(const n in e)r.supports[n]=e[n],r.supports.everything=r.supports.everything&&r.supports[n],"flag"!==n&&(r.supports.everythingExceptFlag=r.supports.everythingExceptFlag&&r.supports[n]);var t;r.supports.everythingExceptFlag=r.supports.everythingExceptFlag&&!r.supports.flag,r.supports.everything||((t=r.source||{}).concatemoji?a(t.concatemoji):t.wpemoji&&t.twemoji&&(a(t.twemoji),a(t.wpemoji)))}); //# sourceURL=https://aiguido.com/wp-includes/js/wp-emoji-loader.min.js </script> </body> </html>