Collaboration: The Key to Creativity for Mother Artists

Collaboration: The Key to Creativity for Mother Artists

Collaboration is Key

Mothers Institute for Collaboration and Art (MICA) is screaming for collaboration. Collaborating is invaluable for artists for innovation, creativity, and community. As we know, parents who are artists have unique circumstances; the caretaking of children takes up your time, to be blunt. When you become a parent, suddenly, you’re responsible for the well-being and future of a vulnerable human life. For most parents, this means you’re looking at the world from a different lens.

Heck, you’ve got neuroplasticity changing up your brain. It also means that whatever life you had created now needs to fit kids into it. So, if you’re an artist, well, finding time to create is even more precious than before.

Balancing the Two Sides of Parent Artists

Getting out of the caretaker’s head and into the artist’s head can be challenging. However, as artists, we must! The world depends on us. Listen, we know collaboration has long been a thing of art, and now, other industries have caught on. By the way, the Washington Post article linked talks about the five things Gen Z wants in the workplace:

1.  Customized career paths,

2.  Constant opportunities to learn,

3.  Purpose-driven work,

4.  Flexible work arrangements,

5.  Collaborative environments.

Hello? That is exactly what (Gen X) MICA founder Lyza Fennell is all about. Collaborating on projects can be particularly advantageous for parents to balance their creative practice with parenting responsibilities.  Finding time to create is a major challenge for parents, with all the obligations that come with parenting today.

The Benefits of Collaboration for Mother Artists

The benefits of collaboration are numerous! Here are a few ways to consider how it can help:

      • Providing support and community: artists can feel isolated and alone in their creative journey. Collaboration can give them a supportive community of fellow artists who understand their challenges.  Sometimes isolation is good, but not always.
      • Reducing time commitments: collaborating with others can help reduce your workload and save time for other important tasks. This is especially helpful if you have limited time to create art.
      • Expanding creative possibilities: Collaboration can help mother artists expand their creative possibilities. By bringing in new ideas and perspectives from other artists, you can push the boundaries of your art and create something truly innovative.

In other words, collaboration is a valuable approach that offers several benefits and serves as a support system for artist parents. By working together, these talented individuals can share ideas, resources, and experiences, which can help them overcome the challenges of balancing their creative pursuits and parental responsibilities. Therefore, this collaborative approach can also create a more inclusive environment within the arts community, where everyone can feel supported and empowered to pursue their passions.

Group of women standing and listening enthusiastically.

The Pathway to Collaboration

Time is precious when you are a parent and artist. There are so many demands on your time, and finding the time to create art can be hard. But collaboration can be a pathway to making art even when you’re busy.

Collaboration can help parent artists overcome the challenges of balancing their creative practice with parenting responsibilities in several ways. For example, collaboration can:

      • Overcoming creative blocks: Sometimes, mother artists can get stuck in a creative rut. Collaboration can help them break out of this rut by giving them new ideas and perspectives.
      • Learning new skills: Collaboration can be a great way to learn new skills from other artists. This can help mother artists grow as artists and create even more amazing work.
      • Building a network: Collaboration can help mother artists build their network of contacts in the art world. This can lead to more opportunities to exhibit and sell their art.

In other words, it is a powerful tool to help artists who are parents overcome the challenges of balancing their creative practice with parenting responsibilities. It’s a great way to gain support and community, reduce time commitments, expand creative possibilities, overcome creative blocks, learn new skills, and build your network.

inspiration, teamwork, collaboration, success, trust

Types of Collaboration

On-site collaboration: On-site collaborations such as artist residencies and workshops offer a hands-on experience. These immersive programs provide a unique opportunity to work closely with other artists, learn new techniques, and gain inspiration.

Virtual collaboration: In today’s digital age, virtual collaboration is growing increasingly popular. Online platforms allow you to connect with artists from around the world. You could collaborate on a digital art project, host a virtual workshop, or organize an online art exhibition.

Collaboration: A Catalyst for Innovation

Collaboration can be a catalyst for innovation. Individuals can pool their diverse perspectives, experiences, and expertise by working together to generate new and creative ideas, such as a group of artists with different backgrounds and skills could collaborate on a project to create a new form of art that combines elements of different disciplines.

Here are some specific examples of how collaboration can benefit mother artists:

Workshopping: Workshops can be a great way for mother artists to learn new skills, share ideas, and get feedback from other artists.

Critique groups: Critique groups can be a supportive and constructive way for mother artists to get feedback on their work.

Weekly meetings: Weekly meetings with other mother artists can provide a much-needed support system and accountability for them trying to balance their creative practice with their parenting responsibilities.

Successful forms of collaboration can lead to a more dynamic and productive environment where different voices and opinions are valued and leveraged for the greater good.

Ultimately, the power of collaboration lies in its ability to bring people together, fostering a sense of community and shared purpose that can drive real change and progress.

Finding the Right Collaborators

Finding the right collaborator can be daunting, but it’s essential for mother artists who want to collaborate effectively. Finding people who share your artistic vision and goals is important when looking for collaborators. You also want to find people who are reliable, hardworking, and easy to get along with.

Here are a few tips for finding the right collaborators:

      • Attend art events and join art organizations. This is a great way to meet other artists and learn about their work.
      • Reach out to artists whose work you admire. Send them a message or email and introduce yourself.
      • Look for collaborators online. There are many websites and online forums where artists can connect with each other.

Once you’ve found a few potential collaborators, getting to know them better is important. Meet up with them in person and talk about your work. This will help you to see if you’re a good fit for each other.

Here are a few questions you can ask potential collaborators:

      • What are your artistic goals?
      • What are your strengths and weaknesses as an artist?
      • What are you looking for in a collaborator?
      • How do you like to work?

If you find that you have a good rapport with a potential collaborator and share similar goals, you’re well on your way to a successful collaboration.

Social media platforms like Instagram or Facebook can also be useful tools to connect with other artists around the globe. You can search for hashtags related to your art form or interests and likely find other artists using those hashtags. You can also join groups on social media for artists; this is a great way to connect with other artists interested in collaborating.

five women meeting inside at table

Balancing Artistic Endeavors and Parenting

Juggling your artistic pursuits with motherhood can be challenging but not impossible. Here are a few tips for balancing these two important parts of your life:

      • Set boundaries. It’s important to set boundaries between your artistic and parenting time. This means setting aside specific times each day or week for your art and sticking to those times as much as possible. It also means not letting your parenting responsibilities seep into your artistic time and vice versa.
      • Manage your time effectively. This is essential for any busy parent, but it’s especially important for mother artists who want to make time for their art. Several time management techniques, such as batching tasks and using a planner, can be helpful.
      • Ask for help. Don’t be afraid to ask for help from your partner, family, and friends. This can free up some of your time to focus on your art.

In this way, collaboration can help, as shared projects can divide the workload and offer mutual support. Find other mother artists who are also passionate about their art and work on projects together. This can be a great way to get support and feedback, and it can also help you to stay motivated.

Want to Collaborate with Non-Artists?

Artists and non-artists can benefit greatly from collaboration. Artists can bring their creativity and vision to the table, while non-artists can provide expertise in other types of new technologies, processes, and fields of knowledge. This can lead to innovative and exciting new art that would not be possible without collaboration.

Here are some examples of how artists can collaborate with non-artists:

      • With technologists and scientists: Artists can collaborate with technologists and scientists to create new and engaging art that uses cutting-edge technology. This could involve creating interactive installations, virtual reality experiences, or augmented reality artworks.
      • With educators: Artists can collaborate with educators to create new and engaging art education programs. This could involve developing a new curriculum, leading workshops, or creating interactive art installations.
      • With community organizers: Artists can collaborate with community organizers to create art addressing social and environmental issues. This could involve creating murals, public art installations, or theater productions.
      • With businesses: Artists can collaborate with businesses to create art promoting their products or services. This could involve designing logos, creating marketing materials, or developing interactive exhibits.

There are many other possibilities for collaboration between artists and non-artists. The key is to be open to new ideas and to think outside the box. By collaborating with others, artists can have a greater impact on the world and make a difference in the lives of others.

group shot artist moms and kids

Where Do You Find the Collaborators?

Collaboration is essential for mother artists who want to take their art to the next level. By collaborating with other artists, mother artists can share ideas, learn new skills, and get feedback on their work. They can also build a community of support and accountability.

There are many places where mother artists can find collaborators. Here are a few suggestions:

        • Online communities: There are many online communities where mother artists can connect with each other and find potential collaborators. Some popular online communities include Meetup, Facebook groups, and Twitter.
        • Conferences and workshops: Attending conferences and workshops that bring together professionals from various fields is an excellent way to network with potential collaborators and stay current on the latest technologies and trends.
        • Reach out to local organizations: Many local organizations support collaboration between artists. Reaching out to these organizations is a great way to find collaborators in your area.

Finding collaborators can be daunting, but it’s essential for mother artists who want to collaborate effectively. Mother artists can find collaborators who share their artistic vision and goals by following the tips in this section.

It's Time to Get Out There and Collaborate

Collaborating with other artists can greatly enhance your artistic practice. It can broaden your creative range, expose you to different styles and techniques, and provide a platform to share and exchange ideas.

Moreover, it can help you build a network of like-minded individuals who can provide support, feedback, and encouragement.

Remember, your creativity does not have to be a solitary journey. Collaboration can open doors to new possibilities and experiences.

So, step out, reach out, and embrace the power of working together. Your art, your passion, and your creative journey deserve it.

Artist moms, are you ready to take your creativity to the next level? Collaboration is the key to unlocking new ideas, expanding your artistic horizons, and building a supportive community. Comment below, tell us what you’re thinking about or your experiences with collaborations.

Want to Join our Collaborative in Northampton, MA?

Email us or comment below today!

Sources:

Future World-building Depends on Artists and Collaborative Networks” By Kamal Sinclair; National Endowment for the Arts.

Have an event? Share it on our events calendar!

Breaking Barriers: How to Create a More Inclusive Art World for Women and Moms

Breaking Barriers: How to Create a More Inclusive Art World for Women and Moms

The Challenges Facing Women and Moms in the Art World

Women and mothers in the arts have long faced systemic barriers that have prevented them from thriving. These barriers include inadequate access to affordable childcare, gender bias, time constraints, and isolation.

Addressing these obstacles with urgency and determination is imperative to achieve significant progress toward a truly inclusive and equitable art community. We must push for change now.

Here are some specific actions we can take:

      • Increase access to affordable childcare. This will allow mothers to have more time to create art without worrying about their children.
      • Challenge gender stereotypes in the art world. This will help to ensure that women’s work is seen and recognized.
      • Provide flexible work arrangements for mothers. This will allow mothers to balance their artistic careers with their family responsibilities.
      • Create opportunities for mothers to connect with each other. This will help to combat isolation and create a sense of community.

These actions allow us to cultivate an art world that empowers and supports women and mothers. Their voices will be heard, and their work will be showcased, allowing for a more diverse and dynamic art scene that accurately represents our society’s richness.

Increase Representation in Leadership

To achieve greater gender parity in the arts, it is crucial to ensure that women have equal opportunities for leadership positions. This can be accomplished by nominating more women for these roles, providing mentorship and training programs, and offering flexible work arrangements that allow women to balance their careers with family responsibilities. By promoting women into leadership positions, we can bring a wider range of perspectives to the table, leading to a more diverse and inclusive art community.

We were so pleased that for our inaugural opening night gala, we had two mothers in government attend. And the current mayor of Northampton, MA, Gina-Louise Sciarra, is a mother. Heck, 2021 brought us our first woman, and mother, to hold the office of Vice President with Kamala Harris, the highest-ranking mom ever in US history.

This is just the beginning. It is essential to ensure equal access for women and mothers to the arts. They deserve the same opportunities as men and should be included in all discussions. This way, we can create a just and inclusive art world that benefits everyone.

The Future of the Art World

The art world is at a crossroads. We can either continue to discriminate against mothers or create a more inclusive and equitable environment for all artists, regardless of their parental status. The future of the art world depends on the choices we make today.

Establishing a more inclusive and fair art world for women and mothers requires collaboration from everyone. We must increase the representation of women in leadership positions, advocate for policies that support working mothers, challenge gender stereotypes, and support organizations that promote equity. By taking these steps, we can gradually create a level playing field for women in the arts, enabling them to express their artistic abilities without barriers. As we strive for a more inclusive and elevated perspective in society, let’s not forget the immense contribution of mother artists to the creative world. We should celebrate and embrace their talents in all aspects of the art world.

Three women mean business

Advocate for Policies that Support Working Moms

Mothers disproportionately shoulder the unpaid labor of parenting. A 2020 New York Times Opinion piece estimated that women’s unpaid labor is worth $10.9 trillion worldwide.

Balancing motherhood and a career is challenging for many mothers. It can be even more daunting in the arts, where jobs often come with long hours and unpredictable schedules. However, we can make it easier for mothers in the arts to maintain their careers while raising a family by advocating for policies like paid parental leave, affordable childcare, and flexible work arrangements. That’s where women-friendly government officials can help.

Challenge Gender Stereotypes

Gender stereotypes continue to permeate the art world, resulting in a lack of recognition and opportunities for women. It’s crucial to commission more works from female artists, showcase more women artists in exhibitions and performances, and give female artists more chances to discuss their experiences as both artists and mothers. Event organizers, exhibition curators, and award panels must be held accountable for promoting diverse artists. It’s time to take action and put an end to this injustice.

Mom teaching girl to paint on canvas

Support Organizations Promoting Equity

Many organizations are working to create a more equitable art world. Supporting them can help to bridge the gap.

The Geena Davis Institute on Gender in Media is a non-profit organization dedicated to improving the representation of girls and women in media. Founded by Academy Award-winning actor Geena Davis, the organization works to make gender equality in film and television a reality through research, education, and advocacy.

The institute has conducted groundbreaking research that has revealed the extent to which gender stereotypes are perpetuated in media. For example, the institute found that women are underrepresented in leading roles in film and television, and when they are represented, they are often depicted in stereotypical ways.

The institute also provides educational materials and resources for teachers, parents, and media professionals who want to make a difference in this space. These materials can help people to understand the importance of gender equality in media and how they can work to challenge gender stereotypes.

In addition to the Geena Davis Institute on Gender in Media, many other organizations are working to promote equality for women in the art world. These organizations include WomenArts, the National Women’s Law Center, MomsRising, Moms F1rst, Parent Artist Advocacy League for Performing Arts + Media, and Mothers Institute for Collaboration and Art.

To truly empower mothers and women in their creative endeavors, it is imperative that we throw our support behind organizations that actively challenge gender inequality within the art world. By doing so, we can help facilitate increased funding and the implementation of policies that directly benefit women and their pursuit of artistic excellence.

The Future of the Art World Depends on It

Acknowledging the numerous obstacles mothers face in the creative arts is imperative. Sadly, these women’s individual experiences often go unnoticed. However, we possess the ability to rectify this. By investing in the futures of women and mothers, we can establish a supportive and uplifting art world that facilitates everyone in realizing their complete potential. This is a critical step towards securing the future of the art world.

The art world reflects the larger society, and we must continue to strive for equity and inclusion. Women and mothers are essential to any creative field and should be respected, valued, and celebrated.

By recognizing our shared responsibility to create a more equitable future for all artists, regardless of gender or parental status, we can create the conditions for a more diverse and vibrant art world. It is imperative that we prioritize inclusivity and equity in the art world to create equal opportunities for all to pursue their dreams and create meaningful work.  The necessary support and empowerment to mothers in the art world should not be ignored. The future of the art world depends on it.

The Importance of Supporting Mother Artists

It is widely recognized that women have made significant contributions to the arts despite their obstacles. It is also acknowledged that balancing a family and career can be difficult today. Our society has evolved, with many families having two working parents or being headed by a single parent. That said, it is clear that we are not providing enough support for families as a whole.

It is time that we recognize the incredible contribution of mother artists worldwide. From painters to musicians, writers to filmmakers, moms are making their mark in the creative world, and it is time for us to celebrate their achievements.

Many women artists have also acknowledged that they had to choose between a career or a family. And we know not everyone wants to be a mother, but those who are both mothers and artists, need unique support.

By supporting organizations that aim to support women and mothers as artists, we can help ensure that mother artists get access to the resources they need to continue creating and pushing boundaries in the arts. Recognizing and respecting the unique perspectives of mothers is absolutely essential. It is imperative to create an environment that is inclusive and values the opinions of all.

Only then can we truly create an equitable future for everyone in the creative world. Here are some specific things that we can do to support mother artists:

      • Advocate for more representation of women in leadership positions in the creative industries.
      • Support organizations that provide support and resources for women in art.
      • Buy art by mother artists.
      • Speak out against gender discrimination in the art world.

The creative world has long been male-dominated, but mother artists are breaking down these barriers and making their mark. Their work is often underrepresented in the art world, but it is essential that we recognize and celebrate their contributions.

By supporting mother artists, we can help to create a more inclusive and equitable art world for all. We can also help to ensure that mothers’ voices are heard, and their perspectives are valued.

Challenges Faced by Women and Moms in the Art World

Many women and mothers continue to encounter various obstacles in the art world that hinder their potential for success. One of these challenges is the need for adequate representation of women in leadership roles in the creative industries. Even though women constitute a substantial portion of individuals involved in art and its production, they occupy less than a quarter of top creative positions. Several factors, such as gender discrimination and unconscious bias, cause this inequality.

Balancing childcare and household responsibilities with an art career can be challenging for freelance and contractor mothers. It’s important to advocate for more opportunities in the art world for women and mothers, as this can bring fresh perspectives and ideas to the field.

woman-looking-at-camera-holding-banner-activists

The Financial Challenges of Being a Female Creative

Economic Barriers

Economic barriers can be a major roadblock for many female creatives. Due to institutional bias and discrimination, many female and mom-owned creative businesses that seek investment capital or funding from traditional sources need help. We must continue to strive towards creating an equitable economic environment where all artists are supported financially so that they can thrive.

Creating an Equitable Future

To create an equitable future for all women and mothers in the creative world, we must continue to support access to resources and funding for female creatives, recognize the unique perspectives and issues that mothers encounter, and create an environment where their voices are heard and valued.

With more awareness and action on these issues, we can continue celebrating the powerful work of female creatives throughout history and create a more inclusive and equitable future for all women in the creative industries.

The Art World's Mother Problem

The art world has a long history of discriminating against mothers. In the early 20th century, the avant-gardes viewed domesticity as a drag, and women artists who became mothers were often judged harshly. Even today, mothers in the art world face significant challenges, such as a lack of childcare options, a bias toward youth, and the expectation that they will have to choose between motherhood and a successful career.

These challenges have a real impact on women’s careers in the art world. A recent study by the Freelands Foundation found that only 32% of artists represented by London’s leading galleries are female. This suggests that motherhood is a significant barrier to women’s success in the art world.

There are several things that can be done to address this problem. First, we need to challenge the stereotypes that surround motherhood. Mothers are just as creative and committed to their work as non-mothers. Second, we must provide more support for working parents in art. This could include things like on-site childcare, flexible work arrangements, and paid parental leave.

Finally, we must change how we think about motherhood and work. Motherhood should not be seen as a liability but rather as an asset. Mothers bring a unique perspective and skills to the workplace and should be valued for their contributions.

mom with three kids sitting on couch cuddled together

How You Can Help Create a More Equitable Art World for Women and Moms

The art world is at a crossroads. We can either continue to discriminate against mothers or create a more inclusive and equitable environment for all artists, regardless of their parental status. The future of the art world depends on the choices we make today.

Here are some specific things you can do to help:

      • Support organizations that are working to promote equity for women and mothers in the arts. These organizations are on the frontlines of the fight for change, and your support can make a real difference.
      • Advocate for policies that support working moms. This includes paid parental leave, affordable childcare, and flexible work arrangements. When moms have the support they need, they can be more successful in their careers and in their art.
      • Challenge gender stereotypes in the art world. When we see mothers as artists, we challenge the idea that motherhood is a liability. We also open up new possibilities for women and moms to pursue their creative dreams.
      • Commission works by women artists. When you commission a work by a woman artist, you are sending a message that you value their work and their contributions to the art world.
      • Feature more women artists in exhibitions and performances. When you feature women artists in exhibitions and performances, you are helping to increase their visibility and reach.
      • Provide opportunities for female artists to discuss their experiences as artists and moms. When you give female artists a platform to share their stories, you are helping to break down the barriers that prevent them from succeeding.
      • Hold event organizers, exhibition curators, and award panels accountable. Ask them to explain their selection criteria and ensure their lineups are diverse. When you hold these gatekeepers accountable, you are helping to create a more equitable art world for all.

Final Thoughts

Before you go…

      • Your voice matters. When you speak up about the challenges facing women and moms in the art world, you are helping to raise awareness and create change.
      • Don’t be afraid to get involved. There are many ways to get involved in the fight for equity in the art world. Find an organization that aligns with your values, and get started today.
      • Celebrate the work of women and moms in the arts. When you see the work of a woman artist, take a moment to appreciate their talent and contributions to the art world.

Recognizing and honoring the invaluable contributions of mother artists to the creative world is crucial as we aim to cultivate a more inclusive and elevated societal perspective. These exceptional talents deserve to be celebrated and seamlessly integrated into every facet of the creative arts.

The world of art mirrors our society. To build a more just and inclusive society, we need to begin by fostering a more just and inclusive art world. One way we can achieve this is by supporting mothers who are artists and by challenging preconceived notions regarding motherhood. By working together, we can establish a more equitable art world that embraces women and mothers.

Sources:

Judah, Hettie. How Not to Exclude Artist Mothers (and Other Parents) (Hot Topics in the Art World) (pp. 13-16). Lund Humphries. Kindle Edition. 

Have an event? Share it on our events calendar!

Theatre: A Man’s World, But What About Mothers?

Theatre: A Man’s World, But What About Mothers?

Mothers in Theatre: The Double Bind

Theatre has long been a male-dominated institution. From the actors on stage to the directors and producers behind the scenes, men have traditionally held power in the theatre world. But what about mothers?

Mothers who work in theatre often face a double bind. They are expected to be just as dedicated to their work as their male counterparts, but they are also expected to be the primary caregivers for their children. This can be a difficult balance to strike, leading to significant stress for mothers.

The theatre industry often overlooks the challenges that mothers face. Work schedules are often long and unpredictable, and childcare can be expensive and difficult to find. As a result, many mothers feel like they have to choose between their careers and their families.

Generation X woman (mom) with upscale hair ready for her scene

This is a problem for mothers and the theatre industry as a whole. Mothers bring a wealth of experience and talent to the table, and their absence is a loss to the field.

The theatre industry needs to do more to support mothers. This means providing flexible work arrangements, offering childcare assistance, and creating a more family-friendly culture. It also means changing the way that we think about motherhood. Motherhood is not a liability; it is an asset.

When we value the work of mothers, we make the theatre industry a better place for everyone.

Photographic portrait of actor mom with a spotlight on background

The Work-Life Balance Dilemma for Mothers in Theatre

The theatre industry has long ignored mothers’ challenges balancing work and family responsibilities. This is because motherhood is often seen as a personal rather than a professional issue. As a result, mothers often feel pressure to “appear” childless to be taken seriously in their careers.

This pressure can be incredibly stressful, leading to several negative consequences for mothers in theatre. For example, women who are mothers may be less likely to be hired or promoted, and they may also be more likely to experience burnout.

This is unacceptable.

Mothers are an essential part of the theatre industry, and they deserve to be treated with respect. We must start by recognizing that motherhood is not just a personal issue. It is also a professional issue, significantly impacting women’s ability to succeed in their careers.

Once we acknowledge this, we can make the theatre industry more supportive of mothers. This means providing flexible work arrangements, offering childcare assistance, and creating a more family-friendly culture.

We need to do better for mothers in theatre.

They deserve successful careers without choosing between work and their families. We need to create an industry that welcomes and supports mothers so they can reach their full potential.

Theater as a Tool for Social Change: Marie NDiaye's Theater of the Mothers

French playwright Marie NDiaye uses her work to explore the role of mothers in a patriarchal society. Her plays often feature mothers made to make difficult choices to protect their children. NDiaye’s work is important because it gives voice to the experiences of marginalized women and challenges the traditional view of motherhood as a selfless act.

NDiaye’s plays are metadramas, meaning they reflect on the nature of theater itself. This is evident in how her plays often feature mothers compelled to play roles prescribed by society. For example, in the play Papa Doit Manger, the mother is driven to sacrifice her own needs to care for her husband and children. This role is both physically and emotionally demanding, ultimately leading to her death.

NDiaye’s work is a powerful reminder of how theater can be used to challenge patriarchal oppression. Her plays offer a critical view of how society expects mothers to behave, showing how these expectations can be harmful. By interrogating the role of theater in the oppression of mothers, NDiaye’s work shows how theater can raise awareness of social issues and offer a path toward social change.

Mother working at home with baby reading email from theatre company

Join Us in Supporting Mothers in Theatre

Gender discrimination is prevalent in all professions, and exorbitant childcare costs and lack of availability continue to struggle when caregivers need to work. Our social order still runs on an outmoded conception, assuming that one parent is at home.

However, theatrical motherwork goes beyond working parents’ everyday struggles in fulfilling the theatre’s unique demands, from production schedules to fundraising, promotional, and networking events. These are all predicated on the idea that the theatre professional is available around the clock. There can be an attitude within the theatre, as well, that when one becomes a parent, there are unstated consequences for the decision.

Further, theatre professionals who have children need to create the illusion that they can work any time and any number of hours to stay in the race, yet if they do that, they feel they are sacrificing their children, and guilt ensues. It takes careful planning and negotiations on the parent’s part; balance is difficult. Support is not here yet.

Mothers in Theatre: The Unpaid Work

Mothers in theatre need to make difficult choices and many sacrifices. Being part of a play, which historically does not pay much, means that any money would go toward a babysitter; therefore, it stops becoming a means for income but rather a non-paying hobby. It only furthers the story of the unpaid work of mothers.

Theatre mothers with young children without a support system must choose: to work or be a mom. Like many institutions, theatre must examine how it operates from an outdated patriarchal mode. Access to affordable childcare, government subsidies for self-employed and contracted, flexible schedules, and flexible medical leave are imperative for theater. Further, patrons should seek out art/theatre by and about mothers. Marie NDiaye’s theatre is an important endeavor, bringing attention to the issues of mothers and the theatre on the stage. It is possible to make theatre more inclusive to mothers, although it will take a multi-dimensional approach and a shakeup from the institution to the group to the individual.

Please join us in supporting these efforts to make theatre more inclusive to mothers. Together, we can create a more equitable and supportive environment for all theatre professionals, regardless of parental status.

 

Make Theatre More Inclusive to Mothers

In conclusion, theatre needs to be more inclusive to mothers. We need to create an industry that is welcoming and supportive of mothers, so that they can reach their full potential.

Here are some specific actions that the theatre industry can take to support mothers:

    • Provide flexible work arrangements: This could include things like telecommuting, flextime, and job sharing.
    • Offer childcare assistance: This could include things like on-site childcare, subsidies for childcare, or help finding childcare providers.
    • Create a more family-friendly culture: This could include things like providing paid parental leave, flexible work hours, and a supportive work environment.
    • Change the way that we think about motherhood: We need to start seeing motherhood as an asset, not a liability. Mothers bring a wealth of experience and talent to the table, and we must value their contributions.

Call to action:

We urge you to join us in supporting these efforts to make theatre more inclusive to mothers. Together, we can create a more equitable and supportive environment for all theatre professionals, regardless of parental status.

Sources:

Rusch-Drutz, Corinne. 2004. “Stage Mothers: A Qualitative Analysis of Women’s Work Experiences As Mothers in Toronto Theatre”. Journal of the Motherhood Initiative for Research and Community Involvement 6 (2). https://jarm.journals.yorku.ca/index.php/jarm/article/view/4925.

 

Ndiaye, Noémie. “CHAPTER XXI. Theater of the Mothers: Three Political Plays by Marie NDiaye” In Women Mobilizing Memory edited by Ayşe Gül Altınay, María José Contreras, Marianne Hirsch, Jean Howard, Banu Karaca and Alisa Solomon, 363-380. New York Chichester, West Sussex: Columbia University Press, 2019. https://doi.org/10.7312/alti19184-023



Have an event? Share it on our events calendar!

Open Mic Nights as a Tool for Performing Artist Moms

Open Mic Nights as a Tool for Performing Artist Moms

Finding the balance between your passions and responsibilities can be challenging with the demands of motherhood, family life, and career goals. However, it’s crucial to keep exploring new opportunities and expanding your artistic reach. Open mic nights offer a unique opportunity to showcase your talents, meet new people, and grow your network.  These events allow artists of all skill levels to showcase their talents and receive audience feedback. This post will explore how you can navigate open mic nights as a mother/parent, from selecting appropriate material to building connections with other performers and venue owners. We’ll also discuss the positive impact of participating in open mics on your skills and career as a performing artist.

Research and Preparation

Before you dive into open mic nights, it is essential to research and prepare. In starting this article, finding an up-to-date comprehensive list was challenging, as many venues closed with the pandemic, and others either stopped their open mics or only did them seasonally. The last thing you want to do is arrange for a babysitter, arrive ready for your performance, and learn that the date listed was for last year. So, find local venues that host open mic nights and attend as an audience member. This way, you will get a sense of the vibe and style of the performances, which will help you prepare the right material that aligns with the audience’s interests. Also, research the venue’s policies, such as time limits, sign-up procedures, and content restrictions, ensuring you are well-prepared and can showcase your best work. Finding the right venue can make your experience more successful.

 

Knowing what type of audience you’ll be performing for is essential. Some open mic nights draw in a more mature crowd, while others cater to a younger demographic. Some events even have specific themes, such as poetry or hip-hop nights. Research various open mic nights in your area and attend a few as an audience member. You’ll get a sense of which event will be best for you. Don’t be afraid to ask other performers for recommendations. If you’re new to open mic nights, starting with smaller events before moving on to larger venues is a good idea. It will help you build confidence and get comfortable performing in front of an audience.

Choosing the Right Material

Once you’ve found your open mic night, select material that matches the tone and audience. The key to nailing an open mic performance is selecting the appropriate material. You want to choose pieces that highlight your strengths and resonate with the audience. Avoid performing pieces that are controversial, offensive, or too long. Focus on the work that showcases your unique voice and tap into what the audience wants to hear. Start by choosing something you’re comfortable with, showcasing your strengths as an artist. But don’t be afraid to push your boundaries by trying out new material. Before taking the stage, practice and time your piece. Most open mic nights have a time limit, so make sure your performance fits. Choosing the right content for your staged performance is one of the most crucial steps. We advise selecting familiar material you know well, reflecting your artistry’s message. If you are a musician, choose a song you can perform confidently. If you are a writer, choose a piece representing your style and capturing the audience’s attention. Moreover, make sure the material is appropriate for the venue and audience.

Prepare Yourself Mentally

The thought of performing in front of others can be intimidating, so practice visualization techniques, deep breathing exercises, and positive affirmations to calm nerves. Visualize your performance and receive warm applause from the audience. Rehearse in front of your kids. Isn’t that what they’re there for? 🤭

Building Connections

As a mother/parent, you may have personal stories to share that can connect with audiences. It’s essential to relate with your audience and build rapport. Be sure to introduce yourself to the venue owner and other performers. A simple introduction and a quick chat after your performance can go a long way. Not only will it help you build a relationship with the venue, but it can also lead to collaborative opportunities with other performers down the line.

Networking is vital to success in the performing arts industry. Open mic nights provide a great opportunity to connect with other performers and venue owners who can offer you options in the future. Feel free to share your contact information or social media handles. You never know whom you might meet at an open mic night, so being friendly and open to new connections is important. After the open mic, attend other events where your new connections perform. Building relationships with these people can lead to future collaborations, bookings, and opportunities.

Take Advantage of Feedback

Open mic nights offer the chance to receive feedback from audiences and other performers. Use this opportunity to improve your skills and connect with other artists. Be open to criticism and take time to reflect on the comments you receive. Remember that constructive feedback is essential for growth. Unfortunately, not every performance will be a hit. Sometimes, the audience may not respond in the way you hoped. But don’t take it personally! Instead, take it as a learning opportunity. Solicit feedback from other performers and audience members to understand what worked and what didn’t. Most open mic nights embrace constructive feedback to help performers grow. Additionally, open mic nights can lead to professional opportunities, such as invitations to perform at other events, collaborations, and recording opportunities.

Record Your Performance

Recording your performance is an excellent way to critique your performance after the event and determine areas for improvement. It can also provide material for sharing on social media platforms, helping to increase your reach and following. Before taking the stage, ensure you have permission to record your performance. Filming allows you to review your work later, improve, and share your progress with others. You can post the recording on your social media pages or YouTube channel or use it to apply for paid gigs. Additionally, you can use the footage to showcase your talent to potential fans, investors, and collaborators.

Conclusion

Participating in open mic nights offers numerous benefits. For one, it’s an opportunity to practice your craft, whether singing, stand-up comedy, or poetry. It’s also a chance to experiment and test new materials without the pressure of traditional performance. Open mic nights can also help you grow your audience and gain exposure, as many events are free and open to the public. Look at all the possibilities: gaining exposure, improving your performance skills, building your network, trying out new material, and getting audience feedback. You never know; if you share this article with your artist friends, you may meet another mom doing the same thing. Open mic nights are a supportive and encouraging environment where you can connect with and learn from other artists who are on a similar path.

Navigating open mic nights can be a valuable experience for performing artists. By starting small, selecting appropriate material, connecting with other performers and venue owners, and benefiting from the experience, mothers in the performing arts can continue to pursue their passions and expand their reach. Whether you’re just starting or a seasoned performer, open mic nights offer a valuable opportunity to connect with others, hone your skills, and share your talent with live audiences. So why not give it a try? You might just be surprised at what you can achieve. So, go out there and shine!

We have a starter list for you, just below. Be sure to comment below with your ideas and experiences!

Image of upclose microphone and lights behind shimmering in magenta and blue. Open Mics list for the 413 and beyond!

Add to Our List of Open Mics!

This started as a long list and got shorter and shorter. We took out anything that didn’t look like it was currently offering open mics. Help it grow? We know the list is small and regional, but here is our list from June 2023 for:

Open Mics 413

Bishop’s Lounge – Northampton, MA

The Rendezvous – Turners Falls, MA

The Dream Away Lodge – Becket, MA

Open Mic with Gundy at JJs Tavern – Florence, MA

Wurst Haus– Northampton, MA

Play Incubation Collective Pic Salon– various locations in the 413

 Luthier’s Co-op – Easthampton, MA

Paradise East Open Mic Night  -Northampton, MA

Workshop 13 – Ware, MA

The Stomping Ground– Putnam, CT

Irish Ale House– Springfield, MA

Hitchcock Brewing Company– Bernardston, MA

Open Mic listings:

Eventbrite listing for Northampton, MA open mic June 2023

Boston Comedy Open Mics -all of Massachusetts

 

`;return t=URL.createObjectURL(new Blob([o],{type:"text/html"})),TG.set(e,t),g_e?.register(e,t),t}function k_e({contentRef:e,children:t,tabIndex:o=0,scale:r=1,frameSize:n=0,readonly:i,forwardedRef:s,title:a=(0,IG.__)("Editor canvas"),...c}){let{resolvedAssets:u,isPreviewMode:d}=(0,jD.useSelect)(T=>{let O=T(_).getSettings();return{resolvedAssets:O.__unstableResolvedAssets,isPreviewMode:O.isPreviewMode}},[]),[f,m]=(0,rm.useState)(),[h,p]=(0,rm.useState)([]),[g,b,v]=zD(),k=(0,Fu.useRefEffect)(T=>{T._load=()=>{m(T.contentDocument)};let O;function D(z){z.preventDefault()}function U(z){z.target.tagName==="A"&&z.target.getAttribute("href")?.startsWith("#")&&(z.preventDefault(),O.defaultView.location.hash=z.target.getAttribute("href").slice(1))}let{ownerDocument:G}=T;p(Array.from(G.body.classList).filter(z=>z.startsWith("admin-color-")||z.startsWith("post-type-")||z==="wp-embed-responsive"));function j(){let{contentDocument:z}=T,{documentElement:W}=z;O=z,W.classList.add("block-editor-iframe__html"),z.dir=G.dir;for(let ee of CG())z.getElementById(ee.id)||(z.head.appendChild(ee.cloneNode(!0)),d||console.warn(`${ee.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,ee));O.addEventListener("dragover",D,!1),O.addEventListener("drop",D,!1),O.addEventListener("click",U)}return T.addEventListener("load",j),()=>{delete T._load,T.removeEventListener("load",j),O?.removeEventListener("dragover",D),O?.removeEventListener("drop",D),O?.removeEventListener("click",U)}},[]),{contentResizeListener:y,containerResizeListener:S,isZoomedOut:x,scaleContainerWidth:C}=EG({scale:r,frameSize:parseInt(n),iframeDocument:f}),B=(0,Fu.useDisabled)({isDisabled:!i}),I=(0,Fu.useMergeRefs)([h_e(f),e,b,B]),P=b_e(u),E=o>=0&&!d,L=(0,Os.jsxs)(Os.Fragment,{children:[E&&g,(0,Os.jsx)("iframe",{...c,style:{...c.style,height:c.style?.height,border:0},ref:(0,Fu.useMergeRefs)([s,k]),tabIndex:o,src:P,title:a,onKeyDown:T=>{if(c.onKeyDown&&c.onKeyDown(T),T.currentTarget.ownerDocument!==T.target.ownerDocument){let{stopPropagation:O}=T.nativeEvent;T.nativeEvent.stopPropagation=()=>{},T.stopPropagation(),T.nativeEvent.stopPropagation=O,RG(T,window.KeyboardEvent,T.currentTarget)}},children:f&&(0,rm.createPortal)((0,Os.jsxs)("body",{ref:I,className:V("block-editor-iframe__body","editor-styles-wrapper",...h),children:[y,(0,Os.jsx)(PG.__experimentalStyleProvider,{document:f,children:t})]}),f.documentElement)}),E&&v]});return(0,Os.jsxs)("div",{className:"block-editor-iframe__container",children:[S,(0,Os.jsx)("div",{className:V("block-editor-iframe__scale-container",x&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-scale-container-width":x&&`${C}px`},children:L})]})}function v_e(e,t){return(0,jD.useSelect)(r=>r(_).getSettings().__internalIsInitialized,[])?(0,Os.jsx)(k_e,{...e,forwardedRef:t}):null}var Dh=(0,rm.forwardRef)(v_e);var w$=l(A(),1),Gh=l(R(),1),C$=l(F(),1);var R1={attribute:/\[\s*(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)\s*(?:(?\W?=)\s*(?.+?)\s*(\s(?[iIsS]))?\s*)?\]/gu,id:/#(?[-\w\P{ASCII}]+)/gu,class:/\.(?[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,"pseudo-class":/:(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,universal:/(?:(?\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)/gu},y_e=new Set(["combinator","comma"]);var S_e=e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(R1[e].source.replace("(?\xB6*)","(?.*)"),"gu");default:return R1[e]}};function __e(e,t){let o=0,r="";for(;t(o.push({value:i,offset:s}),"\uE000".repeat(i.length))),e=e.replace(w_e,(i,s,a,c)=>(o.push({value:i,offset:c}),`${s}${"\uE001".repeat(a.length)}${s}`));{let i=0,s;for(;(s=e.indexOf("(",i))>-1;){let a=__e(e,s);o.push({value:a,offset:s}),e=`${e.substring(0,s)}(${"\xB6".repeat(a.length-2)})${e.substring(s+a.length)}`,i=s+a.length}}let r=x_e(e,t),n=new Set;for(let i of o.reverse())for(let s of r){let{offset:a,value:c}=i;if(!(s.pos[0]<=a&&a+c.length<=s.pos[1]))continue;let{content:u}=s,d=a-s.pos[0];s.content=u.slice(0,d)+c+u.slice(d+c.length),s.content!==u&&n.add(s)}for(let i of n){let s=S_e(i.type);if(!s)throw new Error(`Unknown token type: ${i.type}`);s.lastIndex=0;let a=s.exec(i.content);if(!a)throw new Error(`Unable to parse content for ${i.type}: ${i.content}`);Object.assign(i,a.groups)}return r}function*P1(e,t){switch(e.type){case"list":for(let o of e.list)yield*P1(o,e);break;case"complex":yield*P1(e.left,e),yield*P1(e.right,e);break;case"compound":yield*e.list.map(o=>[o,e]);break;default:yield[e,t]}}function OG(e){let t;return Array.isArray(e)?t=e:t=[...P1(e)].map(([o])=>o),t.map(o=>o.content).join("")}var v$=l(QW(),1),y$=l(L1(),1),S$=l(t$(),1),_$=l(b$(),1),k$=new Map,x$=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];function D0e(e,t){let o=UD(t),r=o.findLastIndex(({content:s,type:a})=>x$.some(c=>s===c.content&&a===c.type)),n=-1;for(let s=r+1;sd instanceof RegExp?a.match(d):a.includes(d))?a:x$.some(d=>a.startsWith(d.content))?D0e(s,a):c}}),o&&(0,_$.default)({rootUrl:o})].filter(Boolean)).process(e,{}).css}catch(i){return i instanceof y$.default?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i.message+` `+i.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i),null}}var F0e=(e,t="",o)=>{let r=k$.get(t);return r||(r=new WeakMap,k$.set(t,r)),e.map(n=>{let i=r.get(n);return i||(i=V0e(n,t,o),r.set(n,i)),i})},Hh=F0e;var Hu=l(w(),1);Yc([qc,Ap]);function z0e(e,t){return(0,Gh.useCallback)(o=>{if(!o)return;let{ownerDocument:r}=o,{defaultView:n,body:i}=r,s=t?r.querySelector(t):i,a;if(s)a=n?.getComputedStyle(s,null).getPropertyValue("background-color");else{let u=r.createElement("div");u.classList.add("editor-styles-wrapper"),i.appendChild(u),a=n?.getComputedStyle(u,null).getPropertyValue("background-color"),i.removeChild(u)}let c=Bt(a);c.luminance()>.5||c.alpha()===0?i.classList.remove("is-dark-theme"):i.classList.add("is-dark-theme")},[e,t])}function j0e({styles:e,scope:t,transformOptions:o}){let r=(0,C$.useSelect)(s=>M(s(_)).getStyleOverrides(),[]),[n,i]=(0,Gh.useMemo)(()=>{let s=Object.values(e??[]);for(let[a,c]of r){let u=s.findIndex(({id:f})=>a===f),d={...c,id:a};u===-1?s.push(d):s[u]=d}return[Hh(s.filter(a=>a?.css),t,o),s.filter(a=>a.__unstableType==="svgs").map(a=>a.assets).join("")]},[e,r,t,o]);return(0,Hu.jsxs)(Hu.Fragment,{children:[(0,Hu.jsx)("style",{ref:z0e(n,t)}),n.map((s,a)=>(0,Hu.jsx)("style",{children:s},a)),(0,Hu.jsx)(w$.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:i}})]})}var Ml=(0,Gh.memo)(j0e);var Fi=l(w(),1),U0e=(0,Z1.memo)(Wh),x5=2e3,H0e=[];function G0e({viewportWidth:e,containerWidth:t,minHeight:o,additionalStyles:r=H0e}){e||(e=t);let[n,{height:i}]=(0,Vy.useResizeObserver)(),{styles:s}=(0,B$.useSelect)(d=>({styles:d(_).getSettings().styles}),[]),a=(0,Z1.useMemo)(()=>s&&[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r],[s,r]),c=t/e,u=i?t/(i*c):0;return(0,Fi.jsx)(E$.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${c})`,aspectRatio:u,maxHeight:i>x5?x5*c:void 0,minHeight:o},children:(0,Fi.jsxs)(Dh,{contentRef:(0,Vy.useRefEffect)(d=>{let{ownerDocument:{documentElement:f}}=d;f.classList.add("block-editor-block-preview__content-iframe"),f.style.position="absolute",f.style.width="100%",d.style.boxSizing="border-box",d.style.position="absolute",d.style.width="100%"},[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:i,pointerEvents:"none",maxHeight:x5,minHeight:c!==0&&c<1&&o?o/c:o},children:[(0,Fi.jsx)(Ml,{styles:a}),n,(0,Fi.jsx)(U0e,{renderAppender:!1})]})})}function T$(e){let[t,{width:o}]=(0,Vy.useResizeObserver)();return(0,Fi.jsxs)(Fi.Fragment,{children:[(0,Fi.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,Fi.jsx)("div",{className:"block-editor-block-preview__container",children:!!o&&(0,Fi.jsx)(G0e,{...e,containerWidth:o})})]})}var $h=l(R(),1),O$=l(P$(),1),R$=(0,O$.createQueue)();function A$({children:e,placeholder:t}){let[o,r]=(0,$h.useState)(!1);return(0,$h.useEffect)(()=>{let n={};return R$.add(n,()=>{(0,$h.flushSync)(()=>{r(!0)})}),()=>{R$.cancel(n)}},[]),o?e:t}var lm=l(w(),1),W0e=[];function $0e({blocks:e,viewportWidth:t=1200,minHeight:o,additionalStyles:r=W0e,__experimentalMinHeight:n,__experimentalPadding:i}){n&&(o=n,(0,w5.default)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],(0,w5.default)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));let s=(0,C5.useSelect)(u=>u(_).getSettings(),[]),a=(0,am.useMemo)(()=>({...s,focusMode:!1,isPreviewMode:!0}),[s]),c=(0,am.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return!e||e.length===0?null:(0,lm.jsx)(Rh,{value:c,settings:a,children:(0,lm.jsx)(T$,{viewportWidth:t,minHeight:o,additionalStyles:r})})}var L$=(0,am.memo)($0e);L$.Async=A$;var vn=L$;function N$({blocks:e,props:t={},layout:o}){let r=(0,C5.useSelect)(u=>u(_).getSettings(),[]),n=(0,am.useMemo)(()=>({...r,styles:void 0,focusMode:!1,isPreviewMode:!0}),[r]),i=(0,X1.useDisabled)(),s=(0,X1.useMergeRefs)([t.ref,i]),a=(0,am.useMemo)(()=>Array.isArray(e)?e:[e],[e]),c=(0,lm.jsxs)(Rh,{value:a,settings:n,children:[(0,lm.jsx)(Ml,{}),(0,lm.jsx)(Fy,{renderAppender:!1,layout:o})]});return{...t,ref:s,className:V(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?c:null}}var Gu=l(w(),1);function K0e({item:e}){let{name:t,title:o,icon:r,description:n,initialAttributes:i,example:s}=e,a=(0,Kh.isReusableBlock)(e),c=(0,M$.useMemo)(()=>s?(0,Kh.getBlockFromExample)(t,{attributes:{...s.attributes,...i},innerBlocks:s.innerBlocks}):(0,Kh.createBlock)(t,i),[t,s,i]),u=144,d=280,f=s?.viewportWidth??500,m=d/f,h=m!==0&&m<1&&u?u/m:u;return(0,Gu.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,Gu.jsx)("div",{className:"block-editor-inserter__preview",children:a||s?(0,Gu.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,Gu.jsx)(vn,{blocks:c,viewportWidth:f,minHeight:u,additionalStyles:[{css:` body { padding: 24px; min-height:${Math.round(h)}px; display:flex; align-items:center; } .is-root-container { width: 100%; } `}]})}):(0,Gu.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,D$.__)("No preview available.")})}),!a&&(0,Gu.jsx)(Sy,{title:o,icon:r,description:n})]})}var Q1=K0e;var eg=l(N(),1),Fl=l(R(),1),O5=l(Z(),1);var X$=l($(),1),Q$=l(Z(),1);var Jh=l(R(),1),Wu=l($(),1),q$=l(A(),1),zy=l(it(),1);var W$=l(A(),1),$$=l(R(),1);var Yh=l(R(),1),V$=l(N(),1),F$=l(Xo(),1),z$=l(w(),1);function Y0e(e,t){let[o,r]=(0,Yh.useState)(!1);return(0,Yh.useEffect)(()=>{o&&(0,F$.speak)((0,V$.__)("Use left and right arrow keys to move through blocks"))},[o]),(0,z$.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:n=>{!n.currentTarget.contains(n.relatedTarget)&&r(!1)},...e})}var B5=(0,Yh.forwardRef)(Y0e);var j$=l(R(),1),U$=l(A(),1),H$=l(w(),1);function q0e(e,t){return(0,H$.jsx)(U$.Composite.Group,{role:"presentation",ref:t,...e})}var E5=(0,j$.forwardRef)(q0e);var eB=l(A(),1),G$=l(R(),1),J1=l(w(),1);function Z0e({isFirst:e,as:t,children:o,...r},n){return(0,J1.jsx)(eB.Composite.Item,{ref:n,role:"option",accessibleWhenDisabled:!0,...r,render:i=>{let s={...i,tabIndex:e?0:i.tabIndex};return t?(0,J1.jsx)(t,{...s,children:o}):typeof o=="function"?o(s):(0,J1.jsx)(eB.Button,{__next40pxDefaultSize:!0,...s,children:o})}})}var T5=(0,G$.forwardRef)(Z0e);var I5=l(w(),1);function X0e({key:e,children:t}){return(0,I5.jsx)($$.Fragment,{children:t},e)}function Q0e({children:e}){return(0,I5.jsx)(W$.Composite,{focusShift:!0,focusWrap:"horizontal",render:X0e,children:e})}var qh=Q0e;var K$=l(A(),1),oB=l($(),1),rB=l(F(),1),Y$=l(R(),1);var Xh=l(N(),1),Zh=l(A(),1);var Ls=l(w(),1);function tB({count:e,icon:t,isPattern:o,fadeWhenDisabled:r}){let n=o&&(0,Xh.__)("Pattern");return(0,Ls.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,Ls.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,Ls.jsxs)(Zh.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,Ls.jsx)(Zh.FlexItem,{children:t?(0,Ls.jsx)(Ae,{icon:t}):n||(0,Xh.sprintf)((0,Xh._n)("%d block","%d blocks",e),e)}),(0,Ls.jsx)(Zh.FlexItem,{children:(0,Ls.jsx)(Ae,{icon:ov})}),r&&(0,Ls.jsx)(Zh.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,Ls.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}var P5=l(w(),1),J0e=({isEnabled:e,blocks:t,icon:o,children:r,pattern:n})=>{let i=t.length===1?t[0].name:void 0,s=(0,rB.useSelect)(f=>i&&f(oB.store).getBlockType(i)?.icon,[i]),{startDragging:a,stopDragging:c}=M((0,rB.useDispatch)(_)),u=(0,Y$.useMemo)(()=>n?.type===Nt.user&&n?.syncStatus!=="unsynced"?[(0,oB.createBlock)("core/block",{ref:n.id})]:void 0,[n?.type,n?.syncStatus,n?.id]);if(!e)return r({draggable:!1,onDragStart:void 0,onDragEnd:void 0});let d=u??t;return(0,P5.jsx)(K$.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:d},onDragStart:f=>{a();let m=new Set;for(let h of d){let p=`wp-block:${h.name}`;m.has(p)||(f.dataTransfer.items.add("",p),m.add(p))}},onDragEnd:()=>{c()},__experimentalDragComponent:(0,P5.jsx)(tB,{count:t.length,icon:o||!n&&s,isPattern:!!n}),children:({onDraggableStart:f,onDraggableEnd:m})=>r({draggable:!0,onDragStart:f,onDragEnd:m})})},Qh=J0e;var Dl=l(w(),1);function exe({className:e,isFirst:t,item:o,onSelect:r,onHover:n,isDraggable:i,...s}){let a=(0,Jh.useRef)(!1),c=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},u=(0,Jh.useMemo)(()=>[(0,Wu.createBlock)(o.name,o.initialAttributes,(0,Wu.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))],[o.name,o.initialAttributes,o.innerBlocks]),d=(0,Wu.isReusableBlock)(o)&&o.syncStatus!=="unsynced"||(0,Wu.isTemplatePart)(o);return(0,Dl.jsx)(Qh,{isEnabled:i&&!o.isDisabled,blocks:u,icon:o.icon,children:({draggable:f,onDragStart:m,onDragEnd:h})=>(0,Dl.jsx)("div",{className:V("block-editor-block-types-list__list-item",{"is-synced":d}),draggable:f,onDragStart:p=>{a.current=!0,m&&(n(null),m(p))},onDragEnd:p=>{a.current=!1,h&&h(p)},children:(0,Dl.jsxs)(T5,{isFirst:t,className:V("block-editor-block-types-list__item",e),disabled:o.isDisabled,onClick:p=>{p.preventDefault(),r(o,(0,zy.isAppleOS)()?p.metaKey:p.ctrlKey),n(null)},onKeyDown:p=>{let{keyCode:g}=p;g===zy.ENTER&&(p.preventDefault(),r(o,(0,zy.isAppleOS)()?p.metaKey:p.ctrlKey),n(null))},onMouseEnter:()=>{a.current||n(o)},onMouseLeave:()=>n(null),...s,children:[(0,Dl.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:c,children:(0,Dl.jsx)(Ae,{icon:o.icon,showColors:!0})}),(0,Dl.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,Dl.jsx)(q$.__experimentalTruncate,{numberOfLines:3,children:o.title})})]})})})}var Z$=(0,Jh.memo)(exe);var jy=l(w(),1);function txe(e,t){let o=[];for(let r=0,n=e.length;r{},children:r,label:n,isDraggable:i=!0}){let s="block-editor-block-types-list",a=(0,Q$.useInstanceId)(J$,s);return(0,jy.jsxs)(B5,{className:s,"aria-label":n,children:[txe(e,3).map((c,u)=>(0,jy.jsx)(E5,{children:c.map((d,f)=>(0,jy.jsx)(Z$,{item:d,className:(0,X$.getBlockMenuDefaultClassName)(d.id),onSelect:t,onHover:o,isDraggable:i&&!d.isDisabled,isFirst:u===0&&f===0,rowId:`${a}-${u}`},d.id))},u)),r]})}var cm=J$;var eK=l(A(),1),Vl=l(w(),1);function oxe({title:e,icon:t,children:o}){return(0,Vl.jsxs)(Vl.Fragment,{children:[(0,Vl.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,Vl.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,Vl.jsx)(eK.Icon,{icon:t})]}),(0,Vl.jsx)("div",{className:"block-editor-inserter__panel-content",children:o})]})}var $u=oxe;var tK=l(N(),1),R5=l(w(),1);function rxe(){return(0,R5.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,R5.jsx)("p",{children:(0,tK.__)("No results found.")})})}var Ns=rxe;var zo=l(w(),1),nxe=e=>e.name.split("/")[0],ixe=6,sxe=[];function oK({items:e,collections:t,categories:o,onSelectItem:r,onHover:n,showMostUsedBlocks:i,className:s}){let a=(0,Fl.useMemo)(()=>pa(e,"frecency","desc").slice(0,ixe),[e]),c=(0,Fl.useMemo)(()=>e.filter(p=>!p.category),[e]),u=(0,Fl.useMemo)(()=>{let p={...t};return Object.keys(t).forEach(g=>{p[g]=e.filter(b=>nxe(b)===g),p[g].length===0&&delete p[g]}),p},[e,t]);(0,Fl.useEffect)(()=>()=>n(null),[]);let d=(0,O5.useAsyncList)(o),f=o.length===d.length,m=(0,Fl.useMemo)(()=>Object.entries(t),[t]),h=(0,O5.useAsyncList)(f?m:sxe);return(0,zo.jsxs)("div",{className:s,children:[i&&e.length>3&&!!a.length&&(0,zo.jsx)($u,{title:(0,eg._x)("Most used","blocks"),children:(0,zo.jsx)(cm,{items:a,onSelect:r,onHover:n,label:(0,eg._x)("Most used","blocks")})}),d.map(p=>{let g=e.filter(b=>b.category===p.slug);return!g||!g.length?null:(0,zo.jsx)($u,{title:p.title,icon:p.icon,children:(0,zo.jsx)(cm,{items:g,onSelect:r,onHover:n,label:p.title})},p.slug)}),f&&c.length>0&&(0,zo.jsx)($u,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,eg.__)("Uncategorized"),children:(0,zo.jsx)(cm,{items:c,onSelect:r,onHover:n,label:(0,eg.__)("Uncategorized")})}),h.map(([p,g])=>{let b=u[p];return!b||!b.length?null:(0,zo.jsx)($u,{title:g.title,icon:g.icon,children:(0,zo.jsx)(cm,{items:b,onSelect:r,onHover:n,label:g.title})},p)})]})}function axe({rootClientId:e,onInsert:t,onHover:o,showMostUsedBlocks:r},n){let[i,s,a,c]=vu(e,t);if(!i.length)return(0,zo.jsx)(Ns,{});let u=[],d=[];for(let f of i)f.category!=="reusable"&&(f.isSearchOnly||(f.isAllowedInCurrentRoot?u.push(f):d.push(f)));return(0,zo.jsx)(qh,{children:(0,zo.jsxs)("div",{ref:n,children:[!!u.length&&(0,zo.jsx)(zo.Fragment,{children:(0,zo.jsx)(oK,{items:u,categories:s,collections:a,onSelectItem:c,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,zo.jsx)(oK,{items:d,categories:s,collections:a,onSelectItem:c,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__all-blocks"})]})})}var rK=(0,Fl.forwardRef)(axe);var wK=l(R(),1),CK=l(Z(),1),BK=l(A(),1),EK=l(N(),1);var kK=l(A(),1),V5=l(R(),1),vK=l(N(),1);var nB=l(A(),1),A5=l(N(),1),zl=l(w(),1);function lxe({selectedCategory:e,patternCategories:t,onClickCategory:o}){let r="block-editor-block-patterns-explorer__sidebar";return(0,zl.jsx)("div",{className:`${r}__categories-list`,children:t.map(({name:n,label:i})=>(0,zl.jsx)(nB.Button,{__next40pxDefaultSize:!0,label:i,className:`${r}__categories-list__item`,isPressed:e===n,onClick:()=>{o(n)},children:i},n))})}function cxe({searchValue:e,setSearchValue:t}){return(0,zl.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,zl.jsx)(nB.SearchControl,{onChange:t,value:e,label:(0,A5.__)("Search"),placeholder:(0,A5.__)("Search")})})}function uxe({selectedCategory:e,patternCategories:t,onClickCategory:o,searchValue:r,setSearchValue:n}){return(0,zl.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,zl.jsx)(cxe,{searchValue:r,setSearchValue:n}),!r&&(0,zl.jsx)(lxe,{selectedCategory:e,patternCategories:t,onClickCategory:o})]})}var nK=uxe;var Ul=l(R(),1),ng=l(N(),1),mK=l(Z(),1),pK=l(A(),1),hK=l(Xo(),1);var iK=l($(),1),Ca=l(R(),1),jl=l(A(),1),sK=l(Z(),1),aK=l(N(),1);var yn=l(A(),1),zi=l(N(),1),Cr=l(w(),1);function iB({currentPage:e,numPages:t,changePage:o,totalItems:r}){return(0,Cr.jsxs)(yn.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,Cr.jsx)(yn.__experimentalText,{variant:"muted",children:(0,zi.sprintf)((0,zi._n)("%s item","%s items",r),r)}),t>1&&(0,Cr.jsxs)(yn.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,Cr.jsxs)(yn.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,Cr.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(1),disabled:e===1,"aria-label":(0,zi.__)("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Cr.jsx)("span",{children:"\xAB"})}),(0,Cr.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(e-1),disabled:e===1,"aria-label":(0,zi.__)("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Cr.jsx)("span",{children:"\u2039"})})]}),(0,Cr.jsx)(yn.__experimentalText,{variant:"muted",children:(0,zi.sprintf)((0,zi._x)("%1$s of %2$s","paging"),e,t)}),(0,Cr.jsxs)(yn.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,Cr.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(e+1),disabled:e===t,"aria-label":(0,zi.__)("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Cr.jsx)("span",{children:"\u203A"})}),(0,Cr.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(t),disabled:e===t,"aria-label":(0,zi.__)("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Cr.jsx)("span",{children:"\xBB"})})]})]})]})}var Yt=l(w(),1),dxe=({showTooltip:e,title:t,children:o})=>e?(0,Yt.jsx)(jl.Tooltip,{text:t,children:o}):(0,Yt.jsx)(Yt.Fragment,{children:o});function lK({id:e,isDraggable:t,pattern:o,onClick:r,onHover:n,showTitlesAsTooltip:i,category:s,isSelected:a}){let[c,u]=(0,Ca.useState)(!1),{blocks:d,viewportWidth:f}=o,h=`block-editor-block-patterns-list__item-description-${(0,sK.useInstanceId)(lK)}`,p=o.type===Nt.user,g=(0,Ca.useMemo)(()=>!s||!t?d:(d??[]).map(b=>{let v=(0,iK.cloneBlock)(b);return v.attributes.metadata?.categories?.includes(s)&&(v.attributes.metadata.categories=[s]),v}),[d,t,s]);return(0,Yt.jsx)(Qh,{isEnabled:t,blocks:g,pattern:o,children:({draggable:b,onDragStart:v,onDragEnd:k})=>(0,Yt.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:b,onDragStart:y=>{u(!0),v&&(n?.(null),v(y))},onDragEnd:y=>{u(!1),k&&k(y)},children:(0,Yt.jsx)(dxe,{showTooltip:i&&!p,title:o.title,children:(0,Yt.jsxs)(jl.Composite.Item,{render:(0,Yt.jsx)("div",{role:"option","aria-label":o.title,"aria-describedby":o.description?h:void 0,className:V("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":o.type===Nt.user&&!o.syncStatus,"is-selected":a})}),id:e,onClick:()=>{r(o,d),n?.(null)},onMouseEnter:()=>{c||n?.(o)},onMouseLeave:()=>n?.(null),children:[(0,Yt.jsx)(vn.Async,{placeholder:(0,Yt.jsx)(fxe,{}),children:(0,Yt.jsx)(vn,{blocks:d,viewportWidth:f})}),(!i||p)&&(0,Yt.jsxs)(jl.__experimentalHStack,{className:"block-editor-patterns__pattern-details",spacing:2,children:[p&&!o.syncStatus&&(0,Yt.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,Yt.jsx)(we,{className:"block-editor-patterns__pattern-icon",icon:Ei})}),(0,Yt.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:o.title})]}),!!o.description&&(0,Yt.jsx)(jl.VisuallyHidden,{id:h,children:o.description})]})})})})}function fxe(){return(0,Yt.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}function mxe({isDraggable:e,blockPatterns:t,onHover:o,onClickPattern:r,orientation:n,label:i=(0,aK.__)("Block patterns"),category:s,showTitlesAsTooltip:a,pagingProps:c},u){let[d,f]=(0,Ca.useState)(void 0),[m,h]=(0,Ca.useState)(null);(0,Ca.useEffect)(()=>{let g=t[0]?.name;f(g)},[t]);let p=(g,b)=>{h(g.name),r(g,b)};return(0,Yt.jsxs)(jl.Composite,{orientation:n,activeId:d,setActiveId:f,role:"listbox",className:"block-editor-block-patterns-list","aria-label":i,ref:u,children:[t.map(g=>(0,Yt.jsx)(lK,{id:g.name,pattern:g,onClick:p,onHover:o,isDraggable:e,showTitlesAsTooltip:a,category:s,isSelected:!!m&&m===g.name},g.name)),c&&(0,Yt.jsx)(iB,{...c})]})}var Ba=(0,Ca.forwardRef)(mxe);var um=l(F(),1),uK=l($(),1),sB=l(N(),1),dK=l(Xo(),1),L5=l(R(),1);function cK({destinationRootClientId:e,destinationIndex:t,rootClientId:o,registry:r}){if(o===e)return t;let n=["",...r.select(_).getBlockParents(e),e],i=n.indexOf(o);return i!==-1?r.select(_).getBlockIndex(n[i+1])+1:r.select(_).getBlockOrder(o).length}function pxe({rootClientId:e="",insertionIndex:t,clientId:o,isAppender:r,onSelect:n,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}){let a=(0,um.useRegistry)(),{getSelectedBlock:c,getClosestAllowedInsertionPoint:u,isBlockInsertionPointVisible:d}=M((0,um.useSelect)(_)),{destinationRootClientId:f,destinationIndex:m}=(0,um.useSelect)(S=>{let{getSelectedBlockClientId:x,getBlockRootClientId:C,getBlockIndex:B,getBlockOrder:I,getInsertionPoint:P}=M(S(_)),E=x(),L=e,T,O=P();return t!==void 0?T=t:O&&O.hasOwnProperty("index")?(L=O?.rootClientId?O.rootClientId:e,T=O.index):o?T=B(o):!r&&E?(L=C(E),T=B(E)+1):T=I(L).length,{destinationRootClientId:L,destinationIndex:T}},[e,t,o,r]),{replaceBlocks:h,insertBlocks:p,showInsertionPoint:g,hideInsertionPoint:b,setLastFocus:v}=M((0,um.useDispatch)(_)),k=(0,L5.useCallback)((S,x,C=!1,B)=>{(C||i||s)&&v(null);let I=c();!r&&I&&(0,uK.isUnmodifiedDefaultBlock)(I,"content")?h(I.clientId,S,null,i||C?0:null,x):p(S,r||B===void 0?m:cK({destinationRootClientId:f,destinationIndex:m,rootClientId:B,registry:a}),r||B===void 0?f:B,s,i||C?0:null,x);let P=Array.isArray(S)?S.length:1,E=(0,sB.sprintf)((0,sB._n)("%d block added.","%d blocks added.",P),P);(0,dK.speak)(E),n&&n(S)},[r,c,h,p,f,m,n,i,s,v,a]),y=(0,L5.useCallback)(S=>{if(S&&!d()){let x=u(S.name,f);x!==null&&g(x,cK({destinationRootClientId:f,destinationIndex:m,rootClientId:x,registry:a}))}else b()},[u,d,g,b,f,m,a]);return[f,k,y]}var Ku=pxe;var tg=l(R(),1),aB=l($(),1),og=l(F(),1),lB=l(N(),1),fK=l(Un(),1);var hxe=(e,t,o,r)=>{let n=(0,tg.useMemo)(()=>({[du]:!!r}),[r]),i=(0,og.useSelect)(p=>{let{getSettings:g}=M(p(_));return g()[C0]??!1},[]),{patternCategories:s,patterns:a,userPatternCategories:c}=(0,og.useSelect)(p=>{let{getSettings:g,__experimentalGetAllowedPatterns:b}=M(p(_)),{__experimentalUserPatternCategories:v,__experimentalBlockPatternCategories:k}=g();return{patterns:b(t,n),userPatternCategories:v,patternCategories:k}},[t,n]),u=(0,tg.useMemo)(()=>a.filter(p=>!(p.categories?.includes("navigation")&&!i)),[a,i]),{getClosestAllowedInsertionPointForPattern:d}=M((0,og.useSelect)(_)),f=(0,tg.useMemo)(()=>{let p=[...s];return c?.forEach(g=>{p.find(b=>b.name===g.name)||p.push(g)}),p},[s,c]),{createSuccessNotice:m}=(0,og.useDispatch)(fK.store),h=(0,tg.useCallback)((p,g)=>{let b=r?t:d(p,t);if(b===null)return;let v=p.type===Nt.user&&p.syncStatus!=="unsynced"?[(0,aB.createBlock)("core/block",{ref:p.id})]:g;e((v??[]).map(k=>{let y=(0,aB.cloneBlock)(k);return y.attributes.metadata?.categories?.includes(o)&&(y.attributes.metadata.categories=[o]),y}),p.name,!1,b),m((0,lB.sprintf)((0,lB.__)('Block pattern "%s" inserted.'),p.title),{type:"snackbar",id:"inserter-notice"})},[m,e,o,t,d,r]);return[u,f,h]},Yu=hxe;var rg=l(R(),1),N5=l(Z(),1),M5=l(Fe(),1),cB=20;function uB(e,t,o,r=""){let[n,i]=(0,rg.useState)(1),s=(0,N5.usePrevious)(t),a=(0,N5.usePrevious)(r);(s!==t||a!==r)&&n!==1&&i(1);let c=e.length,u=n-1,d=(0,rg.useMemo)(()=>e.slice(u*cB,u*cB+cB),[u,e]),f=Math.ceil(e.length/cB),m=h=>{(0,M5.getScrollContainer)(o?.current)?.scrollTo(0,0),i(h)};return(0,rg.useEffect)(function(){(0,M5.getScrollContainer)(o?.current)?.scrollTo(0,0)},[t,o]),{totalItems:c,categoryPatterns:d,numPages:f,changePage:m,currentPage:n}}var Ms=l(w(),1);function gxe({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,Ms.jsx)(pK.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,ng.sprintf)((0,ng._n)("%d pattern found","%d patterns found",t),t)}):null}function bxe({searchValue:e,selectedCategory:t,patternCategories:o,rootClientId:r,onModalClose:n}){let i=(0,Ul.useRef)(),s=(0,mK.useDebounce)(hK.speak,500),[a,c]=Ku({rootClientId:r,shouldFocusBlock:!0}),[u,,d]=Yu(c,a,t),f=(0,Ul.useMemo)(()=>o.map(v=>v.name),[o]),m=(0,Ul.useMemo)(()=>{let v=u.filter(k=>{if(t===Ff.name||t===_l.name&&k.type===Nt.user||t===Yp.name&&k.blockTypes?.includes("core/post-content"))return!0;if(t==="uncategorized"){let y=k.categories?.some(S=>f.includes(S))??!1;return!k.categories?.length||!y}return k.categories?.includes(t)});return e?jv(v,e):v},[e,u,t,f]);(0,Ul.useEffect)(()=>{if(!e)return;let v=m.length,k=(0,ng.sprintf)((0,ng._n)("%d result found.","%d results found.",v),v);s(k)},[e,s,m.length]);let h=uB(m,t,i),[p,g]=(0,Ul.useState)(e);e!==p&&(g(e),h.changePage(1));let b=!!m?.length;return(0,Ms.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:i,children:[(0,Ms.jsx)(gxe,{filterValue:e,filteredBlockPatternsLength:m.length}),(0,Ms.jsx)(qh,{children:b&&(0,Ms.jsxs)(Ms.Fragment,{children:[(0,Ms.jsx)(Ba,{blockPatterns:h.categoryPatterns,onClickPattern:(v,k)=>{d(v,k),n()},isDraggable:!1}),(0,Ms.jsx)(iB,{...h})]})})]})}var gK=bxe;var D5=l(R(),1),ig=l(N(),1),bK=l(Xo(),1);function kxe(e,t){return!e.categories||!e.categories.length?!1:e.categories.some(o=>t.some(r=>r.name===o))}function sg(e,t="all"){let[o,r]=Yu(void 0,e),n=(0,D5.useMemo)(()=>t==="all"?o:o.filter(s=>!Pw(s,t)),[t,o]);return(0,D5.useMemo)(()=>{let s=r.filter(a=>n.some(c=>c.categories?.includes(a.name))).sort((a,c)=>a.label.localeCompare(c.label));return n.some(a=>!kxe(a,r))&&!s.find(a=>a.name==="uncategorized")&&s.push({name:"uncategorized",label:(0,ig._x)("Uncategorized")}),n.some(a=>a.blockTypes?.includes("core/post-content"))&&s.unshift(Yp),n.some(a=>a.type===Nt.user)&&s.unshift(_l),n.length>0&&s.unshift({name:Ff.name,label:Ff.label}),(0,bK.speak)((0,ig.sprintf)((0,ig._n)("%d category button displayed.","%d category buttons displayed.",s.length),s.length)),s},[r,n])}var dm=l(w(),1);function vxe({initialCategory:e,rootClientId:t,onModalClose:o}){let[r,n]=(0,V5.useState)(""),[i,s]=(0,V5.useState)(e?.name),a=sg(t);return(0,dm.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,dm.jsx)(nK,{selectedCategory:i,patternCategories:a,onClickCategory:s,searchValue:r,setSearchValue:n}),(0,dm.jsx)(gK,{searchValue:r,selectedCategory:i,patternCategories:a,rootClientId:t,onModalClose:o})]})}function yxe({onModalClose:e,...t}){return(0,dm.jsx)(kK.Modal,{title:(0,vK.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,dm.jsx)(vxe,{onModalClose:e,...t})})}var yK=yxe;var ag=l(N(),1),Dt=l(A(),1);var Jo=l(w(),1);function Sxe({title:e}){return(0,Jo.jsx)(Dt.__experimentalVStack,{spacing:0,children:(0,Jo.jsx)(Dt.__experimentalView,{children:(0,Jo.jsx)(Dt.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,Jo.jsxs)(Dt.__experimentalHStack,{spacing:2,children:[(0,Jo.jsx)(Dt.Navigator.BackButton,{style:{minWidth:24,padding:0},icon:(0,ag.isRTL)()?Vo:Nr,size:"small",label:(0,ag.__)("Back")}),(0,Jo.jsx)(Dt.__experimentalSpacer,{children:(0,Jo.jsx)(Dt.__experimentalHeading,{level:5,children:e})})]})})})})}function dB({categories:e,children:t}){return(0,Jo.jsxs)(Dt.Navigator,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,Jo.jsx)(Dt.Navigator.Screen,{path:"/",children:(0,Jo.jsx)(Dt.__experimentalItemGroup,{children:e.map(o=>(0,Jo.jsx)(Dt.Navigator.Button,{path:`/category/${o.name}`,as:Dt.__experimentalItem,isAction:!0,children:(0,Jo.jsxs)(Dt.__experimentalHStack,{children:[(0,Jo.jsx)(Dt.FlexBlock,{children:o.label}),(0,Jo.jsx)(we,{icon:(0,ag.isRTL)()?Nr:Vo})]})},o.name))})}),e.map(o=>(0,Jo.jsxs)(Dt.Navigator.Screen,{path:`/category/${o.name}`,children:[(0,Jo.jsx)(Sxe,{title:(0,ag.__)("Back")}),t(o)]},o.name))]})}var ji=l(R(),1),F5=l(N(),1),Ds=l(A(),1);var _n=l(A(),1),Sn=l(N(),1);var fB=l(R(),1);var pr=l(w(),1),SK=e=>e!=="all"&&e!=="user",_xe=e=>e.name===_l.name,xxe=[{value:"all",label:(0,Sn._x)("All","patterns")},{value:Nt.directory,label:(0,Sn.__)("Pattern Directory")},{value:Nt.theme,label:(0,Sn.__)("Theme & Plugins")},{value:Nt.user,label:(0,Sn.__)("User")}];function _K({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:o,patternSourceFilter:r,scrollContainerRef:n,category:i}){let s=i.name===_l.name?Nt.user:r,a=SK(s),c=_xe(i),u=(0,fB.useMemo)(()=>[{value:"all",label:(0,Sn._x)("All","patterns")},{value:Iv.full,label:(0,Sn._x)("Synced","patterns"),disabled:a},{value:Iv.unsynced,label:(0,Sn._x)("Not synced","patterns"),disabled:a}],[a]);function d(f){t(f),SK(f)&&e("all")}return(0,pr.jsx)(pr.Fragment,{children:(0,pr.jsx)(_n.DropdownMenu,{popoverProps:{placement:"right-end"},label:(0,Sn.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,pr.jsx)(we,{icon:(0,pr.jsx)(_n.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,pr.jsx)(_n.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,pr.jsxs)(pr.Fragment,{children:[!c&&(0,pr.jsx)(_n.MenuGroup,{label:(0,Sn.__)("Source"),children:(0,pr.jsx)(_n.MenuItemsChoice,{choices:xxe,onSelect:f=>{d(f),n.current?.scrollTo(0,0)},value:s})}),(0,pr.jsx)(_n.MenuGroup,{label:(0,Sn.__)("Type"),children:(0,pr.jsx)(_n.MenuItemsChoice,{choices:u,onSelect:f=>{e(f),n.current?.scrollTo(0,0)},value:o})}),(0,pr.jsx)("div",{className:"block-editor-inserter__patterns-filter-help",children:(0,fB.createInterpolateElement)((0,Sn.__)("Patterns are available from theWordPress.org Pattern Directory, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,pr.jsx)(_n.ExternalLink,{href:(0,Sn.__)("https://wordpress.org/patterns/")})})})]})})})}var $r=l(w(),1),wxe=()=>{};function mB({rootClientId:e,onInsert:t,onHover:o=wxe,category:r,showTitlesAsTooltip:n}){let[i,,s]=Yu(t,e,r?.name),[a,c]=(0,ji.useState)("all"),[u,d]=(0,ji.useState)("all"),f=sg(e,u),m=(0,ji.useRef)(),h=(0,ji.useMemo)(()=>i.filter(k=>Pw(k,u,a)?!1:r.name===Ff.name||r.name===_l.name&&k.type===Nt.user||r.name===Yp.name&&k.blockTypes?.includes("core/post-content")?!0:r.name==="uncategorized"?k.categories?!k.categories.some(y=>f.some(S=>S.name===y)):!0:k.categories?.includes(r.name)),[i,f,r.name,u,a]),p=uB(h,r,m),{changePage:g}=p;(0,ji.useEffect)(()=>()=>o(null),[]);let b=(0,ji.useCallback)(k=>{c(k),g(1)},[c,g]),v=(0,ji.useCallback)(k=>{d(k),g(1)},[d,g]);return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsxs)(Ds.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,$r.jsxs)(Ds.__experimentalHStack,{children:[(0,$r.jsx)(Ds.FlexBlock,{children:(0,$r.jsx)(Ds.__experimentalHeading,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:r.label})}),(0,$r.jsx)(_K,{patternSyncFilter:a,patternSourceFilter:u,setPatternSyncFilter:b,setPatternSourceFilter:v,scrollContainerRef:m,category:r})]}),!h.length&&(0,$r.jsx)(Ds.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,F5.__)("No results found")})]}),h.length>0&&(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(Ds.__experimentalText,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:(0,F5.__)("Drag and drop patterns into the canvas.")}),(0,$r.jsx)(Ba,{ref:m,blockPatterns:p.categoryPatterns,onClickPattern:s,onHover:o,label:r.label,orientation:"vertical",category:r.name,isDraggable:!0,showTitlesAsTooltip:n,patternFilter:u,pagingProps:p})]})]})}var hB=l(Z(),1),gB=l(A(),1),xK=l(R(),1);var fm=l(w(),1),{Tabs:pB}=M(gB.privateApis);function Cxe({categories:e,selectedCategory:t,onSelectCategory:o,children:r}){let s={type:"tween",duration:(0,hB.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},a=(0,hB.usePrevious)(t),c=t?t.name:null,[u,d]=(0,xK.useState)(),f=e?.[0]?.name;return c===null&&!u&&f&&d(f),(0,fm.jsxs)(pB,{selectOnMove:!1,selectedTabId:c,orientation:"vertical",onSelect:m=>{o(e.find(h=>h.name===m))},activeTabId:u,onActiveTabIdChange:d,children:[(0,fm.jsx)(pB.TabList,{className:"block-editor-inserter__category-tablist",children:e.map(m=>(0,fm.jsx)(pB.Tab,{tabId:m.name,"aria-current":m===t?"true":void 0,children:m.label},m.name))}),e.map(m=>(0,fm.jsx)(pB.TabPanel,{tabId:m.name,focusable:!1,children:(0,fm.jsx)(gB.__unstableMotion.div,{className:"block-editor-inserter__category-panel",initial:a?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:s,children:r})},m.name))]})}var bB=Cxe;var Kn=l(w(),1);function Bxe({onSelectCategory:e,selectedCategory:t,onInsert:o,rootClientId:r,children:n}){let[i,s]=(0,wK.useState)(!1),a=sg(r),c=(0,CK.useViewportMatch)("medium","<");return a.length?(0,Kn.jsxs)(Kn.Fragment,{children:[!c&&(0,Kn.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,Kn.jsx)(bB,{categories:a,selectedCategory:t,onSelectCategory:e,children:n}),(0,Kn.jsx)(BK.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,EK.__)("Explore all patterns")})]}),c&&(0,Kn.jsx)(dB,{categories:a,children:u=>(0,Kn.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,Kn.jsx)(mB,{onInsert:o,rootClientId:r,category:u},u.name)})}),i&&(0,Kn.jsx)(yK,{initialCategory:t||a[0],patternCategories:a,onModalClose:()=>s(!1),rootClientId:r})]}):(0,Kn.jsx)(Ns,{})}var TK=Bxe;var WK=l(N(),1),$K=l(Z(),1),KK=l(A(),1),yB=l(R(),1);var vB=l(A(),1),jK=l(N(),1),UK=l(Z(),1);var MK=l(A(),1),DK=l(N(),1);var Vt=l(A(),1),Yn=l(N(),1),Ea=l(R(),1),j5=l($(),1);var Uy=l(F(),1),OK=l(Un(),1),AK=l(z5(),1),LK=l(dn(),1);var PK=l($(),1),RK=l(w(),1),Exe={image:"img",video:"video",audio:"audio"};function kB(e,t){let o={id:e.id||void 0,caption:e.caption||void 0},r=e.url,n=e.alt||void 0;t==="image"?(o.url=r,o.alt=n):["video","audio"].includes(t)&&(o.src=r);let i=Exe[t],s=(0,RK.jsx)(i,{src:e.previewUrl||r,alt:n,controls:t==="audio"?!0:void 0,inert:"true",onError:({currentTarget:a})=>{a.src===e.previewUrl&&(a.src=r)}});return[(0,PK.createBlock)(`core/${t}`,o),s]}var st=l(w(),1),Txe=["image"],Ixe={placement:"bottom-end",className:"block-editor-inserter__media-list__item-preview-options__popover"};function Pxe({category:e,media:t}){if(!e.getReportUrl)return null;let o=e.getReportUrl(t);return(0,st.jsx)(Vt.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,Yn.__)("Options"),popoverProps:Ixe,icon:ks,children:()=>(0,st.jsx)(Vt.MenuGroup,{children:(0,st.jsx)(Vt.MenuItem,{onClick:()=>window.open(o,"_blank").focus(),icon:yA,children:(0,Yn.sprintf)((0,Yn.__)("Report %s"),e.mediaType)})})})}function Rxe({onClose:e,onSubmit:t}){return(0,st.jsxs)(Vt.Modal,{title:(0,Yn.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,st.jsxs)(Vt.__experimentalVStack,{spacing:3,children:[(0,st.jsx)("p",{children:(0,Yn.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),(0,st.jsx)("p",{children:(0,Yn.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,st.jsxs)(Vt.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,st.jsx)(Vt.FlexItem,{children:(0,st.jsx)(Vt.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,Yn.__)("Cancel")})}),(0,st.jsx)(Vt.FlexItem,{children:(0,st.jsx)(Vt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,Yn.__)("Insert")})})]})]})}function NK({media:e,onClick:t,category:o}){let[r,n]=(0,Ea.useState)(!1),[i,s]=(0,Ea.useState)(!1),[a,c]=(0,Ea.useState)(!1),[u,d]=(0,Ea.useMemo)(()=>kB(e,o.mediaType),[e,o.mediaType]),{createErrorNotice:f,createSuccessNotice:m}=(0,Uy.useDispatch)(OK.store),{getSettings:h,getBlock:p}=(0,Uy.useSelect)(_),{updateBlockAttributes:g}=(0,Uy.useDispatch)(_),b=(0,Ea.useCallback)(S=>{if(a)return;let x=h(),C=(0,j5.cloneBlock)(S),{id:B,url:I,caption:P}=C.attributes;if(!B&&!x.mediaUpload){n(!0);return}if(B){t(C);return}c(!0),window.fetch(I).then(E=>E.blob()).then(E=>{let L=(0,LK.getFilename)(I)||"image.jpg",T=new File([E],L,{type:E.type});x.mediaUpload({filesList:[T],additionalData:{caption:P},onFileChange([O]){(0,AK.isBlobURL)(O.url)||(p(C.clientId)?g(C.clientId,{...C.attributes,id:O.id,url:O.url}):(t({...C,attributes:{...C.attributes,id:O.id,url:O.url}}),m((0,Yn.__)("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),c(!1))},allowedTypes:Txe,onError(O){f(O,{type:"snackbar",id:"inserter-notice"}),c(!1)}})}).catch(()=>{n(!0),c(!1)})},[a,h,t,m,g,f,p]),v=typeof e.title=="string"?e.title:e.title?.rendered||(0,Yn.__)("no title"),k=(0,Ea.useCallback)(()=>s(!0),[]),y=(0,Ea.useCallback)(()=>s(!1),[]);return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)(Qh,{isEnabled:!0,blocks:[u],children:({draggable:S,onDragStart:x,onDragEnd:C})=>(0,st.jsx)("div",{className:V("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:S,onDragStart:x,onDragEnd:C,children:(0,st.jsxs)("div",{onMouseEnter:k,onMouseLeave:y,children:[(0,st.jsx)(Vt.Tooltip,{text:v,children:(0,st.jsx)(Vt.Composite.Item,{render:(0,st.jsx)("div",{"aria-label":v,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>b(u),children:(0,st.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[d,a&&(0,st.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,st.jsx)(Vt.Spinner,{})})]})})}),!a&&(0,st.jsx)(Pxe,{category:o,media:e})]})})}),r&&(0,st.jsx)(Rxe,{onClose:()=>n(!1),onSubmit:()=>{t((0,j5.cloneBlock)(u)),m((0,Yn.__)("Image inserted."),{type:"snackbar",id:"inserter-notice"}),n(!1)}})]})}var U5=l(w(),1);function Oxe({mediaList:e,category:t,onClick:o,label:r=(0,DK.__)("Media List")}){return(0,U5.jsx)(MK.Composite,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":r,children:e.map((n,i)=>(0,U5.jsx)(NK,{media:n,category:t,onClick:o},n.id||n.sourceId||i))})}var VK=Oxe;var Hl=l(R(),1),H5=l(F(),1);function FK(e,t={}){let[o,r]=(0,Hl.useState)(),[n,i]=(0,Hl.useState)(!1),s=(0,Hl.useRef)();return(0,Hl.useEffect)(()=>{(async()=>{let a=JSON.stringify({category:e.name,...t});s.current=a,i(!0),r([]);let c=await e.fetch?.(t);a===s.current&&(r(c),i(!1))})()},[e.name,...Object.values(t)]),{mediaList:o,isLoading:n}}function zK(e){let[t,o]=(0,Hl.useState)([]),r=(0,H5.useSelect)(a=>M(a(_)).getInserterMediaCategories(),[]),{canInsertImage:n,canInsertVideo:i,canInsertAudio:s}=(0,H5.useSelect)(a=>{let{canInsertBlockType:c}=a(_);return{canInsertImage:c("core/image",e),canInsertVideo:c("core/video",e),canInsertAudio:c("core/audio",e)}},[e]);return(0,Hl.useEffect)(()=>{(async()=>{let a=[];if(!r)return;let c=new Map(await Promise.all(r.map(async d=>{if(d.isExternalResource)return[d.name,!0];let f=[];try{f=await d.fetch({per_page:1})}catch{}return[d.name,!!f.length]}))),u={image:n,video:i,audio:s};r.forEach(d=>{u[d.mediaType]&&c.get(d.name)&&a.push(d)}),a.length&&o(a)})()},[n,i,s,r]),t}var qu=l(w(),1),Axe=10;function Hy({rootClientId:e,onInsert:t,category:o}){let[r,n,i]=(0,UK.useDebouncedInput)(),{mediaList:s,isLoading:a}=FK(o,{per_page:i?20:Axe,search:i}),c="block-editor-inserter__media-panel",u=o.labels.search_items||(0,jK.__)("Search");return(0,qu.jsxs)("div",{className:c,children:[(0,qu.jsx)(vB.SearchControl,{className:`${c}-search`,onChange:n,value:r,label:u,placeholder:u}),a&&(0,qu.jsx)("div",{className:`${c}-spinner`,children:(0,qu.jsx)(vB.Spinner,{})}),!a&&!s?.length&&(0,qu.jsx)(Ns,{}),!a&&!!s?.length&&(0,qu.jsx)(VK,{rootClientId:e,onClick:t,mediaList:s,category:o})]})}var HK=l(F(),1);function Lxe({fallback:e=null,children:t}){return(0,HK.useSelect)(r=>{let{getSettings:n}=r(_);return!!n().mediaUpload},[])?t:e}var Vs=Lxe;var GK=l(A(),1),Nxe=()=>null,Zu=(0,GK.withFilters)("editor.MediaUpload")(Nxe);var qn=l(w(),1),Mxe=["image","video","audio"];function Dxe({rootClientId:e,selectedCategory:t,onSelectCategory:o,onInsert:r,children:n}){let i=zK(e),s=(0,$K.useViewportMatch)("medium","<"),a="block-editor-inserter__media-tabs",c=(0,yB.useCallback)(d=>{if(!d?.url)return;let f=window.__experimentalDataViewsMediaModal&&d.mime_type?d.mime_type.split("/")[0]:d.type,[m]=kB(d,f);r(m)},[r]),u=(0,yB.useMemo)(()=>i.map(d=>({...d,label:d.labels.name})),[i]);return u.length?(0,qn.jsxs)(qn.Fragment,{children:[!s&&(0,qn.jsxs)("div",{className:`${a}-container`,children:[(0,qn.jsx)(bB,{categories:u,selectedCategory:t,onSelectCategory:o,children:n}),(0,qn.jsx)(Vs,{children:(0,qn.jsx)(Zu,{multiple:!1,onSelect:c,allowedTypes:Mxe,render:({open:d})=>(0,qn.jsx)(KK.Button,{__next40pxDefaultSize:!0,onClick:f=>{f.target.focus(),d()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:(0,WK.__)("Open Media Library")})})})]}),s&&(0,qn.jsx)(dB,{categories:u,children:d=>(0,qn.jsx)(Hy,{onInsert:r,rootClientId:e,category:d})})]}):(0,qn.jsx)(Ns,{})}var G5=Dxe;var Gy=l(R(),1),Xu=l(N(),1),W5=l(A(),1),_B=l(Z(),1),ZK=l(Xo(),1),XK=l(F(),1);var YK=l(A(),1),{Fill:qK,Slot:Vxe}=(0,YK.createSlotFill)("__unstableInserterMenuExtension");qK.Slot=Vxe;var SB=qK;var xn=l(w(),1),Fxe=9,zxe=[];function jxe({filterValue:e,onSelect:t,onHover:o,onHoverPattern:r,rootClientId:n,clientId:i,isAppender:s,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:u,showBlockDirectory:d=!1,isDraggable:f=!0,shouldFocusBlock:m=!0,prioritizePatterns:h,selectBlockOnInsert:p,isQuick:g}){let b=(0,_B.useDebounce)(ZK.speak,500),{prioritizedBlocks:v}=(0,XK.useSelect)(j=>({prioritizedBlocks:j(_).getBlockListSettings(n)?.prioritizedInserterBlocks||zxe}),[n]),[k,y]=Ku({onSelect:t,rootClientId:n,clientId:i,isAppender:s,insertionIndex:a,shouldFocusBlock:m,selectBlockOnInsert:p}),[S,x,C,B]=vu(k,y,g),[I,,P]=Yu(y,k,void 0,g),E=(0,Gy.useMemo)(()=>{if(c===0)return[];let j=jv(I,e);return c!==void 0?j.slice(0,c):j},[e,I,c]),L=u;h&&E.length>2&&(L=0);let T=(0,Gy.useMemo)(()=>{if(L===0)return[];let j=S.filter(ee=>ee.name!=="core/block"),z=pa(j,"frecency","desc");!e&&v.length&&(z=Jw(z,v));let W=Zw(z,x,C,e);return L!==void 0?W.slice(0,L):W},[e,S,x,C,L,v]);(0,Gy.useEffect)(()=>{if(!e)return;let j=T.length+E.length,z=(0,Xu.sprintf)((0,Xu._n)("%d result found.","%d results found.",j),j);b(z)},[e,b,T,E]);let O=(0,_B.useAsyncList)(T,{step:Fxe}),D=T.length>0||E.length>0,U=!!T.length&&(0,xn.jsx)($u,{title:(0,xn.jsx)(W5.VisuallyHidden,{children:(0,Xu.__)("Blocks")}),children:(0,xn.jsx)(cm,{items:O,onSelect:B,onHover:o,label:(0,Xu.__)("Blocks"),isDraggable:f})}),G=!!E.length&&(0,xn.jsx)($u,{title:(0,xn.jsx)(W5.VisuallyHidden,{children:(0,Xu.__)("Block patterns")}),children:(0,xn.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,xn.jsx)(Ba,{blockPatterns:E,onClickPattern:P,onHover:r,isDraggable:f})})});return(0,xn.jsxs)(qh,{children:[!d&&!D&&(0,xn.jsx)(Ns,{}),h?G:U,!!T.length&&!!E.length&&(0,xn.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),h?U:G,d&&(0,xn.jsx)(SB.Slot,{fillProps:{onSelect:B,onHover:o,filterValue:e,hasItems:D,rootClientId:k},children:j=>j.length?j:D?null:(0,xn.jsx)(Ns,{})})]})}var xB=jxe;var CB=l(A(),1),QK=l(R(),1);var Gl=l(w(),1),{Tabs:wB}=M(CB.privateApis);function Uxe({defaultTabId:e,onClose:t,onSelect:o,selectedTab:r,tabs:n,closeButtonLabel:i},s){return(0,Gl.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,Gl.jsxs)(wB,{selectOnMove:!1,defaultTabId:e,onSelect:o,selectedTabId:r,children:[(0,Gl.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,Gl.jsx)(CB.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:Cf,label:i,onClick:()=>t(),size:"compact"}),(0,Gl.jsx)(wB.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:s,children:n.map(a=>(0,Gl.jsx)(wB.Tab,{tabId:a.name,className:"block-editor-tabbed-sidebar__tab",children:a.title},a.name))})]}),n.map(a=>(0,Gl.jsx)(wB.TabPanel,{tabId:a.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:a.panelRef,children:a.panel},a.name))]})})}var BB=(0,QK.forwardRef)(Uxe);var EB=l(F(),1),lg=l(R(),1);function Wy(e=!0){let{setZoomLevel:t,resetZoomLevel:o}=M((0,EB.useDispatch)(_)),{isZoomedOut:r,isZoomOut:n}=(0,EB.useSelect)(a=>{let{isZoomOut:c}=M(a(_));return{isZoomedOut:c(),isZoomOut:c}},[]),i=(0,lg.useRef)(!1),s=(0,lg.useRef)(e);(0,lg.useEffect)(()=>{r!==s.current&&(i.current=!1)},[r]),(0,lg.useEffect)(()=>(s.current=e,e!==n()&&(i.current=!0,e?t("auto-scaled"):o()),()=>{i.current&&n()&&o()}),[e,n,o,t])}var qe=l(w(),1),eY=()=>{};function Hxe({rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,onSelect:n,showInserterHelpPanel:i,showMostUsedBlocks:s,__experimentalFilterValue:a="",shouldFocusBlock:c=!0,onPatternCategorySelection:u,onClose:d,__experimentalInitialTab:f,__experimentalInitialCategory:m},h){let{isZoomOutMode:p,hasSectionRootClientId:g}=(0,JK.useSelect)(he=>{let{isZoomOut:xe,getSectionRootClientId:ze}=M(he(_));return{isZoomOutMode:xe(),hasSectionRootClientId:!!ze()}},[]),[b,v,k]=(0,$y.useDebouncedInput)(a),[y,S]=(0,Ft.useState)(null),[x,C]=(0,Ft.useState)(m),[B,I]=(0,Ft.useState)("all"),[P,E]=(0,Ft.useState)(null),L=(0,$y.useViewportMatch)("large"),O=(0,$y.useViewportMatch)("medium","<")?d:eY;function D(){return f||(p?"patterns":"blocks")}let[U,G]=(0,Ft.useState)(D());Wy(g&&(U==="patterns"||U==="media")&&L);let[z,W,ee]=Ku({rootClientId:e,clientId:t,isAppender:o,insertionIndex:r,shouldFocusBlock:c}),se=(0,Ft.useRef)(),ce=(0,Ft.useCallback)((he,xe,ze,ot)=>{W(he,xe,ze,ot),n(he),O(),window.requestAnimationFrame(()=>{!c&&!se.current?.contains(h.current.ownerDocument.activeElement)&&se.current?.querySelector("button").focus()})},[W,O,n,h,c]),ie=(0,Ft.useCallback)((he,xe,...ze)=>{ee(!1),W(he,{patternName:xe},...ze),n(),O()},[W,O,n,ee]),re=(0,Ft.useCallback)(he=>{ee(he),S(he)},[ee,S]),Q=(0,Ft.useCallback)((he,xe)=>{C(he),I(xe),u?.()},[C,u]),Y=U==="patterns"&&!k&&!!x,J=U==="media"&&!!P,K=(0,Ft.useMemo)(()=>U==="media"?null:(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(cg.SearchControl,{className:"block-editor-inserter__search",onChange:he=>{y&&S(null),v(he)},value:b,label:(0,Qu.__)("Search"),placeholder:(0,Qu.__)("Search")}),!!k&&(0,qe.jsx)(xB,{filterValue:k,onSelect:n,onHover:re,rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:c,prioritizePatterns:U==="patterns"})]}),[U,y,S,v,b,k,n,re,c,t,e,r,o]),H=(0,Ft.useMemo)(()=>(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,qe.jsx)(rK,{ref:se,rootClientId:z,onInsert:ce,onHover:re,showMostUsedBlocks:s})}),i&&(0,qe.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,qe.jsx)(cg.VisuallyHidden,{as:"h2",children:(0,Qu.__)("A tip for using the block editor")}),(0,qe.jsx)(y9,{})]})]}),[z,ce,re,s,i]),X=(0,Ft.useMemo)(()=>(0,qe.jsx)(TK,{rootClientId:z,onInsert:ie,onSelectCategory:Q,selectedCategory:x,children:Y&&(0,qe.jsx)(mB,{rootClientId:z,onInsert:ie,category:x,patternFilter:B,showTitlesAsTooltip:!0})}),[z,ie,Q,B,x,Y]),ne=(0,Ft.useMemo)(()=>(0,qe.jsx)(G5,{rootClientId:z,selectedCategory:P,onSelectCategory:E,onInsert:ce,children:J&&(0,qe.jsx)(Hy,{rootClientId:z,onInsert:ce,category:P})}),[z,ce,P,E,J]),le=he=>{he!=="patterns"&&C(null),G(he)},ve=(0,Ft.useRef)();return(0,Ft.useLayoutEffect)(()=>{ve.current&&window.requestAnimationFrame(()=>{ve.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[]),(0,qe.jsxs)("div",{className:V("block-editor-inserter__menu",{"show-panel":Y||J,"is-zoom-out":p}),ref:h,children:[(0,qe.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,qe.jsx)(BB,{ref:ve,onSelect:le,onClose:d,selectedTab:U,closeButtonLabel:(0,Qu.__)("Close Block Inserter"),tabs:[{name:"blocks",title:(0,Qu.__)("Blocks"),panel:(0,qe.jsxs)(qe.Fragment,{children:[K,U==="blocks"&&!k&&H]})},{name:"patterns",title:(0,Qu.__)("Patterns"),panel:(0,qe.jsxs)(qe.Fragment,{children:[K,U==="patterns"&&!k&&X]})},{name:"media",title:(0,Qu.__)("Media"),panel:(0,qe.jsxs)(qe.Fragment,{children:[K,ne]})}]})}),i&&y&&(0,qe.jsx)(cg.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,qe.jsx)(Q1,{item:y})})]})}var $5=(0,Ft.forwardRef)(Hxe);function Gxe(e,t){return(0,qe.jsx)($5,{...e,onPatternCategorySelection:eY,ref:t})}var tY=(0,Ft.forwardRef)(Gxe);var TB=l(R(),1),Ky=l(N(),1),IB=l(A(),1),oY=l(F(),1);var mm=l(w(),1),Wxe=6,$xe=6,Kxe=2;function PB({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n,hasSearch:i=!0}){let[s,a]=(0,TB.useState)(""),[c,u]=Ku({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n}),[d]=vu(c,u,!0),{setInserterIsOpened:f,insertionIndex:m}=(0,oY.useSelect)(g=>{let{getSettings:b,getBlockIndex:v,getBlockCount:k}=g(_),y=b(),S=v(o),x=k();return{setInserterIsOpened:y.__experimentalSetIsInserterOpened,insertionIndex:S===-1?x:S}},[o]),h=i&&d.length>Wxe;(0,TB.useEffect)(()=>{f&&f(!1)},[f]);let p=()=>{f({filterValue:s,onSelect:e,rootClientId:t,insertionIndex:m})};return(0,mm.jsxs)("div",{className:V("block-editor-inserter__quick-inserter",{"has-search":h,"has-expand":f}),children:[h&&(0,mm.jsx)(IB.SearchControl,{className:"block-editor-inserter__search",value:s,onChange:g=>{a(g)},label:(0,Ky.__)("Search"),placeholder:(0,Ky.__)("Search")}),(0,mm.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,mm.jsx)(xB,{filterValue:s,onSelect:e,rootClientId:t,clientId:o,isAppender:r,maxBlockPatterns:s?Kxe:0,maxBlockTypes:$xe,isDraggable:!1,selectBlockOnInsert:n,isQuick:!0})}),f&&(0,mm.jsx)(IB.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:p,"aria-label":(0,Ky.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,Ky.__)("Browse all")})]})}var Yxe=50;function rY(e,t){if(!e||!e.attributes||!t?.__experimentalLabel)return null;let o=t.__experimentalLabel(e.attributes,{context:"appender"});return typeof o=="string"&&o.length0?o:null}var Yy=l(w(),1),qxe=({onToggle:e,disabled:t,isOpen:o,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s={}})=>{let{as:a=RB.Button,label:c,onClick:u,...d}=s,f=c;!f&&i?f=i:!f&&n?f=(0,Wl.sprintf)((0,Wl._x)("Add %s","directly add the only allowed block"),r.toLowerCase()):f||(f=(0,Wl._x)("Add block","Generic label for block inserter button"));function m(h){e&&e(h),u&&u(h)}return(0,Yy.jsx)(a,{__next40pxDefaultSize:s.as?void 0:!0,icon:Bi,label:f,tooltipPosition:"bottom",onClick:m,className:"block-editor-inserter__toggle","aria-haspopup":n?!1:"true","aria-expanded":n?!1:o,disabled:t,...d})},Zxe=class extends iY.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){let{onToggle:t}=this.props;t&&t(e)}renderToggle({onToggle:e,isOpen:t}){let{disabled:o,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s,hasItems:a,renderToggle:c=qxe}=this.props;return c({onToggle:e,isOpen:t,disabled:o||!a,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s})}renderContent({onClose:e}){let{rootClientId:t,clientId:o,isAppender:r,showInserterHelpPanel:n,__experimentalIsQuick:i,onSelectOrClose:s,selectBlockOnInsert:a}=this.props;return i?(0,Yy.jsx)(PB,{onSelect:c=>{let u=Array.isArray(c)&&c?.length?c[0]:c;s&&typeof s=="function"&&s(u),e()},rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:a}):(0,Yy.jsx)(tY,{onSelect:()=>{e()},onClose:e,rootClientId:t,clientId:o,isAppender:r,showInserterHelpPanel:n})}render(){let{position:e,hasSingleBlockType:t,directInsertBlock:o,insertOnlyAllowedBlock:r,__experimentalIsQuick:n,onSelectOrClose:i}=this.props;return t||o?this.renderToggle({onToggle:r}):(0,Yy.jsx)(RB.Dropdown,{className:"block-editor-inserter",contentClassName:V("block-editor-inserter__popover",{"is-quick":n}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,Wl.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}},Ui=(0,AB.compose)([(0,OB.withSelect)((e,{clientId:t,rootClientId:o,shouldDirectInsert:r=!0})=>{let{getBlockRootClientId:n,hasInserterItems:i,getAllowedBlocks:s,getDirectInsertBlock:a}=e(_),{getBlockVariations:c,getBlockType:u}=e(qy.store);o=o||n(t)||void 0;let d=s(o),f=r&&a(o),m=d?.length===1&&c(d[0].name,"inserter")?.length===0,h=!1;m&&(h=d[0]);let p=f?u(f.name):null,g=rY(f,p);return{hasItems:i(o),hasSingleBlockType:m,blockTitle:h?h.title:"",allowedBlockType:h,directInsertBlock:f,appenderLabel:g,rootClientId:o}}),(0,OB.withDispatch)((e,t,{select:o})=>({insertOnlyAllowedBlock(){let{rootClientId:r,clientId:n,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!s&&!c)return;function f(b){let{getBlock:v,getPreviousBlockClientId:k}=o(_);if(!b||!n&&!r)return{};let y={},S={};if(n){let x=v(n),C=v(k(n));x?.name===C?.name&&(S=C?.attributes||{})}else{let x=v(r);if(x?.innerBlocks?.length){let C=x.innerBlocks[x.innerBlocks.length-1];c&&c?.name===C.name&&(S=C.attributes)}}return b.forEach(x=>{S.hasOwnProperty(x)&&(y[x]=S[x])}),y}function m(){let{getBlockIndex:b,getBlockSelectionEnd:v,getBlockOrder:k,getBlockRootClientId:y}=o(_);if(n)return b(n);let S=v();return!i&&S&&y(S)===r?b(S)+1:k(r).length}let{insertBlock:h}=e(_),p;if(c){let b=f(c.attributesToCopy);p=(0,qy.createBlock)(c.name,{...c.attributes||{},...b})}else p=(0,qy.createBlock)(a.name);h(p,m(),r,d),u&&u(p);let g=(0,Wl.sprintf)((0,Wl.__)("%s block added"),a.title);(0,nY.speak)(g)}})),(0,AB.ifCondition)(({hasItems:e,isAppender:t,rootClientId:o,clientId:r})=>e||!t&&!o&&!r)])(Zxe);var Zy=l(w(),1),Xxe="\uFEFF";function ug({rootClientId:e}){let{showPrompt:t,isLocked:o,placeholder:r,isManualGrid:n}=(0,LB.useSelect)(u=>{let{getBlockCount:d,getSettings:f,getTemplateLock:m,getBlockAttributes:h}=u(_),p=!d(e),{bodyPlaceholder:g}=f();return{showPrompt:p,isLocked:!!m(e),placeholder:g,isManualGrid:h(e)?.layout?.isManualPlacement}},[e]),{insertDefaultBlock:i,startTyping:s}=(0,LB.useDispatch)(_);if(o||n)return null;let a=(0,sY.decodeEntities)(r)||(0,K5.__)("Type / to choose a block"),c=()=>{i(void 0,e),s()};return(0,Zy.jsxs)("div",{"data-root-client-id":e||"",className:V("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,Zy.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,K5.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:u=>{(NB.ENTER===u.keyCode||NB.SPACE===u.keyCode)&&c()},onClick:()=>c(),onFocus:()=>{t&&c()},children:t?a:Xxe}),(0,Zy.jsx)(Ui,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}var aY=l(A(),1),Y5=l(R(),1),Xy=l(N(),1);var lY=l(Re(),1);var MB=l(w(),1);function cY({rootClientId:e,className:t,onFocus:o,tabIndex:r,onSelect:n},i){return(0,MB.jsx)(Ui,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...s)=>{n&&typeof n=="function"&&n(...s)},renderToggle:({onToggle:s,disabled:a,isOpen:c,blockTitle:u,hasSingleBlockType:d,appenderLabel:f})=>{let m=!d,h;return f?h=f:d?h=(0,Xy.sprintf)((0,Xy._x)("Add %s","directly add the only allowed block"),u.toLowerCase()):h=(0,Xy._x)("Add block","Generic label for block inserter button"),(0,MB.jsx)(aY.Button,{__next40pxDefaultSize:!0,ref:i,onFocus:o,tabIndex:r,className:V(t,"block-editor-button-block-appender"),onClick:s,"aria-haspopup":m?"true":void 0,"aria-expanded":m?c:void 0,disabled:a,label:h,showTooltip:!0,children:(0,MB.jsx)(we,{icon:Bi})})},isAppender:!0})}var uY=(0,Y5.forwardRef)((e,t)=>((0,lY.default)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),cY(e,t))),Ju=(0,Y5.forwardRef)(cY);var dg=l(w(),1);function Qxe({rootClientId:e}){return(0,q5.useSelect)(o=>o(_).canInsertBlockType((0,dY.getDefaultBlockName)(),e))?(0,dg.jsx)(ug,{rootClientId:e}):(0,dg.jsx)(Ju,{rootClientId:e,className:"block-list-appender__toggle"})}function fY({rootClientId:e,CustomAppender:t,className:o,tagName:r="div"}){let n=(0,q5.useSelect)(i=>{let{getBlockInsertionPoint:s,isBlockInsertionPointVisible:a,getBlockCount:c}=i(_),u=s();return a()&&e===u?.rootClientId&&c(e)===0},[e]);return(0,dg.jsx)(r,{tabIndex:-1,className:V("block-list-appender wp-block",o,{"is-drag-over":n}),contentEditable:!1,"data-block":!0,children:t?(0,dg.jsx)(t,{}):(0,dg.jsx)(Qxe,{rootClientId:e})})}var EY=l(Z(),1),Jy=l(F(),1),TY=l(R(),1),IY=l(N(),1);var fg=l(F(),1),td=l(R(),1),FB=l(A(),1),CY=l(Z(),1);var hY=l(F(),1),ed=l(R(),1),gY=l(A(),1),bY=l(N(),1);var pY=l(Z(),1),Z5=l(Fe(),1),mY=new WeakMap;function Jxe(e){let t=(0,pY.useRefEffect)(o=>{function r(i){let{deltaX:s,deltaY:a,target:c}=i,u=e.current,d=mY.get(u);d||(d=(0,Z5.getScrollContainer)(u),mY.set(u,d));let f=(0,Z5.getScrollContainer)(c);o.contains(f)||d.scrollBy(s,a)}let n={passive:!0};return o.addEventListener("wheel",r,n),()=>{o.removeEventListener("wheel",r,n)}},[e]);return e?t:null}var pm=Jxe;var X5=l(w(),1),ewe=Number.MAX_SAFE_INTEGER;function twe({previousClientId:e,nextClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,operation:i="insert",nearestSide:s="right",...a}){let[c,u]=(0,ed.useReducer)(k=>(k+1)%ewe,0),{orientation:d,rootClientId:f,isVisible:m}=(0,hY.useSelect)(k=>{let{getBlockListSettings:y,getBlockRootClientId:S,isBlockVisible:x}=k(_),C=S(e??t);return{orientation:y(C)?.orientation||"vertical",rootClientId:C,isVisible:x(e)&&x(t)}},[e,t]),h=Xe(e),p=Xe(t),g=d==="vertical",b=(0,ed.useMemo)(()=>c<0||!h&&!p||!m?void 0:{contextElement:i==="group"?p||h:h||p,getBoundingClientRect(){let y=h?h.getBoundingClientRect():null,S=p?p.getBoundingClientRect():null,x=0,C=0,B=0,I=0;if(i==="group"){let P=S||y;C=P.top,B=0,I=P.bottom-P.top,x=s==="left"?P.left-2:P.right-2}else g?(C=y?y.bottom:S.top,B=y?y.width:S.width,I=S&&y?S.top-y.bottom:0,x=y?y.left:S.left):(C=y?y.top:S.top,I=y?y.height:S.height,(0,bY.isRTL)()?(x=S?S.right:y.left,B=y&&S?y.left-S.right:0):(x=y?y.right:S.left,B=y&&S?S.left-y.right:0),B=Math.max(B,0));return new window.DOMRect(x,C,B,I)}},[h,p,c,g,m,i,s]),v=pm(n);return(0,ed.useLayoutEffect)(()=>{if(!h)return;let k=new window.MutationObserver(u);return k.observe(h,{attributes:!0}),()=>{k.disconnect()}},[h]),(0,ed.useLayoutEffect)(()=>{if(!p)return;let k=new window.MutationObserver(u);return k.observe(p,{attributes:!0}),()=>{k.disconnect()}},[p]),(0,ed.useLayoutEffect)(()=>{if(h)return h.ownerDocument.defaultView.addEventListener("resize",u),()=>{h.ownerDocument.defaultView?.removeEventListener("resize",u)}},[h]),!h&&!p||!m?null:(0,X5.jsx)(gY.Popover,{ref:v,animate:!1,anchor:b,focusOnMount:!1,__unstableSlotName:r,inline:!r,...a,className:V("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,X5.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:o})},t+"--"+f)}var DB=twe;var SY=l(F(),1),_Y=l(Z(),1),xY=l(A(),1);var Kl=l(R(),1);var kY=l(Z(),1),vY=l(A(),1),$l=l(R(),1);var Q5=l(w(),1),owe=Number.MAX_SAFE_INTEGER;function rwe({clientId:e,bottomClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,shift:i=!0,...s},a){let c=Xe(e),u=Xe(t??e),d=(0,kY.useMergeRefs)([a,pm(n)]),[f,m]=(0,$l.useReducer)(p=>(p+1)%owe,0);(0,$l.useLayoutEffect)(()=>{if(!c)return;let p=new window.MutationObserver(m);return p.observe(c,{attributes:!0}),()=>{p.disconnect()}},[c]);let h=(0,$l.useMemo)(()=>{if(!(f<0||!c||t&&!u))return{getBoundingClientRect(){return u?wD(_h(c),_h(u)):_h(c)},contextElement:c}},[f,c,t,u]);return!c||t&&!u?null:(0,Q5.jsx)(vY.Popover,{ref:d,animate:!1,focusOnMount:!1,anchor:h,__unstableSlotName:r,inline:!r,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:V("block-editor-block-popover",s.className),variant:"unstyled",children:o})}var hm=(0,$l.forwardRef)(rwe),nwe=({clientId:e,bottomClientId:t,children:o,...r},n)=>(0,Q5.jsx)(hm,{...r,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:n,children:o}),yY=(0,$l.forwardRef)(nwe);var VB=l(w(),1);function iwe({clientId:e,bottomClientId:t,children:o,shift:r=!1,additionalStyles:n,...i},s){t??=e;let a=Xe(e);return(0,VB.jsx)(hm,{ref:s,clientId:e,bottomClientId:t,shift:r,...i,children:a&&e===t?(0,VB.jsx)(swe,{selectedElement:a,additionalStyles:n,children:o}):o})}function swe({selectedElement:e,additionalStyles:t={},children:o}){let[r,n]=(0,Kl.useState)(e.offsetWidth),[i,s]=(0,Kl.useState)(e.offsetHeight);(0,Kl.useEffect)(()=>{let c=new window.ResizeObserver(()=>{n(e.offsetWidth),s(e.offsetHeight)});return c.observe(e,{box:"border-box"}),()=>c.disconnect()},[e]);let a=(0,Kl.useMemo)(()=>({position:"absolute",width:r,height:i,...t}),[r,i,t]);return(0,VB.jsx)("div",{style:a,children:o})}var Hi=(0,Kl.forwardRef)(iwe);var J5=l(w(),1),Qy={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};function awe({__unstablePopoverSlot:e,__unstableContentRef:t}){let{clientId:o}=(0,SY.useSelect)(n=>{let{getBlockOrder:i,getBlockInsertionPoint:s}=n(_),a=s(),c=i(a.rootClientId);return c.length?{clientId:c[a.index]}:{}},[]),r=(0,_Y.useReducedMotion)();return(0,J5.jsx)(Hi,{clientId:o,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,J5.jsx)(xY.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?Qy.show:Qy.hide,animate:Qy.show,exit:r?Qy.show:Qy.exit,className:"block-editor-block-popover__drop-zone-foreground"})})}var wY=awe;var Yl=l(w(),1),mg=(0,td.createContext)();mg.displayName="InsertionPointOpenRefContext";function lwe({__unstablePopoverSlot:e,__unstableContentRef:t,operation:o="insert",nearestSide:r="right"}){let{selectBlock:n,hideInsertionPoint:i}=(0,fg.useDispatch)(_),s=(0,td.useContext)(mg),a=(0,td.useRef)(),{orientation:c,previousClientId:u,nextClientId:d,rootClientId:f,isInserterShown:m,isDistractionFree:h,isZoomOutMode:p}=(0,fg.useSelect)(P=>{let{getBlockOrder:E,getBlockListSettings:L,getBlockInsertionPoint:T,isBlockBeingDragged:O,getPreviousBlockClientId:D,getNextBlockClientId:U,getSettings:G,isZoomOut:j}=M(P(_)),z=T(),W=E(z.rootClientId);if(!W.length)return{};let ee=W[z.index-1],se=W[z.index];for(;O(ee);)ee=D(ee);for(;O(se);)se=U(se);let ce=G();return{previousClientId:ee,nextClientId:se,orientation:L(z.rootClientId)?.orientation||"vertical",rootClientId:z.rootClientId,isDistractionFree:ce.isDistractionFree,isInserterShown:z?.__unstableWithInserter,isZoomOutMode:j()}},[]),{getBlockEditingMode:g}=(0,fg.useSelect)(_),b=(0,CY.useReducedMotion)();function v(P){P.target===a.current&&d&&g(d)!=="disabled"&&n(d,-1)}function k(P){P.target===a.current&&!s.current&&i()}function y(P){P.target!==a.current&&(s.current=!0)}let S=(0,td.useCallback)(P=>{!P&&s.current&&(s.current=!1)},[s]),x={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:m?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},C={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(h||p&&o!=="insert")return null;let I=V("block-editor-block-list__insertion-point",c==="horizontal"||o==="group"?"is-horizontal":"is-vertical");return(0,Yl.jsx)(DB,{previousClientId:u,nextClientId:d,__unstablePopoverSlot:e,__unstableContentRef:t,operation:o,nearestSide:r,children:(0,Yl.jsxs)(FB.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:a,tabIndex:-1,onClick:v,onFocus:y,className:V(I,{"is-with-inserter":m}),onHoverEnd:k,children:[(0,Yl.jsx)(FB.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),m&&(0,Yl.jsx)(FB.__unstableMotion.div,{variants:C,className:V("block-editor-block-list__insertion-point-inserter"),children:(0,Yl.jsx)(Ui,{ref:S,position:"bottom center",clientId:d,rootClientId:f,__experimentalIsQuick:!0,onToggle:P=>{s.current=P},onSelectOrClose:()=>{s.current=!1}})})]})})}function BY(e){let{insertionPoint:t,isVisible:o,isBlockListEmpty:r}=(0,fg.useSelect)(n=>{let{getBlockInsertionPoint:i,isBlockInsertionPointVisible:s,getBlockCount:a}=n(_),c=i();return{insertionPoint:c,isVisible:s(),isBlockListEmpty:a(c?.rootClientId)===0}},[]);return!o||r?null:t.operation==="replace"?(0,Yl.jsx)(wY,{...e},`${t.rootClientId}-${t.index}`):(0,Yl.jsx)(lwe,{operation:t.operation,nearestSide:t.nearestSide,...e})}function PY(){let e=(0,TY.useContext)(mg),t=(0,Jy.useSelect)(g=>{let b=g(_).getSettings();return b.isDistractionFree||b.isPreviewMode||M(g(_)).isZoomOut()},[]),{getBlockListSettings:o,getBlockIndex:r,isMultiSelecting:n,getSelectedBlockClientIds:i,getSettings:s,getTemplateLock:a,__unstableIsWithinBlockOverlay:c,getBlockEditingMode:u,getBlockName:d,getBlockAttributes:f,getParentSectionBlock:m}=M((0,Jy.useSelect)(_)),{showInsertionPoint:h,hideInsertionPoint:p}=(0,Jy.useDispatch)(_);return(0,EY.useRefEffect)(g=>{if(t)return;function b(v){if(e===void 0||e.current||v.target.nodeType===v.target.TEXT_NODE||n())return;if(!v.target.classList.contains("block-editor-block-list__layout")){p();return}let k;if(v.target.classList.contains("is-root-container")||(k=(v.target.getAttribute("data-block")?v.target:v.target.closest("[data-block]")).getAttribute("data-block")),a(k)||u(k)==="disabled"||d(k)==="core/block"||k&&f(k).layout?.isManualPlacement)return;let y=o(k),S=y?.orientation||"vertical",x=!!y?.__experimentalCaptureToolbars,C=v.clientY,B=v.clientX,P=Array.from(v.target.children).find(O=>{let D=O.getBoundingClientRect();return O.classList.contains("wp-block")&&S==="vertical"&&D.top>C||O.classList.contains("wp-block")&&S==="horizontal"&&((0,IY.isRTL)()?D.rightB)});if(!P){p();return}if(!P.id&&(P=P.firstElementChild,!P)){p();return}let E=P.id.slice(6);if(!E||c(E)||m(E)||i().includes(E)&&S==="vertical"&&!x&&!s().hasFixedToolbar)return;let L=P.getBoundingClientRect();if(S==="horizontal"&&(v.clientY>L.bottom||v.clientYL.right||v.clientX{g.removeEventListener("mousemove",b)}},[e,o,r,n,h,p,i,t])}var zB=l(F(),1),RY=l(Z(),1);var OY=l(w(),1);function gm(){let{getSettings:e,hasSelectedBlock:t,hasMultiSelection:o}=(0,zB.useSelect)(_),{clearSelectedBlock:r}=(0,zB.useDispatch)(_),{clearBlockSelection:n}=e();return(0,RY.useRefEffect)(i=>{if(!n)return;function s(a){!t()&&!o()||a.target===i&&r()}return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}},[t,o,r,n])}function AY(e){return(0,OY.jsx)("div",{ref:gm(),...e})}var eq=l(Z(),1),hg=l(R(),1),tq=l(F(),1),ym=l($(),1);var LY=l(w(),1);function NY({showSeparator:e,isFloating:t,onAddBlock:o,isToggle:r}){let{clientId:n}=Ie();return(0,LY.jsx)(Ju,{className:V({"block-list-appender__toggle":r}),rootClientId:n,showSeparator:e,isFloating:t,onAddBlock:o})}var MY=l(w(),1);function DY(){let{clientId:e}=Ie();return(0,MY.jsx)(ug,{rootClientId:e})}var UB=l(R(),1),zY=l(F(),1),jB=l(Re(),1),jY=l(eS(),1);var tS=new WeakMap;function cwe(){let e;return t=>((e===void 0||!(0,jY.isShallowEqual)(e,t))&&(e=t),e)}function FY(e){let[t]=(0,UB.useState)(cwe);return t(e)}function UY(e,t,o,r,n,i,s,a,c,u,d,f){let m=(0,zY.useRegistry)(),h=FY(o),p=FY(r),g=c===void 0||t==="contentOnly"?t:c;(0,UB.useLayoutEffect)(()=>{let b={allowedBlocks:h,prioritizedInserterBlocks:p,templateLock:g};if(u!==void 0&&(b.__experimentalCaptureToolbars=u),d!==void 0)b.orientation=d;else{let v=ws(f?.type);b.orientation=v.getOrientation(f)}s!==void 0&&((0,jB.default)("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),b.defaultBlock=s),n!==void 0&&(b.defaultBlock=n),a!==void 0&&((0,jB.default)("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),b.directInsert=a),i!==void 0&&(b.directInsert=i),b.directInsert!==void 0&&typeof b.directInsert!="boolean"&&(0,jB.default)("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),tS.get(m)||tS.set(m,{}),tS.get(m)[e]=b,window.queueMicrotask(()=>{let v=tS.get(m);if(Object.keys(v).length){let{updateBlockListSettings:k}=m.dispatch(_);k(v),tS.set(m,{})}})},[e,h,p,g,n,i,s,a,u,d,f,m])}var eV=l(Sf(),1),HB=l(R(),1),HY=l(F(),1),GY=l($(),1);function WY(e,t,o,r){let n=(0,HY.useRegistry)(),i=(0,HB.useRef)(null);(0,HB.useLayoutEffect)(()=>{let s=!1,{getBlocks:a,getSelectedBlocksInitialCaretPosition:c,isBlockSelected:u}=n.select(_),{replaceInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:f}=n.dispatch(_);return window.queueMicrotask(()=>{if(s)return;let m=a(e),h=m.length===0||o==="all"||o==="contentOnly",p=!(0,eV.default)(t,i.current);if(!h||!p)return;i.current=t;let g=(0,GY.synchronizeBlocksWithTemplate)(m,t);(0,eV.default)(g,m)||(f(),d(e,g,m.length===0&&r&&g.length!==0&&u(e),c()))}),()=>{s=!0}},[t,o,e,n,r])}var $Y=l($(),1),KY=l(F(),1);function YY(e){return(0,KY.useSelect)(t=>{let o=t(_).getBlock(e);if(!o)return;let r=t($Y.store).getBlockType(o.name);if(r&&Object.keys(r.providesContext).length!==0)return Object.fromEntries(Object.entries(r.providesContext).map(([n,i])=>[n,o.attributes[i]]))},[e])}var vm=l(F(),1),$B=l(R(),1),KB=l(Z(),1),QY=l(N(),1),pg=l($(),1);var tV=l(R(),1),Zn=l($(),1),bm=l(F(),1),qY=l(Fe(),1);function oV(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch{return t}return t}function uwe(e,t,o,r,n,i,s,a,c){return u=>{let{srcRootClientId:d,srcClientIds:f,type:m,blocks:h}=oV(u);if(m==="inserter"){s();let p=h.map(g=>(0,Zn.cloneBlock)(g));i(p,!0,null)}if(m==="block"){let p=o(f[0]);if(d===e&&p===t||f.includes(e)||r(f).some(k=>k===e))return;if(a==="group"){let k=f.map(y=>c(y));i(k,!0,null,f);return}let g=d===e,b=f.length,v=g&&p{if(!t().mediaUpload)return;let s=(0,Zn.findTransform)((0,Zn.getBlockTransforms)("from"),a=>a.type==="files"&&r(a.blockName,e)&&a.isMatch(i));if(s){let a=s.transform(i,o);n(a)}}}function fwe(e){return t=>{let o=(0,Zn.pasteHandler)({HTML:t,mode:"BLOCKS"});o.length&&e(o)}}function GB(e,t,o={}){let{operation:r="insert",nearestSide:n="right"}=o,{canInsertBlockType:i,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:c,getBlocksByClientId:u,getSettings:d,getBlock:f}=(0,bm.useSelect)(_),{getGroupingBlockName:m}=(0,bm.useSelect)(Zn.store),{insertBlocks:h,moveBlocksToPosition:p,updateBlockAttributes:g,clearSelectedBlock:b,replaceBlocks:v,removeBlocks:k}=(0,bm.useDispatch)(_),y=(0,bm.useRegistry)(),S=(0,tV.useCallback)((P,E=!0,L=0,T=[])=>{Array.isArray(P)||(P=[P]);let D=c(e)[t];if(r==="replace")v(D,P,void 0,L);else if(r==="group"){let U=f(D);n==="left"?P.push(U):P.unshift(U);let G=P.map(ee=>(0,Zn.createBlock)(ee.name,ee.attributes,ee.innerBlocks)),j=P.every(ee=>ee.name==="core/image"),z=i("core/gallery",e),W=(0,Zn.createBlock)(j&&z?"core/gallery":m(),{layout:{type:"flex",flexWrap:j&&z?null:"nowrap"}},G);v([D,...T],W,void 0,L)}else h(P,t,e,E,L)},[c,e,t,r,v,f,n,i,m,h]),x=(0,tV.useCallback)((P,E,L)=>{if(r==="replace"){let T=u(P),D=c(e)[t];y.batch(()=>{k(P,!1),v(D,T,void 0,0)})}else p(P,E,e,L)},[r,c,u,p,y,k,v,t,e]),C=uwe(e,t,s,a,x,S,b,r,f),B=dwe(e,d,g,i,S),I=fwe(S);return P=>{let E=(0,qY.getFilesFromDataTransfer)(P.dataTransfer),L=P.dataTransfer.getData("text/html");L?I(L):E.length?B(E):C(P)}}function mwe(e,t,o){let r=o==="top"||o==="bottom",{x:n,y:i}=e,s=r?n:i,a=r?i:n,c=r?t.left:t.top,u=r?t.right:t.bottom,d=t[o],f;return s>=c&&s<=u?f=s:s{let s=mwe(e,t,i);(r===void 0||s=e.x&&t.top<=e.y&&t.bottom>=e.y}function ZY(e,t){return t.top<=e.y&&t.bottom>=e.y}var rV=30,pwe=120,hwe=120;function gwe(e,t,o="vertical",r={}){let n=o==="horizontal"?["left","right"]:["top","bottom"],i=0,s="before",a=1/0,c=null,u="right",{dropZoneElement:d,parentBlockOrientation:f,rootBlockIndex:m=0}=r;if(d&&f!=="horizontal"){let v=d.getBoundingClientRect(),[k,y]=km(t,v,["top","bottom"]);if(v.height>pwe&&khwe&&k{let x=k();if(!x)return;let[C,B]=km(t,x,n),[I,P]=km(t,x,["left","right"]),E=WB(t,x);v&&E?C=0:o==="vertical"&&S!=="horizontal"&&(E&&Ic);n=o.every(c=>a?.includes(c))}let s=o.map(a=>e(a)).every(a=>{let[c]=a?.parent||[];return c?c===r:!0});return n&&s}function XY(e,t){let{defaultView:o}=t;return!!(o&&e instanceof o.HTMLElement&&e.closest("[data-is-insertion-point]"))}function JY({dropZoneElement:e,rootClientId:t="",parentClientId:o="",isDisabled:r=!1}={}){let n=(0,vm.useRegistry)(),[i,s]=(0,$B.useState)({index:null,operation:"insert"}),{getBlockType:a,getBlockVariations:c,getGroupingBlockName:u}=(0,vm.useSelect)(pg.store),{canInsertBlockType:d,getBlockListSettings:f,getBlocks:m,getBlockIndex:h,getDraggedBlockClientIds:p,getBlockNamesByClientId:g,getAllowedBlocks:b,isDragging:v,isGroupable:k,isZoomOut:y,getSectionRootClientId:S,getBlockParents:x}=M((0,vm.useSelect)(_)),{showInsertionPoint:C,hideInsertionPoint:B,startDragging:I,stopDragging:P}=M((0,vm.useDispatch)(_)),E=GB(i.operation==="before"||i.operation==="after"?o:t,i.index,{operation:i.operation,nearestSide:i.nearestSide}),L=(0,KB.useThrottle)((0,$B.useCallback)((T,O)=>{v()||I();let D=p(),U=[t,...x(t,!0)];if(D.some(H=>U.includes(H)))return;let j=b(t),z=g([t])[0],W=g(D);if(!YB(a,j,W,z))return;let se=S();if(y()&&se!==t)return;let ce=m(t).filter(H=>!((0,pg.hasBlockSupport)(H.name,"visibility",!0)&&H.attributes?.metadata?.blockVisibility===!1));if(ce.length===0){n.batch(()=>{s({index:0,operation:"insert"}),C(t,0,{operation:"insert"})});return}let ie=ce.map(H=>{let X=H.clientId;return{isUnmodifiedDefaultBlock:(0,pg.isUnmodifiedDefaultBlock)(H),getBoundingClientRect:()=>{let ne=O.getElementById(`block-${X}`);return ne?ne.getBoundingClientRect():null},blockIndex:h(X),blockOrientation:f(X)?.orientation}}),re=gwe(ie,{x:T.clientX,y:T.clientY},f(t)?.orientation,{dropZoneElement:e,parentBlockClientId:o,parentBlockOrientation:o?f(o)?.orientation:void 0,rootBlockIndex:h(t)}),[Q,Y,J]=re,K=ie[Q]?.isUnmodifiedDefaultBlock;if(!(y()&&!K&&Y!=="insert")){if(Y==="group"){let H=ce[Q],X=[H.name,...W].every(xe=>xe==="core/image"),ne=d("core/gallery",t),le=k([H.clientId,p()]),ve=c(u(),"block"),he=ve&&ve.find(({name:xe})=>xe==="group-row");if(X&&!ne&&(!le||!he)||!X&&(!le||!he))return}n.batch(()=>{s({index:Q,operation:Y,nearestSide:J});let H=["before","after"].includes(Y)?o:t;C(H,Q,{operation:Y,nearestSide:J})})}},[v,b,t,g,p,a,S,y,m,f,e,o,h,n,I,C,d,k,c,u]),200);return(0,KB.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:r,onDrop:E,onDragOver(T){L(T,T.currentTarget.ownerDocument)},onDragLeave(T){let{ownerDocument:O}=T.currentTarget;XY(T.relatedTarget,O)||XY(T.target,O)||(L.cancel(),B())},onDragEnd(){L.cancel(),P(),B()}})}var ql=l(w(),1),bwe={};function kwe({children:e,clientId:t}){let o=YY(t);return(0,ql.jsx)(b0,{value:o,children:e})}var vwe=(0,hg.memo)(Fy);function oq(e){let{clientId:t,allowedBlocks:o,prioritizedInserterBlocks:r,defaultBlock:n,directInsert:i,__experimentalDefaultBlock:s,__experimentalDirectInsert:a,template:c,templateLock:u,wrapperRef:d,templateInsertUpdatesSelection:f,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:h,renderAppender:p,orientation:g,placeholder:b,layout:v,name:k,blockType:y,parentLock:S,defaultLayout:x}=e;UY(t,S,o,r,n,i,s,a,u,m,g,v),WY(t,c,u,f);let C=(0,ym.getBlockSupport)(k,"layout")||(0,ym.getBlockSupport)(k,"__experimentalLayout")||bwe,{allowSizingOnChildren:B=!1}=C,I=v||C,P=(0,hg.useMemo)(()=>({...x,...I,...B&&{allowSizingOnChildren:!0}}),[x,I,B]),E=(0,ql.jsx)(vwe,{rootClientId:t,renderAppender:p,__experimentalAppenderTagName:h,layout:P,wrapperRef:d,placeholder:b});return!y?.providesContext||Object.keys(y.providesContext).length===0?E:(0,ql.jsx)(kwe,{clientId:t,children:E})}function ywe(e){return g1(e),(0,ql.jsx)(oq,{...e})}var qB=(0,hg.forwardRef)((e,t)=>{let o=Sm({ref:t},e);return(0,ql.jsx)("div",{className:"block-editor-inner-blocks",children:(0,ql.jsx)("div",{...o})})});function Sm(e={},t={}){let{__unstableDisableLayoutClassNames:o,__unstableDisableDropZone:r,dropZoneElement:n}=t,{clientId:i,layout:s=null,__unstableLayoutClassNames:a=""}=Ie(),c=(0,tq.useSelect)(S=>{let{getBlockName:x,isZoomOut:C,getTemplateLock:B,getBlockRootClientId:I,getBlockEditingMode:P,getBlockSettings:E,getSectionRootClientId:L}=M(S(_));if(!i){let W=L();return{isDropZoneDisabled:C()&&W!==""}}let{hasBlockSupport:T,getBlockType:O}=S(ym.store),D=x(i),U=P(i),G=I(i),[j]=E(i,"layout"),z=U==="disabled";if(C()){let W=L();z=i!==W}return{__experimentalCaptureToolbars:T(D,"__experimentalExposeControlsToChildren",!1),name:D,blockType:O(D),parentLock:B(G),parentClientId:G,isDropZoneDisabled:z,defaultLayout:j}},[i]),{__experimentalCaptureToolbars:u,name:d,blockType:f,parentLock:m,parentClientId:h,isDropZoneDisabled:p,defaultLayout:g}=c,b=JY({dropZoneElement:n,rootClientId:i,parentClientId:h}),v=(0,eq.useMergeRefs)([e.ref,r||p||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:b]),k={__experimentalCaptureToolbars:u,layout:s,name:d,blockType:f,parentLock:m,defaultLayout:g,...t},y=k.value&&k.onChange?ywe:oq;return{...e,ref:v,className:V(e.className,"block-editor-block-list__layout",o?"":a),children:i?(0,ql.jsx)(y,{...k,clientId:i}):(0,ql.jsx)(Fy,{...t})}}Sm.save=ym.__unstableGetInnerBlocksProps;qB.DefaultBlockAppender=DY;qB.ButtonBlockAppender=NY;qB.Content=()=>Sm.save().children;var oS=qB;var rS=l(Z(),1),gg=l(F(),1),nV=l(Fe(),1),Br=l(it(),1);var rq=l(w(),1),Swe=new Set([Br.UP,Br.RIGHT,Br.DOWN,Br.LEFT,Br.ENTER,Br.BACKSPACE]);function _we(e){let{keyCode:t,shiftKey:o}=e;return!o&&Swe.has(t)}function nS(){let e=(0,gg.useSelect)(o=>o(_).isTyping(),[]),{stopTyping:t}=(0,gg.useDispatch)(_);return(0,rS.useRefEffect)(o=>{if(!e)return;let{ownerDocument:r}=o,n,i;function s(a){let{clientX:c,clientY:u}=a;n&&i&&(n!==c||i!==u)&&t(),n=c,i=u}return r.addEventListener("mousemove",s),()=>{r.removeEventListener("mousemove",s)}},[e,t])}function iS(){let{isTyping:e}=(0,gg.useSelect)(i=>{let{isTyping:s}=i(_);return{isTyping:s()}},[]),{startTyping:t,stopTyping:o}=(0,gg.useDispatch)(_),r=nS(),n=(0,rS.useRefEffect)(i=>{let{ownerDocument:s}=i,{defaultView:a}=s,c=a.getSelection();if(e){let h=function(v){let{target:k}=v;b=a.setTimeout(()=>{(0,nV.isTextField)(k)||o()})},p=function(v){let{keyCode:k}=v;(k===Br.ESCAPE||k===Br.TAB)&&o()},g=function(){c.isCollapsed||o()};var u=h,d=p,f=g;let b;return i.addEventListener("focus",h),i.addEventListener("keydown",p),s.addEventListener("selectionchange",g),()=>{a.clearTimeout(b),i.removeEventListener("focus",h),i.removeEventListener("keydown",p),s.removeEventListener("selectionchange",g)}}function m(h){let{type:p,target:g}=h;!(0,nV.isTextField)(g)||!i.contains(g)||p==="keydown"&&!_we(h)||t()}return i.addEventListener("keypress",m),i.addEventListener("keydown",m),()=>{i.removeEventListener("keypress",m),i.removeEventListener("keydown",m)}},[e,t,o]);return(0,rS.useMergeRefs)([r,n])}function xwe({children:e}){return(0,rq.jsx)("div",{ref:iS(),children:e})}var nq=xwe;var sS=l(A(),1),iq=l(Z(),1),sq=l(F(),1),aq=l(R(),1),lq=l(N(),1);var ZB=l(w(),1);function iV({clientId:e,rootClientId:t="",position:o="top"}){let[r,n]=(0,aq.useState)(!1),{sectionRootClientId:i,sectionClientIds:s,insertionPoint:a,blockInsertionPointVisible:c,blockInsertionPoint:u,blocksBeingDragged:d}=(0,sq.useSelect)(x=>{let{getInsertionPoint:C,getBlockOrder:B,getSectionRootClientId:I,isBlockInsertionPointVisible:P,getBlockInsertionPoint:E,getDraggedBlockClientIds:L}=M(x(_)),T=I(),O=B(T);return{sectionRootClientId:T,sectionClientIds:O,insertionPoint:C(),blockInsertionPoint:E(),blockInsertionPointVisible:P(),blocksBeingDragged:L()}},[]),f=(0,iq.useReducedMotion)();if(!e)return;let m=!1;if(!(t===i&&s&&s.includes(e)))return null;let p=a?.index===0&&e===s[a.index],g=a&&a.hasOwnProperty("index")&&e===s[a.index-1];o==="top"&&(m=p||c&&u.index===0&&e===s[u.index]),o==="bottom"&&(m=g||c&&e===s[u.index-1]);let b=d[0],v=d.includes(e),k=s.indexOf(b),S=(k>0?s[k-1]:null)===e;return(v||S)&&(m=!1),(0,ZB.jsx)(sS.__unstableAnimatePresence,{children:m&&(0,ZB.jsx)(sS.__unstableMotion.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:f?0:.2,ease:[.6,0,.4,1]},className:V("block-editor-block-list__zoom-out-separator",{"is-dragged-over":r}),"data-is-insertion-point":"true",onDragOver:()=>n(!0),onDragLeave:()=>n(!1),children:(0,ZB.jsx)(sS.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:(0,lq.__)("Drop pattern.")})})})}var Kr=l(w(),1),t1=(0,od.createContext)();t1.displayName="IntersectionObserverContext";var XB=new WeakMap,wwe={trailing:!0};function Cwe({className:e,...t}){let{isOutlineMode:o,isFocusMode:r,isPreviewMode:n,editedContentOnlySection:i}=(0,Gi.useSelect)(f=>{let{getSettings:m,isTyping:h,hasBlockSpotlight:p,getEditedContentOnlySection:g}=M(f(_)),{outlineMode:b,focusMode:v,isPreviewMode:k}=m();return{isOutlineMode:b&&!h(),isFocusMode:v||p(),isPreviewMode:k,editedContentOnlySection:g()}},[]),s=(0,Gi.useRegistry)(),{setBlockVisibility:a}=(0,Gi.useDispatch)(_),c=(0,QB.useDebounce)((0,od.useCallback)(()=>{let f={};XB.get(s).forEach(([m,h])=>{f[m]=h}),a(f)},[s]),300,wwe),u=(0,od.useMemo)(()=>{let{IntersectionObserver:f}=window;if(f)return new f(m=>{XB.get(s)||XB.set(s,[]);for(let h of m){let p=h.target.getAttribute("data-block");XB.get(s).push([p,h.isIntersecting])}c()})},[]),d=Sm({ref:(0,QB.useMergeRefs)([gm(),PY(),iS()]),className:V("is-root-container",e,{"is-outline-mode":o,"is-focus-mode":r,"is-preview-mode":n})},t);return(0,Kr.jsxs)(t1.Provider,{value:u,children:[(0,Kr.jsx)("div",{...d}),!!i&&(0,Kr.jsx)(Bwe,{clientId:i})]})}function Bwe({clientId:e}){let{stopEditingContentOnlySection:t}=M((0,Gi.useDispatch)(_)),o=(0,Gi.useSelect)(r=>{let{isBlockSelected:n,hasSelectedInnerBlock:i,getBlockSelectionStart:s}=r(_);return!s()||n(e)||i(e,!0)},[e]);return(0,od.useEffect)(()=>{o||t()},[o,t]),null}function Wh(e){return(0,Kr.jsx)(m0,{value:bO,children:(0,Kr.jsx)(Cwe,{...e})})}var Ewe=[],Twe=new Set;function Iwe({placeholder:e,rootClientId:t,renderAppender:o,__experimentalAppenderTagName:r,layout:n=CM}){let i=o!==!1,s=!!o,{order:a,isZoomOut:c,selectedBlocks:u,visibleBlocks:d,shouldRenderAppender:f}=(0,Gi.useSelect)(m=>{let{getSettings:h,getBlockOrder:p,getSelectedBlockClientIds:g,__unstableGetVisibleBlocks:b,getTemplateLock:v,getBlockEditingMode:k,isSectionBlock:y,isContainerInsertableToInContentOnlyMode:S,getBlockName:x,isZoomOut:C,canInsertBlockType:B}=M(m(_)),I=p(t);if(h().isPreviewMode)return{order:I,selectedBlocks:Ewe,visibleBlocks:Twe};let P=g(),E=P[0],L=!t&&!E&&(!I.length||!B((0,cq.getDefaultBlockName)(),t)),T=!!(t&&E&&t===E),O=v(t);return{order:I,selectedBlocks:P,visibleBlocks:b(),isZoomOut:C(),shouldRenderAppender:(!y(t)||S(x(E),t))&&k(t)!=="disabled"&&(!O||O==="contentOnly")&&i&&!C()&&(s||T||L)}},[t,i,s]);return(0,Kr.jsxs)(pH,{value:n,children:[a.map(m=>(0,Kr.jsxs)(Gi.AsyncModeProvider,{value:!d.has(m)&&!u.includes(m),children:[c&&(0,Kr.jsx)(iV,{clientId:m,rootClientId:t,position:"top"}),(0,Kr.jsx)(b9,{rootClientId:t,clientId:m}),c&&(0,Kr.jsx)(iV,{clientId:m,rootClientId:t,position:"bottom"})]},m)),a.length<1&&e,f&&(0,Kr.jsx)(fY,{tagName:r,rootClientId:t,CustomAppender:o})]})}function Fy(e){return(0,Kr.jsx)(Gi.AsyncModeProvider,{value:!1,children:(0,Kr.jsx)(Iwe,{...e})})}var Hg=l(F(),1),e3=l(Fe(),1),t3=l(A(),1),qQ=l(Ps(),1),_T=l(R(),1),Gg=l($(),1),o3=l(Xo(),1),Wg=l(N(),1);var Dq=l(Z(),1),Vq=l(F(),1),Fq=l(Fe(),1),Ta=l(R(),1);var Xn=l(N(),1),xm=l($(),1),aE=l(A(),1),Rq=l(Z(),1),Oq=l(F(),1),lE=l(R(),1);var lS=l(A(),1),pq=l(Jv(),1),hq=l(Re(),1),rE=l(R(),1);var Er=l(A(),1),uq=(0,Er.createSlotFill)("InspectorControls"),Pwe=(0,Er.createSlotFill)("InspectorAdvancedControls"),Rwe=(0,Er.createSlotFill)("InspectorControlsBindings"),Owe=(0,Er.createSlotFill)("InspectorControlsBackground"),Awe=(0,Er.createSlotFill)("InspectorControlsBorder"),Lwe=(0,Er.createSlotFill)("InspectorControlsColor"),Nwe=(0,Er.createSlotFill)("InspectorControlsFilter"),Mwe=(0,Er.createSlotFill)("InspectorControlsDimensions"),Dwe=(0,Er.createSlotFill)("InspectorControlsPosition"),Vwe=(0,Er.createSlotFill)("InspectorControlsTypography"),Fwe=(0,Er.createSlotFill)("InspectorControlsListView"),zwe=(0,Er.createSlotFill)("InspectorControlsStyles"),jwe=(0,Er.createSlotFill)("InspectorControlsEffects"),Uwe=(0,Er.createSlotFill)("InspectorControlsContent"),Hwe={default:uq,advanced:Pwe,background:Owe,bindings:Rwe,border:Awe,color:Lwe,content:Uwe,dimensions:Mwe,effects:jwe,filter:Nwe,list:Fwe,position:Dwe,settings:uq,styles:zwe,typography:Vwe},Wi=Hwe,aS=(0,Er.createSlotFill)(Symbol("PrivateInspectorControlsAllowedBlocks"));var bg=l(A(),1),eE=l(R(),1),dq=l(Z(),1),tE=l(F(),1);var JB=l(w(),1),fq=Symbol("ListViewContentPopover"),{Fill:mq,Slot:Gwe}=(0,bg.createSlotFill)(fq);function Wwe(){return(0,dq.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:35,resize:!1}}}function oE({listViewRef:e}){let{popoverProps:t}=Wwe(),o=(0,bg.__experimentalUseSlotFills)(fq),r=!!(o&&o.length),{selectedClientId:n,isOpen:i}=(0,tE.useSelect)(u=>{let{getSelectedBlockClientId:d}=u(_),f=M(u(_));return{selectedClientId:d(),isOpen:f.isListViewContentPanelOpen()}},[]),[s,a]=(0,eE.useState)(null);(0,eE.useLayoutEffect)(()=>{if(!n||!e?.current){a(null);return}let u=e.current.querySelector(`[data-block="${n}"]`);a(u)},[n,e]);let{closeListViewContentPanel:c}=M((0,tE.useDispatch)(_));return!i||!r||!s?null:(0,JB.jsx)(bg.Popover,{...t??{},className:"block-editor-inspector-list-view-content-popover",anchor:s,onClose:c,children:(0,JB.jsx)("div",{style:{width:"280px"},children:(0,JB.jsx)(Gwe,{})})})}var rd=l(w(),1),$we=["content","list"];function _m({children:e,group:t="default",__experimentalGroup:o,resetAllFilter:r}){o&&((0,hq.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=o);let n=Ie(),i=Wi[t]?.Fill;if(!i)return(0,pq.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(n[Kc]){let s=n.name==="core/template-part",a=$we.includes(t);if(!(s||a))return null}return!n[Kc]&&!n[bs]?null:t==="content"&&n[Gk]&&n[Kc]?n[bs]?(0,rd.jsx)(lS.__experimentalStyleProvider,{document,children:(0,rd.jsx)(mq,{children:e})}):null:(0,rd.jsx)(lS.__experimentalStyleProvider,{document,children:(0,rd.jsx)(i,{children:s=>(0,rd.jsx)(Ywe,{fillProps:s,children:e,resetAllFilter:r})})})}function Kwe({resetAllFilter:e,children:t}){let{registerResetAllFilter:o,deregisterResetAllFilter:r}=(0,rE.useContext)(lS.__experimentalToolsPanelContext);return(0,rE.useEffect)(()=>{if(e&&o&&r)return o(e),()=>{r(e)}},[e,o,r]),t}function Ywe({children:e,resetAllFilter:t,fillProps:o}){let{forwardedContext:r=[]}=o,n=(0,rd.jsx)(Kwe,{resetAllFilter:t,children:e});return r.reduce((i,[s,a])=>(0,rd.jsx)(s,{...a,children:i}),n)}var xq=l(A(),1),wq=l(R(),1),Cq=l(Jv(),1),Bq=l(Re(),1);var bq=l(A(),1),nE=l(F(),1),kq=l(R(),1);var gq=l(Z(),1);function Ro(){return(0,gq.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function kg(e,t){if(!e||!t)return t;let o=e.split(","),r=t.split(","),n=[];return o.forEach(i=>{r.forEach(s=>{n.push(`${i.trim()} ${s.trim()}`)})}),n.join(", ")}var vq=l(w(),1);function yq({children:e,group:t,label:o}){let{updateBlockAttributes:r}=(0,nE.useDispatch)(_),{getBlockAttributes:n,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:a}=(0,nE.useSelect)(_),c=Ro(),u=s(),d=(0,kq.useCallback)((f=[])=>{let m={},h=a()?i():[u];h.forEach(p=>{let{style:g}=n(p),b={style:g};f.forEach(v=>{b={...b,...v(b)}}),b={...b,style:Me(b.style)},m[p]=b}),r(h,m,!0)},[n,i,a,u,r]);return(0,vq.jsx)(bq.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:o,resetAll:d,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:c,children:e},u)}var sV=l(A(),1),iE=l(R(),1),Sq=l(w(),1);function _q({Slot:e,fillProps:t,...o}){let r=(0,iE.useContext)(sV.__experimentalToolsPanelContext),n=(0,iE.useMemo)(()=>({...t??{},forwardedContext:[...t?.forwardedContext??[],[sV.__experimentalToolsPanelContext.Provider,{value:r}]]}),[r,t]);return(0,Sq.jsx)(e,{...o,fillProps:n,bubblesVirtually:!0})}var sE=l(w(),1);function qwe({__experimentalGroup:e,group:t="default",label:o,fillProps:r,...n},i){e&&((0,Bq.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);let s=Wi[t],a=(0,xq.__experimentalUseSlotFills)(s?.name);if(!s)return(0,Cq.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(!a?.length)return null;let{Slot:c}=s;return o?(0,sE.jsx)(yq,{group:t,label:o,children:(0,sE.jsx)(_q,{...n,fillProps:r,Slot:c})}):(0,sE.jsx)(c,{...n,ref:i,fillProps:r,bubblesVirtually:!0})}var aV=(0,wq.forwardRef)(qwe);var lV=l(w(),1),Eq=_m;Eq.Slot=aV;var nd=e=>(0,lV.jsx)(_m,{...e,group:"advanced"});nd.Slot=function(t){return(0,lV.jsx)(aV,{...t,group:"advanced"})};nd.slotName="InspectorAdvancedControls";var fe=Eq;var Iq=l(F(),1),id=l($(),1),cS=l(N(),1);function Tq(e){let t=e?.style?.position?.type;return t==="sticky"?(0,cS.__)("Sticky"):t==="fixed"?(0,cS.__)("Fixed"):null}function Tt(e){return(0,Iq.useSelect)(t=>{if(!e)return null;let{getBlockName:o,getBlockAttributes:r,__experimentalGetParsedPattern:n}=t(_),{getBlockType:i,getActiveBlockVariation:s}=t(id.store),a=o(e),c=i(a);if(!c)return null;let u=r(e),d=u?.metadata?.patternName;if(d){let v=n(d),k=Tq(u);return{isSynced:!1,title:(0,cS.__)("Pattern"),icon:Ei,description:v?.description||(0,cS.__)("A block pattern."),anchor:u?.anchor,positionLabel:k,positionType:u?.style?.position?.type,name:v?.title||u?.metadata?.name}}let f=s(a,u),m=(0,id.isReusableBlock)(c)||(0,id.isTemplatePart)(c),p=(m?(0,id.__experimentalGetBlockLabel)(c,u):void 0)||c.title,g=Tq(u),b={isSynced:m,title:p,icon:c.icon,description:c.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name};return f?{isSynced:m,title:f.title||c.title,icon:f.icon||c.icon,description:f.description||c.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name}:b},[e])}var uS=l(w(),1),dS="position",cV={key:"default",value:"",name:(0,Xn.__)("Default")},uV={key:"sticky",value:"sticky",name:(0,Xn._x)("Sticky","Name for the value of the CSS position property"),hint:(0,Xn.__)("The block will stick to the top of the window instead of scrolling.")},Pq={key:"fixed",value:"fixed",name:(0,Xn._x)("Fixed","Name for the value of the CSS position property"),hint:(0,Xn.__)("The block will not move when the page is scrolled.")},Zwe=["top","right","bottom","left"],Xwe=["sticky","fixed"];function Qwe({selector:e,style:t}){let o="",{type:r}=t?.position||{};return Xwe.includes(r)&&(o+=`${e} {`,o+=`position: ${r};`,Zwe.forEach(n=>{t?.position?.[n]!==void 0&&(o+=`${n}: ${t.position[n]};`)}),(r==="sticky"||r==="fixed")&&(o+="z-index: 10"),o+="}"),o}function Jwe(e){let t=(0,xm.getBlockSupport)(e,dS);return!!(t===!0||t?.sticky)}function eCe(e){let t=(0,xm.getBlockSupport)(e,dS);return!!(t===!0||t?.fixed)}function tCe(e){return!!(0,xm.getBlockSupport)(e,dS)}function Aq(e){let t=e?.style?.position?.type;return t==="sticky"||t==="fixed"}function Lq({name:e}={}){let[t,o]=me("position.fixed","position.sticky"),r=!t&&!o;return!tCe(e)||r}function oCe({style:e={},clientId:t,name:o,setAttributes:r}){let n=eCe(o),i=Jwe(o),s=e?.position?.type,{firstParentClientId:a}=(0,Oq.useSelect)(h=>{let{getBlockParents:p}=h(_),g=p(t);return{firstParentClientId:g[g.length-1]}},[t]),c=Tt(a),u=i&&s===uV.value&&c?(0,Xn.sprintf)((0,Xn.__)("The block will stick to the scrollable area of the parent %s block."),c.title):null,d=(0,lE.useMemo)(()=>{let h=[cV];return(i||s===uV.value)&&h.push(uV),(n||s===Pq.value)&&h.push(Pq),h},[n,i,s]),f=h=>{let g={...e,position:{...e?.position,type:h,top:h==="sticky"||h==="fixed"?"0px":void 0}};r({style:Me(g)})},m=s&&d.find(h=>h.value===s)||cV;return lE.Platform.select({web:d.length>1?(0,uS.jsx)(fe,{group:"position",children:(0,uS.jsx)(aE.BaseControl,{help:u,children:(0,uS.jsx)(aE.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,Xn.__)("Position"),hideLabelFromVision:!0,describedBy:(0,Xn.sprintf)((0,Xn.__)("Currently selected position: %s"),m.name),options:d,value:m,onChange:({selectedItem:h})=>{f(h.value)},size:"__unstable-large"})})}):null,native:null})}var dV={edit:function(t){return Lq(t)?null:(0,uS.jsx)(oCe,{...t})},useBlockProps:nCe,attributeKeys:["style"],hasSupport(e){return(0,xm.hasBlockSupport)(e,dS)}},rCe={};function nCe({name:e,style:t}){let o=(0,xm.hasBlockSupport)(e,dS),r=Lq({name:e}),n=o&&!r,i=(0,Rq.useInstanceId)(rCe),s=`.wp-container-${i}.wp-container-${i}`,a;n&&(a=Qwe({selector:s,style:t})||"");let c=V({[`wp-container-${i}`]:n&&!!a,[`is-position-${t?.position?.type}`]:n&&!!a&&!!t?.position?.type});return Qn({css:a}),{className:c}}var zq={placement:"top-start"},Nq={...zq,flip:!1,shift:!0},iCe={...zq,flip:!0,shift:!1};function Mq(e,t,o,r,n){if(!e||!t)return Nq;let i=o?.scrollTop||0,s=_h(t),a=e.getBoundingClientRect(),c=i+a.top,u=e.ownerDocument.documentElement.clientHeight,d=c+r,f=s.top>d,m=s.height>u-r;return!n&&(f||m)?Nq:iCe}function cE({contentElement:e,clientId:t}){let o=Xe(t),[r,n]=(0,Ta.useState)(0),{blockIndex:i,isSticky:s}=(0,Vq.useSelect)(m=>{let{getBlockIndex:h,getBlockAttributes:p}=m(_);return{blockIndex:h(t),isSticky:Aq(p(t))}},[t]),a=(0,Ta.useMemo)(()=>{if(e)return(0,Fq.getScrollContainer)(e)},[e]),[c,u]=(0,Ta.useState)(()=>Mq(e,o,a,r,s)),d=(0,Dq.useRefEffect)(m=>{n(m.offsetHeight)},[]),f=(0,Ta.useCallback)(()=>u(Mq(e,o,a,r,s)),[e,o,a,r]);return(0,Ta.useLayoutEffect)(f,[i,f]),(0,Ta.useLayoutEffect)(()=>{if(!e||!o)return;let m=e?.ownerDocument?.defaultView;m?.addEventHandler?.("resize",f);let h,p=o?.ownerDocument?.defaultView;return p.ResizeObserver&&(h=new p.ResizeObserver(f),h.observe(o)),()=>{m?.removeEventHandler?.("resize",f),h&&h.disconnect()}},[f,e,o]),{...c,ref:d}}var jq=l(F(),1);function uE(e){return(0,jq.useSelect)(o=>{let{getBlockRootClientId:r,getBlockParents:n,__experimentalGetBlockListSettingsForBlocks:i,isBlockInsertionPointVisible:s,getBlockInsertionPoint:a,getBlockOrder:c,hasMultiSelection:u,getLastMultiSelectedBlockClientId:d}=o(_),f=n(e),m=i(f),h=f.find(g=>m[g]?.__experimentalCaptureToolbars),p=!1;if(s()){let g=a();p=c(g.rootClientId)[g.index]===e}return{capturingClientId:h,isInsertionPointVisible:p,lastClientId:u()?d():null,rootClientId:r(e)}},[e])}var dE=l(w(),1);function Uq({clientId:e,__unstableContentRef:t}){let{capturingClientId:o,isInsertionPointVisible:r,lastClientId:n,rootClientId:i}=uE(e),s=cE({contentElement:t?.current,clientId:e});return(0,dE.jsx)(Hi,{clientId:o||e,bottomClientId:n,className:V("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":r}),__unstableContentRef:t,...s,children:(0,dE.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,dE.jsx)(Ui,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})})})}var VQ=l(F(),1),Ug=l(R(),1),FQ=l(Ps(),1);var AQ=l(N(),1),LQ=l(F(),1),ZV=l(R(),1),NQ=l(Z(),1),ic=l($(),1),MQ=l(A(),1);var wm=l(A(),1),Jq=l(F(),1),eZ=l(N(),1);var Kq=l($(),1),Yq=l(A(),1),fS=l(F(),1),mS=l(R(),1),qq=l(Z(),1);var Gq=l(Fe(),1),Ia=l(R(),1),fE=50,Wq=25,sCe=1e3,Hq=sCe*(Wq/1e3);function $q(){let e=(0,Ia.useRef)(null),t=(0,Ia.useRef)(null),o=(0,Ia.useRef)(null),r=(0,Ia.useRef)(null);(0,Ia.useEffect)(()=>()=>{r.current&&(clearInterval(r.current),r.current=null)},[]);let n=(0,Ia.useCallback)(a=>{e.current=a.clientY,o.current=(0,Gq.getScrollContainer)(a.target),r.current=setInterval(()=>{if(o.current&&t.current){let c=o.current.scrollTop+t.current;o.current.scroll({top:c})}},Wq)},[]),i=(0,Ia.useCallback)(a=>{if(!o.current)return;let c=o.current.offsetHeight,u=e.current-o.current.offsetTop,d=a.clientY-o.current.offsetTop;if(a.clientY>u){let f=Math.max(c-u-fE,0),m=Math.max(d-u-fE,0),h=f===0||m===0?0:m/f;t.current=Hq*h}else if(a.clientY{e.current=null,o.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}var fV=l(w(),1),aCe=({appendToOwnerDocument:e,children:t,clientIds:o,cloneClassname:r,elementId:n,onDragStart:i,onDragEnd:s,fadeWhenDisabled:a=!1,dragComponent:c})=>{let{srcRootClientId:u,isDraggable:d,icon:f,visibleInserter:m,getBlockType:h}=(0,fS.useSelect)(E=>{let{canMoveBlocks:L,getBlockRootClientId:T,getBlockName:O,getBlockAttributes:D,isBlockInsertionPointVisible:U}=E(_),{getBlockType:G,getActiveBlockVariation:j}=E(Kq.store),z=T(o[0]),W=O(o[0]),ee=j(W,D(o[0]));return{srcRootClientId:z,isDraggable:L(o),icon:ee?.icon||G(W)?.icon,visibleInserter:U(),getBlockType:G}},[o]),p=(0,mS.useRef)(!1),[g,b,v]=$q(),{getAllowedBlocks:k,getBlockNamesByClientId:y,getBlockRootClientId:S}=(0,fS.useSelect)(_),{startDraggingBlocks:x,stopDraggingBlocks:C}=(0,fS.useDispatch)(_);(0,mS.useEffect)(()=>()=>{p.current&&C()},[]);let I=Xe(o[0])?.closest("body");return(0,mS.useEffect)(()=>{if(!I||!a)return;let L=(0,qq.throttle)(T=>{if(!T.target.closest("[data-block]"))return;let O=y(o),D=T.target.closest("[data-block]").getAttribute("data-block"),U=k(D),G=y([D])[0],j;if(U?.length===0){let z=S(D),W=y([z])[0],ee=k(z);j=YB(h,ee,O,W)}else j=YB(h,U,O,G);!j&&!m?window?.document?.body?.classList?.add("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token")},200);return I.addEventListener("dragover",L),()=>{I.removeEventListener("dragover",L)}},[o,I,a,k,y,S,h,m]),d?(0,fV.jsx)(Yq.Draggable,{appendToOwnerDocument:e,cloneClassname:r,__experimentalTransferDataType:"wp-blocks",transferData:{type:"block",srcClientIds:o,srcRootClientId:u},onDragStart:E=>{window.requestAnimationFrame(()=>{x(o),p.current=!0,g(E),i&&i()})},onDragOver:b,onDragEnd:()=>{C(),p.current=!1,v(),s&&s()},__experimentalDragComponent:c!==void 0?c:(0,fV.jsx)(tB,{count:o.length,icon:f,fadeWhenDisabled:!0}),elementId:n,children:({onDraggableStart:E,onDraggableEnd:L})=>t({draggable:!0,onDragStart:E,onDragEnd:L})}):t({draggable:!1})},mE=aCe;var Xq=l($(),1),pE=l(A(),1),Qq=l(Z(),1),hE=l(F(),1),gE=l(R(),1),$i=l(N(),1);var ke=l(N(),1),sd=(e,t)=>e==="up"?t==="horizontal"?(0,ke.isRTL)()?"right":"left":"up":e==="down"?t==="horizontal"?(0,ke.isRTL)()?"left":"right":"down":null;function Zq(e,t,o,r,n,i,s){let a=o+1;if(e>1)return lCe(e,o,r,n,i,s);if(r&&n)return(0,ke.sprintf)((0,ke.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!n){let c=sd("down",s);if(c==="down")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(i>0&&n){let c=sd("down",s);if(c==="down")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the end of the content and can\u2019t be moved down"),t);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the end of the content and can\u2019t be moved left"),t);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the end of the content and can\u2019t be moved right"),t)}if(i<0&&!r){let c=sd("up",s);if(c==="up")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(i<0&&r){let c=sd("up",s);if(c==="up")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the beginning of the content and can\u2019t be moved up"),t);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the beginning of the content and can\u2019t be moved left"),t);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the beginning of the content and can\u2019t be moved right"),t)}}function lCe(e,t,o,r,n,i){let s=t+1;if(o&&r)return(0,ke.__)("All blocks are selected, and cannot be moved");if(n>0&&!r){let a=sd("down",i);if(a==="down")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if(a==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n>0&&r){let a=sd("down",i);if(a==="down")return(0,ke.__)("Blocks cannot be moved down as they are already at the bottom");if(a==="left")return(0,ke.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ke.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(n<0&&!o){let a=sd("up",i);if(a==="up")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if(a==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n<0&&o){let a=sd("up",i);if(a==="up")return(0,ke.__)("Blocks cannot be moved up as they are already at the top");if(a==="left")return(0,ke.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ke.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}var Zl=l(w(),1),cCe=(e,t)=>e==="up"?t==="horizontal"?(0,$i.isRTL)()?Vo:Nr:wf:e==="down"?t==="horizontal"?(0,$i.isRTL)()?Nr:Vo:zn:null,uCe=(e,t)=>e==="up"?t==="horizontal"?(0,$i.isRTL)()?(0,$i.__)("Move right"):(0,$i.__)("Move left"):(0,$i.__)("Move up"):e==="down"?t==="horizontal"?(0,$i.isRTL)()?(0,$i.__)("Move left"):(0,$i.__)("Move right"):(0,$i.__)("Move down"):null,mV=(0,gE.forwardRef)(({clientIds:e,direction:t,orientation:o,...r},n)=>{let i=(0,Qq.useInstanceId)(mV),s=Array.isArray(e)?e:[e],a=s.length,{disabled:c}=r,{blockType:u,isDisabled:d,rootClientId:f,isFirst:m,isLast:h,firstIndex:p,orientation:g="vertical"}=(0,hE.useSelect)(x=>{let{getBlockIndex:C,getBlockRootClientId:B,getBlockOrder:I,getBlock:P,getBlockListSettings:E}=x(_),L=s[0],T=B(L),O=C(L),D=C(s[s.length-1]),U=I(T),G=P(L),j=O===0,z=D===U.length-1,{orientation:W}=E(T)||{};return{blockType:G?(0,Xq.getBlockType)(G.name):null,isDisabled:c||(t==="up"?j:z),rootClientId:T,firstIndex:O,isFirst:j,isLast:z,orientation:o||W}},[e,t]),{moveBlocksDown:b,moveBlocksUp:v}=(0,hE.useDispatch)(_),k=t==="up"?v:b,y=x=>{k(e,f),r.onClick&&r.onClick(x)},S=`block-editor-block-mover-button__description-${i}`;return(0,Zl.jsxs)(Zl.Fragment,{children:[(0,Zl.jsx)(pE.Button,{__next40pxDefaultSize:!0,ref:n,className:V("block-editor-block-mover-button",`is-${t}-button`),icon:cCe(t,g),label:uCe(t,g),"aria-describedby":S,...r,onClick:d?null:y,disabled:d,accessibleWhenDisabled:!0}),(0,Zl.jsx)(pE.VisuallyHidden,{id:S,children:Zq(a,u&&u.title,p,m,h,t==="up"?-1:1,g)})]})}),bE=(0,gE.forwardRef)((e,t)=>(0,Zl.jsx)(mV,{direction:"up",ref:t,...e})),kE=(0,gE.forwardRef)((e,t)=>(0,Zl.jsx)(mV,{direction:"down",ref:t,...e}));var Pa=l(w(),1);function dCe({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:o,isBlockMoverDownButtonDisabled:r}){let{canMove:n,rootClientId:i,isFirst:s,isLast:a,orientation:c,isManualGrid:u}=(0,Jq.useSelect)(d=>{let{getBlockIndex:f,getBlockListSettings:m,canMoveBlocks:h,getBlockOrder:p,getBlockRootClientId:g,getBlockAttributes:b}=d(_),v=Array.isArray(e)?e:[e],k=v[0],y=g(k),S=f(k),x=f(v[v.length-1]),C=p(y),{layout:B={}}=b(y)??{};return{canMove:h(e),rootClientId:y,isFirst:S===0,isLast:x===C.length-1,orientation:m(y)?.orientation,isManualGrid:B.type==="grid"&&B.isManualPlacement&&window.__experimentalEnableGridInteractivity}},[e]);return!n||s&&a&&!i||t&&u?null:(0,Pa.jsxs)(wm.ToolbarGroup,{className:V("block-editor-block-mover",{"is-horizontal":c==="horizontal"}),children:[!t&&(0,Pa.jsx)(mE,{clientIds:e,fadeWhenDisabled:!0,children:d=>(0,Pa.jsx)(wm.Button,{__next40pxDefaultSize:!0,icon:ov,className:"block-editor-block-mover__drag-handle",label:(0,eZ.__)("Drag"),tabIndex:"-1",...d})}),!u&&(0,Pa.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,Pa.jsx)(wm.ToolbarItem,{children:d=>(0,Pa.jsx)(bE,{disabled:o,clientIds:e,...d})}),(0,Pa.jsx)(wm.ToolbarItem,{children:d=>(0,Pa.jsx)(kE,{disabled:r,clientIds:e,...d})})]})]})}var vE=dCe;var rZ=l(A(),1),SE=l(F(),1),_E=l(N(),1),nZ=l(R(),1);var pS=l(F(),1),ad=l(R(),1);var{clearTimeout:tZ,setTimeout:fCe}=window,oZ=200;function mCe({ref:e,isFocused:t,highlightParent:o,debounceTimeout:r=oZ}){let{getSelectedBlockClientId:n,getBlockRootClientId:i}=(0,pS.useSelect)(_),{toggleBlockHighlight:s}=(0,pS.useDispatch)(_),a=(0,ad.useRef)(),c=(0,pS.useSelect)(g=>g(_).getSettings().isDistractionFree,[]),u=g=>{if(g&&c)return;let b=n(),v=o?i(b):b;s(v,g)},d=()=>e?.current&&e.current.matches(":hover"),f=()=>{let g=d();return!t&&!g},m=()=>{let g=a.current;g&&tZ&&tZ(g)},h=g=>{g&&g.stopPropagation(),m(),u(!0)},p=g=>{g&&g.stopPropagation(),m(),a.current=fCe(()=>{f()&&u(!1)},r)};return(0,ad.useEffect)(()=>()=>{u(!1),m()},[]),{debouncedShowGestures:h,debouncedHideGestures:p}}function vg({ref:e,highlightParent:t=!1,debounceTimeout:o=oZ}){let[r,n]=(0,ad.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:s}=mCe({ref:e,debounceTimeout:o,isFocused:r,highlightParent:t}),a=(0,ad.useRef)(!1),c=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,ad.useEffect)(()=>{let u=e.current,d=()=>{c()&&(n(!0),i())},f=()=>{c()||(n(!1),s())};return u&&!a.current&&(u.addEventListener("focus",d,!0),u.addEventListener("blur",f,!0),a.current=!0),()=>{u&&(u.removeEventListener("focus",d),u.removeEventListener("blur",f))}},[e,a,n,i,s]),{onMouseMove:i,onMouseLeave:s}}var yE=l(w(),1);function iZ(){let{selectBlock:e}=(0,SE.useDispatch)(_),{parentClientId:t}=(0,SE.useSelect)(i=>{let{getBlockParents:s,getSelectedBlockClientId:a,getParentSectionBlock:c}=M(i(_)),u=a(),d=c(u),f=s(u);return{parentClientId:d??f[f.length-1]}},[]),o=Tt(t),r=(0,nZ.useRef)(),n=vg({ref:r,highlightParent:!0});return(0,yE.jsx)("div",{className:"block-editor-block-parent-selector",ref:r,...n,children:(0,yE.jsx)(rZ.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,_E.sprintf)((0,_E.__)("Select parent block: %s"),o?.title),showTooltip:!0,icon:(0,yE.jsx)(Ae,{icon:o?.icon})})},t)}var xE=l(A(),1);var yg=l(A(),1),pCe=(0,yg.createSlotFill)("BlockControls"),hCe=(0,yg.createSlotFill)("BlockControlsBlock"),gCe=(0,yg.createSlotFill)("BlockFormatControls"),bCe=(0,yg.createSlotFill)("BlockControlsOther"),kCe=(0,yg.createSlotFill)("BlockControlsParent"),vCe={default:pCe,block:hCe,inline:gCe,other:bCe,parent:kCe},hS=vCe;function sZ(e,t){let o=Ie();return o[bs]?hS[e]?.Fill:o[Rp]&&t?hS.parent.Fill:null}var Xl=l(w(),1);function pV({group:e="default",controls:t,children:o,__experimentalShareWithChildBlocks:r=!1}){let n=sZ(e,r);if(!n)return null;let i=(0,Xl.jsxs)(Xl.Fragment,{children:[e==="default"&&(0,Xl.jsx)(xE.ToolbarGroup,{controls:t}),o]});return(0,Xl.jsx)(xE.__experimentalStyleProvider,{document,children:(0,Xl.jsx)(n,{children:s=>{let{forwardedContext:a=[]}=s;return a.reduce((c,[u,d])=>(0,Xl.jsx)(u,{...d,children:c}),i)}})})}var gS=l(R(),1),Ql=l(A(),1),lZ=l(Jv(),1);var hV=l(w(),1),{ComponentsContext:aZ}=M(Ql.privateApis);function gV({group:e="default",...t}){let o=(0,gS.useContext)(Ql.__experimentalToolbarContext),r=(0,gS.useContext)(aZ),n=(0,gS.useMemo)(()=>({forwardedContext:[[Ql.__experimentalToolbarContext.Provider,{value:o}],[aZ.Provider,{value:r}]]}),[o,r]),i=hS[e],s=(0,Ql.__experimentalUseSlotFills)(i.name);if(!i)return(0,lZ.default)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;let{Slot:a}=i,c=(0,hV.jsx)(a,{...t,bubblesVirtually:!0,fillProps:n});return e==="default"?c:(0,hV.jsx)(Ql.ToolbarGroup,{children:c})}var bV=l(w(),1),cZ=pV;cZ.Slot=gV;var kV=e=>(0,bV.jsx)(pV,{group:"inline",...e});kV.Slot=function(t){return(0,bV.jsx)(gV,{group:"inline",...t})};var Mt=cZ;var uZ=l(A(),1),{Fill:dZ,Slot:yCe}=(0,uZ.createSlotFill)("__unstableBlockToolbarLastItem");dZ.Slot=yCe;var wE=dZ;var GE=l(A(),1);var Cg=l($(),1),ti=l(A(),1),Am=l(F(),1);var UE=l(R(),1),Ra=l(N(),1),mX=l(Ps(),1),Om=l(Z(),1);var _g=l(F(),1),ld=l($(),1);var TZ=l(R(),1),kS=l($(),1),bS=l(F(),1),IZ=l(Un(),1),Jl=l(N(),1);var Jn=l($(),1),fZ=l(R(),1),SCe="align";var mZ="__experimentalBorder",CE="color",_Ce="customClassName",pZ="typography.__experimentalFontFamily",hZ="typography.fontSize",xCe="typography.lineHeight",wCe="typography.__experimentalFontStyle",CCe="typography.__experimentalFontWeight",gZ="typography.textAlign",BCe="typography.textColumns",ECe="typography.__experimentalTextDecoration",TCe="typography.__experimentalWritingMode",ICe="typography.__experimentalTextTransform",PCe="typography.__experimentalLetterSpacing",RCe="layout",OCe=[xCe,hZ,wCe,CCe,pZ,gZ,BCe,ECe,ICe,TCe,PCe],ACe=["shadow"],LCe="spacing",NCe=[...ACe,...OCe,mZ,CE,LCe],bZ=e=>(0,Jn.hasBlockSupport)(e,SCe);function kZ(e,t="any"){if(fZ.Platform.OS!=="web")return!1;let o=(0,Jn.getBlockSupport)(e,mZ);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}var vZ=e=>{let t=(0,Jn.getBlockSupport)(e,CE);return t!==null&&typeof t=="object"&&!!t.gradients},yZ=e=>{let t=(0,Jn.getBlockSupport)(e,CE);return t&&t.background!==!1},SZ=e=>(0,Jn.hasBlockSupport)(e,gZ);var _Z=e=>{let t=(0,Jn.getBlockSupport)(e,CE);return t&&t.text!==!1};var xZ=e=>(0,Jn.hasBlockSupport)(e,_Ce,!0);var wZ=e=>(0,Jn.hasBlockSupport)(e,pZ);var CZ=e=>(0,Jn.hasBlockSupport)(e,hZ);var BZ=e=>(0,Jn.hasBlockSupport)(e,RCe);var EZ=e=>NCe.some(t=>(0,Jn.hasBlockSupport)(e,t));function MCe(e){try{let t=(0,kS.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return!(t.length===1&&t[0].name==="core/freeform")}catch{return!1}}var DCe={align:bZ,borderColor:e=>kZ(e,"color"),backgroundColor:yZ,textAlign:SZ,textColor:_Z,gradient:vZ,className:xZ,fontFamily:wZ,fontSize:CZ,layout:BZ,style:EZ};function VCe(e,t){return Object.entries(DCe).reduce((o,[r,n])=>(n(e.name)&&n(t.name)&&(o[r]=e.attributes[r]),o),{})}function vV(e,t,o){for(let r=0;r{let s="";try{if(!window.navigator.clipboard){n((0,Jl.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});return}s=await window.navigator.clipboard.readText()}catch{n((0,Jl.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"});return}if(!s||!MCe(s)){r((0,Jl.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});return}let a=(0,kS.parse)(s);if(a.length===1?e.batch(()=>{vV(i,i.map(()=>a[0]),t)}):e.batch(()=>{vV(i,a,t)}),i.length===1){let c=(0,kS.getBlockType)(i[0].name)?.title;o((0,Jl.sprintf)((0,Jl.__)("Pasted styles to %s."),c),{type:"snackbar"})}else o((0,Jl.sprintf)((0,Jl.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})},[e.batch,t,o,r,n])}function PZ({clientIds:e,children:t,__experimentalUpdateSelection:o}){let{getDefaultBlockName:r,getGroupingBlockName:n}=(0,_g.useSelect)(ld.store),i=(0,_g.useSelect)(y=>{let{canInsertBlockType:S,getBlockRootClientId:x,getBlocksByClientId:C,getDirectInsertBlock:B,canRemoveBlocks:I}=y(_),P=C(e),E=x(e[0]),L=S(r(),E),T=E?B(E):null;return{canRemove:I(e),canInsertBlock:P.every(O=>(L||!!T)&&S(O.name,E)),canCopyStyles:P.every(O=>!!O&&((0,ld.hasBlockSupport)(O.name,"color")||(0,ld.hasBlockSupport)(O.name,"typography"))),canDuplicate:P.every(O=>!!O&&(0,ld.hasBlockSupport)(O.name,"multiple",!0)&&S(O.name,E))}},[e,r]),{getBlocksByClientId:s,getBlocks:a}=(0,_g.useSelect)(_),{canRemove:c,canInsertBlock:u,canCopyStyles:d,canDuplicate:f}=i,{removeBlocks:m,replaceBlocks:h,duplicateBlocks:p,insertAfterBlock:g,insertBeforeBlock:b,flashBlock:v}=(0,_g.useDispatch)(_),k=Sg();return t({canCopyStyles:d,canDuplicate:f,canInsertBlock:u,canRemove:c,onDuplicate(){return p(e,o)},onRemove(){return m(e,o)},onInsertBefore(){b(e[0])},onInsertAfter(){g(e[e.length-1])},onGroup(){if(!e.length)return;let y=n(),S=(0,ld.switchToBlockType)(s(e),y);S&&h(e,S)},onUngroup(){if(!e.length)return;let y=a(e[0]);y.length&&h(e,y)},onCopy(){e.length===1&&v(e[0])},async onPasteStyles(){await k(s(e))}})}var RZ=l(A(),1),FCe=(0,RZ.createSlotFill)(Symbol("CommentIconSlotFill")),BE=FCe;var OZ=l(N(),1),AZ=l(A(),1),EE=l($(),1),TE=l(F(),1);var LZ=l(w(),1);function zCe({clientId:e}){let t=(0,TE.useSelect)(r=>r(_).getBlock(e),[e]),{replaceBlocks:o}=(0,TE.useDispatch)(_);return!t||t.name!=="core/html"?null:(0,LZ.jsx)(AZ.MenuItem,{onClick:()=>o(e,(0,EE.rawHandler)({HTML:(0,EE.getBlockContent)(t)})),children:(0,OZ.__)("Convert to Blocks")})}var NZ=zCe;var MZ=l(A(),1),{Fill:DZ,Slot:jCe}=(0,MZ.createSlotFill)("__unstableBlockSettingsMenuFirstItem");DZ.Slot=jCe;var IE=DZ;var wg=l(A(),1),iX=l($(),1),sX=l(F(),1);var SV=l(A(),1),_V=l(N(),1),zZ=l($(),1),OE=l(F(),1),jZ=l(it(),1);var VZ=l($(),1),FZ=l(F(),1);function vS(e){return(0,FZ.useSelect)(t=>{let{getBlocksByClientId:o,getSelectedBlockClientIds:r,isUngroupable:n,isGroupable:i}=t(_),{getGroupingBlockName:s,getBlockType:a}=t(VZ.store),c=e?.length?e:r(),u=o(c),[d]=u,f=c.length===1&&n(c[0]);return{clientIds:c,isGroupable:i(c),isUngroupable:f,blocksSelection:u,groupingBlockName:s(),onUngroup:f&&a(d.name)?.transforms?.ungroup}},[e])}var PE=l(F(),1),RE=l($(),1),Cm=l(A(),1);var yS=l(N(),1);var Bm=l(w(),1),UCe={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};function HCe(){let{blocksSelection:e,clientIds:t,groupingBlockName:o,isGroupable:r}=vS(),{replaceBlocks:n}=(0,PE.useDispatch)(_),{canRemove:i,variations:s}=(0,PE.useSelect)(p=>{let{canRemoveBlocks:g}=p(_),{getBlockVariations:b}=p(RE.store);return{canRemove:g(t),variations:b(o,"transform")}},[t,o]),a=p=>{let g=(0,RE.switchToBlockType)(e,o);typeof p!="string"&&(p="group"),g&&g.length>0&&(g[0].attributes.layout=UCe[p],n(t,g))},c=()=>a("row"),u=()=>a("stack"),d=()=>a("grid");if(!r||!i)return null;let f=!!s.find(({name:p})=>p==="group-row"),m=!!s.find(({name:p})=>p==="group-stack"),h=!!s.find(({name:p})=>p==="group-grid");return(0,Bm.jsxs)(Cm.ToolbarGroup,{children:[(0,Bm.jsx)(Cm.ToolbarButton,{icon:iv,label:(0,yS._x)("Group","action: convert blocks to group"),onClick:a}),f&&(0,Bm.jsx)(Cm.ToolbarButton,{icon:eN,label:(0,yS._x)("Row","action: convert blocks to row"),onClick:c}),m&&(0,Bm.jsx)(Cm.ToolbarButton,{icon:hN,label:(0,yS._x)("Stack","action: convert blocks to stack"),onClick:u}),h&&(0,Bm.jsx)(Cm.ToolbarButton,{icon:nv,label:(0,yS._x)("Grid","action: convert blocks to grid"),onClick:d})]})}var yV=HCe;var Em=l(w(),1);function UZ({clientIds:e,isGroupable:t,isUngroupable:o,onUngroup:r,blocksSelection:n,groupingBlockName:i,onClose:s=()=>{}}){let{getSelectedBlockClientIds:a}=(0,OE.useSelect)(_),{replaceBlocks:c}=(0,OE.useDispatch)(_),u=()=>{let m=(0,zZ.switchToBlockType)(n,i);m&&c(e,m)},d=()=>{let m=n[0].innerBlocks;m.length&&(r&&(m=r(n[0].attributes,n[0].innerBlocks)),c(e,m))};if(!t&&!o)return null;let f=a();return(0,Em.jsxs)(Em.Fragment,{children:[t&&(0,Em.jsx)(SV.MenuItem,{shortcut:f.length>1?jZ.displayShortcut.primary("g"):void 0,onClick:()=>{u(),s()},children:(0,_V._x)("Group","verb")}),o&&(0,Em.jsx)(SV.MenuItem,{onClick:()=>{d(),s()},children:(0,_V._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}var xV=l(N(),1),WZ=l(R(),1),$Z=l(A(),1);var HZ=l(F(),1);function ei(e){return(0,HZ.useSelect)(t=>{let{canLockBlockType:o,getBlockName:r,isEditLockedBlock:n,isMoveLockedBlock:i,isRemoveLockedBlock:s,isLockedBlock:a}=M(t(_));return{isEditLocked:n(e),isMoveLocked:i(e),isRemoveLocked:s(e),canLock:o(r(e)),isLocked:a(e)}},[e])}var Ki=l(N(),1),SS=l(R(),1),bo=l(A(),1);var AE=l(F(),1),GZ=l($(),1);var It=l(w(),1),GCe=["core/navigation"];function WCe(e){return e.remove&&e.move?"all":e.remove&&!e.move?"insert":!1}function LE({clientId:e,onClose:t}){let[o,r]=(0,SS.useState)({move:!1,remove:!1}),{isEditLocked:n,isMoveLocked:i,isRemoveLocked:s}=ei(e),{allowsEditLocking:a,templateLock:c,hasTemplateLock:u}=(0,AE.useSelect)(v=>{let{getBlockName:k,getBlockAttributes:y}=v(_),S=k(e),x=(0,GZ.getBlockType)(S);return{allowsEditLocking:GCe.includes(S),templateLock:y(e)?.templateLock,hasTemplateLock:!!x?.attributes?.templateLock}},[e]),[d,f]=(0,SS.useState)(!!c),{updateBlockAttributes:m}=(0,AE.useDispatch)(_),h=Tt(e);(0,SS.useEffect)(()=>{r({move:i,remove:s,...a?{edit:n}:{}})},[n,i,s,a]);let p=Object.values(o).every(Boolean),g=Object.values(o).some(Boolean)&&!p,b=o.move!==i||o.remove!==s||a&&o.edit!==n||u&&d!==!!c;return(0,It.jsx)(bo.Modal,{title:(0,Ki.sprintf)((0,Ki.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,size:"small",children:(0,It.jsxs)("form",{onSubmit:v=>{v.preventDefault(),b&&(m([e],{lock:o,templateLock:d?WCe(o):void 0}),t())},children:[(0,It.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,It.jsx)("legend",{children:(0,Ki.__)("Select the features you want to lock")}),(0,It.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,It.jsxs)("li",{children:[(0,It.jsx)(bo.CheckboxControl,{className:"block-editor-block-lock-modal__options-all",label:(0,Ki.__)("Lock all"),checked:p,indeterminate:g,onChange:v=>r({move:v,remove:v,...a?{edit:v}:{}})}),(0,It.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[a&&(0,It.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,It.jsx)(bo.CheckboxControl,{label:(0,Ki.__)("Lock editing"),checked:!!o.edit,onChange:v=>r(k=>({...k,edit:v}))}),(0,It.jsx)(bo.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?Of:yl})]}),(0,It.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,It.jsx)(bo.CheckboxControl,{label:(0,Ki.__)("Lock movement"),checked:o.move,onChange:v=>r(k=>({...k,move:v}))}),(0,It.jsx)(bo.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?Of:yl})]}),(0,It.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,It.jsx)(bo.CheckboxControl,{label:(0,Ki.__)("Lock removal"),checked:o.remove,onChange:v=>r(k=>({...k,remove:v}))}),(0,It.jsx)(bo.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?Of:yl})]})]})]})}),u&&(0,It.jsx)(bo.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,Ki.__)("Apply to all blocks inside"),checked:d,disabled:o.move&&!o.remove,onChange:()=>f(!d)})]}),(0,It.jsxs)(bo.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,It.jsx)(bo.FlexItem,{children:(0,It.jsx)(bo.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,Ki.__)("Cancel")})}),(0,It.jsx)(bo.FlexItem,{children:(0,It.jsx)(bo.Button,{variant:"primary",type:"submit",disabled:!b,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,Ki.__)("Apply")})})]})]})})}var Tm=l(w(),1);function wV({clientId:e}){let{canLock:t,isLocked:o}=ei(e),[r,n]=(0,WZ.useReducer)(s=>!s,!1);if(!t)return null;let i=o?(0,xV.__)("Unlock"):(0,xV.__)("Lock");return(0,Tm.jsxs)(Tm.Fragment,{children:[(0,Tm.jsx)($Z.MenuItem,{icon:o?yl:BL,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog",children:i}),r&&(0,Tm.jsx)(LE,{clientId:e,onClose:n})]})}var NE=l(N(),1),ME=l(A(),1),xg=l(R(),1);var cd=l(w(),1);function CV({clientId:e}){let{canLock:t,isLocked:o}=ei(e),[r,n]=(0,xg.useReducer)(a=>!a,!1),i=(0,xg.useRef)(!1);if((0,xg.useEffect)(()=>{o&&(i.current=!0)},[o]),!o&&!i.current)return null;let s=o?(0,NE.__)("Unlock"):(0,NE.__)("Lock");return!t&&o&&(s=(0,NE.__)("Locked")),(0,cd.jsxs)(cd.Fragment,{children:[(0,cd.jsx)(ME.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,cd.jsx)(ME.ToolbarButton,{disabled:!t,icon:o?Of:yl,label:s,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog"})}),r&&(0,cd.jsx)(LE,{clientId:e,onClose:n})]})}var BV=l(N(),1),KZ=l(A(),1),DE=l($(),1),VE=l(F(),1);var YZ=l(w(),1),$Ce=()=>{};function qZ({clientId:e,onToggle:t=$Ce}){let{blockType:o,mode:r,enabled:n}=(0,VE.useSelect)(a=>{let{getBlock:c,getBlockMode:u,getSettings:d}=a(_),f=c(e);return{mode:u(e),blockType:f?(0,DE.getBlockType)(f.name):null,enabled:d().codeEditingEnabled&&!!f?.isValid}},[e]),{toggleBlockMode:i}=(0,VE.useDispatch)(_);if(!o||!(0,DE.hasBlockSupport)(o,"html",!0)||!n)return null;let s=r==="visual"?(0,BV.__)("Edit as HTML"):(0,BV.__)("Edit visually");return(0,YZ.jsx)(KZ.MenuItem,{onClick:()=>{i(e),t()},children:s})}var JZ=l(A(),1),eX=l(N(),1),tX=l(R(),1),oX=l(F(),1),rX=l(Ps(),1);var zs=l(A(),1),Fs=l(N(),1),XZ=l(R(),1),QZ=l(Xo(),1),FE=l(F(),1);function ZZ(e){return e?.trim()?.length===0}var ec=l(w(),1);function Im({clientId:e,onClose:t}){let[o,r]=(0,XZ.useState)(),n=Tt(e),{metadata:i}=(0,FE.useSelect)(b=>{let{getBlockAttributes:v}=b(_);return{metadata:v(e)?.metadata}},[e]),{updateBlockAttributes:s}=(0,FE.useDispatch)(_),a=i?.name||"",c=n?.title,u=!!a&&!!i?.bindings&&Object.values(i.bindings).some(b=>b.source==="core/pattern-overrides"),d=o!==void 0&&o!==a,f=o===c,m=ZZ(o),h=d||f,p=b=>b.target.select(),g=()=>{let b=f||m?void 0:o,v=f||m?(0,Fs.sprintf)((0,Fs.__)('Block name reset to: "%s".'),o):(0,Fs.sprintf)((0,Fs.__)('Block name changed to: "%s".'),o);(0,QZ.speak)(v,"assertive"),s([e],{metadata:Me({...i,name:b})}),t()};return(0,ec.jsx)(zs.Modal,{title:(0,Fs.__)("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:(0,ec.jsx)("form",{onSubmit:b=>{b.preventDefault(),h&&g()},children:(0,ec.jsxs)(zs.__experimentalVStack,{spacing:"3",children:[(0,ec.jsx)(zs.TextControl,{__next40pxDefaultSize:!0,value:o??a,label:(0,Fs.__)("Name"),help:u?(0,Fs.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:c,onChange:r,onFocus:p}),(0,ec.jsxs)(zs.__experimentalHStack,{justify:"right",children:[(0,ec.jsx)(zs.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,Fs.__)("Cancel")}),(0,ec.jsx)(zs.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!h,variant:"primary",type:"submit",children:(0,Fs.__)("Save")})]})]})})})}var Pm=l(w(),1);function EV({clientId:e}){let[t,o]=(0,tX.useState)(!1),r=(0,oX.useSelect)(n=>n(rX.store).getShortcutRepresentation("core/block-editor/rename"),[]);return(0,Pm.jsxs)(Pm.Fragment,{children:[(0,Pm.jsx)(JZ.MenuItem,{onClick:()=>{o(!0)},"aria-expanded":t,"aria-haspopup":"dialog",shortcut:r,children:(0,eX.__)("Rename")}),t&&(0,Pm.jsx)(Im,{clientId:e,onClose:()=>o(!1)})]})}var nX=l($(),1);function Rm(e){return{canRename:!!e&&(0,nX.getBlockSupport)(e,"renaming",!0)}}var js=l(w(),1),{Fill:KCe,Slot:YCe}=(0,wg.createSlotFill)("BlockSettingsMenuControls"),qCe=({fillProps:e,clientIds:t=null})=>{let{selectedBlocks:o,selectedClientIds:r,isContentOnly:n,canToggleSelectedBlocksVisibility:i,canEdit:s}=(0,sX.useSelect)(b=>{let{getBlocksByClientId:v,getBlockNamesByClientId:k,getSelectedBlockClientIds:y,getBlockEditingMode:S,canEditBlock:x}=b(_),C=t!==null?t:y();return{selectedBlocks:k(C),selectedClientIds:C,isContentOnly:S(C[0])==="contentOnly",canToggleSelectedBlocksVisibility:v(C).every(B=>(0,iX.hasBlockSupport)(B.name,"visibility",!0)),canEdit:x(C[0])}},[t]),{canLock:a}=ei(r[0]),{canRename:c}=Rm(o[0]),u=r.length===1&&a&&!n,d=r.length===1&&c&&!n,f=i&&!n,m=vS(r),{isGroupable:h,isUngroupable:p}=m,g=(h||p)&&!n;return(0,js.jsx)(YCe,{fillProps:{...e,canEdit:s,selectedBlocks:o,selectedClientIds:r},children:b=>!b?.length>0&&!g&&!u?null:(0,js.jsxs)(wg.MenuGroup,{children:[g&&(0,js.jsx)(UZ,{...m,onClose:e?.onClose}),s&&u&&(0,js.jsx)(wV,{clientId:r[0]}),s&&d&&(0,js.jsx)(EV,{clientId:r[0]}),s&&f&&(0,js.jsx)(RD,{clientIds:r}),b,s&&e?.count===1&&!n&&(0,js.jsx)(qZ,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};function aX({...e}){return(0,js.jsx)(wg.__experimentalStyleProvider,{document,children:(0,js.jsx)(KCe,{...e})})}aX.Slot=qCe;var zE=aX;var lX=l(R(),1),cX=l(A(),1),uX=l(Z(),1),dX=l(F(),1),jE=l(N(),1);var TV=l(w(),1);function fX({parentClientId:e,parentBlockType:t}){let o=(0,uX.useViewportMatch)("medium","<"),{selectBlock:r}=(0,dX.useDispatch)(_),n=(0,lX.useRef)(),i=vg({ref:n,highlightParent:!0});return o?(0,TV.jsx)(cX.MenuItem,{...i,ref:n,icon:(0,TV.jsx)(Ae,{icon:t.icon}),onClick:()=>r(e),children:(0,jE.sprintf)((0,jE.__)("Select parent block (%s)"),t.title)}):null}var kt=l(w(),1),ZCe={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function IV({clientIds:e,onCopy:t,label:o,shortcut:r,eventType:n="copy",__experimentalUpdateSelection:i=!1}){let{getBlocksByClientId:s}=(0,Am.useSelect)(_),{removeBlocks:a}=(0,Am.useDispatch)(_),c=Ah(),u=(0,Om.useCopyToClipboard)(()=>(0,Cg.serialize)(s(e)),()=>{switch(n){case"copy":case"copyStyles":t(),c(n,e);break;case"cut":c(n,e),a(e,i);break;default:break}}),d=o||(0,Ra.__)("Copy");return(0,kt.jsx)(ti.MenuItem,{ref:u,shortcut:r,children:d})}function PV({block:e,clientIds:t,children:o,__experimentalSelectBlock:r,...n}){let i=t.length,s=t[0],{firstParentClientId:a,parentBlockType:c,previousBlockClientId:u,selectedBlockClientIds:d,isContentOnly:f,isZoomOut:m,canEdit:h}=(0,Am.useSelect)(C=>{let{getBlockName:B,getBlockRootClientId:I,getPreviousBlockClientId:P,getSelectedBlockClientIds:E,getBlockAttributes:L,getBlockEditingMode:T,isZoomOut:O,canEditBlock:D}=M(C(_)),{getActiveBlockVariation:U}=C(Cg.store),G=I(s),j=G&&B(G);return{firstParentClientId:G,parentBlockType:G&&(U(j,L(G))||(0,Cg.getBlockType)(j)),previousBlockClientId:P(s),selectedBlockClientIds:E(),isContentOnly:T(s)==="contentOnly",isZoomOut:O(),canEdit:D(s)}},[s]),{getBlockOrder:p,getSelectedBlockClientIds:g}=(0,Am.useSelect)(_),b=(0,Am.useSelect)(C=>{let{getShortcutRepresentation:B}=C(mX.store);return{copy:B("core/block-editor/copy"),cut:B("core/block-editor/cut"),duplicate:B("core/block-editor/duplicate"),remove:B("core/block-editor/remove"),insertAfter:B("core/block-editor/insert-after"),insertBefore:B("core/block-editor/insert-before")}},[]),v=d.length>0;async function k(C){if(!r)return;let B=await C;B&&B[0]&&r(B[0],!1)}function y(){if(!r)return;let C=u||a;C||(C=p()[0]);let B=v&&g().length===0;r(C,B)}let x=!d?.includes(a)&&!!a;return(0,kt.jsx)(PZ,{clientIds:t,__experimentalUpdateSelection:!r,children:({canCopyStyles:C,canDuplicate:B,canInsertBlock:I,canRemove:P,onDuplicate:E,onInsertAfter:L,onInsertBefore:T,onRemove:O,onCopy:D,onPasteStyles:U})=>!P&&!B&&!I&&f?null:(0,kt.jsx)(ti.DropdownMenu,{icon:ks,label:(0,Ra.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:ZCe,noIcons:!0,...n,children:({onClose:j})=>(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsxs)(ti.MenuGroup,{children:[(0,kt.jsx)(IE.Slot,{fillProps:{onClose:j}}),x&&(0,kt.jsx)(fX,{parentClientId:a,parentBlockType:c}),h&&i===1&&(0,kt.jsx)(NZ,{clientId:s}),!f&&(0,kt.jsx)(IV,{clientIds:t,onCopy:D,shortcut:b.copy}),P&&!f&&(0,kt.jsx)(IV,{clientIds:t,label:(0,Ra.__)("Cut"),eventType:"cut",shortcut:b.cut,__experimentalUpdateSelection:!r}),B&&(0,kt.jsx)(ti.MenuItem,{onClick:(0,Om.pipe)(j,E,k),shortcut:b.duplicate,children:(0,Ra.__)("Duplicate")}),I&&!m&&(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(ti.MenuItem,{onClick:(0,Om.pipe)(j,T),shortcut:b.insertBefore,children:(0,Ra.__)("Add before")}),(0,kt.jsx)(ti.MenuItem,{onClick:(0,Om.pipe)(j,L),shortcut:b.insertAfter,children:(0,Ra.__)("Add after")})]}),h&&i===1&&(0,kt.jsx)(BE.Slot,{fillProps:{clientId:s,onClose:j}})]}),C&&!f&&(0,kt.jsxs)(ti.MenuGroup,{children:[(0,kt.jsx)(IV,{clientIds:t,onCopy:D,label:(0,Ra.__)("Copy styles"),eventType:"copyStyles"}),h&&(0,kt.jsx)(ti.MenuItem,{onClick:U,children:(0,Ra.__)("Paste styles")})]}),!f&&(0,kt.jsx)(zE.Slot,{fillProps:{onClose:j,count:i,firstBlockClientId:s},clientIds:t}),typeof o=="function"?o({onClose:j}):UE.Children.map(z=>(0,UE.cloneElement)(z,{onClose:j})),P&&(0,kt.jsx)(ti.MenuGroup,{children:(0,kt.jsx)(ti.MenuItem,{onClick:(0,Om.pipe)(j,O,y),shortcut:b.remove,children:(0,Ra.__)("Delete")})})]})})})}var pX=PV;var hX=l(A(),1),XCe=(0,hX.createSlotFill)(Symbol("CommentIconToolbarSlotFill")),HE=XCe;var Bg=l(w(),1);function QCe({clientIds:e,...t}){return(0,Bg.jsxs)(GE.ToolbarGroup,{children:[(0,Bg.jsx)(HE.Slot,{}),(0,Bg.jsx)(GE.ToolbarItem,{children:o=>(0,Bg.jsx)(pX,{clientIds:e,toggleProps:o,...t})})]})}var WE=QCe;var $E=l(A(),1),gX=l(N(),1),KE=l(F(),1);var RV=l(w(),1);function bX({clientIds:e}){let t=e.length===1?e[0]:void 0,o=(0,KE.useSelect)(n=>!!t&&n(_).getBlockMode(t)==="html",[t]),{toggleBlockMode:r}=(0,KE.useDispatch)(_);return o?(0,RV.jsx)($E.ToolbarGroup,{children:(0,RV.jsx)($E.ToolbarButton,{onClick:()=>{r(t)},children:(0,gX.__)("Edit visually")})}):null}var YE=l(A(),1),Yr=l(R(),1),yX=l(F(),1),SX=l(Re(),1),AV=l(Fe(),1),_X=l(Ps(),1),xX=l(it(),1);var OV=l(w(),1);function JCe(e){let t="toolbarItem";return!e.some(o=>!(t in o.dataset))}function kX(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function vX(e){return e.contains(e.ownerDocument.activeElement)}function e1e(e){let[t]=AV.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}function t1e(e){let[o,r]=(0,Yr.useState)(!0),n=(0,Yr.useCallback)(()=>{let i=AV.focus.tabbable.find(e.current),s=JCe(i);s||(0,SX.default)("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),r(s)},[e]);return(0,Yr.useLayoutEffect)(()=>{let i=new window.MutationObserver(n);return i.observe(e.current,{childList:!0,subtree:!0}),()=>i.disconnect()},[n,o,e]),o}function o1e({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:o,defaultIndex:r,onIndexChange:n,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:s}){let[a]=(0,Yr.useState)(t),[c]=(0,Yr.useState)(r),u=(0,Yr.useCallback)(()=>{e1e(e.current)},[e]);(0,_X.useShortcut)("core/block-editor/focus-toolbar",()=>{i&&u()}),(0,Yr.useEffect)(()=>{a&&u()},[o,a,u]),(0,Yr.useEffect)(()=>{let m=e.current,h=0;return!a&&!vX(m)&&(h=window.requestAnimationFrame(()=>{let p=kX(m),g=c||0;p[g]&&vX(m)&&p[g].focus({preventScroll:!0})})),()=>{if(window.cancelAnimationFrame(h),!n||!m)return;let g=kX(m).findIndex(b=>b.tabIndex===0);n(g)}},[c,a,n,e]);let{getLastFocus:f}=M((0,yX.useSelect)(_));(0,Yr.useEffect)(()=>{let m=e.current;if(s){let h=p=>{let g=f();p.keyCode===xX.ESCAPE&&g?.current&&(p.preventDefault(),g.current.focus())};return m.addEventListener("keydown",h),()=>{m.removeEventListener("keydown",h)}}},[s,f,e])}function Eg({children:e,focusOnMount:t,focusEditorOnEscape:o=!1,shouldUseKeyboardFocusShortcut:r=!0,__experimentalInitialIndex:n,__experimentalOnIndexChange:i,orientation:s="horizontal",...a}){let c=(0,Yr.useRef)(),u=t1e(c);return o1e({toolbarRef:c,focusOnMount:t,defaultIndex:n,onIndexChange:i,isAccessibleToolbar:u,shouldUseKeyboardFocusShortcut:r,focusEditorOnEscape:o}),u?(0,OV.jsx)(YE.Toolbar,{label:a["aria-label"],ref:c,orientation:s,...a,children:e}):(0,OV.jsx)(YE.NavigableMenu,{orientation:s,role:"toolbar",ref:c,...a,children:e})}var wX=l(F(),1),qE=l($(),1);function ZE(){return(0,wX.useSelect)(t=>{let{getBlockEditingMode:o,getBlockName:r,getBlockSelectionStart:n}=t(_),i=n(),s=i&&(0,qE.getBlockType)(r(i));return s&&(0,qE.hasBlockSupport)(s,"__experimentalToolbar",!0)&&o(i)!=="disabled"},[])}var ud=l(A(),1),CX=l(N(),1),BX=l($(),1),EX=l(R(),1),XE=l(F(),1);var Tg=l(w(),1),LV=[],r1e=6,n1e={placement:"bottom-start"};function TX({clientId:e}){let{categories:t,currentPatternName:o,patterns:r}=(0,XE.useSelect)(a=>{let{getBlockAttributes:c,getBlockRootClientId:u,__experimentalGetAllowedPatterns:d}=a(_),f=c(e),m=f?.metadata?.categories||LV,h=u(e),p=m.length>0?d(h):LV;return{categories:m,currentPatternName:f?.metadata?.patternName,patterns:p}},[e]),{replaceBlocks:n}=(0,XE.useDispatch)(_),i=(0,EX.useMemo)(()=>t.length===0||!r||r.length===0?LV:r.filter(a=>{let c=a.source==="core"||a.source?.startsWith("pattern-directory")&&a.source!=="pattern-directory/theme";return a.blocks.length===1&&!c&&o!==a.name&&a.categories?.some(u=>t.includes(u))&&(a.syncStatus==="unsynced"||!a.id)}).slice(0,r1e),[t,o,r]);if(i.length<2)return null;let s=a=>{let c=(a.blocks??[]).map(u=>(0,BX.cloneBlock)(u));c[0].attributes.metadata={...c[0].attributes.metadata,categories:t},n(e,c)};return(0,Tg.jsx)(ud.Dropdown,{popoverProps:n1e,renderToggle:({onToggle:a,isOpen:c})=>(0,Tg.jsx)(ud.ToolbarGroup,{children:(0,Tg.jsx)(ud.ToolbarButton,{onClick:()=>a(!c),"aria-expanded":c,children:(0,CX.__)("Change design")})}),renderContent:()=>(0,Tg.jsx)(ud.__experimentalDropdownContentWrapper,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:(0,Tg.jsx)(Ba,{blockPatterns:i,onClickPattern:s,showTitlesAsTooltip:!0})})})}var Hs=l(A(),1),QX=l(N(),1),sT=l(F(),1);var eT=l(F(),1),dd=l($(),1),AX=l(R(),1);var NV=l(QE(),1),PX=l(N(),1);function RX(e,t){for(let o of new NV.default(t).values()){if(o.indexOf("is-style-")===-1)continue;let r=o.substring(9),n=e?.find(({name:i})=>i===r);if(n)return n}return JE(e)}function Ig(e,t,o){let r=new NV.default(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+o.name),r.value}function OX(e){return!e||e.length===0?[]:JE(e)?e:[{name:"default",label:(0,PX._x)("Default","block style"),isDefault:!0},...e]}function JE(e){return e?.find(t=>t.isDefault)}function i1e(e,t){return(0,AX.useMemo)(()=>{let o=t?.example,r=t?.name;if(o&&r)return(0,dd.getBlockFromExample)(r,{attributes:o.attributes,innerBlocks:o.innerBlocks});if(e)return(0,dd.cloneBlock)(e)},[e,t?.example,t?.name])}function Pg({clientId:e,onSwitch:t}){let o=m=>{let{getBlock:h}=m(_),p=h(e);if(!p)return{};let g=(0,dd.getBlockType)(p.name),{getBlockStyles:b}=m(dd.store);return{block:g?.example?null:p,blockType:g,styles:b(p.name),className:p.attributes.className||""}},{styles:r,block:n,blockType:i,className:s}=(0,eT.useSelect)(o,[e]),{updateBlockAttributes:a}=(0,eT.useDispatch)(_),c=OX(r),u=RX(c,s),d=i1e(n,i);return{onSelect:m=>{let h=Ig(s,u,m);a(e,{className:h}),t()},stylesToRender:c,activeStyle:u,genericPreviewBlock:d,className:s}}var Ng=l($(),1),ES=l(F(),1),iT=l(R(),1);function LX(e,t,o){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};let r=t.pop(),n=e;for(let i of t){let s=n[i];n=n[i]=Array.isArray(s)?[...s]:{...s}}return n[r]=o,e}var Oo=(e,t,o)=>{let r=Array.isArray(t)?t:t.split("."),n=e;return r.forEach(i=>{n=n?.[i]}),n??o};var MX=l(Hv(),1);var s1e="1600px",a1e="320px",l1e=1,c1e=.25,u1e=.75,d1e="14px";function NX({minimumFontSize:e,maximumFontSize:t,fontSize:o,minimumViewportWidth:r=a1e,maximumViewportWidth:n=s1e,scaleFactor:i=l1e,minimumFontSizeLimit:s}){if(s=Oa(s)?s:d1e,o){let y=Oa(o);if(!y?.unit||!y?.value)return null;let S=Oa(s,{coerceTo:y.unit});if(S?.value&&!e&&!t&&y?.value<=S?.value)return null;if(t||(t=`${y.value}${y.unit}`),!e){let x=y.unit==="px"?y.value:y.value*16,C=Math.min(Math.max(1-.075*Math.log2(x),c1e),u1e),B=_S(y.value*C,3);S?.value&&B0}function f1e(e){let t=e?.typography??{},o=e?.layout,r=Oa(o?.wideSize)?o?.wideSize:null;return MV(t)&&r?{fluid:{maxViewportWidth:r,...typeof t.fluid=="object"?t.fluid:{}}}:{fluid:t?.fluid}}function tc(e,t){let{size:o}=e;if(!o||o==="0"||e?.fluid===!1||!MV(t?.typography)&&!MV(e))return o;let r=f1e(t)?.fluid??{},n=NX({minimumFontSize:typeof e?.fluid=="boolean"?void 0:e?.fluid?.min,maximumFontSize:typeof e?.fluid=="boolean"?void 0:e?.fluid?.max,fontSize:o,minimumFontSizeLimit:typeof r=="object"?r?.minFontSize:void 0,maximumViewportWidth:typeof r=="object"?r?.maxViewportWidth:void 0,minimumViewportWidth:typeof r=="object"?r?.minViewportWidth:void 0});return n||o}var Aa="body",xS=":root",tT=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>tc(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}];function Us(e,t){if(!e||!t)return t;let o=e.split(","),r=t.split(","),n=[];return o.forEach(i=>{r.forEach(s=>{n.push(`${i.trim()} ${s.trim()}`)})}),n.join(", ")}function DX(e,t){if(!e||!t)return;let o={};return Object.entries(t).forEach(([r,n])=>{typeof n=="string"&&(o[r]=Us(e,n)),typeof n=="object"&&(o[r]={},Object.entries(n).forEach(([i,s])=>{o[r][i]=Us(e,s)}))}),o}function VX(e,t){return e.includes(",")?e.split(",").map(n=>n+t).join(","):e+t}function FX(e,t){let o=`.is-style-${e}`;if(!t)return o;let r=/((?::\([^)]+\))?\s*)([^\s:]+)/,n=(s,a,c)=>a+c+o;return t.split(",").map(s=>s.replace(r,n)).join(",")}function m1e(e,t){if(!e||!t)return e;if(typeof e=="object"&&"ref"in e&&e?.ref){let o=(0,MX.getCSSValueFromRawStyle)(Oo(t,e.ref));return typeof o=="object"&&o!==null&&"ref"in o&&o?.ref?void 0:o===void 0?e:o}return e}function p1e(e,t){if(!e||!t||!Array.isArray(t))return e;let o=t.find(r=>r?.name===e);return o?.href?o?.href:e}function Rg(e,t){if(!e||!t)return e;let o=m1e(e,t);return typeof o=="object"&&o!==null&&"url"in o&&o?.url&&(o.url=p1e(o.url,t?._links?.["wp:theme-file"])),o}function zX(e,t,o=[],r="slug",n){let i=[t?Oo(e,["blocks",t,...o]):void 0,Oo(e,o)].filter(Boolean);for(let s of i)if(s){let a=["custom","theme","default"];for(let c of a){let u=s[c];if(u){let d=u.find(f=>f[r]===n);if(d)return r==="slug"||zX(e,t,o,"slug",d.slug)[r]===d[r]?d:void 0}}}}function h1e(e,t,o,[r,n]=[]){let i=tT.find(a=>a.cssVarInfix===r);if(!i||!e.settings)return o;let s=zX(e.settings,t,i.path,"slug",n);if(s){let{valueKey:a}=i,c=s[a];return wn(e,t,c)}return o}function g1e(e,t,o,r=[]){let n=(t?Oo(e?.settings??{},["blocks",t,"custom",...r]):void 0)??Oo(e?.settings??{},["custom",...r]);return n?wn(e,t,n):o}function wn(e,t,o){if(!o||typeof o!="string")if(typeof o=="object"&&o!==null&&"ref"in o&&typeof o.ref=="string"){let u=Oo(e,o.ref);if(!u||typeof u=="object"&&"ref"in u)return u;o=u}else return o;let r="var:",n="var(--wp--",i=")",s;if(o.startsWith(r))s=o.slice(r.length).split("|");else if(o.startsWith(n)&&o.endsWith(i))s=o.slice(n.length,-i.length).split("--");else return o;let[a,...c]=s;return a==="preset"?h1e(e,t,o,c):a==="custom"?g1e(e,t,o,c):o}var qr=l($(),1),CS=l(Hv(),1),qX=l(F(),1);function oi(e,t="root",o={}){if(!t)return null;let{fallback:r=!1}=o,{name:n,selectors:i,supports:s}=e,a=i&&Object.keys(i).length>0,c=Array.isArray(t)?t.join("."):t,u=null;if(a&&i.root?u=i?.root:s?.__experimentalSelector?u=s.__experimentalSelector:u=".wp-block-"+n.replace("core/","").replace("/","-"),c==="root")return u;let d=Array.isArray(t)?t:t.split(".");if(d.length===1){let m=r?u:null;if(a)return Oo(i,`${c}.root`,null)||Oo(i,c,null)||m;let h=s?Oo(s,`${c}.__experimentalSelector`,null):void 0;return h?Us(u,h):m}let f;return a&&(f=Oo(i,c,null)),f||(r?oi(e,d[0],o):null)}function Ag(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function VV(e){if(!e)return;let t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function P1e(e){if(!e)return null;let t=typeof e=="string";return{top:t?e:e?.top,left:t?e:e?.left}}function FV(e,t="0"){let o=P1e(e);if(!o)return null;let r=VV(o?.top)||t,n=VV(o?.left)||t;return r===n?r:`${r} ${n}`}var GX={backgroundSize:"cover",backgroundPosition:"50% 50%"};function WX(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:GX.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:GX.backgroundPosition}),t}var $X={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};var R1e={button:"wp-element-button",caption:"wp-element-caption"},O1e={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"};function A1e(e="*",t={}){return tT.reduce((o,{path:r,cssVarInfix:n,classes:i})=>{if(!i)return o;let s=Oo(t,r,[]);return["default","theme","custom"].forEach(a=>{s[a]&&s[a].forEach(({slug:c})=>{i.forEach(({classSuffix:u,propertyName:d})=>{let f=`.has-${Ag(c)}-${u}`,m=e.split(",").map(p=>`${p}${f}`).join(","),h=`var(--wp--preset--${n}--${Ag(c)})`;o+=`${m}{${d}: ${h} !important;}`})})}),o},"")}function L1e(e,t){let o=e.split(","),r=[];return o.forEach(n=>{r.push(`${t.trim()}${n.trim()}`)}),r.join(", ")}var KX=(e,t,o)=>{if(o!=="core/paragraph"||(t?.blocks?.["core/paragraph"]?.typography?.textIndent??t?.typography?.textIndent??"subsequent")!=="all")return e;let i=".wp-block-paragraph + .wp-block-paragraph",s=".wp-block-paragraph";if(i in e){let a=e[i],c={...e};return delete c[i],c[s]=a,c}return e},YX=(e,t)=>{let o={};return Object.entries(e).forEach(([r,n])=>{if(r==="root"||!t?.[r])return;let i=typeof n=="string";if(!i&&typeof n=="object"&&n!==null&&Object.entries(n).forEach(([s,a])=>{if(s==="root"||!t?.[r][s])return;let c={[r]:{[s]:t[r][s]}},u=Lg(c);o[a]=[...o[a]||[],...u],delete t[r][s]}),i||typeof n=="object"&&n!==null&&"root"in n){let s=i?n:n.root,a={[r]:t[r]},c=Lg(a);o[s]=[...o[s]||[],...c],delete t[r]}}),o};function Lg(e={},t="",o,r={},n=!1){let i=Aa===t,s=Object.entries(qr.__EXPERIMENTAL_STYLE_PROPERTY).reduce((c,[u,{value:d,properties:f,useEngine:m,rootOnly:h}])=>{if(h&&!i)return c;let p=d;if(p[0]==="elements"||m)return c;let g=Oo(e,p);if(u==="--wp--style--root--padding"&&(typeof g=="string"||!o))return c;if(f&&typeof g!="string")Object.entries(f).forEach(b=>{let[v,k]=b;if(!Oo(g,[k],!1))return;let y=v.startsWith("--")?v:Ag(v);c.push(`${y}: ${(0,CS.getCSSValueFromRawStyle)(Oo(g,[k]))}`)});else if(Oo(e,p,!1)){let b=u.startsWith("--")?u:Ag(u);c.push(`${b}: ${(0,CS.getCSSValueFromRawStyle)(Oo(e,p))}`)}return c},[]);return e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=Rg(e.background.backgroundImage,r)),!i&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...WX(e.background)}})),(0,CS.getCSSRules)(e).forEach(c=>{if(i&&(o||n)&&c.key.startsWith("padding"))return;let u=c.key.startsWith("--")?c.key:Ag(c.key),d=Rg(c.value,r);u==="font-size"&&(d=tc({name:"",slug:"",size:d},r?.settings)),u==="aspect-ratio"&&s.push("min-height: unset"),s.push(`${u}: ${d}`)}),s}function zV({layoutDefinitions:e=$X,style:t,selector:o,hasBlockGapSupport:r,hasFallbackGapSupport:n,fallbackGapValue:i}){let s="",a=r?FV(t?.spacing?.blockGap):"";if(n&&(o===Aa?a=a||"0.5em":!r&&i&&(a=i)),a&&e&&(Object.values(e).forEach(({className:c,name:u,spacingStyles:d})=>{!r&&u!=="flex"&&u!=="grid"||d?.length&&d.forEach(f=>{let m=[];if(f.rules&&Object.entries(f.rules).forEach(([h,p])=>{m.push(`${h}: ${p||a}`)}),m.length){let h="";r?h=o===Aa?`:root :where(.${c})${f?.selector||""}`:`:root :where(${o}-${c})${f?.selector||""}`:h=o===Aa?`:where(.${c}${f?.selector||""})`:`:where(${o}.${c}${f?.selector||""})`,s+=`${h} { ${m.join("; ")}; }`}})}),o===Aa&&r&&(s+=`${xS} { --wp--style--block-gap: ${a}; }`)),o===Aa&&e){let c=["block","flex","grid"];Object.values(e).forEach(({className:u,displayMode:d,baseStyles:f})=>{d&&c.includes(d)&&(s+=`${o} .${u} { display:${d}; }`),f?.length&&f.forEach(m=>{let h=[];if(m.rules&&Object.entries(m.rules).forEach(([p,g])=>{h.push(`${p}: ${g}`)}),h.length){let p=`.${u}${m?.selector||""}`;s+=`${p} { ${h.join("; ")}; }`}})})}return s}var N1e=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function oT(e){if(!e)return{};let r=Object.entries(e).filter(([n])=>N1e.includes(n)).map(([n,i])=>[n,JSON.parse(JSON.stringify(i))]);return Object.fromEntries(r)}var M1e=(e,t)=>{let o=[];if(!e?.styles)return o;let r=oT(e.styles);return r&&o.push({styles:r,selector:Aa,skipSelectorWrapper:!0}),Object.entries(qr.__EXPERIMENTAL_ELEMENTS).forEach(([n,i])=>{e.styles?.elements?.[n]&&o.push({styles:e.styles?.elements?.[n]??{},selector:i,skipSelectorWrapper:!R1e[n]})}),Object.entries(e.styles?.blocks??{}).forEach(([n,i])=>{let s=oT(i),a=i,c=[];if(a?.variations){let u={};Object.entries(a.variations).forEach(([d,f])=>{let m=f;u[d]=oT(m),m?.css&&(u[d].css=m.css);let h=typeof t!="string"?t[n]?.styleVariationSelectors?.[d]:void 0;Object.entries(m?.elements??{}).forEach(([p,g])=>{g&&qr.__EXPERIMENTAL_ELEMENTS[p]&&c.push({styles:g,selector:Us(h,qr.__EXPERIMENTAL_ELEMENTS[p])})}),Object.entries(m?.blocks??{}).forEach(([p,g])=>{let b=typeof t!="string"?Us(h,t[p]?.selector):void 0,v=typeof t!="string"?Us(h,t[p]?.duotoneSelector):void 0,k=typeof t!="string"?DX(h,t[p]?.featureSelectors??{}):void 0,y=oT(g);g?.css&&(y.css=g.css),!(!b||typeof t=="string")&&(c.push({selector:b,duotoneSelector:v,featureSelectors:k,fallbackGapValue:t[p]?.fallbackGapValue,hasLayoutSupport:t[p]?.hasLayoutSupport,styles:y}),Object.entries(g.elements??{}).forEach(([S,x])=>{x&&qr.__EXPERIMENTAL_ELEMENTS[S]&&c.push({styles:x,selector:Us(b,qr.__EXPERIMENTAL_ELEMENTS[S])})}))})}),s.variations=u}typeof t!="string"&&t?.[n]?.selector&&o.push({duotoneSelector:t[n].duotoneSelector,fallbackGapValue:t[n].fallbackGapValue,hasLayoutSupport:t[n].hasLayoutSupport,selector:t[n].selector,styles:s,featureSelectors:t[n].featureSelectors,styleVariationSelectors:t[n].styleVariationSelectors,name:n}),Object.entries(a?.elements??{}).forEach(([u,d])=>{typeof t!="string"&&d&&t?.[n]&&qr.__EXPERIMENTAL_ELEMENTS[u]&&o.push({styles:d,selector:t[n]?.selector.split(",").map(f=>qr.__EXPERIMENTAL_ELEMENTS[u].split(",").map(h=>f+" "+h)).join(",")})}),o.push(...c)}),o},D1e=(e,t)=>{let o=[];if(!e?.settings)return o;let r=s=>{let a={};return tT.forEach(({path:c})=>{let u=Oo(s,c,!1);u!==!1&&(a=LX(a,c,u))}),a},n=r(e.settings),i=e.settings?.custom;return(Object.keys(n).length>0||i)&&o.push({presets:n,custom:i,selector:xS}),Object.entries(e.settings?.blocks??{}).forEach(([s,a])=>{let c=a.custom;if(typeof t=="string"||!t[s])return;let u=r(a);(Object.keys(u).length>0||c)&&o.push({presets:u,custom:c,selector:t[s]?.selector})}),o};var rT=(e,t,o,r,n=!1,i=!1,s={})=>{let a={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...s},c=M1e(e,t),u=D1e(e,t),d=e?.settings?.useRootPaddingAwareAlignments,{contentSize:f,wideSize:m}=e?.settings?.layout||{},h=a.marginReset||a.rootPadding||a.layoutStyles,p="";if(a.presets&&(f||m)&&(p+=`${xS} {`,p=f?p+` --wp--style--global--content-size: ${f};`:p,p=m?p+` --wp--style--global--wide-size: ${m};`:p,p+="}"),h&&(p+=":where(body) {margin: 0;",a.rootPadding&&d&&(p+=`padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } .has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); } .has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0; `),p+="}"),a.blockStyles&&c.forEach(({selector:g,duotoneSelector:b,styles:v,fallbackGapValue:k,hasLayoutSupport:y,featureSelectors:S,styleVariationSelectors:x,skipSelectorWrapper:C,name:B})=>{if(S){let E=YX(S,v);E=KX(E,e.settings,B),Object.entries(E).forEach(([L,T])=>{if(T.length){let O=T.join(";");p+=`:root :where(${L}){${O};}`}})}if(b){let E={};v?.filter&&(E.filter=v.filter,delete v.filter);let L=Lg(E);L.length&&(p+=`${b}{${L.join(";")};}`)}!n&&(Aa===g||y)&&(p+=zV({style:v,selector:g,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:k}));let I=Lg(v,g,d,e,i);if(I?.length){let E=C?g:`:root :where(${g})`;p+=`${E}{${I.join(";")};}`}v?.css&&(p+=BS(v.css,`:root :where(${g})`)),a.variationStyles&&x&&Object.entries(x).forEach(([E,L])=>{let T=v?.variations?.[E];if(T){if(S){let D=YX(S,T);D=KX(D,e.settings,B),Object.entries(D).forEach(([U,G])=>{if(G.length){let j=L1e(U,L),z=G.join(";");p+=`:root :where(${j}){${z};}`}})}let O=Lg(T,L,d,e);if(O.length&&(p+=`:root :where(${L}){${O.join(";")};}`),T?.css&&(p+=BS(T.css,`:root :where(${L})`)),y&&T?.spacing?.blockGap){let D=L+g;p+=zV({style:T,selector:D,hasBlockGapSupport:!0,hasFallbackGapSupport:r,fallbackGapValue:k})}}});let P=Object.entries(v).filter(([E])=>E.startsWith(":"));P?.length&&P.forEach(([E,L])=>{let T=Lg(L);if(!T?.length)return;let D=`:root :where(${g.split(",").map(U=>U+E).join(",")}){${T.join(";")};}`;p+=D})}),a.layoutStyles&&(p=p+".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",p=p+".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",p=p+".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),a.blockGap&&o){let g=FV(e?.styles?.spacing?.blockGap)||"0.5em";p=p+`:root :where(.wp-site-blocks) > * { margin-block-start: ${g}; margin-block-end: 0; }`,p=p+":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",p=p+":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return a.presets&&u.forEach(({selector:g,presets:b})=>{(Aa===g||xS===g)&&(g="");let v=A1e(g,b);v.length>0&&(p+=v)}),p};var V1e=(e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;let o={root:t};return Object.entries(O1e).forEach(([r,n])=>{let i=oi(e,r);i&&(o[n]=i)}),o},nT=(e,t)=>{let{getBlockStyles:o}=(0,qX.select)(qr.store),r={};return e.forEach(n=>{let i=n.name,s=oi(n);if(!s)return;let a=oi(n,"filter.duotone");if(!a){let h=oi(n),p=(0,qr.getBlockSupport)(n,"color.__experimentalDuotone",!1);a=p&&h&&Us(h,p)}let c=!!n?.supports?.layout||!!n?.supports?.__experimentalLayout,u=n?.supports?.spacing?.blockGap?.__experimentalDefault,d=o(i),f={};d?.forEach(h=>{let p=t?`-${t}`:"",g=`${h.name}${p}`,b=FX(g,s);f[g]=b});let m=V1e(n,s);r[i]={duotoneSelector:a??void 0,fallbackGapValue:u,featureSelectors:Object.keys(m).length?m:void 0,hasLayoutSupport:c,name:i,selector:s,styleVariationSelectors:d?.length?f:void 0}}),r};function BS(e,t){let o="";return!e||e.trim()===""||e.split("&").forEach(n=>{if(!n||n.trim()==="")return;if(!n.includes("{"))o+=`:root :where(${t}){${n.trim()}}`;else{let s=n.replace("}","").split("{");if(s.length!==2)return;let[a,c]=s,u=a.match(/([>+~\s]*::[a-zA-Z-]+)/),d=u?u[1]:"",f=u?a.replace(d,"").trim():a.trim(),m;f===""?m=t:m=a.startsWith(" ")?Us(t,f):VX(t,f),o+=`:root :where(${m})${d}{${c.trim()}}`}}),o}var TS=l(w(),1),jV="is-style-";function ZX(e){return e?e.split(/\s+/).reduce((t,o)=>{if(o.startsWith(jV)){let r=o.slice(jV.length);r!=="default"&&t.push(r)}return t},[]):[]}function UV(e,t=[]){let o=ZX(e);if(!o)return null;for(let r of o)if(t.some(n=>n.name===r))return r;return null}function F1e({override:e}){oc(e)}function HV({config:e}){let{getBlockStyles:t,overrides:o}=(0,ES.useSelect)(i=>({getBlockStyles:i(Ng.store).getBlockStyles,overrides:M(i(_)).getStyleOverrides()}),[]),{getBlockName:r}=(0,ES.useSelect)(_),n=(0,iT.useMemo)(()=>{if(!o?.length)return;let i=[],s=[];for(let[,a]of o)if(a?.variation&&a?.clientId&&!s.includes(a.clientId)){let c=r(a.clientId),u=e?.styles?.blocks?.[c]?.variations?.[a.variation];if(u){let d={settings:e?.settings,styles:{blocks:{[c]:{variations:{[`${a.variation}-${a.clientId}`]:u}}}}},f=nT((0,Ng.getBlockTypes)(),a.clientId),b=rT(d,f,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});i.push({id:`${a.variation}-${a.clientId}`,css:b,__unstableType:"variation",variation:a.variation,clientId:a.clientId}),s.push(a.clientId)}}return i},[e,o,t,r]);return!n||!n.length?null:(0,TS.jsx)(TS.Fragment,{children:n.map(i=>(0,TS.jsx)(F1e,{override:i},i.id))})}function GV(e,t,o){if(!e?.styles?.blocks?.[t]?.variations?.[o])return;let r=i=>{Object.keys(i).forEach(s=>{let a=i[s];if(typeof a=="object"&&a!==null)if(a.ref!==void 0)if(typeof a.ref!="string"||a.ref.trim()==="")delete i[s];else{let c=Sl(e,a.ref);c?i[s]=c:delete i[s]}else r(a),Object.keys(a).length===0&&delete i[s]})},n=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[o]));return r(n),n}function z1e(e,t,o){let{globalSettings:r,globalStyles:n}=(0,ES.useSelect)(i=>{let s=i(_).getSettings();return{globalSettings:s.__experimentalFeatures,globalStyles:s[xi]}},[]);return(0,iT.useMemo)(()=>{let i=GV({settings:r,styles:n},e,t);return{settings:r,styles:{blocks:{[e]:{variations:{[`${t}-${o}`]:i}}}}}},[r,n,t,o,e])}function j1e({name:e,className:t,clientId:o}){let{getBlockStyles:r}=(0,ES.useSelect)(Ng.store),n=r(e),i=UV(t,n),s=`${jV}${i}-${o}`,{settings:a,styles:c}=z1e(e,i,o),u=(0,iT.useMemo)(()=>{if(!i)return;let d={settings:a,styles:c},f=nT((0,Ng.getBlockTypes)(),o);return rT(d,f,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[i,a,c,o]);return oc({id:`variation-${o}`,css:u,__unstableType:"variation",variation:i,clientId:o}),i?{className:s}:{}}var XX={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>ZX(e).length>0,useBlockProps:j1e};var fd=l(w(),1),U1e=(0,fd.jsxs)(Hs.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,fd.jsx)(Hs.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),(0,fd.jsx)(Hs.Path,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]});function H1e({clientId:e}){let{stylesToRender:t,activeStyle:o,className:r}=Pg({clientId:e}),{updateBlockAttributes:n}=(0,sT.useDispatch)(_),{globalSettings:i,globalStyles:s,blockName:a}=(0,sT.useSelect)(d=>{let f=d(_).getSettings();return{globalSettings:f.__experimentalFeatures,globalStyles:f[xi],blockName:d(_).getBlockName(e)}},[e]),c=o?.name?GV({settings:i,styles:s},a,o.name)?.color?.background:void 0;return!t||t.length===0?null:(0,fd.jsx)(Hs.ToolbarGroup,{children:(0,fd.jsx)(Hs.ToolbarButton,{onClick:()=>{let f=(t.findIndex(p=>p.name===o.name)+1)%t.length,m=t[f],h=Ig(r,o,m);n(e,{className:h})},label:(0,QX.__)("Shuffle styles"),children:(0,fd.jsx)(Hs.Icon,{icon:U1e,style:{fill:c||"transparent"}})})})}var JX=H1e;var cT=l(A(),1),WV=l(N(),1),eQ=l(F(),1),uT=l($(),1);var aT=l(F(),1);function lT(e){let{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i}=(0,aT.useSelect)(u=>{let{isSectionBlock:d,getParentSectionBlock:f,getEditedContentOnlySection:m,isWithinEditedContentOnlySection:h}=M(u(_)),p=m();return{isSectionBlock:d(e),isWithinSection:d(e)||!!f(e),isWithinEditedSection:h(e),isEditingContentOnlySection:p===e,editedContentOnlySection:p}},[e]),s=(0,aT.useDispatch)(_),{editContentOnlySection:a,stopEditingContentOnlySection:c}=M(s);return{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i,editContentOnlySection:a,stopEditingContentOnlySection:c}}var $V=l(w(),1);function tQ({clientId:e}){let{isSectionBlock:t,isEditingContentOnlySection:o,editContentOnlySection:r,stopEditingContentOnlySection:n}=lT(e),i=(0,eQ.useSelect)(c=>{if(!e)return null;let{getBlockName:u}=c(_),d=u(e);return d?{name:d}:null},[e]);if(!e||!t&&!o||(0,uT.isReusableBlock)(i)||(0,uT.isTemplatePart)(i))return null;let s=o;return(0,$V.jsx)(cT.ToolbarGroup,{children:(0,$V.jsx)(cT.ToolbarButton,{onClick:()=>{s?n():r(e)},children:s?(0,WV.__)("Exit pattern"):(0,WV.__)("Edit pattern")})})}var TQ=l(A(),1),IQ=l(N(),1),PQ=l(F(),1);var RS=l($(),1),RQ=l(Xp(),1);var La=l(N(),1),Na=l(A(),1),md=l($(),1),kT=l(F(),1);var cQ=l(N(),1),IS=l(A(),1),mT=l($(),1),pT=l(R(),1);var oQ=l(N(),1),rQ=l(A(),1),nQ=l(Z(),1);var Lm=l(w(),1);function dT({blocks:e}){return(0,nQ.useViewportMatch)("medium","<")?null:(0,Lm.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,Lm.jsx)(rQ.Popover,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:(0,Lm.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,Lm.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,oQ.__)("Preview")}),(0,Lm.jsx)(vn,{viewportWidth:601,blocks:e})]})})})}var iQ=l(A(),1),Mg=l($(),1),sQ=l(F(),1),fT=l(R(),1);var rc=l(w(),1),G1e={};function aQ({clientIds:e,blocks:t}){let{activeBlockVariation:o,blockVariationTransformations:r}=(0,sQ.useSelect)(i=>{let{getBlockAttributes:s,canRemoveBlocks:a}=i(_),{getActiveBlockVariation:c,getBlockVariations:u}=i(Mg.store),d=a(e);if(t.length!==1||!d)return G1e;let[f]=t;return{blockVariationTransformations:u(f.name,"transform"),activeBlockVariation:c(f.name,s(f.clientId))}},[e,t]);return(0,fT.useMemo)(()=>r?.filter(({name:i})=>i!==o?.name),[r,o])}var W1e=({transformations:e,onSelect:t,blocks:o})=>{let[r,n]=(0,fT.useState)();return(0,rc.jsxs)(rc.Fragment,{children:[r&&(0,rc.jsx)(dT,{blocks:(0,Mg.cloneBlock)(o[0],e.find(({name:i})=>i===r).attributes)}),e?.map(i=>(0,rc.jsx)($1e,{item:i,onSelect:t,setHoveredTransformItemName:n},i.name))]})};function $1e({item:e,onSelect:t,setHoveredTransformItemName:o}){let{name:r,icon:n,title:i}=e;return(0,rc.jsxs)(iQ.MenuItem,{className:(0,Mg.getBlockMenuDefaultClassName)(r),onClick:s=>{s.preventDefault(),t(r)},onMouseLeave:()=>o(null),onMouseEnter:()=>o(r),onFocus:()=>o(r),onBlur:()=>o(null),children:[(0,rc.jsx)(Ae,{icon:n,showColors:!0}),i]})}var lQ=W1e;var Cn=l(w(),1);function K1e(e){let t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},o=(0,pT.useMemo)(()=>{let r=Object.keys(t),n=e.reduce((i,s)=>{let{name:a}=s;return r.includes(a)?i.priorityTextTransformations.push(s):i.restTransformations.push(s),i},{priorityTextTransformations:[],restTransformations:[]});if(n.priorityTextTransformations.length===1&&n.priorityTextTransformations[0].name==="core/quote"){let i=n.priorityTextTransformations.pop();n.restTransformations.push(i)}return n},[e]);return o.priorityTextTransformations.sort(({name:r},{name:n})=>t[r]{let[s,a]=(0,pT.useState)(),{priorityTextTransformations:c,restTransformations:u}=K1e(t),d=c.length&&u.length,f=!!u.length&&(0,Cn.jsx)(q1e,{restTransformations:u,onSelect:r,setHoveredTransformItemName:a});return(0,Cn.jsxs)(Cn.Fragment,{children:[(0,Cn.jsxs)(IS.MenuGroup,{label:(0,cQ.__)("Transform to"),className:e,children:[s&&(0,Cn.jsx)(dT,{blocks:(0,mT.switchToBlockType)(i,s)}),!!o?.length&&(0,Cn.jsx)(lQ,{transformations:o,blocks:i,onSelect:n}),c.map(m=>(0,Cn.jsx)(uQ,{item:m,onSelect:r,setHoveredTransformItemName:a},m.name)),!d&&f]}),!!d&&(0,Cn.jsx)(IS.MenuGroup,{className:e,children:f})]})};function q1e({restTransformations:e,onSelect:t,setHoveredTransformItemName:o}){return e.map(r=>(0,Cn.jsx)(uQ,{item:r,onSelect:t,setHoveredTransformItemName:o},r.name))}function uQ({item:e,onSelect:t,setHoveredTransformItemName:o}){let{name:r,icon:n,title:i,isDisabled:s}=e;return(0,Cn.jsxs)(IS.MenuItem,{className:(0,mT.getBlockMenuDefaultClassName)(r),onClick:a=>{a.preventDefault(),t(r)},disabled:s,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r),onFocus:()=>o(r),onBlur:()=>o(null),children:[(0,Cn.jsx)(Ae,{icon:n,showColors:!0}),i]})}var dQ=Y1e;var mQ=l(N(),1),pQ=l(A(),1);var hT=l(A(),1);var Dg=l(w(),1),Z1e=()=>{};function fQ({clientId:e,onSwitch:t=Z1e}){let{onSelect:o,stylesToRender:r,activeStyle:n}=Pg({clientId:e,onSwitch:t});return!r||r.length===0?null:(0,Dg.jsx)(Dg.Fragment,{children:r.map(i=>{let s=i.label||i.name;return(0,Dg.jsx)(hT.MenuItem,{icon:n.name===i.name?bl:null,onClick:()=>o(i),children:(0,Dg.jsx)(hT.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:s})},i.name)})})}var KV=l(w(),1);function gT({hoveredBlock:e,onSwitch:t}){let{clientId:o}=e;return(0,KV.jsx)(pQ.MenuGroup,{label:(0,mQ.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,KV.jsx)(fQ,{clientId:o,onSwitch:t})})}var qV=l(N(),1),yQ=l(R(),1),bT=l(Z(),1);var Gs=l(A(),1);var bQ=l(R(),1),kQ=l($(),1);var hQ=l($(),1),YV=(e,t,o=new Set)=>{let{clientId:r,name:n,innerBlocks:i=[]}=e;if(!o.has(r)){if(n===t)return e;for(let s of i){let a=YV(s,t,o);if(a)return a}}},gQ=(e,t)=>{let o=(0,hQ.getBlockAttributesNamesByRole)(e,"content");return o?.length?o.reduce((r,n)=>(t[n]&&(r[n]=t[n]),r),{}):t};var X1e=(e,t)=>{let o=gQ(t.name,t.attributes);e.attributes={...e.attributes,...o}},Q1e=(e,t)=>{let o=t.map(n=>(0,kQ.cloneBlock)(n)),r=new Set;for(let n of e){let i=!1;for(let s of o){let a=YV(s,n.name,r);if(a){i=!0,r.add(a.clientId),X1e(a,n);break}}if(!i)return}return o},J1e=(e,t)=>(0,bQ.useMemo)(()=>e.reduce((o,r)=>{let n=Q1e(t,r.blocks);return n&&o.push({...r,transformedBlocks:n}),o},[]),[e,t]),vQ=J1e;var hr=l(w(),1);function eBe({blocks:e,patterns:t,onSelect:o}){let[r,n]=(0,yQ.useState)(!1),i=vQ(t,e);return i.length?(0,hr.jsxs)(Gs.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[r&&(0,hr.jsx)(tBe,{patterns:i,onSelect:o}),(0,hr.jsx)(Gs.MenuItem,{onClick:s=>{s.preventDefault(),n(!r)},icon:Vo,children:(0,qV.__)("Patterns")})]}):null}function tBe({patterns:e,onSelect:t}){let o=(0,bT.useViewportMatch)("medium","<");return(0,hr.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,hr.jsx)(Gs.Popover,{className:"block-editor-block-switcher__popover-preview",placement:o?"bottom":"right-start",offset:16,children:(0,hr.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,hr.jsx)(oBe,{patterns:e,onSelect:t})})})})}function oBe({patterns:e,onSelect:t}){return(0,hr.jsx)(Gs.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,qV.__)("Patterns list"),children:e.map(o=>(0,hr.jsx)(SQ,{pattern:o,onSelect:t},o.name))})}function SQ({pattern:e,onSelect:t}){let o="block-editor-block-switcher__preview-patterns-container",r=(0,bT.useInstanceId)(SQ,`${o}-list__item-description`);return(0,hr.jsxs)("div",{className:`${o}-list__list-item`,children:[(0,hr.jsxs)(Gs.Composite.Item,{render:(0,hr.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?r:void 0,className:`${o}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,hr.jsx)(vn,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,hr.jsx)("div",{className:`${o}-list__item-title`,children:e.title})]}),!!e.description&&(0,hr.jsx)(Gs.VisuallyHidden,{id:r,children:e.description})]})}var _Q=eBe;var ri=l(w(),1);function rBe({onClose:e,clientIds:t}){let{replaceBlocks:o,multiSelect:r,updateBlockAttributes:n}=(0,kT.useDispatch)(_),{possibleBlockTransformations:i,patterns:s,blocks:a,isUsingBindings:c,canRemove:u,hasBlockStyles:d}=(0,kT.useSelect)(I=>{let{getBlockAttributes:P,getBlocksByClientId:E,getBlockRootClientId:L,getBlockTransformItems:T,__experimentalGetPatternTransformItems:O,canRemoveBlocks:D,getBlockName:U}=I(_),{getBlockStyles:G}=I(md.store),j=L(t[0]),z=E(t),W=t.length===1,ee=W&&U(t[0]),se=W&&!!G(ee)?.length;return{blocks:z,possibleBlockTransformations:T(z,j),patterns:O(z,j),isUsingBindings:t.every(ce=>!!P(ce)?.metadata?.bindings),canRemove:D(t),hasBlockStyles:se}},[t]),f=aQ({clientIds:t,blocks:a});function m(I){I.length>1&&r(I[0].clientId,I[I.length-1].clientId)}function h(I){let P=(0,md.switchToBlockType)(a,I);o(t,P),m(P)}function p(I){n(a[0].clientId,{...f.find(({name:P})=>P===I).attributes})}function g(I){o(t,I),m(I)}let b=a.length===1,v=b&&((0,md.isTemplatePart)(a[0])||(0,md.isReusableBlock)(a[0])),k=!!i?.length&&u&&!v,y=!!f?.length,S=!!s?.length&&u,x=k||y;if(!(d||x||S))return(0,ri.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,La.__)("No transforms.")});let B=b?(0,La._x)("This block is connected.","block toolbar button label and description"):(0,La._x)("These blocks are connected.","block toolbar button label and description");return(0,ri.jsxs)("div",{className:"block-editor-block-switcher__container",children:[S&&(0,ri.jsx)(_Q,{blocks:a,patterns:s,onSelect:I=>{g(I),e()}}),x&&(0,ri.jsx)(dQ,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,possibleBlockVariationTransformations:f,blocks:a,onSelect:I=>{h(I),e()},onSelectVariation:I=>{p(I),e()}}),d&&(0,ri.jsx)(gT,{hoveredBlock:a[0],onSwitch:e}),c&&(0,ri.jsx)(Na.MenuGroup,{children:(0,ri.jsx)(Na.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:B})})]})}var nBe=({children:e,clientIds:t,label:o,text:r})=>{let i=t.length===1?(0,La.__)("Change block type or style"):(0,La.sprintf)((0,La._n)("Change type of %d block","Change type of %d blocks",t.length),t.length);return(0,ri.jsx)(Na.ToolbarGroup,{children:(0,ri.jsx)(Na.ToolbarItem,{children:s=>(0,ri.jsx)(Na.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:e,text:r,toggleProps:{description:i,...s},menuProps:{orientation:"both"},children:({onClose:a})=>(0,ri.jsx)(rBe,{onClose:a,clientIds:t})})})})},xQ=nBe;var wQ=l(N(),1),Fg=l(A(),1);var Vg=l(w(),1);function CQ({clientIds:e,children:t,label:o,text:r}){return(0,Vg.jsx)(Fg.ToolbarGroup,{children:(0,Vg.jsx)(Fg.ToolbarItem,{children:n=>(0,Vg.jsx)(Fg.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:t,text:r,toggleProps:{description:(0,wQ.__)("Change block style"),...n},menuProps:{orientation:"both"},children:({onClose:i})=>(0,Vg.jsx)("div",{className:"block-editor-block-switcher__container",children:(0,Vg.jsx)(gT,{hoveredBlock:{clientId:e[0]},onSwitch:i})})})})})}var zg=l(A(),1),PS=l(N(),1),vT=l(R(),1),BQ=l(F(),1);var nc=l(w(),1);function iBe({clientIds:e,blockTitle:t}){let o=(0,BQ.useSelect)(i=>{let{getBlockAttributes:s}=i(_);return s(e?.[0])?.metadata?.name},[e]),r=e.length===1,n;return r&&o?n=(0,PS.sprintf)((0,PS.__)('This %1$s is editable using the "%2$s" override.'),t.toLowerCase(),o):n=(0,PS.__)("These blocks are editable using overrides."),(0,nc.jsx)(zg.__experimentalText,{children:n})}function EQ({icon:e,clientIds:t,blockTitle:o,label:r}){let[n,i]=(0,vT.useState)(!1),s=(0,vT.useRef)();return(0,nc.jsxs)(nc.Fragment,{children:[(0,nc.jsx)(zg.ToolbarButton,{ref:s,className:"block-editor-block-toolbar__pattern-overrides-indicator",icon:e,label:r,onClick:()=>i(!n),"aria-expanded":n}),n&&(0,nc.jsx)(zg.Popover,{anchor:s.current,onClose:()=>i(!1),placement:"bottom-start",offset:16,className:"block-editor-block-toolbar__pattern-overrides-popover",children:(0,nc.jsx)(iBe,{clientIds:t,blockTitle:o})})]})}var jg=l(w(),1);function sBe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r,getBlockParentsByBlockName:n,canRemoveBlocks:i,getTemplateLock:s,getBlockEditingMode:a,canEditBlock:c}=M(e(_)),{getBlockStyles:u}=e(RS.store),d=t.some(P=>s(P)==="contentOnly"),f=t.length===1,m=f&&o(t[0]),h=f&&!!u(m)?.length,p=t.some(P=>!!r(P)?.metadata?.patternName),g=t.every(P=>$k(r(P)?.metadata?.bindings)),b=t.every(P=>n(P,"core/block",!0).length>0),v=i(t),k=t.every(P=>c(P)),y=a(t[0]),S=y==="default",x=y==="contentOnly",B=!p&&S&&(h||v)&&!d&&k,I=g&&b;return B?"switcher":x&&h&&!g&&k?"styles-only":I?"pattern-overrides":"default"}function aBe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r}=M(e(_)),n=t.length===1,i=t[0],s=r(i);if(n&&s?.metadata?.patternName)return Ei;let a=o(i),c=(0,RS.getBlockType)(a);if(n){let{getActiveBlockVariation:f}=e(RS.store);return f(a,s)?.icon||c?.icon}let u=t.map(f=>o(f));return new Set(u).size===1?c?.icon:Bf}function OQ({clientIds:e,isSynced:t}){let{icon:o,showIconLabels:r,variant:n}=(0,PQ.useSelect)(f=>({icon:aBe({select:f,clientIds:e}),showIconLabels:f(RQ.store).get("core","showIconLabels"),variant:sBe({select:f,clientIds:e})}),[e]),i=zr({clientId:e?.[0],maximumLength:35}),s=e.length===1,a=s&&t&&!r,c=s?i:(0,IQ.__)("Multiple blocks selected"),u=a&&i?i:void 0,d=(0,jg.jsx)(Ae,{className:"block-editor-block-toolbar__block-icon",icon:o});return n==="switcher"?(0,jg.jsx)(xQ,{clientIds:e,label:c,text:u,children:d}):n==="styles-only"?(0,jg.jsx)(CQ,{clientIds:e,label:c,text:u,children:d}):n==="pattern-overrides"?(0,jg.jsx)(EQ,{icon:d,clientIds:e,blockTitle:i,label:c}):(0,jg.jsx)(TQ.ToolbarButton,{disabled:!0,className:"block-editor-block-toolbar__block-icon-button",title:c,icon:d,text:u})}var Qe=l(w(),1);function XV({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,variant:n="unstyled"}){let{blockClientId:i,blockClientIds:s,isDefaultEditingMode:a,blockType:c,toolbarKey:u,shouldShowVisualToolbar:d,showParentSelector:f,isUsingBindings:m,isSectionContainer:h,hasContentOnlyLocking:p,showShuffleButton:g,showSlots:b,showGroupButtons:v,showLockButtons:k,showBlockVisibilityButton:y,showSwitchSectionStyleButton:S,areSelectedBlocksHiddenOnViewport:x,canEdit:C}=(0,LQ.useSelect)(G=>{let{canEditBlock:j}=G(_),{getBlockName:z,getBlockMode:W,getBlockParents:ee,getSelectedBlockClientIds:se,isBlockValid:ce,getBlockEditingMode:ie,getBlockAttributes:re,getSettings:Q,getTemplateLock:Y,getParentSectionBlock:J,isZoomOut:K,isSectionBlock:H,isBlockHiddenAtViewport:X}=M(G(_)),ne=se(),le=ne[0],ve=ee(le),xe=J(le)??ve[ve.length-1],ze=z(xe),ot=(0,ic.getBlockType)(ze),Wt=ie(le),fo=Wt==="default",Do=z(le),rt=ne.every(je=>ce(je)),ar=ne.every(je=>W(je)==="visual"),xt=ne.every(je=>!!re(je)?.metadata?.bindings),At=ne.some(je=>Y(je)==="contentOnly"),Pe=K(),wt=H(le),qo=j(le),$t=qo&&(Pe||wt),lr=Q()?.[wi]?.toLowerCase()||"desktop",ln=ne.length>0&&ne.every(je=>X(je,lr));return{blockClientId:le,blockClientIds:ne,isDefaultEditingMode:fo,blockType:le&&(0,ic.getBlockType)(Do),shouldShowVisualToolbar:rt&&ar,toolbarKey:`${le}${xe}`,showParentSelector:!Pe&&ot&&Wt!=="contentOnly"&&ie(xe)!=="disabled"&&(0,ic.hasBlockSupport)(ot,"__experimentalParentSelector",!0)&&ne.length===1,isUsingBindings:xt,isSectionContainer:wt,hasContentOnlyLocking:At,showShuffleButton:Pe,showSlots:!Pe,showGroupButtons:!Pe,showLockButtons:!Pe,showBlockVisibilityButton:!Pe,showSwitchSectionStyleButton:$t,areSelectedBlocksHiddenOnViewport:ln,canEdit:qo}},[]),B=(0,ZV.useRef)(null),I=(0,ZV.useRef)(),P=vg({ref:I}),E=!(0,NQ.useViewportMatch)("medium","<");if(!ZE())return null;let T=s.length>1,O=(0,ic.isReusableBlock)(c)||(0,ic.isTemplatePart)(c),D=V("block-editor-block-contextual-toolbar",{"has-parent":f}),U=V("block-editor-block-toolbar",{"is-synced":O,"is-connected":m});return(0,Qe.jsx)(Eg,{focusEditorOnEscape:!0,className:D,"aria-label":(0,AQ.__)("Block tools"),variant:n==="toolbar"?void 0:n,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,children:(0,Qe.jsxs)("div",{ref:B,className:U,children:[f&&!T&&E&&(0,Qe.jsx)(iZ,{}),(d||T)&&(0,Qe.jsx)("div",{ref:I,...P,children:(0,Qe.jsxs)(MQ.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,Qe.jsx)(OQ,{clientIds:s,isSynced:O}),a&&y&&(0,Qe.jsx)(ID,{clientIds:s}),!T&&a&&k&&(0,Qe.jsx)(CV,{clientId:i}),(0,Qe.jsx)(vE,{clientIds:s,hideDragHandle:e})]})}),!x&&!p&&d&&T&&v&&(0,Qe.jsx)(yV,{}),!T&&C&&(0,Qe.jsx)(tQ,{clientId:s[0]}),!x&&g&&(0,Qe.jsx)(TX,{clientId:s[0]}),!x&&S&&(0,Qe.jsx)(JX,{clientId:s[0]}),!x&&d&&b&&(0,Qe.jsxs)(Qe.Fragment,{children:[!h&&(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Mt.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(Mt.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(Mt.Slot,{className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(Mt.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"})]}),(0,Qe.jsx)(Mt.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(wE.Slot,{})]}),(0,Qe.jsx)(bX,{clientIds:s}),(0,Qe.jsx)(WE,{clientIds:s})]})},u)}function DQ({hideDragHandle:e,variant:t}){return(0,Qe.jsx)(XV,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}var QV=l(w(),1);function zQ({clientId:e,isTyping:t,__unstableContentRef:o}){let{capturingClientId:r,isInsertionPointVisible:n,lastClientId:i}=uE(e),s=(0,Ug.useRef)();(0,Ug.useEffect)(()=>{s.current=void 0},[e]);let{stopTyping:a}=(0,VQ.useDispatch)(_),c=(0,Ug.useRef)(!1);(0,FQ.useShortcut)("core/block-editor/focus-toolbar",()=>{c.current=!0,a(!0)}),(0,Ug.useEffect)(()=>{c.current=!1});let u=r||e,d=cE({contentElement:o?.current,clientId:u});return!t&&(0,QV.jsx)(hm,{clientId:u,bottomClientId:i,className:V("block-editor-block-list__block-popover",{"is-insertion-point-visible":n}),resize:!1,...d,__unstableContentRef:o,children:(0,QV.jsx)(XV,{focusOnMount:c.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:f=>{s.current=f},variant:"toolbar"})})}var yT=l(F(),1),ST=l(R(),1);var jQ=l(A(),1);var UQ=l(N(),1),HQ=l(w(),1);function lBe({onClick:e}){return(0,HQ.jsx)(jQ.Button,{variant:"primary",icon:Bi,size:"compact",className:V("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:(0,UQ._x)("Add pattern","Generic label for pattern inserter button")})}var GQ=lBe;var JV=l(w(),1);function cBe(){let[e,t]=(0,ST.useState)(!1),{hasSelection:o,blockOrder:r,setInserterIsOpened:n,sectionRootClientId:i,selectedBlockClientId:s,blockInsertionPoint:a,insertionPointVisible:c}=(0,yT.useSelect)(p=>{let{getSettings:g,getBlockOrder:b,getSelectionStart:v,getSelectedBlockClientId:k,getSectionRootClientId:y,getBlockInsertionPoint:S,isBlockInsertionPointVisible:x}=M(p(_)),C=y();return{hasSelection:!!v().clientId,blockOrder:b(C),sectionRootClientId:C,setInserterIsOpened:g().__experimentalSetIsInserterOpened,selectedBlockClientId:k(),blockInsertionPoint:S(),insertionPointVisible:x()}},[]),{showInsertionPoint:u}=M((0,yT.useDispatch)(_));if((0,ST.useEffect)(()=>{let p=setTimeout(()=>{t(!0)},500);return()=>{clearTimeout(p)}},[]),!e||!o)return null;let d=s,m=r.findIndex(p=>s===p)+1,h=r[m];return c&&a?.index===m?null:(0,JV.jsx)(DB,{previousClientId:d,nextClientId:h,children:(0,JV.jsx)(GQ,{onClick:()=>{n({rootClientId:i,insertionIndex:m,tab:"patterns",category:"all"}),u(i,m,{operation:"insert"})}})})}var WQ=cBe;var $Q=l(F(),1),KQ=l($(),1);function YQ(){return(0,$Q.useSelect)(e=>{let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getBlock:r,getBlockMode:n,getSettings:i,isTyping:s,isBlockInterfaceHidden:a}=M(e(_)),c=t()||o(),u=r(c),d=!!c&&!!u,f=d&&(0,KQ.isUnmodifiedDefaultBlock)(u,"content")&&n(c)!=="html",m=c&&!s()&&f,h=!a()&&!i().hasFixedToolbar&&!m&&d&&!f;return{showEmptyBlockSideInserter:m,showBlockToolbarPopover:h}},[])}var Yi=l(w(),1);function uBe(e){let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getSettings:r,isTyping:n,isDragging:i,isZoomOut:s,getViewportModalClientIds:a}=M(e(_));return{clientId:t()||o(),hasFixedToolbar:r().hasFixedToolbar,isTyping:n(),isZoomOutMode:s(),isDragging:i(),viewportModalClientIds:a()}}function OS({children:e,__unstableContentRef:t,...o}){let{clientId:r,hasFixedToolbar:n,isTyping:i,isZoomOutMode:s,isDragging:a,viewportModalClientIds:c}=(0,Hg.useSelect)(uBe,[]),u=(0,qQ.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:d,getSelectedBlockClientIds:f,getBlockRootClientId:m,getBlockEditingMode:h,getBlockName:p,isGroupable:g,getEditedContentOnlySection:b,canEditBlock:v}=M((0,Hg.useSelect)(_)),{getGroupingBlockName:k}=(0,Hg.useSelect)(Gg.store),{showEmptyBlockSideInserter:y,showBlockToolbarPopover:S}=YQ(),x=Sg(),[C,B]=(0,_T.useState)(null),{canRename:I}=Rm(p(f()[0])),{duplicateBlocks:P,removeBlocks:E,replaceBlocks:L,insertAfterBlock:T,insertBeforeBlock:O,selectBlock:D,moveBlocksUp:U,moveBlocksDown:G,expandBlock:j,stopEditingContentOnlySection:z,showViewportModal:W,hideViewportModal:ee}=M((0,Hg.useDispatch)(_));function se(re){if(!re.defaultPrevented){if(u("core/block-editor/move-up",re)||u("core/block-editor/move-down",re)){let Q=f();if(Q.length){re.preventDefault();let Y=m(Q[0]);(u("core/block-editor/move-up",re)?"up":"down")==="up"?U(Q,Y):G(Q,Y);let K=Array.isArray(Q)?Q.length:1,H=(0,Wg.sprintf)((0,Wg._n)("%d block moved.","%d blocks moved.",Q.length),K);(0,o3.speak)(H)}}else if(u("core/block-editor/duplicate",re)){let Q=f();Q.length&&(re.preventDefault(),P(Q))}else if(u("core/block-editor/remove",re)){let Q=f();Q.length&&(re.preventDefault(),E(Q))}else if(u("core/block-editor/paste-styles",re)){let Q=f();if(Q.length){re.preventDefault();let Y=d(Q);x(Y)}}else if(u("core/block-editor/insert-after",re)){let Q=f();Q.length&&(re.preventDefault(),T(Q[Q.length-1]))}else if(u("core/block-editor/insert-before",re)){let Q=f();Q.length&&(re.preventDefault(),O(Q[0]))}else if(u("core/block-editor/unselect",re)){if(re.target.closest("[role=toolbar]"))return;let Q=f();Q.length>1&&(re.preventDefault(),D(Q[0]))}else if(u("core/block-editor/collapse-list-view",re)){if((0,e3.isTextField)(re.target)||(0,e3.isTextField)(re.target?.contentWindow?.document?.activeElement))return;re.preventDefault(),j(r)}else if(u("core/block-editor/group",re)){let Q=f();if(Q.length>1&&g(Q)){re.preventDefault();let Y=d(Q),J=k(),K=(0,Gg.switchToBlockType)(Y,J);L(Q,K),(0,o3.speak)((0,Wg.__)("Selected blocks are grouped."))}}else if(u("core/block-editor/rename",re)){let Q=f();if(Q.length===1){let Y=h(Q[0])==="contentOnly";I&&!Y&&v(Q[0])&&(re.preventDefault(),B(Q[0]))}}else if(u("core/block-editor/toggle-block-visibility",re)){let Q=f();if(Q.length){if(re.preventDefault(),!d(Q).every(K=>(0,Gg.hasBlockSupport)(K.name,"visibility",!0))||Q.some(K=>h(K)!=="default"||!v(K)))return;W(Q)}}u("core/block-editor/stop-editing-as-blocks",re)&&b()&&z()}}let ce=pm(t),ie=pm(t);return(0,Yi.jsxs)("div",{...o,onKeyDown:se,className:V(o.className,{"block-editor-block-tools--is-dragging":a}),children:[(0,Yi.jsxs)(mg.Provider,{value:(0,_T.useRef)(!1),children:[!i&&!s&&(0,Yi.jsx)(BY,{__unstableContentRef:t}),y&&(0,Yi.jsx)(Uq,{__unstableContentRef:t,clientId:r}),S&&(0,Yi.jsx)(zQ,{__unstableContentRef:t,clientId:r,isTyping:i}),!s&&!n&&(0,Yi.jsx)(t3.Popover.Slot,{name:"block-toolbar",ref:ce}),e,(0,Yi.jsx)(t3.Popover.Slot,{name:"__unstable-block-tools-after",ref:ie}),s&&!a&&(0,Yi.jsx)(WQ,{__unstableContentRef:t})]}),C&&(0,Yi.jsx)(Im,{clientId:C,onClose:()=>B(null)}),c&&(0,Yi.jsx)(CD,{clientIds:c,onClose:ee})]})}var qi=l(N(),1),Ma=l($(),1),sc=l(F(),1),r3=l(XQ(),1);var dBe=()=>function(){let{replaceBlocks:t,multiSelect:o}=(0,sc.useDispatch)(_),{blocks:r,clientIds:n,canRemove:i,possibleBlockTransformations:s,invalidSelection:a}=(0,sc.useSelect)(h=>{let{getBlockRootClientId:p,getBlockTransformItems:g,getSelectedBlockClientIds:b,getBlocksByClientId:v,canRemoveBlocks:k}=h(_),y=b(),S=v(y);if(S.filter(C=>!C).length>0)return{invalidSelection:!0};let x=p(y[0]);return{blocks:S,clientIds:y,possibleBlockTransformations:g(S,x),canRemove:k(y),invalidSelection:!1}},[]);if(a)return{isLoading:!1,commands:[]};let c=r.length===1&&(0,Ma.isTemplatePart)(r[0]);function u(h){h.length>1&&o(h[0].clientId,h[h.length-1].clientId)}function d(h){let p=(0,Ma.switchToBlockType)(r,h);t(n,p),u(p)}let f=!!s.length&&i&&!c;return!n||n.length<1||!f?{isLoading:!1,commands:[]}:{isLoading:!1,commands:s.map(h=>{let{name:p,title:g,icon:b}=h,v=!b?.src||b?.src==="block-default"?{src:ev}:b;return{name:"core/block-editor/transform-to-"+p.replace("/","-"),label:(0,qi.sprintf)((0,qi.__)("Transform to %s"),g),icon:v?.src,category:"command",callback:({close:k})=>{d(p),k()}}})}},fBe=()=>function(){let{clientIds:t,isUngroupable:o,isGroupable:r}=(0,sc.useSelect)(O=>{let{getSelectedBlockClientIds:D,isUngroupable:U,isGroupable:G}=O(_);return{clientIds:D(),isUngroupable:U(),isGroupable:G()}},[]),{canInsertBlockType:n,getBlockRootClientId:i,getBlocksByClientId:s,canRemoveBlocks:a,isBlockHiddenAnywhere:c}=M((0,sc.useSelect)(_)),{getBlockEditingMode:u}=(0,sc.useSelect)(_),{getDefaultBlockName:d,getGroupingBlockName:f}=(0,sc.useSelect)(Ma.store),m=s(t),h=(0,sc.useDispatch)(_),{removeBlocks:p,replaceBlocks:g,duplicateBlocks:b,insertAfterBlock:v,insertBeforeBlock:k}=h,y=()=>{if(!m.length)return;let O=f(),D=(0,Ma.switchToBlockType)(m,O);D&&g(t,D)},S=()=>{if(!m.length)return;let O=m[0].innerBlocks;O.length&&g(t,O)};if(!t||t.length<1)return{isLoading:!1,commands:[]};let{showViewportModal:x}=M(h),C=i(t[0]),B=n(d(),C),I=m.every(O=>!!O&&(0,Ma.hasBlockSupport)(O.name,"multiple",!0)&&n(O.name,C)),P=a(t),E=[];I&&E.push({name:"duplicate",label:(0,qi.__)("Duplicate"),callback:()=>b(t,!0),icon:Bf}),B&&E.push({name:"add-before",label:(0,qi.__)("Add before"),callback:()=>{let O=Array.isArray(t)?t[0]:O;k(O)},icon:Bi},{name:"add-after",label:(0,qi.__)("Add after"),callback:()=>{let O=Array.isArray(t)?t[t.length-1]:O;v(O)},icon:Bi}),r&&E.push({name:"Group",label:(0,qi.__)("Group"),callback:y,icon:iv}),o&&E.push({name:"ungroup",label:(0,qi.__)("Ungroup"),callback:S,icon:ON}),P&&E.push({name:"remove",label:(0,qi.__)("Delete"),callback:()=>p(t,!0),icon:PN});let L=m.every(O=>!!O&&(0,Ma.hasBlockSupport)(O.name,"visibility",!0)),T=t.every(O=>u(O)==="default");if(L&&T){let O=t.some(D=>c(D));E.push({name:"toggle-visibility",label:O?(0,qi.__)("Show"):(0,qi.__)("Hide"),callback:()=>x(t),icon:O?Lf:vs})}return{isLoading:!1,commands:E.map(O=>({...O,name:"core/block-editor/action-"+O.name,category:"command",callback:({close:D})=>{O.callback(),D()}}))}},xT=()=>{(0,r3.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:dBe()}),(0,r3.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:fBe(),context:"block-selection-edit"})};var Zr=l(w(),1),wT=(0,tJ.createSlotFill)(Symbol("BlockCanvasCover"));function QQ({children:e}){return(0,Zr.jsx)("div",{className:"block-canvas-cover",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},children:e})}var mBe={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function n3({shouldIframe:e=!0,height:t="300px",children:o=(0,Zr.jsx)(Wh,{}),styles:r,contentRef:n,iframeProps:i}){xT();let s=(0,CT.useViewportMatch)("medium","<"),a=nS(),c=gm(),u=(0,JQ.useRef)(),d=(0,CT.useMergeRefs)([n,c,u]),f=(0,eJ.useSelect)(h=>M(h(_)).getZoomLevel(),[]),m=f!==100&&!s?{scale:f,frameSize:"40px"}:{};return e?(0,Zr.jsx)(OS,{__unstableContentRef:u,style:{height:t,display:"flex"},children:(0,Zr.jsxs)(Dh,{...i,...m,ref:a,contentRef:d,style:{...i?.style},name:"editor-canvas",children:[(0,Zr.jsx)(wT.Slot,{fillProps:{containerRef:u},children:h=>h.map((p,g)=>(0,Zr.jsx)(QQ,{children:p},g))}),(0,Zr.jsx)(Ml,{styles:r}),o]})}):(0,Zr.jsxs)(OS,{__unstableContentRef:u,style:{height:t,display:"flex"},children:[(0,Zr.jsx)(wT.Slot,{fillProps:{containerRef:u},children:h=>h.map((p,g)=>(0,Zr.jsx)(QQ,{children:p},g))}),(0,Zr.jsx)(Ml,{styles:r,scope:":where(.editor-styles-wrapper)",transformOptions:mBe}),(0,Zr.jsx)(T1,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%",overflow:"auto"},children:o})]})}function pBe({children:e,height:t,styles:o}){return(0,Zr.jsx)(n3,{height:t,styles:o,children:e})}var oJ=pBe;var Da=l(A(),1),rJ=l(N(),1),nJ=l(it(),1),iJ=l(Re(),1),Zi=l(w(),1),hBe=()=>(0,Zi.jsx)(Da.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,Zi.jsx)(Da.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})}),gBe=({style:e,className:t})=>(0,Zi.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,Zi.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,Zi.jsx)(hBe,{})})}),bBe=({TextColor:e,BackgroundColor:t})=>function({onToggle:r,isOpen:n}){let i=s=>{!n&&s.keyCode===nJ.DOWN&&(s.preventDefault(),r())};return(0,Zi.jsx)(Da.ToolbarGroup,{children:(0,Zi.jsx)(Da.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,rJ.__)("Open Colors Selector"),onClick:r,onKeyDown:i,icon:(0,Zi.jsx)(t,{children:(0,Zi.jsx)(e,{children:(0,Zi.jsx)(gBe,{})})})})})},kBe=({children:e,...t})=>((0,iJ.default)("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,Zi.jsx)(Da.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:bBe(t),renderContent:()=>e})),sJ=kBe;var fee=l(Re(),1),UT=l(A(),1),u3=l(N(),1),mee=l(F(),1),pee=l(R(),1);var Qg=l(Z(),1),zT=l(A(),1),NS=l(F(),1),uee=l(Re(),1),vo=l(R(),1),c3=l(N(),1);var NT=l(A(),1),MT=l(R(),1),DT=l(F(),1);var lJ=l(Z(),1),cJ=l(Xo(),1),uJ=l(F(),1),PT=l(R(),1),$g=l(N(),1);var BT=l(R(),1),ET=(0,BT.createContext)({});ET.displayName="ListViewContext";var pd=()=>(0,BT.useContext)(ET);var TT=l(R(),1),aJ=l(w(),1);function IT({children:e,...t}){let o=(0,TT.useRef)();return(0,TT.useEffect)(()=>{o.current&&(o.current.textContent=o.current.textContent)},[e]),(0,aJ.jsx)("div",{hidden:!0,...t,ref:o,children:e})}var AS=l(w(),1),i3=(0,PT.forwardRef)(({nestingLevel:e,blockCount:t,clientId:o,...r},n)=>{let{insertedBlock:i,setInsertedBlock:s}=pd(),a=(0,lJ.useInstanceId)(i3),{directInsert:c,hideInserter:u}=(0,uJ.useSelect)(p=>{let{getBlockListSettings:g,getTemplateLock:b,isZoomOut:v}=M(p(_)),y=g(o)?.directInsert||!1,S=!!b(o)||v();return{directInsert:y,hideInserter:S}},[o]),d=zr({clientId:o,context:"list-view"}),f=zr({clientId:i?.clientId,context:"list-view"});if((0,PT.useEffect)(()=>{f?.length&&(0,cJ.speak)((0,$g.sprintf)((0,$g.__)("%s block inserted"),f),"assertive")},[f]),u)return null;let m=`list-view-appender__${a}`,h=(0,$g.sprintf)((0,$g.__)("Append to %1$s block at position %2$d, Level %3$d"),d,t+1,e);return(0,AS.jsxs)("div",{className:"list-view-appender",children:[(0,AS.jsx)(Ui,{ref:n,rootClientId:o,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:c,__experimentalIsQuick:!0,...r,toggleProps:{"aria-describedby":m},onSelectOrClose:p=>{p?.clientId&&s(p)}}),(0,AS.jsx)(IT,{id:m,children:h})]})});var bd=l($(),1),Mm=l(A(),1),AT=l(Z(),1);var ko=l(R(),1),Yg=l(F(),1),a3=l(N(),1),LT=l(it(),1),NJ=l(eS(),1),MJ=l(Ps(),1),DJ=l(Xo(),1);var dJ=l(A(),1),fJ=l(Z(),1),mJ=l(R(),1);var pJ=l(w(),1),vBe=R7(dJ.__experimentalTreeGridRow),yBe=(0,mJ.forwardRef)(({isDragged:e,isSelected:t,position:o,level:r,rowCount:n,children:i,className:s,path:a,...c},u)=>{let d=qC({clientId:c["data-block"],enableAnimation:!0,triggerAnimationOnChange:a}),f=(0,fJ.useMergeRefs)([u,d]);return(0,pJ.jsx)(vBe,{ref:f,className:V("block-editor-list-view-leaf",s),level:r,positionInSet:o,setSize:n,isExpanded:void 0,...c,children:i})}),hJ=yBe;var gJ=l(Fe(),1),bJ=l(R(),1);function kJ({isSelected:e,selectedClientIds:t,rowItemRef:o}){let r=t.length===1;(0,bJ.useLayoutEffect)(()=>{if(!e||!r||!o.current)return;let n=(0,gJ.getScrollContainer)(o.current),{ownerDocument:i}=o.current;if(n===i.body||n===i.documentElement||!n)return;let a=o.current.getBoundingClientRect(),c=n.getBoundingClientRect();(a.topc.bottom)&&o.current.scrollIntoView()},[e,r,o])}var EJ=l(R(),1);var hd=l(A(),1),wJ=l(R(),1);var OT=l(it(),1),CJ=l(F(),1);var vJ=l(N(),1),s3=l(w(),1);function RT({onClick:e}){return(0,s3.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,s3.jsx)(we,{icon:(0,vJ.isRTL)()?tv:ou})})}var yJ=l(R(),1),SJ=l(F(),1);var SBe=3,_J={"core/image":({clientId:e,attributes:t})=>{if(t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/cover":({clientId:e,attributes:t})=>{if(t.backgroundType==="image"&&t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/media-text":({clientId:e,attributes:t})=>{if(t.mediaType==="image"&&t.mediaUrl)return{url:t.mediaUrl,alt:t.mediaAlt||"",clientId:e}},"core/gallery":({innerBlocks:e})=>{let t=[],o=e?.length?_J[e[0].name]:void 0;if(!o)return t;for(let r of e){let n=o(r);if(n&&t.push(n),t.length>=SBe)return t}return t}};function _Be(e,t){let o=_J[e.name],r=o?o(e):void 0;return r?Array.isArray(r)?t?[]:r:[r]:[]}function xJ({clientId:e,isExpanded:t}){let{block:o}=(0,SJ.useSelect)(n=>({block:n(_).getBlock(e)}),[e]);return(0,yJ.useMemo)(()=>_Be(o,t),[o,t])}var jo=l(w(),1),{Badge:xBe}=M(hd.privateApis);function wBe({className:e,block:{clientId:t},onClick:o,onContextMenu:r,onMouseDown:n,onToggleExpanded:i,tabIndex:s,onFocus:a,onDragStart:c,onDragEnd:u,draggable:d,isExpanded:f,ariaDescribedBy:m},h){let p=Tt(t),g=zr({clientId:t,context:"list-view"}),{isLocked:b}=ei(t),{hasPatternName:v,blockVisibility:k}=(0,CJ.useSelect)(P=>{let{getBlockAttributes:E}=M(P(_)),L=E(t);return{hasPatternName:!!L?.metadata?.patternName,blockVisibility:L?.metadata?.blockVisibility}},[t]),y=b,S=p?.positionType==="sticky",x=xJ({clientId:t,isExpanded:f}),C=ky(k),B=P=>{P.dataTransfer.clearData(),c?.(P)};function I(P){(P.keyCode===OT.ENTER||P.keyCode===OT.SPACE)&&o(P)}return(0,jo.jsxs)("a",{className:V("block-editor-list-view-block-select-button",e),onClick:o,onContextMenu:r,onKeyDown:I,onMouseDown:n,ref:h,tabIndex:s,onFocus:a,onDragStart:B,onDragEnd:u,draggable:d,href:`#block-${t}`,"aria-describedby":m,"aria-expanded":f,children:[(0,jo.jsx)(RT,{onClick:i}),(0,jo.jsx)(Ae,{icon:v?Ei:p?.icon,showColors:!0,context:"list-view"}),(0,jo.jsxs)(hd.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,jo.jsx)(hd.__experimentalTruncate,{ellipsizeMode:"auto",children:g})}),p?.anchor&&(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,jo.jsx)(xBe,{className:"block-editor-list-view-block-select-button__anchor",children:p.anchor})}),S&&(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,jo.jsx)(we,{icon:ML})}),x.length?(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:x.map((P,E)=>(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${P.url})`,zIndex:x.length-E}},P.clientId))}):null,!!C&&(0,jo.jsx)(hd.Tooltip,{text:C,children:(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__block-visibility","aria-hidden":"true",children:(0,jo.jsx)(we,{icon:vs})})}),y&&(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,jo.jsx)(we,{icon:TL})})]})]})}var BJ=(0,wJ.forwardRef)(wBe);var gd=l(w(),1),CBe=(0,EJ.forwardRef)(({onClick:e,onToggleExpanded:t,block:o,isSelected:r,position:n,siblingBlockCount:i,level:s,isExpanded:a,selectedClientIds:c,...u},d)=>{let{clientId:f}=o,{AdditionalBlockContent:m,insertedBlock:h,setInsertedBlock:p}=pd(),g=c.includes(f)?c:[f];return(0,gd.jsxs)(gd.Fragment,{children:[m&&(0,gd.jsx)(m,{block:o,insertedBlock:h,setInsertedBlock:p}),(0,gd.jsx)(mE,{appendToOwnerDocument:!0,clientIds:g,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:b,onDragStart:v,onDragEnd:k})=>(0,gd.jsx)(BJ,{ref:d,className:"block-editor-list-view-block-contents",block:o,onClick:e,onToggleExpanded:t,isSelected:r,position:n,siblingBlockCount:i,level:s,draggable:b,onDragStart:v,onDragEnd:k,isExpanded:a,...u})})]})}),TJ=CBe;var Nm=l(N(),1),IJ=l(Fe(),1),PJ=(e,t,o)=>(0,Nm.sprintf)((0,Nm.__)("Block %1$d of %2$d, Level %3$d."),e,t,o),RJ=(e,t)=>[e?.positionLabel?`${(0,Nm.sprintf)((0,Nm.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,Nm.__)("This block is locked."):void 0].filter(Boolean).join(" "),OJ=(e,t)=>Array.isArray(t)&&t.length?t.indexOf(e)!==-1:t===e;function AJ(e,t,o,r){let n=[...o,e],i=[...r,t],s=Math.min(n.length,i.length)-1,a=n[s],c=i[s];return{start:a,end:c}}function Kg(e,t){if(!t)return;let o=`[role=row][data-block="${e}"]`;return new Promise(r=>{if(t.querySelector(o))return r(t.querySelector(o));let n=null,i=new window.MutationObserver(()=>{t.querySelector(o)&&(clearTimeout(n),i.disconnect(),r(t.querySelector(o)))});i.observe(t,{childList:!0,subtree:!0}),n=setTimeout(()=>{i.disconnect(),r(null)},3e3)}).then(r=>{r&&r.isConnected&&IJ.focus.focusable.find(r)?.[0]?.focus()})}function LJ({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:o,clientId:r,firstDraggedBlockIndex:n,isDragged:i}){let s,a,c;if(!i){a=!1;let u=e[r];c=u>n,t!=null&&n!==void 0?u!==void 0&&(u>=n&&u=t?s="down":s="normal",a=typeof t=="number"&&t-1===u&&o==="inside"):t===null&&n!==void 0?u!==void 0&&u>=n?s="up":s="normal":t!=null&&n===void 0?u!==void 0&&(u{let{getBlock:to,getBlockName:ye,getSettings:Lt}=M(ue(_));return{block:to(e),blockName:ye(e),allowRightClickOverrides:Lt().allowRightClickOverrides}},[e]),{canRename:Do}=Rm(Wt),rt=(0,bd.hasBlockSupport)(Wt,"__experimentalToolbar",!0),xt=`list-view-block-select-button__description-${(0,AT.useInstanceId)(VJ)}`,{expand:At,collapse:Pe,collapseAll:wt,BlockSettingsMenu:qo,listViewInstanceId:$t,expandedState:lr,setInsertedBlock:ln,treeGridElementRef:je,rootClientId:Eo}=pd(),Ze=(0,MJ.__unstableUseShortcutEventMatch)();function Ve(){let ue=ie(),to=ue.includes(e),ye=to?ue[0]:e,Lt=Q(ye);return{blocksToUpdate:to?ue:[e],firstBlockClientId:ye,firstBlockRootClientId:Lt,selectedBlockClientIds:ue}}async function gt(ue){if(ue.defaultPrevented||ue.target.closest("[role=dialog]"))return;let to=[LT.BACKSPACE,LT.DELETE].includes(ue.keyCode);if(Ze("core/block-editor/unselect",ue)&&g.length>0)ue.stopPropagation(),ue.preventDefault(),a(ue,void 0);else if(to||Ze("core/block-editor/remove",ue)){let{blocksToUpdate:ye,firstBlockClientId:Lt,firstBlockRootClientId:un,selectedBlockClientIds:Sr}=Ve();if(!le(ye))return;let $c=re(Lt)??un;j(ye,!1);let pO=Sr.length>0&&ie().length===0;$c||($c=Y()[0]),Ct($c,pO)}else if(Ze("core/block-editor/paste-styles",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve(),Lt=H(ye);ze(Lt)}else if(Ze("core/block-editor/duplicate",ue)){ue.preventDefault();let{blocksToUpdate:ye,firstBlockRootClientId:Lt}=Ve();if(H(ye).every(Sr=>!!Sr&&(0,bd.hasBlockSupport)(Sr.name,"multiple",!0)&&ce(Sr.name,Lt))){let Sr=await D(ye,!1);Sr?.length&&Ct(Sr[0],!1)}}else if(Ze("core/block-editor/insert-before",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve();await W(ye[0]);let Lt=ie();Ct(Lt[0],!1)}else if(Ze("core/block-editor/insert-after",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve();await z(ye.at(-1));let Lt=ie();Ct(Lt[0],!1)}else if(Ze("core/block-editor/select-all",ue)){ue.preventDefault();let{firstBlockRootClientId:ye,selectedBlockClientIds:Lt}=Ve(),un=Y(ye);if(!un.length)return;if((0,NJ.isShallowEqual)(Lt,un)&&ye&&ye!==Eo){Ct(ye,!0);return}U(un[0],un[un.length-1],null)}else if(Ze("core/block-editor/collapse-list-view",ue)){ue.preventDefault();let{firstBlockClientId:ye}=Ve(),Lt=J(ye,!1);wt(),At(Lt)}else if(Ze("core/block-editor/group",ue)){let{blocksToUpdate:ye}=Ve();if(ye.length>1&&ve(ye)){ue.preventDefault();let Lt=H(ye),un=he(),Sr=(0,bd.switchToBlockType)(Lt,un);G(ye,Sr),(0,DJ.speak)((0,a3.__)("Selected blocks are grouped."));let $c=ie();Ct($c[0],!1)}}else if(Ze("core/block-editor/toggle-block-visibility",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve();if(!H(ye).every(Sr=>(0,bd.hasBlockSupport)(Sr.name,"visibility",!0))||ye.some(Sr=>K(Sr)!=="default"))return;ee(ye)}else if(Ze("core/block-editor/rename",ue)){let{blocksToUpdate:ye}=Ve(),Lt=K(ye[0])==="contentOnly";ye.length===1&&Do&&!Lt&&(ue.preventDefault(),P(!0))}}let To=(0,ko.useCallback)(()=>{x(!0),se(e,!0)},[e,x,se]),cr=(0,ko.useCallback)(()=>{x(!1),se(e,!1)},[e,x,se]),ge=(0,ko.useCallback)(ue=>{a(ue,e),ue.preventDefault()},[e,a]),Ct=(0,ko.useCallback)((ue,to)=>{to&&a(void 0,ue,null,null),Kg(ue,je?.current)},[a,je]),Io=(0,ko.useCallback)(ue=>{ue.preventDefault(),ue.stopPropagation(),p===!0?Pe(e):p===!1&&At(e)},[e,At,Pe,p]),Ke=(0,ko.useCallback)(ue=>{let{ownerDocument:to}=y?.current||{};!to||!to.hasFocus()||rt&&fo&&(y.current?.click(),B(new window.DOMRect(ue.clientX,ue.clientY,0,0)),ue.preventDefault())},[fo,y,rt]),te=(0,ko.useCallback)(ue=>{fo&&ue.button===2&&ue.preventDefault()},[fo]),Le=(0,ko.useMemo)(()=>{let{ownerDocument:ue}=k?.current||{};if(!(!C||!ue))return{ownerDocument:ue,getBoundingClientRect(){return C}}},[C]),ct=(0,ko.useCallback)(()=>{B(void 0)},[B]);if(kJ({isSelected:i,rowItemRef:k,selectedClientIds:g}),!ot)return null;let Wc=PJ(c,f,u),da=RJ(xe,E),Ep=ky(ot?.attributes?.metadata?.blockVisibility),Uk=f>0,gf=m&&Uk,cn=V("block-editor-list-view-block__mover-cell",{"is-visible":S||i}),Tp=V("block-editor-list-view-block__menu-cell",{"is-visible":S||L}),Ip;gf?Ip=2:rt||(Ip=3);let a0=V({"is-selected":i,"is-first-selected":L,"is-last-selected":T,"is-branch-selected":s,"is-synced-branch":b,"is-dragging":r,"has-single-cell":!rt,"is-synced":xe?.isSynced,"is-draggable":ne,"is-displacement-normal":t==="normal","is-displacement-up":t==="up","is-displacement-down":t==="down","is-after-dragged-blocks":o,"is-nesting":n}),l0=g.includes(e)?g:[e],Hk=i&&g.length===1;return(0,er.jsxs)(hJ,{className:a0,isDragged:r,onKeyDown:gt,onMouseEnter:To,onMouseLeave:cr,onFocus:To,onBlur:cr,level:u,position:c,rowCount:d,path:h,id:`list-view-${$t}-block-${e}`,"data-block":e,"data-expanded":X?p:void 0,ref:k,children:[(0,er.jsx)(Mm.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Ip,ref:v,"aria-selected":!!i,children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,er.jsx)(TJ,{block:ot,onClick:ge,onContextMenu:Ke,onMouseDown:te,onToggleExpanded:Io,isSelected:i,position:c,siblingBlockCount:f,level:u,ref:ue,tabIndex:Hk?0:to,onFocus:ye,isExpanded:X?p:void 0,selectedClientIds:g,ariaDescribedBy:xt}),(0,er.jsx)(IT,{id:xt,children:[Wc,da,Ep].filter(Boolean).join(" ")})]})}),gf&&(0,er.jsx)(er.Fragment,{children:(0,er.jsxs)(Mm.__experimentalTreeGridCell,{className:cn,withoutGridItem:!0,children:[(0,er.jsx)(Mm.__experimentalTreeGridItem,{children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsx)(bE,{orientation:"vertical",clientIds:[e],ref:ue,tabIndex:to,onFocus:ye})}),(0,er.jsx)(Mm.__experimentalTreeGridItem,{children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsx)(kE,{orientation:"vertical",clientIds:[e],ref:ue,tabIndex:to,onFocus:ye})})]})}),rt&&qo&&(0,er.jsx)(Mm.__experimentalTreeGridCell,{className:Tp,"aria-selected":!!i,ref:y,children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsx)(qo,{clientIds:l0,block:ot,icon:ks,label:(0,a3.__)("Options"),popoverProps:{anchor:Le},toggleProps:{ref:ue,className:"block-editor-list-view-block__menu",tabIndex:to,onClick:ct,onFocus:ye,size:"small"},disableOpenOnArrowDown:!0,expand:At,expandedState:lr,setInsertedBlock:ln,__experimentalSelectBlock:Ct})}),I&&(0,er.jsx)(Im,{clientId:e,onClose:()=>P(!1)})]})}var FJ=(0,ko.memo)(VJ);var ni=l(w(),1);function zJ(e,t,o,r){return o?.includes(e.clientId)?0:t[e.clientId]??r?1+e.innerBlocks.reduce(BBe(t,o,r),0):1}var BBe=(e,t,o)=>(r,n)=>t?.includes(n.clientId)?r:(e[n.clientId]??o)&&n.innerBlocks.length>0?r+zJ(n,e,t,o):r+1,EBe=()=>{};function jJ(e){let{blocks:t,selectBlock:o=EBe,showBlockMovers:r,selectedClientIds:n,level:i=1,path:s="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:d,parentId:f,shouldShowInnerBlocks:m=!0,isSyncedBranch:h=!1,showAppender:p=!0}=e,g=Tt(f),b=h||!!g?.isSynced,v=(0,DT.useSelect)(O=>f?O(_).canEditBlock(f):!0,[f]),{blockDropPosition:k,blockDropTargetIndex:y,firstDraggedBlockIndex:S,blockIndexes:x,expandedState:C,draggedClientIds:B}=pd(),I=(0,MT.useRef)();if(!v)return null;let P=p&&i===1,E=t.filter(Boolean),L=E.length,T=P?L+1:L;return I.current=c,(0,ni.jsxs)(ni.Fragment,{children:[E.map((O,D)=>{let{clientId:U,innerBlocks:G}=O;D>0&&(I.current+=zJ(E[D-1],C,B,d));let j=!!B?.includes(U),{displacement:z,isAfterDraggedBlocks:W,isNesting:ee}=LJ({blockIndexes:x,blockDropTargetIndex:y,blockDropPosition:k,clientId:U,firstDraggedBlockIndex:S,isDragged:j}),{itemInView:se}=u,ce=se(I.current),ie=D+1,re=s.length>0?`${s}_${ie}`:`${ie}`,Q=!!G?.length,Y=Q&&m?C[U]??d:void 0,J=OJ(U,n),K=a||J&&Q,H=j||ce||J&&U===n[0]||D===0||D===L-1;return(0,ni.jsxs)(DT.AsyncModeProvider,{value:!J,children:[H&&(0,ni.jsx)(FJ,{block:O,selectBlock:o,isSelected:J,isBranchSelected:K,isDragged:j,level:i,position:ie,rowCount:T,siblingBlockCount:L,showBlockMovers:r,path:re,isExpanded:j?!1:Y,listPosition:I.current,selectedClientIds:n,isSyncedBranch:b,displacement:z,isAfterDraggedBlocks:W,isNesting:ee}),!H&&(0,ni.jsx)("tr",{children:(0,ni.jsx)("td",{className:"block-editor-list-view-placeholder"})}),Q&&Y&&!j&&(0,ni.jsx)(jJ,{parentId:U,blocks:G,selectBlock:o,showBlockMovers:r,level:i+1,path:re,listPosition:I.current+1,fixedListWindow:u,isBranchSelected:K,selectedClientIds:n,isExpanded:d,isSyncedBranch:b})]},U)}),P&&(0,ni.jsx)(NT.__experimentalTreeGridRow,{level:i,setSize:T,positionInSet:T,isExpanded:!0,children:(0,ni.jsx)(NT.__experimentalTreeGridCell,{children:O=>(0,ni.jsx)(i3,{clientId:f,nestingLevel:i,blockCount:L,...O})})})]})}var UJ=(0,MT.memo)(jJ);var qg=l(A(),1),VT=l(Fe(),1),ac=l(R(),1),l3=l(N(),1);var Xi=l(w(),1);function HJ({draggedBlockClientId:e,listViewRef:t,blockDropTarget:o}){let r=Tt(e),n=zr({clientId:e,context:"list-view"}),{rootClientId:i,clientId:s,dropPosition:a}=o||{},[c,u]=(0,ac.useMemo)(()=>{if(!t.current)return[];let k=i?t.current.querySelector(`[data-block="${i}"]`):void 0,y=s?t.current.querySelector(`[data-block="${s}"]`):void 0;return[k,y]},[t,i,s]),d=u||c,f=(0,l3.isRTL)(),m=(0,ac.useCallback)((k,y)=>{if(!d)return 0;let S=d.offsetWidth,x=(0,VT.getScrollContainer)(d,"horizontal"),C=d.ownerDocument,B=x===C.body||x===C.documentElement;if(x&&!B){let I=x.getBoundingClientRect(),P=(0,l3.isRTL)()?I.right-k.right:k.left-I.left,E=x.clientWidth;if(EI.right)return S-=k.right-I.right,S}return S-y},[f,d]),h=(0,ac.useMemo)(()=>{if(!d)return{};let k=d.getBoundingClientRect();return{width:m(k,0)}},[m,d]),p=(0,ac.useMemo)(()=>{if(!d)return{};let k=(0,VT.getScrollContainer)(d),y=d.ownerDocument,S=k===y.body||k===y.documentElement;if(k&&!S){let x=k.getBoundingClientRect(),C=d.getBoundingClientRect(),B=f?x.right-C.right:C.left-x.left;if(!f&&x.left>C.left)return{transform:`translateX( ${B}px )`};if(f&&x.right{if(!c)return 1;let k=parseInt(c.getAttribute("aria-level"),10);return k?k+1:1},[c]),b=(0,ac.useMemo)(()=>d?d.classList.contains("is-branch-selected"):!1,[d]),v=(0,ac.useMemo)(()=>{if(!(!d||!(a==="top"||a==="bottom"||a==="inside")))return{contextElement:d,getBoundingClientRect(){let y=d.getBoundingClientRect(),S=y.left,x=0,C=(0,VT.getScrollContainer)(d,"horizontal"),B=d.ownerDocument,I=C===B.body||C===B.documentElement;if(C&&!I){let L=C.getBoundingClientRect(),T=f?C.offsetWidth-C.clientWidth:0;S{}}),(0,Xi.jsx)(Ae,{icon:r?.icon,showColors:!0,context:"list-view"}),(0,Xi.jsx)(qg.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,Xi.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Xi.jsx)(qg.__experimentalTruncate,{ellipsizeMode:"auto",children:n})})})]}),(0,Xi.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}var GJ=l(Xo(),1),Zg=l(N(),1),LS=l(F(),1),WJ=l(R(),1),ii=l(it(),1),$J=l($(),1);function KJ(){let{clearSelectedBlock:e,multiSelect:t,selectBlock:o}=(0,LS.useDispatch)(_),{getBlockName:r,getBlockParents:n,getBlockSelectionStart:i,getSelectedBlockClientIds:s,hasMultiSelection:a,hasSelectedBlock:c}=(0,LS.useSelect)(_),{getBlockType:u}=(0,LS.useSelect)($J.store);return{updateBlockSelection:(0,WJ.useCallback)(async(f,m,h,p)=>{if(!f?.shiftKey&&f?.keyCode!==ii.ESCAPE){o(m,p);return}f.preventDefault();let g=f.type==="keydown"&&f.keyCode===ii.ESCAPE,b=f.type==="keydown"&&(f.keyCode===ii.UP||f.keyCode===ii.DOWN||f.keyCode===ii.HOME||f.keyCode===ii.END);if(!b&&!c()&&!a()){o(m,null);return}let v=s(),k=[...n(m),m];if((g||b&&!v.some(C=>k.includes(C)))&&await e(),!g){let C=i(),B=m;b&&(!c()&&!a()&&(C=m),h&&(B=h));let I=n(C),P=n(B),{start:E,end:L}=AJ(C,B,I,P);await t(E,L,null)}let y=s();if((f.keyCode===ii.HOME||f.keyCode===ii.END)&&y.length>1)return;let S=v.filter(C=>!y.includes(C)),x;if(S.length===1){let C=u(r(S[0]))?.title;C&&(x=(0,Zg.sprintf)((0,Zg.__)("%s deselected."),C))}else S.length>1&&(x=(0,Zg.sprintf)((0,Zg.__)("%s blocks deselected."),S.length));x&&(0,GJ.speak)(x,"assertive")},[e,r,u,n,i,s,a,c,t,o])}}var YJ=l(R(),1);function qJ(e){return(0,YJ.useMemo)(()=>{let o={},r=0,n=i=>{i.forEach(s=>{o[s.clientId]=r,r++,s.innerBlocks.length>0&&n(s.innerBlocks)})};return n(e),o},[e])}var ZJ=l(F(),1);function XJ({blocks:e,rootClientId:t}){return(0,ZJ.useSelect)(o=>{let{getDraggedBlockClientIds:r,getSelectedBlockClientIds:n,getEnabledClientIdsTree:i}=M(o(_));return{selectedClientIds:n(),draggedClientIds:r(),clientIdsTree:e??i(t)}},[e,t])}var QJ=l(R(),1),JJ=l(F(),1);function eee({collapseAll:e,expand:t}){let{expandedBlock:o,getBlockParents:r}=(0,JJ.useSelect)(n=>{let{getBlockParents:i,getExpandedBlock:s}=M(n(_));return{expandedBlock:s(),getBlockParents:i}},[]);(0,QJ.useEffect)(()=>{if(o){let n=r(o,!1);e(),t(n)}},[e,t,o,r])}var tee=l(F(),1),Dm=l(R(),1),Vm=l(Z(),1),oee=l(N(),1);var lc=24;function TBe(e,t,o=1,r=!1){let n=r?t.right-o*lc:t.left+o*lc;return r?e.x>n:e.xn.clientId===r.rootClientId);return o}function ree(e,t){let o=e[t+1];return o&&o.isDraggedBlock?ree(e,t+1):o}function RBe(e,t,o=1,r=!1){let n=r?t.right-o*lc:t.left+o*lc;return(r?e.xn+lc)&&e.y0&&n.isExpanded||RBe(t,s,c.length,o))){let f=n.isExpanded?0:n.innerBlockCount||0;return{rootClientId:n.clientId,clientId:n.clientId,blockIndex:f,dropPosition:"inside"}}if(u&&n.rootClientId&&TBe(t,s,c.length,o)){let f=ree(e,a),m=n.nestingLevel,h=f?f.nestingLevel:1;if(m&&h){let p=IBe(t,s,c.length,o),g=Math.max(Math.min(p,m-h),0);if(c[g]){let b=n.blockIndex;if(c[g].nestingLevel===f?.nestingLevel)b=f?.blockIndex;else for(let v=a;v>=0;v--){let k=e[v];if(k.rootClientId===c[g].rootClientId){b=k.blockIndex+1;break}}return{rootClientId:c[g].rootClientId,clientId:n.clientId,blockIndex:b,dropPosition:r}}}}if(!n.canInsertDraggedBlocksAsSibling)return;let d=u?1:0;return{rootClientId:n.rootClientId,clientId:n.clientId,blockIndex:n.blockIndex+d,dropPosition:r}}var LBe={leading:!1,trailing:!0};function nee({dropZoneElement:e,expandedState:t,setExpandedState:o}){let{getBlockRootClientId:r,getBlockIndex:n,getBlockCount:i,getDraggedBlockClientIds:s,canInsertBlocks:a}=(0,tee.useSelect)(_),[c,u]=(0,Dm.useState)(),{rootClientId:d,blockIndex:f}=c||{},m=GB(d,f),h=(0,oee.isRTL)(),p=(0,Vm.usePrevious)(d),g=(0,Dm.useCallback)((S,x)=>{let{rootClientId:C}=x||{};C&&x?.dropPosition==="inside"&&!S[C]&&o({type:"expand",clientIds:[C]})},[o]),b=(0,Vm.useThrottle)(g,500,LBe);(0,Dm.useEffect)(()=>{if(c?.dropPosition!=="inside"||p!==c?.rootClientId){b.cancel();return}b(t,c)},[t,p,c,b]);let v=s(),k=(0,Vm.useThrottle)((0,Dm.useCallback)((S,x)=>{let C={x:S.clientX,y:S.clientY},B=!!v?.length,P=Array.from(x.querySelectorAll("[data-block]")).map(L=>{let T=L.dataset.block,O=L.dataset.expanded==="true",D=L.classList.contains("is-dragging"),U=parseInt(L.getAttribute("aria-level"),10),G=r(T);return{clientId:T,isExpanded:O,rootClientId:G,blockIndex:n(T),element:L,nestingLevel:U||void 0,isDraggedBlock:B?D:!1,innerBlockCount:i(T),canInsertDraggedBlocksAsSibling:B?a(v,G):!0,canInsertDraggedBlocksAsChild:B?a(v,T):!0}}),E=ABe(P,C,h);E&&u(E)},[a,v,i,n,r,h]),50);return{ref:(0,Vm.__experimentalUseDropZone)({dropZoneElement:e,onDrop(S){k.cancel(),c&&m(S),u(void 0)},onDragLeave(){k.cancel(),u(null)},onDragOver(S){k(S,S.currentTarget)},onDragEnd(){k.cancel(),u(void 0)}}),target:c}}var FT=l(R(),1),iee=l(F(),1);function see({firstSelectedBlockClientId:e,setExpandedState:t}){let[o,r]=(0,FT.useState)(null),{selectedBlockParentClientIds:n}=(0,iee.useSelect)(i=>{let{getBlockParents:s}=i(_);return{selectedBlockParentClientIds:s(e,!1)}},[e]);return(0,FT.useEffect)(()=>{o!==e&&n?.length&&t({type:"expand",clientIds:n})},[e,n,o,t]),{setSelectedTreeId:r}}var Xg=l(F(),1),aee=l(Z(),1);function lee({selectBlock:e}){let t=(0,Xg.useRegistry)(),{getBlockOrder:o,getBlockRootClientId:r,getBlocksByClientId:n,getPreviousBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a,canInsertBlockType:c,canRemoveBlocks:u}=(0,Xg.useSelect)(_),{flashBlock:d,removeBlocks:f,replaceBlocks:m,insertBlocks:h}=(0,Xg.useDispatch)(_),p=Ah();return(0,aee.useRefEffect)(g=>{function b(y,S){S&&e(void 0,y,null,null),Kg(y,g)}function v(y){let S=s(),x=S.includes(y),C=x?S[0]:y,B=r(C);return{blocksToUpdate:x?S:[y],firstBlockClientId:C,firstBlockRootClientId:B,originallySelectedBlockClientIds:S}}function k(y){if(y.defaultPrevented||!g.contains(y.target.ownerDocument.activeElement))return;let x=y.target.ownerDocument.activeElement?.closest("[role=row]")?.dataset?.block;if(!x)return;let{blocksToUpdate:C,firstBlockClientId:B,firstBlockRootClientId:I,originallySelectedBlockClientIds:P}=v(x);if(C.length!==0){if(y.preventDefault(),y.type==="copy"||y.type==="cut"){C.length===1&&d(C[0]),p(y.type,C);let E=n(C);B1(y,E,t)}if(y.type==="cut"){if(!u(C))return;let E=i(B)??I;f(C,!1);let L=P.length>0&&s().length===0;E||(E=o()[0]),b(E,L)}else if(y.type==="paste"){let{__experimentalCanUserUseUnfilteredHTML:E}=a(),L=yG(y,E);if(C.length===1){let[T]=C;if(L.every(O=>c(O.name,T))){h(L,void 0,T),b(L[0]?.clientId,!1);return}}m(C,L,L.length-1,-1),b(L[0]?.clientId,!1)}}}return g.ownerDocument.addEventListener("copy",k),g.ownerDocument.addEventListener("cut",k),g.ownerDocument.addEventListener("paste",k),()=>{g.ownerDocument.removeEventListener("copy",k),g.ownerDocument.removeEventListener("cut",k),g.ownerDocument.removeEventListener("paste",k)}},[])}var cc=l(w(),1),NBe=(e,t)=>t.type==="clear"?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce((o,r)=>({...o,[r]:t.type==="expand"}),{})}:e,cee=32;function dee({id:e,blocks:t,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:n=!1,showAppender:i=!1,blockSettingsMenu:s=PV,rootClientId:a,description:c,onSelect:u,additionalBlockContent:d},f){t&&(0,uee.default)("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});let m=(0,Qg.useInstanceId)(dee),{clientIdsTree:h,draggedClientIds:p,selectedClientIds:g}=XJ({blocks:t,rootClientId:a}),b=qJ(h),{getBlock:v,getSelectedBlockClientIds:k}=(0,NS.useSelect)(_),{visibleBlockCount:y}=(0,NS.useSelect)(X=>{let{getGlobalBlockCount:ne,getClientIdsOfDescendants:le}=X(_),ve=p?.length>0?le(p).length+1:0;return{visibleBlockCount:ne()-ve}},[p]),{updateBlockSelection:S}=KJ(),[x,C]=(0,vo.useReducer)(NBe,{}),[B,I]=(0,vo.useState)(null),{setSelectedTreeId:P}=see({firstSelectedBlockClientId:g[0],setExpandedState:C}),E=(0,vo.useCallback)((X,ne,le)=>{S(X,ne,null,le),P(ne),u&&u(v(ne))},[P,S,u,v]),{ref:L,target:T}=nee({dropZoneElement:o,expandedState:x,setExpandedState:C}),O=(0,vo.useRef)(),D=lee({selectBlock:E}),U=(0,vo.useCallback)(X=>{let[ne]=k();ne&&X&&Kg(ne,X)},[k]),G=(0,Qg.useMergeRefs)([D,U,O,L,f]),j=(0,vo.useCallback)(X=>{if(!X)return;let ne=Array.isArray(X)?X:[X];C({type:"expand",clientIds:ne})},[C]),z=(0,vo.useCallback)(X=>{X&&C({type:"collapse",clientIds:[X]})},[C]),W=(0,vo.useCallback)(()=>{C({type:"clear"})},[C]),ee=(0,vo.useCallback)(X=>{j(X?.dataset?.block)},[j]),se=(0,vo.useCallback)(X=>{z(X?.dataset?.block)},[z]),ce=(0,vo.useCallback)((X,ne,le)=>{X.shiftKey&&S(X,ne?.dataset?.block,le?.dataset?.block)},[S]);eee({collapseAll:W,expand:j});let ie=p?.[0],{blockDropTargetIndex:re,blockDropPosition:Q,firstDraggedBlockIndex:Y}=(0,vo.useMemo)(()=>{let X,ne;if(T?.clientId){let le=b[T.clientId];X=le===void 0||T?.dropPosition==="top"?le:le+1}else T===null&&(X=null);if(ie){let le=b[ie];ne=le===void 0||T?.dropPosition==="top"?le:le+1}return{blockDropTargetIndex:X,blockDropPosition:T?.dropPosition,firstDraggedBlockIndex:ne}},[T,b,ie]),J=(0,vo.useMemo)(()=>({blockDropPosition:Q,blockDropTargetIndex:re,blockIndexes:b,draggedClientIds:p,expandedState:x,expand:j,firstDraggedBlockIndex:Y,collapse:z,collapseAll:W,BlockSettingsMenu:s,listViewInstanceId:m,AdditionalBlockContent:d,insertedBlock:B,setInsertedBlock:I,treeGridElementRef:O,rootClientId:a}),[Q,re,b,p,x,j,Y,z,W,s,m,d,B,I,a]),[K]=(0,Qg.__experimentalUseFixedWindowList)(O,cee,y,{expandedState:x,useWindowing:!0,windowOverscan:40});if(!h.length&&!i)return null;let H=c&&`block-editor-list-view-description-${m}`;return(0,cc.jsxs)(NS.AsyncModeProvider,{value:!0,children:[(0,cc.jsx)(HJ,{draggedBlockClientId:ie,listViewRef:O,blockDropTarget:T}),c&&(0,cc.jsx)(zT.VisuallyHidden,{id:H,children:c}),(0,cc.jsx)(zT.__experimentalTreeGrid,{id:e,className:V("block-editor-list-view-tree",{"is-dragging":p?.length>0&&re!==void 0}),"aria-label":(0,c3.__)("Block navigation structure"),ref:G,onCollapseRow:se,onExpandRow:ee,onFocusRow:ce,applicationAriaLabel:(0,c3.__)("Block navigation structure"),"aria-describedby":H,style:{"--wp-admin--list-view-dragged-items-height":p?.length?`${cee*(p.length-1)}px`:null},children:(0,cc.jsx)(ET.Provider,{value:J,children:(0,cc.jsx)(UJ,{blocks:h,parentId:a,selectBlock:E,showBlockMovers:r,fixedListWindow:K,selectedClientIds:g,isExpanded:n,showAppender:i})})})]})}var MS=(0,vo.forwardRef)(dee),jT=(0,vo.forwardRef)((e,t)=>(0,cc.jsx)(MS,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0}));var kd=l(w(),1);function MBe({isEnabled:e,onToggle:t,isOpen:o,innerRef:r,...n}){return(0,kd.jsx)(UT.Button,{__next40pxDefaultSize:!0,...n,ref:r,icon:av,"aria-expanded":o,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,u3.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}function DBe({isDisabled:e,...t},o){(0,fee.default)("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});let n=(0,mee.useSelect)(i=>!!i(_).getBlockCount(),[])&&!e;return(0,kd.jsx)(UT.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:i,onToggle:s})=>(0,kd.jsx)(MBe,{...t,innerRef:o,isOpen:i,onToggle:s,isEnabled:n}),renderContent:()=>(0,kd.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,kd.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,u3.__)("List view")}),(0,kd.jsx)(jT,{})]})})}var hee=(0,pee.forwardRef)(DBe);var yee=l(R(),1),See=l(F(),1),HT=l(Z(),1),Va=l(A(),1),d3=l(N(),1);var gee=l(R(),1);var bee=l(w(),1);function kee({genericPreviewBlock:e,style:t,className:o,activeStyle:r}){let n=Ig(o,r,t),i=(0,gee.useMemo)(()=>({name:e.name,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:n+" block-editor-block-styles__block-preview-container"},example:e}),[e,t,n]);return(0,bee.jsx)(Q1,{item:i})}var Ws=l(w(),1),vee=()=>{};function VBe({clientId:e,onSwitch:t=vee,onHoverClassName:o=vee}){let r=(0,See.useSelect)(y=>y(_).canEditBlock(e),[e]),{onSelect:n,stylesToRender:i,activeStyle:s,genericPreviewBlock:a,className:c}=Pg({clientId:e,onSwitch:t}),[u,d]=(0,yee.useState)(null),f=(0,HT.useViewportMatch)("medium","<"),m=Ro();if(!r||!i||i.length===0)return null;let h=(0,HT.debounce)(d,250),p=y=>{n(y),o(null),d(null),h.cancel()},g=y=>{if(u===y){h.cancel();return}h(y),o(y?.name??null)},b=JE(i),v=()=>s?.name!==b?.name,k=()=>{p(b)};return(0,Ws.jsx)(Va.__experimentalToolsPanel,{label:(0,d3.__)("Styles"),resetAll:k,panelId:e,hasInnerWrapper:!0,dropdownMenuProps:m,children:(0,Ws.jsx)(Va.__experimentalToolsPanelItem,{hasValue:v,label:(0,d3.__)("Variation"),onDeselect:k,isShownByDefault:!0,panelId:e,children:(0,Ws.jsxs)("div",{className:"block-editor-block-styles",children:[(0,Ws.jsx)("div",{className:"block-editor-block-styles__variants",children:i.map(y=>{let S=y.label||y.name;return(0,Ws.jsx)(Va.Button,{__next40pxDefaultSize:!0,className:V("block-editor-block-styles__item",{"is-active":s.name===y.name}),variant:"secondary",label:S,onMouseEnter:()=>g(y),onFocus:()=>g(y),onMouseLeave:()=>g(null),onBlur:()=>g(null),onClick:()=>p(y),"aria-current":s.name===y.name,children:(0,Ws.jsx)(Va.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:S})},y.name)})}),u&&!f&&(0,Ws.jsx)(Va.Popover,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,Ws.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null),children:(0,Ws.jsx)(kee,{activeStyle:s,className:c,genericPreviewBlock:a,style:u})})})]})})})}var Jg=VBe;var Bee=l(A(),1),eb=l(N(),1);var xee=l(A(),1),wee=l(w(),1),_ee={0:AL,1:UA,2:GA,3:$A,4:YA,5:ZA,6:QA};function f3({level:e}){return _ee[e]?(0,wee.jsx)(xee.Icon,{icon:_ee[e]}):null}var GT=l(w(),1),Cee=[1,2,3,4,5,6],FBe={className:"block-library-heading-level-dropdown"};function Eee({options:e=Cee,value:t,onChange:o}){let r=e.filter(n=>n===0||Cee.includes(n)).sort((n,i)=>n-i);return(0,GT.jsx)(Bee.ToolbarDropdownMenu,{popoverProps:FBe,icon:(0,GT.jsx)(f3,{level:t}),label:(0,eb.__)("Change level"),controls:r.map(n=>{let i=n===t;return{icon:(0,GT.jsx)(f3,{level:n}),title:n===0?(0,eb.__)("Paragraph"):(0,eb.sprintf)((0,eb.__)("Heading %d"),n),isActive:i,onClick(){o(n)},role:"menuitemradio"}})})}var DS=l(N(),1),VS=l(A(),1);var uc=l(w(),1);function zBe({icon:e=SL,label:t=(0,DS.__)("Choose variation"),instructions:o=(0,DS.__)("Select a variation to start with:"),variations:r,onSelect:n,allowSkip:i}){let s=V("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,uc.jsxs)(VS.Placeholder,{icon:e,label:t,instructions:o,className:s,children:[(0,uc.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,DS.__)("Block variations"),children:r.map(a=>(0,uc.jsxs)("li",{children:[(0,uc.jsx)(VS.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:a.icon&&a.icon.src?a.icon.src:a.icon,iconSize:48,onClick:()=>n(a),className:"block-editor-block-variation-picker__variation",label:a.description||a.title}),(0,uc.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:a.title})]},a.name))}),i&&(0,uc.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,uc.jsx)(VS.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>n(),children:(0,DS.__)("Skip")})})]})}var Tee=zBe;var Oee=l(F(),1),Aee=l($(),1),ob=l(A(),1),m3=l(R(),1),p3=l(Z(),1),Lee=l(N(),1);var dc=l(N(),1),tb=l(A(),1);var vd={carousel:"carousel",grid:"grid"};var si=l(w(),1),jBe=({onBlockPatternSelect:e})=>(0,si.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,si.jsx)(tb.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,dc.__)("Choose")})}),UBe=({handlePrevious:e,handleNext:t,activeSlide:o,totalSlides:r})=>(0,si.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,si.jsx)(tb.Button,{size:"compact",icon:(0,dc.isRTL)()?Vo:Nr,label:(0,dc.__)("Previous pattern"),onClick:e,disabled:o===0,accessibleWhenDisabled:!0}),(0,si.jsx)(tb.Button,{size:"compact",icon:(0,dc.isRTL)()?Nr:Vo,label:(0,dc.__)("Next pattern"),onClick:t,disabled:o===r-1,accessibleWhenDisabled:!0})]}),HBe=({viewMode:e,setViewMode:t,handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i,onBlockPatternSelect:s})=>{let a=e===vd.carousel,c=(0,si.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,si.jsx)(tb.Button,{size:"compact",icon:xv,label:(0,dc.__)("Carousel view"),onClick:()=>t(vd.carousel),isPressed:a}),(0,si.jsx)(tb.Button,{size:"compact",icon:nv,label:(0,dc.__)("Grid view"),onClick:()=>t(vd.grid),isPressed:e===vd.grid})]});return(0,si.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[a&&(0,si.jsx)(UBe,{handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i}),c,a&&(0,si.jsx)(jBe,{onBlockPatternSelect:s})]})},Iee=HBe;var Pee=l(F(),1);function GBe(e,t,o){return(0,Pee.useSelect)(r=>{let{getBlockRootClientId:n,getPatternsByBlockTypes:i,__experimentalGetAllowedPatterns:s}=r(_),a=n(e);return o?s(a).filter(o):i(t,a)},[e,t,o])}var Ree=GBe;var zt=l(w(),1),WBe=({viewMode:e,activeSlide:t,patterns:o,onBlockPatternSelect:r,showTitles:n})=>{let i="block-editor-block-pattern-setup__container";if(e===vd.carousel){let s=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,zt.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,zt.jsx)("div",{className:i,children:(0,zt.jsx)("div",{className:"carousel-container",children:o.map((a,c)=>(0,zt.jsx)(Mee,{active:c===t,className:s.get(c)||"",pattern:a},a.name))})})})}return(0,zt.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,zt.jsx)(ob.Composite,{role:"listbox",className:i,"aria-label":(0,Lee.__)("Patterns list"),children:o.map(s=>(0,zt.jsx)(Nee,{pattern:s,onSelect:r,showTitles:n},s.name))})})};function Nee({pattern:e,onSelect:t,showTitles:o}){let r="block-editor-block-pattern-setup-list",{blocks:n,description:i,viewportWidth:s=700}=e,a=(0,p3.useInstanceId)(Nee,`${r}__item-description`);return(0,zt.jsx)("div",{className:`${r}__list-item`,children:(0,zt.jsxs)(ob.Composite.Item,{render:(0,zt.jsx)("div",{"aria-describedby":i?a:void 0,"aria-label":e.title,className:`${r}__item`}),id:`${r}__pattern__${e.name}`,role:"option",onClick:()=>t(n),children:[(0,zt.jsx)(vn,{blocks:n,viewportWidth:s}),o&&(0,zt.jsx)("div",{className:`${r}__item-title`,children:e.title}),!!i&&(0,zt.jsx)(ob.VisuallyHidden,{id:a,children:i})]})})}function Mee({active:e,className:t,pattern:o,minHeight:r}){let{blocks:n,title:i,description:s}=o,a=(0,p3.useInstanceId)(Mee,"block-editor-block-pattern-setup-list__item-description");return(0,zt.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":i,"aria-describedby":s?a:void 0,children:[(0,zt.jsx)(vn,{blocks:n,minHeight:r}),!!s&&(0,zt.jsx)(ob.VisuallyHidden,{id:a,children:s})]})}var $Be=({clientId:e,blockName:t,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:n=vd.carousel,showTitles:i=!1})=>{let[s,a]=(0,m3.useState)(n),[c,u]=(0,m3.useState)(0),{replaceBlock:d}=(0,Oee.useDispatch)(_),f=Ree(e,t,o);if(!f?.length)return null;let h=r||(p=>{let g=p.map(b=>(0,Aee.cloneBlock)(b));d(e,g)});return(0,zt.jsx)(zt.Fragment,{children:(0,zt.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`,children:[(0,zt.jsx)(WBe,{viewMode:s,activeSlide:c,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,zt.jsx)(Iee,{viewMode:s,setViewMode:a,activeSlide:c,totalSlides:f.length,handleNext:()=>{u(p=>Math.min(p+1,f.length-1))},handlePrevious:()=>{u(p=>Math.max(p-1,0))},onBlockPatternSelect:()=>{h(f[c].blocks)}})]})})},Dee=$Be;var h3=l($(),1),fc=l(N(),1),$s=l(A(),1),WT=l(F(),1),Vee=l(R(),1);var Ao=l(w(),1),{Menu:Fm}=M($s.privateApis);function KBe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,Ao.jsxs)("fieldset",{className:e,children:[(0,Ao.jsx)($s.VisuallyHidden,{as:"legend",children:(0,fc.__)("Transform to variation")}),r.map(n=>(0,Ao.jsx)($s.Button,{__next40pxDefaultSize:!0,size:"compact",icon:(0,Ao.jsx)(Ae,{icon:n.icon,showColors:!0}),isPressed:o===n.name,label:o===n.name?n.title:(0,fc.sprintf)((0,fc.__)("Transform to %s"),n.title),onClick:()=>t(n.name),"aria-label":n.title,showTooltip:!0},n.name))]})}function YBe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,Ao.jsx)("div",{className:e,children:(0,Ao.jsxs)(Fm,{children:[(0,Ao.jsx)(Fm.TriggerButton,{render:(0,Ao.jsx)($s.Button,{className:"block-editor-block-variation-transforms__button",__next40pxDefaultSize:!0,variant:"secondary",children:(0,fc.__)("Transform to variation")})}),(0,Ao.jsx)(Fm.Popover,{position:"bottom",children:(0,Ao.jsx)(Fm.Group,{children:r.map(n=>(0,Ao.jsxs)(Fm.RadioItem,{value:n.name,checked:o===n.name,onChange:()=>t(n.name),children:[(0,Ao.jsx)(Fm.ItemLabel,{children:n.title}),n.description&&(0,Ao.jsx)(Fm.ItemHelpText,{children:n.description})]},n.name))})})]})})}function qBe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,Ao.jsx)("div",{className:e,children:(0,Ao.jsx)($s.__experimentalToggleGroupControl,{label:(0,fc.__)("Transform to variation"),value:o,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,children:r.map(n=>(0,Ao.jsx)($s.__experimentalToggleGroupControlOptionIcon,{icon:(0,Ao.jsx)(Ae,{icon:n.icon,showColors:!0}),value:n.name,label:o===n.name?n.title:(0,fc.sprintf)((0,fc.__)("Transform to %s"),n.title)},n.name))})})}function ZBe({blockClientId:e}){let{updateBlockAttributes:t}=(0,WT.useDispatch)(_),{activeBlockVariation:o,variations:r,canEdit:n,isContentOnly:i,isSection:s}=(0,WT.useSelect)(p=>{let{getActiveBlockVariation:g,getBlockVariations:b}=p(h3.store),{getBlockName:v,getBlockAttributes:k,getBlockEditingMode:y,isSectionBlock:S}=M(p(_)),{canEditBlock:x}=p(_),C=e&&v(e),{hasContentRoleAttribute:B}=M(p(h3.store)),I=B(C);return{activeBlockVariation:g(C,k(e),"transform"),variations:C&&b(C,"transform"),canEdit:x(e),isContentOnly:y(e)==="contentOnly"&&!I,isSection:S(e)}},[e]),a=o?.name,c=(0,Vee.useMemo)(()=>{let p=new Set;return r?(r.forEach(g=>{g.icon&&p.add(g.icon?.src||g.icon)}),p.size===r.length):!1},[r]),u=p=>{t(e,{...r.find(({name:g})=>g===p).attributes})};if(!r?.length||!n||i||s)return null;let d="block-editor-block-variation-transforms",m=r.length>6?KBe:qBe;return(0,Ao.jsx)(c?m:YBe,{className:d,onSelectVariation:u,selectedValue:a,variations:r})}var $T=ZBe;var zm=l(N(),1),KT=l(A(),1);var Fee=l(w(),1),g3={top:{icon:kL,title:(0,zm._x)("Align top","Block vertical alignment setting")},center:{icon:aL,title:(0,zm._x)("Align middle","Block vertical alignment setting")},bottom:{icon:iL,title:(0,zm._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:hL,title:(0,zm._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:fL,title:(0,zm._x)("Space between","Block vertical alignment setting")}},XBe=["top","center","bottom"],QBe="top";function JBe({value:e,onChange:t,controls:o=XBe,isCollapsed:r=!0,isToolbar:n}){function i(d){return()=>t(e===d?void 0:d)}let s=g3[e],a=g3[QBe],c=n?KT.ToolbarGroup:KT.ToolbarDropdownMenu,u=n?{isCollapsed:r}:{};return(0,Fee.jsx)(c,{icon:s?s.icon:a.icon,label:(0,zm._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map(d=>({...g3[d],isActive:e===d,role:r?"menuitemradio":void 0,onClick:i(d)})),...u})}var b3=JBe;var k3=l(w(),1),sC=e=>(0,k3.jsx)(b3,{...e,isToolbar:!1}),zee=e=>(0,k3.jsx)(b3,{...e,isToolbar:!0});var Bn=l(A(),1),FS=l(R(),1),ZT=l(N(),1);var jee=l(A(),1);var v3=l(N(),1),Uee=l(w(),1);function Hee({isLinked:e,...t}){let o=e?(0,v3.__)("Unlink radii"):(0,v3.__)("Link radii");return(0,Uee.jsx)(jee.Button,{...t,className:"components-border-radius-control__linked-button",size:"small",icon:e?fn:Ci,iconSize:24,label:o})}var Gee=l(A(),1);function eEe(e){return[...e].sort((o,r)=>e.filter(n=>n===r).length-e.filter(n=>n===o).length).shift()}function Wee(e={}){if(typeof e=="string")return e;let t=Object.values(e).map(a=>{let c=(0,Gee.__experimentalParseQuantityAndUnitFromRawValue)(a);return typeof a=="string"&&c[0]===void 0?[a,""]:c}),o=t.map(a=>a[0]??""),r=t.map(a=>a[1]),n=o.every(a=>a===o[0])?o[0]:"",i=eEe(r);return n===0||n?`${n}${i||""}`:void 0}function $ee(e={}){if(typeof e=="string"||!e||typeof e!="object")return!1;let t=Object.values(e);if(t.length===0)return!1;let o=t[0];return!t.every(n=>n===o)}function Kee(e){return e?typeof e=="string"?!0:!!Object.values(e).filter(o=>!!o||o===0).length:!1}var Qi=l(A(),1),Jee=l(Z(),1),Sd=l(N(),1);var jm=l(R(),1);var y3=24,Yee=8,YT={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rem:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};var yd=(e,t)=>e?.includes?e==="0"||e.includes(`var:preset|${t}|`):!1;function qee(e,t){if(!e)return;if(e==="0"||e==="default")return e;let o=e.match(new RegExp(`var:preset\\|${t}\\|(.+)`));return o?o[1]:void 0}function Zee(e,t,o){if(e===void 0)return 0;let r=parseFloat(e,10)===0?"0":qee(e,o),n=t.findIndex(i=>String(i.slug)===r);return n!==-1?n:NaN}function S3(e,t,o){if(!yd(e,o))return e;let r=parseFloat(e,10)===0?"0":qee(e,o);return t.find(i=>String(i.slug)===r)?.size}function Xee(e,t,o){if(!e||yd(e,o)||e==="0")return e;let r=t.find(n=>String(n.size)===String(e));return r?.slug?`var:preset|${o}|${r.slug}`:e}var rb=l(A(),1),mc=l(w(),1);function Qee({allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:o,minValue:r,parsedQuantity:n,computedUnit:i,units:s,isMixed:a,step:c,max:u,showTooltip:d,value:f,minimumCustomValue:m,onCustomValueChange:h,onCustomValueSliderChange:p,onUnitChange:g,onMouseOut:b,onMouseOver:v,setMinValue:k}){let y=(0,mc.jsx)(rb.__experimentalUnitControl,{className:"preset-input-control__unit-control",disableUnits:a,hideLabelFromVision:!0,label:t,min:r,onChange:h,onUnitChange:g,onBlur:b,onFocus:v,onMouseOut:b,onMouseOver:v,size:"__unstable-large",units:s,value:[n,i].join(""),placeholder:o,onDragStart:()=>{e&&f?.charAt(0)==="-"&&k(0)},onDrag:()=>{e&&f?.charAt(0)==="-"&&k(0)},onDragEnd:()=>{e&&k(m)}});return(0,mc.jsxs)(mc.Fragment,{children:[d?(0,mc.jsx)(rb.Tooltip,{text:t,placement:"top",children:(0,mc.jsx)("div",{className:"preset-input-control__tooltip-wrapper",children:y})}):y,(0,mc.jsx)(rb.RangeControl,{className:"preset-input-control__custom-value-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:u,min:0,onBlur:b,onChange:p,onFocus:v,onMouseOut:b,onMouseOver:v,step:c,value:n,withInputField:!1,__next40pxDefaultSize:!0})]})}var _d=l(w(),1);function Um({allowNegativeOnDrag:e=!1,ariaLabel:t,className:o,customValueSettings:r=YT,disableCustomValues:n,icon:i,isMixed:s,value:a,minimumCustomValue:c,onChange:u,onMouseOut:d,onMouseOver:f,onUnitChange:m,presets:h=[],presetType:p,selectedUnit:g,showTooltip:b,units:v}){let k=(0,jm.useMemo)(()=>Xee(a,h,p),[a,h,p]),y=o??"preset-input-control",S=h.slice(1,h.length-1).map((K,H)=>({value:H+1,label:void 0})),x=S.length>0,C=h.length<=Yee,B=s?(0,Sd.__)("Mixed"):null,[I,P]=(0,jm.useState)(c),[E,L]=(0,jm.useState)(!n&&k!==void 0&&!yd(k,p)),T=null,O=(0,Jee.usePrevious)(k);(0,jm.useEffect)(()=>{k&&O!==k&&!yd(k,p)&&E!==!0&&L(!0)},[k,O,p,E]);let D=!C&&!E&&k!==void 0&&(!yd(k,p)||yd(k,p)&&s),U=h;D?(U=[...h,{name:s?(0,Sd.__)("Mixed"):(0,Sd.sprintf)((0,Sd.__)("Custom (%s)"),k),slug:"custom",size:k}],T=U.length-1):s||(T=E?S3(k,h,p):Zee(k,h,p));let G=U.map((K,H)=>({key:H,name:K.name})),j=yd(k,p)?S3(k,h,p):k,[z,W]=(0,Qi.__experimentalParseQuantityAndUnitFromRawValue)(j),ee=W||g||"px",se=v?.find(K=>K.value===ee),ce=se?.step??r[ee]?.steps??.1,ie=se?.max??r[ee]?.max??10,re=K=>{let X=!isNaN(parseFloat(K))?K:void 0;X!==void 0&&u(X)},Q=K=>{u([K,ee].join(""))},Y=K=>k===void 0?void 0:h[K]?.name,J=(K,H)=>{let X=parseInt(K,10);if(H==="selectList"){if(X===0&&h[0]?.slug==="0")return"0";if(X===0)return}else if(X===0)return"0";return`var:preset|${p}|${h[K]?.slug}`};return(0,_d.jsxs)(Qi.__experimentalHStack,{className:`preset-input-control__wrapper ${y}__wrapper`,children:[i&&(0,_d.jsx)(Qi.Icon,{className:"preset-input-control__icon",icon:i,size:y3}),(!x||E)&&(0,_d.jsx)(Qee,{allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:B,minValue:I,parsedQuantity:z,computedUnit:ee,units:v,isMixed:s,step:ce,max:ie,showTooltip:b,value:k,minimumCustomValue:c,onCustomValueChange:re,onCustomValueSliderChange:Q,onUnitChange:m,onMouseOut:d,onMouseOver:f,setMinValue:P}),x&&C&&!E&&(0,_d.jsx)(Qi.RangeControl,{"aria-valuenow":T,"aria-valuetext":h[T]?.name,className:"preset-input-control__preset-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:h.length-1,marks:S,min:0,onBlur:d,onChange:K=>u(J(K)),onFocus:f,onMouseDown:K=>{K?.nativeEvent?.offsetX<35&&k===void 0&&u("0")},onMouseOut:d,onMouseOver:f,renderTooltipContent:Y,step:1,value:T,withInputField:!1,__next40pxDefaultSize:!0}),x&&!C&&!E&&(0,_d.jsx)(Qi.CustomSelectControl,{className:"preset-input-control__custom-select-control",hideLabelFromVision:!0,label:t,onBlur:d,onChange:K=>{D&&K.selectedItem.key===G.length-1?L(!0):u(J(K.selectedItem.key,"selectList"))},onFocus:f,onMouseOut:d,onMouseOver:f,options:G,size:"__unstable-large",value:G.find(K=>K.key===T)||""}),x&&!n&&(0,_d.jsx)(Qi.Button,{className:"preset-input-control__custom-toggle",icon:nN,iconSize:y3,isPressed:E,label:E?(0,Sd.__)("Use preset"):(0,Sd.__)("Set custom value"),onClick:()=>{L(!E)},size:"small"})]})}var nb=l(N(),1);var ete=8,qT=[],_3={all:(0,nb.__)("Border radius"),topLeft:(0,nb.__)("Top left"),topRight:(0,nb.__)("Top right"),bottomLeft:(0,nb.__)("Bottom left"),bottomRight:(0,nb.__)("Bottom right")},x3={all:lA,topLeft:dA,topRight:fA,bottomLeft:cA,bottomRight:uA},w3=0;var pc=l(w(),1);function tEe(e){let t=e?.default??qT,o=e?.custom??qT,r=e?.theme??qT;return(0,FS.useMemo)(()=>{let n=[{name:(0,ZT.__)("None"),slug:"0",size:0},...o,...r,...t];return n.length>ete?[{name:(0,ZT.__)("Default"),slug:"default",size:void 0},...n]:n},[o,r,t])}function tte(e,t){return t==="all"?Wee(e):typeof e=="string"?e:e?.[t]}function ote(e,t){return t==="all"?e.flat:e[t]}function rte(e,t,o){return r=>{o(e==="all"?{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r}:{...typeof t!="string"?t||{}:{topLeft:t,topRight:t,bottomLeft:t,bottomRight:t},[e]:r})}}function nte(e,t,o){return r=>{let n={...t};e==="all"?(n.flat=r,n.topLeft=r,n.topRight=r,n.bottomLeft=r,n.bottomRight=r):n[e]=r,o(n)}}function XT({onChange:e,values:t,presets:o}){let[r,n]=(0,FS.useState)(!Kee(t)||!$ee(t)),i=tEe(o),[s,a]=(0,FS.useState)({flat:typeof t=="string"?(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[c]=me("spacing.units"),u=(0,Bn.__experimentalUseCustomUnits)({availableUnits:c||["px","em","rem"]}),d=()=>n(!r);return(0,pc.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,pc.jsxs)(Bn.__experimentalHStack,{className:"components-border-radius-control__header",children:[(0,pc.jsx)(Bn.BaseControl.VisualLabel,{as:"legend",children:(0,ZT.__)("Radius")}),(0,pc.jsx)(Hee,{onClick:d,isLinked:r})]}),r?(0,pc.jsx)(Um,{ariaLabel:_3.all,className:"components-border-radius-control",icon:x3.all,minimumCustomValue:w3,onChange:rte("all",t,e),onUnitChange:nte("all",s,a),presets:i,presetType:"border-radius",selectedUnit:ote(s,"all"),showTooltip:!0,units:u,value:tte(t,"all")}):(0,pc.jsx)(Bn.__experimentalVStack,{children:["topLeft","topRight","bottomLeft","bottomRight"].map(f=>(0,pc.jsx)(Um,{ariaLabel:_3[f],className:"components-border-radius-control",icon:x3[f],minimumCustomValue:w3,onChange:rte(f,t,e),onUnitChange:nte(f,s,a),presets:i,presetType:"border-radius",selectedUnit:ote(s,f),showTooltip:!0,units:u,value:tte(t,f)},f))})]})}var ate=l(A(),1);var ite=l(Z(),1);var ste=l(w(),1),QT=(0,ite.createHigherOrderComponent)(e=>function(o){let[r,n,i,s,a]=me("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),c=a?[...n||[],...r||[],...i||[]]:[...n||[],...i||[]],{colors:u=c,disableCustomColors:d=!s}=o,f=u&&u.length>0||!d;return(0,ste.jsx)(e,{...o,colors:u,disableCustomColors:d,hasColorsToChoose:f})},"withColorContext");var lte=QT(ate.ColorPalette);var C3=l(N(),1),Ks=l(A(),1);var yo=l(w(),1),{Tabs:ib}=M(Ks.privateApis),oEe=["colors","disableCustomColors","gradients","disableCustomGradients"],Fa={color:"color",gradient:"gradient"};function cte({colors:e,gradients:t,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,className:i,label:s,onColorChange:a,onGradientChange:c,colorValue:u,gradientValue:d,clearable:f,showTitle:m=!0,enableAlpha:h,headingLevel:p}){let g=a&&(e&&e.length>0||!o),b=c&&(t&&t.length>0||!r);if(!g&&!b)return null;let v={[Fa.color]:(0,yo.jsx)(Ks.ColorPalette,{value:u,onChange:b?y=>{a(y),c()}:a,colors:e,disableCustomColors:o,__experimentalIsRenderedInSidebar:n,clearable:f,enableAlpha:h,headingLevel:p}),[Fa.gradient]:(0,yo.jsx)(Ks.GradientPicker,{value:d,onChange:g?y=>{c(y),a()}:c,gradients:t,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,clearable:f,headingLevel:p})},k=y=>(0,yo.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:v[y]});return(0,yo.jsx)(Ks.BaseControl,{className:V("block-editor-color-gradient-control",i),children:(0,yo.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,yo.jsxs)(Ks.__experimentalVStack,{spacing:1,children:[m&&(0,yo.jsx)("legend",{children:(0,yo.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,yo.jsx)(Ks.BaseControl.VisualLabel,{children:s})})}),g&&b&&(0,yo.jsx)("div",{children:(0,yo.jsxs)(ib,{defaultTabId:d?Fa.gradient:!!g&&Fa.color,children:[(0,yo.jsxs)(ib.TabList,{children:[(0,yo.jsx)(ib.Tab,{tabId:Fa.color,children:(0,C3.__)("Color")}),(0,yo.jsx)(ib.Tab,{tabId:Fa.gradient,children:(0,C3.__)("Gradient")})]}),(0,yo.jsx)(ib.TabPanel,{tabId:Fa.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:v.color}),(0,yo.jsx)(ib.TabPanel,{tabId:Fa.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:v.gradient})]})}),!b&&k(Fa.color),!g&&k(Fa.gradient)]})})})}function rEe(e){let[t,o,r,n]=me("color.palette","color.gradients","color.custom","color.customGradient");return(0,yo.jsx)(cte,{colors:t,gradients:o,disableCustomColors:!r,disableCustomGradients:!n,...e})}function nEe(e){return oEe.every(t=>e.hasOwnProperty(t))?(0,yo.jsx)(cte,{...e}):(0,yo.jsx)(rEe,{...e})}var xd=nEe;var ute=l(w(),1);function dte({onChange:e,value:t,...o}){return(0,ute.jsx)(xd,{...o,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}var Ys=l(N(),1),fte=l(A(),1),mte=l(Xo(),1),B3=l(w(),1);Yc([qc,Ap]);function iEe({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:o,fallbackLinkColor:r,fontSize:n,isLargeText:i,textColor:s,linkColor:a,enableAlphaChecker:c=!1}){let u=e||t;if(!u)return null;let d=s||o,f=a||r;if(!d&&!f)return null;let m=[{color:d,description:(0,Ys.__)("text color")},{color:f,description:(0,Ys.__)("link color")}],h=Bt(u),p=h.alpha()<1,g=h.brightness(),b={level:"AA",size:i||i!==!1&&n>=24?"large":"small"},v="",k="";for(let y of m){if(!y.color)continue;let S=Bt(y.color),x=S.isReadable(h,b),C=S.alpha()<1;if(!x){if(p||C)continue;v=go(r?null:t)}),e&&(0,za.jsx)(sEe,{format:e,onChange:o})]})}function sEe({format:e,onChange:t}){let r=[...[...new Set(["Y-m-d",(0,gr._x)("n/j/Y","short date format"),(0,gr._x)("n/j/Y g:i A","short date format with time"),(0,gr._x)("M j, Y","medium date format"),(0,gr._x)("M j, Y g:i A","medium date format with time"),(0,gr._x)("F j, Y","long date format"),(0,gr._x)("M j","short date format without the year")])].map((a,c)=>({key:`suggested-${c}`,name:(0,zS.dateI18n)(a,wd),format:a})),{key:"human-diff",name:(0,zS.humanTimeDiff)(wd),format:"human-diff"}],n={key:"custom",name:(0,gr.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,gr.__)("Enter your own date format")},[i,s]=(0,eI.useState)(()=>!!e&&!r.some(a=>a.format===e));return(0,za.jsxs)(ai.__experimentalVStack,{children:[(0,za.jsx)(ai.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,gr.__)("Choose a format"),options:[...r,n],value:i?n:r.find(a=>a.format===e)??n,onChange:({selectedItem:a})=>{a===n?s(!0):(s(!1),t(a.format))}}),i&&(0,za.jsx)(ai.TextControl,{__next40pxDefaultSize:!0,label:(0,gr.__)("Custom format"),hideLabelFromVision:!0,help:(0,eI.createInterpolateElement)((0,gr.__)("Enter a date or timeformat string."),{Link:(0,za.jsx)(ai.ExternalLink,{href:(0,gr.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:a=>t(a)})]})}var Ji=l(A(),1),jS=l(N(),1),gte=l(it(),1);var bte=l(Z(),1),ja=l(w(),1);function kte({id:e,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s}){let a;i==="unset"?a=(0,ja.jsx)(Ji.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?a=(0,ja.jsx)(Ji.DuotoneSwatch,{values:i}):a=(0,ja.jsx)(we,{icon:wA});let c=(0,jS.__)("Apply duotone filter"),d=`${(0,bte.useInstanceId)(kte,"duotone-control",e)}__description`;return(0,ja.jsx)(Ji.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,jS.__)("Duotone")},renderToggle:({isOpen:f,onToggle:m})=>(0,ja.jsx)(Ji.ToolbarButton,{showTooltip:!0,onClick:m,"aria-haspopup":"true","aria-expanded":f,onKeyDown:p=>{!f&&p.keyCode===gte.DOWN&&(p.preventDefault(),m())},label:c,icon:a}),renderContent:()=>(0,ja.jsxs)(Ji.MenuGroup,{label:(0,jS.__)("Duotone"),children:[(0,ja.jsx)("p",{children:(0,jS.__)("Create a two-tone color effect without losing your original image.")}),(0,ja.jsx)(Ji.DuotonePicker,{"aria-label":c,"aria-describedby":d,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s})]})})}var tI=kte;var _te=l(A(),1),xte=l(Re(),1),wte=l(R(),1),li=l(N(),1);var tr=l(N(),1);var oI=l(N(),1);function vte(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":t=(0,oI._x)("Regular","font style");break;case"italic":t=(0,oI._x)("Italic","font style");break;case"oblique":t=(0,oI._x)("Oblique","font style");break;default:t=e;break}return{name:t,value:e}}var qs=l(N(),1);function E3(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":case"400":t=(0,qs._x)("Regular","font weight");break;case"bold":case"700":t=(0,qs._x)("Bold","font weight");break;case"100":t=(0,qs._x)("Thin","font weight");break;case"200":t=(0,qs._x)("Extra Light","font weight");break;case"300":t=(0,qs._x)("Light","font weight");break;case"500":t=(0,qs._x)("Medium","font weight");break;case"600":t=(0,qs._x)("Semi Bold","font weight");break;case"800":t=(0,qs._x)("Extra Bold","font weight");break;case"900":t=(0,qs._x)("Black","font weight");break;case"1000":t=(0,qs._x)("Extra Black","font weight");break;default:t=e;break}return{name:t,value:e}}var yte=[{name:(0,tr._x)("Regular","font style"),value:"normal"},{name:(0,tr._x)("Italic","font style"),value:"italic"}],Ste=[{name:(0,tr._x)("Thin","font weight"),value:"100"},{name:(0,tr._x)("Extra Light","font weight"),value:"200"},{name:(0,tr._x)("Light","font weight"),value:"300"},{name:(0,tr._x)("Regular","font weight"),value:"400"},{name:(0,tr._x)("Medium","font weight"),value:"500"},{name:(0,tr._x)("Semi Bold","font weight"),value:"600"},{name:(0,tr._x)("Bold","font weight"),value:"700"},{name:(0,tr._x)("Extra Bold","font weight"),value:"800"},{name:(0,tr._x)("Black","font weight"),value:"900"},{name:(0,tr._x)("Extra Black","font weight"),value:"1000"}];function sb(e){let t=[],o=[],r=[],n=!e||e?.length===0,i=!1;return e?.forEach(s=>{if(typeof s.fontWeight=="string"&&/\s/.test(s.fontWeight.trim())){i=!0;let[u,d]=s.fontWeight.split(" ");u=parseInt(u.slice(0,1)),d==="1000"?d=10:d=parseInt(d.slice(0,1));for(let f=u;f<=d;f++){let m=`${f.toString()}00`;o.some(h=>h.value===m)||o.push(E3(m))}}let a=E3(typeof s.fontWeight=="number"?s.fontWeight.toString():s.fontWeight),c=vte(s.fontStyle);c&&Object.keys(c).length&&(t.some(u=>u.value===c.value)||t.push(c)),a&&Object.keys(a).length&&(o.some(u=>u.value===a.value)||i||o.push(a))}),o.some(s=>s.value>="600")||o.push({name:(0,tr._x)("Bold","font weight"),value:"700"}),t.some(s=>s.value==="italic")||t.push({name:(0,tr._x)("Italic","font style"),value:"italic"}),n&&(t=yte,o=Ste),t=t.length===0?yte:t,o=o.length===0?Ste:o,t.forEach(({name:s,value:a})=>{o.forEach(({name:c,value:u})=>{let d=a==="normal"?c:(0,tr.sprintf)((0,tr._x)("%1$s %2$s","font"),c,s);r.push({key:`${a}-${u}`,name:d,style:{fontStyle:a,fontWeight:u}})})}),{fontStyles:t,fontWeights:o,combinedStyleAndWeightOptions:r,isSystemFont:n,isVariableFont:i}}var Cte=l(w(),1),aEe=(e,t)=>e?t?(0,li.__)("Appearance"):(0,li.__)("Font style"):(0,li.__)("Font weight");function rI(e){let{__next40pxDefaultSize:t=!1,onChange:o,hasFontStyles:r=!0,hasFontWeights:n=!0,fontFamilyFaces:i,value:{fontStyle:s,fontWeight:a},...c}=e,u=r||n,d=aEe(r,n),f={key:"default",name:(0,li.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:m,fontWeights:h,combinedStyleAndWeightOptions:p}=sb(i),g=()=>{let x=[f];return p&&x.push(...p),x},b=()=>{let x=[f];return m.forEach(({name:C,value:B})=>{x.push({key:B,name:C,style:{fontStyle:B,fontWeight:void 0}})}),x},v=()=>{let x=[f];return h.forEach(({name:C,value:B})=>{x.push({key:B,name:C,style:{fontStyle:void 0,fontWeight:B}})}),x},k=(0,wte.useMemo)(()=>r&&n?g():r?b():v(),[e.options,m,h,p]),y=k.find(x=>x.style.fontStyle===s&&x.style.fontWeight===a)||k[0],S=()=>y?r?n?(0,li.sprintf)((0,li.__)("Currently selected font appearance: %s"),y.name):(0,li.sprintf)((0,li.__)("Currently selected font style: %s"),y.name):(0,li.sprintf)((0,li.__)("Currently selected font weight: %s"),y.name):(0,li.__)("No selected font appearance");return!t&&(c.size===void 0||c.size==="default")&&(0,xte.default)("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),u&&(0,Cte.jsx)(_te.CustomSelectControl,{...c,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:d,describedBy:S(),options:k,value:y,onChange:({selectedItem:x})=>o(x.style)})}var Bte=l(A(),1),Ete=l(Re(),1),T3=l(N(),1);var Tte=l(w(),1);function nI({__next40pxDefaultSize:e=!1,value:t="",onChange:o,fontFamilies:r,className:n,...i}){let[s]=me("typography.fontFamilies");if(r||(r=s),!r||r.length===0)return null;let a=[{key:"",name:(0,T3.__)("Default")},...r.map(({fontFamily:u,name:d})=>({key:u,name:d||u,style:{fontFamily:u}}))];!e&&(i.size===void 0||i.size==="default")&&(0,Ete.default)("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});let c=a.find(u=>u.key===t)??"";return(0,Tte.jsx)(Bte.CustomSelectControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,T3.__)("Font"),value:c,onChange:({selectedItem:u})=>o(u.key),options:a,className:V("block-editor-font-family-control",n),...i})}var iI=l(A(),1),Ite=l(Re(),1),Pte=l(N(),1);var Rte=l(w(),1);function sI({__next40pxDefaultSize:e=!1,value:t,onChange:o,__unstableInputWidth:r="60px",...n}){let[i]=me("spacing.units"),s=(0,iI.__experimentalUseCustomUnits)({availableUnits:i||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return!e&&(n.size===void 0||n.size==="default")&&(0,Ite.default)("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,Rte.jsx)(iI.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...n,label:(0,Pte.__)("Letter spacing"),value:t,__unstableInputWidth:r,units:s,onChange:o})}var US=l(N(),1),aI=l(A(),1),I3=l(w(),1),lEe=[{label:(0,US.__)("None"),value:"none",icon:Mr},{label:(0,US.__)("Underline"),value:"underline",icon:OA},{label:(0,US.__)("Strikethrough"),value:"line-through",icon:PA}];function lI({value:e,onChange:t,className:o}){return(0,I3.jsx)(aI.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,US.__)("Decoration"),className:V("block-editor-text-decoration-control",o),value:e,onChange:r=>{t(r===e?void 0:r)},children:lEe.map(r=>(0,I3.jsx)(aI.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var ab=l(N(),1);var cI=l(A(),1),P3=l(w(),1),cEe=[{label:(0,ab.__)("None"),value:"none",icon:Mr},{label:(0,ab.__)("Uppercase"),value:"uppercase",icon:LA},{label:(0,ab.__)("Lowercase"),value:"lowercase",icon:TA},{label:(0,ab.__)("Capitalize"),value:"capitalize",icon:BA}];function uI({className:e,value:t,onChange:o}){return(0,P3.jsx)(cI.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ab.__)("Letter case"),className:V("block-editor-text-transform-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:cEe.map(r=>(0,P3.jsx)(cI.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var lb=l(N(),1);var dI=l(A(),1),R3=l(w(),1),uEe=[{label:(0,lb.__)("Horizontal"),value:"horizontal-tb",icon:BN},{label:(0,lb.__)("Vertical"),value:(0,lb.isRTL)()?"vertical-lr":"vertical-rl",icon:TN}];function fI({className:e,value:t,onChange:o}){return(0,R3.jsx)(dI.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,lb.__)("Orientation"),className:V("block-editor-writing-mode-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:uEe.map(r=>(0,R3.jsx)(dI.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var Xr=l(A(),1),Ote=l(R(),1),Ate=l(N(),1);var Uo=l(w(),1),dEe=({setting:e,children:t,panelId:o,...r})=>{let n=()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()};return(0,Uo.jsx)(Xr.__experimentalToolsPanelItem,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:n,isShownByDefault:e.isShownByDefault!==void 0?e.isShownByDefault:!0,...r,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:e.resetAllFilter,children:t})},fEe=({colorValue:e,label:t})=>(0,Uo.jsxs)(Xr.__experimentalHStack,{justify:"flex-start",children:[(0,Uo.jsx)(Xr.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,Uo.jsx)(Xr.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),mEe=e=>function({onToggle:o,isOpen:r}){let{clearable:n,colorValue:i,gradientValue:s,onColorChange:a,onGradientChange:c,label:u}=e,d=(0,Ote.useRef)(void 0),f={onClick:o,className:V("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r,ref:d},m=()=>{i?a():s&&c()},h=i??s;return(0,Uo.jsxs)(Uo.Fragment,{children:[(0,Uo.jsx)(Xr.Button,{__next40pxDefaultSize:!0,...f,children:(0,Uo.jsx)(fEe,{colorValue:h,label:u})}),n&&h&&(0,Uo.jsx)(Xr.Button,{__next40pxDefaultSize:!0,label:(0,Ate.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:Mr,onClick:()=>{m(),r&&o(),d.current?.focus()}})]})};function mI({colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradients:n,settings:i,__experimentalIsRenderedInSidebar:s,...a}){let c;return s&&(c={placement:"left-start",offset:36,shift:!0}),(0,Uo.jsx)(Uo.Fragment,{children:i.map((u,d)=>{let f={clearable:!1,colorValue:u.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradientValue:u.gradientValue,gradients:n,label:u.label,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...u},m={clearable:u.clearable,label:u.label,colorValue:u.colorValue,gradientValue:u.gradientValue,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange};return u&&(0,Uo.jsx)(dEe,{setting:u,...a,children:(0,Uo.jsx)(Xr.Dropdown,{popoverProps:c,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:mEe(m),renderContent:()=>(0,Uo.jsx)(Xr.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Uo.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,Uo.jsx)(xd,{...f})})})})},d)})})}var pI=l(A(),1),Lte=l(F(),1),Nte=l(Z(),1);var O3=l(R(),1),Hm=l(N(),1);function Cd(){let[e,t,o,r,n,i,s,a,c,u]=me("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),d={disableCustomColors:!e,disableCustomGradients:!i};return d.colors=(0,O3.useMemo)(()=>{let f=[];return o&&o.length&&f.push({name:(0,Hm._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:o}),n&&r&&r.length&&f.push({name:(0,Hm._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:r}),t&&t.length&&f.push({name:(0,Hm._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),f},[t,o,r,n]),d.gradients=(0,O3.useMemo)(()=>{let f=[];return a&&a.length&&f.push({name:(0,Hm._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:a}),u&&c&&c.length&&f.push({name:(0,Hm._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:c}),s&&s.length&&f.push({name:(0,Hm._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:s}),f},[s,a,c,u]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}var Zs=l(w(),1),pEe=["colors","disableCustomColors","gradients","disableCustomGradients"],A3=({className:e,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,children:i,settings:s,title:a,showTitle:c=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:d})=>{let f=(0,Nte.useInstanceId)(A3),{batch:m}=(0,Lte.useRegistry)();return(!t||t.length===0)&&(!o||o.length===0)&&r&&n&&s?.every(h=>(!h.colors||h.colors.length===0)&&(!h.gradients||h.gradients.length===0)&&(h.disableCustomColors===void 0||h.disableCustomColors)&&(h.disableCustomGradients===void 0||h.disableCustomGradients))?null:(0,Zs.jsxs)(pI.__experimentalToolsPanel,{className:V("block-editor-panel-color-gradient-settings",e),label:c?a:void 0,resetAll:()=>{m(()=>{s.forEach(({colorValue:h,gradientValue:p,onColorChange:g,onGradientChange:b})=>{h?g():p&&b()})})},panelId:f,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,Zs.jsx)(mI,{settings:s,panelId:f,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,__experimentalIsRenderedInSidebar:u,enableAlpha:d}),!!i&&(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsx)(pI.__experimentalSpacer,{marginY:4})," ",i]})]})},hEe=e=>{let t=Cd();return(0,Zs.jsx)(A3,{...t,...e})},gEe=e=>pEe.every(t=>e.hasOwnProperty(t))?(0,Zs.jsx)(A3,{...e}):(0,Zs.jsx)(hEe,{...e}),hI=gEe;var gI=l(R(),1),Gm=l(A(),1),N3=l(N(),1);var HS=l(w(),1),L3=[],bEe={...YT,px:{max:1e3,steps:1},em:{max:50,steps:.1},rem:{max:50,steps:.1}};function kEe(e){let t=e?.default??L3,o=e?.custom??L3,r=e?.theme??L3;return(0,gI.useMemo)(()=>[{name:(0,N3.__)("None"),slug:"0",size:0},...o,...r,...t],[o,r,t])}function cb({label:e=(0,N3.__)("Dimension"),onChange:t,value:o}){let[r,n]=me("dimensions.dimensionSizes","spacing.units"),i=(0,Gm.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vh","vw"]}),s=kEe(r),[a,c]=(0,gI.useState)(()=>{let[,d]=(0,Gm.__experimentalParseQuantityAndUnitFromRawValue)(o);return d||i[0]?.value||"px"}),u=d=>{let[f,m]=(0,Gm.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(d)&&m==="px"?t((f/16).toFixed(2)+d):["em","rem"].includes(m)&&d==="px"?t(Math.round(f*16)+d):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(d)&&f>100&&t(100+d),c(d)};return(0,HS.jsxs)("fieldset",{className:"block-editor-dimension-control",children:[(0,HS.jsx)(Gm.BaseControl.VisualLabel,{as:"legend",children:e}),(0,HS.jsx)(Um,{ariaLabel:e,className:"block-editor-dimension-control",customValueSettings:bEe,minimumCustomValue:0,onChange:t,onUnitChange:u,presets:s,presetType:"dimension",selectedUnit:a,showTooltip:!0,units:i,value:o})]})}var Dte=l(R(),1),or=l(A(),1),Vte=l(N(),1),Fte=l(Re(),1);var Ua=l(w(),1),Mte={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function zte({label:e=(0,Vte.__)("Height"),onChange:t,value:o}){(0,Fte.default)("wp.blockEditor.HeightControl",{since:"7.0",version:"7.2",alternative:"wp.blockEditor.DimensionControl"});let r=parseFloat(o),[n]=me("spacing.units"),i=(0,or.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vh","vw"]}),s=(0,Dte.useMemo)(()=>(0,or.__experimentalParseQuantityAndUnitFromRawValue)(o),[o])[1]||i[0]?.value||"px",a=u=>{t([u,s].join(""))},c=u=>{let[d,f]=(0,or.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(u)&&f==="px"?t((d/16).toFixed(2)+u):["em","rem"].includes(f)&&u==="px"?t(Math.round(d*16)+u):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(u)&&d>100&&t(100+u)};return(0,Ua.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,Ua.jsx)(or.BaseControl.VisualLabel,{as:"legend",children:e}),(0,Ua.jsxs)(or.Flex,{children:[(0,Ua.jsx)(or.FlexItem,{isBlock:!0,children:(0,Ua.jsx)(or.__experimentalUnitControl,{value:o,units:i,onChange:t,onUnitChange:c,min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),(0,Ua.jsx)(or.FlexItem,{isBlock:!0,children:(0,Ua.jsx)(or.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,Ua.jsx)(or.RangeControl,{__next40pxDefaultSize:!0,value:r,min:0,max:Mte[s]?.max??100,step:Mte[s]?.step??.1,withInputField:!1,onChange:a,label:e,hideLabelFromVision:!0})})})]})]})}var KS=l(A(),1);var es=l(jr()),foe=l(aoe());function xEe(e,t,o,r,n,i){i===void 0&&(i=0);var s=ub(e,t,i),a=s.width,c=s.height,u=Math.min(a,o),d=Math.min(c,r);return u>d*n?{width:d*n,height:d}:{width:u,height:u/n}}function wEe(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function GS(e,t,o,r,n){n===void 0&&(n=0);var i=ub(t.width,t.height,n),s=i.width,a=i.height;return{x:loe(e.x,s,o.width,r),y:loe(e.y,a,o.height,r)}}function loe(e,t,o,r){var n=t*r/2-o/2;return _I(e,-n,n)}function coe(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function uoe(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function CEe(e,t,o,r,n,i,s){i===void 0&&(i=0),s===void 0&&(s=!0);var a=s?BEe:EEe,c=ub(t.width,t.height,i),u=ub(t.naturalWidth,t.naturalHeight,i),d={x:a(100,((c.width-o.width/n)/2-e.x/n)/c.width*100),y:a(100,((c.height-o.height/n)/2-e.y/n)/c.height*100),width:a(100,o.width/c.width*100/n),height:a(100,o.height/c.height*100/n)},f=Math.round(a(u.width,d.width*u.width/100)),m=Math.round(a(u.height,d.height*u.height/100)),h=u.width>=u.height*r,p=h?{width:Math.round(m*r),height:m}:{width:f,height:Math.round(f/r)},g=Fo(Fo({},p),{x:Math.round(a(u.width-p.width,d.x*u.width/100)),y:Math.round(a(u.height-p.height,d.y*u.height/100))});return{croppedAreaPercentages:d,croppedAreaPixels:g}}function BEe(e,t){return Math.min(e,Math.max(0,t))}function EEe(e,t){return t}function TEe(e,t,o,r,n,i){var s=ub(t.width,t.height,o),a=_I(r.width/s.width*(100/e.width),n,i),c={x:a*s.width/2-r.width/2-s.width*a*(e.x/100),y:a*s.height/2-r.height/2-s.height*a*(e.y/100)};return{crop:c,zoom:a}}function IEe(e,t,o){var r=wEe(t);return o.height>o.width?o.height/(e.height*r):o.width/(e.width*r)}function PEe(e,t,o,r,n,i){o===void 0&&(o=0);var s=ub(t.naturalWidth,t.naturalHeight,o),a=_I(IEe(e,t,r),n,i),c=r.height>r.width?r.height/e.height:r.width/e.width,u={x:((s.width-e.width)/2-e.x)*c,y:((s.height-e.height)/2-e.y)*c};return{crop:u,zoom:a}}function doe(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function REe(e){return e*Math.PI/180}function ub(e,t,o){var r=REe(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function _I(e,t,o){return Math.min(Math.max(e,t),o)}function SI(){for(var e=[],t=0;t0}).join(" ").trim()}var OEe=`.reactEasyCrop_Container { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; user-select: none; touch-action: none; cursor: move; display: flex; justify-content: center; align-items: center; }.reactEasyCrop_Image, .reactEasyCrop_Video { will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */ }.reactEasyCrop_Contain { max-width: 100%; max-height: 100%; margin: auto; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .reactEasyCrop_Cover_Horizontal { width: 100%; height: auto; } .reactEasyCrop_Cover_Vertical { width: auto; height: 100%; }.reactEasyCrop_CropArea { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid rgba(255, 255, 255, 0.5); box-sizing: border-box; box-shadow: 0 0 0 9999em; color: rgba(0, 0, 0, 0.5); overflow: hidden; }.reactEasyCrop_CropAreaRound { border-radius: 50%; }.reactEasyCrop_CropAreaGrid::before { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 0; bottom: 0; left: 33.33%; right: 33.33%; border-top: 0; border-bottom: 0; }.reactEasyCrop_CropAreaGrid::after { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-left: 0; border-right: 0; } `,AEe=1,LEe=3,NEe=1,moe=(function(e){PU(t,e);function t(){var o=e!==null&&e.apply(this,arguments)||this;return o.cropperRef=es.createRef(),o.imageRef=es.createRef(),o.videoRef=es.createRef(),o.containerPosition={x:0,y:0},o.containerRef=null,o.styleRef=null,o.containerRect=null,o.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},o.dragStartPosition={x:0,y:0},o.dragStartCrop={x:0,y:0},o.gestureZoomStart=0,o.gestureRotationStart=0,o.isTouching=!1,o.lastPinchDistance=0,o.lastPinchRotation=0,o.rafDragTimeout=null,o.rafPinchTimeout=null,o.wheelTimer=null,o.currentDoc=typeof document<"u"?document:null,o.currentWindow=typeof window<"u"?window:null,o.resizeObserver=null,o.previousCropSize=null,o.isInitialized=!1,o.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},o.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!o.containerRef)){var r=!0;o.resizeObserver=new window.ResizeObserver(function(n){if(r){r=!1;return}o.computeSizes()}),o.resizeObserver.observe(o.containerRef)}},o.preventZoomSafari=function(r){return r.preventDefault()},o.cleanEvents=function(){o.currentDoc&&(o.currentDoc.removeEventListener("mousemove",o.onMouseMove),o.currentDoc.removeEventListener("mouseup",o.onDragStopped),o.currentDoc.removeEventListener("touchmove",o.onTouchMove),o.currentDoc.removeEventListener("touchend",o.onDragStopped),o.currentDoc.removeEventListener("gesturechange",o.onGestureChange),o.currentDoc.removeEventListener("gestureend",o.onGestureEnd),o.currentDoc.removeEventListener("scroll",o.onScroll))},o.clearScrollEvent=function(){o.containerRef&&o.containerRef.removeEventListener("wheel",o.onWheel),o.wheelTimer&&clearTimeout(o.wheelTimer)},o.onMediaLoad=function(){var r=o.computeSizes();r&&(o.previousCropSize=r,o.emitCropData(),o.setInitialCrop(r),o.isInitialized=!0),o.props.onMediaLoaded&&o.props.onMediaLoaded(o.mediaSize)},o.setInitialCrop=function(r){if(o.props.initialCroppedAreaPercentages){var n=TEe(o.props.initialCroppedAreaPercentages,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=n.crop,s=n.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}else if(o.props.initialCroppedAreaPixels){var a=PEe(o.props.initialCroppedAreaPixels,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=a.crop,s=a.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}},o.computeSizes=function(){var r,n,i,s,a,c,u=o.imageRef.current||o.videoRef.current;if(u&&o.containerRef){o.containerRect=o.containerRef.getBoundingClientRect(),o.saveContainerPosition();var d=o.containerRect.width/o.containerRect.height,f=((r=o.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((n=o.videoRef.current)===null||n===void 0?void 0:n.videoWidth)||0,m=((i=o.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((s=o.videoRef.current)===null||s===void 0?void 0:s.videoHeight)||0,h=u.offsetWidthp?{width:o.containerRect.height*p,height:o.containerRect.height}:{width:o.containerRect.width,height:o.containerRect.width/p};break;case"horizontal-cover":g={width:o.containerRect.width,height:o.containerRect.width/p};break;case"vertical-cover":g={width:o.containerRect.height*p,height:o.containerRect.height};break}else g={width:u.offsetWidth,height:u.offsetHeight};o.mediaSize=Fo(Fo({},g),{naturalWidth:f,naturalHeight:m}),o.props.setMediaSize&&o.props.setMediaSize(o.mediaSize);var b=o.props.cropSize?o.props.cropSize:xEe(o.mediaSize.width,o.mediaSize.height,o.containerRect.width,o.containerRect.height,o.props.aspect,o.props.rotation);return(((a=o.state.cropSize)===null||a===void 0?void 0:a.height)!==b.height||((c=o.state.cropSize)===null||c===void 0?void 0:c.width)!==b.width)&&o.props.onCropSizeChange&&o.props.onCropSizeChange(b),o.setState({cropSize:b},o.recomputeCropPosition),o.props.setCropSize&&o.props.setCropSize(b),b}},o.saveContainerPosition=function(){if(o.containerRef){var r=o.containerRef.getBoundingClientRect();o.containerPosition={x:r.left,y:r.top}}},o.onMouseDown=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("mousemove",o.onMouseMove),o.currentDoc.addEventListener("mouseup",o.onDragStopped),o.saveContainerPosition(),o.onDragStart(t.getMousePoint(r)))},o.onMouseMove=function(r){return o.onDrag(t.getMousePoint(r))},o.onScroll=function(r){o.currentDoc&&(r.preventDefault(),o.saveContainerPosition())},o.onTouchStart=function(r){o.currentDoc&&(o.isTouching=!0,!(o.props.onTouchRequest&&!o.props.onTouchRequest(r))&&(o.currentDoc.addEventListener("touchmove",o.onTouchMove,{passive:!1}),o.currentDoc.addEventListener("touchend",o.onDragStopped),o.saveContainerPosition(),r.touches.length===2?o.onPinchStart(r):r.touches.length===1&&o.onDragStart(t.getTouchPoint(r.touches[0]))))},o.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?o.onPinchMove(r):r.touches.length===1&&o.onDrag(t.getTouchPoint(r.touches[0]))},o.onGestureStart=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("gesturechange",o.onGestureChange),o.currentDoc.addEventListener("gestureend",o.onGestureEnd),o.gestureZoomStart=o.props.zoom,o.gestureRotationStart=o.props.rotation)},o.onGestureChange=function(r){if(r.preventDefault(),!o.isTouching){var n=t.getMousePoint(r),i=o.gestureZoomStart-1+r.scale;if(o.setNewZoom(i,n,{shouldUpdatePosition:!0}),o.props.onRotationChange){var s=o.gestureRotationStart+r.rotation;o.props.onRotationChange(s)}}},o.onGestureEnd=function(r){o.cleanEvents()},o.onDragStart=function(r){var n,i,s=r.x,a=r.y;o.dragStartPosition={x:s,y:a},o.dragStartCrop=Fo({},o.props.crop),(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n)},o.onDrag=function(r){var n=r.x,i=r.y;o.currentWindow&&(o.rafDragTimeout&&o.currentWindow.cancelAnimationFrame(o.rafDragTimeout),o.rafDragTimeout=o.currentWindow.requestAnimationFrame(function(){if(o.state.cropSize&&!(n===void 0||i===void 0)){var s=n-o.dragStartPosition.x,a=i-o.dragStartPosition.y,c={x:o.dragStartCrop.x+s,y:o.dragStartCrop.y+a},u=o.props.restrictPosition?GS(c,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):c;o.props.onCropChange(u)}}))},o.onDragStopped=function(){var r,n;o.isTouching=!1,o.cleanEvents(),o.emitCropData(),(n=(r=o.props).onInteractionEnd)===null||n===void 0||n.call(r)},o.onWheel=function(r){if(o.currentWindow&&!(o.props.onWheelRequest&&!o.props.onWheelRequest(r))){r.preventDefault();var n=t.getMousePoint(r),i=(0,foe.default)(r).pixelY,s=o.props.zoom-i*o.props.zoomSpeed/200;o.setNewZoom(s,n,{shouldUpdatePosition:!0}),o.state.hasWheelJustStarted||o.setState({hasWheelJustStarted:!0},function(){var a,c;return(c=(a=o.props).onInteractionStart)===null||c===void 0?void 0:c.call(a)}),o.wheelTimer&&clearTimeout(o.wheelTimer),o.wheelTimer=o.currentWindow.setTimeout(function(){return o.setState({hasWheelJustStarted:!1},function(){var a,c;return(c=(a=o.props).onInteractionEnd)===null||c===void 0?void 0:c.call(a)})},250)}},o.getPointOnContainer=function(r,n){var i=r.x,s=r.y;if(!o.containerRect)throw new Error("The Cropper is not mounted");return{x:o.containerRect.width/2-(i-n.x),y:o.containerRect.height/2-(s-n.y)}},o.getPointOnMedia=function(r){var n=r.x,i=r.y,s=o.props,a=s.crop,c=s.zoom;return{x:(n+a.x)/c,y:(i+a.y)/c}},o.setNewZoom=function(r,n,i){var s=i===void 0?{}:i,a=s.shouldUpdatePosition,c=a===void 0?!0:a;if(!(!o.state.cropSize||!o.props.onZoomChange)){var u=_I(r,o.props.minZoom,o.props.maxZoom);if(c){var d=o.getPointOnContainer(n,o.containerPosition),f=o.getPointOnMedia(d),m={x:f.x*u-d.x,y:f.y*u-d.y},h=o.props.restrictPosition?GS(m,o.mediaSize,o.state.cropSize,u,o.props.rotation):m;o.props.onCropChange(h)}o.props.onZoomChange(u)}},o.getCropData=function(){if(!o.state.cropSize)return null;var r=o.props.restrictPosition?GS(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop;return CEe(r,o.mediaSize,o.state.cropSize,o.getAspect(),o.props.zoom,o.props.rotation,o.props.restrictPosition)},o.emitCropData=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropComplete&&o.props.onCropComplete(n,i),o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.emitCropAreaChange=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.recomputeCropPosition=function(){if(o.state.cropSize){var r=o.props.crop;if(o.isInitialized&&o.previousCropSize){var n=Math.abs(o.previousCropSize.width-o.state.cropSize.width)>1e-6||Math.abs(o.previousCropSize.height-o.state.cropSize.height)>1e-6;if(n){var i=o.state.cropSize.width/o.previousCropSize.width,s=o.state.cropSize.height/o.previousCropSize.height;r={x:o.props.crop.x*i,y:o.props.crop.y*s}}}var a=o.props.restrictPosition?GS(r,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):r;o.previousCropSize=o.state.cropSize,o.props.onCropChange(a),o.emitCropData()}},o.onKeyDown=function(r){var n,i,s=o.props,a=s.crop,c=s.onCropChange,u=s.keyboardStep,d=s.zoom,f=s.rotation,m=u;if(o.state.cropSize){r.shiftKey&&(m*=.2);var h=Fo({},a);switch(r.key){case"ArrowUp":h.y-=m,r.preventDefault();break;case"ArrowDown":h.y+=m,r.preventDefault();break;case"ArrowLeft":h.x-=m,r.preventDefault();break;case"ArrowRight":h.x+=m,r.preventDefault();break;default:return}o.props.restrictPosition&&(h=GS(h,o.mediaSize,o.state.cropSize,d,f)),r.repeat||(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n),c(h)}},o.onKeyUp=function(r){var n,i;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}o.emitCropData(),(i=(n=o.props).onInteractionEnd)===null||i===void 0||i.call(n)},o}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=OEe,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var o,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(o=this.resizeObserver)===null||o===void 0||o.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(o){var r,n,i,s,a,c,u,d,f;o.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):o.aspect!==this.props.aspect?this.computeSizes():o.objectFit!==this.props.objectFit?this.computeSizes():o.zoom!==this.props.zoom?this.recomputeCropPosition():((r=o.cropSize)===null||r===void 0?void 0:r.height)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.height)||((i=o.cropSize)===null||i===void 0?void 0:i.width)!==((s=this.props.cropSize)===null||s===void 0?void 0:s.width)?this.computeSizes():(((a=o.crop)===null||a===void 0?void 0:a.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((u=o.crop)===null||u===void 0?void 0:u.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),o.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),o.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var m=this.getObjectFit();m!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:m},this.computeSizes)},t.prototype.getAspect=function(){var o=this.props,r=o.cropSize,n=o.aspect;return r?r.width/r.height:n},t.prototype.getObjectFit=function(){var o,r,n,i;if(this.props.objectFit==="cover"){var s=this.imageRef.current||this.videoRef.current;if(s&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var a=this.containerRect.width/this.containerRect.height,c=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,d=c/u;return de>=0?e%360:(360+e%360)%360,MEe=e=>new Promise((t,o)=>{let r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",n=>o(n)),r.setAttribute("crossOrigin","anonymous"),r.src=e});function boe(e){return e*Math.PI/180}function DEe(e,t,o){let r=boe(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}async function koe(e,t,o=0,r={horizontal:!1,vertical:!1}){try{let n=await MEe(e),i=document.createElement("canvas"),s=i.getContext("2d");if(!s)return null;let a=boe(o),{width:c,height:u}=DEe(n.width,n.height,o);i.width=c,i.height=u,s.translate(c/2,u/2),s.rotate(a),s.scale(r.horizontal?-1:1,r.vertical?-1:1),s.translate(-n.width/2,-n.height/2),s.drawImage(n,0,0);let d=document.createElement("canvas"),f=d.getContext("2d");return f?(d.width=t.width,d.height=t.height,f.drawImage(i,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise(m=>{d.toBlob(h=>{h&&m(URL.createObjectURL(h))},"image/jpeg")})):null}catch{return null}}var Km={crop:{x:0,y:0,width:100,height:100},zoom:db,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1}},VEe={x:0,y:0},G3={crop:VEe,croppedArea:Km.crop,croppedAreaPixels:null,zoom:Km.zoom,rotation:Km.rotation,flip:Km.flip,aspectRatio:Km.aspectRatio,mediaSize:null};function voe(){let[e,t]=(0,Xs.useState)(G3),[o,r]=(0,Xs.useState)(null),n=(0,Xs.useCallback)(u=>{t(d=>{let m={...typeof u=="function"?u(d):u};return"rotation"in m&&m.rotation!==void 0&&(m.rotation=xI(m.rotation)),{...d,...m}})},[]),i=(0,Xs.useCallback)((u=null)=>{if(!u){r(null),n(G3);return}if(typeof u=="object"){let d={...Km,...u};r(d),n(d)}},[n,r]),s=(0,Xs.useCallback)(()=>{if(o){let u={crop:{x:0,y:0},croppedAreaPixels:null};o.crop&&(u.croppedArea=o.crop),o.zoom!==void 0&&(u.zoom=o.zoom),o.rotation!==void 0&&(u.rotation=o.rotation),o.aspectRatio!==void 0&&(u.aspectRatio=o.aspectRatio),o.flip!==void 0&&(u.flip=o.flip),n(u)}else n({...G3})},[o,n]),a=(0,Xs.useMemo)(()=>{if(o){let d={crop:e.croppedAreaPixels||e.croppedArea,zoom:e.zoom,rotation:xI(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return $m(d,o)===!1}let u={crop:e.croppedArea,zoom:e.zoom,rotation:xI(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return $m(u,Km)===!1},[e,o]),c=(0,Xs.useCallback)(async u=>e.croppedAreaPixels?koe(u,e.croppedAreaPixels,e.rotation,e.flip):null,[e.croppedAreaPixels,e.rotation,e.flip]);return(0,Xs.useMemo)(()=>({cropperState:e,setCropperState:n,resetState:o,setResetState:i,isDirty:a,reset:s,getCroppedImage:c}),[e,n,o,i,a,s,c])}var yoe=l(w(),1),Soe=(0,fb.createContext)({cropperState:{crop:{x:0,y:0},croppedArea:{x:0,y:0,width:100,height:100},croppedAreaPixels:null,zoom:db,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1},mediaSize:null},setCropperState:()=>{},resetState:null,setResetState:()=>{},isDirty:!1,reset:()=>{},getCroppedImage:()=>Promise.resolve(null)});function W3({children:e}){let t=voe(),o=(0,fb.useMemo)(()=>({...t}),[t]);return(0,yoe.jsx)(Soe.Provider,{value:o,children:e})}var WS=()=>{let e=(0,fb.useContext)(Soe);if(!e)throw new Error("Missing ImageCropperContext");return e};var xoe=l(w(),1);function $3({src:e,onLoad:t,minZoom:o=db,maxZoom:r=goe,...n}){let{cropperState:i,setCropperState:s}=WS(),{crop:a,zoom:c,rotation:u,aspectRatio:d,flip:f}=i,m=v=>s({crop:v}),h=v=>s({zoom:v}),p=v=>s({rotation:v}),g=v=>s({mediaSize:v}),b=(0,_oe.useCallback)((v,k)=>{s({croppedArea:v,croppedAreaPixels:k})},[s]);return(0,xoe.jsx)(moe,{classes:{containerClassName:"image-cropper__container",cropAreaClassName:"image-cropper__crop-area",mediaClassName:"image-cropper__image"},minZoom:o,maxZoom:r,rotation:u,image:e,setMediaSize:g,crop:a,zoom:c,aspect:d,onCropChange:m,onZoomChange:h,onCropComplete:b,onMediaLoaded:v=>{t?.(v)},onRotationChange:p,transform:[`translate(${a.x}px, ${a.y}px)`,`rotateZ(${u}deg)`,`rotateY(${f.horizontal?180:0}deg)`,`rotateX(${f.vertical?180:0}deg)`,`scale(${c})`].join(" "),...n})}var hb=l(A(),1),pb=l(N(),1);var woe=100,Coe=300,wI={placement:"bottom-start"};var mb=l(R(),1);var CI=l(F(),1),Ym=l(R(),1),gc=l(N(),1),Boe=l(Un(),1),Eoe=l(Fe(),1);var FEe={crop:(0,gc.__)("Image cropped."),rotate:(0,gc.__)("Image rotated."),cropAndRotate:(0,gc.__)("Image cropped and rotated.")};function Toe({crop:e,rotation:t,url:o,id:r,onSaveImage:n,onFinishEditing:i}){let{createErrorNotice:s,createSuccessNotice:a}=(0,CI.useDispatch)(Boe.store),[c,u]=(0,Ym.useState)(!1),{editMediaEntity:d}=(0,CI.useSelect)(h=>({editMediaEntity:h(_).getSettings()?.[x0]}),[]),f=(0,Ym.useCallback)(()=>{u(!1),i()},[i]),m=(0,Ym.useCallback)(async()=>{if(!d){i(),s((0,gc.__)("Sorry, you are not allowed to edit images on this site."),{id:"image-editing-error",type:"snackbar"});return}u(!0);let h=[];if(t>0&&h.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&h.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),h.length===0){u(!1),i();return}let p=h.length===1?h[0].type:"cropAndRotate";try{let g=await d(r,{src:o,modifiers:h},{throwOnError:!0});g&&(n({id:g.id,url:g.source_url}),a(FEe[p],{type:"snackbar",actions:[{label:(0,gc.__)("Undo"),onClick:()=>{n({id:r,url:o})}}]}))}catch(g){s((0,gc.sprintf)((0,gc.__)("Could not edit image. %s"),(0,Eoe.__unstableStripHTML)(g.message)),{id:"image-editing-error",type:"snackbar"})}finally{u(!1),i()}},[e,t,r,o,n,s,a,i,d]);return(0,Ym.useMemo)(()=>({isInProgress:c,apply:m,cancel:f}),[c,m,f])}var Qs=l(R(),1),Ioe=l(ut(),1);function Poe({url:e,naturalWidth:t,naturalHeight:o}){let[r,n]=(0,Qs.useState)(),{cropperState:i,setCropperState:s}=WS(),{zoom:a,aspectRatio:c,crop:u,croppedArea:d}=i,f=(0,Qs.useCallback)(k=>{s({zoom:k})},[s]),m=(0,Qs.useCallback)(k=>{s({aspectRatio:k})},[s]),h=t/o,p=o/t;(0,Qs.useEffect)(()=>{m(h)},[]);let[g,b]=(0,Qs.useState)(0),v=(0,Qs.useCallback)(()=>{let k=(g+90)%360,y=h,x=a!==1||!(h===c||p===c);if(g%180===90&&(y=1/h),k===0){n(),b(k),s({aspectRatio:x?c:h,crop:{x:-(u.y*y),y:u.x*y}});return}function C(P){let E=document.createElement("canvas"),L=0,T=0;k%180?(E.width=P.target.height,E.height=P.target.width):(E.width=P.target.width,E.height=P.target.height),(k===90||k===180)&&(L=E.width),(k===270||k===180)&&(T=E.height);let O=E.getContext("2d");O.translate(L,T),O.rotate(k*Math.PI/180),O.drawImage(P.target,0,0),E.toBlob(D=>{n(URL.createObjectURL(D)),b(k);let U=x?c:E.width/E.height;s({aspectRatio:U,crop:{x:-(u.y*y),y:u.x*y}})})}let B=new window.Image;B.src=e,B.onload=C;let I=(0,Ioe.applyFilters)("media.crossOrigin",void 0,e);typeof I=="string"&&(B.crossOrigin=I)},[g,h,e,s,u,a,c,p,b]);return(0,Qs.useMemo)(()=>({editedUrl:r,setEditedUrl:n,crop:d,zoom:a,setZoom:f,rotation:g,rotateClockwise:v,aspect:c,setAspect:m,defaultAspect:h}),[r,d,a,f,g,v,c,m,h])}var Roe=l(w(),1),K3=(0,mb.createContext)({});K3.displayName="ImageEditingContext";var Ha=()=>(0,mb.useContext)(K3);function Ooe({id:e,url:t,naturalWidth:o,naturalHeight:r,onFinishEditing:n,onSaveImage:i,children:s}){let a=Poe({url:t,naturalWidth:o,naturalHeight:r}),c=Toe({id:e,url:t,onSaveImage:i,onFinishEditing:n,...a}),u=(0,mb.useMemo)(()=>({...a,...c}),[a,c]);return(0,Roe.jsx)(K3.Provider,{value:u,children:s})}var ts=l(w(),1);function BI({aspectRatios:e,isDisabled:t,label:o,onClick:r,value:n}){return(0,ts.jsx)(hb.MenuGroup,{label:o,children:e.map(({name:i,slug:s,ratio:a})=>(0,ts.jsx)(hb.MenuItem,{disabled:t,onClick:()=>{r(a)},role:"menuitemradio",isSelected:a===n,icon:a===n?bl:void 0,children:i},s))})}function zEe(e){let[t,o,...r]=e.split("/").map(Number);return t<=0||o<=0||Number.isNaN(t)||Number.isNaN(o)||r.length?NaN:o?t/o:t}function Y3({ratio:e,...t}){return{ratio:zEe(e),...t}}function Aoe({toggleProps:e}){let{isInProgress:t,aspect:o,setAspect:r,defaultAspect:n}=Ha(),[i,s,a]=me("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,ts.jsx)(hb.DropdownMenu,{icon:UO,label:(0,pb.__)("Aspect Ratio"),popoverProps:wI,toggleProps:e,children:({onClose:c})=>(0,ts.jsxs)(ts.Fragment,{children:[(0,ts.jsx)(BI,{isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:[{slug:"original",name:(0,pb.__)("Original"),ratio:n},...a?i.map(Y3).filter(({ratio:u})=>u===1):[]]}),s?.length>0&&(0,ts.jsx)(BI,{label:(0,pb.__)("Theme"),isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:s}),a&&(0,ts.jsx)(BI,{label:(0,pb.__)("Landscape"),isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:i.map(Y3).filter(({ratio:u})=>u>1)}),a&&(0,ts.jsx)(BI,{label:(0,pb.__)("Portrait"),isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:i.map(Y3).filter(({ratio:u})=>u<1)})]})})}var Loe=l(A(),1),Noe=l(Z(),1);var Bd=l(w(),1);function Moe({url:e,width:t,height:o,naturalHeight:r,naturalWidth:n,borderProps:i}){let{isInProgress:s,editedUrl:a,rotation:c}=Ha(),[u,{width:d}]=(0,Noe.useResizeObserver)(),f=o||d*r/n;c%180===90&&(f=d*n/r);let m=(0,Bd.jsxs)("div",{className:V("wp-block-image__crop-area",i?.className,{"is-applying":s}),style:{...i?.style,width:t||d,height:f},children:[(0,Bd.jsx)($3,{src:a||e}),s&&(0,Bd.jsx)(Loe.Spinner,{})]});return(0,Bd.jsxs)(Bd.Fragment,{children:[u,m]})}var Ed=l(A(),1),q3=l(N(),1);var $S=l(w(),1);function Doe(){let{isInProgress:e,zoom:t,setZoom:o}=Ha();return(0,$S.jsx)(Ed.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:wI,renderToggle:({isOpen:r,onToggle:n})=>(0,$S.jsx)(Ed.ToolbarButton,{icon:oN,label:(0,q3.__)("Zoom"),onClick:n,"aria-expanded":r,disabled:e}),renderContent:()=>(0,$S.jsx)(Ed.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,$S.jsx)(Ed.RangeControl,{__next40pxDefaultSize:!0,label:(0,q3.__)("Zoom"),min:woe,max:Coe,value:Math.round(t*100),onChange:r=>o(r/100)})})})}var Voe=l(A(),1),Foe=l(N(),1);var zoe=l(w(),1);function joe(){let{isInProgress:e,rotateClockwise:t}=Ha();return(0,zoe.jsx)(Voe.ToolbarButton,{icon:QL,label:(0,Foe.__)("Rotate"),onClick:t,disabled:e})}var Z3=l(A(),1),X3=l(N(),1);var qm=l(w(),1);function Uoe(){let{isInProgress:e,apply:t,cancel:o}=Ha();return(0,qm.jsxs)(qm.Fragment,{children:[(0,qm.jsx)(Z3.ToolbarButton,{onClick:t,disabled:e,children:(0,X3.__)("Apply")}),(0,qm.jsx)(Z3.ToolbarButton,{onClick:o,children:(0,X3.__)("Cancel")})]})}var ci=l(w(),1);function Hoe({id:e,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i,onSaveImage:s,onFinishEditing:a,borderProps:c}){return(0,ci.jsx)(W3,{children:(0,ci.jsxs)(Ooe,{id:e,url:t,naturalWidth:i,naturalHeight:n,onSaveImage:s,onFinishEditing:a,children:[(0,ci.jsx)(Moe,{borderProps:c,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i}),(0,ci.jsxs)(Mt,{children:[(0,ci.jsxs)(KS.ToolbarGroup,{children:[(0,ci.jsx)(Doe,{}),(0,ci.jsx)(KS.ToolbarItem,{children:u=>(0,ci.jsx)(Aoe,{toggleProps:u})}),(0,ci.jsx)(joe,{})]}),(0,ci.jsx)(KS.ToolbarGroup,{children:(0,ci.jsx)(Uoe,{})})]})]})})}var ui=l(A(),1),Td=l(N(),1);var gb=l(R(),1);function Goe(e,t,o,r,n){let[i,s]=(0,gb.useState)(t??r??""),[a,c]=(0,gb.useState)(e??o??"");return(0,gb.useEffect)(()=>{t===void 0&&r!==void 0&&s(r),e===void 0&&o!==void 0&&c(o)},[r,o]),(0,gb.useEffect)(()=>{t!==void 0&&Number.parseInt(t)!==Number.parseInt(i)&&s(t),e!==void 0&&Number.parseInt(e)!==Number.parseInt(a)&&c(e)},[t,e]),{currentHeight:a,currentWidth:i,updateDimension:(f,m)=>{let h=m===""?void 0:parseInt(m,10);f==="width"?s(h):c(h),n({[f]:h})},updateDimensions:(f,m)=>{c(f??o),s(m??r),n({height:f,width:m})}}}var os=l(w(),1),Woe=[25,50,75,100],jEe=()=>{};function $oe(e,t,o){let r=Math.round(t*(e/100)),n=Math.round(o*(e/100));return{scaledWidth:r,scaledHeight:n}}function Koe({imageSizeHelp:e,imageWidth:t,imageHeight:o,imageSizeOptions:r=[],isResizable:n=!0,slug:i,width:s,height:a,onChange:c,onChangeImage:u=jEe}){let{currentHeight:d,currentWidth:f,updateDimension:m,updateDimensions:h}=Goe(a,s,o,t,c),p=b=>{if(b===void 0){h();return}let{scaledWidth:v,scaledHeight:k}=$oe(b,t,o);h(k,v)},g=Woe.find(b=>{let{scaledWidth:v,scaledHeight:k}=$oe(b,t,o);return f===v&&d===k});return(0,os.jsxs)(ui.__experimentalVStack,{className:"block-editor-image-size-control",spacing:"4",children:[r&&r.length>0&&(0,os.jsx)(ui.SelectControl,{label:(0,Td.__)("Resolution"),value:i,options:r,onChange:u,help:e,size:"__unstable-large"}),n&&(0,os.jsxs)(os.Fragment,{children:[(0,os.jsxs)(ui.__experimentalHStack,{align:"baseline",spacing:"4",children:[(0,os.jsx)(ui.__experimentalNumberControl,{label:(0,Td.__)("Width"),value:f,min:1,onChange:b=>m("width",b),size:"__unstable-large"}),(0,os.jsx)(ui.__experimentalNumberControl,{label:(0,Td.__)("Height"),value:d,min:1,onChange:b=>m("height",b),size:"__unstable-large"})]}),(0,os.jsx)(ui.__experimentalToggleGroupControl,{label:(0,Td.__)("Image size presets"),hideLabelFromVision:!0,onChange:p,value:g,isBlock:!0,__next40pxDefaultSize:!0,children:Woe.map(b=>(0,os.jsx)(ui.__experimentalToggleGroupControlOption,{value:b,label:(0,Td.sprintf)((0,Td.__)("%d%%"),b)},b))})]})]})}var EI=l(A(),1);var Zm=l(N(),1),qoe=l(w(),1),Yoe={left:nu,center:ru,right:iu,"space-between":zp,stretch:jp};function UEe({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:o,value:r,popoverProps:n,isToolbar:i}){let s=f=>{o(f===r?void 0:f)},a=r?Yoe[r]:Yoe.left,c=[{name:"left",icon:nu,title:(0,Zm.__)("Justify items left"),isActive:r==="left",onClick:()=>s("left")},{name:"center",icon:ru,title:(0,Zm.__)("Justify items center"),isActive:r==="center",onClick:()=>s("center")},{name:"right",icon:iu,title:(0,Zm.__)("Justify items right"),isActive:r==="right",onClick:()=>s("right")},{name:"space-between",icon:zp,title:(0,Zm.__)("Space between items"),isActive:r==="space-between",onClick:()=>s("space-between")},{name:"stretch",icon:jp,title:(0,Zm.__)("Stretch items"),isActive:r==="stretch",onClick:()=>s("stretch")}],u=i?EI.ToolbarGroup:EI.ToolbarDropdownMenu,d=i?{isCollapsed:t}:{};return(0,qoe.jsx)(u,{icon:a,popoverProps:n,label:(0,Zm.__)("Change items justification"),controls:c.filter(f=>e.includes(f.name)),...d})}var Q3=UEe;var J3=l(w(),1),lh=e=>(0,J3.jsx)(Q3,{...e,isToolbar:!1}),Zoe=e=>(0,J3.jsx)(Q3,{...e,isToolbar:!0});var Qr=l(A(),1),Js=l(N(),1),no=l(R(),1),jre=l(Z(),1),Ure=l(Fe(),1),Hre=l(it(),1),Gre=l(eS(),1),jI=l(F(),1),lF=l(Xp(),1);var Wre=l(Re(),1),UI=l(dn(),1);var bb=l(A(),1);var TI=l(Z(),1),II=l(N(),1),Xoe=l(R(),1),bc=l(w(),1);function Qoe({children:e,settingsOpen:t,setSettingsOpen:o}){let r=(0,TI.useReducedMotion)(),n=r?Xoe.Fragment:bb.__unstableAnimatePresence,i=r?"div":bb.__unstableMotion.div,a=`link-control-settings-drawer-${(0,TI.useInstanceId)(Qoe)}`;return(0,bc.jsxs)(bc.Fragment,{children:[(0,bc.jsx)(bb.Button,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":t,onClick:()=>o(!t),icon:(0,II.isRTL)()?tv:ou,"aria-controls":a,children:(0,II._x)("Advanced","Additional link settings")}),(0,bc.jsx)(n,{children:t&&(0,bc.jsx)(i,{className:"block-editor-link-control__drawer",hidden:!t,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,bc.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:e})})})]})}var Joe=Qoe;var NI=l(R(),1),sF=l(N(),1),kre=l(Re(),1);var YS=l(N(),1),ure=l(A(),1);var PI=l(N(),1),ere=l(A(),1),tre=l(R(),1);var eF=l(w(),1),HEe=({searchTerm:e,onClick:t,itemProps:o,buttonText:r})=>{if(!e)return null;let n;return r?n=typeof r=="function"?r(e):r:n=(0,tre.createInterpolateElement)((0,PI.sprintf)((0,PI.__)("Create: %s"),e),{mark:(0,eF.jsx)("mark",{})}),(0,eF.jsx)(ere.MenuItem,{...o,iconPosition:"left",icon:Bi,className:"block-editor-link-control__search-item",onClick:t,children:n})},ore=HEe;var kc=l(N(),1),OI=l(A(),1);var rre=l(Fe(),1),vb=l(dn(),1),nre=l(Z(),1),ire=l(Re(),1),kb=l(w(),1),RI={post:{icon:KL,label:(0,kc.__)("Post")},page:{icon:vl,label:(0,kc.__)("Page")},post_tag:{icon:wN,label:(0,kc.__)("Tag")},category:{icon:KO,label:(0,kc.__)("Category")},attachment:{icon:_A,label:(0,kc.__)("Attachment")}};function GEe({isURL:e,suggestion:t}){let o=null;return e?o=rv:t.type in RI&&(o=RI[t.type].icon,t.type==="page"&&(t.isFrontPage&&(o=eL),t.isBlogHome&&(o=VN))),o?(0,kb.jsx)(we,{className:"block-editor-link-control__search-item-icon",icon:o}):null}function WEe(e){return e?.trim()?.length?e?.replace(/^\/?/,"/"):e}function $Ee(e){return e?.trim()?.length?e?.replace(/\/$/,""):e}var KEe=(e,...t)=>(...o)=>e(...o,...t),YEe=e=>t=>t==null||t!==t?e:t;function qEe(e){return e&&(0,nre.pipe)(vb.safeDecodeURI,vb.getPath,YEe(""),KEe(vb.filterURLForDisplay,24),$Ee,WEe)(e)}var sre=({itemProps:e,suggestion:t,searchTerm:o,onClick:r,isURL:n=!1,shouldShowType:i=!1})=>{let s=n?(0,kc.__)("Press ENTER to add this link"):qEe(t.url);return(0,kb.jsx)(OI.MenuItem,{...e,info:s,iconPosition:"left",icon:(0,kb.jsx)(GEe,{suggestion:t,isURL:n}),onClick:r,shortcut:i&&ZEe(t),className:"block-editor-link-control__search-item",children:(0,kb.jsx)(OI.TextHighlight,{text:(0,rre.__unstableStripHTML)(t.title),highlight:o})})};function ZEe(e){return e.isFrontPage?(0,kc.__)("Front page"):e.isBlogHome?(0,kc.__)("Blog home"):e.type in RI?RI[e.type].label:e.type}var are=sre,lre=e=>((0,ire.default)("wp.blockEditor.__experimentalLinkControlSearchItem",{since:"6.8"}),(0,kb.jsx)(sre,{...e}));var cre=l(N(),1),Xm="__CREATE__",tF="tel",AI="link",oF="mailto",rF="internal",yb=[AI,oF,tF,rF],nF=[{id:"opensInNewTab",title:(0,cre.__)("Open in new tab")}];var dre=l(Re(),1),Qm=l(w(),1);function fre({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:n,suggestions:i,selectedSuggestion:s,isLoading:a,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){let f=V("block-editor-link-control__search-results",{"is-loading":a}),m=i.length===1&&yb.includes(i[0].type),h=e&&!m&&!c,p=!d?.type,g=c?(0,YS.__)("Suggestions"):(0,YS.sprintf)((0,YS.__)('Search results for "%s"'),t);return(0,Qm.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,Qm.jsx)("div",{...r,className:f,"aria-label":g,children:(0,Qm.jsx)(ure.MenuGroup,{children:i.map((b,v)=>h&&Xm===b.type?(0,Qm.jsx)(ore,{searchTerm:t,buttonText:u,onClick:()=>o(b),itemProps:n(b,v),isSelected:v===s},b.type):Xm===b.type?null:(0,Qm.jsx)(are,{itemProps:n(b,v),suggestion:b,index:v,onClick:()=>{o(b)},isSelected:v===s,isURL:yb.includes(b.type),searchTerm:t,shouldShowType:p,isFrontPage:b?.isFrontPage,isBlogHome:b?.isBlogHome},`${b.id}-${b.type}`))})})})}var mre=fre,pre=e=>((0,dre.default)("wp.blockEditor.__experimentalLinkControlSearchResults",{since:"6.8"}),(0,Qm.jsx)(fre,{...e}));var hre=l(R(),1),gre=l(F(),1);var LI=l(dn(),1);function qS(e){let t=e?.trim();if(!t)return{url:t,type:AI};let o=AI,r=(0,LI.getProtocol)(t)||"";return r.includes("mailto")?o=oF:r.includes("tel")?o=tF:t?.startsWith("#")&&(o=rF),bf(t)||kf(t)||t.startsWith("?")||r?{url:t,type:o}:{url:(0,LI.prependHTTPS)(t),type:o}}var XEe=()=>Promise.resolve([]),QEe=e=>{let{url:t,type:o}=qS(e);return Promise.resolve([{id:e,title:e,url:t,type:o}])},JEe=async(e,t,o,r,n,i)=>{let{isInitialSuggestions:s}=t,a=await o(e,t);return a.map(c=>Number(c.id)===n?(c.isFrontPage=!0,c):(Number(c.id)===i&&(c.isBlogHome=!0),c)),s||vf(e)||!r?a:a.concat({title:e,url:e,type:Xm})};function bre(e,t,o){let{fetchSearchSuggestions:r,pageOnFront:n,pageForPosts:i}=(0,gre.useSelect)(a=>{let{getSettings:c}=a(_);return{pageOnFront:c().pageOnFront,pageForPosts:c().pageForPosts,fetchSearchSuggestions:c().__experimentalFetchLinkSuggestions}},[]),s=t?QEe:XEe;return(0,hre.useCallback)((a,{isInitialSuggestions:c})=>vf(a)?s(a,{isInitialSuggestions:c}):JEe(a,{...e,isInitialSuggestions:c},r,o,n,i),[s,r,n,i,e,o])}var Sb=l(w(),1),eTe=()=>Promise.resolve([]),iF=()=>{},vre=(0,NI.forwardRef)(({value:e,children:t,currentLink:o={},className:r=null,placeholder:n=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=iF,onChange:a=iF,onSelect:c=iF,showSuggestions:u=!0,renderSuggestions:d=C=>(0,Sb.jsx)(mre,{...C}),fetchSuggestions:f=null,allowDirectEntry:m=!0,showInitialSuggestions:h=!1,suggestionsQuery:p={},withURLSuggestion:g=!0,createSuggestionButtonText:b,hideLabelFromVision:v=!1,suffix:k,isEntity:y=!1,customValidity:S},x)=>{let C=bre(p,m,i,g),B=u?f||C:eTe,[I,P]=(0,NI.useState)(),E=(U,G)=>{a(U),P(G)},L=U=>d({...U,withCreateSuggestion:i,createSuggestionButtonText:b,suggestionsQuery:p,handleSuggestionClick:G=>{U.handleSuggestionClick&&U.handleSuggestionClick(G),T(G)}}),T=async U=>{let G=U;if(Xm===U.type){try{G=await s(U.title),G?.url&&c(G)}catch{}return}if(m||G&&Object.keys(G).length>=1){let{id:j,url:z,kind:W,type:ee,...se}=o??{};c({...se,...G},G)}},O=n??(0,sF.__)("Search or type URL"),D=v&&n!==""?O:(0,sF.__)("Link");return(0,Sb.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,Sb.jsx)(Id,{disableSuggestions:o?.url===e,label:D,hideLabelFromVision:v,className:r,value:e,onChange:E,placeholder:O,__experimentalRenderSuggestions:u?L:null,__experimentalFetchLinkSuggestions:B,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:h,customValidity:S,required:!1,onSubmit:(U,G)=>{let j=U||I;!j&&!e?.trim()?.length?G.preventDefault():T(j||{url:e})},inputRef:x,suffix:k,disabled:y}),t]})}),yre=vre,Sre=e=>((0,kre.default)("wp.blockEditor.__experimentalLinkControlSearchInput",{since:"6.8"}),(0,Sb.jsx)(vre,{...e}));var Pd=l(N(),1),Lo=l(A(),1),Bre=l(Z(),1),VI=l(dn(),1);var Ere=l(Fe(),1),FI=l(F(),1),Tre=l(Un(),1),Ire=l(Xp(),1);var _re=l(A(),1),{Slot:xre,Fill:wre}=(0,_re.createSlotFill)("BlockEditorLinkControlViewer");var Cre=l(F(),1),MI=l(R(),1);function tTe(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function oTe(e){let[t,o]=(0,MI.useReducer)(tTe,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,Cre.useSelect)(n=>{let{getSettings:i}=n(_);return{fetchRichUrlData:i().__experimentalFetchRichUrlData}},[]);return(0,MI.useEffect)(()=>{if(e?.length&&r&&typeof AbortController<"u"){o({type:"LOADING"});let n=new window.AbortController,i=n.signal;return r(e,{signal:i}).then(s=>{o({type:"RESOLVED",richData:s})}).catch(()=>{i.aborted||o({type:"ERROR"})}),()=>{n.abort()}}},[e]),t}var DI=oTe;var vt=l(w(),1),{Badge:rTe}=M(Lo.privateApis);function Pre({value:e,onEditClick:t,hasRichPreviews:o=!1,hasUnlinkControl:r=!1,onRemove:n}){let i=(0,FI.useSelect)(b=>b(Ire.store).get("core","showIconLabels"),[]),s=o?e?.url:null,{richData:a,isFetching:c}=DI(s),u=a&&Object.keys(a).length,d=e&&(0,VI.filterURLForDisplay)((0,VI.safeDecodeURI)(e.url),24)||"",f=!e?.url?.length,m=!f&&(0,Ere.__unstableStripHTML)(a?.title||e?.title||d),h;a?.icon?h=(0,vt.jsx)("img",{src:a?.icon,alt:""}):f?h=(0,vt.jsx)(we,{icon:rL,size:32}):h=(0,vt.jsx)(we,{icon:rv});let{createNotice:p}=(0,FI.useDispatch)(Tre.store),g=(0,Bre.useCopyToClipboard)(e.url,()=>{p("info",(0,Pd.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return(0,vt.jsx)(Lo.Flex,{role:"group","aria-label":(0,Pd.__)("Manage link"),className:V("block-editor-link-control__preview",{"is-current":!0,"is-rich":u,"is-fetching":!!c,"is-preview":!0,"is-error":f,"is-url-title":m===d}),children:(0,vt.jsxs)(Lo.Flex,{gap:0,align:"flex-start",children:[(0,vt.jsxs)(Lo.Flex,{className:"block-editor-link-control__link-information",role:"figure","aria-label":(0,Pd.__)("Link information"),justify:"start",align:"flex-start",children:[e?.image?(0,vt.jsx)(Lo.Flex,{className:"block-editor-link-control__preview-image",justify:"center",children:(0,vt.jsx)("img",{src:e?.image,alt:""})}):(0,vt.jsx)(Lo.Flex,{className:V("block-editor-link-control__preview-icon",{"is-image":a?.icon}),justify:"center",children:h}),(0,vt.jsx)(Lo.Flex,{className:"block-editor-link-control__preview-details",direction:"column",gap:2,children:f?(0,vt.jsx)("span",{className:"block-editor-link-control__preview-error-notice",children:(0,Pd.__)("Link is empty")}):(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)(Lo.ExternalLink,{className:"block-editor-link-control__preview-title",href:e.url,children:(0,vt.jsx)(Lo.__experimentalTruncate,{numberOfLines:1,children:m})}),(0,vt.jsx)("span",{className:"block-editor-link-control__preview-info",children:(0,vt.jsx)(Lo.__experimentalTruncate,{numberOfLines:1,children:d})}),e?.badges?.length>0&&(0,vt.jsx)(Lo.__experimentalHStack,{className:"block-editor-link-control__preview-badges",alignment:"left",gap:1,children:e.badges.map((b,v)=>(0,vt.jsx)(rTe,{intent:b.intent,children:b.label},`${b.label}|${b.intent}|${v}`))})]})})]}),(0,vt.jsx)(Lo.Button,{icon:Af,label:(0,Pd.__)("Edit link"),onClick:t,size:"compact",showTooltip:!i}),r&&(0,vt.jsx)(Lo.Button,{icon:Ci,label:(0,Pd.__)("Remove link"),onClick:n,size:"compact",showTooltip:!i}),(0,vt.jsx)(Lo.Button,{icon:iA,label:(0,Pd.__)("Copy link"),ref:g,accessibleWhenDisabled:!0,disabled:f,size:"compact",showTooltip:!i}),(0,vt.jsx)(xre,{fillProps:e})]})})}var Rre=l(N(),1),zI=l(A(),1),_b=l(w(),1),nTe=()=>{},iTe=({value:e,onChange:t=nTe,settings:o})=>{if(!o||!o.length)return null;let r=i=>s=>{t({...e,[i.id]:s})},n=o.map(i=>{if("render"in i){if(typeof i.render=="function"){let s=i.render(i,e,t);return(0,_b.jsx)("div",{className:"block-editor-link-control__setting",children:s},i.id)}return null}return(0,_b.jsx)(zI.CheckboxControl,{className:"block-editor-link-control__setting",label:i.title,onChange:r(i),checked:e?!!e[i.id]:!1,help:i?.help},i.id)}).filter(Boolean);return(0,_b.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,_b.jsx)(zI.VisuallyHidden,{as:"legend",children:(0,Rre.__)("Currently selected link settings")}),n]})},Ore=iTe;var Are=l(N(),1),Jm=l(R(),1);function Lre(e){let t=(0,Jm.useRef)(),[o,r]=(0,Jm.useState)(!1),[n,i]=(0,Jm.useState)(null),s=async function(a){r(!0),i(null);try{return t.current=sTe(Promise.resolve(e(a))),await t.current.promise}catch(c){if(c&&c.isCanceled)return;throw i(c.message||(0,Are.__)("An unknown error occurred during creation. Please try again.")),c}finally{r(!1)}};return(0,Jm.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:s,isCreatingPage:o,errorMessage:n}}var sTe=e=>{let t=!1;return{promise:new Promise((r,n)=>{e.then(i=>t?n({isCanceled:!0}):r(i),i=>n(t?{isCanceled:!0}:i))}),cancel(){t=!0}}};var aF=l(R(),1),Dre=l(Mre(),1);function Vre(e){let[t,o]=(0,aF.useState)(e||{}),[r,n]=(0,aF.useState)(e);return(0,Dre.default)(e,r)||(n(e),o(e)),[t,o,c=>{o({...t,url:c})},c=>{o({...t,title:c})},c=>u=>{let d=Object.keys(u).reduce((f,m)=>(c.includes(m)&&(f[m]=u[m]),f),{});o({...t,...d})}]}var Pt=l(w(),1),cF=()=>{},Fre="core/block-editor",zre="linkControlSettingsDrawer";function ep({searchInputPlaceholder:e,value:t,settings:o=nF,onChange:r=cF,onInputChange:n,onRemove:i,onCancel:s,noDirectEntry:a=!1,showSuggestions:c=!0,showInitialSuggestions:u,forceIsEditingLink:d,createSuggestion:f,withCreateSuggestion:m,inputValue:h="",suggestionsQuery:p={},noURLSuggestion:g=!1,createSuggestionButtonText:b,hasRichPreviews:v=!1,hasTextControl:k=!1,renderControlBottom:y=null,handleEntities:S=!1}){m===void 0&&f&&(m=!0);let[x,C]=(0,no.useState)(!1),[B,I]=(0,no.useState)(void 0),{advancedSettingsPreference:P}=(0,jI.useSelect)(ge=>({advancedSettingsPreference:ge(lF.store).get(Fre,zre)??!1}),[]),{set:E}=(0,jI.useDispatch)(lF.store),L=ge=>{E&&E(Fre,zre,ge),C(ge)},T=P||x,O=(0,no.useRef)(!0),D=(0,no.useRef)(),U=(0,no.useRef)(),G=(0,no.useRef)(),j=(0,no.useRef)(),z=o.map(({id:ge})=>ge),[W,ee,se,ce,ie]=Vre(t),re=ge=>{se(ge),n?.(ge)},Q=S&&!!W?.id,Y=(0,jre.useInstanceId)(ep,"link-control"),J=Q?`${Y}__help`:null,K=t&&!(0,Gre.isShallowEqualObjects)(W,t),[H,X]=(0,no.useState)(d!==void 0?d:!t||!t.url),{createPage:ne,isCreatingPage:le,errorMessage:ve}=Lre(f);(0,no.useEffect)(()=>{d!==void 0&&X(d)},[d]),(0,no.useEffect)(()=>{if(O.current)return;(Ure.focus.focusable.find(D.current)[0]||D.current).focus()},[H,le]),(0,no.useEffect)(()=>(O.current=!1,()=>{O.current=!0}),[]);let he=(0,no.useRef)();(0,no.useEffect)(()=>{if(he.current===void 0){he.current=h;return}he.current!==h&&(console.warn("LinkControl: The inputValue prop is uncontrolled and only sets the initial value. onInputChange is an observer for the input value. Changes to inputValue from the parent will not update the search input."),he.current=h)},[h]),(0,no.useEffect)(()=>{if(B?.type==="invalid"){let ge=G.current;ge&&typeof ge.reportValidity=="function"&&ge.reportValidity()}},[B]);let xe=t?.url?.trim()?.length>0,ze=()=>{X(!1)},ot=ge=>{let Ct={type:"invalid",message:(0,Js.__)("Please enter a valid URL.")},Io={type:"valid"},Ke=ge?.trim();if(!Ke?.length||!vf(Ke))return Ct;if(bf(Ke)||kf(Ke))return Io;let te=(0,UI.prependHTTPS)(Ke);return(0,UI.isURL)(te)?Io:Ct},Wt=ge=>{if(!(ge&&ge.id&&ge.type&&!yb.includes(ge.type))){let Ke=ge?.url||$t,te=ot(Ke);if(te.type==="invalid"){I(te);return}let{url:Le}=qS(Ke);ge={...ge,url:Le}}ge?.kind==="taxonomy"&&ge?.url&&(j.current=ge.url);let Io=Object.keys(ge).reduce((Ke,te)=>(z.includes(te)||(Ke[te]=ge[te]),Ke),{});r({...W,...Io,title:W?.title||ge?.title}),I(void 0),ze()},fo=()=>{if(lr)return!1;let ge=$t.trim(),Ct=W&&W.id&&W.type&&!yb.includes(W.type),Io=t?.url===ge;if(Ct&&Io)return I(void 0),!0;let Ke=ot($t);return Ke.type==="invalid"?(I(Ke),!1):(I(void 0),!0)},Do=()=>{K&&r({...t,...W,url:qS($t).url}),ze(),I(void 0)},rt=()=>{fo()&&Do()},ar=ge=>{let{keyCode:Ct}=ge;Ct===Hre.ENTER&&!lr&&(ge.preventDefault(),rt())},xt=()=>{ee(t)},At=ge=>{ge.preventDefault(),ge.stopPropagation(),xt(),I(void 0),xe?ze():i?.(),s?.()},[Pe,wt]=(0,no.useState)(!1),qo=()=>{let{id:ge,kind:Ct,type:Io,...Ke}=W;ee({...Ke,id:void 0,kind:void 0,type:void 0,url:void 0}),wt(!0)};(0,no.useEffect)(()=>{Pe&&(G.current?.focus(),wt(!1))},[Pe]);let $t=W?.url!==void 0?W.url:h||"",lr=!$t?.trim()?.length;(0,no.useEffect)(()=>{I(void 0)},[$t]);let ln=!B,je=i&&t&&!H&&!le,Eo=H&&xe,Ze=xe&&k,Ve=(H||!t)&&!le,gt=lr||!ln||t&&!K,To=!!o?.length&&H&&xe,cr=(0,no.useMemo)(()=>t?.kind==="taxonomy"&&!t?.url&&j.current?{...t,url:j.current}:t,[t]);return(0,Pt.jsxs)("div",{tabIndex:-1,ref:D,className:"block-editor-link-control",children:[le&&(0,Pt.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,Pt.jsx)(Qr.Spinner,{})," ",(0,Js.__)("Creating"),"\u2026"]}),Ve&&(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsxs)("div",{className:V({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Ze,"has-actions":Eo}),children:[Ze&&(0,Pt.jsx)(Qr.TextControl,{ref:U,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,Js.__)("Text"),value:W?.title,onChange:ce,onKeyDown:ar,__next40pxDefaultSize:!0}),(0,Pt.jsx)(yre,{ref:G,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:$t,withCreateSuggestion:m,onCreateSuggestion:ne,onChange:re,onSelect:Wt,showInitialSuggestions:u,allowDirectEntry:!a,showSuggestions:c,suggestionsQuery:p,withURLSuggestion:!g,createSuggestionButtonText:b,hideLabelFromVision:!Ze,isEntity:Q,customValidity:B,suffix:(0,Pt.jsx)(aTe,{isEntity:Q,showActions:Eo,isDisabled:gt,onUnlink:qo,onSubmit:rt,helpTextId:J})}),Q&&J&&(0,Pt.jsx)("p",{id:J,className:"block-editor-link-control__help",children:(0,Js.sprintf)((0,Js.__)("Synced with the selected %s."),W?.type||"item")})]}),ve&&(0,Pt.jsx)(Qr.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:ve})]}),t&&!H&&!le&&(0,Pt.jsx)(Pre,{value:cr,onEditClick:()=>X(!0),hasRichPreviews:v,hasUnlinkControl:je,onRemove:()=>{i(),X(!0)}},cr?.url),To&&(0,Pt.jsx)("div",{className:"block-editor-link-control__tools",children:!lr&&(0,Pt.jsx)(Joe,{settingsOpen:T,setSettingsOpen:L,children:(0,Pt.jsx)(Ore,{value:W,settings:o,onChange:ie(z)})})}),Eo&&(0,Pt.jsxs)(Qr.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,Pt.jsx)(Qr.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:At,children:(0,Js.__)("Cancel")}),(0,Pt.jsx)(Qr.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:gt?cF:rt,className:"block-editor-link-control__search-submit","aria-disabled":gt,children:(0,Js.__)("Apply")})]}),!le&&y&&y()]})}function aTe({isEntity:e,showActions:t,isDisabled:o,onUnlink:r,onSubmit:n,helpTextId:i}){if(e)return(0,Pt.jsx)(Qr.Button,{icon:Ci,onClick:r,"aria-describedby":i,showTooltip:!0,label:(0,Js.__)("Unsync and edit"),__next40pxDefaultSize:!0});if(!t)return(0,Pt.jsx)(Qr.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Pt.jsx)(Qr.Button,{onClick:o?cF:n,label:(0,Js.__)("Submit"),icon:kl,className:"block-editor-link-control__search-submit","aria-disabled":o,size:"small"})})}ep.ViewerFill=wre;ep.DEFAULT_LINK_SETTINGS=nF;var HI=e=>((0,Wre.default)("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,Pt.jsx)(ep,{...e}));HI.ViewerFill=ep.ViewerFill;HI.DEFAULT_LINK_SETTINGS=ep.DEFAULT_LINK_SETTINGS;var Rd=ep;var Kre=l(N(),1),Yre=l(A(),1),qre=l(Re(),1);var ZS=1.5,uF=.01,dF=10,fF="";function $re(e){return e!==void 0&&e!==fF}var mF=l(w(),1),lTe=({__next40pxDefaultSize:e=!1,value:t,onChange:o,__unstableInputWidth:r="60px",...n})=>{let i=$re(t),s=(d,f)=>{if(i)return d;let m=uF*dF;switch(`${d}`){case`${m}`:return ZS+m;case"0":return f?d:ZS-m;case"":return ZS;default:return d}},a=(d,f)=>{let m=["insertText","insertFromPaste"].includes(f.payload.event.nativeEvent?.inputType),h=s(d.value,m);return{...d,value:h}},c=i?t:fF,u=(d,{event:f})=>{if(d===""){o();return}if(f.type==="click"){o(s(`${d}`,!1));return}o(`${d}`)};return!e&&(n.size===void 0||n.size==="default")&&(0,qre.default)("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,mF.jsx)("div",{className:"block-editor-line-height-control",children:(0,mF.jsx)(Yre.__experimentalNumberControl,{...n,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,__unstableInputWidth:r,__unstableStateReducer:a,onChange:u,label:(0,Kre.__)("Line height"),placeholder:ZS,step:uF,spinFactor:dF,value:c,min:0,spinControls:"custom"})})},GI=lTe;var Ga=l(N(),1),Zre=l(Xo(),1),Jr=l(A(),1),$I=l(F(),1),Xre=l(it(),1);var Qre=l(Z(),1),Jre=l(Fe(),1),ene=l(Un(),1),tne=l(R(),1);function WI(e,t,o){if(o)return o;if(!t||typeof t!="object"||Object.keys(t).length===0)return e&&e.length>0?e.map(n=>`${n}/*`).join(","):void 0;if(!e||e.length===0)return;let r=[];for(let[,n]of Object.entries(t))e.some(s=>s.includes("/")?n===s:n.startsWith(`${s}/`))&&r.push(n);return r.length>0?r.join(","):e.map(n=>`${n}/*`).join(",")}var rr=l(w(),1),cTe=()=>{},uTe=0,dTe=({mediaURL:e,mediaId:t,mediaIds:o,allowedTypes:r,accept:n,onError:i,onSelect:s,onSelectURL:a,onReset:c,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:f=cTe,name:m=(0,Ga.__)("Replace"),createNotice:h,removeNotice:p,children:g,multiple:b=!1,addToGallery:v,handleUpload:k=!0,variant:y,popoverProps:S,renderToggle:x,className:C})=>{let{mediaUpload:B,allowedMimeTypes:I}=(0,$I.useSelect)(z=>{let{getSettings:W}=z(_),ee=W();return{mediaUpload:ee.mediaUpload,allowedMimeTypes:ee.allowedMimeTypes}},[]),P=`block-editor/media-replace-flow/error-notice/${++uTe}`,E=(0,tne.useMemo)(()=>WI(r,I,n),[r,I,n]),L=z=>{let W=(0,Jre.__unstableStripHTML)(z);if(i){i(W);return}setTimeout(()=>{h("error",W,{speak:!0,id:P,isDismissible:!0})},1e3)},T=(z,W)=>{d&&u&&u(),W(),s(z),(0,Zre.speak)((0,Ga.__)("The media file has been replaced")),p(P)},O=(z,W)=>{let ee=z.target.files;if(!k)return W(),s(ee);f(ee),B({allowedTypes:r,filesList:ee,onFileChange:([se])=>{T(se,W)},onError:L})},D=z=>{z.keyCode===Xre.DOWN&&(z.preventDefault(),z.target.click())},G=b&&(!r||r.length===0?!1:r.every(z=>z==="image"||z.startsWith("image/"))),j={...S,variant:y};return(0,rr.jsx)(Jr.Dropdown,{popoverProps:j,className:C,contentClassName:V("block-editor-media-replace-flow__options",y&&`is-variant-${y}`),renderToggle:({isOpen:z,onToggle:W})=>x?x({"aria-expanded":z,"aria-haspopup":"true",onClick:W,onKeyDown:D,children:m}):(0,rr.jsx)(Jr.ToolbarButton,{"aria-expanded":z,"aria-haspopup":"true",onClick:W,onKeyDown:D,children:m}),renderContent:({onClose:z})=>(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)(Jr.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,rr.jsxs)(Vs,{children:[(0,rr.jsx)(Zu,{gallery:G,addToGallery:v,multiple:b,value:b?o:t,onSelect:W=>T(W,z),allowedTypes:r,render:({open:W})=>(0,rr.jsx)(Jr.MenuItem,{icon:Up,onClick:W,children:(0,Ga.__)("Open Media Library")})}),(0,rr.jsx)(Jr.FormFileUpload,{onChange:W=>{O(W,z)},accept:E,multiple:!!b,render:({openFileDialog:W})=>(0,rr.jsx)(Jr.MenuItem,{icon:MN,onClick:()=>{W()},children:(0,Ga._x)("Upload","verb")})})]}),u&&(0,rr.jsx)(Jr.MenuItem,{icon:WL,onClick:u,isPressed:d,children:(0,Ga.__)("Use featured image")}),typeof g=="function"?g({onClose:z}):g,e&&c&&(0,rr.jsx)(Jr.MenuItem,{onClick:()=>{c(),z()},children:(0,Ga.__)("Reset")})]}),a&&(0,rr.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,rr.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,Ga.__)("Current media URL:")}),(0,rr.jsx)(Rd,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:W})=>{a(W)},searchInputPlaceholder:(0,Ga.__)("Paste or type URL")})]})]})})},xb=(0,Qre.compose)([(0,$I.withDispatch)(e=>{let{createNotice:t,removeNotice:o}=e(ene.store);return{createNotice:t,removeNotice:o}}),(0,Jr.withFilters)("editor.MediaReplaceFlow")])(dTe);var _o=l(A(),1),So=l(N(),1),Nd=l(R(),1),hne=l(F(),1);var gne=l(Re(),1);var hF=l(N(),1),YI=l(R(),1),wb=l(A(),1);var pne=l(Re(),1);var nne=l(N(),1),ine=l(A(),1);var one=l(A(),1),KI=l(dn(),1),pF=l(w(),1);function rne({url:e,urlLabel:t,className:o}){let r=V(o,"block-editor-url-popover__link-viewer-url");return e?(0,pF.jsx)(one.ExternalLink,{className:r,href:e,children:t||(0,KI.filterURLForDisplay)((0,KI.safeDecodeURI)(e))}):(0,pF.jsx)("span",{className:r})}var XS=l(w(),1);function sne({className:e,linkClassName:t,onEditLinkClick:o,url:r,urlLabel:n,...i}){return(0,XS.jsxs)("div",{className:V("block-editor-url-popover__link-viewer",e),...i,children:[(0,XS.jsx)(rne,{url:r,urlLabel:n,className:t}),o&&(0,XS.jsx)(ine.Button,{icon:Af,label:(0,nne.__)("Edit"),onClick:o,size:"compact"})]})}var dne=l(N(),1),fne=l(A(),1);var vc=l(N(),1),QS=l(R(),1),ea=l(it(),1),Tn=l(A(),1),Od=l(Z(),1),ane=l(F(),1),lne=l(dn(),1);var Wa=l(w(),1),cne=l(jr(),1),{ValidatedInputControl:fTe}=M(Tn.privateApis);function une(e){return typeof e=="function"}var mTe=class extends QS.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,QS.createRef)(),this.inputRef=e.inputRef||(0,QS.createRef)(),this.hasRenderedValidation={current:!1},this.updateSuggestions=(0,Od.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){let{showSuggestions:t,selectedSuggestion:o}=this.state,{value:r,__experimentalShowInitialSuggestions:n=!1}=this.props;t&&o!==null&&this.suggestionNodes[o]&&this.suggestionNodes[o].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value!==r&&!this.props.disableSuggestions&&(r?.length?this.updateSuggestions(r):n&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){let{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){let{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:o}=this.props;if(!t)return;let r=!e?.length;if(e=e.trim(),!r&&(e.length<2||!o&&(0,lne.isURL)(e))){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});return}this.setState({selectedSuggestion:null,loading:!0});let n=t(e,{isInitialSuggestions:r});n.then(i=>{this.suggestionsRequest===n&&(this.setState({suggestions:i,suggestionsValue:e,loading:!1,showSuggestions:!!i.length}),i.length?this.props.debouncedSpeak((0,vc.sprintf)((0,vc._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",i.length),i.length),"assertive"):this.props.debouncedSpeak((0,vc.__)("No results."),"assertive"))}).catch(()=>{this.suggestionsRequest===n&&this.setState({loading:!1})}).finally(()=>{this.suggestionsRequest===n&&(this.suggestionsRequest=null)}),this.suggestionsRequest=n}onChange(e){this.props.onChange(e)}onFocus(){let{suggestions:e}=this.state,{disableSuggestions:t,value:o}=this.props;o&&!t&&!(e&&e.length)&&this.suggestionsRequest===null&&this.updateSuggestions(o)}onKeyDown(e){this.props.onKeyDown?.(e);let{showSuggestions:t,selectedSuggestion:o,suggestions:r,loading:n}=this.state;if(!t||!r.length||n){switch(e.keyCode){case ea.UP:{e.target.selectionStart!==0&&(e.preventDefault(),e.target.setSelectionRange(0,0));break}case ea.DOWN:{this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break}case ea.ENTER:{this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e));break}}return}let i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case ea.UP:{e.preventDefault();let s=o?o-1:r.length-1;this.setState({selectedSuggestion:s});break}case ea.DOWN:{e.preventDefault();let s=o===null||o===r.length-1?0:o+1;this.setState({selectedSuggestion:s});break}case ea.TAB:{this.state.selectedSuggestion!==null&&(this.selectLink(i),this.props.speak((0,vc.__)("Link selected.")));break}case ea.ENTER:{e.preventDefault(),this.state.selectedSuggestion!==null?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e);break}}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:o,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:n}){let i=n,s=e&&e.length;return!r&&!s&&(i=!1),o===!0&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Wa.jsxs)(Wa.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){let{label:e=null,className:t,isFullWidth:o,instanceId:r,placeholder:n=(0,vc.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:s="",hideLabelFromVision:a=!1,help:c=null,disabled:u=!1,customValidity:d,markWhenOptional:f}=this.props,{loading:m,showSuggestions:h,selectedSuggestion:p,suggestionsListboxId:g,suggestionOptionIdPrefix:b}=this.state,v=`url-input-control-${r}`,k={id:v,label:e,className:V("block-editor-url-input",t,{"is-full-width":o}),hideLabelFromVision:a},y={id:v,value:s,required:this.props.required??!0,type:"text",name:v,autoComplete:"off",onChange:u?()=>{}:this.onChange,onFocus:u?()=>{}:this.onFocus,placeholder:n,onKeyDown:u?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,vc.__)("URL"),"aria-expanded":h,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":p!==null?`${b}-${p}`:void 0,ref:this.inputRef,disabled:u,suffix:this.props.suffix,help:c},S={customValidity:d,...f!==void 0&&{markWhenOptional:f}};if(i)return i(k,y,m);d!==void 0&&(this.hasRenderedValidation.current=!0);let x=this.hasRenderedValidation.current?fTe:Tn.__experimentalInputControl;return(0,Wa.jsxs)(Tn.BaseControl,{...k,children:[(0,Wa.jsx)(x,{...y,...this.hasRenderedValidation.current?S:{},__next40pxDefaultSize:!0}),m&&(0,Wa.jsx)(Tn.Spinner,{})]})}renderSuggestions(){let{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:o,suggestions:r,suggestionsValue:n,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:c}=this.state;if(!o||r.length===0)return null;let u={id:s,ref:this.autocompleteRef,role:"listbox"},d=(f,m)=>({role:"option",tabIndex:"-1",id:`${a}-${m}`,ref:this.bindSuggestionNode(m),"aria-selected":m===i?!0:void 0});return une(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:u,buildSuggestionItemProps:d,isLoading:c,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!n?.length,currentInputValue:n}):(0,Wa.jsx)(Tn.Popover,{placement:"bottom",focusOnMount:!1,children:(0,Wa.jsx)("div",{...u,className:V("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:r.map((f,m)=>(0,cne.createElement)(Tn.Button,{__next40pxDefaultSize:!0,...d(f,m),key:f.id,className:V("block-editor-url-input__suggestion",{"is-selected":m===i}),onClick:()=>this.handleOnClick(f)},f.title))})})}},Id=(0,Od.compose)(Od.withSafeTimeout,Tn.withSpokenMessages,Od.withInstanceId,(0,ane.withSelect)((e,t)=>{if(une(t.__experimentalFetchLinkSuggestions))return;let{getSettings:o}=e(_);return{__experimentalFetchLinkSuggestions:o().__experimentalFetchLinkSuggestions}}))(mTe);var JS=l(w(),1);function mne({autocompleteRef:e,className:t,onChangeInputValue:o,value:r,...n}){return(0,JS.jsxs)("form",{className:V("block-editor-url-popover__link-editor",t),...n,children:[(0,JS.jsx)(Id,{value:r,onChange:o,autocompleteRef:e}),(0,JS.jsx)(fne.Button,{icon:kl,label:(0,dne.__)("Apply"),type:"submit",size:"compact"})]})}var Ad=l(w(),1),{__experimentalPopoverLegacyPositionToPlacement:pTe}=M(wb.privateApis),hTe="bottom",gF=(0,YI.forwardRef)(({additionalControls:e,children:t,renderSettings:o,placement:r,focusOnMount:n="firstElement",position:i,...s},a)=>{i!==void 0&&(0,pne.default)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"});let c;r!==void 0?c=r:i!==void 0&&(c=pTe(i)),c=c||hTe;let[u,d]=(0,YI.useState)(!1),f=!!o&&u,m=()=>{d(!u)};return(0,Ad.jsxs)(wb.Popover,{ref:a,role:"dialog","aria-modal":"true","aria-label":(0,hF.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:n,placement:c,shift:!0,variant:"toolbar",...s,children:[(0,Ad.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,Ad.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!o&&(0,Ad.jsx)(wb.Button,{className:"block-editor-url-popover__settings-toggle",icon:zn,label:(0,hF.__)("Link settings"),onClick:m,"aria-expanded":u,size:"compact"})]})}),f&&(0,Ad.jsx)("div",{className:"block-editor-url-popover__settings",children:o()}),e&&!f&&(0,Ad.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})});gF.LinkEditor=mne;gF.LinkViewer=sne;var Ld=gF;var Ge=l(w(),1),gTe=()=>{},bTe=({src:e,onChange:t,onSubmit:o,onClose:r,popoverAnchor:n})=>(0,Ge.jsx)(Ld,{anchor:n,onClose:r,children:(0,Ge.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o,children:(0,Ge.jsx)(_o.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,So.__)("URL"),type:"text",hideLabelFromVision:!0,placeholder:(0,So.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,Ge.jsx)(_o.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Ge.jsx)(_o.Button,{size:"small",icon:kl,label:(0,So.__)("Apply"),type:"submit"})})})})}),kTe=({src:e,onChangeSrc:t,onSelectURL:o})=>{let[r,n]=(0,Nd.useState)(null),[i,s]=(0,Nd.useState)(!1),a=()=>{s(!0)},c=()=>{s(!1),r?.focus()},u=d=>{d.preventDefault(),e&&o&&(o(e),c())};return(0,Ge.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:a,isPressed:i,variant:"secondary","aria-haspopup":"dialog",ref:n,children:(0,So.__)("Insert from URL")}),i&&(0,Ge.jsx)(bTe,{src:e,onChange:t,onSubmit:u,onClose:c,popoverAnchor:r})]})};function vTe({value:e={},allowedTypes:t,className:o,icon:r,labels:n={},mediaPreview:i,notices:s,isAppender:a,accept:c,addToGallery:u,multiple:d=!1,handleUpload:f=!0,disableDropZone:m,disableMediaButtons:h,onError:p,onSelect:g,onCancel:b,onSelectURL:v,onToggleFeaturedImage:k,onDoubleClick:y,onFilesPreUpload:S=gTe,onHTMLDrop:x,children:C,mediaLibraryButton:B,placeholder:I,style:P}){x&&(0,gne.default)("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});let{mediaUpload:E,allowedMimeTypes:L}=(0,hne.useSelect)(Y=>{let{getSettings:J}=Y(_),K=J();return{mediaUpload:K.mediaUpload,allowedMimeTypes:K.allowedMimeTypes}},[]),[T,O]=(0,Nd.useState)("");(0,Nd.useEffect)(()=>{O(e?.src??"")},[e?.src]);let D=(0,Nd.useMemo)(()=>WI(t,L,c),[t,L,c]),U=()=>!t||t.length===0?!1:t.every(Y=>Y==="image"||Y.startsWith("image/")),G=Y=>{if(!f||typeof f=="function"&&!f(Y))return g(Y);S(Y);let J;if(d)if(u){let K=[];J=H=>{let X=(e??[]).filter(ne=>ne.id?!K.some(({id:le})=>Number(le)===Number(ne.id)):!K.some(({urlSlug:le})=>ne.url.includes(le)));g(X.concat(H)),K=H.map(ne=>{let le=ne.url.lastIndexOf("."),ve=ne.url.slice(0,le);return{id:ne.id,urlSlug:ve}})}}else J=g;else J=([K])=>g(K);E({allowedTypes:t,filesList:Y,onFileChange:J,onError:p,multiple:d})};async function j(Y){let{blocks:J}=oV(Y);if(!J?.length)return;let K=await Promise.all(J.map(H=>{let X=H.name.split("/")[1];return H.attributes.id?(H.attributes.type=X,H.attributes):new Promise((ne,le)=>{window.fetch(H.attributes.url).then(ve=>ve.blob()).then(ve=>E({filesList:[ve],additionalData:{title:H.attributes.title,alt_text:H.attributes.alt,caption:H.attributes.caption,type:X},onFileChange:([he])=>{he.id&&ne(he)},allowedTypes:t,onError:le})).catch(()=>ne(H.attributes.url))})})).catch(H=>p(H));K?.length&&g(d?K:K[0])}let z=Y=>{G(Y.target.files)},ee=I??(Y=>{let{instructions:J,title:K}=n;if(!E&&!v&&(J=(0,So.__)("To edit this block, you need permission to upload media.")),J===void 0||K===void 0){let X=t??[],[ne]=X,le=X.length===1,ve=le&&ne==="audio",he=le&&ne==="image",xe=le&&ne==="video";J===void 0&&E&&(J=(0,So.__)("Drag and drop an image or video, upload, or choose from your library."),ve?J=(0,So.__)("Drag and drop an audio file, upload, or choose from your library."):he?J=(0,So.__)("Drag and drop an image, upload, or choose from your library."):xe&&(J=(0,So.__)("Drag and drop a video, upload, or choose from your library."))),K===void 0&&(K=(0,So.__)("Media"),ve?K=(0,So.__)("Audio"):he?K=(0,So.__)("Image"):xe&&(K=(0,So.__)("Video")))}let H=V("block-editor-media-placeholder",o,{"is-appender":a});return(0,Ge.jsxs)(_o.Placeholder,{icon:r,label:K,instructions:J,className:H,notices:s,onDoubleClick:y,preview:i,style:P,children:[Y,C]})}),se=()=>m?null:(0,Ge.jsx)(_o.DropZone,{onFilesDrop:G,onDrop:j,isEligible:Y=>{let J="wp-block:core/",K=[];for(let H of Y.types)H.startsWith(J)&&K.push(H.slice(J.length));return K.every(H=>t.includes(H))&&(d?!0:K.length===1)}}),ce=()=>b&&(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:(0,So.__)("Cancel"),variant:"link",onClick:b,children:(0,So.__)("Cancel")}),ie=()=>v&&(0,Ge.jsx)(kTe,{src:T,onChangeSrc:O,onSelectURL:v}),re=()=>k&&(0,Ge.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:k,variant:"secondary",children:(0,So.__)("Use featured image")})}),Q=()=>{let J=B??(({open:H})=>(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{H()},children:(0,So.__)("Media Library")})),K=(0,Ge.jsx)(Zu,{addToGallery:u,gallery:d&&U(),multiple:d,onSelect:g,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map(({id:H})=>H):e.id,render:J});if(E&&a)return(0,Ge.jsxs)(Ge.Fragment,{children:[se(),(0,Ge.jsx)(_o.FormFileUpload,{onChange:z,accept:D,multiple:!!d,render:({openFileDialog:H})=>{let X=(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,variant:"primary",className:V("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:H,children:(0,So._x)("Upload","verb")}),K,ie(),re(),ce()]});return ee(X)}})]});if(E){let H=(0,Ge.jsxs)(Ge.Fragment,{children:[se(),(0,Ge.jsx)(_o.FormFileUpload,{render:({openFileDialog:X})=>(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,onClick:X,variant:"primary",className:V("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,So._x)("Upload","verb")}),onChange:z,accept:D,multiple:!!d}),K,ie(),re(),ce()]});return ee(H)}return ee(K)};return h?(0,Ge.jsx)(Vs,{children:se()}):(0,Ge.jsx)(Vs,{fallback:ee(ie()),children:Q()})}var bne=(0,_o.withFilters)("editor.MediaPlaceholder")(vTe);var kne=l(w(),1),yTe=({colorSettings:e,...t})=>{let o=e.map(r=>{if(!r)return r;let{value:n,onChange:i,...s}=r;return{...s,colorValue:n,onColorChange:i}});return(0,kne.jsx)(hI,{settings:o,gradients:[],disableCustomGradients:!0,...t})},vne=yTe;var hie=l(zM(),1);var gie=l(R(),1);var fie=l(R(),1);var sie=l(Sf(),1),nr=l(R(),1),Dd=l(F(),1),cP=l(Z(),1),aie=l(dr(),1),lie=l(A(),1),cie=l($(),1),uie=l(Re(),1),Lb=l(N(),1);var yne=l(N(),1),qI=l(A(),1);var bF=l(N(),1),tp=l(A(),1);var yc=l(w(),1),STe={placement:"bottom-start"},_Te=()=>(0,yc.jsxs)(yc.Fragment,{children:[["bold","italic","link","unknown"].map(e=>(0,yc.jsx)(tp.Slot,{name:`RichText.ToolbarControls.${e}`},e)),(0,yc.jsx)(tp.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;let o=e.map(([{props:r}])=>r).some(({isActive:r})=>r);return(0,yc.jsx)(tp.ToolbarItem,{children:r=>(0,yc.jsx)(tp.DropdownMenu,{icon:zn,label:(0,bF.__)("More"),toggleProps:{...r,className:V(r.className,{"is-pressed":o}),description:(0,bF.__)("Displays more block tools")},controls:pa(e.map(([{props:n}])=>n),"title"),popoverProps:STe})})}})]}),kF=_Te;var Md=l(w(),1);function xTe({popoverAnchor:e}){return(0,Md.jsx)(qI.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,Md.jsx)(Eg,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,yne.__)("Format tools"),children:(0,Md.jsx)(qI.ToolbarGroup,{children:(0,Md.jsx)(kF,{})})})})}var wTe=({inline:e,editableContentElement:t})=>e?(0,Md.jsx)(xTe,{popoverAnchor:t}):(0,Md.jsx)(Mt,{group:"inline",children:(0,Md.jsx)(kF,{})}),Sne=wTe;var ZI=l(R(),1),_ne=l(F(),1);function xne({html:e,value:t}){let o=(0,ZI.useRef)(),r=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:n}=(0,_ne.useDispatch)(_);(0,ZI.useLayoutEffect)(()=>{if(!o.current){o.current=t.text;return}if(o.current!==t.text){let i=window.setTimeout(()=>{n()},1e3);return o.current=t.text,()=>{window.clearTimeout(i)}}n()},[e,r])}var Eb=l(R(),1),Une=l(Z(),1);var e_=l(dr(),1),wne=l(ut(),1);var CTe=["`",'"',"'","\u201C\u201D","\u2018\u2019"],Cne=e=>t=>{function o(r){let{inputType:n,data:i}=r,{value:s,onChange:a,registry:c}=e.current;if(n!=="insertText"||(0,e_.isCollapsed)(s))return;let u=(0,wne.applyFilters)("blockEditor.wrapSelectionSettings",CTe).find(([x,C])=>x===i||C===i);if(!u)return;let[d,f=d]=u,m=s.start,h=s.end+d.length,p=(0,e_.insert)(s,d,m,m);p=(0,e_.insert)(p,f,h,h);let{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:b}=c.dispatch(_);g(),a(p),b();let v={};for(let x in r)v[x]=r[x];v.data=f;let{ownerDocument:k}=t,{defaultView:y}=k,S=new y.InputEvent("input",v);window.queueMicrotask(()=>{r.target.dispatchEvent(S)}),r.preventDefault()}return t.addEventListener("beforeinput",o),()=>{t.removeEventListener("beforeinput",o)}};var XI=l(dr(),1),Cb=l($(),1);var Bne=l(dr(),1);function Ene(e){let t="tales of gutenberg",o=" \u{1F421}\u{1F422}\u{1F980}\u{1F424}\u{1F98B}\u{1F418}\u{1F427}\u{1F439}\u{1F981}\u{1F984}\u{1F98D}\u{1F43C}\u{1F43F}\u{1F383}\u{1F434}\u{1F41D}\u{1F406}\u{1F995}\u{1F994}\u{1F331}\u{1F347}\u03C0\u{1F34C}\u{1F409}\u{1F4A7}\u{1F968}\u{1F30C}\u{1F342}\u{1F360}\u{1F966}\u{1F95A}\u{1F95D}\u{1F39F}\u{1F965}\u{1F952}\u{1F6F5}\u{1F956}\u{1F352}\u{1F36F}\u{1F3BE}\u{1F3B2}\u{1F43A}\u{1F41A}\u{1F42E}\u231B\uFE0F",{start:r,text:n}=e;return rt=>{function o(){let{getValue:n,onReplace:i,selectionChange:s,registry:a}=e.current;if(!i)return;let c=n(),{start:u,text:d}=c;if(d.slice(u-1,u)!==" ")return;let m=d.slice(0,u).trim(),h=(0,Cb.getBlockTransforms)("from").filter(({type:v})=>v==="prefix"),p=(0,Cb.findTransform)(h,({prefix:v})=>m===v);if(!p)return;let g=(0,XI.toHTMLString)({value:(0,XI.insert)(c,Cl,0,u)}),b=p.transform(g);return s(...Tne([b])),i([b]),a.dispatch(_).__unstableMarkAutomaticChange(),!0}function r(n){let{inputType:i,type:s}=n,{getValue:a,onChange:c,__unstableAllowPrefixTransformations:u,formatTypes:d,registry:f,onReplace:m}=e.current;if(i!=="insertText"&&s!=="compositionend"||u&&o())return;let h=a(),p=(0,Cb.getBlockTransforms)("from").filter(y=>y.type==="input"),g=(0,Cb.findTransform)(p,y=>y.regExp.test(h.text));if(g){m(g.transform()),f.dispatch(_).__unstableMarkAutomaticChange();return}let b=d.reduce((y,{__unstableInputRule:S})=>(S&&(y=S(y)),y),Ene(h)),{__unstableMarkLastChangeAsPersistent:v,__unstableMarkAutomaticChange:k}=f.dispatch(_);b!==h&&(v(),c({...b,activeFormats:h.activeFormats}),k())}return t.addEventListener("input",r),t.addEventListener("compositionend",r),()=>{t.removeEventListener("input",r),t.removeEventListener("compositionend",r)}};var Pne=e=>t=>{function o(r){if(r.inputType!=="insertReplacementText")return;let{registry:n}=e.current;n.dispatch(_).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",o),()=>{t.removeEventListener("beforeinput",o)}};var QI=l(it(),1),Rne=()=>e=>{function t(o){(QI.isKeyboardEvent.primary(o,"z")||QI.isKeyboardEvent.primary(o,"y")||QI.isKeyboardEvent.primaryShift(o,"z"))&&o.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}};var One=e=>t=>{let{keyboardShortcuts:o}=e.current;function r(n){for(let i of o.current)i(n)}return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r)}};var Ane=e=>t=>{let{inputEvents:o}=e.current;function r(n){for(let i of o.current)i(n)}return t.addEventListener("input",r),()=>{t.removeEventListener("input",r)}};var JI=l(it(),1);var Lne=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented||n!==JI.BACKSPACE&&n!==JI.ESCAPE)return;let{registry:i}=e.current,{didAutomaticChange:s,getSettings:a}=i.select(_),{__experimentalUndo:c}=a();c&&s()&&(r.preventDefault(),c())}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}};var Mne=l($(),1),$a=l(dr(),1),Dne=l(dn(),1);var BTe=l(R(),1),ETe=l($(),1),TTe=l(w(),1);function Nne(e,t){if(t?.length){let o=e.formats.length;for(;o--;)e.formats[o]=[...t,...e.formats[o]||[]]}}function eP(e){if(!(e!==!0&&e!=="p"&&e!=="li"))return e===!0?"p":e}function Bb({allowedFormats:e,disableFormats:t}){return t?Bb.EMPTY_ARRAY:e}Bb.EMPTY_ARRAY=[];var Vne=e=>t=>{function o(n){let{disableFormats:i,onChange:s,value:a,formatTypes:c,tagName:u,onReplace:d,__unstableEmbedURLOnPaste:f,preserveWhiteSpace:m,pastePlainText:h}=e.current;if(!t.contains(n.target)||n.defaultPrevented)return;let{plainText:p,html:g}=Lh(n);if(n.preventDefault(),window.console.log(`Received HTML (RichText):`,g),window.console.log(`Received plain text (RichText):`,p),i){s((0,$a.insert)(a,p));return}let b=n.clipboardData.getData("rich-text")==="true";function v(x){let C=c.reduce((B,{__unstablePasteRule:I})=>(I&&B===a&&(B=I(a,{html:g,plainText:p})),B),a);if(C!==a)s(C);else{let B=(0,$a.create)({html:x});Nne(B,a.activeFormats),s((0,$a.insert)(a,B))}}if(b){v(g);return}if(h){s((0,$a.insert)(a,(0,$a.create)({text:p})));return}let k="INLINE",y=p.trim();f&&(0,$a.isEmpty)(a)&&(0,Dne.isURL)(y)&&/^https?:/.test(y)&&(k="BLOCKS");let S=(0,Mne.pasteHandler)({HTML:g,plainText:p,mode:k,tagName:u,preserveWhiteSpace:m});typeof S=="string"?v(S):S.length>0&&d&&(0,$a.isEmpty)(a)&&d(S,S.length-1,-1)}let{defaultView:r}=t.ownerDocument;return r.addEventListener("paste",o),()=>{r.removeEventListener("paste",o)}};var t_=l(it(),1),tP=l(dr(),1),Fne=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented)return;let{value:i,onMerge:s,onRemove:a}=e.current;if(n===t_.DELETE||n===t_.BACKSPACE){let{start:c,end:u,text:d}=i,f=n===t_.BACKSPACE,m=i.activeFormats&&!!i.activeFormats.length;if(!(0,tP.isCollapsed)(i)||m||f&&c!==0||!f&&u!==d.length)return;s?s(!f):a&&(0,tP.isEmpty)(i)&&f&&a(!f),r.preventDefault()}}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}};var vF=l(it(),1),o_=l(dr(),1),zne=e=>t=>{function o(i){if(i.keyCode!==vF.ENTER)return;let{onReplace:s,onSplit:a}=e.current;s&&a&&(i.__deprecatedOnSplit=!0)}function r(i){if(i.defaultPrevented||i.target!==t||i.keyCode!==vF.ENTER)return;let{value:s,onChange:a,disableLineBreaks:c,onSplitAtEnd:u,onSplitAtDoubleLineEnd:d,registry:f}=e.current;i.preventDefault();let{text:m,start:h,end:p}=s;i.shiftKey?c||a((0,o_.insert)(s,` `)):u&&h===p&&p===m.length?u():d&&h===p&&p===m.length&&m.slice(-2)===``?f.batch(()=>{let g={...s};g.start=g.end-2,a((0,o_.remove)(g)),d()}):c||a((0,o_.insert)(s,` `))}let{defaultView:n}=t.ownerDocument;return n.addEventListener("keydown",r),t.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",r),t.removeEventListener("keydown",o)}};var jne=e=>t=>{function o(){let{registry:r}=e.current;if(!r.select(_).isMultiSelecting())return;let n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",o),()=>{t.removeEventListener("focus",o)}};var ITe=[Cne,Ine,Pne,Rne,One,Ane,Lne,Vne,Fne,zne,jne];function oP(e){let t=(0,Eb.useRef)(e);(0,Eb.useInsertionEffect)(()=>{t.current=e});let o=(0,Eb.useMemo)(()=>ITe.map(r=>r(t)),[t]);return(0,Une.useRefEffect)(r=>{if(!e.isSelected)return;let n=o.map(i=>i(r));return()=>{n.forEach(i=>i())}},[o,e.isSelected])}var rP=l(dr(),1),nP=l(R(),1);var Hne=l(w(),1),Gne=l(jr(),1),PTe={},yF=Symbol("usesContext");function RTe({onChange:e,onFocus:t,value:o,forwardedRef:r,settings:n,isVisible:i}){let{name:s,edit:a,[yF]:c}=n,u=(0,nP.useContext)(_r),d=(0,nP.useMemo)(()=>c?Object.fromEntries(Object.entries(u).filter(([g])=>c.includes(g))):PTe,[c,u]);if(!a)return null;let f=(0,rP.getActiveFormat)(o,s),m=f!==void 0,h=(0,rP.getActiveObject)(o),p=h!==void 0&&h.type===s;return(0,Hne.jsx)(a,{isActive:m,isVisible:i,activeAttributes:m?f.attributes||{}:{},isObjectActive:p,activeObjectAttributes:p?h.attributes||{}:{},value:o,onChange:e,onFocus:t,contentRef:r,context:d},s)}function iP({formatTypes:e,...t}){return e.map(o=>(0,Gne.createElement)(RTe,{settings:o,...t,key:o.name}))}var Wne=l(R(),1),$ne=l($(),1),Kne=l(Re(),1);var SF=l(w(),1);function _F(e,t){if(Tb.isEmpty(e)){let o=eP(t);return o?`<${o}>`:""}return Array.isArray(e)?((0,Kne.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),$ne.children.toHTML(e)):typeof e=="string"?e:e.toHTMLString()}function r_({value:e,tagName:t,multiline:o,format:r,...n}){return e=(0,SF.jsx)(Wne.RawHTML,{children:_F(e,o)}),t?(0,SF.jsx)(t,{...n,children:e}):e}var Qne=l(R(),1),wF=l($(),1),Jne=l(dr(),1),eie=l(Re(),1);var Yne=l(R(),1),qne=l(Re(),1),sP=l(F(),1),Zne=l(it(),1),Ib=l(dr(),1);var xF=l(w(),1);function OTe({children:e,identifier:t,tagName:o="div",value:r="",onChange:n,multiline:i,...s},a){(0,qne.default)("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});let{clientId:c}=Ie(),{getSelectionStart:u,getSelectionEnd:d}=(0,sP.useSelect)(_),{selectionChange:f}=(0,sP.useDispatch)(_),m=eP(i);r=r||`<${m}>`;let p=`${r}<${m}>`.split(`<${m}>`);p.shift(),p.pop();function g(b){n(`<${m}>${b.join(`<${m}>`)}`)}return(0,xF.jsx)(o,{ref:a,children:p.map((b,v)=>(0,xF.jsx)(aP,{identifier:`${t}-${v}`,tagName:m,value:b,onChange:k=>{let y=p.slice();y[v]=k,g(y)},isSelected:void 0,onKeyDown:k=>{if(k.keyCode!==Zne.ENTER)return;k.preventDefault();let{offset:y}=u(),{offset:S}=d();if(typeof y!="number"||typeof S!="number")return;let x=(0,Ib.create)({html:b});x.start=y,x.end=S;let C=(0,Ib.split)(x).map(I=>(0,Ib.toHTMLString)({value:I})),B=p.slice();B.splice(v,1,...C),g(B),f(c,`${t}-${v+1}`,0,0)},onMerge:k=>{let y=p.slice(),S=0;if(k){if(!y[v+1])return;y.splice(v,2,y[v]+y[v+1]),S=y[v].length-1}else{if(!y[v-1])return;y.splice(v-1,2,y[v-1]+y[v]),S=y[v-1].length-1}g(y),f(c,`${t}-${v-(k?0:1)}`,S,S)},...s},v))})}var Xne=(0,Yne.forwardRef)(OTe);var tie=l(w(),1);function oie(e){return(0,Qne.forwardRef)((t,o)=>{let r=t.value,n=t.onChange;Array.isArray(r)&&((0,eie.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),r=wF.children.toHTML(t.value),n=s=>t.onChange(wF.children.fromDOM((0,Jne.__unstableCreateElement)(document,s).childNodes)));let i=t.multiline?Xne:e;return(0,tie.jsx)(i,{...t,value:r,onChange:n,ref:o})})}var rie=l(it(),1),Pb=l(R(),1);function CF({character:e,type:t,onUse:o}){let r=(0,Pb.useContext)(Rb),n=(0,Pb.useRef)();return n.current=o,(0,Pb.useEffect)(()=>{function i(s){rie.isKeyboardEvent[t](s,e)&&(n.current(),s.preventDefault())}return r.current.add(i),()=>{r.current.delete(i)}},[e,t]),null}var lP=l(A(),1),nie=l(it(),1),BF=l(w(),1);function EF({name:e,shortcutType:t,shortcutCharacter:o,...r}){let n,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&o&&(n=nie.displayShortcut[t](o)),(0,BF.jsx)(lP.Fill,{name:i,children:(0,BF.jsx)(lP.ToolbarButton,{...r,shortcut:n})})}var Ob=l(R(),1);function TF({inputType:e,onInput:t}){let o=(0,Ob.useContext)(Ab),r=(0,Ob.useRef)();return r.current=t,(0,Ob.useEffect)(()=>{function n(i){i.inputType===e&&(r.current(),i.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}},[e]),null}var di=l(w(),1),{useRichText:ATe}=M(aie.privateApis),Rb=(0,nr.createContext)();Rb.displayName="keyboardShortcutContext";var Ab=(0,nr.createContext)();Ab.displayName="inputEventContext";var iie=Symbol("instanceId");function die(e){let{__unstableMobileNoFocusOnMount:t,deleteEnter:o,placeholderTextColor:r,textAlign:n,selectionColor:i,tagsToEliminate:s,disableEditingMenu:a,fontSize:c,fontFamily:u,fontWeight:d,fontStyle:f,minWidth:m,maxWidth:h,disableSuggestions:p,disableAutocorrection:g,...b}=e;return b}function aP({children:e,tagName:t="div",value:o="",onChange:r,isSelected:n,multiline:i,inlineToolbar:s,wrapperClassName:a,autocompleters:c,onReplace:u,placeholder:d,allowedFormats:f,withoutInteractiveFormatting:m,onRemove:h,onMerge:p,onSplit:g,__unstableOnSplitAtEnd:b,__unstableOnSplitAtDoubleLineEnd:v,identifier:k,preserveWhiteSpace:y,__unstablePastePlainText:S,__unstableEmbedURLOnPaste:x,__unstableDisableFormats:C,disableLineBreaks:B,__unstableAllowPrefixTransformations:I,readOnly:P,...E},L){E=die(E),g&&(0,uie.default)("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});let T=(0,cP.useInstanceId)(aP),O=(0,nr.useRef)(),[D,U]=(0,nr.useState)(null),G=Ie(),{clientId:j,isSelected:z,name:W}=G,ee=G[Op],se=(0,nr.useContext)(_r),ce=(0,Dd.useRegistry)(),ie=je=>{if(!z)return{isSelected:!1};let{getSelectionStart:Eo,getSelectionEnd:Ze}=je(_),Ve=Eo(),gt=Ze(),To;return n===void 0?To=Ve.clientId===j&>.clientId===j&&(k?Ve.attributeKey===k:Ve[iie]===T):n&&(To=Ve.clientId===j),{selectionStart:To?Ve.offset:void 0,selectionEnd:To?gt.offset:void 0,isSelected:To}},{selectionStart:re,selectionEnd:Q,isSelected:Y}=(0,Dd.useSelect)(ie,[j,k,T,n,z]),{disableBoundBlock:J,bindingsPlaceholder:K,bindingsLabel:H}=(0,Dd.useSelect)(je=>{if(!ee?.[k])return{};let{__experimentalBlockBindingsSupportedAttributes:Eo}=je(_).getSettings();if(!Eo?.[W])return{};let Ve=ee[k],gt=(0,cie.getBlockBindingsSource)(Ve.source),To={};if(gt?.usesContext?.length)for(let ct of gt.usesContext)To[ct]=se[ct];let cr=!gt?.canUserEditValue?.({select:je,context:To,args:Ve.args});if(o.length>0)return{disableBoundBlock:cr,bindingsPlaceholder:null,bindingsLabel:null};let{getBlockAttributes:ge}=je(_),Ct=ge(j),Io=null;gt?.getFieldsList&&(Io=gt.getFieldsList({select:je,context:To})?.find(Wc=>(0,sie.default)(Wc.args,Ve?.args))?.label);let Ke=Io??gt?.label,te=cr?Ke:(0,Lb.sprintf)((0,Lb.__)("Add %s"),Ke),Le=cr?Ve?.args?.key||gt?.label:(0,Lb.sprintf)((0,Lb.__)("Empty %s; start writing to edit its value"),Ve?.args?.key||gt?.label);return{disableBoundBlock:cr,bindingsPlaceholder:Ct?.placeholder||te,bindingsLabel:Le}},[ee,k,W,o,j,se]),X=!!se?.["pattern/overrides"],ne=ee?.__default?.source==="core/pattern-overrides",ve=P||J||X&&!ne,{getSelectionStart:he,getSelectionEnd:xe,getBlockRootClientId:ze}=(0,Dd.useSelect)(_),{selectionChange:ot}=(0,Dd.useDispatch)(_),Wt=Bb({allowedFormats:f,disableFormats:C}),fo=!Wt||Wt.length>0,Do=(0,nr.useCallback)((je,Eo)=>{let Ze={},Ve=je===void 0&&Eo===void 0,gt={clientId:j,[k?"attributeKey":iie]:k||T};if(typeof je=="number"||Ve){if(Eo===void 0&&ze(j)!==ze(xe().clientId))return;Ze.start={...gt,offset:je}}if(typeof Eo=="number"||Ve){if(je===void 0&&ze(j)!==ze(he().clientId))return;Ze.end={...gt,offset:Eo}}ot(Ze)},[j,ze,xe,he,k,T,ot]),{value:rt,getValue:ar,onChange:xt,ref:At,formatTypes:Pe}=ATe({value:o,onChange:r,selectionStart:re,selectionEnd:Q,onSelectionChange:Do,placeholder:K||d,__unstableIsSelected:Y,__unstableDisableFormats:C,preserveWhiteSpace:y,__unstableDependencies:[t],allowedFormats:Wt,withoutInteractiveFormatting:m,__unstableFormatTypeHandlerContext:(0,nr.useMemo)(()=>({richTextIdentifier:k,blockClientId:j}),[k,j])}),wt=ZU({onReplace:u,completers:c,record:rt,onChange:xt});xne({html:o,value:rt});let qo=(0,nr.useRef)(new Set),$t=(0,nr.useRef)(new Set);function lr(){O.current?.focus()}let ln=t;return(0,di.jsxs)(di.Fragment,{children:[Y&&(0,di.jsx)(Rb.Provider,{value:qo,children:(0,di.jsx)(Ab.Provider,{value:$t,children:(0,di.jsxs)(lie.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:rt,onChange:xt,onFocus:lr}),(0,di.jsx)(iP,{value:rt,onChange:xt,onFocus:lr,formatTypes:Pe,forwardedRef:O})]})})}),Y&&fo&&(0,di.jsx)(Sne,{inline:s,editableContentElement:D}),(0,di.jsx)(ln,{role:"textbox","aria-multiline":!B,"aria-readonly":ve,...E,draggable:void 0,"aria-label":H||E["aria-label"]||d,...wt,ref:(0,cP.useMergeRefs)([At,L,wt.ref,E.ref,oP({registry:ce,getValue:ar,onChange:xt,__unstableAllowPrefixTransformations:I,formatTypes:Pe,onReplace:u,selectionChange:ot,isSelected:Y,disableFormats:C,value:rt,tagName:t,onSplit:g,__unstableEmbedURLOnPaste:x,pastePlainText:S,onMerge:p,onRemove:h,disableLineBreaks:B,onSplitAtEnd:b,onSplitAtDoubleLineEnd:v,keyboardShortcuts:qo,inputEvents:$t}),O,U]),contentEditable:!ve,suppressContentEditableWarning:!0,className:V("block-editor-rich-text__editable",E.className,"rich-text"),tabIndex:E.tabIndex===0&&!ve?null:E.tabIndex,"data-wp-block-attribute-key":k})]})}var n_=oie((0,nr.forwardRef)(aP));n_.Content=r_;n_.isEmpty=e=>!e||e.length===0;var IF=(0,nr.forwardRef)((e,t)=>{if(Ie()[f0]){let{children:n,tagName:i="div",value:s,onChange:a,isSelected:c,multiline:u,inlineToolbar:d,wrapperClassName:f,autocompleters:m,onReplace:h,placeholder:p,allowedFormats:g,withoutInteractiveFormatting:b,onRemove:v,onMerge:k,onSplit:y,__unstableOnSplitAtEnd:S,__unstableOnSplitAtDoubleLineEnd:x,identifier:C,preserveWhiteSpace:B,__unstablePastePlainText:I,__unstableEmbedURLOnPaste:P,__unstableDisableFormats:E,disableLineBreaks:L,__unstableAllowPrefixTransformations:T,readOnly:O,...D}=die(e);return(0,di.jsx)(i,{ref:t,...D,dangerouslySetInnerHTML:{__html:_F(s,u)||"
"}})}return(0,di.jsx)(n_,{ref:t,...e,readOnly:!1})});IF.Content=r_;IF.isEmpty=e=>!e||e.length===0;var Tb=IF;var PF=l(w(),1),mie=(0,fie.forwardRef)((e,t)=>(0,PF.jsx)(Tb,{ref:t,...e,__unstableDisableFormats:!0}));mie.Content=function({value:t="",tagName:o="div",...r}){return(0,PF.jsx)(o,{...r,children:t})};var pie=mie;var RF=l(w(),1),LTe=(0,gie.forwardRef)(({__experimentalVersion:e,...t},o)=>{if(e===2)return(0,RF.jsx)(pie,{ref:o,...t});let{className:r,onChange:n,...i}=t;return(0,RF.jsx)(hie.default,{ref:o,className:V("block-editor-plain-text",r),onChange:s=>n(s.target.value),...i})}),bie=LTe;var Ka=l(N(),1),yie=l(R(),1),Sie=l(A(),1);var kie=l(Z(),1),vie=l(A(),1),uP=l(N(),1),op=l(w(),1);function dP({property:e,viewport:t,desc:o}){let r=(0,kie.useInstanceId)(dP),n=o||(0,uP.sprintf)((0,uP._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),e,t.label);return(0,op.jsxs)(op.Fragment,{children:[(0,op.jsx)("span",{"aria-describedby":`rbc-desc-${r}`,children:t.label}),(0,op.jsx)(vie.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`,children:n})]})}var Ya=l(w(),1);function NTe(e){let{title:t,property:o,toggleLabel:r,onIsResponsiveChange:n,renderDefaultControl:i,renderResponsiveControls:s,isResponsive:a=!1,defaultLabel:c={id:"all",label:(0,Ka._x)("All","screen sizes")},viewports:u=[{id:"small",label:(0,Ka.__)("Small screens")},{id:"medium",label:(0,Ka.__)("Medium screens")},{id:"large",label:(0,Ka.__)("Large screens")}]}=e;if(!t||!o||!i)return null;let d=r||(0,Ka.sprintf)((0,Ka.__)("Use the same %s on all screen sizes."),o),f=(0,Ka.__)("Choose whether to use the same value for all screen sizes or a unique value for each screen size."),m=i((0,Ya.jsx)(dP,{property:o,viewport:c}),c),h=()=>u.map(p=>(0,Ya.jsx)(yie.Fragment,{children:i((0,Ya.jsx)(dP,{property:o,viewport:p}),p)},p.id));return(0,Ya.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,Ya.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,Ya.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,Ya.jsx)(Sie.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:d,checked:!a,onChange:n,help:f}),(0,Ya.jsxs)("div",{className:V("block-editor-responsive-block-control__group",{"is-responsive":a}),children:[!a&&m,a&&(s?s(u):h())]})]})]})}var _ie=NTe;var fP=l(A(),1);var xie=l(w(),1);function wie({units:e,...t}){let[o]=me("spacing.units"),r=(0,fP.__experimentalUseCustomUnits)({availableUnits:o||["%","px","em","rem","vw"],units:e});return(0,xie.jsx)(fP.__experimentalUnitControl,{units:r,...t})}var i_=l(N(),1),Cie=l(R(),1),Nb=l(A(),1);var qa=l(w(),1);function MTe({url:e,onChange:t}){let[o,r]=(0,Cie.useReducer)(i=>!i,!1),n=i=>{i.preventDefault(),r()};return(0,qa.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,qa.jsx)(Nb.Button,{size:"compact",icon:fn,label:e?(0,i_.__)("Edit link"):(0,i_.__)("Insert link"),onClick:r,className:"components-toolbar__control",isPressed:!!e}),o&&(0,qa.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:n,children:(0,qa.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,qa.jsx)(Nb.Button,{__next40pxDefaultSize:!0,className:"block-editor-url-input__back",icon:Qk,label:(0,i_.__)("Close"),onClick:r}),(0,qa.jsx)(Id,{value:e||"",onChange:t,suffix:(0,qa.jsx)(Nb.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,qa.jsx)(Nb.Button,{size:"small",icon:kl,label:(0,i_.__)("Submit"),type:"submit"})})})]})})]})}var Bie=MTe;var In=l(N(),1),rs=l(R(),1),Rie=l(Fe(),1),Ho=l(A(),1);var Oie=l(dn(),1);var yt=l(w(),1),OF="none",Eie="custom",Tie="media",Iie="attachment",Pie=["noreferrer","noopener"],Aie=({linkDestination:e,onChangeUrl:t,url:o,mediaType:r="image",mediaUrl:n,mediaLink:i,linkTarget:s,linkClass:a,rel:c,showLightboxSetting:u,lightboxEnabled:d,onSetLightbox:f,resetLightbox:m})=>{let[h,p]=(0,rs.useState)(!1),[g,b]=(0,rs.useState)(null),v=()=>{p(!0)},[k,y]=(0,rs.useState)(!1),[S,x]=(0,rs.useState)(null),C=(0,rs.useRef)(null),B=(0,rs.useRef)();(0,rs.useEffect)(()=>{if(!B.current)return;(Rie.focus.focusable.find(B.current)[0]||B.current).focus()},[k,o,d]);let I=()=>{(e===Tie||e===Iie)&&x(""),y(!0)},P=()=>{y(!1)},E=()=>{x(null),P(),p(!1)},L=Y=>{let J=Y?"_blank":void 0,K;if(J){let H=(c??"").split(" ");Pie.forEach(X=>{H.includes(X)||H.push(X)}),K=H.join(" ")}else{let H=(c??"").split(" ").filter(X=>Pie.includes(X)===!1);K=H.length?H.join(" "):void 0}return{linkTarget:J,rel:K}},T=()=>Y=>{let J=C.current;J&&J.contains(Y.target)||(p(!1),x(null),P())},O=()=>Y=>{if(S){let J=U().find(K=>K.url===S)?.linkDestination||Eie;t({href:(0,Oie.prependHTTPS)(S),linkDestination:J,lightbox:{enabled:!1}})}P(),x(null),Y.preventDefault()},D=()=>{t({linkDestination:OF,href:""})},U=()=>{let Y=[{linkDestination:Tie,title:(0,In.__)("Link to image file"),url:r==="image"?n:void 0,icon:sv}];return r==="image"&&i&&Y.push({linkDestination:Iie,title:(0,In.__)("Link to attachment page"),url:r==="image"?i:void 0,icon:vl}),Y},G=Y=>{let J=U(),K;Y?K=(J.find(H=>H.url===Y)||{linkDestination:Eie}).linkDestination:K=OF,t({linkDestination:K,href:Y})},j=Y=>{let J=L(Y);t(J)},z=Y=>{t({rel:Y})},W=Y=>{t({linkClass:Y})},ee=(0,yt.jsxs)(Ho.__experimentalVStack,{spacing:"3",children:[(0,yt.jsx)(Ho.ToggleControl,{label:(0,In.__)("Open in new tab"),onChange:j,checked:s==="_blank"}),(0,yt.jsx)(Ho.TextControl,{__next40pxDefaultSize:!0,label:(0,In.__)("Link relation"),value:c??"",onChange:z,help:(0,rs.createInterpolateElement)((0,In.__)("The Link Relation attribute defines the relationship between a linked resource and the current document."),{a:(0,yt.jsx)(Ho.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})})}),(0,yt.jsx)(Ho.TextControl,{__next40pxDefaultSize:!0,label:(0,In.__)("Link CSS class"),value:a||"",onChange:W})]}),se=S!==null?S:o,ce=!d||d&&!u,ie=!se&&ce,re=(U().find(Y=>Y.linkDestination===e)||{}).title,Q=()=>{if(d&&u&&!o&&!k)return(0,yt.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,yt.jsx)(we,{icon:px}),(0,yt.jsxs)("div",{className:"text",children:[(0,yt.jsx)("p",{children:(0,In.__)("Enlarge on click")}),(0,yt.jsx)("p",{className:"description",children:(0,In.__)("Scales the image with a lightbox effect")})]}),(0,yt.jsx)(Ho.Button,{icon:Ci,label:(0,In.__)("Disable enlarge on click"),onClick:()=>{f?.(!1)},size:"compact"})]});if(!o||k)return(0,yt.jsx)(Ld.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:se,onChangeInputValue:x,onSubmit:O(),autocompleteRef:C});if(o&&!k)return(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)(Ld.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:I,urlLabel:re}),(0,yt.jsx)(Ho.Button,{icon:Ci,label:(0,In.__)("Remove link"),onClick:()=>{D(),m?.()},size:"compact"})]})};return(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)(Ho.ToolbarButton,{icon:fn,className:"components-toolbar__control",label:(0,In.__)("Link"),"aria-expanded":h,onClick:v,ref:b,isActive:!!o||d&&u}),h&&(0,yt.jsx)(Ld,{ref:B,anchor:g,onFocusOutside:T(),onClose:E,renderSettings:ce?()=>ee:null,additionalControls:ie&&(0,yt.jsxs)(Ho.NavigableMenu,{children:[U().map(Y=>(0,yt.jsx)(Ho.MenuItem,{icon:Y.icon,iconPosition:"left",onClick:()=>{x(null),G(Y.url),P()},children:Y.title},Y.linkDestination)),u&&(0,yt.jsx)(Ho.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:px,info:(0,In.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{x(null),t({linkDestination:OF,href:""}),f?.(!0),P()},children:(0,In.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:Q()})]})};var Db=l(A(),1),Kie=l(R(),1),hP=l(N(),1);var Lie=l(R(),1),LF=l(N(),1);var AF=[],DTe=new Intl.Collator("und",{numeric:!0}).compare;function mP(){let[e,t,o,r]=me("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),n=e??AF,i=t??AF,s=o&&r!==!1?o:AF;return(0,Lie.useMemo)(()=>{let a=[{name:(0,LF.__)("None"),slug:"0",size:0},...n,...i,...s];return a.every(({slug:c})=>/^[0-9]/.test(c))&&a.sort((c,u)=>DTe(c.slug,u.slug)),a.length>QU?[{name:(0,LF.__)("Default"),slug:"default",size:void 0},...a]:a},[n,i,s])}var Nie=l(R(),1),Mie=l(F(),1),pP=l(N(),1),Die=l(A(),1);var Vie=l(w(),1),VTe={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function Mb({icon:e,isMixed:t=!1,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,side:a,spacingSizes:c,type:u,value:d,...f}){let m=(0,Mie.useSelect)(S=>S(_).getSettings()?.disableCustomSpacingSizes),[h]=me("spacing.units"),p=(0,Die.__experimentalUseCustomUnits)({availableUnits:h||["px","em","rem"]}),g=(0,Nie.useMemo)(()=>c?.map(S=>({name:S.name,slug:S.slug,size:S.size}))||[],[c]),b=(_u.includes(a)||["vertical","horizontal"].includes(a))&&s?ga[a]:"",v=s?u?.toLowerCase():u,k=(0,pP.sprintf)((0,pP._x)("%1$s %2$s","spacing"),b,v).trim(),y=p[0]?.value||"px";return(0,Vie.jsx)(Um,{allowNegativeOnDrag:o<0,ariaLabel:k,className:"spacing-sizes-control",customValueSettings:VTe,disableCustomValues:m,icon:e,isMixed:t,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,presets:g,presetType:"spacing",selectedUnit:y,units:p,value:d,...f})}var s_=l(w(),1),Fie=["vertical","horizontal"];function zie({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let c=d=>f=>{if(!t)return;let m={...Object.keys(a).reduce((h,p)=>(h[p]=ah(a[p],i),h),{})};d==="vertical"&&(m.top=f,m.bottom=f),d==="horizontal"&&(m.left=f,m.right=f),t(m)},u=n?.length?Fie.filter(d=>xM(n,d)):Fie;return(0,s_.jsx)(s_.Fragment,{children:u.map(d=>{let f=d==="vertical"?a.top:a.left;return(0,s_.jsx)(Mb,{icon:nC[d],label:ga[d],minimumCustomValue:e,onChange:c(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:f,withInputField:!1},`spacing-sizes-control-${d}`)})})}var a_=l(w(),1);function jie({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let c=n?.length?_u.filter(d=>n.includes(d)):_u,u=d=>f=>{let m={...Object.keys(a).reduce((h,p)=>(h[p]=ah(a[p],i),h),{})};m[d]=f,t(m)};return(0,a_.jsx)(a_.Fragment,{children:c.map(d=>(0,a_.jsx)(Mb,{icon:nC[d],label:ga[d],minimumCustomValue:e,onChange:u(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:a[d],withInputField:!1},`spacing-sizes-control-${d}`))})}var Uie=l(w(),1);function Hie({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,values:c}){let u=d=>f=>{let m={...Object.keys(c).reduce((h,p)=>(h[p]=ah(c[p],s),h),{})};m[d]=f,t(m)};return(0,Uie.jsx)(Mb,{label:ga[i],minimumCustomValue:e,onChange:u(i),onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,value:c[i],withInputField:!1})}var Gie=l(A(),1);var NF=l(N(),1),Wie=l(w(),1);function $ie({isLinked:e,...t}){let o=e?(0,NF.__)("Unlink sides"):(0,NF.__)("Link sides");return(0,Wie.jsx)(Gie.Button,{...t,size:"small",icon:e?fn:Ci,iconSize:24,label:o})}var Za=l(w(),1);function Vb({inputProps:e,label:t,minimumCustomValue:o=0,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,sides:a=_u,useSelect:c,values:u}){let d=mP(),f=u||JU,m=a?.length===1,h=a?.includes("horizontal")&&a?.includes("vertical")&&a?.length===2,[p,g]=(0,Kie.useState)(tH(f,a)),b=()=>{g(p===Bl.axial?Bl.custom:Bl.axial)},k={...e,minimumCustomValue:o,onChange:C=>{let B={...u,...C};r(B)},onMouseOut:n,onMouseOver:i,sides:a,spacingSizes:d,type:t,useSelect:c,values:f},y=()=>p===Bl.axial?(0,Za.jsx)(zie,{...k}):p===Bl.custom?(0,Za.jsx)(jie,{...k}):(0,Za.jsx)(Hie,{side:p,...k,showSideInLabel:s}),S=_u.includes(p)&&s?ga[p]:"",x=(0,hP.sprintf)((0,hP._x)("%1$s %2$s","spacing"),t,S).trim();return(0,Za.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,Za.jsxs)(Db.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,Za.jsx)(Db.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:x}),!m&&!h&&(0,Za.jsx)($ie,{label:t,onClick:b,isLinked:p===Bl.axial})]}),(0,Za.jsx)(Db.__experimentalVStack,{spacing:.5,children:y()})]})}var Yie=l(Re(),1);function qie(){return(0,Yie.default)("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}var gP=l(R(),1);function Zie(e){let[t,o]=(0,gP.useState)(window.innerWidth);(0,gP.useEffect)(()=>{if(e==="Desktop")return;let i=()=>o(window.innerWidth);return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e]);let r=i=>{let s;switch(i){case"Tablet":s=781;break;case"Mobile":s=479;break;default:return null}return s{let s=i==="Mobile"?"768px":"1024px",a="40px",c="auto";switch(i){case"Tablet":case"Mobile":return{width:r(i),marginTop:a,marginBottom:a,marginLeft:c,marginRight:c,height:s,overflowY:"auto"};default:return{marginLeft:c,marginRight:c}}})(e)}var ok=l(N(),1),jd=l($(),1),jae=l(A(),1),i4=l(F(),1),Uae=l(R(),1);var Fb=l(A(),1),bP=l(N(),1),Xie=l(F(),1),kP=l($(),1);var rp=l(w(),1);function FTe({block:e,onNavigateToEntityRecord:t,isSyncedPattern:o,isTemplatePartBlock:r}){let n=e?.attributes||{};return(0,rp.jsx)(Fb.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,rp.jsx)(Fb.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{if(o)t({postId:n.ref,postType:"wp_block"});else if(r){let{theme:s,slug:a}=n,c=s&&a?`${s}//${a}`:null;c&&t({postId:c,postType:"wp_template_part"})}},children:(0,bP.__)("Edit original")})})}function zTe({clientId:e,editedContentOnlySection:t,editContentOnlySection:o,stopEditingContentOnlySection:r}){return(0,rp.jsx)(Fb.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,rp.jsx)(Fb.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{t?r():o(e)},children:t?(0,bP.__)("Exit pattern"):(0,bP.__)("Edit pattern")})})}function Qie({clientId:e}){let{isWithinSection:t,isWithinEditedSection:o,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i}=lT(e),{block:s,onNavigateToEntityRecord:a,canEdit:c}=(0,Xie.useSelect)(m=>{let{getBlock:h,getSettings:p,canEditBlock:g}=m(_);return{block:h(e),onNavigateToEntityRecord:p().onNavigateToEntityRecord,canEdit:g(e)}},[e]);if(!c||!t&&!o)return null;let u=(0,kP.isReusableBlock)(s),d=(0,kP.isTemplatePart)(s);return(u||d)&&a?(0,rp.jsx)(FTe,{block:s,onNavigateToEntityRecord:a,isSyncedPattern:u,isTemplatePartBlock:d}):(0,rp.jsx)(zTe,{clientId:e,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i})}var Jie=l(F(),1),ese=l(N(),1),tse=l(A(),1),ose=l(R(),1);var rse=l(w(),1);function vP(){let e=(0,Jie.useSelect)(r=>r(_).getBlockSelectionStart(),[]),t=(0,ose.useRef)();return Kf(e,t),e?(0,rse.jsx)(tse.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current?.focus()},children:(0,ese.__)("Skip to the selected block")}):null}var yP=l(N(),1),nse=l(F(),1);var ise=l(A(),1);var l_=l(w(),1);function MF(){let e=(0,nse.useSelect)(t=>t(_).getSelectedBlockCount(),[]);return(0,l_.jsxs)(ise.__experimentalHStack,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,l_.jsx)(Ae,{icon:Bf,showColors:!0}),(0,l_.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,yP.sprintf)((0,yP._n)("%d Block","%d Blocks",e),e)})]})}var tk=l(A(),1),ra=l(R(),1),Lae=l(Xp(),1),ek=l(F(),1);var c_=l(N(),1),SP={name:"settings",title:(0,c_.__)("Settings"),value:"settings",icon:rA},_P={name:"styles",title:(0,c_.__)("Styles"),value:"styles",icon:vN},xP={name:"content",title:(0,c_.__)("Content"),value:"content",icon:vl},Sc={name:"list",title:(0,c_.__)("List View"),value:"list-view",icon:av};var EP=l(A(),1);var u_=l(A(),1),sse=l(N(),1);var d_=l(w(),1),jTe=({initialOpen:e=!1})=>{let t=(0,u_.__experimentalUseSlotFills)(nd.slotName),o=(0,u_.__experimentalUseSlotFills)(aS.name),r=!!(t&&t.length),n=!!(o&&o.length);return!r&&!n?null:(0,d_.jsxs)(u_.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,sse.__)("Advanced"),initialOpen:e,children:[(0,d_.jsx)(fe.Slot,{group:"advanced"}),(0,d_.jsx)(aS.Slot,{})]})},wP=jTe;var zb=l(A(),1),CP=l(F(),1),DF=l(N(),1);var f_=l(w(),1),UTe=()=>{let{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:o}=(0,CP.useSelect)(s=>{let{getBlocksByClientId:a,getSelectedBlockClientIds:c}=s(_),u=c(),d=a(u);return{selectedClientIds:u,selectedBlocks:d,hasPositionAttribute:d?.some(({attributes:f})=>!!f?.style?.position?.type)}},[]),{updateBlockAttributes:r}=(0,CP.useDispatch)(_),n=Ro();function i(){if(!e?.length||!t?.length)return;let s=Object.fromEntries(t?.map(({clientId:a,attributes:c})=>[a,{style:Me({...c?.style,position:{...c?.style?.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}]));r(e,s,!0)}return(0,f_.jsx)(zb.__experimentalToolsPanel,{className:"block-editor-block-inspector__position",label:(0,DF.__)("Position"),resetAll:i,dropdownMenuProps:n,children:(0,f_.jsx)(zb.__experimentalToolsPanelItem,{isShownByDefault:o,label:(0,DF.__)("Position"),hasValue:()=>o,onDeselect:i,children:(0,f_.jsx)(fe.Slot,{group:"position"})})})},HTe=()=>{let e=(0,zb.__experimentalUseSlotFills)(Wi.position.name);return!(e&&e.length)?null:(0,f_.jsx)(UTe,{})},BP=HTe;var Xa=l(w(),1),GTe=({showAdvancedControls:e=!1})=>{let t=(0,EP.__experimentalUseSlotFills)(Wi.default.name),o=(0,EP.__experimentalUseSlotFills)(Wi.position.name),r=(0,EP.__experimentalUseSlotFills)(Wi.bindings.name),n=!!t?.length||!!o?.length||!!r?.length;return(0,Xa.jsxs)(Xa.Fragment,{children:[(0,Xa.jsx)(fe.Slot,{}),(0,Xa.jsx)(BP,{}),(0,Xa.jsx)(fe.Slot,{group:"bindings"}),e&&(0,Xa.jsx)("div",{children:(0,Xa.jsx)(wP,{initialOpen:!n})})]})},ase=GTe;var Qb=l(N(),1),p2=l(F(),1);var S_=l($(),1),KF=l(A(),1),Xb=l(R(),1),dae=l(ut(),1),fae=l(F(),1);var $F={};Pp($F,{AdvancedPanel:()=>XP,BackgroundPanel:()=>r2,BorderPanel:()=>UP,ColorPanel:()=>$P,DimensionsPanel:()=>VP,FiltersPanel:()=>YP,ImageSettingsPanel:()=>oae,TypographyPanel:()=>AP,useHasBackgroundPanel:()=>y_,useHasBorderPanel:()=>jP,useHasBorderPanelControls:()=>h_,useHasColorPanel:()=>WP,useHasDimensionsPanel:()=>DP,useHasFiltersPanel:()=>Jse,useHasImageSettingsPanel:()=>tae,useHasTypographyPanel:()=>OP,useSettingsForBlockElement:()=>IP});var TP=l(R(),1),lse=l(F(),1),VF=l($(),1),np=l(N(),1);function IP(e,t,o){let{supportedStyles:r,supports:n}=(0,lse.useSelect)(i=>({supportedStyles:M(i(VF.store)).getSupportedStyles(t,o),supports:i(VF.store).getBlockType(t)?.supports}),[t,o]);return(0,TP.useMemo)(()=>{let i={...e};return r.includes("fontSize")||(i.typography={...i.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),r.includes("fontFamily")||(i.typography={...i.typography,fontFamilies:{}}),i.color={...i.color,text:i.color?.text&&r.includes("color"),background:i.color?.background&&(r.includes("background")||r.includes("backgroundColor")),button:i.color?.button&&r.includes("buttonColor"),heading:i.color?.heading&&r.includes("headingColor"),link:i.color?.link&&r.includes("linkColor"),caption:i.color?.caption&&r.includes("captionColor")},r.includes("background")||(i.color.gradients=[],i.color.customGradient=!1),r.includes("filter")||(i.color.defaultDuotone=!1,i.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","textIndent","writingMode"].forEach(s=>{r.includes(s)||(i.typography={...i.typography,[s]:!1})}),r.includes("textIndent")&&(i.typography={...i.typography,textIndent:i.typography?.textIndent??"subsequent"}),r.includes("columnCount")||(i.typography={...i.typography,textColumns:!1}),["contentSize","wideSize"].forEach(s=>{r.includes(s)||(i.layout={...i.layout,[s]:!1})}),["padding","margin","blockGap"].forEach(s=>{r.includes(s)||(i.spacing={...i.spacing,[s]:!1});let a=Array.isArray(n?.spacing?.[s])?n?.spacing?.[s]:n?.spacing?.[s]?.sides;a?.length&&i.spacing?.[s]&&(i.spacing={...i.spacing,[s]:{...i.spacing?.[s],sides:a}})}),["aspectRatio","height","minHeight","width"].forEach(s=>{r.includes(s)||(i.dimensions={...i.dimensions,[s]:!1})}),["radius","color","style","width"].forEach(s=>{r.includes("border"+s.charAt(0).toUpperCase()+s.slice(1))||(i.border={...i.border,[s]:!1})}),["backgroundImage","backgroundSize"].forEach(s=>{r.includes(s)||(i.background={...i.background,[s]:!1})}),i.shadow=r.includes("shadow")?i.shadow:!1,i},[e,r,n])}function Qa(e){let t=e?.color?.palette?.custom,o=e?.color?.palette?.theme,r=e?.color?.palette?.default,n=e?.color?.defaultPalette;return(0,TP.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,np._x)("Theme","Indicates this palette comes from the theme."),colors:o}),n&&r&&r.length&&i.push({name:(0,np._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&i.push({name:(0,np._x)("Custom","Indicates this palette is created by the user."),colors:t}),i},[t,o,r,n])}function m_(e){let t=e?.color?.gradients?.custom,o=e?.color?.gradients?.theme,r=e?.color?.gradients?.default,n=e?.color?.defaultGradients;return(0,TP.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,np._x)("Theme","Indicates this palette comes from the theme."),gradients:o}),n&&r&&r.length&&i.push({name:(0,np._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&i.push({name:(0,np._x)("Custom","Indicates this palette is created by the user."),gradients:t}),i},[t,o,r,n])}var io=l(A(),1),Mo=l(N(),1),Ub=l(R(),1);var jb=l(N(),1);var cse=l(R(),1),PP=l(A(),1),FF=l(w(),1),WTe=[{label:(0,jb.__)("Align text left"),value:"left",icon:eu},{label:(0,jb.__)("Align text center"),value:"center",icon:_f},{label:(0,jb.__)("Align text right"),value:"right",icon:tu},{label:(0,jb.__)("Justify text"),value:"justify",icon:AO}],$Te=["left","center","right"];function RP({className:e,value:t,onChange:o,options:r=$Te}){let n=(0,cse.useMemo)(()=>WTe.filter(i=>r.includes(i.value)),[r]);return n.length?(0,FF.jsx)(PP.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,jb.__)("Text alignment"),className:V("block-editor-text-alignment-control",e),value:t,onChange:i=>{o(i===t?void 0:i)},children:n.map(i=>(0,FF.jsx)(PP.__experimentalToggleGroupControlOptionIcon,{value:i.value,icon:i.icon,label:i.label},i.value))}):null}var No=l(A(),1),p_=l(N(),1);var ns=l(w(),1);function use({__next40pxDefaultSize:e=!1,value:t,onChange:o,__unstableInputWidth:r="60px",withSlider:n=!1,hasBottomMargin:i=!1,help:s,...a}){let[c]=me("spacing.units"),u=(0,No.__experimentalUseCustomUnits)({availableUnits:c||["px","em","rem","ch","%","vw","vh"],defaultValues:{px:16,em:2,rem:2,ch:2}}),[d,f]=(0,No.__experimentalParseQuantityAndUnitFromRawValue)(t,u),m=!!f&&["em","rem","%","ch","vw","vh"].includes(f);return n?(0,ns.jsxs)(No.__experimentalView,{style:i?{marginBottom:12}:void 0,children:[(0,ns.jsx)(No.BaseControl.VisualLabel,{children:(0,p_.__)("Line indent")}),(0,ns.jsxs)(No.Flex,{children:[(0,ns.jsx)(No.FlexItem,{isBlock:!0,children:(0,ns.jsx)(No.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,p_.__)("Line indent"),labelPosition:"top",hideLabelFromVision:!0,value:t,onChange:o,size:a.size,units:u,__unstableInputWidth:r,min:0})}),n&&(0,ns.jsx)(No.FlexItem,{isBlock:!0,children:(0,ns.jsx)(No.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,ns.jsx)(No.RangeControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,p_.__)("Line indent"),hideLabelFromVision:!0,value:d,withInputField:!1,onChange:h=>{o?.(h===void 0?void 0:h+(f??"px"))},min:0,max:m?10:100,step:m?.1:1,initialPosition:0})})})]}),s&&(0,ns.jsx)("p",{className:"components-base-control__help",children:s})]}):(0,ns.jsx)(No.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...a,label:(0,p_.__)("Line indent"),value:t,__unstableInputWidth:r,units:u,onChange:o,help:s})}function fse(e,t){let o=e?.typography?.fontFamilies,r=["default","theme","custom"].flatMap(i=>o?.[i]??[]),n=r.find(i=>i.fontFamily===t)?.fontFace??[];return{fontFamilies:r,fontFamilyFaces:n}}function dse(e,t){return t=typeof t=="number"?t.toString():t,!t||typeof t!="string"?"":!e||e.length===0?t:e?.reduce((r,{value:n})=>{let i=Math.abs(parseInt(n)-parseInt(t)),s=Math.abs(parseInt(r)-parseInt(t));return ir.value===t)?t:t==="oblique"&&!e.find(r=>r.value==="oblique")?"italic":""}function mse(e,t,o){let r=t,n=o,{fontStyles:i,fontWeights:s,combinedStyleAndWeightOptions:a}=sb(e),c=i?.some(({value:d})=>d===t),u=s?.some(({value:d})=>d?.toString()===o?.toString());return c||(r=t?KTe(i,t):a?.find(d=>d.style.fontWeight===dse(s,o))?.style?.fontStyle),u||(n=o?dse(s,o):a?.find(d=>d.style.fontStyle===(r||t))?.style?.fontWeight),{nearestFontStyle:r,nearestFontWeight:n}}var Je=l(w(),1),YTe=1,qTe=6;function OP(e){let t=hse(e),o=gse(e),r=bse(e),n=kse(e),i=yse(e),s=vse(e),a=Sse(e),c=wse(e),u=_se(e),d=xse(e),f=pse(e);return t||o||r||n||i||s||f||a||c||u||d}function pse(e){return e?.typography?.defaultFontSizes!==!1&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function hse(e){return["default","theme","custom"].some(t=>e?.typography?.fontFamilies?.[t]?.length)}function gse(e){return e?.typography?.lineHeight}function bse(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function ZTe(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,Mo.__)("Appearance"):(0,Mo.__)("Font style"):(0,Mo.__)("Font weight")}function kse(e){return e?.typography?.letterSpacing}function vse(e){return e?.typography?.textTransform}function yse(e){return e?.typography?.textAlign}function Sse(e){return e?.typography?.textDecoration}function _se(e){return e?.typography?.writingMode}function xse(e){return e?.typography?.textColumns}function wse(e){return e?.typography?.textIndent}function XTe(e){let t=e?.typography?.fontSizes,o=!!e?.typography?.defaultFontSizes;return[...t?.custom??[],...t?.theme??[],...o?t?.default??[]:[]]}function QTe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=Ro(),s=()=>{let a=e(o);t(a)};return(0,Je.jsx)(io.__experimentalToolsPanel,{label:(0,Mo.__)("Typography"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var JTe={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,textIndent:!0,writingMode:!0,textColumns:!0};function AP({as:e=QTe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=JTe,isGlobalStyles:a=!1}){let c=te=>wn({settings:n},"",te),u=hse(n),d=c(r?.typography?.fontFamily),{fontFamilies:f,fontFamilyFaces:m}=(0,Ub.useMemo)(()=>fse(n,d),[n,d]),h=te=>{let Le=f?.find(({fontFamily:cn})=>cn===te)?.slug,ct=pe(t,["typography","fontFamily"],Le?`var:preset|font-family|${Le}`:te||void 0),Wc=f?.find(({fontFamily:cn})=>cn===te)?.fontFace??[],{fontStyles:da,fontWeights:Ep}=sb(Wc),Uk=da?.some(({value:cn})=>cn===T),gf=Ep?.some(({value:cn})=>cn?.toString()===O?.toString());if(!Uk||!gf){let{nearestFontStyle:cn,nearestFontWeight:Tp}=mse(Wc,T,O);cn||Tp?ct={...ct,typography:{...ct?.typography,fontStyle:cn||void 0,fontWeight:Tp||void 0}}:(T||O)&&(ct={...ct,typography:{...ct?.typography,fontStyle:void 0,fontWeight:void 0}})}o(ct)},p=()=>!!t?.typography?.fontFamily,g=()=>h(void 0),b=pse(n),v=!n?.typography?.customFontSize,k=XTe(n),y=c(r?.typography?.fontSize),S=(()=>{let te=r?.typography?.fontSize;if(!te||typeof te!="string")return;if(te.startsWith("var:preset|font-size|"))return te.replace("var:preset|font-size|","");let Le=te.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);if(Le)return Le[1]})(),x=(te,Le)=>{let ct=Le?.slug?`var:preset|font-size|${Le?.slug}`:te;o(pe(t,["typography","fontSize"],ct||void 0))},C=()=>!!t?.typography?.fontSize,B=()=>x(void 0),I=bse(n),P=ZTe(n),E=n?.typography?.fontStyle,L=n?.typography?.fontWeight,T=c(r?.typography?.fontStyle),O=c(r?.typography?.fontWeight),D=(0,Ub.useCallback)(({fontStyle:te,fontWeight:Le})=>{(te!==T||Le!==O)&&o({...t,typography:{...t?.typography,fontStyle:te||void 0,fontWeight:Le||void 0}})},[T,O,o,t]),U=()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,G=(0,Ub.useCallback)(()=>{D({})},[D]),j=gse(n),z=c(r?.typography?.lineHeight),W=te=>{o(pe(t,["typography","lineHeight"],te||void 0))},ee=()=>t?.typography?.lineHeight!==void 0,se=()=>W(void 0),ce=kse(n),ie=c(r?.typography?.letterSpacing),re=te=>{o(pe(t,["typography","letterSpacing"],te||void 0))},Q=()=>!!t?.typography?.letterSpacing,Y=()=>re(void 0),J=wse(n),K=c(r?.typography?.textIndent),X=(n?.typography?.textIndent??"subsequent")==="all",ne=te=>{o(pe(t,["typography","textIndent"],te||void 0))},le=te=>{o({...t,settings:{typography:{textIndent:te?"all":"subsequent"}}})},ve=()=>!!t?.typography?.textIndent,he=()=>{o(pe(t,["typography","textIndent"],void 0))},xe=X?(0,Mo.__)("Indents the first line of all paragraphs."):(0,Mo.__)("Indents the first line of each paragraph after the first one."),ze=xse(n),ot=c(r?.typography?.textColumns),Wt=te=>{o(pe(t,["typography","textColumns"],te||void 0))},fo=()=>!!t?.typography?.textColumns,Do=()=>Wt(void 0),rt=vse(n),ar=c(r?.typography?.textTransform),xt=te=>{o(pe(t,["typography","textTransform"],te||void 0))},At=()=>!!t?.typography?.textTransform,Pe=()=>xt(void 0),wt=Sse(n),qo=c(r?.typography?.textDecoration),$t=te=>{o(pe(t,["typography","textDecoration"],te||void 0))},lr=()=>!!t?.typography?.textDecoration,ln=()=>$t(void 0),je=_se(n),Eo=c(r?.typography?.writingMode),Ze=te=>{o(pe(t,["typography","writingMode"],te||void 0))},Ve=()=>!!t?.typography?.writingMode,gt=()=>Ze(void 0),To=yse(n),cr=c(r?.typography?.textAlign),ge=te=>{o(pe(t,["typography","textAlign"],te||void 0))},Ct=()=>!!t?.typography?.textAlign,Io=()=>ge(void 0),Ke=(0,Ub.useCallback)(te=>({...te,typography:{}}),[]);return(0,Je.jsxs)(e,{resetAllFilter:Ke,value:t,onChange:o,panelId:i,children:[u&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Font"),hasValue:p,onDeselect:g,isShownByDefault:s.fontFamily,panelId:i,children:(0,Je.jsx)(nI,{fontFamilies:f,value:d,onChange:h,size:"__unstable-large"})}),b&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Size"),hasValue:C,onDeselect:B,isShownByDefault:s.fontSize,panelId:i,children:(0,Je.jsx)(io.FontSizePicker,{value:S||y,valueMode:S?"slug":"literal",onChange:x,fontSizes:k,disableCustomFontSizes:v,withReset:!1,withSlider:!0,size:"__unstable-large"})}),I&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:P,hasValue:U,onDeselect:G,isShownByDefault:s.fontAppearance,panelId:i,children:(0,Je.jsx)(rI,{value:{fontStyle:T,fontWeight:O},onChange:D,hasFontStyles:E,hasFontWeights:L,fontFamilyFaces:m,size:"__unstable-large"})}),j&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Line height"),hasValue:ee,onDeselect:se,isShownByDefault:s.lineHeight,panelId:i,children:(0,Je.jsx)(GI,{__unstableInputWidth:"auto",value:z,onChange:W,size:"__unstable-large"})}),ce&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Letter spacing"),hasValue:Q,onDeselect:Y,isShownByDefault:s.letterSpacing,panelId:i,children:(0,Je.jsx)(sI,{value:ie,onChange:re,size:"__unstable-large",__unstableInputWidth:"auto"})}),J&&(0,Je.jsxs)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Line indent"),hasValue:ve,onDeselect:he,isShownByDefault:s.textIndent,panelId:i,children:[(0,Je.jsx)(use,{value:K,onChange:ne,size:"__unstable-large",__unstableInputWidth:"auto",withSlider:!0,hasBottomMargin:a}),a&&(0,Je.jsx)(io.ToggleControl,{label:(0,Mo.__)("Indent all paragraphs"),checked:X,onChange:le,help:xe})]}),ze&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Columns"),hasValue:fo,onDeselect:Do,isShownByDefault:s.textColumns,panelId:i,children:(0,Je.jsx)(io.__experimentalNumberControl,{label:(0,Mo.__)("Columns"),max:qTe,min:YTe,onChange:Wt,size:"__unstable-large",spinControls:"custom",value:ot,initialPosition:1})}),wt&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Decoration"),hasValue:lr,onDeselect:ln,isShownByDefault:s.textDecoration,panelId:i,children:(0,Je.jsx)(lI,{value:qo,onChange:$t,size:"__unstable-large",__unstableInputWidth:"auto"})}),je&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Orientation"),hasValue:Ve,onDeselect:gt,isShownByDefault:s.writingMode,panelId:i,children:(0,Je.jsx)(fI,{value:Eo,onChange:Ze,size:"__unstable-large"})}),rt&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Letter case"),hasValue:At,onDeselect:Pe,isShownByDefault:s.textTransform,panelId:i,children:(0,Je.jsx)(uI,{value:ar,onChange:xt,showNone:!0,isBlock:!0,size:"__unstable-large"})}),To&&(0,Je.jsxs)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Text alignment"),hasValue:Ct,onDeselect:Io,isShownByDefault:s.textAlign,panelId:i,children:[(0,Je.jsx)(RP,{value:cr,onChange:ge,options:["left","center","right","justify"],size:"__unstable-large"}),cr==="justify"&&(0,Je.jsx)("div",{children:(0,Je.jsx)(io.Notice,{status:"warning",isDismissible:!1,children:(0,Mo.__)("Justified text can reduce readability. For better accessibility, use left-aligned text instead.")})})]})]})}var Zt=l(N(),1),jt=l(A(),1);var Gb=l(R(),1);var et=l(A(),1),Go=l(N(),1),Bse=l(R(),1),LP=l(F(),1);var Cse=l(F(),1);function ip(e,t){let{getBlockOrder:o,getBlockAttributes:r}=(0,Cse.useSelect)(_);return(i,s)=>{let a=(s-1)*t+i-1,c=0;for(let u of o(e)){let{columnStart:d,rowStart:f}=r(u).style?.layout??{};(f-1)*t+d-1!!i,u=a==="horizontal"?(0,Go.__)("Width"):(0,Go.__)("Height"),[d]=me("spacing.units"),f=(0,et.__experimentalUseCustomUnits)({availableUnits:d||["%","px","em","rem","vh","vw"]}),m=()=>{t({selfStretch:void 0,flexSize:void 0})};return(0,Bse.useEffect)(()=>{i==="fixed"&&!s&&t({...e,selfStretch:"fit"})},[]),(0,qt.jsxs)(et.__experimentalVStack,{as:et.__experimentalToolsPanelItem,spacing:2,hasValue:c,label:u,onDeselect:m,isShownByDefault:r,panelId:n,children:[(0,qt.jsxs)(et.__experimentalToggleGroupControl,{size:"__unstable-large",label:oIe(o),value:i||"fit",help:eIe(i,o),onChange:h=>{t({selfStretch:h,flexSize:h!=="fixed"?null:s})},isBlock:!0,children:[(0,qt.jsx)(et.__experimentalToggleGroupControlOption,{value:"fit",label:(0,Go._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,qt.jsx)(et.__experimentalToggleGroupControlOption,{value:"fill",label:(0,Go._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,qt.jsx)(et.__experimentalToggleGroupControlOption,{value:"fixed",label:(0,Go._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),i==="fixed"&&(0,qt.jsx)(et.__experimentalUnitControl,{size:"__unstable-large",units:f,onChange:h=>{t({selfStretch:i,flexSize:h})},value:s,min:0,label:u,hideLabelFromVision:!0})]})}function oIe(e){let{orientation:t="horizontal"}=e;return t==="horizontal"?(0,Go.__)("Width"):(0,Go.__)("Height")}function rIe({childLayout:e,onChange:t,parentLayout:o,isShownByDefault:r,panelId:n}){let{columnStart:i,rowStart:s,columnSpan:a,rowSpan:c}=e,{columnCount:u,rowCount:d}=o??{},f=(0,LP.useSelect)(x=>x(_).getBlockRootClientId(n)),{moveBlocksToPosition:m,__unstableMarkNextChangeAsNotPersistent:h}=(0,LP.useDispatch)(_),p=ip(f,u||3),g=()=>!!i||!!s,b=()=>!!a||!!c,v=()=>{t({columnStart:void 0,rowStart:void 0})},k=()=>{t({columnSpan:void 0,rowSpan:void 0})},y=u?u-(i??1)+1:void 0,S=window.__experimentalEnableGridInteractivity&&d?d-(s??1)+1:void 0;return(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsxs)(et.Flex,{as:et.__experimentalToolsPanelItem,hasValue:b,label:(0,Go.__)("Grid span"),onDeselect:k,isShownByDefault:r,panelId:n,children:[(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Column span"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10),B=y?Math.min(C,y):C;t({columnStart:i,rowStart:s,rowSpan:c,columnSpan:B})},value:a??1,min:1,max:y})}),(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Row span"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10),B=S?Math.min(C,S):C;t({columnStart:i,rowStart:s,columnSpan:a,rowSpan:B})},value:c??1,min:1,max:S})})]}),window.__experimentalEnableGridInteractivity&&(0,qt.jsxs)(et.Flex,{as:et.__experimentalToolsPanelItem,hasValue:g,label:(0,Go.__)("Grid placement"),onDeselect:v,isShownByDefault:!1,panelId:n,children:[(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Column"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10);t({columnStart:C,rowStart:s,columnSpan:a,rowSpan:c}),h(),m([n],f,f,p(C,s))},value:i??1,min:1,max:u?u-(a??1)+1:void 0})}),(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Row"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10);t({columnStart:i,rowStart:C,columnSpan:a,rowSpan:c}),h(),m([n],f,f,p(i,C))},value:s??1,min:1,max:d?d-(c??1)+1:void 0})})]})]})}var NP=l(A(),1),Hb=l(N(),1);var zF=l(w(),1);function MP({panelId:e,value:t,onChange:o=()=>{},options:r,defaultValue:n="auto",hasValue:i,isShownByDefault:s=!0}){let a=t??"auto",[c,u,d]=me("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),f=u?.map(({name:p,ratio:g})=>({label:p,value:g})),m=c?.map(({name:p,ratio:g})=>({label:p,value:g})),h=[{label:(0,Hb._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...d?m:[],...f||[],{label:(0,Hb._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,zF.jsx)(NP.__experimentalToolsPanelItem,{hasValue:i||(()=>a!==n),label:(0,Hb.__)("Aspect ratio"),onDeselect:()=>o(void 0),isShownByDefault:s,panelId:e,children:(0,zF.jsx)(NP.SelectControl,{label:(0,Hb.__)("Aspect ratio"),value:a,options:r??h,onChange:o,size:"__unstable-large"})})}var We=l(w(),1),jF=["horizontal","vertical"];function DP(e){let t=Pse(e),o=Rse(e),r=Ose(e),n=Ase(e),i=Lse(e),s=Nse(e),a=Mse(e),c=Dse(e),u=Vse(e),d=Fse(e);return Gb.Platform.OS==="web"&&(t||o||r||n||i||s||a||c||u||d)}function Pse(e){return e?.layout?.contentSize}function Rse(e){return e?.layout?.wideSize}function Ose(e){return e?.spacing?.padding}function Ase(e){return e?.spacing?.margin}function Lse(e){return e?.spacing?.blockGap}function Nse(e){return e?.dimensions?.height}function Mse(e){return e?.dimensions?.minHeight}function Dse(e){return e?.dimensions?.width}function Vse(e){return e?.dimensions?.aspectRatio}function Fse(e){let{type:t="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=e?.parentLayout??{},n=(o==="flex"||t==="flex"||o==="grid"||t==="grid")&&r;return!!e?.layout&&n}function nIe(e){let{defaultSpacingSizes:t,spacingSizes:o}=e?.spacing||{};return t!==!1&&o?.default?.length>0||o?.theme?.length>0||o?.custom?.length>0}function Tse(e,t){if(!t||!e)return e;let o={};return t.forEach(r=>{r==="vertical"&&(o.top=e.top,o.bottom=e.bottom),r==="horizontal"&&(o.left=e.left,o.right=e.right),o[r]=e?.[r]}),o}function Ise(e){return e&&typeof e=="string"?{top:e,right:e,bottom:e,left:e}:e}function iIe(e,t){return e&&(typeof e=="string"?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top})}function sIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=Ro(),s=()=>{let a=e(o);t(a)};return(0,We.jsx)(jt.__experimentalToolsPanel,{label:(0,Zt.__)("Dimensions"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var ta={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,height:!0,minHeight:!0,width:!0,aspectRatio:!0,childLayout:!0};function VP({as:e=sIe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=ta,onVisualize:a=()=>{},includeLayoutControls:c=!1}){let{dimensions:u,spacing:d}=n,f=te=>te&&typeof te=="object"?Object.keys(te).reduce((Le,ct)=>(Le[ct]=wn({settings:{dimensions:u,spacing:d}},"",te[ct]),Le),{}):wn({settings:{dimensions:u,spacing:d}},"",te),m=nIe(n),h=(0,jt.__experimentalUseCustomUnits)({availableUnits:n?.spacing?.units||["%","px","em","rem","vw"]}),p=-1/0,[g,b]=(0,Gb.useState)(p),v=Pse(n)&&c,k=f(r?.layout?.contentSize),y=te=>{o(pe(t,["layout","contentSize"],te||void 0))},S=()=>!!t?.layout?.contentSize,x=()=>y(void 0),C=Rse(n)&&c,B=f(r?.layout?.wideSize),I=te=>{o(pe(t,["layout","wideSize"],te||void 0))},P=()=>!!t?.layout?.wideSize,E=()=>I(void 0),L=Ose(n),T=f(r?.spacing?.padding),O=Ise(T),D=Array.isArray(n?.spacing?.padding)?n?.spacing?.padding:n?.spacing?.padding?.sides,U=D&&D.some(te=>jF.includes(te)),G=te=>{let Le=Tse(te,D);o(pe(t,["spacing","padding"],Le))},j=()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,z=()=>G(void 0),W=()=>a("padding"),ee=Ase(n),se=f(r?.spacing?.margin),ce=Ise(se),ie=Array.isArray(n?.spacing?.margin)?n?.spacing?.margin:n?.spacing?.margin?.sides,re=ie&&ie.some(te=>jF.includes(te)),Q=te=>{let Le=Tse(te,ie);o(pe(t,["spacing","margin"],Le))},Y=()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,J=()=>Q(void 0),K=()=>a("margin"),H=Lse(n),X=Array.isArray(n?.spacing?.blockGap)?n?.spacing?.blockGap:n?.spacing?.blockGap?.sides,ne=X&&X.some(te=>jF.includes(te)),le=f(r?.spacing?.blockGap),ve=iIe(le,ne),he=te=>{o(pe(t,["spacing","blockGap"],te))},xe=te=>{te||he(null),!ne&&te?.hasOwnProperty("top")?he(te.top):he({top:te?.top,left:te?.left})},ze=()=>he(void 0),ot=()=>!!t?.spacing?.blockGap,Wt=Mse(n),fo=f(r?.dimensions?.minHeight),Do=te=>{let Le=pe(t,["dimensions","minHeight"],te);o(pe(Le,["dimensions","aspectRatio"],void 0))},rt=()=>{Do(void 0)},ar=()=>!!t?.dimensions?.minHeight,xt=Nse(n),At=f(r?.dimensions?.height),Pe=te=>{let Le=pe(t,["dimensions","height"],te);o(pe(Le,["dimensions","aspectRatio"],void 0))},wt=()=>{Pe(void 0)},qo=()=>!!t?.dimensions?.height,$t=Dse(n),lr=f(r?.dimensions?.width),ln=te=>{o(pe(t,["dimensions","width"],te))},je=()=>{ln(void 0)},Eo=()=>!!t?.dimensions?.width,Ze=Vse(n),Ve=f(r?.dimensions?.aspectRatio),gt=te=>{let Le=pe(t,["dimensions","aspectRatio"],te);o(pe(Le,["dimensions","minHeight"],void 0))},To=()=>!!t?.dimensions?.aspectRatio,cr=Fse(n),ge=r?.layout,Ct=te=>{o({...t,layout:{...te}})},Io=(0,Gb.useCallback)(te=>({...te,layout:Me({...te?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...te?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...te?.dimensions,height:void 0,minHeight:void 0,aspectRatio:void 0,width:void 0}}),[]),Ke=()=>a(!1);return(0,We.jsxs)(e,{resetAllFilter:Io,value:t,onChange:o,panelId:i,children:[(v||C)&&(0,We.jsx)("span",{className:"span-columns",children:(0,Zt.__)("Set the width of the main content area.")}),v&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{label:(0,Zt.__)("Content width"),hasValue:S,onDeselect:x,isShownByDefault:s.contentSize??ta.contentSize,panelId:i,children:(0,We.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Content width"),labelPosition:"top",value:k||"",onChange:te=>{y(te)},units:h,prefix:(0,We.jsx)(jt.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,We.jsx)(we,{icon:xf})})})}),C&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{label:(0,Zt.__)("Wide width"),hasValue:P,onDeselect:E,isShownByDefault:s.wideSize??ta.wideSize,panelId:i,children:(0,We.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Wide width"),labelPosition:"top",value:B||"",onChange:te=>{I(te)},units:h,prefix:(0,We.jsx)(jt.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,We.jsx)(we,{icon:Nf})})})}),L&&(0,We.jsxs)(jt.__experimentalToolsPanelItem,{hasValue:j,label:(0,Zt.__)("Padding"),onDeselect:z,isShownByDefault:s.padding??ta.padding,className:V({"tools-panel-item-spacing":m}),panelId:i,children:[!m&&(0,We.jsx)(jt.BoxControl,{__next40pxDefaultSize:!0,values:O,onChange:G,label:(0,Zt.__)("Padding"),sides:D,units:h,allowReset:!1,splitOnAxis:U,inputProps:{onMouseOver:W,onMouseOut:Ke}}),m&&(0,We.jsx)(Vb,{values:O,onChange:G,label:(0,Zt.__)("Padding"),sides:D,units:h,allowReset:!1,onMouseOver:W,onMouseOut:Ke})]}),ee&&(0,We.jsxs)(jt.__experimentalToolsPanelItem,{hasValue:Y,label:(0,Zt.__)("Margin"),onDeselect:J,isShownByDefault:s.margin??ta.margin,className:V({"tools-panel-item-spacing":m}),panelId:i,children:[!m&&(0,We.jsx)(jt.BoxControl,{__next40pxDefaultSize:!0,values:ce,onChange:Q,inputProps:{min:g,onDragStart:()=>{b(0)},onDragEnd:()=>{b(p)},onMouseOver:K,onMouseOut:Ke},label:(0,Zt.__)("Margin"),sides:ie,units:h,allowReset:!1,splitOnAxis:re}),m&&(0,We.jsx)(Vb,{values:ce,onChange:Q,minimumCustomValue:-1/0,label:(0,Zt.__)("Margin"),sides:ie,units:h,allowReset:!1,onMouseOver:K,onMouseOut:Ke})]}),H&&(0,We.jsxs)(jt.__experimentalToolsPanelItem,{hasValue:ot,label:(0,Zt.__)("Block spacing"),onDeselect:ze,isShownByDefault:s.blockGap??ta.blockGap,className:V({"tools-panel-item-spacing":m,"single-column":!m&&!ne}),panelId:i,children:[!m&&(ne?(0,We.jsx)(jt.BoxControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Block spacing"),min:0,onChange:xe,units:h,sides:X,values:ve,allowReset:!1,splitOnAxis:ne}):(0,We.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Block spacing"),min:0,onChange:he,units:h,value:le})),m&&(0,We.jsx)(Vb,{label:(0,Zt.__)("Block spacing"),min:0,onChange:xe,showSideInLabel:!1,sides:ne?X:["top"],values:ve,allowReset:!1})]}),cr&&(0,We.jsx)(Ese,{value:ge,onChange:Ct,parentLayout:n?.parentLayout,panelId:i,isShownByDefault:s.childLayout??ta.childLayout}),Wt&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{hasValue:ar,label:(0,Zt.__)("Minimum height"),onDeselect:rt,isShownByDefault:s.minHeight??ta.minHeight,panelId:i,children:(0,We.jsx)(cb,{label:(0,Zt.__)("Minimum height"),value:fo,onChange:Do})}),xt&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{hasValue:qo,label:(0,Zt.__)("Height"),onDeselect:wt,isShownByDefault:s.height??ta.height,panelId:i,children:(0,We.jsx)(cb,{label:(0,Zt.__)("Height"),value:At,onChange:Pe})}),$t&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{hasValue:Eo,label:(0,Zt.__)("Width"),onDeselect:je,isShownByDefault:s.width??ta.width,panelId:i,children:(0,We.jsx)(cb,{label:(0,Zt.__)("Width"),value:lr,onChange:ln})}),Ze&&(0,We.jsx)(MP,{hasValue:To,value:Ve,onChange:gt,panelId:i,isShownByDefault:s.aspectRatio??ta.aspectRatio})]})}var en=l(A(),1),$b=l(R(),1),Wb=l(N(),1);var sp=l(N(),1),xo=l(A(),1),zP=l(R(),1);var Rt=l(w(),1),FP=[];function aIe({shadow:e,onShadowChange:t,settings:o}){let r=UF(o);return(0,Rt.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,Rt.jsxs)(xo.__experimentalVStack,{spacing:4,children:[(0,Rt.jsx)(xo.__experimentalHeading,{level:5,children:(0,sp.__)("Drop shadow")}),(0,Rt.jsx)(lIe,{presets:r,activeShadow:e,onSelect:t}),(0,Rt.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,Rt.jsx)(xo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,sp.__)("Clear")})})]})})}function lIe({presets:e,activeShadow:t,onSelect:o}){return e?(0,Rt.jsx)(xo.Composite,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,sp.__)("Drop shadows"),children:e.map(({name:r,slug:n,shadow:i})=>(0,Rt.jsx)(cIe,{label:r,isActive:i===t,type:n==="unset"?"unset":"preset",onSelect:()=>o(i===t?void 0:i),shadow:i},n))}):null}function cIe({type:e,label:t,isActive:o,onSelect:r,shadow:n}){return(0,Rt.jsx)(xo.Tooltip,{text:t,children:(0,Rt.jsx)(xo.Composite.Item,{role:"option","aria-label":t,"aria-selected":o,className:V("block-editor-global-styles__shadow__item",{"is-active":o}),render:(0,Rt.jsx)("button",{className:V("block-editor-global-styles__shadow-indicator",{unset:e==="unset"}),onClick:r,style:{boxShadow:n},"aria-label":t,children:o&&(0,Rt.jsx)(we,{icon:bl})})})})}function zse({shadow:e,onShadowChange:t,settings:o}){return(0,Rt.jsx)(xo.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:uIe(e,t),renderContent:()=>(0,Rt.jsx)(xo.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,Rt.jsx)(aIe,{shadow:e,onShadowChange:t,settings:o})})})}function uIe(e,t){return function({onToggle:r,isOpen:n}){let i=(0,zP.useRef)(void 0),s={onClick:r,className:V("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":n}),"aria-expanded":n,ref:i},a={onClick:()=>{n&&r(),t(void 0),i.current?.focus()},className:V("block-editor-global-styles__shadow-editor__remove-button",{"is-open":n}),label:(0,sp.__)("Remove")};return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(xo.Button,{__next40pxDefaultSize:!0,...s,children:(0,Rt.jsxs)(xo.__experimentalHStack,{justify:"flex-start",children:[(0,Rt.jsx)(we,{className:"block-editor-global-styles__toggle-icon",icon:sN,size:24}),(0,Rt.jsx)(xo.FlexItem,{children:(0,sp.__)("Drop shadow")})]})}),!!e&&(0,Rt.jsx)(xo.Button,{__next40pxDefaultSize:!0,size:"small",icon:Mr,...a})]})}}function UF(e){return(0,zP.useMemo)(()=>{if(!e?.shadow)return FP;let t=e?.shadow?.defaultPresets,{default:o,theme:r,custom:n}=e?.shadow?.presets??{},i={name:(0,sp.__)("Unset"),slug:"unset",shadow:"none"},s=[...t&&o||FP,...r||FP,...n||FP];return s.length&&s.unshift(i),s},[e])}var oa=l(w(),1);function jP(e){return Object.values(h_(e)).some(Boolean)}function h_(e){return{hasBorderColor:jse(e),hasBorderRadius:Use(e),hasBorderStyle:Hse(e),hasBorderWidth:Gse(e),hasShadow:Wse(e)}}function jse(e){return e?.border?.color}function Use(e){return e?.border?.radius}function Hse(e){return e?.border?.style}function Gse(e){return e?.border?.width}function Wse(e){let t=UF(e);return!!e?.shadow&&t.length>0}function dIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=Ro();return(0,oa.jsx)(en.__experimentalToolsPanel,{label:i,resetAll:()=>{let c=e(o);t(c)},panelId:r,dropdownMenuProps:s,children:n})}var fIe={radius:!0,color:!0,width:!0,shadow:!0};function UP({as:e=dIe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,name:s,defaultControls:a=fIe}){let c=Qa(n),u=(0,$b.useCallback)(j=>wn({settings:n},"",j),[n]),d=j=>{let W=c.flatMap(({colors:ee})=>ee).find(({color:ee})=>ee===j);return W?"var:preset|color|"+W.slug:j},f=(0,$b.useMemo)(()=>{if((0,en.__experimentalHasSplitBorders)(r?.border)){let j={...r?.border};return["top","right","bottom","left"].forEach(z=>{j[z]={...j[z],color:u(j[z]?.color)}}),j}return{...r?.border,color:r?.border?.color?u(r?.border?.color):void 0}},[r?.border,u]),m=j=>o({...t,border:j}),h=jse(n),p=Hse(n),g=Gse(n),b=Use(n),v=(0,$b.useMemo)(()=>typeof r?.border?.radius!="object"?u(r?.border?.radius):{topLeft:u(r?.border?.radius?.topLeft),topRight:u(r?.border?.radius?.topRight),bottomLeft:u(r?.border?.radius?.bottomLeft),bottomRight:u(r?.border?.radius?.bottomRight)},[r?.border?.radius,u]),k=j=>m({...f,radius:j}),y=()=>{let j=t?.border?.radius;return typeof j=="object"?Object.entries(j).some(Boolean):!!j},S=Wse(n),x=u(r?.shadow),C=n?.shadow?.presets??{},B=C.custom??C.theme??C.default??[],I=j=>{let z=B?.find(({shadow:W})=>W===j)?.slug;o(pe(t,["shadow"],z?`var:preset|shadow|${z}`:j||void 0))},P=()=>!!t?.shadow,E=()=>I(void 0),L=()=>{if(y())return m({radius:t?.border?.radius});m(void 0)},T=j=>{let z={...j};(0,en.__experimentalHasSplitBorders)(z)?["top","right","bottom","left"].forEach(W=>{z[W]&&(z[W]={...z[W],color:d(z[W]?.color)})}):z&&(z.color=d(z.color)),m({radius:f?.radius,...z})},O=(0,$b.useCallback)(j=>({...j,border:void 0,shadow:void 0}),[]),D=a?.color||a?.width,U=h||p||g||b,G=Kb({blockName:s,hasShadowControl:S,hasBorderControl:U});return(0,oa.jsxs)(e,{resetAllFilter:O,value:t,onChange:o,panelId:i,label:G,children:[(g||h)&&(0,oa.jsx)(en.__experimentalToolsPanelItem,{hasValue:()=>(0,en.__experimentalIsDefinedBorder)(t?.border),label:(0,Wb.__)("Border"),onDeselect:()=>L(),isShownByDefault:D,panelId:i,children:(0,oa.jsx)(en.BorderBoxControl,{colors:c,enableAlpha:!0,enableStyle:p,onChange:T,popoverOffset:40,popoverPlacement:"left-start",value:f,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!S,label:(0,Wb.__)("Border")})}),b&&(0,oa.jsx)(en.__experimentalToolsPanelItem,{hasValue:y,label:(0,Wb.__)("Radius"),onDeselect:()=>k(void 0),isShownByDefault:a.radius,panelId:i,children:(0,oa.jsx)(XT,{presets:n?.border?.radiusSizes,values:v,onChange:j=>{k(j||void 0)}})}),S&&(0,oa.jsxs)(en.__experimentalToolsPanelItem,{label:(0,Wb.__)("Shadow"),hasValue:P,onDeselect:E,isShownByDefault:a.shadow,panelId:i,children:[U?(0,oa.jsx)(en.BaseControl.VisualLabel,{as:"legend",children:(0,Wb.__)("Shadow")}):null,(0,oa.jsx)(zse,{shadow:x,onShadowChange:I,settings:n})]})]})}var Qt=l(A(),1),GP=l(R(),1),Xt=l(N(),1);var at=l(w(),1);function WP(e){let t=Kse(e),o=Xse(e),r=Yse(e),n=Vd(e),i=Zse(e),s=qse(e);return t||o||r||n||i||s}function Kse(e){let t=Qa(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function Yse(e){let t=Qa(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function qse(e){let t=Qa(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function Vd(e){let t=Qa(e),o=m_(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function Zse(e){let t=Qa(e),o=m_(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function Xse(e){let t=Qa(e),o=m_(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function HF({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=Ro(),a=()=>{let c=e(o);t(c)};return(0,at.jsx)(Qt.__experimentalToolsPanel,{label:i||(0,Xt.__)("Elements"),resetAll:a,panelId:r,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,at.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:n})})}var mIe={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},pIe={placement:"left-start",offset:36,shift:!0},{Tabs:HP}=M(Qt.privateApis),hIe=({indicators:e,label:t})=>(0,at.jsxs)(Qt.__experimentalHStack,{justify:"flex-start",children:[(0,at.jsx)(Qt.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map((o,r)=>(0,at.jsx)(Qt.Flex,{expanded:!1,children:(0,at.jsx)(Qt.ColorIndicator,{colorValue:o})},r))}),(0,at.jsx)(Qt.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function $se({isGradient:e,inheritedValue:t,userValue:o,setValue:r,colorGradientControlSettings:n}){return(0,at.jsx)(xd,{...n,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:r,onGradientChange:e?r:void 0,clearable:t===o,headingLevel:3})}function gIe({label:e,hasValue:t,resetValue:o,isShownByDefault:r,indicators:n,tabs:i,colorGradientControlSettings:s,panelId:a}){let c=i.find(m=>m.userValue!==void 0),{key:u,...d}=i[0]??{},f=(0,GP.useRef)(void 0);return(0,at.jsx)(Qt.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:o,isShownByDefault:r,panelId:a,children:(0,at.jsx)(Qt.Dropdown,{popoverProps:pIe,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:m,isOpen:h})=>{let p={onClick:m,className:V("block-editor-panel-color-gradient-settings__dropdown",{"is-open":h}),"aria-expanded":h,ref:f};return(0,at.jsxs)(at.Fragment,{children:[(0,at.jsx)(Qt.Button,{...p,__next40pxDefaultSize:!0,children:(0,at.jsx)(hIe,{indicators:n,label:e})}),t()&&(0,at.jsx)(Qt.Button,{__next40pxDefaultSize:!0,label:(0,Xt.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:Mr,onClick:()=>{o(),h&&m(),f.current?.focus()}})]})},renderContent:()=>(0,at.jsx)(Qt.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,at.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[i.length===1&&(0,at.jsx)($se,{...d,colorGradientControlSettings:s},u),i.length>1&&(0,at.jsxs)(HP,{defaultTabId:c?.key,children:[(0,at.jsx)(HP.TabList,{children:i.map(m=>(0,at.jsx)(HP.Tab,{tabId:m.key,children:m.label},m.key))}),i.map(m=>{let{key:h,...p}=m;return(0,at.jsx)(HP.TabPanel,{tabId:h,focusable:!1,children:(0,at.jsx)($se,{...p,colorGradientControlSettings:s},h)},h)})]})]})})})})}function $P({as:e=HF,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=mIe,label:a,children:c}){let u=Qa(n),d=m_(n),f=n?.color?.custom,m=n?.color?.customGradient,h=u.length>0||f,p=d.length>0||m,g=H=>wn({settings:n},"",H),b=H=>{let ne=u.flatMap(({colors:le})=>le).find(({color:le})=>le===H);return ne?"var:preset|color|"+ne.slug:H},v=H=>{let ne=d.flatMap(({gradients:le})=>le).find(({gradient:le})=>le===H);return ne?"var:preset|gradient|"+ne.slug:H},k=Xse(n),y=g(r?.color?.background),S=g(t?.color?.background),x=g(r?.color?.gradient),C=g(t?.color?.gradient),B=()=>!!S||!!C,I=H=>{let X=pe(t,["color","background"],b(H));X.color.gradient=void 0,o(X)},P=H=>{let X=pe(t,["color","gradient"],v(H));X.color.background=void 0,o(X)},E=()=>{let H=pe(t,["color","background"],void 0);H.color.gradient=void 0,o(H)},L=Yse(n),T=g(r?.elements?.link?.color?.text),O=g(t?.elements?.link?.color?.text),D=H=>{o(pe(t,["elements","link","color","text"],b(H)))},U=g(r?.elements?.link?.[":hover"]?.color?.text),G=g(t?.elements?.link?.[":hover"]?.color?.text),j=H=>{o(pe(t,["elements","link",":hover","color","text"],b(H)))},z=()=>!!O||!!G,W=()=>{let H=pe(t,["elements","link",":hover","color","text"],void 0);H=pe(H,["elements","link","color","text"],void 0),o(H)},ee=Kse(n),se=g(r?.color?.text),ce=g(t?.color?.text),ie=()=>!!ce,re=H=>{let X=pe(t,["color","text"],b(H));se===T&&(X=pe(X,["elements","link","color","text"],b(H))),o(X)},Q=()=>re(void 0),Y=[{name:"caption",label:(0,Xt.__)("Captions"),showPanel:qse(n)},{name:"button",label:(0,Xt.__)("Button"),showPanel:Zse(n)},{name:"heading",label:(0,Xt.__)("Heading"),showPanel:Vd(n)},{name:"h1",label:(0,Xt.__)("H1"),showPanel:Vd(n)},{name:"h2",label:(0,Xt.__)("H2"),showPanel:Vd(n)},{name:"h3",label:(0,Xt.__)("H3"),showPanel:Vd(n)},{name:"h4",label:(0,Xt.__)("H4"),showPanel:Vd(n)},{name:"h5",label:(0,Xt.__)("H5"),showPanel:Vd(n)},{name:"h6",label:(0,Xt.__)("H6"),showPanel:Vd(n)}],J=(0,GP.useCallback)(H=>({...H,color:void 0,elements:{...H?.elements,link:{...H?.elements?.link,color:void 0,":hover":{color:void 0}},...Y.reduce((X,ne)=>({...X,[ne.name]:{...H?.elements?.[ne.name],color:void 0}}),{})}}),[Y]),K=[ee&&{key:"text",label:(0,Xt.__)("Text"),hasValue:ie,resetValue:Q,isShownByDefault:s.text,indicators:[se],tabs:[{key:"text",label:(0,Xt.__)("Text"),inheritedValue:se,setValue:re,userValue:ce}]},k&&{key:"background",label:(0,Xt.__)("Background"),hasValue:B,resetValue:E,isShownByDefault:s.background,indicators:[x??y],tabs:[h&&{key:"background",label:(0,Xt.__)("Color"),inheritedValue:y,setValue:I,userValue:S},p&&{key:"gradient",label:(0,Xt.__)("Gradient"),inheritedValue:x,setValue:P,userValue:C,isGradient:!0}].filter(Boolean)},L&&{key:"link",label:(0,Xt.__)("Link"),hasValue:z,resetValue:W,isShownByDefault:s.link,indicators:[T,U],tabs:[{key:"link",label:(0,Xt.__)("Default"),inheritedValue:T,setValue:D,userValue:O},{key:"hover",label:(0,Xt.__)("Hover"),inheritedValue:U,setValue:j,userValue:G}]}].filter(Boolean);return Y.forEach(({name:H,label:X,showPanel:ne})=>{if(!ne)return;let le=g(r?.elements?.[H]?.color?.background),ve=g(r?.elements?.[H]?.color?.gradient),he=g(r?.elements?.[H]?.color?.text),xe=g(t?.elements?.[H]?.color?.background),ze=g(t?.elements?.[H]?.color?.gradient),ot=g(t?.elements?.[H]?.color?.text),Wt=()=>!!(ot||xe||ze),fo=()=>{let Pe=pe(t,["elements",H,"color","background"],void 0);Pe.elements[H].color.gradient=void 0,Pe.elements[H].color.text=void 0,o(Pe)},Do=Pe=>{o(pe(t,["elements",H,"color","text"],b(Pe)))},rt=Pe=>{let wt=pe(t,["elements",H,"color","background"],b(Pe));wt.elements[H].color.gradient=void 0,o(wt)},ar=Pe=>{let wt=pe(t,["elements",H,"color","gradient"],v(Pe));wt.elements[H].color.background=void 0,o(wt)},xt=!0,At=H!=="caption";K.push({key:H,label:X,hasValue:Wt,resetValue:fo,isShownByDefault:s[H],indicators:xt&&At?[he,ve??le]:[xt?he:ve??le],tabs:[h&&xt&&{key:"text",label:(0,Xt.__)("Text"),inheritedValue:he,setValue:Do,userValue:ot},h&&At&&{key:"background",label:(0,Xt.__)("Background"),inheritedValue:le,setValue:rt,userValue:xe},p&&At&&{key:"gradient",label:(0,Xt.__)("Gradient"),inheritedValue:ve,setValue:ar,userValue:ze,isGradient:!0}].filter(Boolean)})}),(0,at.jsxs)(e,{resetAllFilter:J,value:t,onChange:o,panelId:i,label:a,children:[K.map(H=>{let{key:X,...ne}=H;return(0,at.jsx)(gIe,{...ne,colorGradientControlSettings:{colors:u,disableCustomColors:!f,gradients:d,disableCustomGradients:!m},panelId:i},X)}),c]})}var mt=l(A(),1),_c=l(N(),1),Yb=l(R(),1);var so=l(w(),1),KP=[];function Qse(e,{presetSetting:t,defaultSetting:o}){let r=!e?.color?.[o],n=e?.color?.[t]?.custom||KP,i=e?.color?.[t]?.theme||KP,s=e?.color?.[t]?.default||KP;return(0,Yb.useMemo)(()=>[...n,...i,...r?KP:s],[r,n,i,s])}function Jse(e){return eae(e)}function eae(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function bIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=Ro(),s=()=>{let a=e(o);t(a)};return(0,so.jsx)(mt.__experimentalToolsPanel,{label:(0,_c._x)("Filters","Name for applying graphical effects"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var kIe={duotone:!0},vIe={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,_c.__)("Duotone")},yIe=({indicator:e,label:t})=>(0,so.jsxs)(mt.__experimentalHStack,{justify:"flex-start",children:[(0,so.jsx)(mt.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,so.jsx)(mt.Flex,{expanded:!1,children:e==="unset"||!e?(0,so.jsx)(mt.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):(0,so.jsx)(mt.DuotoneSwatch,{values:e})})}),(0,so.jsx)(mt.FlexItem,{title:t,children:t})]}),SIe=(e,t)=>function({onToggle:r,isOpen:n}){let i=(0,Yb.useRef)(void 0),s={onClick:r,className:V("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":n}),"aria-expanded":n,ref:i},a={onClick:()=>{n&&r(),t(),i.current?.focus()},className:"block-editor-panel-duotone-settings__reset",label:(0,_c.__)("Reset")};return(0,so.jsxs)(so.Fragment,{children:[(0,so.jsx)(mt.Button,{__next40pxDefaultSize:!0,...s,children:(0,so.jsx)(yIe,{indicator:e,label:(0,_c.__)("Duotone")})}),e&&(0,so.jsx)(mt.Button,{size:"small",icon:Mr,...a})]})};function YP({as:e=bIe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=kIe}){let a=b=>wn({settings:n},"",b),c=eae(n),u=Qse(n,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),d=Qse(n,{presetSetting:"palette",defaultSetting:"defaultPalette"}),f=a(r?.filter?.duotone),m=b=>{let v=u.find(({colors:y})=>y===b),k=v?`var:preset|duotone|${v.slug}`:b;o(pe(t,["filter","duotone"],k))},h=()=>!!t?.filter?.duotone,p=()=>m(void 0),g=(0,Yb.useCallback)(b=>({...b,filter:{...b.filter,duotone:void 0}}),[]);return(0,so.jsx)(e,{resetAllFilter:g,value:t,onChange:o,panelId:i,children:c&&(0,so.jsx)(mt.__experimentalToolsPanelItem,{label:(0,_c.__)("Duotone"),hasValue:h,onDeselect:p,isShownByDefault:s.duotone,panelId:i,children:(0,so.jsx)(mt.Dropdown,{popoverProps:vIe,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:SIe(f,p),renderContent:()=>(0,so.jsx)(mt.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,so.jsxs)(mt.MenuGroup,{label:(0,_c.__)("Duotone"),children:[(0,so.jsx)("p",{children:(0,_c.__)("Create a two-tone color effect without losing your original image.")}),(0,so.jsx)(mt.DuotonePicker,{colorPalette:d,duotonePalette:u,disableCustomColors:!0,disableCustomDuotone:!0,value:f,onChange:m})]})})})})})}var qb=l(A(),1),g_=l(N(),1);var ap=l(w(),1);function tae(e,t,o){return e==="core/image"&&o?.lightbox?.allowEditing||!!t?.lightbox}function oae({onChange:e,value:t,inheritedValue:o,panelId:r}){let n=Ro(),i=()=>{e(void 0)},s=c=>{e({enabled:c})},a=!1;return o?.lightbox?.enabled&&(a=o.lightbox.enabled),(0,ap.jsx)(ap.Fragment,{children:(0,ap.jsx)(qb.__experimentalToolsPanel,{label:(0,g_._x)("Settings","Image settings"),resetAll:i,panelId:r,dropdownMenuProps:n,children:(0,ap.jsx)(qb.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,g_.__)("Enlarge on click"),onDeselect:i,isShownByDefault:!0,panelId:r,children:(0,ap.jsx)(qb.ToggleControl,{label:(0,g_.__)("Enlarge on click"),checked:a,onChange:s})})})})}var Zb=l(A(),1),rae=l(R(),1),qP=l(N(),1);var b_=l(w(),1);function ZP(e){return!(typeof e=="string"&&/<\/?\w/.test(e))}function XP({value:e,onChange:t,inheritedValue:o=e,help:r}){let[n,i]=(0,rae.useState)(null),s=o?.css;function a(u){if(t({...e,css:u}),!ZP(u)){i((0,qP.__)("The custom CSS is invalid. Do not use <> markup."));return}n&&i(null)}function c(u){let d=u?.target?.value;if(!d||!ZP(d))return;let[f]=Hh([{css:d}],".for-validation-only");i(f===null?(0,qP.__)("There is an error with your CSS structure."):null)}return(0,b_.jsxs)(Zb.__experimentalVStack,{spacing:3,children:[n&&(0,b_.jsx)(Zb.Notice,{status:"error",onRemove:()=>i(null),children:n}),(0,b_.jsx)(Zb.TextareaControl,{label:(0,qP.__)("Additional CSS"),value:s,onChange:u=>a(u),onBlur:c,className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1,help:r})]})}var t2=l(A(),1),o2=l(R(),1),WF=l(N(),1);var Be=l(A(),1);var Ot=l(N(),1),iae=l(Un(),1),GF=l(dn(),1),xc=l(R(),1),k_=l(F(),1),sae=l(Fe(),1),aae=l(z5(),1);var Te=l(w(),1),QP="image",_Ie={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},e2=()=>{},JP=e=>{window.requestAnimationFrame(()=>{let[t]=sae.focus.tabbable.find(e?.current);t&&t.focus()})};function xIe(e){return e==="cover"||e===void 0?(0,Ot.__)("Image covers the space evenly."):e==="contain"?(0,Ot.__)("Image is contained without distortion."):(0,Ot.__)("Image has a fixed width.")}var wIe=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;let t=isNaN(e.x)?.5:e.x,o=isNaN(e.y)?.5:e.y;return`${t*100}% ${o*100}%`},CIe=e=>{if(!e)return{x:void 0,y:void 0};let[t,o]=e.split(" ").map(r=>parseFloat(r)/100);return t=isNaN(t)?void 0:t,o=isNaN(o)?t:o,{x:t,y:o}};function lae({as:e="span",imgUrl:t,toggleProps:o={},filename:r,label:n,onToggleCallback:i=e2}){let{isOpen:s,...a}=o;(0,xc.useEffect)(()=>{typeof s<"u"&&i(s)},[s,i]);let c=()=>(0,Te.jsxs)(Be.__experimentalHStack,{className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[(0,Te.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:t?`url(${t})`:void 0}}),(0,Te.jsxs)(Be.FlexBlock,{children:[(0,Te.jsx)(Be.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:n}),(0,Te.jsx)(Be.VisuallyHidden,{as:"span",children:t?(0,Ot.sprintf)((0,Ot.__)("Background image: %s"),r||n):(0,Ot.__)("No background image selected")})]})]});return e==="button"?(0,Te.jsx)(Be.Button,{__next40pxDefaultSize:!0,...a,children:c()}):c()}function BIe({label:e,filename:t,url:o,children:r,onToggle:n=e2,hasImageValue:i,onReset:s,containerRef:a}){if(!i)return;let c=e||(0,GF.getFilename)(o)||(0,Ot.__)("Image");return(0,Te.jsx)(Be.Dropdown,{popoverProps:_Ie,renderToggle:({onToggle:u,isOpen:d})=>{let f={onClick:u,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":d,"aria-label":(0,Ot.__)("Background size, position and repeat options."),isOpen:d};return(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(lae,{imgUrl:o,filename:t,label:c,toggleProps:f,as:"button",onToggleCallback:n}),s&&(0,Te.jsx)(Be.Button,{__next40pxDefaultSize:!0,label:(0,Ot.__)("Reset"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:Mr,onClick:()=>{s(),d&&u(),JP(a)}})]})},renderContent:()=>(0,Te.jsx)(Be.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:r})})}function EIe(){return(0,Te.jsx)(Be.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,Te.jsx)(Be.Spinner,{})})}function nae({onChange:e,style:t,inheritedValue:o,onRemoveImage:r=e2,onResetImage:n=e2,displayInPanel:i,defaultValues:s,containerRef:a}){let[c,u]=(0,xc.useState)(!1),{getSettings:d}=(0,k_.useSelect)(_),{id:f,title:m,url:h}=t?.background?.backgroundImage||{...o?.background?.backgroundImage},{createErrorNotice:p}=(0,k_.useDispatch)(iae.store),g=B=>{p(B,{type:"snackbar"}),u(!1)},b=()=>e(pe(t,["background","backgroundImage"],void 0)),v=B=>{if(!B||!B.url){b(),u(!1);return}if((0,aae.isBlobURL)(B.url)){u(!0);return}if(B.media_type&&B.media_type!==QP||!B.media_type&&B.type&&B.type!==QP){g((0,Ot.__)("Only images can be used as a background image."));return}let I=t?.background?.backgroundSize||s?.backgroundSize,P=t?.background?.backgroundPosition;e(pe(t,["background"],{...t?.background,backgroundImage:{url:B.url,id:B.id,source:"file",title:B.title||void 0},backgroundPosition:!P&&(I==="auto"||!I)?"50% 0":P,backgroundSize:I})),u(!1),JP(a)},k=B=>{d().mediaUpload({allowedTypes:[QP],filesList:B,onFileChange([I]){v(I)},onError:g,multiple:!1})},y=lp(t),S=()=>e(pe(t,["background"],{backgroundImage:"none"})),x=!y&&lp(o),C=m||(0,GF.getFilename)(h)||(0,Ot.__)("Image");return(0,Te.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[c&&(0,Te.jsx)(EIe,{}),(0,Te.jsx)(xb,{mediaId:f,mediaURL:h,allowedTypes:[QP],accept:"image/*",onSelect:v,popoverProps:{className:V({"block-editor-global-styles-background-panel__media-replace-popover":i})},name:(0,Te.jsx)(lae,{imgUrl:h,filename:m,label:C}),renderToggle:B=>(0,Te.jsx)(Be.Button,{...B,__next40pxDefaultSize:!0}),onError:g,onReset:()=>{JP(a),n()},children:x&&(0,Te.jsx)(Be.MenuItem,{onClick:()=>{JP(a),S(),r()},children:(0,Ot.__)("Remove")})}),(0,Te.jsx)(Be.DropZone,{onFilesDrop:k,label:(0,Ot.__)("Drop to upload")})]})}function TIe({onChange:e,style:t,inheritedValue:o,defaultValues:r}){let n=t?.background?.backgroundSize||o?.background?.backgroundSize,i=t?.background?.backgroundRepeat||o?.background?.backgroundRepeat,s=t?.background?.backgroundImage?.url||o?.background?.backgroundImage?.url,a=t?.background?.backgroundImage?.id,c=t?.background?.backgroundPosition||o?.background?.backgroundPosition,u=t?.background?.backgroundAttachment||o?.background?.backgroundAttachment,d=!n&&a?r?.backgroundSize:n||"auto";d=["cover","contain","auto"].includes(d)?d:"auto";let f=!(i==="no-repeat"||d==="cover"&&i===void 0),m=v=>{let k=i,y=c;v==="contain"&&(k="no-repeat",y=void 0),v==="cover"&&(k=void 0,y=void 0),(d==="cover"||d==="contain")&&v==="auto"&&(k=void 0,t?.background?.backgroundImage?.id&&(y="50% 0")),!v&&d==="auto"&&(v="auto"),e(pe(t,["background"],{...t?.background,backgroundPosition:y,backgroundRepeat:k,backgroundSize:v}))},h=v=>{e(pe(t,["background","backgroundPosition"],wIe(v)))},p=()=>e(pe(t,["background","backgroundRepeat"],f===!0?"no-repeat":"repeat")),g=()=>e(pe(t,["background","backgroundAttachment"],u==="fixed"?"scroll":"fixed")),b=!c&&a&&n==="contain"?r?.backgroundPosition:c;return(0,Te.jsxs)(Be.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,Te.jsx)(Be.FocalPointPicker,{label:(0,Ot.__)("Focal point"),url:s,value:CIe(b),onChange:h}),(0,Te.jsx)(Be.ToggleControl,{label:(0,Ot.__)("Fixed background"),checked:u==="fixed",onChange:g}),(0,Te.jsxs)(Be.__experimentalToggleGroupControl,{size:"__unstable-large",label:(0,Ot.__)("Size"),value:d,onChange:m,isBlock:!0,help:xIe(n||r?.backgroundSize),children:[(0,Te.jsx)(Be.__experimentalToggleGroupControlOption,{value:"cover",label:(0,Ot._x)("Cover","Size option for background image control")},"cover"),(0,Te.jsx)(Be.__experimentalToggleGroupControlOption,{value:"contain",label:(0,Ot._x)("Contain","Size option for background image control")},"contain"),(0,Te.jsx)(Be.__experimentalToggleGroupControlOption,{value:"auto",label:(0,Ot._x)("Tile","Size option for background image control")},"tile")]}),(0,Te.jsxs)(Be.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,Te.jsx)(Be.__experimentalUnitControl,{"aria-label":(0,Ot.__)("Background image width"),onChange:m,value:n,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,Ot.__)("Auto"),disabled:d!=="auto"||d===void 0}),(0,Te.jsx)(Be.ToggleControl,{label:(0,Ot.__)("Repeat"),checked:f,onChange:p,disabled:d==="cover"})]})]})}function cae({value:e,onChange:t,inheritedValue:o=e,settings:r,defaultValues:n={}}){let{globalStyles:i,_links:s}=(0,k_.useSelect)(v=>{let{getSettings:k}=v(_),y=k();return{globalStyles:y[xi],_links:y[S0]}},[]),a=(0,xc.useMemo)(()=>{let v={background:{}};return o?.background?(Object.entries(o?.background).forEach(([k,y])=>{v.background[k]=Rg(y,{styles:i,_links:s})}),v):o},[i,s,o]),c=()=>t(pe(e,["background"],{})),{title:u,url:d}=e?.background?.backgroundImage||{...a?.background?.backgroundImage},f=lp(e)||lp(a),m=e?.background?.backgroundImage||o?.background?.backgroundImage,h=f&&m!=="none"&&(r?.background?.backgroundSize||r?.background?.backgroundPosition||r?.background?.backgroundRepeat),[p,g]=(0,xc.useState)(!1),b=(0,xc.useRef)();return(0,Te.jsx)("div",{ref:b,className:V("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":p}),children:h?(0,Te.jsx)(BIe,{label:u,filename:u,url:d,onToggle:g,hasImageValue:f,onReset:c,containerRef:b,children:(0,Te.jsxs)(Be.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,Te.jsx)(nae,{onChange:t,style:e,inheritedValue:a,displayInPanel:!0,onResetImage:()=>{g(!1),c()},onRemoveImage:()=>g(!1),defaultValues:n,containerRef:b}),(0,Te.jsx)(TIe,{onChange:t,style:e,defaultValues:n,inheritedValue:a})]})}):(0,Te.jsx)(nae,{onChange:t,style:e,inheritedValue:a,defaultValues:n,onResetImage:()=>{g(!1),c()},onRemoveImage:()=>g(!1),containerRef:b})})}var v_=l(w(),1),IIe={backgroundImage:!0};function y_(e){return o2.Platform.OS==="web"&&e?.background?.backgroundImage}function lp(e){return!!e?.background?.backgroundImage?.id||typeof e?.background?.backgroundImage=="string"||!!e?.background?.backgroundImage?.url}function PIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,headerLabel:i}){let s=Ro();return(0,v_.jsx)(t2.__experimentalToolsPanel,{label:i,resetAll:()=>{let c=e(o);t(c)},panelId:r,dropdownMenuProps:s,children:n})}function r2({as:e=PIe,value:t,onChange:o,inheritedValue:r,settings:n,panelId:i,defaultControls:s=IIe,defaultValues:a={},headerLabel:c=(0,WF.__)("Background")}){let u=y_(n),d=()=>o(pe(t,["background"],{})),f=(0,o2.useCallback)(m=>({...m,background:{}}),[]);return(0,v_.jsx)(e,{resetAllFilter:f,value:t,onChange:o,panelId:i,headerLabel:c,children:u&&(0,v_.jsx)(t2.__experimentalToolsPanelItem,{hasValue:()=>!!t?.background,label:(0,WF.__)("Image"),onDeselect:d,isShownByDefault:s.backgroundImage,panelId:i,children:(0,v_.jsx)(cae,{value:t,onChange:o,settings:n,inheritedValue:r,defaultControls:s,defaultValues:a})})})}var i2=l(N(),1),YF=l(w(),1),up="__experimentalBorder",__="shadow",uae=(e,t,o)=>{let r;return e.some(n=>n.colors.some(i=>i[t]===o?(r=i,!0):!1)),r},cp=({colors:e,namedColor:t,customColor:o})=>{if(t){let n=uae(e,"slug",t);if(n)return n}if(!o)return{color:void 0};let r=uae(e,"color",o);return r||{color:o}};function n2(e){let t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function mae(e){if((0,KF.__experimentalHasSplitBorders)(e?.border))return{style:e,borderColor:void 0};let t=e?.border?.color,o=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r={...e};return r.border={...r.border,color:o?void 0:t},{style:Me(r),borderColor:o}}function pae(e){return(0,KF.__experimentalHasSplitBorders)(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function RIe({label:e,children:t,resetAllFilter:o}){let r=(0,Xb.useCallback)(n=>{let i=pae(n),s=o(i);return{...n,...mae(s)}},[o]);return(0,YF.jsx)(fe,{group:"border",resetAllFilter:r,label:e,children:t})}function hae({clientId:e,name:t,setAttributes:o,settings:r}){let n=jP(r),{style:i,borderColor:s}=(0,fae.useSelect)(d=>{if(!n)return{};let{style:f,borderColor:m}=d(_).getBlockAttributes(e)||{};return{style:f,borderColor:m}},[e,n]),a=(0,Xb.useMemo)(()=>pae({style:i,borderColor:s}),[i,s]),c=d=>{o(mae(d))};if(!n)return null;let u={...(0,S_.getBlockSupport)(t,[up,"__experimentalDefaultControls"]),...(0,S_.getBlockSupport)(t,[__,"__experimentalDefaultControls"])};return(0,YF.jsx)(UP,{as:RIe,panelId:e,settings:r,value:a,onChange:c,defaultControls:u})}function s2(e,t="any"){if(Xb.Platform.OS!=="web")return!1;let o=(0,S_.getBlockSupport)(e,up);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}function Kb({blockName:e,hasBorderControl:t,hasShadowControl:o}={}){let r=is(e),n=h_(r);return!t&&!o&&e&&(t=n?.hasBorderColor||n?.hasBorderStyle||n?.hasBorderWidth||n?.hasBorderRadius,o=n?.hasShadow),t&&o?(0,i2.__)("Border & Shadow"):o?(0,i2.__)("Shadow"):(0,i2.__)("Border")}function OIe(e){return!s2(e,"color")||e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}}function gae(e,t,o){if(!s2(t,"color")||Ue(t,up,"color"))return e;let r=qF(o),n=V(e.className,r);return e.className=n||void 0,e}function qF(e){let{borderColor:t,style:o}=e,r=_i("border-color",t);return V({"has-border-color":t||o?.border?.color,[r]:!!r})}function AIe({name:e,borderColor:t,style:o}){let{colors:r}=Cd();if(!s2(e,"color")||Ue(e,up,"color"))return{};let{color:n}=cp({colors:r,namedColor:t}),{color:i}=cp({colors:r,namedColor:n2(o?.border?.top?.color)}),{color:s}=cp({colors:r,namedColor:n2(o?.border?.right?.color)}),{color:a}=cp({colors:r,namedColor:n2(o?.border?.bottom?.color)}),{color:c}=cp({colors:r,namedColor:n2(o?.border?.left?.color)});return gae({style:Me({borderTopColor:i||n,borderRightColor:s||n,borderBottomColor:a||n,borderLeftColor:c||n})||{}},e,{borderColor:t,style:o})}var ZF={useBlockProps:AIe,addSaveProps:gae,attributeKeys:["borderColor","style"],hasSupport(e){return s2(e,"color")}};(0,dae.addFilter)("blocks.registerBlockType","core/border/addAttributes",OIe);var e4=l(ut(),1),wc=l($(),1),Fd=l(R(),1),Eae=l(F(),1);var QF=l($(),1),bae=l(F(),1),kae=l(R(),1);var JF=l(w(),1),dp="background",XF={backgroundSize:"cover",backgroundPosition:"50% 50%"};function a2(e,t="any"){let o=(0,QF.getBlockSupport)(e,dp);return o===!0?!0:t==="any"?!!o?.backgroundImage||!!o?.backgroundSize||!!o?.backgroundRepeat:!!o?.[t]}function l2(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:XF.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:XF.backgroundPosition}),t}function LIe({name:e,style:t}){if(!a2(e)||!t?.background?.backgroundImage)return;let o=l2(t?.background);if(o)return{style:{...o}}}function vae(e){return lp(e)?"has-background":""}function NIe({children:e}){let t=(0,kae.useCallback)(o=>({...o,style:{...o.style,background:void 0}}),[]);return(0,JF.jsx)(fe,{group:"background",resetAllFilter:t,children:e})}function yae({clientId:e,name:t,setAttributes:o,settings:r}){let{style:n,inheritedValue:i}=(0,bae.useSelect)(u=>{let{getBlockAttributes:d,getSettings:f}=u(_),m=f();return{style:d(e)?.style,inheritedValue:m[xi]?.blocks?.[t]}},[e,t]);if(!y_(r)||!a2(t,"backgroundImage"))return null;let s=u=>{o({style:Me(u)})},a={...r,background:{...r.background,backgroundSize:r?.background?.backgroundSize&&a2(t,"backgroundSize")}},c=(0,QF.getBlockSupport)(t,[dp,"defaultControls"]);return(0,JF.jsx)(r2,{inheritedValue:i,as:NIe,panelId:e,defaultValues:XF,settings:a,onChange:s,defaultControls:c,value:n})}var Sae={useBlockProps:LIe,attributeKeys:["style"],hasSupport:a2};var x_=l(R(),1),xae=l(F(),1),wae=l($(),1);var Cae=l(w(),1);function c2(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function _ae(e,t){if(!e||!t)return{};let o=oi(t,"color.text",{fallback:!0}),r=oi(t,"color.background",{fallback:!0}),n=e.querySelector(o)||e,i=e.querySelector(r)||e,s=e.querySelector("a"),a=c2(n,"color"),c=s&&s.textContent?c2(s,"color"):void 0,u=i,d=c2(u,"background-color");for(;d==="rgba(0, 0, 0, 0)"&&u.parentNode&&u.parentNode.nodeType===u.parentNode.ELEMENT_NODE;)u=u.parentNode,d=c2(u,"background-color");return{textColor:a,backgroundColor:d,linkColor:c}}function MIe(e,t){return Object.keys(t).some(r=>e[r]!==t[r])?t:e}function Bae({clientId:e,name:t}){let o=Xe(e),[r,n]=(0,x_.useReducer)(MIe,{}),i=(0,xae.useSelect)(s=>t?s(wae.store).getBlockType(t):void 0,[t]);return(0,x_.useLayoutEffect)(()=>{!o||!i||window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>n(_ae(o,i))))}),(0,x_.useLayoutEffect)(()=>{if(!o||!i)return;let s=new window.MutationObserver(()=>{n(_ae(o,i))});return s.observe(o,{attributes:!0,attributeFilter:["class","style"]}),()=>{s.disconnect()}},[o,i]),(0,Cae.jsx)(JT,{backgroundColor:r.backgroundColor,textColor:r.textColor,linkColor:r.linkColor,enableAlphaChecker:!0})}var u2=l(w(),1),ir="color",d2=e=>{let t=(0,wc.getBlockSupport)(e,ir);return t&&(t.link===!0||t.gradient===!0||t.background!==!1||t.text!==!1)},DIe=e=>{if(Fd.Platform.OS!=="web")return!1;let t=(0,wc.getBlockSupport)(e,ir);return t!==null&&typeof t=="object"&&!!t.link},t4=e=>{let t=(0,wc.getBlockSupport)(e,ir);return t!==null&&typeof t=="object"&&!!t.gradients},VIe=e=>{let t=(0,wc.getBlockSupport)(e,ir);return t&&t.background!==!1},FIe=e=>{let t=(0,wc.getBlockSupport)(e,ir);return t&&t.text!==!1};function zIe(e){return d2(e)&&(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),t4(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}})),e}function Tae(e,t,o){if(!d2(t)||Ue(t,ir))return e;let r=t4(t),{backgroundColor:n,textColor:i,gradient:s,style:a}=o,c=g=>!Ue(t,ir,g),u=c("text")?_i("color",i):void 0,d=c("gradients")?oh(s):void 0,f=c("background")?_i("background-color",n):void 0,m=c("background")||c("gradients"),h=n||a?.color?.background||r&&(s||a?.color?.gradient),p=V(e.className,u,d,{[f]:(!r||!a?.color?.gradient)&&!!f,"has-text-color":c("text")&&(i||a?.color?.text),"has-background":m&&h,"has-link-color":c("link")&&a?.elements?.link?.color});return e.className=p||void 0,e}function Iae(e){let t=e?.color?.text,o=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r=e?.color?.background,n=r?.startsWith("var:preset|color|")?r.substring(17):void 0,i=e?.color?.gradient,s=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,a={...e};return a.color={...a.color,text:o?void 0:t,background:n?void 0:r,gradient:s?void 0:i},{style:Me(a),textColor:o,backgroundColor:n,gradient:s}}function Pae(e){return{...e.style,color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text,background:e.backgroundColor?"var:preset|color|"+e.backgroundColor:e.style?.color?.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:e.style?.color?.gradient}}}function jIe({children:e,resetAllFilter:t}){let o=(0,Fd.useCallback)(r=>{let n=Pae(r),i=t(n);return{...r,...Iae(i)}},[t]);return(0,u2.jsx)(fe,{group:"color",resetAllFilter:o,children:e})}function f2({clientId:e,name:t,setAttributes:o,settings:r,asWrapper:n,label:i,defaultControls:s}){let a=WP(r),{style:c,textColor:u,backgroundColor:d,gradient:f}=(0,Eae.useSelect)(b=>{if(!a)return{};let{style:v,textColor:k,backgroundColor:y,gradient:S}=b(_).getBlockAttributes(e)||{};return{style:v,textColor:k,backgroundColor:y,gradient:S}},[e,a]),m=(0,Fd.useMemo)(()=>Pae({style:c,textColor:u,backgroundColor:d,gradient:f}),[c,u,d,f]),h=b=>{o(Iae(b))};if(!a)return null;s=s||(0,wc.getBlockSupport)(t,[ir,"__experimentalDefaultControls"]);let p=Fd.Platform.OS==="web"&&!m?.color?.gradient&&(r?.color?.text||r?.color?.link)&&(0,wc.getBlockSupport)(t,[ir,"enableContrastChecker"])!==!1;return(0,u2.jsx)($P,{as:n||jIe,panelId:e,settings:r,value:m,onChange:h,defaultControls:s,label:i,enableContrastChecker:(0,wc.getBlockSupport)(t,[ir,"enableContrastChecker"])!==!1,children:p&&(0,u2.jsx)(Bae,{clientId:e,name:t})})}function UIe({name:e,backgroundColor:t,textColor:o,gradient:r,style:n}){let[i,s,a]=me("color.palette.custom","color.palette.theme","color.palette.default"),c=(0,Fd.useMemo)(()=>[...i||[],...s||[],...a||[]],[i,s,a]);if(!d2(e)||Ue(e,ir))return{};let u={};o&&!Ue(e,ir,"text")&&(u.color=fa(c,o)?.color),t&&!Ue(e,ir,"background")&&(u.backgroundColor=fa(c,t)?.color);let d=Tae({style:u},e,{textColor:o,backgroundColor:t,gradient:r,style:n}),f=t||n?.color?.background||r||n?.color?.gradient;return{...d,className:V(d.className,!f&&vae(n))}}var o4={useBlockProps:UIe,addSaveProps:Tae,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:d2},HIe={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function GIe(e,t,o,r){let n=e.name,i={linkColor:DIe(n),textColor:FIe(n),backgroundColor:VIe(n),gradient:t4(n)};return m2(i,HIe,e,t,o,r)}(0,e4.addFilter)("blocks.registerBlockType","core/color/addAttribute",zIe);(0,e4.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",GIe);var br=l(w(),1);function WIe({blockName:e,clientId:t,contentClientIds:o}){let r=is(e),{updateBlockAttributes:n}=(0,p2.useDispatch)(_),{hasButtons:i,hasHeading:s}=(0,p2.useSelect)(c=>{let u=c(_).getBlockNamesByClientId(o);return{hasButtons:u.includes("core/buttons"),hasHeading:u.includes("core/heading")}},[o]);return(0,br.jsx)(f2,{clientId:t,name:e,settings:r,setAttributes:c=>{n(t,c)},asWrapper:HF,label:(0,Qb.__)("Color"),defaultControls:{text:!0,background:!0,button:i,heading:s}})}var $Ie=({blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:r,contentClientIds:n})=>{let i=Kb({blockName:e});return(0,br.jsxs)(br.Fragment,{children:[o&&(0,br.jsx)(Jg,{clientId:t}),r&&(0,br.jsx)(WIe,{blockName:e,clientId:t,contentClientIds:n}),(!r||e==="core/template-part")&&(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(fe.Slot,{group:"color",label:(0,Qb.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,br.jsx)(fe.Slot,{group:"background",label:(0,Qb.__)("Background image")}),(0,br.jsx)(fe.Slot,{group:"filter"}),(0,br.jsx)(fe.Slot,{group:"typography",label:(0,Qb.__)("Typography")}),(0,br.jsx)(fe.Slot,{group:"dimensions",label:(0,Qb.__)("Dimensions")}),(0,br.jsx)(fe.Slot,{group:"border",label:i}),(0,br.jsx)(fe.Slot,{group:"styles"})]})]})},Rae=$Ie;var Oae=l(A(),1),Aae=l(N(),1);var h2=l($(),1),g2=l(F(),1),fi=l(A(),1);var ss=l(w(),1);function b2({clientIds:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){return e.length?(0,ss.jsx)(fi.__experimentalVStack,{spacing:1,children:e.map(n=>(0,ss.jsx)(KIe,{onSelect:t,onSwitchToListView:o,hasListViewTab:r,clientId:n},n))}):null}function KIe({clientId:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){let n=Tt(e),{isSelected:i,childBlocks:s,hasListViewSupport:a,blockName:c}=(0,g2.useSelect)(p=>{let{isBlockSelected:g,hasSelectedInnerBlock:b,getBlockOrder:v,getBlockName:k}=p(_),y=k(e);return{isSelected:g(e)||b(e,!0),childBlocks:v(e),hasListViewSupport:y==="core/navigation"||(0,h2.hasBlockSupport)(y,"listView"),blockName:y}},[e]),d=(0,h2.getBlockType)(c)?.title||c,{selectBlock:f}=(0,g2.useDispatch)(_),h=s&&s.length>0&&r&&a;return(0,ss.jsx)(fi.Button,{__next40pxDefaultSize:!0,className:"block-editor-block-quick-navigation__item",isPressed:i,onClick:async()=>{await f(e),h&&o&&o(e),t&&t(e)},children:(0,ss.jsxs)(fi.Flex,{children:[(0,ss.jsx)(fi.FlexItem,{children:(0,ss.jsx)(Ae,{icon:n?.icon})}),(0,ss.jsx)(fi.FlexBlock,{style:{textAlign:"left"},children:(0,ss.jsx)(fi.__experimentalTruncate,{children:d})}),h&&(0,ss.jsx)(fi.FlexItem,{children:(0,ss.jsx)(we,{icon:Vo,size:24})})]})})}var Jb=l(w(),1),YIe=({contentClientIds:e,onSwitchToListView:t,hasListViewTab:o})=>{if(!e||e.length===0)return null;let r=window?.__experimentalContentOnlyInspectorFields;return(0,Jb.jsx)(Jb.Fragment,{children:!r&&(0,Jb.jsx)(Oae.PanelBody,{title:(0,Aae.__)("Content"),children:(0,Jb.jsx)(b2,{clientIds:e,onSwitchToListView:t,hasListViewTab:o})})})},k2=YIe;var Wo=l(w(),1),{Tabs:zd}=M(tk.privateApis);function r4({blockName:e,clientId:t,hasBlockStyles:o,tabs:r,isSectionBlock:n,contentClientIds:i}){let s=(0,ra.useRef)(null),a=(0,ek.useSelect)(S=>S(Lae.store).get("core","showIconLabels"),[]),{requestedTab:c}=(0,ek.useSelect)(S=>({requestedTab:M(S(_)).getRequestedInspectorTab()})),[u,d]=(0,ra.useState)(()=>c?.tabName??r[0]?.name),f=(0,ra.useRef)(!1),m=(0,ra.useRef)(!1),{__unstableSetOpenListViewPanel:h,__unstableIncrementListViewExpandRevision:p,__unstableSetAllListViewPanelsOpen:g}=(0,ek.useDispatch)(_),{clearRequestedInspectorTab:b}=M((0,ek.useDispatch)(_));(0,ra.useEffect)(()=>{f.current=!1},[t]),(0,ra.useEffect)(()=>{c&&(d(c.tabName),c.tabName===Sc.name&&c.options?.openPanel&&(h(c.options.openPanel),p()),m.current=!0,f.current=!0,b())},[c,h,p,b]),(0,ra.useEffect)(()=>{u===Sc.name&&!f.current&&(g(),p())},[t,u,g,p]),(0,ra.useEffect)(()=>{if(!r?.length||f.current&&r.some(x=>x.name===u))return;let S=r[0]?.name;u!==S&&d(S)},[r,u]);let v=S=>{d(S),f.current=!0,S===Sc.name&&!m.current&&(g(),p()),m.current=!1},k=r.some(S=>S.name===Sc.name),y=S=>{k&&(h(S),p(),m.current=!0,v(Sc.name))};return(0,Wo.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,Wo.jsxs)(zd,{selectedTabId:u,onSelect:v,children:[(0,Wo.jsx)(zd.TabList,{children:r.map(S=>a?(0,Wo.jsx)(zd.Tab,{tabId:S.name,children:S.title},S.name):(0,Wo.jsx)(tk.Tooltip,{text:S.title,children:(0,Wo.jsx)(zd.Tab,{tabId:S.name,"aria-label":S.title,children:(0,Wo.jsx)(tk.Icon,{icon:S.icon})})},S.name))}),(0,Wo.jsxs)(zd.TabPanel,{tabId:xP.name,focusable:!1,children:[(0,Wo.jsx)(k2,{contentClientIds:i,onSwitchToListView:y,hasListViewTab:k}),(0,Wo.jsx)(fe.Slot,{group:"content"})]}),(0,Wo.jsxs)(zd.TabPanel,{tabId:Sc.name,focusable:!1,children:[(0,Wo.jsx)(fe.Slot,{group:"list",ref:s}),(0,Wo.jsx)(oE,{listViewRef:s})]}),(0,Wo.jsx)(zd.TabPanel,{tabId:SP.name,focusable:!1,children:(0,Wo.jsx)(ase,{showAdvancedControls:!!e})}),(0,Wo.jsx)(zd.TabPanel,{tabId:_P.name,focusable:!1,children:(0,Wo.jsx)(Rae,{blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:n,contentClientIds:i})})]},t)})}var mi=l(A(),1),Nae=l(F(),1);var qIe=[];function ZIe(e,t={}){return t[e]!==void 0?t[e]:t.default!==void 0?t.default:!0}function Mae(e,t,o,r){let n=[],{bindings:i,border:s,color:a,content:c,default:u,dimensions:d,list:f,position:m,styles:h,typography:p,effects:g}=Wi,b=(0,mi.__experimentalUseSlotFills)(f.name),v=!!b&&b.length,k=(0,mi.__experimentalUseSlotFills)(c.name),y=!!k&&k.length,x=[...(0,mi.__experimentalUseSlotFills)(s.name)||[],...(0,mi.__experimentalUseSlotFills)(a.name)||[],...(0,mi.__experimentalUseSlotFills)(d.name)||[],...(0,mi.__experimentalUseSlotFills)(h.name)||[],...(0,mi.__experimentalUseSlotFills)(p.name)||[],...(0,mi.__experimentalUseSlotFills)(g.name)||[]].length,C=[...(0,mi.__experimentalUseSlotFills)(nd.slotName)||[],...(0,mi.__experimentalUseSlotFills)(i.name)||[]],B=[...(0,mi.__experimentalUseSlotFills)(u.name)||[],...(0,mi.__experimentalUseSlotFills)(m.name)||[],...v&&x>1?C:[]],I=window?.__experimentalContentOnlyInspectorFields,P=y||!I&&t?.length;P&&n.push(xP),v&&n.push(Sc),(B.length||C.length&&(P||v))&&n.push(SP);let{tabSettings:E,isPreviewMode:L}=(0,Nae.useSelect)(O=>{let D=O(_).getSettings();return{tabSettings:D.blockInspectorTabs,isPreviewMode:D.isPreviewMode}},[]);return!L&&(r||x)&&n.push(_P),ZIe(e,E)?n:qIe}var Dae=l(A(),1);var n4=l(w(),1),{Fill:XIe,Slot:QIe}=(0,Dae.createSlotFill)(Symbol("InspectorControlsLastItem")),Vae=e=>Ie()[bs]?(0,n4.jsx)(XIe,{...e}):null;Vae.Slot=function(t){return(0,n4.jsx)(QIe,{...t})};var v2=Vae;var Fae=l(F(),1);function zae(e){return(0,Fae.useSelect)(t=>{if(e){let o=t(_).getSettings().blockInspectorAnimation,r=o?.animationParent,{getSelectedBlockClientId:n,getBlockParentsByBlockName:i}=t(_),s=n();return!i(s,r,!0)[0]&&e.name!==r?null:o?.[e.name]}return null},[e])}var _e=l(w(),1);function Hae({blockName:e,showAdvancedControls:t=!0,showPositionControls:o=!0,showBindingsControls:r=!0}){let n=Kb({blockName:e});return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(fe.Slot,{}),(0,_e.jsx)(fe.Slot,{group:"color",label:(0,ok.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,_e.jsx)(fe.Slot,{group:"background",label:(0,ok.__)("Background image")}),(0,_e.jsx)(fe.Slot,{group:"typography",label:(0,ok.__)("Typography")}),(0,_e.jsx)(fe.Slot,{group:"dimensions",label:(0,ok.__)("Dimensions")}),(0,_e.jsx)(fe.Slot,{group:"border",label:n}),(0,_e.jsx)(fe.Slot,{group:"styles"}),o&&(0,_e.jsx)(BP,{}),r&&(0,_e.jsx)(fe.Slot,{group:"bindings"}),t&&(0,_e.jsx)("div",{children:(0,_e.jsx)(wP,{})})]})}function JIe(){let{selectedBlockCount:e,renderedBlockName:t,renderedBlockClientId:o,blockType:r,isSectionBlock:n,isSectionBlockInSelection:i,hasBlockStyles:s,editedContentOnlySection:a}=(0,i4.useSelect)(g=>{let{getSelectedBlockClientId:b,getSelectedBlockClientIds:v,getSelectedBlockCount:k,getBlockName:y,getParentSectionBlock:S,isSectionBlock:x,getEditedContentOnlySection:C,isWithinEditedContentOnlySection:B}=M(g(_)),{getBlockStyles:I}=g(jd.store),P=b(),L=B(P)?P:S(P)||P,T=L&&y(L),O=T&&(0,jd.getBlockType)(T),U=v().some(z=>x(z)),G=T&&I(T),j=G&&G.length>0;return{selectedBlockCount:k(),renderedBlockClientId:L,renderedBlockName:T,blockType:O,isSectionBlockInSelection:U,isSectionBlock:x(L),hasBlockStyles:j,editedContentOnlySection:C()}},[]),c=(0,i4.useSelect)(g=>{if(!n||!o)return[];let{getClientIdsOfDescendants:b,getBlockName:v,getBlockEditingMode:k}=M(g(_)),y=b(o),S=new Set;return y.forEach(x=>{let C=v(x);(C==="core/navigation"||(0,jd.hasBlockSupport)(C,"listView"))&&b(x).forEach(I=>S.add(I))}),y.filter(x=>!S.has(x)&&k(x)==="contentOnly")},[n,o]),u=Mae(r?.name,c,n,s),d=u?.length>1,f=zae(r),m=e>1;if(m&&!i)return(0,_e.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,_e.jsx)(MF,{}),d?(0,_e.jsx)(r4,{tabs:u}):(0,_e.jsx)(Hae,{blockName:t,showAdvancedControls:!1,showPositionControls:!1,showBindingsControls:!1})]});if(m&&i)return(0,_e.jsx)("div",{className:"block-editor-block-inspector",children:(0,_e.jsx)(MF,{})});let h=t===(0,jd.getUnregisteredTypeHandlerName)();return!r||!o||h?(0,_e.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,ok.__)("No block selected.")}):(0,_e.jsx)(ePe,{animate:f,wrapper:g=>(0,_e.jsx)(tPe,{blockInspectorAnimationSettings:f,renderedBlockClientId:o,children:g}),children:(0,_e.jsx)(oPe,{renderedBlockClientId:o,blockName:r.name,isSectionBlock:n,availableTabs:u,contentClientIds:c,hasBlockStyles:s,editedContentOnlySection:a})})}var ePe=({animate:e,wrapper:t,children:o})=>e?t(o):o,tPe=({blockInspectorAnimationSettings:e,renderedBlockClientId:t,children:o})=>{let r=e&&e.enterDirection==="leftToRight"?-50:50;return(0,_e.jsx)(jae.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},children:o},t)},oPe=({renderedBlockClientId:e,blockName:t,isSectionBlock:o,availableTabs:r,contentClientIds:n,hasBlockStyles:i,editedContentOnlySection:s})=>{let a=(0,Uae.useRef)(null),c=r?.length>1,u=s&&s!==e,d=Tt(s),f=Tt(e),m=f.isSynced;return(0,_e.jsxs)("div",{className:"block-editor-block-inspector",children:[u&&(0,_e.jsx)(Sy,{...d,className:d?.isSynced&&"is-synced",parentClientId:s}),(0,_e.jsx)(Sy,{...f,allowParentNavigation:!0,className:m&&"is-synced",isChild:u,clientId:e}),(0,_e.jsx)(d9,{clientId:e}),(0,_e.jsx)(Qie,{clientId:e}),(0,_e.jsx)($T,{blockClientId:e}),c&&(0,_e.jsx)(_e.Fragment,{children:(0,_e.jsx)(r4,{hasBlockStyles:i,clientId:e,blockName:t,tabs:r,isSectionBlock:o,contentClientIds:n})}),!c&&(0,_e.jsxs)(_e.Fragment,{children:[i&&(0,_e.jsx)(Jg,{clientId:e}),(0,_e.jsx)(k2,{contentClientIds:n}),(0,_e.jsx)(fe.Slot,{group:"content"}),(0,_e.jsx)(fe.Slot,{group:"list",ref:a}),(0,_e.jsx)(oE,{listViewRef:a}),!o&&(0,_e.jsx)(Hae,{blockName:t})]}),(0,_e.jsx)(v2.Slot,{}),(0,_e.jsx)(vP,{},"back")]})},Gae=JIe;var s4=l(Re(),1);var Wae=l(w(),1),$ae=()=>((0,s4.default)("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),wy());function Kae(e){return(0,s4.default)("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,Wae.jsx)("div",{...e,ref:wy()})}var Yae=l(F(),1),a4=l(R(),1);var l4=l(w(),1),rPe=()=>{};function nPe({rootClientId:e,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n=!1,__experimentalInsertionIndex:i,__experimentalInitialTab:s,__experimentalInitialCategory:a,__experimentalFilterValue:c,onPatternCategorySelection:u,onSelect:d=rPe,shouldFocusBlock:f=!1,onClose:m},h){let{destinationRootClientId:p}=(0,Yae.useSelect)(g=>{let{getBlockRootClientId:b}=g(_);return{destinationRootClientId:e||b(t)||void 0}},[t,e]);return(0,l4.jsx)($5,{onSelect:d,rootClientId:p,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n,__experimentalInsertionIndex:i,__experimentalFilterValue:c,onPatternCategorySelection:u,__experimentalInitialTab:s,__experimentalInitialCategory:a,shouldFocusBlock:f,ref:h,onClose:m})}var c4=(0,a4.forwardRef)(nPe);function iPe(e,t){return(0,l4.jsx)(c4,{...e,onPatternCategorySelection:void 0,ref:t})}var qae=(0,a4.forwardRef)(iPe);var Zae=l(Re(),1);function Xae(){return(0,Zae.default)("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}var Qae=l(Z(),1),w_=l(Fe(),1),Jae=l(F(),1),Ud=l(it(),1);var ele=l(w(),1),sPe=window.navigator.userAgent.indexOf("Trident")!==-1,aPe=new Set([Ud.UP,Ud.DOWN,Ud.LEFT,Ud.RIGHT]),lPe=.75;function u4(){let e=(0,Jae.useSelect)(t=>t(_).hasSelectedBlock(),[]);return(0,Qae.useRefEffect)(t=>{if(!e)return;let{ownerDocument:o}=t,{defaultView:r}=o,n,i,s;function a(){n||(n=r.requestAnimationFrame(()=>{m(),n=null}))}function c(g){i&&r.cancelAnimationFrame(i),i=r.requestAnimationFrame(()=>{u(g),i=null})}function u({keyCode:g}){if(!h())return;let b=(0,w_.computeCaretRect)(r);if(!b)return;if(!s){s=b;return}if(aPe.has(g)){s=b;return}let v=b.top-s.top;if(v===0)return;let k=(0,w_.getScrollContainer)(t);if(!k)return;let y=k===o.body||k===o.documentElement,S=y?r.scrollY:k.scrollTop,x=y?0:k.getBoundingClientRect().top,C=y?s.top/r.innerHeight:(s.top-x)/(r.innerHeight-x);if(S===0&&Cx+B||s.top{r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a,!0),t.removeEventListener("keydown",c),t.removeEventListener("keyup",u),t.removeEventListener("mousedown",d),t.removeEventListener("touchstart",d),o.removeEventListener("selectionchange",f),r.cancelAnimationFrame(n),r.cancelAnimationFrame(i)}},[e])}function cPe({children:e}){return(0,ele.jsx)("div",{ref:u4(),className:"block-editor__typewriter",children:e})}var uPe=sPe?e=>e.children:cPe,tle=uPe;var fp=l(R(),1),d4=l(Re(),1);var f4=l(w(),1),y2=(0,fp.createContext)({});y2.displayName="RenderedRefsContext";function dPe(e,t,o){let r={...e,[t]:e[t]?new Set(e[t]):new Set};return r[t].add(o),r}function m4({children:e,uniqueId:t,blockName:o=""}){let r=(0,fp.useContext)(y2),{name:n}=Ie();o=o||n;let i=(0,fp.useMemo)(()=>dPe(r,o,t),[r,o,t]);return(0,f4.jsx)(y2.Provider,{value:i,children:e})}function p4(e,t=""){let o=(0,fp.useContext)(y2),{name:r}=Ie();return t=t||r,!!o[t]?.has(e)}var ole=e=>((0,d4.default)("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,f4.jsx)(m4,{...e})),rle=(...e)=>((0,d4.default)("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),p4(...e));var _2=l(A(),1),h4=l(N(),1),g4=l(R(),1),ile=l(hc(),1);var pi=l(A(),1);var nle=l(N(),1),Cc=l(w(),1);function S2({title:e,help:t,actions:o=[],onClose:r}){return(0,Cc.jsxs)(pi.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,Cc.jsxs)(pi.__experimentalHStack,{alignment:"center",children:[(0,Cc.jsx)(pi.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,Cc.jsx)(pi.__experimentalSpacer,{}),o.map(({label:n,icon:i,onClick:s})=>(0,Cc.jsx)(pi.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:n,icon:i,variant:!i&&"tertiary",onClick:s,children:!i&&n},n)),r&&(0,Cc.jsx)(pi.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:(0,nle.__)("Close"),icon:Cf,onClick:r})]}),t&&(0,Cc.jsx)(pi.__experimentalText,{children:t})]})}var rk=l(w(),1);function fPe({onClose:e,onChange:t,showPopoverHeaderActions:o,isCompact:r,currentDate:n,title:i,...s},a){let c={startOfWeek:(0,ile.getSettings)().l10n.startOfWeek,onChange:t,currentDate:r?void 0:n,currentTime:r?n:void 0,...s},u=r?_2.TimePicker:_2.DateTimePicker;return(0,rk.jsxs)("div",{ref:a,className:"block-editor-publish-date-time-picker",children:[(0,rk.jsx)(S2,{title:i||(0,h4.__)("Publish"),actions:o?[{label:(0,h4.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,rk.jsx)(u,{...c})]})}var b4=(0,g4.forwardRef)(fPe);function mPe(e,t){return(0,rk.jsx)(b4,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}var sle=(0,g4.forwardRef)(mPe);var x2=l(F(),1),ale=l(R(),1);function ao(e){let t=Ie(),{clientId:o=""}=t,r=(0,x2.useRegistry)(),n=(0,x2.useSelect)(i=>o?null:i(_).getBlockEditingMode(),[o]);return(0,ale.useEffect)(()=>{if(!e)return;let{setBlockEditingMode:i,unsetBlockEditingMode:s,__unstableMarkNextChangeAsNotPersistent:a}=r.dispatch(_);return a(),i(o,e),()=>{a(),s(o)}},[r,o,e]),o?t[d0]:n}var lle=l(Re(),1),cle=l(R(),1);function pPe(){return(0,lle.default)("wp.blockEditor.ToolSelector",{since:"6.9",hint:"The ToolSelector component no longer renders anything."}),null}var ule=(0,cle.forwardRef)(pPe);var B_=l(w(),1),Me=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return e;let t=Object.entries(e).map(([o,r])=>[o,Me(r)]).filter(([,o])=>o!==void 0);return t.length?Object.fromEntries(t):void 0};function m2(e,t,o,r,n,i){if(Object.values(e??{}).every(c=>!c)||i.length===1&&o.innerBlocks.length===r.length)return o;let s=r[0]?.attributes;if(i.length>1&&r.length>1)if(r[n])s=r[n]?.attributes;else return o;let a=o;return Object.entries(e).forEach(([c,u])=>{u&&t[c].forEach(d=>{let f=Sl(s,d);f&&(a={...a,attributes:pe(a.attributes,d,f)})})}),a}function Ue(e,t,o){let n=(0,dle.getBlockSupport)(e,t)?.__experimentalSkipSerialization;return Array.isArray(n)?n.includes(o):n}var Bc=new WeakMap;function Qn({id:e,css:t}){return oc({id:e,css:t})}function oc({id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i}={}){let{setStyleOverride:s,deleteStyleOverride:a}=M((0,w2.useDispatch)(_)),c=(0,w2.useRegistry)(),u=(0,as.useId)();(0,as.useEffect)(()=>{if(!t&&!o)return;let d=e||u,f={id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i};return Bc.get(c)||Bc.set(c,[]),Bc.get(c).push([d,f]),window.queueMicrotask(()=>{Bc.get(c)?.length&&c.batch(()=>{Bc.get(c).forEach(m=>{s(...m)}),Bc.set(c,[])})}),()=>{Bc.get(c)?.find(([h])=>h===d)?Bc.set(c,Bc.get(c).filter(([h])=>h!==d)):a(d)}},[e,t,i,o,r,u,s,a,c,n])}function is(e,t){let[o,r,n,i,s,a,c,u,d,f,m,h,p,g,b,v,k,y,S,x,C,B,I,P,E,L,T,O,D,U,G,j,z,W,ee,se,ce,ie,re,Q,Y,J,K,H,X,ne,le,ve,he,xe,ze,ot,Wt,fo,Do,rt,ar,xt,At,Pe,wt]=me("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.width","dimensions.dimensionSizes","layout","border.color","border.radius","border.style","border.width","border.radiusSizes","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow"),qo=(0,as.useMemo)(()=>({background:{backgroundImage:o,backgroundSize:r},color:{palette:{custom:J,theme:H,default:X},gradients:{custom:ze,theme:ot,default:Wt},duotone:{custom:ve,theme:he,default:xe},defaultGradients:fo,defaultPalette:ne,defaultDuotone:le,custom:Y,customGradient:Do,customDuotone:K,background:rt,link:ar,heading:At,button:Pe,text:xt},typography:{fontFamilies:{custom:n,default:i,theme:s},fontSizes:{custom:c,default:u,theme:d},customFontSize:f,defaultFontSizes:a,fontStyle:m,fontWeight:h,lineHeight:p,textAlign:g,textColumns:b,textDecoration:v,textIndent:k,textTransform:S,letterSpacing:x,writingMode:y},spacing:{spacingSizes:{custom:L,default:T,theme:O},customSpacingSize:E,defaultSpacingSizes:P,padding:C,margin:B,blockGap:I,units:D},border:{color:se,radius:ce,style:ie,width:re,radiusSizes:Q},dimensions:{aspectRatio:U,height:G,minHeight:j,width:z,dimensionSizes:W},layout:ee,parentLayout:t,shadow:wt}),[o,r,n,i,s,a,c,u,d,f,m,h,p,g,b,v,k,S,x,y,C,B,I,P,E,L,T,O,D,U,G,j,z,W,ee,t,se,ce,ie,re,Q,Y,J,K,H,X,ne,le,ve,he,xe,ze,ot,Wt,fo,Do,rt,ar,xt,At,Pe,wt]);return IP(qo,e)}function fle(e){e=e.map(o=>({...o,Edit:(0,as.memo)(o.edit)}));let t=(0,k4.createHigherOrderComponent)(o=>function(n){let i=Ie();return[...e.map((s,a)=>{let{Edit:c,hasSupport:u,attributeKeys:d=[],shareWithChildBlocks:f,supportsPatternEditing:m}=s;if(!(m&&i[Kc]||i[bs]||i[Rp]&&f)||!u(n.name))return null;let p={};for(let g of d)n.attributes[g]&&(p[g]=n.attributes[g]);return(0,B_.jsx)(c,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...p},a)}),(0,B_.jsx)(o,{...n},"edit")]},"withBlockEditHooks");(0,C_.addFilter)("editor.BlockEdit","core/editor/hooks",t)}function hPe({index:e,useBlockProps:t,setAllWrapperProps:o,...r}){let n=t(r),i=s=>o(a=>{let c=[...a];return c[e]=s,c});return(0,as.useEffect)(()=>(i(n),()=>{i(void 0)})),null}var gPe=(0,as.memo)(hPe);function mle(e){let t=(0,k4.createHigherOrderComponent)(o=>function(n){let[i,s]=(0,as.useState)(Array(e.length).fill(void 0));return[...e.map((a,c)=>{let{hasSupport:u,attributeKeys:d=[],useBlockProps:f,isMatch:m}=a,h={};for(let p of d)n.attributes[p]&&(h[p]=n.attributes[p]);return!Object.keys(h).length||!u(n.name)||m&&!m(h)?null:(0,B_.jsx)(gPe,{index:c,useBlockProps:f,setAllWrapperProps:s,name:n.name,clientId:n.clientId,...h},c)}),(0,B_.jsx)(o,{...n,wrapperProps:i.filter(Boolean).reduce((a,c)=>({...a,...c,className:V(a.className,c.className),style:{...a.style,...c.style}}),n.wrapperProps||{})},"edit")]},"withBlockListBlockHooks");(0,C_.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}function ple(e){function t(o,r,n){return e.reduce((i,s)=>{let{hasSupport:a,attributeKeys:c=[],addSaveProps:u}=s,d={};for(let f of c)n[f]&&(d[f]=n[f]);return!Object.keys(d).length||!a(r)?i:u(i,r,d)},o)}(0,C_.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",t,0),(0,C_.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",o=>(o.hasOwnProperty("className")&&!o.className&&delete o.className,o))}var hle=l($(),1),gle=l(ut(),1);function bPe(e){let{apiVersion:t=1}=e;return t<2&&(0,hle.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}(0,gle.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",bPe);function ble(e){e.hasAttribute("crossorigin")||e.setAttribute("crossorigin","anonymous")}if(window.crossOriginIsolated){let e=function(){document.body?t.observe(document.body,{childList:!0,attributes:!0,subtree:!0}):document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",()=>{document.body&&t.observe(document.body,{childList:!0,attributes:!0,subtree:!0})})};kPe=e;let t=new window.MutationObserver(o=>{o.forEach(r=>{[r.addedNodes,r.target].forEach(n=>{(n instanceof window.NodeList?n:[n]).forEach(s=>{let a=s;a.querySelectorAll&&(a.querySelectorAll("source,script,video,link").forEach(c=>{ble(c)}),["SOURCE","SCRIPT","VIDEO","LINK"].includes(a.nodeName)&&ble(a))})})})});e()}var kPe;var kle=l(ut(),1),ls=l($(),1);var v4=l(w(),1),y4=["left","center","right","wide","full"],vPe=["wide","full"];function S4(e,t=!0,o=!0){let r;return Array.isArray(e)?r=y4.filter(n=>e.includes(n)):e===!0?r=[...y4]:r=[],!o||e===!0&&!t?r.filter(n=>!vPe.includes(n)):r}function yPe(e){return"type"in(e.attributes?.align??{})||(0,ls.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...y4,""]}}),e}function SPe({name:e,align:t,setAttributes:o}){let r=S4((0,ls.getBlockSupport)(e,"align"),(0,ls.hasBlockSupport)(e,"alignWide",!0)),n=Gv(r).map(({name:a})=>a),i=ao();return!n.length||i!=="default"?null:(0,v4.jsx)(Mt,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,v4.jsx)(uC,{value:t,onChange:a=>{a||(0,ls.getBlockType)(e)?.attributes?.align?.default&&(a=""),o({align:a})},controls:n})})}var C2={shareWithChildBlocks:!0,edit:SPe,useBlockProps:_Pe,addSaveProps:xPe,attributeKeys:["align"],hasSupport(e){return(0,ls.hasBlockSupport)(e,"align",!1)}};function _Pe({name:e,align:t}){let o=S4((0,ls.getBlockSupport)(e,"align"),(0,ls.hasBlockSupport)(e,"alignWide",!0));return Gv(o).some(n=>n.name===t)?{"data-align":t}:{}}function xPe(e,t,o){let{align:r}=o,n=(0,ls.getBlockSupport)(t,"align"),i=(0,ls.hasBlockSupport)(t,"alignWide",!0);return S4(n,i).includes(r)&&(e.className=V(`align${r}`,e.className)),e}(0,kle.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",yPe);var vle=l(ut(),1);function wPe(e){return"type"in(e.attributes?.lock??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}(0,vle.addFilter)("blocks.registerBlockType","core/lock/addAttribute",wPe);var B4=l(ut(),1),lk=l($(),1);var E_=l(A(),1),T2=l(N(),1),Rle=l(R(),1),Ole=l(F(),1),I2=l($(),1);var Pn=l(A(),1),Tle=l(R(),1),ak=l(N(),1),Ile=l(F(),1);var w4=l($(),1),Cle=l(F(),1),sk=l(A(),1),na=l(N(),1),B2=l(R(),1),Ble=l(Z(),1),Ele=l(Xo(),1);var _4=l(R(),1),_le=l(Z(),1),xle=l(A(),1);var yle=l(A(),1);var nk=l(w(),1);function CPe({blockTypes:e,value:t,onItemChange:o}){return(0,nk.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map(r=>(0,nk.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,nk.jsx)(yle.CheckboxControl,{label:r.title,checked:t.includes(r.name),onChange:(...n)=>o(r,...n)}),(0,nk.jsx)(Ae,{icon:r.icon})]},r.name))})}var Sle=CPe;var ik=l(w(),1);function wle({title:e,blockTypes:t,selectedBlockTypes:o,onChange:r}){let n=(0,_le.useInstanceId)(wle),i=(0,_4.useCallback)((f,m)=>{r(m?[...o,f]:o.filter(({name:h})=>h!==f.name))},[o,r]),s=(0,_4.useCallback)(f=>{r(f?[...o,...t.filter(m=>!o.find(({name:h})=>h===m.name))]:o.filter(m=>!t.find(({name:h})=>h===m.name)))},[t,o,r]);if(!t.length)return null;let a=t.map(({name:f})=>f).filter(f=>(o??[]).some(m=>m.name===f)),c="block-editor-block-manager__category-title-"+n,u=a.length===t.length,d=!u&&a.length>0;return(0,ik.jsxs)("div",{role:"group","aria-labelledby":c,className:"block-editor-block-manager__category",children:[(0,ik.jsx)(xle.CheckboxControl,{checked:u,onChange:s,className:"block-editor-block-manager__category-title",indeterminate:d,label:(0,ik.jsx)("span",{id:c,children:e})}),(0,ik.jsx)(Sle,{blockTypes:t,value:a,onItemChange:i})]})}var x4=wle;var Ec=l(w(),1);function E2({blockTypes:e,selectedBlockTypes:t,onChange:o,showSelectAll:r=!0}){let n=(0,Ble.useDebounce)(Ele.speak,500),[i,s]=(0,B2.useState)(""),{categories:a,isMatchingSearchTerm:c}=(0,Cle.useSelect)(m=>({categories:m(w4.store).getCategories(),isMatchingSearchTerm:m(w4.store).isMatchingSearchTerm}),[]),u=e.filter(m=>!i||c(m,i)),d=t.length>0&&t.length!==e.length,f=e.length>0&&t.length===e.length;return(0,B2.useEffect)(()=>{if(!i)return;let m=u.length,h=(0,na.sprintf)((0,na._n)("%d result found.","%d results found.",m),m);n(h)},[u?.length,i,n]),(0,Ec.jsxs)(sk.__experimentalVStack,{className:"block-editor-block-manager__content",spacing:4,children:[(0,Ec.jsx)(sk.SearchControl,{label:(0,na.__)("Search for a block"),placeholder:(0,na.__)("Search for a block"),value:i,onChange:m=>s(m),className:"block-editor-block-manager__search"}),r&&(0,Ec.jsx)(sk.CheckboxControl,{className:"block-editor-block-manager__select-all",label:(0,na.__)("Select all"),checked:f,onChange:()=>{o(f?[]:e)},indeterminate:d}),(0,Ec.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,na.__)("Available block types"),className:"block-editor-block-manager__results",children:[u.length===0&&(0,Ec.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,na.__)("No blocks found.")}),a.map(m=>(0,Ec.jsx)(x4,{title:m.title,blockTypes:u.filter(h=>h.category===m.slug),selectedBlockTypes:t,onChange:o},m.slug)),(0,Ec.jsx)(x4,{title:(0,na.__)("Uncategorized"),blockTypes:u.filter(({category:m})=>!m),selectedBlockTypes:t,onChange:o})]})]})}var ia=l(w(),1);function Ple({clientId:e,blockTypes:t,selectedBlockTypes:o,onClose:r}){let[n,i]=(0,Tle.useState)(o),{updateBlockAttributes:s}=(0,Ile.useDispatch)(_),a=()=>{let c=n.length===t.length,u=n.map(({name:d})=>d);s(e,{allowedBlocks:c?void 0:u}),r()};return(0,ia.jsx)(Pn.Modal,{title:(0,ak._x)("Manage allowed blocks","modal title"),onRequestClose:r,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,ia.jsxs)(Pn.__experimentalVStack,{as:"form",onSubmit:c=>{c.preventDefault(),a()},spacing:"4",children:[(0,ia.jsx)(Pn.__experimentalText,{children:(0,ak.__)("Select which blocks can be added inside this container.")}),(0,ia.jsx)(E2,{blockTypes:t,selectedBlockTypes:n,onChange:c=>{i(c)}}),(0,ia.jsxs)(Pn.Flex,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,ia.jsx)(Pn.FlexItem,{children:(0,ia.jsx)(Pn.Button,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:(0,ak.__)("Cancel")})}),(0,ia.jsx)(Pn.FlexItem,{children:(0,ia.jsx)(Pn.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,ak.__)("Apply")})})]})]})})}var mp=l(w(),1);function Ale({clientId:e}){let[t,o]=(0,Rle.useState)(!1),{blockTypes:r,selectedBlockNames:n}=(0,Ole.useSelect)(a=>{let{getBlockAttributes:c}=a(_);return{blockTypes:a(I2.store).getBlockTypes(),selectedBlockNames:c(e)?.allowedBlocks}},[e]),i=r.filter(a=>(0,I2.hasBlockSupport)(a,"inserter",!0)&&(!a.parent||a.parent.includes("core/post-content")));if(!i)return null;let s=n===void 0?i:i.filter(a=>n.includes(a.name));return(0,mp.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,mp.jsxs)(E_.BaseControl,{help:(0,T2.__)("Specify which blocks are allowed inside this container."),children:[(0,mp.jsx)(E_.BaseControl.VisualLabel,{children:(0,T2.__)("Allowed Blocks")}),(0,mp.jsx)(E_.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{o(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,T2.__)("Manage allowed blocks")})]}),t&&(0,mp.jsx)(Ple,{clientId:e,blockTypes:i,selectedBlockTypes:s,onClose:()=>o(!1)})]})}var C4=l(w(),1);function BPe({clientId:e}){return ao()==="contentOnly"?null:(0,C4.jsx)(aS.Fill,{children:(0,C4.jsx)(Ale,{clientId:e})})}var Lle={edit:BPe,attributeKeys:["allowedBlocks"],hasSupport(e){return(0,lk.hasBlockSupport)(e,"allowedBlocks")}};function EPe(e){return e?.attributes?.allowedBlocks?.type||(0,lk.hasBlockSupport)(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e}(0,B4.addFilter)("blocks.registerBlockType","core/allowedBlocks/attribute",EPe);function TPe(e,t,o,r){if(!(0,lk.hasBlockSupport)(e.name,"allowedBlocks")||t.length!==1&&r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length||e.attributes.allowedBlocks)return e;let n=t[o]?.attributes?.allowedBlocks;if(!n)return e;let s=(0,lk.getBlockType)(e.name)?.allowedBlocks||[];if(!s.length)return{...e,attributes:{...e.attributes,allowedBlocks:n}};let a=n.filter(c=>s.includes(c));return{...e,attributes:{...e.attributes,allowedBlocks:a}}}(0,B4.addFilter)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",TPe);var Nle=l(ut(),1),P2=l(A(),1),ck=l(N(),1),R2=l($(),1),Mle=l(R(),1);var Ja=l(w(),1),IPe=/[\s#]/g;function PPe(e){return"type"in(e.attributes?.anchor??{})||(0,R2.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string"}}),e}function RPe({anchor:e,setAttributes:t}){if(ao()!=="default")return null;let r=Mle.Platform.OS==="web";return(0,Ja.jsx)(fe,{group:"advanced",children:(0,Ja.jsx)(P2.TextControl,{__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,ck.__)("HTML anchor"),help:(0,Ja.jsxs)(Ja.Fragment,{children:[(0,ck.__)("Enter a word or two\u2014without spaces\u2014to make a unique web address just for this block, called an \u201Canchor\u201D. Then, you\u2019ll be able to link directly to this section of your page."),r&&(0,Ja.jsxs)(Ja.Fragment,{children:[" ",(0,Ja.jsx)(P2.ExternalLink,{href:(0,ck.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,ck.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:r?null:(0,ck.__)("Add an anchor"),onChange:n=>{n=n.replace(IPe,"-"),t({anchor:n!==""?n:void 0})},autoCapitalize:"none",autoComplete:"off"})})}var E4={addSaveProps:OPe,edit:RPe,attributeKeys:["anchor"],hasSupport(e){return(0,R2.hasBlockSupport)(e,"anchor")}};function OPe(e,t,o){return(0,R2.hasBlockSupport)(t,"anchor")&&(e.id=o.anchor===""?null:o.anchor),e}(0,Nle.addFilter)("blocks.registerBlockType","core/anchor/attribute",PPe);var Dle=l(ut(),1),O2=l($(),1);function APe(e){return e?.attributes?.ariaLabel?.type||(0,O2.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e}function LPe(e,t,o){return(0,O2.hasBlockSupport)(t,"ariaLabel")&&!Ue(t,"ariaLabel","ariaLabel")&&(e["aria-label"]=o.ariaLabel===""?null:o.ariaLabel),e}var Vle={addSaveProps:LPe,attributeKeys:["ariaLabel"],hasSupport(e){return(0,O2.hasBlockSupport)(e,"ariaLabel")}};(0,Dle.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",APe);var Ek=l($(),1),AR=l(A(),1),Kde=l(F(),1);var zle=l(jr(),1),Fle={};function T4(e,t){let o=zle.useRef(Fle);return o.current===Fle&&(o.current=e(t)),o}function I4(e,...t){let o=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>o.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${o} for the full message.`}var A2=l(jr(),1);function P4(e,t,o,r){let n=T4(Ule).current;return NPe(n,e,t,o,r)&&Hle(n,[e,t,o,r]),n.callback}function jle(e){let t=T4(Ule).current;return MPe(t,e)&&Hle(t,e),t.callback}function Ule(){return{callback:null,cleanup:null,refs:[]}}function NPe(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function MPe(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function Hle(e,t){if(e.refs=t,t.every(o=>o==null)){e.callback=null;return}e.callback=o=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),o!=null){let r=Array(t.length).fill(null);for(let n=0;n{for(let n=0;n=e}function R4(e){if(!$le.isValidElement(e))return null;let t=e,o=t.props;return(Wle(19)?o?.ref:t.ref)??null}function T_(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Kle(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let i=t[r](n);i!=null&&Object.assign(o,i);continue}n===!0?o[`data-${r.toLowerCase()}`]="":n&&(o[`data-${r.toLowerCase()}`]=n.toString())}return o}function Yle(e,t){return typeof e=="function"?e(t):e}function qle(e,t){return typeof e=="function"?e(t):e}var P_={};function uk(e,t,o,r,n){let i={...O4(e,P_)};return t&&(i=I_(i,t)),o&&(i=I_(i,o)),r&&(i=I_(i,r)),n&&(i=I_(i,n)),i}function Zle(e){if(e.length===0)return P_;if(e.length===1)return O4(e[0],P_);let t={...O4(e[0],P_)};for(let o=1;o=65&&n<=90&&(typeof t=="function"||typeof t>"u")}function Xle(e){return typeof e=="function"}function O4(e,t){return Xle(e)?e(t):e??P_}function zPe(e,t){return t?e?o=>{if(UPe(o)){let n=o;jPe(n);let i=t(n);return n.baseUIHandlerPrevented||e?.(n),i}let r=t(o);return e?.(o),r}:t:e}function jPe(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function A4(e,t){return t?e?t+" "+e:t:e}function UPe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}var HPe=Object.freeze([]),Hd=Object.freeze({});var L4=l(jr(),1);function Qle(e,t,o={}){let r=t.render,n=GPe(t,o);if(o.enabled===!1)return null;let i=o.state??Hd;return WPe(e,r,n,i)}function GPe(e,t={}){let{className:o,style:r,render:n}=e,{state:i=Hd,ref:s,props:a,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Yle(o,i):void 0,f=u?qle(r,i):void 0,m=u?Kle(i,c):Hd,h=u?T_(m,Array.isArray(a)?Zle(a):a)??Hd:Hd;return typeof document<"u"&&(u?Array.isArray(s)?h.ref=jle([h.ref,R4(n),...s]):h.ref=P4(h.ref,R4(n),s):P4(null,null)),u?(d!==void 0&&(h.className=A4(h.className,d)),f!==void 0&&(h.style=T_(h.style,f)),h):Hd}function WPe(e,t,o,r){if(t){if(typeof t=="function")return t(o,r);let n=uk(o,t.props);return n.ref=o.ref,A2.cloneElement(t,n)}if(e&&typeof e=="string")return $Pe(e,o);throw new Error(I4(8))}function $Pe(e,t){return e==="button"?(0,L4.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,L4.createElement)("img",{alt:"",...t,key:t.key}):A2.createElement(e,t)}function L2(e){return Qle(e.defaultTagName??"div",e,e)}var ece=l(R(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='244b5c59c0']")){let e=document.createElement("style");e.setAttribute("data-wp-hash","244b5c59c0"),e.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-sm,12px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-xs,16px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wpds-dimension-padding-sm,8px)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error,#f6e6e3);color:var(--wpds-color-fg-content-error,#470000)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning,#fde6bd);color:var(--wpds-color-fg-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution,#fee994);color:var(--wpds-color-fg-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success,#c5f7cc);color:var(--wpds-color-fg-content-success,#002900)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info,#deebfa);color:var(--wpds-color-fg-content-info,#001b4f)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral,#f8f8f8);color:var(--wpds-color-fg-content-neutral-weak,#6d6d6d)}}')),document.head.appendChild(e)}var Jle={badge:"_96e6251aad1a6136__badge","is-high-intent":"_99f7158cb520f750__is-high-intent","is-medium-intent":"c20ebef2365bc8b7__is-medium-intent","is-low-intent":"_365e1626c6202e52__is-low-intent","is-stable-intent":"_33f8198127ddf4ef__is-stable-intent","is-informational-intent":"_04c1aca8fc449412__is-informational-intent","is-draft-intent":"_90726e69d495ec19__is-draft-intent","is-none-intent":"_898f4a544993bd39__is-none-intent"},N4=(0,ece.forwardRef)(function({children:t,intent:o="none",render:r,className:n,...i},s){return L2({render:r,defaultTagName:"span",ref:s,props:uk(i,{className:V(Jle.badge,Jle[`is-${o}-intent`],n),children:t})})});var tce=l(R(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='71d20935c2']")){let e=document.createElement("style");e.setAttribute("data-wp-hash","71d20935c2"),e.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}")),document.head.appendChild(e)}var KPe={stack:"_19ce0419607e1896__stack"},YPe={xs:"var(--wpds-dimension-gap-xs, 4px)",sm:"var(--wpds-dimension-gap-sm, 8px)",md:"var(--wpds-dimension-gap-md, 12px)",lg:"var(--wpds-dimension-gap-lg, 16px)",xl:"var(--wpds-dimension-gap-xl, 24px)","2xl":"var(--wpds-dimension-gap-2xl, 32px)","3xl":"var(--wpds-dimension-gap-3xl, 40px)"},De=(0,tce.forwardRef)(function({direction:t,gap:o,align:r,justify:n,wrap:i,render:s,...a},c){let u={gap:o&&YPe[o],alignItems:r,justifyContent:n,flexDirection:t,flexWrap:i};return L2({render:s,ref:c,props:uk(a,{style:u,className:KPe.stack})})});var M4=l(N(),1);var Ut="isAny",Ht="isNone",Tr="isAll",Ir="isNotAll",tn="between",on="inThePast",Rn="over",Jt="is",eo="isNot",Gd="lessThan",Wd="greaterThan",$d="lessThanOrEqual",Kd="greaterThanOrEqual",Yd="before",qd="after",Zd="beforeInc",Xd="afterInc",el="contains",tl="notContains",ol="startsWith",Qd="on",Jd="notOn";var Ght={asc:(0,M4.__)("Sort ascending"),desc:(0,M4.__)("Sort descending")};var oce=l(BO(),1),{lock:$ht,unlock:St}=(0,oce.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/dataviews");var R_=l(R(),1),qPe=[];function On({elements:e,getElements:t}){let o=Array.isArray(e)&&e.length>0?e:qPe,[r,n]=(0,R_.useState)(o),[i,s]=(0,R_.useState)(!1);return(0,R_.useEffect)(()=>{if(!t){n(o);return}let a=!1;return s(!0),t().then(c=>{if(!a){let u=Array.isArray(c)&&c.length>0?c:o;n(u)}}).catch(()=>{a||n(o)}).finally(()=>{a||s(!1)}),()=>{a=!0}},[t,o]),{elements:r,isLoading:i}}var ZPe=Math.pow(10,8)*24*60*60*1e3,qht=-ZPe,N2=6048e5,rce=864e5;var XPe=3600;var nce=XPe*24,Zht=nce*7,QPe=nce*365.2425,JPe=QPe/12,Xht=JPe*3,D4=Symbol.for("constructDateFrom");function $o(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&D4 in e?e[D4](t):e instanceof Date?new e.constructor(t):new Date(t)}function lt(e,t){return $o(t||e,e)}function M2(e,t,o){let r=lt(e,o?.in);return isNaN(t)?$o(o?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function D2(e,t,o){let r=lt(e,o?.in);if(isNaN(t))return $o(o?.in||e,NaN);if(!t)return r;let n=r.getDate(),i=$o(o?.in||e,r.getTime());i.setMonth(r.getMonth()+t+1,0);let s=i.getDate();return n>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),n),r)}var e2e={};function ef(){return e2e}function Tc(e,t){let o=ef(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,n=lt(e,t?.in),i=n.getDay(),s=(i=i.getTime()?r+1:o.getTime()>=a.getTime()?r:r-1}function V4(e){let t=lt(e),o=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return o.setUTCFullYear(t.getFullYear()),+e-+o}function ice(e,...t){let o=$o.bind(null,e||t.find(r=>typeof r=="object"));return t.map(o)}function F4(e,t){let o=lt(e,t?.in);return o.setHours(0,0,0,0),o}function sce(e,t,o){let[r,n]=ice(o?.in,e,t),i=F4(r),s=F4(n),a=+i-V4(i),c=+s-V4(s);return Math.round((a-c)/rce)}function ace(e,t){let o=V2(e,t),r=$o(t?.in||e,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),pp(r)}function lce(e,t,o){return M2(e,t*7,o)}function cce(e,t,o){return D2(e,t*12,o)}function uce(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function dk(e){return!(!uce(e)&&typeof e!="number"||isNaN(+lt(e)))}function dce(e,t){let o=lt(e,t?.in);return o.setDate(1),o.setHours(0,0,0,0),o}function F2(e,t){let o=lt(e,t?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}var t2e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},fce=(e,t,o)=>{let r,n=t2e[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",t.toString()),o?.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function z2(e){return(t={})=>{let o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}var o2e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},r2e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},n2e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mce={date:z2({formats:o2e,defaultWidth:"full"}),time:z2({formats:r2e,defaultWidth:"full"}),dateTime:z2({formats:n2e,defaultWidth:"full"})};var i2e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pce=(e,t,o,r)=>i2e[e];function fk(e){return(t,o)=>{let r=o?.context?String(o.context):"standalone",n;if(r==="formatting"&&e.formattingValues){let s=e.defaultFormattingWidth||e.defaultWidth,a=o?.width?String(o.width):s;n=e.formattingValues[a]||e.formattingValues[s]}else{let s=e.defaultWidth,a=o?.width?String(o.width):e.defaultWidth;n=e.values[a]||e.values[s]}let i=e.argumentCallback?e.argumentCallback(t):t;return n[i]}}var s2e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a2e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},l2e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},c2e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u2e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},d2e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},f2e=(e,t)=>{let o=Number(e),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},hce={ordinalNumber:f2e,era:fk({values:s2e,defaultWidth:"wide"}),quarter:fk({values:a2e,defaultWidth:"wide",argumentCallback:e=>e-1}),month:fk({values:l2e,defaultWidth:"wide"}),day:fk({values:c2e,defaultWidth:"wide"}),dayPeriod:fk({values:u2e,defaultWidth:"wide",formattingValues:d2e,defaultFormattingWidth:"wide"})};function mk(e){return(t,o={})=>{let r=o.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;let s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?p2e(a,f=>f.test(s)):m2e(a,f=>f.test(s)),u;u=e.valueCallback?e.valueCallback(c):c,u=o.valueCallback?o.valueCallback(u):u;let d=t.slice(s.length);return{value:u,rest:d}}}function m2e(e,t){for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function p2e(e,t){for(let o=0;o{let r=t.match(e.matchPattern);if(!r)return null;let n=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=o.valueCallback?o.valueCallback(s):s;let a=t.slice(n.length);return{value:s,rest:a}}}var h2e=/^(\d+)(th|st|nd|rd)?/i,g2e=/\d+/i,b2e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},k2e={any:[/^b/i,/^(a|c)/i]},v2e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},y2e={any:[/1/i,/2/i,/3/i,/4/i]},S2e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_2e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},x2e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},w2e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},C2e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},B2e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},bce={ordinalNumber:gce({matchPattern:h2e,parsePattern:g2e,valueCallback:e=>parseInt(e,10)}),era:mk({matchPatterns:b2e,defaultMatchWidth:"wide",parsePatterns:k2e,defaultParseWidth:"any"}),quarter:mk({matchPatterns:v2e,defaultMatchWidth:"wide",parsePatterns:y2e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:mk({matchPatterns:S2e,defaultMatchWidth:"wide",parsePatterns:_2e,defaultParseWidth:"any"}),day:mk({matchPatterns:x2e,defaultMatchWidth:"wide",parsePatterns:w2e,defaultParseWidth:"any"}),dayPeriod:mk({matchPatterns:C2e,defaultMatchWidth:"any",parsePatterns:B2e,defaultParseWidth:"any"})};var z4={code:"en-US",formatDistance:fce,formatLong:mce,formatRelative:pce,localize:hce,match:bce,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kce(e,t){let o=lt(e,t?.in);return sce(o,F2(o))+1}function vce(e,t){let o=lt(e,t?.in),r=+pp(o)-+ace(o);return Math.round(r/N2)+1}function j2(e,t){let o=lt(e,t?.in),r=o.getFullYear(),n=ef(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=$o(t?.in||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);let a=Tc(s,t),c=$o(t?.in||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);let u=Tc(c,t);return+o>=+a?r+1:+o>=+u?r:r-1}function yce(e,t){let o=ef(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,n=j2(e,t),i=$o(t?.in||e,0);return i.setFullYear(n,0,r),i.setHours(0,0,0,0),Tc(i,t)}function Sce(e,t){let o=lt(e,t?.in),r=+Tc(o,t)-+yce(o,t);return Math.round(r/N2)+1}function $e(e,t){let o=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return o+r}var Ic={y(e,t){let o=e.getFullYear(),r=o>0?o:1-o;return $e(t==="yy"?r%100:r,t.length)},M(e,t){let o=e.getMonth();return t==="M"?String(o+1):$e(o+1,2)},d(e,t){return $e(e.getDate(),t.length)},a(e,t){let o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];default:return o==="am"?"a.m.":"p.m."}},h(e,t){return $e(e.getHours()%12||12,t.length)},H(e,t){return $e(e.getHours(),t.length)},m(e,t){return $e(e.getMinutes(),t.length)},s(e,t){return $e(e.getSeconds(),t.length)},S(e,t){let o=t.length,r=e.getMilliseconds(),n=Math.trunc(r*Math.pow(10,o-3));return $e(n,t.length)}};var pk={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},j4={G:function(e,t,o){let r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});default:return o.era(r,{width:"wide"})}},y:function(e,t,o){if(t==="yo"){let r=e.getFullYear(),n=r>0?r:1-r;return o.ordinalNumber(n,{unit:"year"})}return Ic.y(e,t)},Y:function(e,t,o,r){let n=j2(e,r),i=n>0?n:1-n;if(t==="YY"){let s=i%100;return $e(s,2)}return t==="Yo"?o.ordinalNumber(i,{unit:"year"}):$e(i,t.length)},R:function(e,t){let o=V2(e);return $e(o,t.length)},u:function(e,t){let o=e.getFullYear();return $e(o,t.length)},Q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return $e(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return $e(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,o){let r=e.getMonth();switch(t){case"M":case"MM":return Ic.M(e,t);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,o){let r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return $e(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,o,r){let n=Sce(e,r);return t==="wo"?o.ordinalNumber(n,{unit:"week"}):$e(n,t.length)},I:function(e,t,o){let r=vce(e);return t==="Io"?o.ordinalNumber(r,{unit:"week"}):$e(r,t.length)},d:function(e,t,o){return t==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):Ic.d(e,t)},D:function(e,t,o){let r=kce(e);return t==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):$e(r,t.length)},E:function(e,t,o){let r=e.getDay();switch(t){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return $e(i,2);case"eo":return o.ordinalNumber(i,{unit:"day"});case"eee":return o.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"});default:return o.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return $e(i,t.length);case"co":return o.ordinalNumber(i,{unit:"day"});case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"});default:return o.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,o){let r=e.getDay(),n=r===0?7:r;switch(t){case"i":return String(n);case"ii":return $e(n,t.length);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,o){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,o){let r=e.getHours(),n;switch(r===12?n=pk.noon:r===0?n=pk.midnight:n=r/12>=1?"pm":"am",t){case"b":case"bb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,o){let r=e.getHours(),n;switch(r>=17?n=pk.evening:r>=12?n=pk.afternoon:r>=4?n=pk.morning:n=pk.night,t){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,o){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return Ic.h(e,t)},H:function(e,t,o){return t==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):Ic.H(e,t)},K:function(e,t,o){let r=e.getHours()%12;return t==="Ko"?o.ordinalNumber(r,{unit:"hour"}):$e(r,t.length)},k:function(e,t,o){let r=e.getHours();return r===0&&(r=24),t==="ko"?o.ordinalNumber(r,{unit:"hour"}):$e(r,t.length)},m:function(e,t,o){return t==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ic.m(e,t)},s:function(e,t,o){return t==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):Ic.s(e,t)},S:function(e,t){return Ic.S(e,t)},X:function(e,t,o){let r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return xce(r);case"XXXX":case"XX":return hp(r);default:return hp(r,":")}},x:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"x":return xce(r);case"xxxx":case"xx":return hp(r);default:return hp(r,":")}},O:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_ce(r,":");default:return"GMT"+hp(r,":")}},z:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_ce(r,":");default:return"GMT"+hp(r,":")}},t:function(e,t,o){let r=Math.trunc(+e/1e3);return $e(r,t.length)},T:function(e,t,o){return $e(+e,t.length)}};function _ce(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=Math.trunc(r/60),i=r%60;return i===0?o+String(n):o+String(n)+t+$e(i,2)}function xce(e,t){return e%60===0?(e>0?"-":"+")+$e(Math.abs(e)/60,2):hp(e,t)}function hp(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=$e(Math.trunc(r/60),2),i=$e(r%60,2);return o+n+t+i}var wce=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Cce=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},E2e=(e,t)=>{let o=e.match(/(P+)(p+)?/)||[],r=o[1],n=o[2];if(!n)return wce(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",wce(r,t)).replace("{{time}}",Cce(n,t))},Bce={p:Cce,P:E2e};var T2e=/^D+$/,I2e=/^Y+$/,P2e=["D","DD","YY","YYYY"];function Ece(e){return T2e.test(e)}function Tce(e){return I2e.test(e)}function Ice(e,t,o){let r=R2e(e,t,o);if(console.warn(r),P2e.includes(e))throw new RangeError(r)}function R2e(e,t,o){let r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var O2e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A2e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,L2e=/^'([^]*?)'?$/,N2e=/''/g,M2e=/[a-zA-Z]/;function U4(e,t,o){let r=ef(),n=o?.locale??r.locale??z4,i=o?.firstWeekContainsDate??o?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=o?.weekStartsOn??o?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=lt(e,o?.in);if(!dk(a))throw new RangeError("Invalid time value");let c=t.match(A2e).map(d=>{let f=d[0];if(f==="p"||f==="P"){let m=Bce[f];return m(d,n.formatLong)}return d}).join("").match(O2e).map(d=>{if(d==="''")return{isToken:!1,value:"'"};let f=d[0];if(f==="'")return{isToken:!1,value:D2e(d)};if(j4[f])return{isToken:!0,value:d};if(f.match(M2e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:d}});n.localize.preprocessor&&(c=n.localize.preprocessor(a,c));let u={firstWeekContainsDate:i,weekStartsOn:s,locale:n};return c.map(d=>{if(!d.isToken)return d.value;let f=d.value;(!o?.useAdditionalWeekYearTokens&&Tce(f)||!o?.useAdditionalDayOfYearTokens&&Ece(f))&&Ice(f,t,String(e));let m=j4[f[0]];return m(a,f,n.localize,u)}).join("")}function D2e(e){let t=e.match(L2e);return t?t[1].replace(N2e,"'"):e}function gp(e,t,o){return M2(e,-t,o)}function U2(e,t,o){return D2(e,-t,o)}function Pce(e,t,o){return lce(e,-t,o)}function H2(e,t,o){return cce(e,-t,o)}var de=l(N(),1),lo=l(R(),1),rn=l(hc(),1);var H4=l(w(),1),wo={Name:(0,H4.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,H4.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};function Rce(e,t){switch(t){case"days":return gp(new Date,e);case"weeks":return Pce(new Date,e);case"months":return U2(new Date,e);case"years":return H2(new Date,e);default:return new Date}}var Oce={label:(0,de.__)("Is none of"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is none of: %2$s"),e.name,t.map(o=>o.label).join(", ")),wo),filter:((e,t,o)=>{if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?!o.some(n=>r.includes(n)):typeof r=="string"?!o.includes(r):!1}),selection:"multi"},Ace=[{name:Ut,label:(0,de.__)("Includes"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s includes: %2$s"),e.name,t.map(o=>o.label).join(", ")),wo),filter(e,t,o){if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?o.some(n=>r.includes(n)):typeof r=="string"?o.includes(r):!1},selection:"multi"},{name:Ht,...Oce},{name:Tr,label:(0,de.__)("Includes all"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s includes all: %2$s"),e.name,t.map(o=>o.label).join(", ")),wo),filter(e,t,o){return o?.length?o.every(r=>t.getValue({item:e})?.includes(r)):!0},selection:"multi"},{name:Ir,...Oce},{name:tn,label:(0,de.__)("Between (inc)"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s between (inc): %2$s and %3$s"),e.name,t[0].label[0],t[0].label[1]),wo),filter(e,t,o){if(!Array.isArray(o)||o.length!==2||o[0]===void 0||o[1]===void 0)return!0;let r=t.getValue({item:e});return typeof r=="number"||r instanceof Date||typeof r=="string"?r>=o[0]&&r<=o[1]:!1},selection:"custom"},{name:on,label:(0,de.__)("In the past"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is in the past: %2$s"),e.name,`${t[0].value.value} ${t[0].value.unit}`),wo),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=Rce(o.value,o.unit),n=(0,rn.getDate)(t.getValue({item:e}));return n>=r&&n<=new Date},selection:"custom"},{name:Rn,label:(0,de.__)("Over"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is over: %2$s"),e.name,`${t[0].value.value} ${t[0].value.unit}`),wo),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=Rce(o.value,o.unit);return(0,rn.getDate)(t.getValue({item:e}))(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===t.getValue({item:e})||o===void 0},selection:"single"},{name:eo,label:(0,de.__)("Is not"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is not: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o!==t.getValue({item:e})},selection:"single"},{name:Gd,label:(0,de.__)("Less than"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is less than: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is greater than: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>o},selection:"single"},{name:$d,label:(0,de.__)("Less than or equal"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is less than or equal to: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})<=o},selection:"single"},{name:Kd,label:(0,de.__)("Greater than or equal"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is greater than or equal to: %2$s"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>=o},selection:"single"},{name:Yd,label:(0,de.__)("Before"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is before: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is after: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))>r},selection:"single"},{name:Zd,label:(0,de.__)("Before (inc)"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is on or before: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))<=r},selection:"single"},{name:Xd,label:(0,de.__)("After (inc)"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is on or after: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))>=r},selection:"single"},{name:el,label:(0,de.__)("Contains"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s contains: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:tl,label:(0,de.__)("Doesn't contain"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s doesn't contain: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&!r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:ol,label:(0,de.__)("Starts with"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s starts with: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().startsWith(String(o).toLowerCase())},selection:"single"},{name:Qd,label:(0,de.__)("On"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o),n=(0,rn.getDate)(t.getValue({item:e}));return r.getTime()===n.getTime()},selection:"single"},{name:Jd,label:(0,de.__)("Not on"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("%1$s is not: %2$s"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o),n=(0,rn.getDate)(t.getValue({item:e}));return r.getTime()!==n.getTime()},selection:"single"}],Lce=e=>Ace.find(t=>t.name===e),Nce=()=>Ace.map(e=>e.name);var Mce=l(A(),1),Dce=l(R(),1);function pt(e,t){let o;return e?.required&&t?.required?o=t?.required?.message?t.required:void 0:e?.pattern&&t?.pattern?o=t.pattern:e?.min&&t?.min?o=t.min:e?.max&&t?.max?o=t.max:e?.minLength&&t?.minLength?o=t.minLength:e?.maxLength&&t?.maxLength?o=t.maxLength:e?.elements&&t?.elements?o=t.elements:t?.custom&&(o=t.custom),o}var Vce=l(w(),1),{ValidatedCheckboxControl:V2e}=St(Mce.privateApis);function Fce({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,label:c,description:u,isValid:d}=e,f=(0,Dce.useCallback)(()=>{t(a({item:o,value:!s({item:o})}))},[o,s,t,a]);return(0,Vce.jsx)(V2e,{required:!!e.isValid?.required,markWhenOptional:n,customValidity:pt(d,i),hidden:r,label:c,help:u,checked:s({item:o}),onChange:f})}var G2=l(A(),1),zce=l(R(),1);var G4=l(w(),1),{ValidatedComboboxControl:F2e}=St(G2.privateApis);function W2({data:e,field:t,onChange:o,hideLabelFromVision:r,validity:n}){let{label:i,description:s,placeholder:a,getValue:c,setValue:u,isValid:d}=t,f=c({item:e})??"",m=(0,zce.useCallback)(g=>o(u({item:e,value:g??""})),[e,o,u]),{elements:h,isLoading:p}=On({elements:t.elements,getElements:t.getElements});return p?(0,G4.jsx)(G2.Spinner,{}):(0,G4.jsx)(F2e,{required:!!t.isValid?.required,customValidity:pt(d,n),label:i,value:f,help:s,placeholder:a,options:h,onChange:m,hideLabelFromVision:r,allowReset:!0,expandOnFocus:!0})}var q2=l(A(),1),cs=l(R(),1),Y2=l(N(),1),hi=l(hc(),1);var gk=l(A(),1),W4=l(R(),1),rl=l(N(),1);var hk=l(w(),1),z2e={[on]:[{value:"days",label:(0,rl.__)("Days")},{value:"weeks",label:(0,rl.__)("Weeks")},{value:"months",label:(0,rl.__)("Months")},{value:"years",label:(0,rl.__)("Years")}],[Rn]:[{value:"days",label:(0,rl.__)("Days ago")},{value:"weeks",label:(0,rl.__)("Weeks ago")},{value:"months",label:(0,rl.__)("Months ago")},{value:"years",label:(0,rl.__)("Years ago")}]};function $2({className:e,data:t,field:o,onChange:r,hideLabelFromVision:n,operator:i}){let s=z2e[i===on?"inThePast":"over"],{id:a,label:c,getValue:u,setValue:d}=o,f=u({item:t}),{value:m="",unit:h=s[0].value}=f&&typeof f=="object"?f:{},p=(0,W4.useCallback)(b=>r(d({item:t,value:{value:Number(b),unit:h}})),[r,d,t,h]),g=(0,W4.useCallback)(b=>r(d({item:t,value:{value:m,unit:b}})),[r,d,t,m]);return(0,hk.jsx)(gk.BaseControl,{id:a,className:V(e,"dataviews-controls__relative-date"),label:c,hideLabelFromVision:n,children:(0,hk.jsxs)(De,{direction:"row",gap:"sm",children:[(0,hk.jsx)(gk.__experimentalNumberControl,{__next40pxDefaultSize:!0,className:"dataviews-controls__relative-date-number",spinControls:"none",min:1,step:1,value:m,onChange:p}),(0,hk.jsx)(gk.SelectControl,{className:"dataviews-controls__relative-date-unit",__next40pxDefaultSize:!0,label:(0,rl.__)("Unit"),value:h,options:s,onChange:g,hideLabelFromVision:!0})]})})}var jce=l(hc(),1);function K2(e){if(!e)return null;let t=(0,jce.getDate)(e);return t&&dk(t)?t:null}var tf=l(w(),1),{DateCalendar:j2e,ValidatedInputControl:U2e}=St(q2.privateApis),H2e=e=>e?(0,hi.dateI18n)("Y-m-d\\TH:i",(0,hi.getDate)(e)):"";function G2e({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,description:c,setValue:u,getValue:d,isValid:f}=t,m=d({item:e}),h=typeof m=="string"?m:void 0,[p,g]=(0,cs.useState)(()=>K2(h)||new Date),b=(0,cs.useRef)(null),v=(0,cs.useRef)(void 0),k=(0,cs.useRef)(null),y=(0,cs.useCallback)(E=>o(u({item:e,value:E})),[e,o,u]);(0,cs.useEffect)(()=>()=>{v.current&&clearTimeout(v.current)},[]);let S=(0,cs.useCallback)(E=>{let L;if(E){let T=(0,hi.dateI18n)("Y-m-d",E),O;h?O=(0,hi.dateI18n)("H:i",(0,hi.getDate)(h)):O=(0,hi.dateI18n)("H:i",E),L=(0,hi.getDate)(`${T}T${O}`).toISOString(),y(L),v.current&&clearTimeout(v.current)}else y(void 0);k.current=b.current&&b.current.ownerDocument.activeElement,v.current=setTimeout(()=>{b.current&&(b.current.focus(),b.current.blur(),y(L),k.current&&k.current instanceof HTMLElement&&k.current.focus())},0)},[y,h]),x=(0,cs.useCallback)(E=>{if(E){let L=(0,hi.getDate)(E);y(L.toISOString());let T=K2(L.toISOString());T&&g(T)}else y(void 0)},[y]),{format:C}=t,B=C.weekStartsOn??(0,hi.getSettings)().l10n.startOfWeek,{timezone:{string:I}}=(0,hi.getSettings)(),P=a;return f?.required&&!n&&!r?P=`${a} (${(0,Y2.__)("Required")})`:!f?.required&&n&&!r&&(P=`${a} (${(0,Y2.__)("Optional")})`),(0,tf.jsx)(q2.BaseControl,{id:s,label:P,help:c,hideLabelFromVision:r,children:(0,tf.jsxs)(De,{direction:"column",gap:"lg",children:[(0,tf.jsx)(j2e,{style:{width:"100%"},selected:h&&K2(h)||void 0,onSelect:S,month:p,onMonthChange:g,timeZone:I||void 0,weekStartsOn:B}),(0,tf.jsx)(U2e,{ref:b,__next40pxDefaultSize:!0,required:!!f?.required,customValidity:pt(f,i),type:"datetime-local",label:(0,Y2.__)("Date time"),hideLabelFromVision:!0,value:H2e(h),onChange:x})]})})}function Uce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){return i===on||i===Rn?(0,tf.jsx)($2,{className:"dataviews-controls__datetime",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):(0,tf.jsx)(G2e,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s})}var Rr=l(A(),1),tt=l(R(),1),Ko=l(N(),1),Pr=l(hc(),1);var ht=l(w(),1),{DateCalendar:W2e,DateRangeCalendar:$2e}=St(Rr.privateApis),K2e=[{id:"today",label:(0,Ko.__)("Today"),getValue:()=>(0,Pr.getDate)(null)},{id:"yesterday",label:(0,Ko.__)("Yesterday"),getValue:()=>{let e=(0,Pr.getDate)(null);return gp(e,1)}},{id:"past-week",label:(0,Ko.__)("Past week"),getValue:()=>{let e=(0,Pr.getDate)(null);return gp(e,7)}},{id:"past-month",label:(0,Ko.__)("Past month"),getValue:()=>{let e=(0,Pr.getDate)(null);return U2(e,1)}}],Y2e=[{id:"last-7-days",label:(0,Ko.__)("Last 7 days"),getValue:()=>{let e=(0,Pr.getDate)(null);return[gp(e,7),e]}},{id:"last-30-days",label:(0,Ko.__)("Last 30 days"),getValue:()=>{let e=(0,Pr.getDate)(null);return[gp(e,30),e]}},{id:"month-to-date",label:(0,Ko.__)("Month to date"),getValue:()=>{let e=(0,Pr.getDate)(null);return[dce(e),e]}},{id:"last-year",label:(0,Ko.__)("Last year"),getValue:()=>{let e=(0,Pr.getDate)(null);return[H2(e,1),e]}},{id:"year-to-date",label:(0,Ko.__)("Year to date"),getValue:()=>{let e=(0,Pr.getDate)(null);return[F2(e),e]}}],bk=e=>{if(!e)return null;let t=(0,Pr.getDate)(e);return t&&dk(t)?t:null},$4=e=>e?typeof e=="string"?e:U4(e,"yyyy-MM-dd"):"";function Hce({field:e,validity:t,inputRefs:o,isTouched:r,setIsTouched:n,children:i}){let{isValid:s}=e,[a,c]=(0,tt.useState)(void 0),u=(0,tt.useCallback)(()=>{let f=Array.isArray(o)?o:[o];for(let m of f){let h=m.current;if(h&&!h.validity.valid){c({type:"invalid",message:h.validationMessage});return}}c(void 0)},[o]);return(0,tt.useEffect)(()=>{let f=Array.isArray(o)?o:[o],m=t?pt(s,t):void 0;for(let h of f){let p=h.current;p&&p.setCustomValidity(m?.type==="invalid"&&m.message?m.message:"")}},[o,s,t]),(0,tt.useEffect)(()=>{let f=Array.isArray(o)?o:[o],m=h=>{h.preventDefault(),n(!0)};for(let h of f)h.current?.addEventListener("invalid",m);return()=>{for(let h of f)h.current?.removeEventListener("invalid",m)}},[o,n]),(0,tt.useEffect)(()=>{if(!r)return;let f=t?pt(s,t):void 0;f?c(f):u()},[r,s,t,u]),(0,ht.jsxs)("div",{onBlur:f=>{r||(!f.relatedTarget||!f.currentTarget.contains(f.relatedTarget))&&n(!0)},children:[i,(0,ht.jsx)("div",{"aria-live":"polite",children:a&&(0,ht.jsxs)("p",{className:V("components-validated-control__indicator",a.type==="invalid"?"is-invalid":void 0),children:[(0,ht.jsx)(Rr.Icon,{className:"components-validated-control__indicator-icon",icon:Rf,size:16,fill:"currentColor"}),a.message]})})]})}function q2e({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,setValue:c,getValue:u,isValid:d,format:f}=t,[m,h]=(0,tt.useState)(null),p=f.weekStartsOn??(0,Pr.getSettings)().l10n.startOfWeek,g=u({item:e}),b=typeof g=="string"?g:void 0,[v,k]=(0,tt.useState)(()=>bk(b)||new Date),[y,S]=(0,tt.useState)(!1),x=(0,tt.useRef)(null),C=(0,tt.useCallback)(T=>o(c({item:e,value:T})),[e,o,c]),B=(0,tt.useCallback)(T=>{let O=T?U4(T,"yyyy-MM-dd"):void 0;C(O),h(null),S(!0)},[C]),I=(0,tt.useCallback)(T=>{let O=T.getValue(),D=$4(O);k(O),C(D),h(T.id),S(!0)},[C]),P=(0,tt.useCallback)(T=>{if(C(T),T){let O=bk(T);O&&k(O)}h(null),S(!0)},[C]),{timezone:{string:E}}=(0,Pr.getSettings)(),L=a;return d?.required&&!n?L=`${a} (${(0,Ko.__)("Required")})`:!d?.required&&n&&(L=`${a} (${(0,Ko.__)("Optional")})`),(0,ht.jsx)(Hce,{field:t,validity:i,inputRefs:x,isTouched:y,setIsTouched:S,children:(0,ht.jsx)(Rr.BaseControl,{id:s,className:"dataviews-controls__date",label:L,hideLabelFromVision:r,children:(0,ht.jsxs)(De,{direction:"column",gap:"lg",children:[(0,ht.jsxs)(De,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[K2e.map(T=>{let O=m===T.id;return(0,ht.jsx)(Rr.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:O,size:"small",onClick:()=>I(T),children:T.label},T.id)}),(0,ht.jsx)(Rr.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!m,size:"small",disabled:!!m,accessibleWhenDisabled:!1,children:(0,Ko.__)("Custom")})]}),(0,ht.jsx)(Rr.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:x,type:"date",label:(0,Ko.__)("Date"),hideLabelFromVision:!0,value:b,onChange:P,required:!!t.isValid?.required}),(0,ht.jsx)(W2e,{style:{width:"100%"},selected:b&&bk(b)||void 0,onSelect:B,month:v,onMonthChange:k,timeZone:E||void 0,weekStartsOn:p})]})})})}function Z2e({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,getValue:c,setValue:u,format:d}=t,f,m=c({item:e});Array.isArray(m)&&m.length===2&&m.every(D=>typeof D=="string")&&(f=m);let h=d.weekStartsOn??(0,Pr.getSettings)().l10n.startOfWeek,p=(0,tt.useCallback)(D=>{o(u({item:e,value:D}))},[e,o,u]),[g,b]=(0,tt.useState)(null),v=(0,tt.useMemo)(()=>{if(!f)return{from:void 0,to:void 0};let[D,U]=f;return{from:bk(D)||void 0,to:bk(U)||void 0}},[f]),[k,y]=(0,tt.useState)(()=>v.from||new Date),[S,x]=(0,tt.useState)(!1),C=(0,tt.useRef)(null),B=(0,tt.useRef)(null),I=(0,tt.useCallback)((D,U)=>{D&&U?p([$4(D),$4(U)]):!D&&!U&&p(void 0)},[p]),P=(0,tt.useCallback)(D=>{I(D?.from,D?.to),b(null),x(!0)},[I]),E=(0,tt.useCallback)(D=>{let[U,G]=D.getValue();y(U),I(U,G),b(D.id),x(!0)},[I]),L=(0,tt.useCallback)((D,U)=>{let[G,j]=f||[void 0,void 0];if(I(D==="from"?U:G,D==="to"?U:j),U){let ee=bk(U);ee&&y(ee)}b(null),x(!0)},[f,I]),{timezone:T}=(0,Pr.getSettings)(),O=a;return t.isValid?.required&&!n?O=`${a} (${(0,Ko.__)("Required")})`:!t.isValid?.required&&n&&(O=`${a} (${(0,Ko.__)("Optional")})`),(0,ht.jsx)(Hce,{field:t,validity:i,inputRefs:[C,B],isTouched:S,setIsTouched:x,children:(0,ht.jsx)(Rr.BaseControl,{id:s,className:"dataviews-controls__date",label:O,hideLabelFromVision:r,children:(0,ht.jsxs)(De,{direction:"column",gap:"lg",children:[(0,ht.jsxs)(De,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[Y2e.map(D=>{let U=g===D.id;return(0,ht.jsx)(Rr.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:U,size:"small",onClick:()=>E(D),children:D.label},D.id)}),(0,ht.jsx)(Rr.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!g,size:"small",accessibleWhenDisabled:!1,disabled:!!g,children:(0,Ko.__)("Custom")})]}),(0,ht.jsxs)(De,{direction:"row",gap:"sm",justify:"space-between",className:"dataviews-controls__date-range-inputs",children:[(0,ht.jsx)(Rr.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:C,type:"date",label:(0,Ko.__)("From"),hideLabelFromVision:!0,value:f?.[0],onChange:D=>L("from",D),required:!!t.isValid?.required}),(0,ht.jsx)(Rr.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:B,type:"date",label:(0,Ko.__)("To"),hideLabelFromVision:!0,value:f?.[1],onChange:D=>L("to",D),required:!!t.isValid?.required})]}),(0,ht.jsx)($2e,{style:{width:"100%"},selected:v,onSelect:P,month:k,onMonthChange:y,timeZone:T.string||void 0,weekStartsOn:h})]})})})}function Gce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){return i===on||i===Rn?(0,ht.jsx)($2,{className:"dataviews-controls__date",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):i===tn?(0,ht.jsx)(Z2e,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s}):(0,ht.jsx)(q2e,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s})}var Z2=l(A(),1),Wce=l(R(),1);var K4=l(w(),1),{ValidatedSelectControl:X2e}=St(Z2.privateApis);function X2({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{type:s,label:a,description:c,getValue:u,setValue:d,isValid:f}=t,m=s==="array",h=u({item:e})??(m?[]:""),p=(0,Wce.useCallback)(v=>o(d({item:e,value:v})),[e,o,d]),{elements:g,isLoading:b}=On({elements:t.elements,getElements:t.getElements});return b?(0,K4.jsx)(Z2.Spinner,{}):(0,K4.jsx)(X2e,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(f,i),label:a,value:h,help:c,options:g,onChange:p,__next40pxDefaultSize:!0,hideLabelFromVision:r,multiple:m})}var Y4=l(w(),1),Q2e=10;function $ce(e){let{field:t}=e,{elements:o}=On({elements:t.elements,getElements:t.getElements});return o.length>=Q2e?(0,Y4.jsx)(W2,{...e}):(0,Y4.jsx)(X2,{...e})}var J2=l(A(),1);var Kce=l(A(),1),Yce=l(R(),1);var qce=l(w(),1),{ValidatedInputControl:J2e}=St(Kce.privateApis);function nl({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,type:i,prefix:s,suffix:a,validity:c}){let{label:u,placeholder:d,description:f,getValue:m,setValue:h,isValid:p}=t,g=m({item:e}),b=(0,Yce.useCallback)(v=>o(h({item:e,value:v})),[e,h,o]);return(0,qce.jsx)(J2e,{required:!!p.required,markWhenOptional:n,customValidity:pt(p,c),label:u,placeholder:d,value:g??"",help:f,onChange:b,hideLabelFromVision:r,type:i,prefix:s,suffix:a,pattern:p.pattern?p.pattern.constraint:void 0,minLength:p.minLength?p.minLength.constraint:void 0,maxLength:p.maxLength?p.maxLength.constraint:void 0,__next40pxDefaultSize:!0})}var Q2=l(w(),1);function Zce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,Q2.jsx)(nl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"email",prefix:(0,Q2.jsx)(J2.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Q2.jsx)(J2.Icon,{icon:bA})})})}var tR=l(A(),1);var eR=l(w(),1);function Xce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,eR.jsx)(nl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"tel",prefix:(0,eR.jsx)(tR.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,eR.jsx)(tR.Icon,{icon:uv})})})}var rR=l(A(),1);var oR=l(w(),1);function Qce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,oR.jsx)(nl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"url",prefix:(0,oR.jsx)(rR.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,oR.jsx)(rR.Icon,{icon:fn})})})}var Pc=l(A(),1),O_=l(R(),1),nR=l(N(),1);var of=l(w(),1),{ValidatedNumberControl:eRe}=St(Pc.privateApis);function Jce(e){if(e===""||e===void 0)return"";let t=Number(e);return Number.isFinite(t)?t:""}function tRe({value:e,onChange:t,hideLabelFromVision:o,step:r}){let[n="",i=""]=e,s=(0,O_.useCallback)(c=>t([Jce(c),i]),[t,i]),a=(0,O_.useCallback)(c=>t([n,Jce(c)]),[t,n]);return(0,of.jsx)(Pc.BaseControl,{help:(0,nR.__)("The max. value must be greater than the min. value."),children:(0,of.jsxs)(Pc.Flex,{direction:"row",gap:4,children:[(0,of.jsx)(Pc.__experimentalNumberControl,{label:(0,nR.__)("Min."),value:n,max:i?Number(i)-r:void 0,onChange:s,__next40pxDefaultSize:!0,hideLabelFromVision:o,step:r}),(0,of.jsx)(Pc.__experimentalNumberControl,{label:(0,nR.__)("Max."),value:i,min:n?Number(n)+r:void 0,onChange:a,__next40pxDefaultSize:!0,hideLabelFromVision:o,step:r})]})})}function iR({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){let a=t.format?.decimals??0,c=Math.pow(10,Math.abs(a)*-1),{label:u,description:d,getValue:f,setValue:m,isValid:h}=t,p=f({item:e})??"",g=(0,O_.useCallback)(v=>{o(m({item:e,value:["",void 0].includes(v)?void 0:Number(v)}))},[e,o,m]),b=(0,O_.useCallback)(v=>{o(m({item:e,value:v}))},[e,o,m]);if(i===tn){let v=["",""];return Array.isArray(p)&&p.length===2&&p.every(k=>typeof k=="number"||k==="")&&(v=p),(0,of.jsx)(tRe,{value:v,onChange:b,hideLabelFromVision:r,step:c})}return(0,of.jsx)(eRe,{required:!!h.required,markWhenOptional:n,customValidity:pt(h,s),label:u,help:d,value:p,onChange:g,__next40pxDefaultSize:!0,hideLabelFromVision:r,step:c,min:h.min?h.min.constraint:void 0,max:h.max?h.max.constraint:void 0})}var eue=l(w(),1);function tue(e){return(0,eue.jsx)(iR,{...e})}var oue=l(w(),1);function rue(e){return(0,oue.jsx)(iR,{...e})}var sR=l(A(),1),nue=l(R(),1);var q4=l(w(),1),{ValidatedRadioControl:oRe}=St(sR.privateApis);function iue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:c,setValue:u,isValid:d}=t,{elements:f,isLoading:m}=On({elements:t.elements,getElements:t.getElements}),h=c({item:e}),p=(0,nue.useCallback)(g=>o(u({item:e,value:g})),[e,o,u]);return m?(0,q4.jsx)(sR.Spinner,{}):(0,q4.jsx)(oRe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(d,i),label:s,help:a,onChange:p,options:f,selected:h,hideLabelFromVision:r})}var Z4=l(R(),1);var sue=l(w(),1);function aue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{prefix:a,suffix:c}=i||{};return(0,sue.jsx)(nl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s,prefix:a?(0,Z4.createElement)(a):void 0,suffix:c?(0,Z4.createElement)(c):void 0})}var lue=l(A(),1),cue=l(R(),1);var uue=l(w(),1),{ValidatedToggleControl:rRe}=St(lue.privateApis);function due({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:c,setValue:u,isValid:d}=e,f=(0,cue.useCallback)(()=>{t(u({item:o,value:!c({item:o})}))},[t,u,o,c]);return(0,uue.jsx)(rRe,{required:!!d.required,markWhenOptional:n,customValidity:pt(d,i),hidden:r,label:s,help:a,checked:c({item:o}),onChange:f})}var fue=l(A(),1),mue=l(R(),1);var pue=l(w(),1),{ValidatedTextareaControl:nRe}=St(fue.privateApis);function hue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{rows:a=4}=i||{},{label:c,placeholder:u,description:d,setValue:f,isValid:m}=t,h=t.getValue({item:e}),p=(0,mue.useCallback)(g=>o(f({item:e,value:g})),[e,o,f]);return(0,pue.jsx)(nRe,{required:!!m.required,markWhenOptional:n,customValidity:pt(m,s),label:c,placeholder:u,value:h??"",help:d,onChange:p,rows:a,minLength:m.minLength?m.minLength.constraint:void 0,maxLength:m.maxLength?m.maxLength.constraint:void 0,__next40pxDefaultSize:!0,hideLabelFromVision:r})}var kk=l(A(),1),gue=l(R(),1);var aR=l(w(),1),{ValidatedToggleGroupControl:iRe}=St(kk.privateApis);function bue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,isValid:c}=t,u=s({item:e}),d=(0,gue.useCallback)(p=>o(a({item:e,value:p})),[e,o,a]),{elements:f,isLoading:m}=On({elements:t.elements,getElements:t.getElements});if(m)return(0,aR.jsx)(kk.Spinner,{});if(f.length===0)return null;let h=f.find(p=>p.value===u);return(0,aR.jsx)(iRe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(c,i),__next40pxDefaultSize:!0,isBlock:!0,label:t.label,help:h?.description||t.description,onChange:d,value:u,hideLabelFromVision:r,children:f.map(p=>(0,aR.jsx)(kk.__experimentalToggleGroupControlOption,{label:p.label,value:p.value},p.value))})}var lR=l(A(),1),cR=l(R(),1);var A_=l(w(),1),{ValidatedFormTokenField:sRe}=St(lR.privateApis);function kue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,getValue:c,setValue:u,isValid:d}=t,f=c({item:e}),{elements:m,isLoading:h}=On({elements:t.elements,getElements:t.getElements}),p=(0,cR.useMemo)(()=>Array.isArray(f)?f.map(b=>m?.find(k=>k.value===b)||{value:b,label:b}):[],[f,m]),g=(0,cR.useCallback)(b=>{let v=b.map(k=>typeof k=="object"&&"value"in k?k.value:k);o(u({item:e,value:v}))},[o,u,e]);return h?(0,A_.jsx)(lR.Spinner,{}):(0,A_.jsx)(sRe,{required:!!d?.required,markWhenOptional:n,customValidity:pt(d,i),label:r?void 0:s,value:p,onChange:g,placeholder:a,suggestions:m?.map(b=>b.value),__experimentalValidateInput:b=>t.isValid?.elements&&m?m.some(v=>v.value===b||v.label===b):!0,__experimentalExpandOnFocus:m&&m.length>0,__experimentalShowHowTo:!t.isValid?.elements,displayTransform:b=>typeof b=="object"&&"label"in b?b.label:typeof b=="string"&&m&&m.find(k=>k.value===b)?.label||b,__experimentalRenderItem:({item:b})=>{if(typeof b=="string"&&m){let v=m.find(k=>k.value===b);return(0,A_.jsx)("span",{children:v?.label||b})}return(0,A_.jsx)("span",{children:b})}})}var An=l(A(),1),X4=l(R(),1),vue=l(N(),1);var Rc=l(w(),1),{ValidatedInputControl:aRe}=St(An.privateApis),lRe=({color:e,onColorChange:t})=>{let o=e&&Bt(e).isValid()?e:"#ffffff";return(0,Rc.jsx)(An.Dropdown,{className:"dataviews-controls__color-picker-dropdown",popoverProps:{resize:!1},renderToggle:({onToggle:r})=>(0,Rc.jsx)(An.Button,{onClick:r,"aria-label":(0,vue.__)("Open color picker"),size:"small",icon:()=>(0,Rc.jsx)(An.ColorIndicator,{colorValue:o})}),renderContent:()=>(0,Rc.jsx)(An.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Rc.jsx)(An.ColorPicker,{color:o,onChange:t,enableAlpha:!0})})})};function yue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,description:c,setValue:u,isValid:d}=t,f=t.getValue({item:e})||"",m=(0,X4.useCallback)(p=>{o(u({item:e,value:p}))},[e,o,u]),h=(0,X4.useCallback)(p=>{o(u({item:e,value:p||""}))},[e,o,u]);return(0,Rc.jsx)(aRe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(d,i),label:s,placeholder:a,value:f,help:c,onChange:h,hideLabelFromVision:r,type:"text",prefix:(0,Rc.jsx)(An.__experimentalInputControlPrefixWrapper,{variant:"control",children:(0,Rc.jsx)(lRe,{color:f,onColorChange:m})})})}var dR=l(A(),1),fR=l(R(),1),Q4=l(N(),1);var uR=l(w(),1);function Sue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let[s,a]=(0,fR.useState)(!1),c=(0,fR.useCallback)(()=>{a(u=>!u)},[]);return(0,uR.jsx)(nl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:s?"text":"password",suffix:(0,uR.jsx)(dR.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,uR.jsx)(dR.Button,{icon:s?vs:Lf,onClick:c,size:"small",label:s?(0,Q4.__)("Hide password"):(0,Q4.__)("Show password")})})})}function mR(e){return Array.isArray(e.elements)&&e.elements.length>0||typeof e.getElements=="function"}var xue=l(w(),1),_ue={adaptiveSelect:$ce,array:kue,checkbox:Fce,color:yue,combobox:W2,datetime:Uce,date:Gce,email:Zce,telephone:Xce,url:Qce,integer:tue,number:rue,password:Sue,radio:iue,select:X2,text:aue,toggle:due,textarea:hue,toggleGroup:bue};function cRe(e){return e&&typeof e=="object"&&typeof e.control=="string"}function uRe(e){let{control:t,...o}=e,r=pR(t);return r===null?null:function(i){return(0,xue.jsx)(r,{...i,config:o})}}function wue(e,t){return typeof e.Edit=="function"?e.Edit:typeof e.Edit=="string"?pR(e.Edit):cRe(e.Edit)?uRe(e.Edit):mR(e)&&e.type!=="array"?pR("adaptiveSelect"):t===null?null:pR(t)}function pR(e){return Object.keys(_ue).includes(e)?_ue[e]:null}function dRe(e,t,o){if(e.filterBy===!1)return!1;let r=e.filterBy?.operators?.filter(n=>o.includes(n))??t;return r.length===0?!1:{isPrimary:!!e.filterBy?.isPrimary,operators:r}}var Cue=dRe;var fRe=e=>({item:t})=>{let o=e.split("."),r=t;for(let n of o)r.hasOwnProperty(n)?r=r[n]:r=void 0;return r},Bue=fRe;var mRe=e=>({value:t})=>{let o=e.split("."),r={},n=r;for(let i of o.slice(0,-1))n[i]={},n=n[i];return n[o.at(-1)]=t,r},Eue=mRe;var Iue=l(N(),1);function hR({item:e,field:t}){let{elements:o,isLoading:r}=On({elements:t.elements,getElements:t.getElements}),n=t.getValue({item:e});return r||o.length===0?n:o?.find(i=>i.value===n)?.label||t.getValue({item:e})}var Tue=l(w(),1);function co({item:e,field:t}){return t.hasElements?(0,Tue.jsx)(hR,{item:e,field:t}):t.getValueFormatted({item:e,field:t})}var il=(e,t,o)=>o==="asc"?e.localeCompare(t):t.localeCompare(e);function uo(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)}function sl(e,t){if(typeof t.isValid.minLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length>=t.isValid.minLength.constraint}function al(e,t){if(typeof t.isValid.maxLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length<=t.isValid.maxLength.constraint}function ll(e,t){if(t.isValid.pattern?.constraint===void 0)return!0;try{let o=new RegExp(t.isValid.pattern.constraint),r=t.getValue({item:e});return[void 0,"",null].includes(r)?!0:o.test(String(r))}catch{return!1}}function _t(e,t){let r=(t.elements??[]).map(i=>i.value);if(r.length===0)return!0;let n=t.getValue({item:e});return[].concat(n).every(i=>r.includes(i))}function pRe({item:e,field:t}){return t.getValue({item:e})}var nn=pRe;var hRe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function gRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!hRe.test(o)?(0,Iue.__)("Value must be a valid email address."):null}var Pue={type:"email",render:co,Edit:"email",sort:il,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,el,tl,ol,Ut,Ht,Tr,Ir],format:{},getValueFormatted:nn,validate:{required:uo,pattern:ll,minLength:sl,maxLength:al,elements:_t,custom:gRe}};var Rue=l(N(),1);var vk=(e,t,o)=>o==="asc"?e-t:t-e;function gR(e,t){if(typeof t.isValid.min?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)>=t.isValid.min.constraint}function bR(e,t){if(typeof t.isValid.max?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)<=t.isValid.max.constraint}var Oue={separatorThousand:","};function bRe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="integer"?r=Oue:r=t.format;let{separatorThousand:n}=r,i=Math.trunc(o);return n?String(i).replace(/\B(?=(\d{3})+(?!\d))/g,n):String(i)}function kRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Number.isInteger(o)?(0,Rue.__)("Value must be an integer."):null}var Aue={type:"integer",render:co,Edit:"integer",sort:vk,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo,Gd,Wd,$d,Kd,tn],validOperators:[Jt,eo,Gd,Wd,$d,Kd,tn,Ut,Ht,Tr,Ir],format:Oue,getValueFormatted:bRe,validate:{required:uo,min:gR,max:bR,elements:_t,custom:kRe}};var Lue=l(N(),1);var Nue={separatorThousand:",",separatorDecimal:".",decimals:2};function vRe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="number"?r=Nue:r=t.format;let{separatorThousand:n,separatorDecimal:i,decimals:s}=r,a=o.toFixed(s),[c,u]=a.split("."),d=n?c.replace(/\B(?=(\d{3})+(?!\d))/g,n):c;return s===0?d:d+i+u}function yRe(e){return e===""||e===void 0||e===null}function SRe(e,t){let o=t.getValue({item:e});return!yRe(o)&&!Number.isFinite(o)?(0,Lue.__)("Value must be a number."):null}var Mue={type:"number",render:co,Edit:"number",sort:vk,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo,Gd,Wd,$d,Kd,tn],validOperators:[Jt,eo,Gd,Wd,$d,Kd,tn,Ut,Ht,Tr,Ir],format:Nue,getValueFormatted:vRe,validate:{required:uo,min:gR,max:bR,elements:_t,custom:SRe}};var Due={type:"text",render:co,Edit:"text",sort:il,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,el,tl,ol,Ut,Ht,Tr,Ir],format:{},getValueFormatted:nn,validate:{required:uo,pattern:ll,minLength:sl,maxLength:al,elements:_t}};var bp=l(hc(),1);var Vue={datetime:(0,bp.getSettings)().formats.datetime,weekStartsOn:(0,bp.getSettings)().l10n.startOfWeek};function _Re({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="datetime"?r=Vue:r=t.format,(0,bp.dateI18n)(r.datetime,(0,bp.getDate)(o))}var xRe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},Fue={type:"datetime",render:co,Edit:"datetime",sort:xRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Qd,Jd,Yd,qd,Zd,Xd,on,Rn],validOperators:[Qd,Jd,Yd,qd,Zd,Xd,on,Rn],format:Vue,getValueFormatted:_Re,validate:{required:uo,elements:_t}};var kp=l(hc(),1);var zue={date:(0,kp.getSettings)().formats.date,weekStartsOn:(0,kp.getSettings)().l10n.startOfWeek};function wRe({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="date"?r=zue:r=t.format,(0,kp.dateI18n)(r.date,(0,kp.getDate)(o))}var CRe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},jue={type:"date",render:co,Edit:"date",sort:CRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Qd,Jd,Yd,qd,Zd,Xd,on,Rn,tn],validOperators:[Qd,Jd,Yd,qd,Zd,Xd,on,Rn,tn],format:zue,getValueFormatted:wRe,validate:{required:uo,elements:_t}};var kR=l(N(),1);function Uue(e,t){return t.getValue({item:e})===!0}function BRe({item:e,field:t}){let o=t.getValue({item:e});return o===!0?(0,kR.__)("True"):o===!1?(0,kR.__)("False"):""}function ERe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&![!0,!1].includes(o)?(0,kR.__)("Value must be true, false, or undefined"):null}var TRe=(e,t,o)=>{let r=!!e;return r===!!t?0:o==="asc"?r?1:-1:r?-1:1},Hue={type:"boolean",render:co,Edit:"checkbox",sort:TRe,validate:{required:Uue,elements:_t,custom:ERe},enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo],validOperators:[Jt,eo],format:{},getValueFormatted:BRe};var Gue={type:"media",render:()=>null,Edit:null,sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:nn,validate:{}};var J4=l(N(),1);function Wue(e,t){let o=t.getValue({item:e});return Array.isArray(o)&&o.length>0&&o.every(r=>![void 0,"",null].includes(r))}function $ue({item:e,field:t}){let o=t.getValue({item:e});return(Array.isArray(o)?o:[]).join(", ")}function IRe({item:e,field:t}){return $ue({item:e,field:t})}function PRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Array.isArray(o)?(0,J4.__)("Value must be an array."):o.every(r=>typeof r=="string")?null:(0,J4.__)("Every value must be a string.")}var RRe=(e,t,o)=>{let r=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(r.length!==n.length)return o==="asc"?r.length-n.length:n.length-r.length;let i=r.join(","),s=n.join(",");return o==="asc"?i.localeCompare(s):s.localeCompare(i)},Kue={type:"array",render:IRe,Edit:"array",sort:RRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Ut,Ht,Tr,Ir],format:{},getValueFormatted:$ue,validate:{required:Wue,elements:_t,custom:PRe}};function ORe({item:e,field:t}){return t.getValue({item:e})?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":""}var Yue={type:"password",render:co,Edit:"password",sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:ORe,validate:{required:uo,pattern:ll,minLength:sl,maxLength:al,elements:_t}};var que={type:"telephone",render:co,Edit:"telephone",sort:il,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,el,tl,ol,Ut,Ht,Tr,Ir],format:{},getValueFormatted:nn,validate:{required:uo,pattern:ll,minLength:sl,maxLength:al,elements:_t}};var Zue=l(N(),1);var yk=l(w(),1);function ARe({item:e,field:t}){if(t.hasElements)return(0,yk.jsx)(hR,{item:e,field:t});let o=nn({item:e,field:t});return!o||!Bt(o).isValid()?o:(0,yk.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,yk.jsx)("div",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:o,border:"1px solid #ddd",flexShrink:0}}),(0,yk.jsx)("span",{children:o})]})}function LRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Bt(o).isValid()?(0,Zue.__)("Value must be a valid color."):null}var NRe=(e,t,o)=>{let r=Bt(e),n=Bt(t);if(!r.isValid()&&!n.isValid())return 0;if(!r.isValid())return o==="asc"?1:-1;if(!n.isValid())return o==="asc"?-1:1;let i=r.toHsl(),s=n.toHsl();return i.h!==s.h?o==="asc"?i.h-s.h:s.h-i.h:i.s!==s.s?o==="asc"?i.s-s.s:s.s-i.s:o==="asc"?i.l-s.l:s.l-i.l},Xue={type:"color",render:ARe,Edit:"color",sort:NRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ut,Ht],format:{},getValueFormatted:nn,validate:{required:uo,elements:_t,custom:LRe}};var Que={type:"url",render:co,Edit:"url",sort:il,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,el,tl,ol,Ut,Ht,Tr,Ir],format:{},getValueFormatted:nn,validate:{required:uo,pattern:ll,minLength:sl,maxLength:al,elements:_t}};var MRe=(e,t,o)=>typeof e=="number"&&typeof t=="number"?vk(e,t,o):il(e,t,o),Jue={render:co,Edit:null,sort:MRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo],validOperators:Nce(),format:{},getValueFormatted:nn,validate:{required:uo,elements:_t}};function ede(e,t){let o;e.isValid?.required===!0&&t.validate.required!==void 0&&(o={constraint:!0,validate:t.validate.required});let r;(e.isValid?.elements===!0||e.isValid?.elements===void 0&&(e.elements||e.getElements))&&t.validate.elements!==void 0&&(r={constraint:!0,validate:t.validate.elements});let n;typeof e.isValid?.min=="number"&&t.validate.min!==void 0&&(n={constraint:e.isValid.min,validate:t.validate.min});let i;typeof e.isValid?.max=="number"&&t.validate.max!==void 0&&(i={constraint:e.isValid.max,validate:t.validate.max});let s;typeof e.isValid?.minLength=="number"&&t.validate.minLength!==void 0&&(s={constraint:e.isValid.minLength,validate:t.validate.minLength});let a;typeof e.isValid?.maxLength=="number"&&t.validate.maxLength!==void 0&&(a={constraint:e.isValid.maxLength,validate:t.validate.maxLength});let c;e.isValid?.pattern!==void 0&&t.validate.pattern!==void 0&&(c={constraint:e.isValid?.pattern,validate:t.validate.pattern});let u=e.isValid?.custom??t.validate.custom;return{required:o,elements:r,min:n,max:i,minLength:s,maxLength:a,pattern:c,custom:u}}function tde(e){return e.validOperators.reduce((t,o)=>{let r=Lce(o);return r?.filter&&(t[o]=r.filter),t},{})}function DRe(e,t){return{...t.format,...e.format}}var ode=DRe;function VRe(e){let t=[Pue,Aue,Mue,Due,Fue,jue,Hue,Gue,Kue,Yue,que,Xue,Que].find(o=>o?.type===e);return t||Jue}function L_(e){return e.map(t=>{let o=VRe(t.type),r=t.getValue||Bue(t.id),n=function(i,s,a){let c=r({item:i}),u=r({item:s});return t.sort?t.sort(c,u,a):o.sort(c,u,a)};return{id:t.id,label:t.label||t.id,header:t.header||t.label||t.id,description:t.description,placeholder:t.placeholder,getValue:r,setValue:t.setValue||Eue(t.id),elements:t.elements,getElements:t.getElements,hasElements:mR(t),isVisible:t.isVisible,enableHiding:t.enableHiding??!0,readOnly:t.readOnly??!1,type:o.type,render:t.render??o.render,Edit:wue(t,o.Edit),sort:n,enableSorting:t.enableSorting??o.enableSorting,enableGlobalSearch:t.enableGlobalSearch??o.enableGlobalSearch,isValid:ede(t,o),filterBy:Cue(t,o.defaultOperators,o.validOperators),filter:tde(o),format:ode(t,o),getValueFormatted:t.getValueFormatted??o.getValueFormatted}})}var az=l(R(),1);var rde=l(R(),1),nde=l(w(),1),ez=(0,rde.createContext)({fields:[]});ez.displayName="DataFormContext";function ide({fields:e,children:t}){return(0,nde.jsx)(ez.Provider,{value:{fields:e},children:t})}var us=ez;var TR=l(R(),1);var yR=l(R(),1),N_=l(A(),1);var Or={type:"regular",labelPosition:"top"},FRe=e=>typeof e=="string"?[{id:e,visibility:"when-collapsed"}]:e.map(t=>typeof t=="string"?{id:t,visibility:"when-collapsed"}:{id:t.id,visibility:t.visibility});function sde(e){let t=Or;if(e?.type==="regular")t={type:"regular",labelPosition:e?.labelPosition??"top"};else if(e?.type==="panel"){let o=e.summary??[],r=Array.isArray(o)?o:[o];t={type:"panel",labelPosition:e?.labelPosition??"side",openAs:e?.openAs??"dropdown",summary:r,editVisibility:e?.editVisibility??"on-hover"}}else if(e?.type==="card")if(e.withHeader===!1)t={type:"card",withHeader:!1,isOpened:!0,summary:[],isCollapsible:!1};else{let o=e.summary??[];t={type:"card",withHeader:!0,isOpened:typeof e.isOpened=="boolean"?e.isOpened:!0,summary:FRe(o),isCollapsible:e.isCollapsible===void 0?!0:e.isCollapsible}}else e?.type==="row"?t={type:"row",alignment:e?.alignment??"center",styles:e?.styles??{}}:e?.type==="details"&&(t={type:"details",summary:e?.summary??""});return t}function ade(e){let t=sde(e?.layout),o=(e.fields??[]).map(r=>{if(typeof r=="string")return{id:r,layout:t};let n=r.layout?sde(r.layout):t;return{id:r.id,layout:n,...!!r.label&&{label:r.label},...!!r.description&&{description:r.description},..."children"in r&&Array.isArray(r.children)&&{children:ade({fields:r.children,layout:Or}).fields}}});return{layout:t,fields:o}}var vR=ade;var Gt=l(w(),1);function zRe({title:e}){return(0,Gt.jsx)(De,{direction:"column",className:"dataforms-layouts-regular__header",gap:"lg",children:(0,Gt.jsx)(De,{direction:"row",align:"center",children:(0,Gt.jsx)(N_.__experimentalHeading,{level:2,size:13,children:e})})})}function lde({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,yR.useContext)(us),a=t.layout,c=(0,yR.useMemo)(()=>({layout:Or,fields:t.children?t.children:[]}),[t]);if(t.children)return(0,Gt.jsxs)(Gt.Fragment,{children:[!r&&t.label&&(0,Gt.jsx)(zRe,{title:t.label}),(0,Gt.jsx)(Ln,{data:e,form:c,onChange:o,validity:i?.children})]});let u=a.labelPosition,d=s.find(f=>f.id===t.id);return!d||!d.Edit?null:u==="side"?(0,Gt.jsxs)(De,{direction:"row",className:"dataforms-layouts-regular__field",gap:"sm",children:[(0,Gt.jsx)("div",{className:V("dataforms-layouts-regular__field-label",`dataforms-layouts-regular__field-label--label-position-${u}`),children:(0,Gt.jsx)(N_.BaseControl.VisualLabel,{children:d.label})}),(0,Gt.jsx)("div",{className:"dataforms-layouts-regular__field-control",children:d.readOnly===!0?(0,Gt.jsx)(d.render,{item:e,field:d}):(0,Gt.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:!0,markWhenOptional:n,validity:i},d.id)})]}):(0,Gt.jsx)("div",{className:"dataforms-layouts-regular__field",children:d.readOnly===!0?(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsxs)(Gt.Fragment,{children:[!r&&u!=="none"&&(0,Gt.jsx)(N_.BaseControl.VisualLabel,{children:d.label}),(0,Gt.jsx)(d.render,{item:e,field:d})]})}):(0,Gt.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:u==="none"?!0:r,markWhenOptional:n,validity:i})})}var oz=l(DV(),1),vp=l(A(),1),rz=l(N(),1),sa=l(R(),1),wR=l(Z(),1);var _k=l(A(),1),Sk=l(N(),1);var mde=l(Z(),1),pde=l(R(),1);function jRe(e,t){return V("dataforms-layouts-panel__field-label",`dataforms-layouts-panel__field-label--label-position-${e}`,{"has-error":t})}var cde=jRe;var SR=l(A(),1);var M_=l(w(),1);function URe(e,t,o){return e?(0,M_.jsx)(SR.Tooltip,{text:t,placement:"top",children:(0,M_.jsxs)("span",{className:"dataforms-layouts-panel__field-label-error-content",children:[(0,M_.jsx)(SR.Icon,{icon:Rf,size:16}),o]})}):o}var ude=URe;function dde(e){if(!e)return;let t=Object.keys(e).filter(o=>o!=="children");for(let o of t){let r=e[o];if(r!==void 0&&r.type==="invalid")return r.message?r.message:o==="required"?"A required field is empty":"Unidentified validation error"}if(e.children)for(let o of Object.values(e.children)){let r=dde(o);if(r)return r}}var fde=dde;var gi=l(w(),1);function D_({data:e,field:t,fieldLabel:o,summaryFields:r,validity:n,touched:i,disabled:s,onClick:a,"aria-expanded":c}){let{labelPosition:u,editVisibility:d}=t.layout,f=fde(n),m=i&&!!f,h=cde(u,m),p=ude(m,f,o),g=V("dataforms-layouts-panel__field-trigger",`dataforms-layouts-panel__field-trigger--label-${u}`,{"is-disabled":s,"dataforms-layouts-panel__field-trigger--edit-always":d==="always"}),b=(0,mde.useInstanceId)(D_,"dataforms-layouts-panel__field-control"),v=m?(0,Sk.sprintf)((0,Sk._x)("Edit %s (has errors)","field"),o||""):(0,Sk.sprintf)((0,Sk._x)("Edit %s","field"),o||""),k=(0,pde.useRef)(null);return(0,gi.jsxs)("div",{ref:k,className:g,onClick:s?void 0:()=>{let x=k.current?.ownerDocument.defaultView?.getSelection();x&&x.toString().length>0||a()},onKeyDown:s?void 0:x=>{x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a())},children:[u!=="none"&&(0,gi.jsx)("span",{className:h,children:p}),u==="none"&&m&&(0,gi.jsx)(_k.Tooltip,{text:f,placement:"top",children:(0,gi.jsx)("span",{className:"dataforms-layouts-panel__field-label-error-content",children:(0,gi.jsx)(_k.Icon,{icon:Rf,size:16})})}),(0,gi.jsx)("span",{id:`${b}`,className:"dataforms-layouts-panel__field-control",children:r.length>1?(0,gi.jsx)("span",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%",gap:"2px"},children:r.map(x=>(0,gi.jsx)("span",{style:{width:"100%"},children:(0,gi.jsx)(x.render,{item:e,field:x})},x.id))}):r.map(x=>(0,gi.jsx)(x.render,{item:e,field:x},x.id))}),!s&&(0,gi.jsx)(_k.Button,{className:"dataforms-layouts-panel__field-trigger-icon",label:v,showTooltip:!1,icon:Af,size:"small","aria-expanded":c,"aria-haspopup":"dialog","aria-describedby":`${b}`})]})}var hde=l(DV(),1),tz=l(Sf(),1),cl=l(R(),1),sn=l(N(),1);function gde(e){return e?Object.values(e).every(t=>Object.entries(t).every(([o,r])=>o==="children"&&r&&typeof r=="object"?gde(r):r.type!=="invalid"&&r.type!=="validating")):!0}function HRe(e,t){let o=vR(e);if(o.fields.length===0)return[];let r=new Map;t.forEach(s=>{r.set(s.id,s)});function n(s){if("children"in s&&Array.isArray(s.children)){let u=s.children.map(n).filter(f=>f!==null);if(u.length===0)return null;let d=r.get(s.id);if(d){let[f]=L_([d]);return{id:s.id,children:u,field:f}}return{id:s.id,children:u}}let a=r.get(s.id);if(!a)return null;let[c]=L_([a]);return{id:s.id,children:[],field:c}}return o.fields.map(n).filter(s=>s!==null)}function xk(e,t,o){if(e||(e={}),o.length===0)return e;let r={...e},n=r;for(let s=0;s{if(a===r.current[t.id]){if(!Array.isArray(c)){n(u=>xk(u,{elements:{type:"invalid",message:(0,sn.__)("Could not validate elements.")}},[...i,t.id]));return}t.field?.isValid.elements&&!t.field.isValid.elements.validate(s,{...t.field,elements:c})?n(u=>xk(u,{elements:{type:"invalid",message:(0,sn.__)("Value must be one of the elements.")}},[...i,t.id])):n(u=>bde(u,[...i,t.id],"elements"))}}).catch(c=>{if(a!==r.current[t.id])return;let u;c instanceof Error?u=c.message:u=String(c)||(0,sn.__)("Unknown error when running elements validation asynchronously."),n(d=>xk(d,{elements:{type:"invalid",message:u}},[...i,t.id]))})}function WRe(e,t,o){let{customCounterRef:r,setFormValidity:n,path:i}=o,s=(r.current[t.id]||0)+1;r.current[t.id]=s,e.then(a=>{if(s===r.current[t.id]){if(a===null){n(c=>bde(c,[...i,t.id],"custom"));return}if(typeof a=="string"){n(c=>xk(c,{custom:{type:"invalid",message:a}},[...i,t.id]));return}n(c=>xk(c,{custom:{type:"invalid",message:(0,sn.__)("Validation could not be processed.")}},[...i,t.id]))}}).catch(a=>{if(s!==r.current[t.id])return;let c;a instanceof Error?c=a.message:c=String(a)||(0,sn.__)("Unknown error when running custom validation asynchronously."),n(u=>xk(u,{custom:{type:"invalid",message:c}},[...i,t.id]))})}function kde(e,t,o){if(t.field?.isValid.required&&!t.field.isValid.required.validate(e,t.field))return{required:{type:"invalid"}};if(t.field?.isValid.pattern&&!t.field.isValid.pattern.validate(e,t.field))return{pattern:{type:"invalid",message:(0,sn.__)("Value does not match the required pattern.")}};if(t.field?.isValid.min&&!t.field.isValid.min.validate(e,t.field))return{min:{type:"invalid",message:(0,sn.__)("Value is below the minimum.")}};if(t.field?.isValid.max&&!t.field.isValid.max.validate(e,t.field))return{max:{type:"invalid",message:(0,sn.__)("Value is above the maximum.")}};if(t.field?.isValid.minLength&&!t.field.isValid.minLength.validate(e,t.field))return{minLength:{type:"invalid",message:(0,sn.__)("Value is too short.")}};if(t.field?.isValid.maxLength&&!t.field.isValid.maxLength.validate(e,t.field))return{maxLength:{type:"invalid",message:(0,sn.__)("Value is too long.")}};if(t.field?.isValid.elements&&t.field.hasElements&&!t.field.getElements&&Array.isArray(t.field.elements)&&!t.field.isValid.elements.validate(e,t.field))return{elements:{type:"invalid",message:(0,sn.__)("Value must be one of the elements.")}};let r;if(t.field&&t.field.isValid.custom)try{let i=t.field.getValue({item:e});r=t.field.isValid.custom((0,hde.default)(e,t.field.setValue({item:e,value:i})),t.field)}catch(i){let s;return i instanceof Error?s=i.message:s=String(i)||(0,sn.__)("Unknown error when running custom validation."),{custom:{type:"invalid",message:s}}}if(typeof r=="string")return{custom:{type:"invalid",message:r}};let n={};if(t.field&&t.field.isValid.elements&&t.field.hasElements&&typeof t.field.getElements=="function"&&(GRe(t.field.getElements(),t,o),n.elements={type:"validating",message:(0,sn.__)("Validating\u2026")}),r instanceof Promise&&(WRe(r,t,o),n.custom={type:"validating",message:(0,sn.__)("Validating\u2026")}),Object.keys(n).length>0)return n;if(t.children.length>0){let i={};t.children.forEach(a=>{i[a.id]=kde(e,a,{...o,path:[...o.path,t.id,"children"]})});let s={};return Object.entries(i).forEach(([a,c])=>{c!==void 0&&(s[a]=c)}),Object.keys(s).length===0?void 0:{children:s}}}function vde(e,t){let o=e?.field?.getValue({item:t});if(e.children.length===0)return o;let r=e.children.map(n=>vde(n,t));return r?{value:o,children:r}:o}function $Re(e,t,o){let[r,n]=(0,cl.useState)(),i=(0,cl.useRef)({}),s=(0,cl.useRef)({}),a=(0,cl.useRef)({}),c=(0,cl.useCallback)(()=>{let u={customCounterRef:i,elementsCounterRef:s,setFormValidity:n,path:[],item:e},d=HRe(o,t);if(d.length===0){n(void 0);return}let f={},m=[];d.forEach(h=>{let p=vde(h,e);if(a.current.hasOwnProperty(h.id)&&(0,tz.default)(a.current[h.id],p)){m.push(h.id);return}a.current[h.id]=p;let g=kde(e,h,u);g!==void 0&&(f[h.id]=g)}),n(h=>{let p={...h,...f},g=[...m,...Object.keys(f)];return Object.keys(p).forEach(v=>{p&&!g.includes(v)&&delete p[v]}),Object.keys(p).length===0&&(p=void 0),(0,tz.default)(h,p)?h:p})},[e,t,o]);return(0,cl.useEffect)(()=>{c()},[c]),{validity:r,isValid:gde(r)}}var yde=$Re;var Sde=l(R(),1);function rf(e,t){(0,Sde.useEffect)(()=>{t&&e.current&&e.current.querySelectorAll("input, textarea, select").forEach(r=>{r.reportValidity()})},[t,e])}var _de=l(R(),1);function KRe(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.id):[]}var _R=(e,t)=>Array.isArray(e)&&e.length>0?KRe(e).map(r=>t.find(n=>n.id===r)).filter(r=>r!==void 0):[];var YRe=(e,t)=>{let o=t.find(r=>r.id===e.id);return o||t.find(r=>{if(e.children){let n=e.children.filter(i=>!i.children);return n.length===0?!1:r.id===n[0].id}return r.id===e.id})};function qRe(e){let{fields:t}=(0,_de.useContext)(us),o=e.layout,r=_R(o.summary,t),n=YRe(e,t),i=e.children?e.label:n?.label;return r.length===0?{summaryFields:n?[n]:[],fieldDefinition:n,fieldLabel:i}:{summaryFields:r,fieldDefinition:n,fieldLabel:i}}var xR=qRe;var an=l(w(),1);function ZRe({data:e,field:t,onChange:o,fieldLabel:r,onClose:n,touched:i}){let{fields:s}=(0,sa.useContext)(us),[a,c]=(0,sa.useState)({}),u=(0,sa.useMemo)(()=>(0,oz.default)(e,a,{arrayMerge:(k,y)=>y}),[e,a]),d=(0,sa.useMemo)(()=>({layout:Or,fields:t.children?t.children:[{id:t.id,layout:Or}]}),[t]),f=s.map(k=>({...k,Edit:k.Edit===null?void 0:k.Edit,isValid:{required:k.isValid.required?.constraint,elements:k.isValid.elements?.constraint,min:k.isValid.min?.constraint,max:k.isValid.max?.constraint,pattern:k.isValid.pattern?.constraint,minLength:k.isValid.minLength?.constraint,maxLength:k.isValid.maxLength?.constraint}})),{validity:m}=yde(u,f,d),h=()=>{o(a),n()},p=k=>{c(y=>(0,oz.default)(y,k,{arrayMerge:(S,x)=>x}))},g=(0,wR.useFocusOnMount)("firstInputElement"),b=(0,sa.useRef)(null),v=(0,wR.useMergeRefs)([g,b]);return rf(b,i),(0,an.jsxs)(vp.Modal,{className:"dataforms-layouts-panel__modal",onRequestClose:n,isFullScreen:!1,title:r,size:"medium",children:[(0,an.jsx)("div",{ref:v,children:(0,an.jsx)(Ln,{data:u,form:d,onChange:p,validity:m,children:(k,y,S,x)=>(0,an.jsx)(k,{data:u,field:y,onChange:p,hideLabelFromVision:d.fields.length<2,markWhenOptional:x,validity:S},y.id)})}),(0,an.jsxs)(De,{direction:"row",className:"dataforms-layouts-panel__modal-footer",gap:"md",children:[(0,an.jsx)(vp.__experimentalSpacer,{style:{flex:1}}),(0,an.jsx)(vp.Button,{variant:"tertiary",onClick:n,__next40pxDefaultSize:!0,children:(0,rz.__)("Cancel")}),(0,an.jsx)(vp.Button,{variant:"primary",onClick:h,__next40pxDefaultSize:!0,children:(0,rz.__)("Apply")})]})]})}function XRe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,sa.useState)(!1),[s,a]=(0,sa.useState)(!1),{fieldDefinition:c,fieldLabel:u,summaryFields:d}=xR(t);if(!c)return null;let f=()=>{a(!1),i(!0)};return(0,an.jsxs)(an.Fragment,{children:[(0,an.jsx)(D_,{data:e,field:t,fieldLabel:u,summaryFields:d,validity:r,touched:n,disabled:c.readOnly===!0,onClick:()=>a(!0),"aria-expanded":s}),s&&(0,an.jsx)(ZRe,{data:e,field:t,onChange:o,fieldLabel:u??"",onClose:f,touched:n})]})}var xde=XRe;var nf=l(A(),1),wde=l(N(),1),Oc=l(R(),1);var Cde=l(Z(),1);var Ar=l(w(),1);function QRe({title:e,onClose:t}){return(0,Ar.jsx)(De,{direction:"column",className:"dataforms-layouts-panel__dropdown-header",gap:"lg",children:(0,Ar.jsxs)(De,{direction:"row",gap:"sm",align:"center",children:[e&&(0,Ar.jsx)(nf.__experimentalHeading,{level:2,size:13,children:e}),(0,Ar.jsx)(nf.__experimentalSpacer,{style:{flex:1}}),t&&(0,Ar.jsx)(nf.Button,{label:(0,wde.__)("Close"),icon:Cf,onClick:t,size:"small"})]})})}function JRe({touched:e,children:t}){let o=(0,Oc.useRef)(null);return rf(o,e),(0,Ar.jsx)("div",{ref:o,children:t})}function eOe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,Oc.useState)(!1),[s,a]=(0,Oc.useState)(null),c=(0,Oc.useMemo)(()=>({anchor:s,placement:"left-start",offset:36,shift:!0}),[s]),[u,d]=(0,Cde.__experimentalUseDialog)({focusOnMount:"firstInputElement"}),f=(0,Oc.useMemo)(()=>({layout:Or,fields:t.children?t.children:[{id:t.id,layout:Or}]}),[t]),m=(0,Oc.useMemo)(()=>{if(r!==void 0)return t.children?r?.children:{[t.id]:r}},[r,t]),{fieldDefinition:h,fieldLabel:p,summaryFields:g}=xR(t);return h?(0,Ar.jsx)("div",{ref:a,className:"dataforms-layouts-panel__field-dropdown-anchor",children:(0,Ar.jsx)(nf.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:c,focusOnMount:!1,onToggle:b=>{b||i(!0)},renderToggle:({isOpen:b,onToggle:v})=>(0,Ar.jsx)(D_,{data:e,field:t,fieldLabel:p,summaryFields:g,validity:r,touched:n,disabled:h.readOnly===!0,onClick:v,"aria-expanded":b}),renderContent:({onClose:b})=>(0,Ar.jsx)(JRe,{touched:n,children:(0,Ar.jsxs)("div",{ref:u,...d,children:[(0,Ar.jsx)(QRe,{title:p,onClose:b}),(0,Ar.jsx)(Ln,{data:e,form:f,onChange:o,validity:m,children:(v,k,y,S)=>(0,Ar.jsx)(v,{data:e,field:k,onChange:o,hideLabelFromVision:(f?.fields??[]).length<2,markWhenOptional:S,validity:y},k.id)})]})})})}):null}var Bde=eOe;var nz=l(w(),1);function Ede({data:e,field:t,onChange:o,validity:r}){return t.layout.openAs==="modal"?(0,nz.jsx)(xde,{data:e,field:t,onChange:o,validity:r}):(0,nz.jsx)(Bde,{data:e,field:t,onChange:o,validity:r})}var sf=l(A(),1),Pde=l(Z(),1),Nn=l(R(),1),iz=l(N(),1);var CR=l(N(),1),Tde=l(w(),1);function Ide(e){if(!e)return 0;let t=0,o=Object.keys(e).filter(r=>r!=="children");for(let r of o)e[r]?.type==="invalid"&&t++;if(e.children)for(let r of Object.values(e.children))t+=Ide(r);return t}function BR({validity:e}){let t=Ide(e);return t===0?null:(0,Tde.jsx)(N4,{intent:"high",children:(0,CR.sprintf)((0,CR._n)("%d field needs attention","%d fields need attention",t),t)})}var kr=l(w(),1);function tOe(e,t,o){if(!t||Array.isArray(t)&&t.length===0)return!1;let n=(Array.isArray(t)?t:[t]).find(i=>typeof i=="string"?i===e.id:typeof i=="object"&&"id"in i?i.id===e.id:!1);return n?typeof n=="string"?!0:typeof n=="object"&&"visibility"in n?n.visibility==="always"||n.visibility==="when-collapsed"&&!o:!0:!1}function sz({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,Nn.useContext)(us),a=t.layout,c=(0,Nn.useRef)(null),u=(0,Pde.useInstanceId)(sz,"dataforms-layouts-card-card-body"),d=(0,Nn.useMemo)(()=>({layout:Or,fields:t.children??[]}),[t]),{isOpened:f,isCollapsible:m}=a,[h,p]=(0,Nn.useState)(f),[g,b]=(0,Nn.useState)(!1);(0,Nn.useEffect)(()=>{p(f)},[f]);let v=(0,Nn.useCallback)(()=>{p(T=>(T&&b(!0),!T))},[]),k=m?h:!0,y=(0,Nn.useCallback)(()=>{b(!0)},[b]);rf(c,k&&g);let x=_R(a.summary,s).filter(T=>tOe(T,a.summary,k)),C=g&&a.isCollapsible?(0,kr.jsx)(BR,{validity:i}):null,B={blockStart:"medium",blockEnd:"medium",inlineStart:"medium",inlineEnd:"medium"},I=t.label,P,E;if(t.children)P=!!I&&a.withHeader,E=(0,kr.jsxs)(kr.Fragment,{children:[t.description&&(0,kr.jsx)("div",{className:"dataforms-layouts-card__field-description",children:t.description}),(0,kr.jsx)(Ln,{data:e,form:d,onChange:o,validity:i?.children})]});else{let T=s.find(D=>D.id===t.id);if(!T||!T.Edit)return null;let O=yp("regular")?.component;if(!O)return null;I=T.label,P=!!I&&a.withHeader,E=(0,kr.jsx)(O,{data:e,field:t,onChange:o,hideLabelFromVision:r||P,markWhenOptional:n,validity:i})}let L={blockStart:P?"none":"medium",blockEnd:"medium",inlineStart:"medium",inlineEnd:"medium"};return(0,kr.jsxs)(sf.Card,{className:"dataforms-layouts-card__field",size:B,children:[P&&(0,kr.jsxs)(sf.CardHeader,{className:"dataforms-layouts-card__field-header",onClick:m?v:void 0,style:{cursor:m?"pointer":void 0},isBorderless:!0,children:[(0,kr.jsxs)("div",{style:{height:m?void 0:"40px",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,kr.jsx)("span",{className:"dataforms-layouts-card__field-header-label",children:I}),C,x.length>0&&a.withHeader&&(0,kr.jsx)("div",{className:"dataforms-layouts-card__field-summary",children:x.map(T=>(0,kr.jsx)(T.render,{item:e,field:T},T.id))})]}),m&&(0,kr.jsx)(sf.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:k?wf:zn,"aria-expanded":k,"aria-controls":u,"aria-label":k?(0,iz.__)("Collapse"):(0,iz.__)("Expand")})]}),(k||!P)&&(0,kr.jsx)(sf.CardBody,{id:u,size:L,className:"dataforms-layouts-card__field-control",ref:c,onBlur:y,children:E})]})}var Rde=l(A(),1);var sr=l(w(),1);function oOe({title:e}){return(0,sr.jsx)(De,{direction:"column",className:"dataforms-layouts-row__header",gap:"lg",children:(0,sr.jsx)(De,{direction:"row",align:"center",children:(0,sr.jsx)(Rde.__experimentalHeading,{level:2,size:13,children:e})})})}var rOe=({children:e})=>(0,sr.jsx)(sr.Fragment,{children:e});function Ode({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let s=t.layout;if(t.children){let c={layout:Or,fields:t.children};return(0,sr.jsxs)("div",{className:"dataforms-layouts-row__field",children:[!r&&t.label&&(0,sr.jsx)(oOe,{title:t.label}),(0,sr.jsx)(De,{direction:"row",align:s.alignment,gap:"lg",children:(0,sr.jsx)(Ln,{data:e,form:c,onChange:o,validity:i?.children,as:rOe,children:(u,d,f)=>(0,sr.jsx)("div",{className:"dataforms-layouts-row__field-control",style:s.styles[d.id],children:(0,sr.jsx)(u,{data:e,field:d,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:f})},d.id)})})]})}let a=yp("regular")?.component;return a?(0,sr.jsx)(sr.Fragment,{children:(0,sr.jsx)("div",{className:"dataforms-layouts-row__field-control",children:(0,sr.jsx)(a,{data:e,field:t,onChange:o,markWhenOptional:n,validity:i})})}):null}var Mn=l(R(),1),Ade=l(N(),1);var Ac=l(w(),1);function Lde({data:e,field:t,onChange:o,validity:r}){let{fields:n}=(0,Mn.useContext)(us),i=(0,Mn.useRef)(null),s=(0,Mn.useRef)(null),[a,c]=(0,Mn.useState)(!1),[u,d]=(0,Mn.useState)(!1),f=(0,Mn.useMemo)(()=>({layout:Or,fields:t.children??[]}),[t]);(0,Mn.useEffect)(()=>{let b=i.current;if(!b)return;let v=()=>{let k=b.open;k||c(!0),d(k)};return b.addEventListener("toggle",v),()=>{b.removeEventListener("toggle",v)}},[]),rf(s,u&&a);let m=(0,Mn.useCallback)(()=>{c(!0)},[]);if(!t.children)return null;let h=t.layout.summary??"",p=h?n.find(b=>b.id===h):void 0,g;return p&&p.render?g=(0,Ac.jsx)(p.render,{item:e,field:p}):g=t.label||(0,Ade.__)("More details"),(0,Ac.jsxs)("details",{ref:i,className:"dataforms-layouts-details__details",children:[(0,Ac.jsx)("summary",{className:"dataforms-layouts-details__summary",children:(0,Ac.jsxs)(De,{direction:"row",align:"center",gap:"md",className:"dataforms-layouts-details__summary-content",children:[g,a&&(0,Ac.jsx)(BR,{validity:r})]})}),(0,Ac.jsx)("div",{ref:s,className:"dataforms-layouts-details__content",onBlur:m,children:(0,Ac.jsx)(Ln,{data:e,form:f,onChange:o,validity:r?.children})})]})}var Sp=l(w(),1),nOe=[{type:"regular",component:lde,wrapper:({children:e})=>(0,Sp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e})},{type:"panel",component:Ede,wrapper:({children:e})=>(0,Sp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"md",children:e})},{type:"card",component:sz,wrapper:({children:e})=>(0,Sp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"xl",children:e})},{type:"row",component:Ode,wrapper:({children:e,layout:t})=>(0,Sp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:(0,Sp.jsx)("div",{className:"dataforms-layouts-row__field",children:(0,Sp.jsx)(De,{direction:"row",gap:"lg",align:t.alignment,children:e})})})},{type:"details",component:Lde}];function yp(e){return nOe.find(t=>t.type===e)}var ER=l(w(),1),iOe=({children:e})=>(0,ER.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e});function Ln({data:e,form:t,onChange:o,validity:r,children:n,as:i}){let{fields:s}=(0,TR.useContext)(us),a=(0,TR.useMemo)(()=>{let d=s.filter(m=>!!m.isValid?.required).length,f=s.length-d;return d>f},[s]);function c(d){return s.find(f=>f.id===d.id)}let u=i??yp(t.layout.type)?.wrapper??iOe;return(0,ER.jsx)(u,{layout:t.layout,children:t.fields.map(d=>{let f=yp(d.layout.type)?.component;if(!f)return null;let m=d.children?void 0:c(d);return m&&m.isVisible&&!m.isVisible(e)?null:n?n(f,d,r?.[d.id],a):(0,ER.jsx)(f,{data:e,field:d,onChange:o,markWhenOptional:a,validity:r?.[d.id]},d.id)})})}var lz=l(w(),1);function V_({data:e,form:t,fields:o,onChange:r,validity:n}){let i=(0,az.useMemo)(()=>vR(t),[t]),s=(0,az.useMemo)(()=>L_(o),[o]);return t.fields?(0,lz.jsx)(ide,{fields:s,children:(0,lz.jsx)(Ln,{data:e,form:i,onChange:r,validity:n})}):null}var af=l(R(),1),Yde=l(N(),1);var Ck=l(A(),1);var cz=l(N(),1);var Nde=l(Z(),1);function wk({isControl:e}={isControl:!1}){return(0,Nde.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:e?35:259}}}var IR=l(w(),1);function Mde({fields:e,visibleFields:t,onToggleField:o}){let{popoverProps:r}=wk();return!e||e.length===0?null:(0,IR.jsx)(Ck.DropdownMenu,{icon:ks,label:(0,cz.__)("Options"),popoverProps:r,toggleProps:{size:"small"},children:({onClose:n})=>(0,IR.jsx)(Ck.MenuGroup,{label:(0,cz.__)("Show / Hide"),children:e.map(i=>{let s=t.includes(i.id);return(0,IR.jsx)(Ck.MenuItem,{isSelected:s,onClick:()=>{o(i.id),n()},role:"menuitemcheckbox",icon:s?bl:null,children:i.label},i.id)})})})}var PR=l(A(),1),Dde=l(Z(),1),Vde=l(F(),1),Lc=l(R(),1),Fde=l(dr(),1);var aa=l(w(),1),{useRichText:sOe}=M(Fde.privateApis);function zde({data:e,field:t,hideLabelFromVision:o,onChange:r,config:n={}}){let i=(0,Vde.useRegistry)(),s=t.getValue({item:e}),a=t.config||{},{clientId:c}=n,[u,d]=(0,Lc.useState)({start:void 0,end:void 0}),[f,m]=(0,Lc.useState)(!1),h=(0,Lc.useRef)(),p=(0,Lc.useRef)(new Set),g=(0,Lc.useRef)(new Set),b=Bb({allowedFormats:a?.allowedFormats,disableFormats:a?.disableFormats});function v(){h.current?.focus()}let{value:k,getValue:y,onChange:S,ref:x,formatTypes:C}=sOe({value:s,onChange(P){r(t.setValue({item:e,value:P}))},selectionStart:u.start,selectionEnd:u.end,onSelectionChange:(P,E)=>d({start:P,end:E}),__unstableIsSelected:f,preserveWhiteSpace:!!a?.preserveWhiteSpace,placeholder:a?.placeholder,__unstableDisableFormats:a?.disableFormats,allowedFormats:b,withoutInteractiveFormatting:a?.withoutInteractiveFormatting,__unstableFormatTypeHandlerContext:(0,Lc.useMemo)(()=>({richTextIdentifier:t.id,blockClientId:c}),[t.id,c])}),{baseControlProps:B,controlProps:I}=(0,PR.useBaseControlProps)({hideLabelFromVision:o??t.hideLabelFromVision,label:t.label});return(0,aa.jsxs)(aa.Fragment,{children:[f&&(0,aa.jsx)(Rb.Provider,{value:g,children:(0,aa.jsx)(Ab.Provider,{value:p,children:(0,aa.jsx)("div",{children:(0,aa.jsx)(iP,{value:k,onChange:S,onFocus:v,formatTypes:C,forwardedRef:h,isVisible:!1})})})}),(0,aa.jsx)(PR.BaseControl,{...B,children:(0,aa.jsx)("div",{className:"block-editor-content-only-controls__rich-text",role:"textbox","aria-multiline":!a?.disableLineBreaks,ref:(0,Dde.useMergeRefs)([x,oP({registry:i,getValue:y,onChange:S,formatTypes:C,selectionChange:d,isSelected:f,disableFormats:a?.disableFormats,value:k,tagName:"div",disableLineBreaks:a?.disableLineBreaks,keyboardShortcuts:g,inputEvents:p}),h]),onFocus:()=>m(!0),onBlur:()=>m(!1),contentEditable:!0,...I})})]})}var _p=l(A(),1),jde=l(F(),1),Bk=l(N(),1);var Co=l(w(),1);function aOe({data:e,field:t,attachment:o,config:r}){let{allowedTypes:n=[],multiple:i=!1}=r||{};if(i)return"todo multiple";if(o?.media_type==="image"||o?.poster)return(0,Co.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Co.jsx)("img",{alt:"",width:24,height:24,src:o.media_type==="image"?o.source_url:o.poster})});if(n.length===1){let a=t.getValue({item:e})?.url;if(n[0]==="image"&&a)return(0,Co.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Co.jsx)("img",{alt:"",width:24,height:24,src:a})});let c;if(n[0]==="image"?c=sv:n[0]==="video"?c=zN:n[0]==="audio"?c=GO:c=Up,c)return(0,Co.jsx)(_p.Icon,{icon:c,size:24})}return(0,Co.jsx)(_p.Icon,{icon:Up,size:24})}function Ude({data:e,field:t,onChange:o,config:r={}}){let{popoverProps:n}=wk({isControl:!0}),i=t.getValue({item:e}),{allowedTypes:s=[],multiple:a=!1,useFeaturedImage:c=!1}=r,u=i?.id,d=i?.url,f=(0,jde.useSelect)(h=>{if(!u)return;let g=h(_).getSettings()[w0];if(g)return g(h,u)},[u]),m;if(s.length===1){let h=s[0];h==="image"?m=(0,Bk.__)("Choose an image\u2026"):h==="video"?m=(0,Bk.__)("Choose a video\u2026"):h==="application"?m=(0,Bk.__)("Choose a file\u2026"):m=(0,Bk.__)("Choose a media item\u2026")}else m=(0,Bk.__)("Choose a media item\u2026");return(0,Co.jsx)(Vs,{children:(0,Co.jsx)(xb,{className:"block-editor-content-only-controls__media-replace-flow",allowedTypes:s,mediaId:u,mediaURL:d,multiple:a,popoverProps:n,onReset:()=>{o(t.setValue({item:e,value:{}}))},...c&&{useFeaturedImage:!!i?.featuredImage,onToggleFeaturedImage:()=>{o(t.setValue({item:e,value:{featuredImage:!i?.featuredImage}}))}},onSelect:h=>{if(h.id&&h.url){let p={...h,mediaType:h.media_type};c&&(p.featuredImage=!1),o(t.setValue({item:e,value:p}))}},renderToggle:h=>(0,Co.jsx)(_p.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__media",...h,children:(0,Co.jsxs)(_p.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__media-row",children:[d&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(aOe,{attachment:f,field:t,data:e,config:r}),(0,Co.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:f?.title?.raw&&f?.title?.raw!==""?f?.title?.raw:d})]}),!d&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)("span",{className:"block-editor-content-only-controls__media-placeholder",style:{width:"24px",height:"24px"}}),(0,Co.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:m})]})]})})})})}var Nc=l(A(),1),OR=l(R(),1),Hde=l(N(),1);var Gde=l(dn(),1);var vr=l(w(),1),uz="noreferrer noopener",Wde="_blank",RR="nofollow";function lOe({rel:e="",url:t="",opensInNewTab:o,nofollow:r}){let n,i=e;if(o)n=Wde,i=i?.includes(uz)?i:i+` ${uz}`;else{let s=new RegExp(`\\b${uz}\\s*`,"g");i=i?.replace(s,"").trim()}if(r)i=i?.includes(RR)?i:(i+` ${RR}`).trim();else{let s=new RegExp(`\\b${RR}\\s*`,"g");i=i?.replace(s,"").trim()}return{url:(0,Gde.prependHTTP)(t),linkTarget:n,rel:i||void 0}}function $de({data:e,field:t,onChange:o}){let[r,n]=(0,OR.useState)(!1),{popoverProps:i}=wk({isControl:!0}),s=t.getValue({item:e}),a=s?.url,c=s?.rel||"",d=s?.linkTarget===Wde,f=c===RR,m=(0,OR.useMemo)(()=>({url:a,opensInNewTab:d,nofollow:f}),[a,d,f]);return(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(Nc.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__link",onClick:()=>{n(!0)},children:(0,vr.jsxs)(Nc.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__link-row",children:[a&&(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(Nc.Icon,{icon:fn,size:24}),(0,vr.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:a})]}),!a&&(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(Nc.Icon,{icon:fn,size:24,style:{opacity:.3}}),(0,vr.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:(0,Hde.__)("Link")})]})]})}),r&&(0,vr.jsx)(Nc.Popover,{onClose:()=>{n(!1)},...i??{},children:(0,vr.jsx)(Rd,{value:m,onChange:h=>{let p=lOe({rel:c,...h});o(t.setValue({item:e,value:p}))},onRemove:()=>{o(t.setValue({item:e,value:{}}))}})})]})}var yr=l(w(),1),{fieldsKey:qde,formKey:dz}=M(Ek.privateApis);function fz(e,t={}){return function(r){return(0,yr.jsx)(e,{...r,config:t})}}function cOe({clientId:e,blockType:t,setAttributes:o,isCollapsed:r=!1}){let n=zr({clientId:e,context:"list-view"}),i=Tt(e),s=t?.[qde],a=(0,af.useContext)(_r),c=(0,Kde.useSelect)(p=>{let g=p(_).getBlockAttributes(e);if(!g?.metadata?.bindings)return g;let{getBlockBindingsSource:b}=M(p(Ek.store));return Object.entries(g.metadata.bindings).reduce((v,[k,y])=>{let S=b(y.source);if(!S)return v;let x=S.getValues({select:p,context:a,bindings:{[k]:y}});return{...v,...x}},g)},[a,e]),u=(0,af.useMemo)(()=>r?{...t?.[dz],fields:[t?.[dz]?.fields?.[0]]}:t?.[dz],[t,r]),[d,f]=(0,af.useState)(u),m=(0,af.useMemo)(()=>s?.length?s.map(p=>{let g={...p};return typeof p.Edit=="string"&&p.Edit==="rich-text"?g.Edit=fz(zde,{clientId:e}):typeof p.Edit=="string"&&p.Edit==="link"?g.Edit=fz($de):typeof p.Edit=="object"&&p.Edit.control==="media"&&(g.Edit=fz(Ude,{...p.Edit})),g}):[],[s,e]);if(!s?.length)return null;let h=p=>{f(g=>g.fields?.includes(p)?{...g,fields:g.fields.filter(b=>b!==p)}:{...g,fields:[...g.fields||[],p]})};return(0,yr.jsxs)("div",{className:"block-editor-block-fields__container",children:[(0,yr.jsx)("div",{className:"block-editor-block-fields__header",children:(0,yr.jsxs)(AR.__experimentalHStack,{spacing:1,children:[r&&(0,yr.jsxs)(yr.Fragment,{children:[(0,yr.jsx)(Ae,{className:"block-editor-block-fields__header-icon",icon:i?.icon}),(0,yr.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,yr.jsx)(AR.__experimentalTruncate,{numberOfLines:1,children:n})}),(0,yr.jsx)(Mde,{fields:m,visibleFields:d.fields,onToggleField:h})]}),!r&&(0,yr.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,Yde.__)("Content")})]})}),(0,yr.jsx)(V_,{data:c,fields:m,form:d,onChange:o})]})}function uOe(e){return!!(window?.__experimentalContentOnlyInspectorFields&&(0,Ek.getBlockType)(e)?.[qde])}function dOe(e){let{blockType:t,isSelectionWithinCurrentSection:o}=(0,af.useContext)(ur);return(0,yr.jsx)(_m,{group:"content",children:(0,yr.jsx)(cOe,{...e,blockType:t,isCollapsed:o})})}var Zde={edit:dOe,hasSupport:uOe,attributeKeys:[],supportsPatternEditing:!0};var hz=l(ut(),1),Xde=l(A(),1),mz=l(N(),1),F_=l($(),1);var pz=l(w(),1);function fOe(e){return(0,F_.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}function mOe({className:e,setAttributes:t}){return ao()!=="default"?null:(0,pz.jsx)(fe,{group:"advanced",children:(0,pz.jsx)(Xde.TextControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,mz.__)("Additional CSS class(es)"),value:e||"",onChange:r=>{t({className:r!==""?r:void 0})},help:(0,mz.__)("Separate multiple classes with spaces.")})})}var gz={edit:mOe,addSaveProps:pOe,attributeKeys:["className"],hasSupport(e){return(0,F_.hasBlockSupport)(e,"customClassName",!0)}};function pOe(e,t,o){return(0,F_.hasBlockSupport)(t,"customClassName",!0)&&o.className&&(e.className=V(e.className,o.className)),e}function hOe(e,t,o,r){if(!(0,F_.hasBlockSupport)(e.name,"customClassName",!0)||r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1)return e;if(t[o]){let n=t[o]?.attributes.className;if(n&&e.attributes.className===void 0)return{...e,attributes:{...e.attributes,className:n}}}return e}(0,hz.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",fOe);(0,hz.addFilter)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",hOe);var Qde=l(ut(),1),z_=l($(),1);function gOe(e,t){return(0,z_.hasBlockSupport)(t,"className",!0)&&(typeof e.className=="string"?e.className=[...new Set([(0,z_.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,z_.getBlockDefaultClassName)(t.name)),e}(0,Qde.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",gOe);var Pfe=l(R(),1),Rfe=l(ut(),1),Vc=l($(),1),Ofe=l(Z(),1),Rk=l(Hv(),1);var wz=l($(),1),FR=l(R(),1),bfe=l(F(),1);var bOe=l($(),1);var kOe=l(w(),1),Jde="typography.lineHeight";var efe=l(ut(),1),LR=l($(),1),tfe=l(QE(),1),ofe=l(A(),1);var j_="typography.__experimentalFontFamily",{kebabCase:vOe}=M(ofe.privateApis);function yOe(e){return(0,LR.hasBlockSupport)(e,j_)&&(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}})),e}function rfe(e,t,o){if(!(0,LR.hasBlockSupport)(t,j_)||Ue(t,ds,"fontFamily")||!o?.fontFamily)return e;let r=new tfe.default(e.className);r.add(`has-${vOe(o?.fontFamily)}-font-family`);let n=r.value;return e.className=n||void 0,e}function SOe({name:e,fontFamily:t}){return rfe({},e,{fontFamily:t})}var bz={useBlockProps:SOe,addSaveProps:rfe,attributeKeys:["fontFamily"],hasSupport(e){return(0,LR.hasBlockSupport)(e,j_)}};(0,efe.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",yOe);var kz=l(ut(),1),Tk=l($(),1),nfe=l(QE(),1);var _Oe=l(w(),1),xp="typography.fontSize";function xOe(e){return(0,Tk.hasBlockSupport)(e,xp)&&(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}})),e}function ife(e,t,o){if(!(0,Tk.hasBlockSupport)(t,xp)||Ue(t,ds,"fontSize"))return e;let r=new nfe.default(e.className);r.add(gu(o.fontSize));let n=r.value;return e.className=n||void 0,e}function wOe({name:e,fontSize:t,style:o}){let[r,n,i]=me("typography.fontSizes","typography.fluid","layout");if(!(0,Tk.hasBlockSupport)(e,xp)||Ue(e,ds,"fontSize")||!t&&!o?.typography?.fontSize)return;let s;if(o?.typography?.fontSize&&(s={style:{fontSize:tc({size:o.typography.fontSize},{typography:{fluid:n},layout:i})}}),t&&(s={style:{fontSize:rh(r,t,o?.typography?.fontSize).size}}),!!s)return ife(s,e,{fontSize:t})}var vz={useBlockProps:wOe,addSaveProps:ife,attributeKeys:["fontSize","style"],hasSupport(e){return(0,Tk.hasBlockSupport)(e,xp)}},COe={fontSize:[["fontSize"],["style","typography","fontSize"]]};function BOe(e,t,o,r){let n=e.name,i={fontSize:(0,Tk.hasBlockSupport)(n,xp)};return m2(i,COe,e,t,o,r)}(0,kz.addFilter)("blocks.registerBlockType","core/font/addAttribute",xOe);(0,kz.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",BOe);var NR=l(N(),1),Ik=l($(),1);var yz=l(w(),1),Pk="typography.textAlign",EOe=[{icon:eu,title:(0,NR.__)("Align text left"),align:"left"},{icon:_f,title:(0,NR.__)("Align text center"),align:"center"},{icon:tu,title:(0,NR.__)("Align text right"),align:"right"}],sfe=["left","center","right"],TOe=[];function Sz(e){return Array.isArray(e)?sfe.filter(t=>e.includes(t)):e===!0?sfe:TOe}function IOe({style:e,name:t,setAttributes:o}){let n=is(t)?.typography?.textAlign,i=ao();if(!n||i!=="default")return null;let s=Sz((0,Ik.getBlockSupport)(t,Pk));if(!s.length)return null;let a=EOe.filter(u=>s.includes(u.align)),c=u=>{let d={...e,typography:{...e?.typography,textAlign:u}};o({style:Me(d)})};return(0,yz.jsx)(Mt,{group:"block",children:(0,yz.jsx)(Kw,{value:e?.typography?.textAlign,onChange:c,alignmentControls:a})})}var MR={edit:IOe,useBlockProps:POe,addSaveProps:ROe,attributeKeys:["style"],hasSupport(e){return(0,Ik.hasBlockSupport)(e,Pk,!1)}};function POe({name:e,style:t}){if(!t?.typography?.textAlign||!Sz((0,Ik.getBlockSupport)(e,Pk)).length||Ue(e,ds,"textAlign"))return null;let r=t.typography.textAlign;return{className:V({[`has-text-align-${r}`]:r})}}function ROe(e,t,o){if(!o?.style?.typography?.textAlign)return e;let{textAlign:r}=o.style.typography,n=(0,Ik.getBlockSupport)(t,Pk);return Sz(n).includes(r)&&!Ue(t,ds,"textAlign")&&(e.className=V(`has-text-align-${r}`,e.className)),e}var xz=l(ut(),1),lf=l($(),1),wp=l(R(),1),pfe=l(F(),1),U_=l(N(),1),DR=l(A(),1),hfe=l(Z(),1);function OOe(e,t){let o=e.scrollHeight>e.clientHeight,r=0,n=2400,i=r,s=window.getComputedStyle(e),a=parseFloat(s.paddingLeft)||0,c=parseFloat(s.paddingRight)||0,u=document.createRange();u.selectNodeContents(e);let d=e,f=e.parentElement;if(f){let h=window.getComputedStyle(f);h?.display==="flex"&&(d=f,a+=parseFloat(h.paddingLeft)||0,c+=parseFloat(h.paddingRight)||0)}let m=d.clientHeight;for(;r<=n;){let h=Math.floor((r+n)/2);t(h);let g=u.getBoundingClientRect().width,b=e.scrollWidth<=d.clientWidth&&g<=d.clientWidth-a-c,v=o||e.scrollHeight<=d.clientHeight||e.scrollHeight<=m;d.clientHeight>m&&(m=d.clientHeight),b&&v?(i=h,r=h+1):n=h-1}return u.detach(),i}function afe(e,t){if(!e)return;t(0);let o=OOe(e,t);return t(o),o}var lfe=l(R(),1),cfe=l(N(),1),ufe=l(A(),1),dfe=l(Xo(),1),_z=l(w(),1);function ffe(){let e=(0,cfe.__)("The text may be too small to read. Consider using a larger container or less text.");return(0,lfe.useEffect)(()=>{(0,dfe.speak)(e)},[e]),(0,_z.jsx)("div",{className:"block-editor-fit-text-size-warning",children:(0,_z.jsx)(ufe.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:e})})}var Dn=l(w(),1),AOe={},LOe=12,Mc="typography.fitText";function NOe(e){return!(0,lf.hasBlockSupport)(e,Mc)||e.attributes?.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}}function MOe({fitText:e,name:t,clientId:o}){let[r,n]=(0,wp.useState)(null),i=(0,lf.hasBlockSupport)(t,Mc),s=Xe(o),{blockAttributes:a,parentId:c,blockMode:u}=(0,pfe.useSelect)(f=>{if(!o||!i||!e)return AOe;let m=f(_).getBlockMode(o);return m==="html"?{blockMode:m}:{blockAttributes:f(_).getBlockAttributes(o),parentId:f(_).getBlockRootClientId(o),blockMode:m}},[o,i,e]),d=(0,wp.useCallback)(()=>{if(!s||!i||!e)return;let f=`fit-text-${o}`,m=s.ownerDocument.getElementById(f);m||(m=s.ownerDocument.createElement("style"),m.id=f,s.ownerDocument.head.appendChild(m));let h=`#block-${o}`,g=afe(s,b=>{b===0?m.textContent="":m.textContent=`${h} { font-size: ${b}px !important; }`});n(g)},[s,o,i,e]);return(0,wp.useEffect)(()=>{if(!e||!s||!o||!i||u==="html")return;let f=s,m=f.style.visibility,h=null,p=null,g=null;h=window.requestAnimationFrame(()=>{f.style.visibility="hidden",p=window.requestAnimationFrame(()=>{d(),g=setTimeout(()=>{f.style.visibility=m},10)})});let b;return window.ResizeObserver&&f.parentElement&&(b=new window.ResizeObserver(d),b.observe(f.parentElement),b.observe(f)),()=>{h!==null&&window.cancelAnimationFrame(h),p!==null&&window.cancelAnimationFrame(p),g!==null&&clearTimeout(g),b&&b.disconnect();let v=`fit-text-${o}`,k=f.ownerDocument.getElementById(v);k&&k.remove()}},[e,o,c,d,s,i,u]),(0,wp.useEffect)(()=>{if(e&&s&&i&&u!=="html"){let f=window.requestAnimationFrame(()=>{s&&d()});return()=>window.cancelAnimationFrame(f)}},[a,e,d,s,i,u]),{fontSize:r}}function mfe({clientId:e,fitText:t=!1,setAttributes:o,name:r,fontSize:n,style:i,warning:s}){return(0,lf.hasBlockSupport)(r,Mc)?(0,Dn.jsx)(fe,{group:"typography",children:(0,Dn.jsxs)(DR.__experimentalToolsPanelItem,{hasValue:()=>t,label:(0,U_.__)("Fit text"),onDeselect:()=>o({fitText:void 0}),resetAllFilter:()=>({fitText:void 0}),panelId:e,children:[(0,Dn.jsx)(DR.ToggleControl,{label:(0,U_.__)("Fit text"),checked:t,onChange:()=>{let a=!t||void 0,c={fitText:a};a&&(n&&(c.fontSize=void 0),i?.typography?.fontSize&&(c.style={...i,typography:{...i?.typography,fontSize:void 0}})),o(c)},help:t?(0,U_.__)("Text will resize to fit its container."):(0,U_.__)("The text will resize to fit its container, resetting other font size settings.")}),s]})}):null}function DOe(e,t,o){if(!(0,lf.hasBlockSupport)(t,Mc))return e;let{fitText:r}=o;if(!r)return e;let n=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:n}}function VOe({name:e,fitText:t}){return t&&(0,lf.hasBlockSupport)(e,Mc)?{className:"has-fit-text"}:{}}(0,xz.addFilter)("blocks.registerBlockType","core/fit-text/addAttribute",NOe);var FOe=e=>(0,lf.hasBlockSupport)(e,Mc);function zOe({fitText:e,name:t,clientId:o,children:r}){let{fontSize:n}=MOe({fitText:e,name:t,clientId:o});return r(n)}var jOe=(0,hfe.createHigherOrderComponent)(e=>function(o){let{name:r,attributes:n,clientId:i,isSelected:s,setAttributes:a}=o,{fitText:c}=n;return(0,lf.hasBlockSupport)(r,Mc)?(0,Dn.jsxs)(Dn.Fragment,{children:[(0,Dn.jsx)(e,{...o}),c&&(0,Dn.jsx)(zOe,{fitText:c,name:r,clientId:i,children:d=>s&&(0,Dn.jsx)(mfe,{clientId:i,fitText:c,setAttributes:a,name:r,fontSize:n.fontSize,style:n.style,warning:dnull};var Cz=l(w(),1);function gfe(e,t){return Object.fromEntries(Object.entries(e).filter(([o])=>!t.includes(o)))}var UOe="typography.__experimentalLetterSpacing",HOe="typography.__experimentalTextTransform",GOe="typography.__experimentalTextDecoration",WOe="typography.textIndent",$Oe="typography.textColumns",KOe="typography.__experimentalFontStyle",YOe="typography.__experimentalFontWeight",qOe="typography.__experimentalWritingMode",ds="typography",kfe=[Jde,xp,KOe,YOe,j_,Pk,$Oe,GOe,WOe,qOe,HOe,UOe,Mc];function vfe(e){let t={...gfe(e,["fontFamily"])},o=e?.typography?.fontSize,r=e?.typography?.fontFamily,n=typeof o=="string"&&o?.startsWith("var:preset|font-size|")?o.substring(21):void 0,i=r?.startsWith("var:preset|font-family|")?r.substring(23):void 0;return t.typography={...gfe(t.typography,["fontFamily"]),fontSize:n?void 0:o},{style:Me(t),fontFamily:i,fontSize:n}}function yfe(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize}}}function ZOe({children:e,resetAllFilter:t}){let o=(0,FR.useCallback)(r=>{let n=yfe(r),i=t(n);return{...r,...vfe(i)}},[t]);return(0,Cz.jsx)(fe,{group:"typography",resetAllFilter:o,children:e})}function Sfe({clientId:e,name:t,setAttributes:o,settings:r}){let n=OP(r),{style:i,fontFamily:s,fontSize:a,fitText:c}=(0,bfe.useSelect)(m=>{if(!n)return{};let{style:h,fontFamily:p,fontSize:g,fitText:b}=m(_).getBlockAttributes(e)||{};return{style:h,fontFamily:p,fontSize:g,fitText:b}},[e,n]),u=(0,FR.useMemo)(()=>yfe({style:i,fontFamily:s,fontSize:a}),[i,a,s]),d=m=>{let h=vfe(m);(h.fontSize||h.style?.typography?.fontSize)&&c&&(h.fitText=void 0),o(h)};if(!n)return null;let f=(0,wz.getBlockSupport)(t,[ds,"__experimentalDefaultControls"]);return(0,Cz.jsx)(AP,{as:ZOe,panelId:e,settings:r,value:u,onChange:d,defaultControls:f})}var uf=l(R(),1),jR=l(F(),1),zR=l($(),1),Bfe=l(Re(),1);var ul=l(R(),1),_fe=l(eS(),1);var H_=l(w(),1);function xfe({clientId:e,value:t,computeStyle:o,forceShow:r}){let n=Xe(e),[i,s]=(0,ul.useReducer)(()=>o(n));(0,ul.useEffect)(()=>{n&&r&&s()},[n,r]),(0,ul.useEffect)(()=>{if(!n)return;let d=new window.MutationObserver(s);return d.observe(n,{attributes:!0,attributeFilter:["style","class"]}),()=>{d.disconnect()}},[n]);let a=(0,ul.useRef)(t),[c,u]=(0,ul.useState)(!1);return(0,ul.useEffect)(()=>{if((0,_fe.isShallowEqual)(t,a.current)||r)return;u(!0),a.current=t;let d=setTimeout(()=>{u(!1)},400);return()=>{u(!1),clearTimeout(d)}},[t,r]),!c&&!r?null:(0,H_.jsx)(Hi,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,H_.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})})}function cf(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function wfe({clientId:e,value:t,forceShow:o}){return(0,H_.jsx)(xfe,{clientId:e,value:t?.spacing?.margin,computeStyle:r=>{let n=cf(r,"margin-top"),i=cf(r,"margin-right"),s=cf(r,"margin-bottom"),a=cf(r,"margin-left");return{borderTopWidth:n,borderRightWidth:i,borderBottomWidth:s,borderLeftWidth:a,top:n?`-${n}`:0,right:i?`-${i}`:0,bottom:s?`-${s}`:0,left:a?`-${a}`:0}},forceShow:o})}function Cfe({clientId:e,value:t,forceShow:o}){return(0,H_.jsx)(xfe,{clientId:e,value:t?.spacing?.padding,computeStyle:r=>({borderTopWidth:cf(r,"padding-top"),borderRightWidth:cf(r,"padding-right"),borderBottomWidth:cf(r,"padding-bottom"),borderLeftWidth:cf(r,"padding-left")}),forceShow:o})}var Dc=l(w(),1),dl="dimensions",G_="spacing";function XOe(){let[e,t]=(0,uf.useState)(!1),{hideBlockInterface:o,showBlockInterface:r}=M((0,jR.useDispatch)(_));return(0,uf.useEffect)(()=>{e?o():r()},[e,r,o]),[e,t]}function QOe({children:e,resetAllFilter:t}){let o=(0,uf.useCallback)(r=>{let n=r.style,i=t(n);return{...r,style:i}},[t]);return(0,Dc.jsx)(fe,{group:"dimensions",resetAllFilter:o,children:e})}function Efe({clientId:e,name:t,setAttributes:o,settings:r}){let n=DP(r),i=(0,jR.useSelect)(m=>{if(n)return m(_).getBlockAttributes(e)?.style},[e,n]),[s,a]=XOe(),c=m=>{o({style:Me(m)})};if(!n)return null;let u=(0,zR.getBlockSupport)(t,[dl,"__experimentalDefaultControls"]),d=(0,zR.getBlockSupport)(t,[G_,"__experimentalDefaultControls"]),f={...u,...d};return(0,Dc.jsxs)(Dc.Fragment,{children:[(0,Dc.jsx)(VP,{as:QOe,panelId:e,settings:r,value:i,onChange:c,defaultControls:f,onVisualize:a}),!!r?.spacing?.padding&&s==="padding"&&(0,Dc.jsx)(Cfe,{forceShow:s==="padding",clientId:e,value:i}),!!r?.spacing?.margin&&s==="margin"&&(0,Dc.jsx)(wfe,{forceShow:s==="margin",clientId:e,value:i})]})}function Tfe(e,t="any"){if(uf.Platform.OS!=="web")return!1;let o=(0,zR.getBlockSupport)(e,dl);return o===!0?!0:t==="any"?!!(o?.aspectRatio||o?.height||o?.minHeight||o?.width):!!o?.[t]}var Ife={useBlockProps:JOe,attributeKeys:["height","minHeight","width","style"],hasSupport(e){return Tfe(e)}};function JOe({name:e,height:t,minHeight:o,style:r}){if(!Tfe(e,"aspectRatio")||Ue(e,dl,"aspectRatio"))return{};let n=V({"has-aspect-ratio":!!r?.dimensions?.aspectRatio}),i={};return r?.dimensions?.aspectRatio?(i.minHeight="unset",i.height="unset"):(o||r?.dimensions?.minHeight||t||r?.dimensions?.height)&&(i.aspectRatio="unset"),{className:n,style:i}}function Bz(){(0,Bfe.default)("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}var fl=l(w(),1),eAe=[...kfe,up,ir,dl,dp,G_,__],Tz=e=>eAe.some(t=>(0,Vc.hasBlockSupport)(e,t));function bi(e={}){let t={};return(0,Rk.getCSSRules)(e).forEach(o=>{t[o.key]=o.value}),t}function tAe(e){return!Tz(e)&&!(0,Vc.hasBlockSupport)(e,"customCSS",!0)||e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e}var Afe={[`${up}.__experimentalSkipSerialization`]:["border"],[`${ir}.__experimentalSkipSerialization`]:[ir],[`${ds}.__experimentalSkipSerialization`]:[ds],[`${dl}.__experimentalSkipSerialization`]:[dl],[`${G_}.__experimentalSkipSerialization`]:[G_],[`${__}.__experimentalSkipSerialization`]:[__]},oAe={...Afe,[`${dl}.aspectRatio`]:[`${dl}.aspectRatio`],[`${dp}`]:[dp]},rAe={[`${dl}.aspectRatio`]:!0,[`${dp}`]:!0},nAe={gradients:"gradient"};function Ez(e,t,o=!1){if(!e)return e;let r=e;return o||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach(n=>{if(Array.isArray(n)||(n=n.split(".")),n.length>1){let[i,...s]=n;Ez(r[i],[s],!0)}else n.length===1&&delete r[n[0]]}),r}function Lfe(e,t,o,r=oAe){if(!Tz(t))return e;let{style:n}=o;return Object.entries(r).forEach(([i,s])=>{let a=rAe[i]||(0,Vc.getBlockSupport)(t,i);a===!0&&(n=Ez(n,s)),Array.isArray(a)&&a.forEach(c=>{let u=nAe[c]||c;n=Ez(n,[[...s,u]])})}),e.style={...bi(n),...e.style},e}function iAe({clientId:e,name:t,setAttributes:o,__unstableParentLayout:r}){let n=is(t,r),i=ao(),s={clientId:e,name:t,setAttributes:o,settings:{...n,typography:{...n.typography,textAlign:!1}}};return i!=="default"?null:(0,fl.jsxs)(fl.Fragment,{children:[(0,fl.jsx)(f2,{...s}),(0,fl.jsx)(yae,{...s}),(0,fl.jsx)(Sfe,{...s}),(0,fl.jsx)(hae,{...s}),(0,fl.jsx)(Efe,{...s})]})}var UR={edit:iAe,hasSupport:Tz,addSaveProps:Lfe,attributeKeys:["style"],useBlockProps:lAe},sAe=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],aAe={};function lAe({name:e,style:t}){let o=(0,Ofe.useInstanceId)(aAe,"wp-elements"),r=`.${o}`,n=t?.elements,i=(0,Pfe.useMemo)(()=>{if(!n)return;let s=[];return sAe.forEach(({elementType:a,pseudo:c,elements:u})=>{if(Ue(e,ir,a))return;let f=n?.[a];if(f){let m=kg(r,Vc.__EXPERIMENTAL_ELEMENTS[a]);s.push((0,Rk.compileCSS)(f,{selector:m})),c&&c.forEach(h=>{f[h]&&s.push((0,Rk.compileCSS)(f[h],{selector:kg(r,`${Vc.__EXPERIMENTAL_ELEMENTS[a]}${h}`)}))})}u&&u.forEach(m=>{n[m]&&s.push((0,Rk.compileCSS)(n[m],{selector:kg(r,Vc.__EXPERIMENTAL_ELEMENTS[m])}))})}),s.length>0?s.join(""):void 0},[r,n,e]);return Qn({css:i}),Lfe({className:o},e,{style:t},Afe)}(0,Rfe.addFilter)("blocks.registerBlockType","core/style/addAttribute",tAe);var Nfe=l(ut(),1),Mfe=l($(),1),cAe=e=>(0,Mfe.hasBlockSupport)(e,"__experimentalSettings",!1);function uAe(e){return cAe(e)&&(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}})),e}(0,Nfe.addFilter)("blocks.registerBlockType","core/settings/addAttribute",uAe);var df=l($(),1),Ffe=l(Z(),1),zfe=l(ut(),1),W_=l(R(),1);function dAe(e=[]){let t={r:[],g:[],b:[],a:[]};return e.forEach(o=>{let r=Bt(o).toRgb();t.r.push(r.r/255),t.g.push(r.g/255),t.b.push(r.b/255),t.a.push(r.a)}),t}function Dfe(e){return`${e}{filter:none}`}function Vfe(e,t){return`${e}{filter:url(#${t})}`}function HR(e,t){let o=dAe(t);return` `}var Fc=l(w(),1),Iz=[],fAe=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");Yc([qc]);function Pz({presetSetting:e,defaultSetting:t}){let[o,r,n,i]=me(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,W_.useMemo)(()=>[...r||Iz,...n||Iz,...o&&i||Iz],[o,r,n,i])}function jfe(e,t){if(!e)return;let o=t?.find(({slug:r})=>e===`var:preset|duotone|${r}`);return o?o.colors:void 0}function mAe(e,t){if(!e||!Array.isArray(e))return;let o=t?.find(r=>r?.colors?.every((n,i)=>n===e[i]));return o?`var:preset|duotone|${o.slug}`:void 0}function pAe({style:e,setAttributes:t,name:o}){let r=e?.color?.duotone,n=is(o),i=ao(),s=Pz({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Pz({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[c,u]=me("color.custom","color.customDuotone"),d=!c,f=!u||a?.length===0&&d;if(s?.length===0&&f||i!=="default")return null;let m=r==="unset"||Array.isArray(r)?r:jfe(r,s);return(0,Fc.jsxs)(Fc.Fragment,{children:[(0,Fc.jsx)(fe,{group:"filter",children:(0,Fc.jsx)(YP,{value:{filter:{duotone:m}},onChange:h=>{let p={...e,color:{...h?.filter}};t({style:Me(p)})},settings:n})}),(0,Fc.jsx)(Mt,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Fc.jsx)(tI,{duotonePalette:s,colorPalette:a,disableCustomDuotone:f,disableCustomColors:d,value:m,onChange:h=>{let p=mAe(h,s),g={...e,color:{...e?.color,duotone:p??h}};t({style:Me(g)})},settings:n})})]})}var Rz={shareWithChildBlocks:!0,edit:pAe,useBlockProps:kAe,attributeKeys:["style"],hasSupport(e){return(0,df.hasBlockSupport)(e,"filter.duotone")}};function hAe(e){return(0,df.hasBlockSupport)(e,"filter.duotone")&&(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}})),e}function gAe({clientId:e,id:t,selector:o,attribute:r}){let n=Pz({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(r),s=i?void 0:jfe(r,n),a=typeof r=="string"&&s,c=typeof r=="string"&&!a,u=null;a?u=s:(c||i)&&(u=r);let m=o.split(",").map(g=>`.${t}${g.trim()}`).join(", "),h=Array.isArray(u)||u==="unset";oc(h?{css:u!=="unset"?Vfe(m,t):Dfe(m),__unstableType:"presets"}:void 0),oc(h?{assets:u!=="unset"?HR(t,u):"",__unstableType:"svgs"}:void 0);let p=Xe(e);(0,W_.useEffect)(()=>{if(h&&p&&fAe){let g=p.style.display;p.style.setProperty("display","inline-block"),p.offsetHeight,p.style.setProperty("display",g)}},[h,p,u])}var bAe={};function kAe({clientId:e,name:t,style:o}){let r=(0,Ffe.useInstanceId)(bAe),n=(0,W_.useMemo)(()=>{let c=(0,df.getBlockType)(t);if(c){if(!(0,df.getBlockSupport)(c,"filter.duotone",!1))return null;let d=(0,df.getBlockSupport)(c,"color.__experimentalDuotone",!1);if(d){let f=oi(c);return typeof d=="string"?kg(f,d):f}return oi(c,"filter.duotone",{fallback:!0})}},[t]),i=o?.color?.duotone,s=`wp-duotone-${r}`,a=n&&i;return gAe({clientId:e,id:s,selector:n,attribute:i}),{className:a?s:""}}(0,zfe.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",hAe);var WR=l(R(),1),$_=l(F(),1),Ufe=l(Z(),1),K_=l($(),1),Y_=l(N(),1);var Hfe=l(Un(),1);var GR=l(w(),1),vAe={},yAe={};function SAe({blockName:e,setAttributes:t,style:o}){if(ao()!=="default")return null;let n=(0,K_.getBlockType)(e);function i(a){let c=a?.css?.trim()?a.css:void 0;t({style:Me({...a,css:c})})}let s=(0,Y_.sprintf)((0,Y_.__)("Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value, e.g. color: red;."),n?.title);return(0,GR.jsx)(fe,{group:"advanced",children:(0,GR.jsx)(XP,{value:o,onChange:i,inheritedValue:o,help:s})})}var _Ae="custom-css-edit-warning";function xAe({clientId:e,name:t,setAttributes:o}){let{style:r,canEditCSS:n}=(0,$_.useSelect)(i=>{let{getBlockAttributes:s,getSettings:a}=i(_);return{style:s(e)?.style||yAe,canEditCSS:a().canEditCSS}},[e]);return n?(0,GR.jsx)(SAe,{blockName:t,setAttributes:o,style:r}):null}function wAe({style:e}){let t=e?.css,o=typeof t=="string"&&t.trim().length>0&&ZP(t),r=(0,$_.useSelect)(u=>u(_).getSettings().canEditCSS,[]),{createWarningNotice:n}=(0,$_.useDispatch)(Hfe.store),i=!!t?.trim();(0,WR.useEffect)(()=>{!r&&i&&n((0,Y_.__)("This post contains blocks with custom CSS. You do not have permission to edit CSS. If you save this post, the custom CSS will be removed."),{id:_Ae,isDismissible:!0})},[r,i,n]);let s=(0,Ufe.useInstanceId)(vAe,"wp-custom-css"),a=`.${s}`,c=(0,WR.useMemo)(()=>{if(o)return BS(t,a)},[t,a,o]);return Qn({css:c}),o?{className:`has-custom-css ${s}`}:{}}function CAe(e,t,o){if(!(0,K_.hasBlockSupport)(t,"customCSS",!0)||!o?.style?.css?.trim())return e;let r=e.className?`${e.className} has-custom-css`:"has-custom-css";return{...e,className:r}}var $R={edit:xAe,useBlockProps:wAe,addSaveProps:CAe,attributeKeys:["style"],hasSupport(e){return(0,K_.hasBlockSupport)(e,"customCSS",!0)}};var KR=l(Z(),1),Az=l(ut(),1),zc=l($(),1),YR=l(F(),1),ml=l(A(),1),Ok=l(N(),1);var Yo=l(w(),1),BAe="is-style-",Lz="layout",{kebabCase:Oz}=M(ml.privateApis);function Nz(e){return(0,zc.hasBlockSupport)(e,"layout")||(0,zc.hasBlockSupport)(e,"__experimentalLayout")}function qR(e={},t=""){let{layout:o}=e,{default:r}=(0,zc.getBlockSupport)(t,Lz)||{},n=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||r||{},i=[];if(Hn[n?.type||"default"]?.className){let a=Hn[n?.type||"default"]?.className,c=t.split("/"),d=`wp-block-${c[0]==="core"?c.pop():c.join("-")}-${a}`;i.push(a,d)}return(0,YR.useSelect)(a=>!n?.inherit&&!n?.contentSize&&n?.type!=="constrained"?!1:a(_).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[n?.contentSize,n?.inherit,n?.type])&&i.push("has-global-padding"),n?.orientation&&i.push(`is-${Oz(n.orientation)}`),n?.justifyContent&&i.push(`is-content-justification-${Oz(n.justifyContent)}`),n?.flexWrap&&n.flexWrap==="nowrap"&&i.push("is-nowrap"),i}function Mz(e={},t,o){let{layout:r={},style:n={}}=e,i=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||{},s=ws(i?.type||"default"),[a]=me("spacing.blockGap"),c=a!==null;return s?.getLayoutStyle?.({blockName:t,selector:o,layout:r,style:n,hasBlockGapSupport:c})}function EAe({layout:e,setAttributes:t,name:o,clientId:r}){let n=is(o),{layout:i}=n,{themeSupportsLayout:s}=(0,YR.useSelect)(T=>{let{getSettings:O}=T(_);return{themeSupportsLayout:O().supportsLayout}},[]);if(ao()!=="default")return null;let c=(0,zc.getBlockSupport)(o,Lz,{}),u={...i,...c},{allowSwitching:d,allowEditing:f=!0,allowInheriting:m=!0,default:h}=u;if(!f)return null;let p={...c,...e},{type:g,default:{type:b="default"}={}}=p,v=g||b,k=!!(m&&(!v||v==="default"||v==="constrained"||p.inherit)),y=e||h||{},{inherit:S=!1,contentSize:x=null}=y;if((v==="default"||v==="constrained")&&!s)return null;let C=ws(v),B=ws("constrained"),I=!y.type&&(x||S),P=!!S||!!x,E=T=>t({layout:{type:T}}),L=T=>t({layout:T});return(0,Yo.jsxs)(Yo.Fragment,{children:[(0,Yo.jsx)(fe,{children:(0,Yo.jsxs)(ml.PanelBody,{title:(0,Ok.__)("Layout"),children:[k&&(0,Yo.jsx)(Yo.Fragment,{children:(0,Yo.jsx)(ml.ToggleControl,{label:(0,Ok.__)("Inner blocks use content width"),checked:C?.name==="constrained"||P,onChange:()=>t({layout:{type:C?.name==="constrained"||P?"default":"constrained"}}),help:C?.name==="constrained"||P?(0,Ok.__)("Nested blocks use content width with options for full and wide widths."):(0,Ok.__)("Nested blocks will fill the width of this container.")})}),!S&&d&&(0,Yo.jsx)(TAe,{type:v,onChange:E}),C&&C.name!=="default"&&(0,Yo.jsx)(C.inspectorControls,{layout:y,onChange:L,layoutBlockSupport:u,name:o,clientId:r}),B&&I&&(0,Yo.jsx)(B.inspectorControls,{layout:y,onChange:L,layoutBlockSupport:u,name:o,clientId:r})]})}),!S&&C&&(0,Yo.jsx)(C.toolBarControls,{layout:y,onChange:L,layoutBlockSupport:c,name:o,clientId:r})]})}var Gfe={shareWithChildBlocks:!0,edit:EAe,attributeKeys:["layout"],hasSupport(e){return Nz(e)}};function TAe({type:e,onChange:t}){return(0,Yo.jsx)(ml.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,Ok.__)("Layout type"),hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:mH().map(({name:o,label:r})=>(0,Yo.jsx)(ml.__experimentalToggleGroupControlOption,{value:o,label:r},o))})}function IAe(e){return"type"in(e.attributes?.layout??{})||Nz(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}function PAe({block:e,props:t,blockGapSupport:o,globalBlockGapValue:r,layoutClasses:n}){let{name:i,attributes:s}=t,a=(0,KR.useInstanceId)(e),{layout:c}=s,{default:u}=(0,zc.getBlockSupport)(i,Lz)||{},d=c?.inherit||c?.contentSize||c?.wideSize?{...c,type:"constrained"}:c||u||{},f=`wp-container-${Oz(i)}-is-layout-`,m=`.${f}${a}`,h=o!==null,g=ws(d?.type||"default")?.getLayoutStyle?.({blockName:i,selector:m,layout:d,style:s?.style,hasBlockGapSupport:h,globalBlockGapValue:r}),b=V({[`${f}${a}`]:!!g},n);return Qn({css:g}),(0,Yo.jsx)(e,{...t,__unstableLayoutClassNames:b})}var RAe=(0,KR.createHigherOrderComponent)(e=>function(o){let{clientId:r,name:n,attributes:i}=o,s=Nz(n),a=qR(i,n),c=(0,YR.useSelect)(u=>{if(!s)return;let{getSettings:d,getBlockSettings:f}=M(u(_)),m=d(),{disableLayoutStyles:h}=m;if(h)return;let[p]=f(r,"spacing.blockGap"),g=m[xi],b,v=i?.className;if(v?.includes(BAe)){let{getBlockStyles:y}=u(zc.store),S=y(n),x=UV(v,S);b=x?g?.blocks?.[n]?.variations?.[x]?.spacing?.blockGap:void 0}let k=b??g?.blocks?.[n]?.spacing?.blockGap??g?.spacing?.blockGap;return{blockGapSupport:p,globalBlockGapValue:k}},[s,r,i?.className,n]);return c?(0,Yo.jsx)(PAe,{block:e,props:o,layoutClasses:a,...c}):(0,Yo.jsx)(e,{...o,__unstableLayoutClassNames:s?a:void 0})},"withLayoutStyles");(0,Az.addFilter)("blocks.registerBlockType","core/layout/addAttribute",IAe);(0,Az.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",RAe);var Qfe=l(Z(),1),jz=l(F(),1),Jfe=l(R(),1);var fs=l(R(),1),ff=l(F(),1),$fe=l(Z(),1);function Z_(e,t){return Array.from({length:t},(o,r)=>e+r)}var la=class{constructor({columnStart:e,rowStart:t,columnEnd:o,rowEnd:r,columnSpan:n,rowSpan:i}={}){this.columnStart=e??1,this.rowStart=t??1,n!==void 0?this.columnEnd=this.columnStart+n-1:this.columnEnd=o??this.columnStart,i!==void 0?this.rowEnd=this.rowStart+i-1:this.rowEnd=r??this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(e,t){return e>=this.columnStart&&e<=this.columnEnd&&t>=this.rowStart&&t<=this.rowEnd}containsRect(e){return this.contains(e.columnStart,e.rowStart)&&this.contains(e.columnEnd,e.rowEnd)}intersectsRect(e){return this.columnStart<=e.columnEnd&&this.columnEnd>=e.columnStart&&this.rowStart<=e.rowEnd&&this.rowEnd>=e.rowStart}};function Bo(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function q_(e,t){let o=[];for(let r of e.split(" ")){let n=o[o.length-1],i=n?n.end+t:0,s=i+parseFloat(r);o.push({start:i,end:s})}return o}function jc(e,t,o="start"){return e.reduce((r,n,i)=>Math.abs(n[o]-t)a(_).getSettings().isDistractionFree,[]),i=Xe(e);if(n||!i)return null;let s=o?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return(0,ki.jsx)(AAe,{gridClientId:e,gridElement:i,isManualGrid:s,ref:t,childGridClientId:r})}var AAe=(0,fs.forwardRef)(({gridClientId:e,gridElement:t,isManualGrid:o,childGridClientId:r},n)=>{let[i,s]=(0,fs.useState)(()=>Dz(t)),[a,c]=(0,fs.useState)(!1),u=Xe(r),d=(0,fs.useMemo)(()=>u?Wfe(u):null,[u]);return(0,fs.useEffect)(()=>{let f=()=>s(Dz(t)),m=new window.ResizeObserver(f);m.observe(t,{box:"border-box"});let h=new window.ResizeObserver(f);return h.observe(t),()=>{m.disconnect(),h.disconnect()}},[t]),(0,fs.useEffect)(()=>{function f(){c(!0)}function m(){c(!1)}return document.addEventListener("drag",f),document.addEventListener("dragend",m),()=>{document.removeEventListener("drag",f),document.removeEventListener("dragend",m)}},[]),(0,ki.jsx)(Hi,{className:V("block-editor-grid-visualizer",{"is-dropping-allowed":a}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,ki.jsx)("div",{ref:n,className:"block-editor-grid-visualizer__grid",style:i.style,children:o?(0,ki.jsx)(NAe,{gridClientId:e,gridInfo:i,childGridRect:d}):(0,ki.jsx)(LAe,{gridInfo:i,childGridRect:d})})})});function LAe({gridInfo:e,childGridRect:t}){return Z_(1,e.numRows).map(o=>Z_(1,e.numColumns).map(r=>{let n=e.currentColor;return t?.contains(r,o)&&(n="transparent"),(0,ki.jsx)(Kfe,{color:n},`${o}-${r}`)}))}function NAe({gridClientId:e,gridInfo:t,childGridRect:o}){let[r,n]=(0,fs.useState)(null),i=(0,ff.useSelect)(a=>{let{getBlockOrder:c,getBlockStyles:u}=M(a(_)),d=c(e);return u(d)},[e]),s=(0,fs.useMemo)(()=>{let a=[];for(let c of Object.values(i)){let{columnStart:u,rowStart:d,columnSpan:f=1,rowSpan:m=1}=c?.layout??{};!u||!d||a.push(new la({columnStart:u,rowStart:d,columnSpan:f,rowSpan:m}))}return a},[i]);return Z_(1,t.numRows).map(a=>Z_(1,t.numColumns).map(c=>{let u=o?.contains(c,a),d=t.currentColor;u&&(d="transparent");let f=s.some(h=>h.contains(c,a)),m=r?.contains(c,a)??!1;return(0,ki.jsx)(Kfe,{color:d,className:m&&"is-highlighted",children:f&&!u?(0,ki.jsx)(MAe,{column:c,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n}):(0,ki.jsx)(DAe,{column:c,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n})},`${a}-${c}`)}))}function Kfe({color:e,children:t,className:o}){return(0,ki.jsx)("div",{className:V("block-editor-grid-visualizer__cell",o),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function Yfe(e,t,o,r,n){let{getBlockAttributes:i,getBlockRootClientId:s,canInsertBlockType:a,getBlockName:c}=(0,ff.useSelect)(_),{updateBlockAttributes:u,moveBlocksToPosition:d,__unstableMarkNextChangeAsNotPersistent:f}=(0,ff.useDispatch)(_),m=ip(o,r.numColumns);return VAe({validateDrag(h){let p=c(h);if(!a(p,o))return!1;let g=i(h),b=new la({columnStart:e,rowStart:t,columnSpan:g.style?.layout?.columnSpan,rowSpan:g.style?.layout?.rowSpan});return new la({columnSpan:r.numColumns,rowSpan:r.numRows}).containsRect(b)},onDragEnter(h){let p=i(h);n(new la({columnStart:e,rowStart:t,columnSpan:p.style?.layout?.columnSpan,rowSpan:p.style?.layout?.rowSpan}))},onDragLeave(){n(h=>h?.columnStart===e&&h?.rowStart===t?null:h)},onDrop(h){n(null);let p=i(h);u(h,{style:{...p.style,layout:{...p.style?.layout,columnStart:e,rowStart:t}}}),f(),d([h],s(h),o,m(e,t))}})}function MAe({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){return(0,ki.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:Yfe(e,t,o,r,n)})}function DAe({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){let{updateBlockAttributes:i,moveBlocksToPosition:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,ff.useDispatch)(_),c=ip(o,r.numColumns);return(0,ki.jsx)(Ju,{rootClientId:o,className:"block-editor-grid-visualizer__appender",ref:Yfe(e,t,o,r,n),style:{color:r.currentColor},onSelect:u=>{u&&(i(u.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),a(),s([u.clientId],o,o,c(e,t)))}})}function VAe({validateDrag:e,onDragEnter:t,onDragLeave:o,onDrop:r}){let{getDraggedBlockClientIds:n}=(0,ff.useSelect)(_);return(0,$fe.__experimentalUseDropZone)({onDragEnter(){let[i]=n();i&&e(i)&&t(i)},onDragLeave(){o()},onDrop(){let[i]=n();i&&e(i)&&r(i)}})}var qfe=l(A(),1),Q_=l(R(),1);var ZR=l(w(),1);function Vz({clientId:e,bounds:t,onChange:o,parentLayout:r}){let n=Xe(e),i=n?.parentElement,{isManualPlacement:s}=r;return!n||!i?null:(0,ZR.jsx)(FAe,{clientId:e,bounds:t,blockElement:n,rootBlockElement:i,onChange:o,isManualGrid:s&&window.__experimentalEnableGridInteractivity})}function FAe({clientId:e,bounds:t,blockElement:o,rootBlockElement:r,onChange:n,isManualGrid:i}){let[s,a]=(0,Q_.useState)(null),[c,u]=(0,Q_.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,Q_.useEffect)(()=>{let h=new window.ResizeObserver(()=>{let p=o.getBoundingClientRect(),g=r.getBoundingClientRect(),b=p.top>g.top,v=p.bottomg.left,y=p.righth.disconnect()},[o,r,i]);let d={right:"left",left:"right"},f={top:"flex-end",bottom:"flex-start"},m={display:"flex",justifyContent:"center",alignItems:"center",...d[s]&&{justifyContent:d[s]},...f[s]&&{alignItems:f[s]}};return(0,ZR.jsx)(Hi,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:m,children:(0,ZR.jsx)(qfe.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:c.bottom,bottomLeft:!1,bottomRight:!1,left:c.left,right:c.right,top:c.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:h,pointerId:p})=>{h.setPointerCapture(p)},onResizeStart:(h,p)=>{a(p)},onResizeStop:(h,p,g)=>{let b=parseFloat(Bo(r,"column-gap")),v=parseFloat(Bo(r,"row-gap")),k=q_(Bo(r,"grid-template-columns"),b),y=q_(Bo(r,"grid-template-rows"),v),S=new window.DOMRect(o.offsetLeft+g.offsetLeft,o.offsetTop+g.offsetTop,g.offsetWidth,g.offsetHeight),x=jc(k,S.left)+1,C=jc(y,S.top)+1,B=jc(k,S.right,"end")+1,I=jc(y,S.bottom,"end")+1;n({columnSpan:B-x+1,rowSpan:I-C+1,columnStart:i?x:void 0,rowStart:i?C:void 0})}})})}var ms=l(N(),1),Ak=l(A(),1);var Zfe=l(F(),1),Xfe=l(Z(),1);var Lr=l(w(),1);function Fz({layout:e,parentLayout:t,onChange:o,gridClientId:r,blockClientId:n}){let{moveBlocksToPosition:i,__unstableMarkNextChangeAsNotPersistent:s}=(0,Zfe.useDispatch)(_),a=e?.columnStart??1,c=e?.rowStart??1,u=e?.columnSpan??1,d=e?.rowSpan??1,f=a+u-1,m=c+d-1,h=t?.columnCount,p=t?.rowCount,g=ip(r,h);return(0,Lr.jsx)(Mt,{group:"parent",children:(0,Lr.jsxs)(Ak.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,Lr.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,Lr.jsx)(J_,{icon:(0,ms.isRTL)()?Vo:Nr,label:(0,ms.__)("Move left"),description:(0,ms.__)("Move left"),isDisabled:a<=1,onClick:()=>{o({columnStart:a-1}),s(),i([n],r,r,g(a-1,c))}})}),(0,Lr.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,Lr.jsx)(J_,{className:"is-up-button",icon:wf,label:(0,ms.__)("Move up"),description:(0,ms.__)("Move up"),isDisabled:c<=1,onClick:()=>{o({rowStart:c-1}),s(),i([n],r,r,g(a,c-1))}}),(0,Lr.jsx)(J_,{className:"is-down-button",icon:zn,label:(0,ms.__)("Move down"),description:(0,ms.__)("Move down"),isDisabled:p&&m>=p,onClick:()=>{o({rowStart:c+1}),s(),i([n],r,r,g(a,c+1))}})]}),(0,Lr.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,Lr.jsx)(J_,{icon:(0,ms.isRTL)()?Nr:Vo,label:(0,ms.__)("Move right"),description:(0,ms.__)("Move right"),isDisabled:h&&f>=h,onClick:()=>{o({columnStart:a+1}),s(),i([n],r,r,g(a+1,c))}})})]})})}function J_({className:e,icon:t,label:o,isDisabled:r,onClick:n,description:i}){let a=`block-editor-grid-item-mover-button__description-${(0,Xfe.useInstanceId)(J_)}`;return(0,Lr.jsxs)(Lr.Fragment,{children:[(0,Lr.jsx)(Ak.ToolbarButton,{className:V("block-editor-grid-item-mover-button",e),icon:t,label:o,"aria-describedby":a,onClick:r?null:n,disabled:r,accessibleWhenDisabled:!0}),(0,Lr.jsx)(Ak.VisuallyHidden,{id:a,children:i})]})}var e0=l(F(),1),QR=l(R(),1),XR=l(Z(),1);function zz({clientId:e}){let{gridLayout:t,blockOrder:o,selectedBlockLayout:r}=(0,e0.useSelect)(m=>{let{getBlockAttributes:h,getBlockOrder:p}=m(_),g=m(_).getSelectedBlock();return{gridLayout:h(e).layout??{},blockOrder:p(e),selectedBlockLayout:g?.attributes.style?.layout}},[e]),{getBlockAttributes:n,getBlockRootClientId:i}=(0,e0.useSelect)(_),{updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,e0.useDispatch)(_),c=(0,QR.useMemo)(()=>r?new la(r):null,[r]),u=(0,XR.usePrevious)(c),d=(0,XR.usePrevious)(t.isManualPlacement),f=(0,XR.usePrevious)(o);(0,QR.useEffect)(()=>{let m={};if(t.isManualPlacement){let h=[];for(let g of o){let{columnStart:b,rowStart:v,columnSpan:k=1,rowSpan:y=1}=n(g).style?.layout??{};!b||!v||h.push(new la({columnStart:b,rowStart:v,columnSpan:k,rowSpan:y}))}for(let g of o){let b=n(g),{columnStart:v,rowStart:k,columnSpan:y=1,rowSpan:S=1}=b.style?.layout??{};if(v&&k)continue;let[x,C]=zAe(h,t.columnCount,y,S,u?.columnEnd,u?.rowEnd);h.push(new la({columnStart:x,rowStart:C,columnSpan:y,rowSpan:S})),m[g]={style:{...b.style,layout:{...b.style?.layout,columnStart:x,rowStart:C}}}}let p=Math.max(...h.map(g=>g.rowEnd));(!t.rowCount||t.rowCountu.intersectsRect(c)))return[a,s]}}var Uc=l(w(),1),jAe={};function UAe({style:e}){let t=(0,jz.useSelect)(g=>!g(_).getSettings().disableLayoutStyles),o=e?.layout??{},{selfStretch:r,flexSize:n,columnStart:i,rowStart:s,columnSpan:a,rowSpan:c}=o,u=Hf()||{},{columnCount:d,minimumColumnWidth:f}=u,m=(0,Qfe.useInstanceId)(jAe),h=`.wp-container-content-${m}`,p="";if(t&&(r==="fixed"&&n?p=`${h} { flex-basis: ${n}; box-sizing: border-box; }`:r==="fill"?p=`${h} { flex-grow: 1; }`:i&&a?p=`${h} { grid-column: ${i} / span ${a}; }`:i?p=`${h} { grid-column: ${i}; }`:a&&(p=`${h} { grid-column: span ${a}; }`),s&&c?p+=`${h} { grid-row: ${s} / span ${c}; }`:s?p+=`${h} { grid-row: ${s}; }`:c&&(p+=`${h} { grid-row: span ${c}; }`),(a||i)&&(f||!d))){let g=parseFloat(f);isNaN(g)&&(g=12);let b=f?.replace(g,"");["px","rem","em"].includes(b)||(b="rem");let v=2;a&&i?v=a+i-1:a?v=a:v=i;let k=b==="px"?24:1.5,y=v*g+(v-1)*k,S=g*2+k-1,x=a&&a>1?"1/-1":"auto";p+=`@container (max-width: ${Math.max(y,S)}${b}) { ${h} { grid-column: ${x}; grid-row: auto; } }`}if(Qn({css:p}),!!p)return{className:`wp-container-content-${m}`}}function HAe({clientId:e,style:t,setAttributes:o}){let r=Hf()||{},{type:n="default",allowSizingOnChildren:i=!1,isManualPlacement:s}=r;return n!=="grid"?null:(0,Uc.jsx)(GAe,{clientId:e,style:t,setAttributes:o,allowSizingOnChildren:i,isManualPlacement:s,parentLayout:r})}function GAe({clientId:e,style:t,setAttributes:o,allowSizingOnChildren:r,isManualPlacement:n,parentLayout:i}){let{rootClientId:s,isVisible:a,parentBlockVisibility:c,blockBlockVisibility:u,deviceType:d,isChildBlockAGrid:f}=(0,jz.useSelect)(y=>{let{getBlockRootClientId:S,getBlockEditingMode:x,getTemplateLock:C,getBlockAttributes:B,getSettings:I}=y(_),P=S(e);if(C(P)||x(P)!=="default")return{rootClientId:P,isVisible:!1};let E=B(P),L=B(e),T=I();return{rootClientId:P,isVisible:!0,parentBlockVisibility:E?.metadata?.blockVisibility,blockBlockVisibility:L?.metadata?.blockVisibility,deviceType:T?.[wi]?.toLowerCase()||Et.desktop.value,isChildBlockAGrid:L?.layout?.type==="grid"}},[e]),{isBlockCurrentlyHidden:m}=Mi({blockVisibility:c,deviceType:d}),{isBlockCurrentlyHidden:h}=Mi({blockVisibility:u,deviceType:d}),[p,g]=(0,Jfe.useState)(),b=f?e:void 0;if(!a||m)return null;let v=r&&!h;function k(y){o({style:{...t,layout:{...t?.layout,...y}}})}return(0,Uc.jsxs)(Uc.Fragment,{children:[(0,Uc.jsx)(X_,{clientId:s,contentRef:g,parentLayout:i,childGridClientId:b}),v&&(0,Uc.jsx)(Vz,{clientId:e,bounds:p,onChange:k,parentLayout:i}),n&&window.__experimentalEnableGridInteractivity&&(0,Uc.jsx)(Fz,{layout:t?.layout,parentLayout:i,onChange:k,gridClientId:s,blockClientId:e})]})}var Uz={useBlockProps:UAe,edit:HAe,attributeKeys:["style"],hasSupport(){return!0}};var Gz=l(ut(),1),Hz=l($(),1),eme="metadata";function WAe(e){return e?.attributes?.[eme]?.type||(e.attributes={...e.attributes,[eme]:{type:"object"}}),e}function $Ae(e,t,o,r){if(r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length)return e;let n=t[o]?.attributes?.metadata;if(!n)return e;let i={};return n.noteId&&!e.attributes?.metadata?.noteId&&(i.noteId=n.noteId),n.name&&!e.attributes?.metadata?.name&&(0,Hz.hasBlockSupport)(e.name,"renaming",!0)&&(i.name=n.name),n.blockVisibility!==void 0&&!e.attributes?.metadata?.blockVisibility&&(0,Hz.hasBlockSupport)(e.name,"visibility",!0)&&(i.blockVisibility=n.blockVisibility),Object.keys(i).length>0?{...e,attributes:{...e.attributes,metadata:{...e.attributes.metadata,...i}}}:e}(0,Gz.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",WAe);(0,Gz.addFilter)("blocks.switchToBlockType.transformedBlock","core/metadata/addTransforms",$Ae);var Wz=l(N(),1),JR=l(R(),1),eO=l(A(),1),tO=l($(),1),Lk=l(F(),1);var mf=l(w(),1),KAe={};function YAe({name:e,clientId:t,metadata:{ignoredHookedBlocks:o=[]}={}}){let r=(0,Lk.useSelect)(h=>h(tO.store).getBlockTypes(),[]),n=(0,JR.useMemo)(()=>r?.filter(({name:h,blockHooks:p})=>p&&e in p||o.includes(h)),[r,e,o]),i=(0,Lk.useSelect)(h=>{let{getBlocks:p,getBlockRootClientId:g,getGlobalBlockCount:b}=h(_),v=g(t),k=n.reduce((y,S)=>{if(b(S.name)===0)return y;let x=S?.blockHooks?.[e],C;switch(x){case"before":case"after":C=p(v);break;case"first_child":case"last_child":C=p(t);break;case void 0:C=[...p(v),...p(t)];break}let B=C?.find(I=>I.name===S.name);return B?{...y,[S.name]:B.clientId}:y},{});return Object.values(k).length>0?k:KAe},[n,e,t]),{getBlockIndex:s,getBlockCount:a,getBlockRootClientId:c}=(0,Lk.useSelect)(_),{insertBlock:u,removeBlock:d}=(0,Lk.useDispatch)(_);if(!n.length)return null;let f=n.reduce((h,p)=>{let[g]=p.name.split("/");return h[g]||(h[g]=[]),h[g].push(p),h},{}),m=(h,p)=>{let g=s(t),b=a(t),v=c(t);switch(p){case"before":case"after":u(h,p==="after"?g+1:g,v,!1);break;case"first_child":case"last_child":u(h,p==="first_child"?0:b,t,!1);break;case void 0:u(h,g+1,v,!1);break}};return(0,mf.jsx)(fe,{children:(0,mf.jsxs)(eO.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,Wz.__)("Plugins"),initialOpen:!0,children:[(0,mf.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,Wz.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(f).map(h=>(0,mf.jsxs)(JR.Fragment,{children:[(0,mf.jsx)("h3",{children:h}),f[h].map(p=>{let g=p.name in i;return(0,mf.jsx)(eO.ToggleControl,{checked:g,label:p.title,onChange:()=>{if(!g){let b=p.blockHooks[e];m((0,tO.createBlock)(p.name),b);return}d(i[p.name],!1)}},p.title)})]},h))]})})}var tme={edit:YAe,attributeKeys:["metadata"],hasSupport(){return!0}};var $z=l(N(),1),ome=l($(),1),Nk=l(A(),1),rme=l(F(),1),nme=l(R(),1),ime=l(Z(),1);var pf=l(w(),1),qAe=()=>(0,ime.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},ZAe=({name:e,metadata:t})=>{let o=(0,nme.useContext)(_r),{removeAllBlockBindings:r}=Tl(),n=qAe(),{bindableAttributes:i,hasCompatibleFields:s}=(0,rme.useSelect)(c=>{let{__experimentalBlockBindingsSupportedAttributes:u}=c(_).getSettings(),{getAllBlockBindingsSources:d,getBlockBindingsSourceFieldsList:f}=M(c(ome.store));return{bindableAttributes:u?.[e],hasCompatibleFields:Object.values(d()).some(m=>f(m,o)?.length>0)}},[e,o]);if(!i||i.length===0)return null;let{bindings:a}=t||{};return a===void 0&&!s?null:(0,pf.jsx)(fe,{group:"bindings",children:(0,pf.jsxs)(Nk.__experimentalToolsPanel,{label:(0,$z.__)("Attributes"),resetAll:()=>{r()},dropdownMenuProps:n,className:"block-editor-bindings__panel",children:[(0,pf.jsx)(Nk.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:i.map(c=>(0,pf.jsx)(Kv,{attribute:c,blockName:e,binding:a?.[c]},c))}),(0,pf.jsx)(Nk.__experimentalText,{as:"div",variant:"muted",children:(0,pf.jsx)("p",{children:(0,$z.__)("Attributes connected to custom fields or other dynamic data.")})})]})})},sme={edit:ZAe,attributeKeys:["metadata"],hasSupport(e){return!["core/post-date","core/navigation-link","core/navigation-submenu"].includes(e)}};var ame=l(N(),1),lme=l(A(),1),nO=l(F(),1),t0=l($(),1),cme=l(R(),1);var oO=l(F(),1);function rO(e){let{isOpened:t,expandRevision:o}=(0,oO.useSelect)(i=>{let{isListViewPanelOpened:s,getListViewExpandRevision:a}=M(i(_));return{isOpened:s(e),expandRevision:a()}},[e]),{__unstableToggleListViewPanel:r}=(0,oO.useDispatch)(_);return{isOpened:t,expandRevision:o,handleToggle:i=>{r(e,i)}}}var Mk=l(w(),1),XAe="listView";function ume(e){return(0,t0.hasBlockSupport)(e,XAe)}function QAe({clientId:e,name:t}){let{isSelectionWithinCurrentSection:o}=(0,cme.useContext)(ur),{isOpened:r,expandRevision:n,handleToggle:i}=rO(e),{openListViewContentPanel:s}=M((0,nO.useDispatch)(_)),a=ume(t),{hasChildren:c,isNestedListView:u}=(0,nO.useSelect)(h=>{let{getBlockCount:p,getBlockParents:g,getBlockName:b}=h(_),k=g(e,!1).find(y=>{let S=b(y);return S==="core/navigation"||(0,t0.hasBlockSupport)(S,"listView")});return{hasChildren:!!p(e),isNestedListView:k}},[e]),f=(0,t0.getBlockType)(t)?.title||t;return!a||u?null:(0,Mk.jsx)(_m,{group:"list",children:(0,Mk.jsxs)(lme.PanelBody,{title:o?f:void 0,opened:r,onToggle:i,children:[!c&&(0,Mk.jsx)("p",{className:"block-editor-block-inspector__no-blocks",children:(0,ame.__)("No items yet.")}),(0,Mk.jsx)(MS,{rootClientId:e,isExpanded:!0,description:f,showAppender:!0,onSelect:s},`${e}-${n}`)]})})}var dme={edit:QAe,hasSupport:ume,attributeKeys:[],supportsPatternEditing:!0};var fme=l(ut(),1),mme=l($(),1);function JAe(e){return e.__experimentalLabel||(0,mme.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(o,{context:r})=>{let{metadata:n}=o;if((r==="list-view"||r==="breadcrumb")&&n?.name)return n.name}),e}(0,fme.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",JAe);var pme=l(Z(),1),hme=l(ut(),1),gme=l(F(),1);var ps=l(w(),1);function eLe(e){zz(e)}function tLe({clientId:e,layout:t}){let{isVisible:o,blockVisibility:r,deviceType:n,isAnyAncestorHidden:i}=(0,gme.useSelect)(a=>{let{isBlockSelected:c,hasSelectedInnerBlock:u,isDraggingBlocks:d,getTemplateLock:f,getBlockEditingMode:m,getBlockAttributes:h,getSettings:p}=a(_);if(!d()&&!c(e)||f(e)||m(e)!=="default"||u(e))return{isVisible:!1};let{isBlockParentHiddenAtViewport:g}=M(a(_)),b=h(e),k=p()?.[wi]?.toLowerCase()||Et.desktop.value;return{isVisible:!0,blockVisibility:b?.metadata?.blockVisibility,deviceType:k,isAnyAncestorHidden:g(e,k)}},[e]),{isBlockCurrentlyHidden:s}=Mi({blockVisibility:r,deviceType:n});return(0,ps.jsxs)(ps.Fragment,{children:[(0,ps.jsx)(eLe,{clientId:e}),o&&!s&&!i&&(0,ps.jsx)(X_,{clientId:e,parentLayout:t})]})}var oLe=(0,pme.createHigherOrderComponent)(e=>function(o){return o.attributes.layout?.type!=="grid"?(0,ps.jsx)(e,{...o},"edit"):(0,ps.jsxs)(ps.Fragment,{children:[(0,ps.jsx)(tLe,{clientId:o.clientId,layout:o.attributes.layout}),(0,ps.jsx)(e,{...o},"edit")]})},"addGridVisualizerToBlockEdit");(0,hme.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",oLe);var o0=l($(),1),kme=l(A(),1),vme=l(F(),1);var sO=l(R(),1),yme=l(N(),1);function bme(e){let t=[],o=[];return Object.entries(e).forEach(([r,n])=>{if(!n.autoGenerateControl)return;let i=rLe(r,n);i&&(t.push(i),o.push(r))}),{fields:t,form:{fields:o}}}function rLe(e,t){let o=t.type,r={id:e,label:t.label||e,type:o==="string"?"text":o};return t.enum&&Array.isArray(t.enum)&&(r.elements=t.enum.map(n=>({value:n,label:String(n)}))),r}var iO=l(w(),1);function nLe(e){return e?Object.values(e).some(t=>t?.autoGenerateControl):!1}function iLe({name:e,clientId:t,setAttributes:o}){let r=ao(),n=(0,sO.useContext)(_r),i=(0,vme.useSelect)(u=>{let d=u(_).getBlockAttributes(t);if(!d?.metadata?.bindings)return d;let{getBlockBindingsSource:f}=M(u(o0.store));return Object.entries(d.metadata.bindings).reduce((m,[h,p])=>{let g=f(p.source);if(!g)return m;let b=g.getValues({select:u,context:n,bindings:{[h]:p}});return{...m,...b}},d)},[n,t]),s=(0,o0.getBlockType)(e),{fields:a,form:c}=(0,sO.useMemo)(()=>s?.attributes?bme(s.attributes):{fields:[],form:{fields:[]}},[s?.attributes]);return r!=="default"||!a||a.length===0?null:(0,iO.jsx)(fe,{children:(0,iO.jsx)(kme.PanelBody,{title:(0,yme.__)("Settings"),children:(0,iO.jsx)(V_,{data:i,fields:a,form:c,onChange:o})})})}var Sme={edit:iLe,attributeKeys:[],hasSupport(e){let t=(0,o0.getBlockType)(e);return nLe(t?.attributes)}};function Kz(e){let{style:t}=e,o=t?.dimensions||{},r=bi({dimensions:o});return{className:o.aspectRatio?"has-aspect-ratio":void 0,style:r}}function aO(e){let t=e.style?.border||{};return{className:qF(e)||void 0,style:bi({border:t})}}function Yz(e){let{colors:t}=Cd(),o=aO(e),{borderColor:r}=e;if(r){let n=cp({colors:t,namedColor:r});o.style.borderColor=n.color}return o}function qz(e){let t=e.style?.shadow||"";return{style:bi({shadow:t})}}var Zz=l(R(),1);function lO(e){let{backgroundColor:t,textColor:o,gradient:r,style:n}=e,i=_i("background-color",t),s=_i("color",o),a=oh(r),c=a||n?.color?.gradient,u=V(s,a,{[i]:!c&&!!i,"has-text-color":o||n?.color?.text,"has-background":t||n?.color?.background||r||n?.color?.gradient,"has-link-color":n?.elements?.link?.color}),d=n?.color||{},f=bi({color:d});return{className:u||void 0,style:f}}function Xz(e){let{backgroundColor:t,textColor:o,gradient:r}=e,[n,i,s,a,c,u]=me("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,Zz.useMemo)(()=>[...n||[],...i||[],...s||[]],[n,i,s]),f=(0,Zz.useMemo)(()=>[...a||[],...c||[],...u||[]],[a,c,u]),m=lO(e);if(t){let h=fa(d,t);m.style.backgroundColor=h.color}if(r&&(m.style.background=Ww(f,r)),o){let h=fa(d,o);m.style.color=h.color}return m}function Qz(e){let{style:t}=e,o=t?.spacing||{};return{style:bi({spacing:o})}}var _me=l(A(),1);var{kebabCase:sLe}=M(_me.privateApis);function Jz(e,t){let o=e?.style?.typography||{};o={...o,fontSize:tc({size:e?.style?.typography?.fontSize},t)};let r=bi({typography:o}),n=e?.fontFamily?`has-${sLe(e.fontFamily)}-font-family`:"",i=e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"";return{className:V(n,i,gu(e?.fontSize)),style:r}}var cO=l(R(),1);function e6(e){let[t,o]=(0,cO.useState)(e);return(0,cO.useEffect)(()=>{e&&o(e)},[e]),t}fle([C2,MR,E4,gz,UR,$R,Rz,VR,dV,Gfe,tme,sme,Uz,Lle,Zde,dme,Sme].filter(Boolean));mle([C2,MR,Sae,UR,o4,Ife,Rz,bz,vz,VR,ZF,$R,dV,XX,Uz]);ple([C2,MR,E4,Vle,gz,ZF,$R,VR,o4,UR,bz,vz]);var xme={button:"wp-element-button",caption:"wp-element-caption"},aLe=e=>xme[e]?xme[e]:"";var wme=()=>"";var Dk=l(R(),1),r0=l($(),1),o6=l(dr(),1);var Cme=l(w(),1);function r6(e,t,o){if(e==null||e===!1)return;if(Array.isArray(e))return t6(e,t,o);switch(typeof e){case"string":case"number":return}let{type:r,props:n}=e;switch(r){case Dk.StrictMode:case Dk.Fragment:return t6(n.children,t,o);case Dk.RawHTML:return;case oS.Content:return Bme(t,o);case r_:t.push(n.value);return}switch(typeof r){case"string":return typeof n.children<"u"?t6(n.children,t,o):void 0;case"function":let i=r.prototype&&typeof r.prototype.render=="function"?new r(n).render():r(n);return r6(i,t,o)}}function t6(e,...t){e=Array.isArray(e)?e:[e];for(let o=0;oo instanceof o6.RichTextData?o:o6.RichTextData.fromHTMLString(o))}var Tme=l(A(),1);var n6=l(w(),1);function Ime({clientId:e,resizableBoxProps:t,...o}){return(0,n6.jsx)(Hi,{clientId:e,__unstablePopoverSlot:"block-toolbar",...o,children:(0,n6.jsx)(Tme.ResizableBox,{...t})})}var i0=l(R(),1),uO=l(F(),1),ca=l(A(),1),n0=l(N(),1);var hs=l(w(),1);function Pme({rules:e}){let[t,o]=(0,i0.useState)(!1),{clientIds:r,selectPrevious:n,message:i}=(0,uO.useSelect)(p=>M(p(_)).getRemovalPromptData()),{clearBlockRemovalPrompt:s,setBlockRemovalRules:a,privateRemoveBlocks:c}=M((0,uO.useDispatch)(_));if((0,i0.useEffect)(()=>(a(e),()=>{a()}),[e,a]),(0,i0.useEffect)(()=>{o(!1)},[r]),!i)return;let u=typeof i=="object"&&i!==null,d=u?i.description:i,f=u&&i.requireConfirmation,m=f&&!t,h=()=>{c(r,n,!0),s()};return(0,hs.jsx)(ca.Modal,{title:(0,n0.__)("Confirm deletion"),onRequestClose:s,size:"medium",children:(0,hs.jsxs)(ca.__experimentalVStack,{spacing:4,children:[(0,hs.jsxs)("div",{children:[(0,hs.jsx)("p",{children:d}),u&&(i.warning||i.subtext)&&(0,hs.jsxs)("p",{children:[i.warning&&(0,hs.jsx)("strong",{children:i.warning}),i.warning&&i.subtext&&" ",i.subtext]})]}),f&&(0,hs.jsx)(ca.CheckboxControl,{label:(0,n0.__)("I understand the consequences"),checked:t,onChange:o}),(0,hs.jsxs)(ca.__experimentalHStack,{justify:"right",children:[(0,hs.jsx)(ca.Button,{variant:"tertiary",onClick:s,__next40pxDefaultSize:!0,children:(0,n0.__)("Cancel")}),(0,hs.jsx)(ca.Button,{variant:"primary",onClick:h,disabled:m,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,n0.__)("Delete")})]})]})})}var i6=l(R(),1);var Vk=l(A(),1),Ome=l(R(),1),Vn=l(N(),1),dO=l(w(),1),Rme=[{value:"fill",label:(0,Vn._x)("Fill","Scale option for dimensions control"),help:(0,Vn.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,Vn._x)("Contain","Scale option for dimensions control"),help:(0,Vn.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,Vn._x)("Cover","Scale option for dimensions control"),help:(0,Vn.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,Vn._x)("None","Scale option for dimensions control"),help:(0,Vn.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,Vn._x)("Scale down","Scale option for dimensions control"),help:(0,Vn.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function Ame({panelId:e,value:t,onChange:o,options:r=Rme,defaultValue:n=Rme[0].value,isShownByDefault:i=!0}){let s=t??"fill",a=(0,Ome.useMemo)(()=>r.reduce((c,u)=>(c[u.value]=u.help,c),{}),[r]);return(0,dO.jsx)(Vk.__experimentalToolsPanelItem,{label:(0,Vn._x)("Scale","Image scaling options"),isShownByDefault:i,hasValue:()=>s!==n,onDeselect:()=>o(n),panelId:e,children:(0,dO.jsx)(Vk.__experimentalToggleGroupControl,{label:(0,Vn._x)("Scale","Image scaling options"),isBlock:!0,help:a[s],value:s,onChange:o,size:"__unstable-large",children:r.map(c=>(0,dO.jsx)(Vk.__experimentalToggleGroupControlOption,{...c},c.value))})})}var Fk=l(A(),1),Cp=l(N(),1),Hc=l(w(),1);function Lme({panelId:e,value:t={},onChange:o=()=>{},units:r,isShownByDefault:n=!0}){let i=t.width==="auto"?"":t.width??"",s=t.height==="auto"?"":t.height??"",a=c=>u=>{let d={...t};u?d[c]=u:delete d[c],o(d)};return(0,Hc.jsxs)(Hc.Fragment,{children:[(0,Hc.jsx)(Fk.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,Cp.__)("Width"),isShownByDefault:n,hasValue:()=>i!=="",onDeselect:a("width"),panelId:e,children:(0,Hc.jsx)(Fk.__experimentalUnitControl,{label:(0,Cp.__)("Width"),placeholder:(0,Cp.__)("Auto"),labelPosition:"top",units:r,min:0,value:i,onChange:a("width"),size:"__unstable-large"})}),(0,Hc.jsx)(Fk.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,Cp.__)("Height"),isShownByDefault:n,hasValue:()=>s!=="",onDeselect:a("height"),panelId:e,children:(0,Hc.jsx)(Fk.__experimentalUnitControl,{label:(0,Cp.__)("Height"),placeholder:(0,Cp.__)("Auto"),labelPosition:"top",units:r,min:0,value:s,onChange:a("height"),size:"__unstable-large"})})]})}var hf=l(w(),1);function lLe({panelId:e,value:t={},onChange:o=()=>{},aspectRatioOptions:r,defaultAspectRatio:n="auto",scaleOptions:i,defaultScale:s="fill",unitsOptions:a,tools:c=["aspectRatio","widthHeight","scale"]}){let u=t.width===void 0||t.width==="auto"?null:t.width,d=t.height===void 0||t.height==="auto"?null:t.height,f=t.aspectRatio===void 0||t.aspectRatio==="auto"?null:t.aspectRatio,m=t.scale===void 0||t.scale==="fill"?null:t.scale,[h,p]=(0,i6.useState)(m),[g,b]=(0,i6.useState)(f),v=u&&d?"custom":g,k=f||u&&d;return(0,hf.jsxs)(hf.Fragment,{children:[c.includes("aspectRatio")&&(0,hf.jsx)(MP,{panelId:e,options:r,defaultValue:n,value:v,onChange:y=>{let S={...t};y=y==="auto"?null:y,b(y),y?S.aspectRatio=y:delete S.aspectRatio,y?h?S.scale=h:(S.scale=s,p(s)):delete S.scale,y!=="custom"&&u&&d&&delete S.height,o(S)}}),c.includes("widthHeight")&&(0,hf.jsx)(Lme,{panelId:e,units:a,value:{width:u,height:d},onChange:({width:y,height:S})=>{let x={...t};y=y==="auto"?null:y,S=S==="auto"?null:S,y?x.width=y:delete x.width,S?x.height=S:delete x.height,y&&S?delete x.aspectRatio:g&&(x.aspectRatio=g),!g&&!!y!=!!S?delete x.scale:h?x.scale=h:(x.scale=s,p(s)),o(x)}}),c.includes("scale")&&k&&(0,hf.jsx)(Ame,{panelId:e,options:i,defaultValue:s,value:h,onChange:y=>{let S={...t};y=y==="fill"?null:y,p(y),y?S.scale=y:delete S.scale,o(S)}})]})}var Nme=lLe;var fO=l(A(),1),Gc=l(N(),1),s6=l(w(),1),Mme=[{label:(0,Gc._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,Gc._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,Gc._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,Gc._x)("Full Size","Image size option for resolution control"),value:"full"}];function Dme({panelId:e,value:t,onChange:o,options:r=Mme,defaultValue:n=Mme[0].value,isShownByDefault:i=!0,resetAllFilter:s}){let a=t??n;return(0,s6.jsx)(fO.__experimentalToolsPanelItem,{hasValue:()=>a!==n,label:(0,Gc.__)("Resolution"),onDeselect:()=>o(n),isShownByDefault:i,panelId:e,resetAllFilter:s,children:(0,s6.jsx)(fO.SelectControl,{label:(0,Gc.__)("Resolution"),value:a,options:r,onChange:o,help:(0,Gc.__)("Select the size of the source image."),size:"__unstable-large"})})}var Bp=l(N(),1),zk=l(A(),1),Fme=l(F(),1);var ua=l(N(),1),Vme={a:(0,ua.__)("The element should be used for links that navigate to a different page or to a different section within the same page."),article:(0,ua.__)("The
element should represent a self-contained, syndicatable portion of the document."),aside:(0,ua.__)("The