Plugin Directory

Changeset 3463454


Ignore:
Timestamp:
02/17/2026 11:56:13 AM (6 weeks ago)
Author:
debuggersstudio
Message:

Update to version 4.1.2 from GitHub

Location:
ecomm-reels
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ecomm-reels/tags/4.1.2/CHANGELOG.md

    r3462462 r3463454  
    11# Changelog
     2
     3## [4.1.2](https://github.com/dstudio-asia/reels-wp/compare/v4.1.1...v4.1.2) (2026-02-17)
     4
     5
     6### Bug Fixes
     7
     8* **player:** prevent smooth-scroll jump on modal close + minor admin layout tweaks ([19adec0](https://github.com/dstudio-asia/reels-wp/commit/19adec0a84f253a0b1edd31129622dae7c1a067e))
     9* **player:** robust scroll lock for iOS Safari modal behavior ([3a26b8a](https://github.com/dstudio-asia/reels-wp/commit/3a26b8ac85ef332346032577015f3f6a88ba36b0))
    210
    311## [4.1.1](https://github.com/dstudio-asia/reels-wp/compare/v4.1.0...v4.1.1) (2026-02-16)
  • ecomm-reels/tags/4.1.2/build/index.js

    r3462462 r3463454  
    1 (function(y,va,In,ya){"use strict";var wa=document.createElement("style");wa.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:999}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;position:relative}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer;text-align:center;height:100%;background-color:transparent}#ecommreels-admin-app .ecr-admin-upload__text-icon_wrapper{display:grid;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-admin-video-upload-options{position:absolute;inset:2px;border-radius:10px;background-color:#fff;box-shadow:0 0 4px 8px #f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px}#ecommreels-admin-app .ecr-admin-upload-source-panel{position:absolute;inset:6px;z-index:3;border-radius:10px;border:1px solid #dbeafe;background:#fff;box-shadow:0 12px 24px #0f172a26;padding:12px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-upload-source-panel__close{align-self:flex-end;width:28px;height:28px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#6b7280;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-upload-source-panel__close:hover{color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__title{margin:0;font-size:14px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__description{margin:4px 0 0;font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-upload-source-popover__options{margin-top:12px;display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload-source-option{width:100%;padding:12px;border:1px solid #dbeafe;border-radius:8px;background:#eff6ff;color:#1d4ed8;text-align:left;font-weight:600;font-size:13px;transition:all .2s ease}#ecommreels-admin-app .ecr-admin-upload-source-option:hover{border-color:#3b82f6;background:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-admin-upload-vimeo-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px;opacity:.8}#ecommreels-admin-app .ecr-admin-upload-native-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-upload-native-video-btn:hover{background-color:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;max-height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;height:100vh;position:fixed;top:0;right:0}@media(max-width:1024px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-sidepanel-content{padding-top:32px}}@media(max-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel-content{z-index:999}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:999}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-tab, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-tab, 150px),1fr))}}
    2 /*$vite$:1*/`,document.head.appendChild(wa);function ja(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=ja(y),_r=ja(ya);function kd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},Kt={};/**
     1(function(y,_a,In,ya){"use strict";var wa=document.createElement("style");wa.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:999}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;position:relative}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer;text-align:center;height:100%;background-color:transparent}#ecommreels-admin-app .ecr-admin-upload__text-icon_wrapper{display:grid;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-admin-video-upload-options{position:absolute;inset:2px;border-radius:10px;background-color:#fff;box-shadow:0 0 4px 8px #f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px}#ecommreels-admin-app .ecr-admin-upload-source-panel{position:absolute;inset:6px;z-index:3;border-radius:10px;border:1px solid #dbeafe;background:#fff;box-shadow:0 12px 24px #0f172a26;padding:12px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-upload-source-panel__close{align-self:flex-end;width:28px;height:28px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#6b7280;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-upload-source-panel__close:hover{color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__title{margin:0;font-size:14px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__description{margin:4px 0 0;font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-upload-source-popover__options{margin-top:12px;display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload-source-option{width:100%;padding:12px;border:1px solid #dbeafe;border-radius:8px;background:#eff6ff;color:#1d4ed8;text-align:left;font-weight:600;font-size:13px;transition:all .2s ease}#ecommreels-admin-app .ecr-admin-upload-source-option:hover{border-color:#3b82f6;background:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-admin-upload-vimeo-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px;opacity:.8}#ecommreels-admin-app .ecr-admin-upload-native-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-upload-native-video-btn:hover{background-color:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;gap:8px;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{width:100%}@media(max-width:767px){#ecommreels-admin-app .ecr-admin-thumbnail__uploader{width:260px}}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;max-height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;height:100vh;position:fixed;top:0;right:0}@media(max-width:1024px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-sidepanel-content{padding-top:32px}}@media(max-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel-content{z-index:999}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:999}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-tab, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-tab, 150px),1fr))}}
     2/*$vite$:1*/`,document.head.appendChild(wa);function ja(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=ja(y),vr=ja(ya);function kd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},Kt={};/**
    33 * @license React
    44 * react-jsx-runtime.production.min.js
     
    1717 *
    1818 * @license MIT
    19  */function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yt.apply(this,arguments)}var nt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(nt||(nt={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Xt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Mn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:vr(i))}function n(o,i){Na(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ad(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Na(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Td(){return Math.random().toString(36).substr(2,8)}function Ea(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Yt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Xt(t):t,{state:r,key:t&&t.key||n||Td()})}function vr(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Xt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ad(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=nt.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Yt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=nt.Pop;let h=u(),_=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:_})}function m(h,_){l=nt.Push;let v=Mn(f.location,h,_);r&&r(v,h),d=u()+1;let w=Ea(v,d),j=f.createHref(v);try{s.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,_){l=nt.Replace;let v=Mn(f.location,h,_);r&&r(v,h),d=u();let w=Ea(v,d),j=f.createHref(v);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let _=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof h=="string"?h:vr(h);return v=v.replace(/ $/,"%20"),ye(_,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,_)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),c=h,()=>{o.removeEventListener(Ca,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let _=b(h);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Ta;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ta||(Ta={}));function Aa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Pd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Pd.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Xt(e):e,i;if(r)if(Od(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Na(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Pa(r.substring(1),"/"):i=Pa(r,t)}else i=t;return{pathname:i,search:Id(n),hash:zd(o)}}function Pa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Dn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ld(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Oa(e,t){let r=Ld(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ra(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Xt(e):(o=Yt({},e),ye(!o.pathname||!o.pathname.includes("?"),Dn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),Dn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),Dn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Rd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const La=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ia=["post","put","patch","delete"];new Set(Ia);const Md=["get",...Ia];new Set(Md);/**
     19 */function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yt.apply(this,arguments)}var nt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(nt||(nt={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Xt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Mn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:_r(i))}function n(o,i){Na(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ad(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Na(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Td(){return Math.random().toString(36).substr(2,8)}function Ea(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Yt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Xt(t):t,{state:r,key:t&&t.key||n||Td()})}function _r(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Xt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ad(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=nt.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Yt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=nt.Pop;let h=u(),v=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:v})}function m(h,v){l=nt.Push;let _=Mn(f.location,h,v);r&&r(_,h),d=u()+1;let w=Ea(_,d),j=f.createHref(_);try{s.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,v){l=nt.Replace;let _=Mn(f.location,h,v);r&&r(_,h),d=u();let w=Ea(_,d),j=f.createHref(_);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let v=o.location.origin!=="null"?o.location.origin:o.location.href,_=typeof h=="string"?h:_r(h);return _=_.replace(/ $/,"%20"),ye(v,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,v)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),c=h,()=>{o.removeEventListener(Ca,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let v=b(h);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Ta;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ta||(Ta={}));function Aa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Pd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Pd.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Xt(e):e,i;if(r)if(Od(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Na(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Pa(r.substring(1),"/"):i=Pa(r,t)}else i=t;return{pathname:i,search:Id(n),hash:zd(o)}}function Pa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Dn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ld(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Oa(e,t){let r=Ld(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ra(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Xt(e):(o=Yt({},e),ye(!o.pathname||!o.pathname.includes("?"),Dn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),Dn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),Dn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Rd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const La=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ia=["post","put","patch","delete"];new Set(Ia);const Md=["get",...Ia];new Set(Md);/**
    2020 * React Router v6.30.3
    2121 *
     
    2626 *
    2727 * @license MIT
    28  */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const za=x.createContext(null),_t=x.createContext(null),Fn=x.createContext(null),wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;jr()||ye(!1);let{basename:n,navigator:o}=x.useContext(_t),{hash:i,pathname:s,search:l}=Da(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:La([n,s])),o.createHref({pathname:c,search:l,hash:i})}function jr(){return x.useContext(Fn)!=null}function Sr(){return jr()||ye(!1),x.useContext(Fn).location}function Ma(e){x.useContext(_t).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(wr);return e?Hd():Fd()}function Fd(){jr()||ye(!1);let e=x.useContext(za),{basename:t,future:r,navigator:n}=x.useContext(_t),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Oa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return Ma(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ra(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:La([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Da(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(_t),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Oa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Ra(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Fa=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Fa||{}),$a=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})($a||{});function $d(e){let t=x.useContext(za);return t||ye(!1),t}function Bd(e){let t=x.useContext(wr);return t||ye(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Hd(){let{router:e}=$d(Fa.UseNavigateStable),t=Ud($a.UseNavigateStable),r=x.useRef(!1);return Ma(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function Vd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Wd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=nt.Pop,navigator:i,static:s=!1,future:l}=e;jr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Xt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Aa(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(_t.Provider,{value:d},x.createElement(Fn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
     28 */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const za=x.createContext(null),vt=x.createContext(null),Fn=x.createContext(null),wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;jr()||ye(!1);let{basename:n,navigator:o}=x.useContext(vt),{hash:i,pathname:s,search:l}=Da(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:La([n,s])),o.createHref({pathname:c,search:l,hash:i})}function jr(){return x.useContext(Fn)!=null}function Sr(){return jr()||ye(!1),x.useContext(Fn).location}function Ma(e){x.useContext(vt).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(wr);return e?Hd():Fd()}function Fd(){jr()||ye(!1);let e=x.useContext(za),{basename:t,future:r,navigator:n}=x.useContext(vt),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Oa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return Ma(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ra(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:La([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Da(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(vt),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Oa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Ra(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Fa=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Fa||{}),$a=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})($a||{});function $d(e){let t=x.useContext(za);return t||ye(!1),t}function Bd(e){let t=x.useContext(wr);return t||ye(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Hd(){let{router:e}=$d(Fa.UseNavigateStable),t=Ud($a.UseNavigateStable),r=x.useRef(!1);return Ma(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function Vd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Wd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=nt.Pop,navigator:i,static:s=!1,future:l}=e;jr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Xt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Aa(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(vt.Provider,{value:d},x.createElement(Fn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
    2929 * React Router DOM v6.30.3
    3030 *
     
    3535 *
    3636 * @license MIT
    37  */function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$n.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Gd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kd(e,t){return e.button===0&&(!t||t==="_self")&&!Gd(e)}function Bn(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Yd(e,t){let r=Bn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const Ba=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ed({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&Ba?Ba(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(_t),b,f=!1;if(typeof d=="string"&&eu.test(d)&&(b=d,Qd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),k=Aa(j.pathname,g);j.origin===w.origin&&k!=null?d=k+j.search+j.hash:f=!0}catch{}let h=Dd(d,{relative:o}),_=tu(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function v(w){n&&n(w),w.defaultPrevented||_(w)}return x.createElement("a",$n({},m,{href:b||h,onClick:f||i?n:v,ref:r,target:c}))});var Ua;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ua||(Ua={}));var Ha;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ha||(Ha={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=Sr(),u=Da(e,{relative:s});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:vr(d)===vr(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Jt(e){let t=x.useRef(Bn(e)),r=x.useRef(!1),n=Sr(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=Bn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let ru={data:""},nu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ru},ou=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,au=/\/\*[^]*?\*\/|  +/g,Va=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Me={},Wa=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Wa(e[r]);return t}return e},iu=(e,t,r,n,o)=>{let i=Wa(e),s=Me[i]||(Me[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!Me[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=ou.exec(d.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Va," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Va," ").trim();return m[0]})(e);Me[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&Me.g?Me.g:null;return r&&(Me.g=Me[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Me[s],t,n,l),s},su=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function kr(e){let t=this||{},r=e.call?e(t.p):e;return iu(r.unshift?r.raw?su(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,nu(t.target),t.g,t.o,t.k)}let qa,Un,Hn;kr.bind({g:1});let De=kr.bind({k:1});function lu(e,t,r,n){Ue.p=t,qa=e,Un=r,Hn=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Un&&Un()},l),r.o=/ *go\d+/.test(c),l.className=kr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Hn&&d[0]&&Hn(l),qa(d,l)}return o}}var cu=e=>typeof e=="function",Cr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),Ga=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uu=20,Vn="default",Ka=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ka(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Nr=[],Ya={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ee={},Xa=(e,t=Vn)=>{Ee[t]=Ka(Ee[t]||Ya,e),Nr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Ja=e=>Object.keys(Ee).forEach(t=>Xa(e,t)),pu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Er=(e=Vn)=>t=>{Xa(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Vn)=>{let[r,n]=y.useState(Ee[t]||Ya),o=y.useRef(Ee[t]);y.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Nr.push([t,n]),()=>{let s=Nr.findIndex(([l])=>l===t);s>-1&&Nr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||mu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},hu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||du()}),Zt=e=>(t,r)=>{let n=hu(t,e,r);return Er(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>Zt("blank")(e,t);ne.error=Zt("error"),ne.success=Zt("success"),ne.loading=Zt("loading"),ne.custom=Zt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Er(t)(r):Ja(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Er(t)(r):Ja(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?Cr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?Cr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(b<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Er(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:f}=m||{},h=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),_=h.findIndex(w=>w.id===p.id),v=h.filter((w,j)=>j<_&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[v+1]:[0,v]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},bu=De`
     37 */function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$n.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Gd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kd(e,t){return e.button===0&&(!t||t==="_self")&&!Gd(e)}function Bn(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Yd(e,t){let r=Bn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const Ba=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ed({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&Ba?Ba(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_t=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(vt),b,f=!1;if(typeof d=="string"&&eu.test(d)&&(b=d,Qd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),k=Aa(j.pathname,g);j.origin===w.origin&&k!=null?d=k+j.search+j.hash:f=!0}catch{}let h=Dd(d,{relative:o}),v=tu(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function _(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",$n({},m,{href:b||h,onClick:f||i?n:_,ref:r,target:c}))});var Ua;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ua||(Ua={}));var Ha;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ha||(Ha={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=Sr(),u=Da(e,{relative:s});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(d)===_r(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Jt(e){let t=x.useRef(Bn(e)),r=x.useRef(!1),n=Sr(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=Bn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let ru={data:""},nu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ru},ou=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,au=/\/\*[^]*?\*\/|  +/g,Va=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Me={},Wa=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Wa(e[r]);return t}return e},iu=(e,t,r,n,o)=>{let i=Wa(e),s=Me[i]||(Me[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!Me[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=ou.exec(d.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Va," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Va," ").trim();return m[0]})(e);Me[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&Me.g?Me.g:null;return r&&(Me.g=Me[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Me[s],t,n,l),s},su=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function kr(e){let t=this||{},r=e.call?e(t.p):e;return iu(r.unshift?r.raw?su(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,nu(t.target),t.g,t.o,t.k)}let qa,Un,Hn;kr.bind({g:1});let De=kr.bind({k:1});function lu(e,t,r,n){Ue.p=t,qa=e,Un=r,Hn=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Un&&Un()},l),r.o=/ *go\d+/.test(c),l.className=kr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Hn&&d[0]&&Hn(l),qa(d,l)}return o}}var cu=e=>typeof e=="function",Cr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),Ga=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uu=20,Vn="default",Ka=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ka(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Nr=[],Ya={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ee={},Xa=(e,t=Vn)=>{Ee[t]=Ka(Ee[t]||Ya,e),Nr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Ja=e=>Object.keys(Ee).forEach(t=>Xa(e,t)),pu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Er=(e=Vn)=>t=>{Xa(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Vn)=>{let[r,n]=y.useState(Ee[t]||Ya),o=y.useRef(Ee[t]);y.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Nr.push([t,n]),()=>{let s=Nr.findIndex(([l])=>l===t);s>-1&&Nr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||mu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},hu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||du()}),Zt=e=>(t,r)=>{let n=hu(t,e,r);return Er(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>Zt("blank")(e,t);ne.error=Zt("error"),ne.success=Zt("success"),ne.loading=Zt("loading"),ne.custom=Zt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Er(t)(r):Ja(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Er(t)(r):Ja(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?Cr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?Cr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(b<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Er(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:f}=m||{},h=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),v=h.findIndex(w=>w.id===p.id),_=h.filter((w,j)=>j<v&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[_+1]:[0,_]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},bu=De`
    3838from {
    3939  transform: scale(0) rotate(45deg);
     
    4343 transform: scale(1) rotate(45deg);
    4444  opacity: 1;
    45 }`,_u=De`
     45}`,vu=De`
    4646from {
    4747  transform: scale(0);
     
    5151  transform: scale(1);
    5252  opacity: 1;
    53 }`,vu=De`
     53}`,_u=De`
    5454from {
    5555  transform: scale(0) rotate(90deg);
     
    7575  &:before {
    7676    content: '';
    77     animation: ${_u} 0.15s ease-out forwards;
     77    animation: ${vu} 0.15s ease-out forwards;
    7878    animation-delay: 150ms;
    7979    position: absolute;
     
    8888
    8989  &:before {
    90     animation: ${vu} 0.15s ease-out forwards;
     90    animation: ${_u} 0.15s ease-out forwards;
    9191    animation-delay: 180ms;
    9292    transform: rotate(90deg);
     
    211211    pointer-events: auto;
    212212  }
    213 `,Tr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=xu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Tr,left:Tr,right:Tr,bottom:Tr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?Cr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},q=ne;const Za={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],ot={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Za.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Wu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Qa=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Ku=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Yu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var ei={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ti=y.createContext&&y.createContext(ei),Xu=["attr","size","title"];function Ju(e,t){if(e==null)return{};var r=Zu(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ar.apply(this,arguments)}function ri(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ri(Object(r),!0).forEach(function(n){Qu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ri(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qu(e,t,r){return t=ep(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ep(e){var t=tp(e,"string");return typeof t=="symbol"?t:t+""}function tp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ni(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),ni(t.child)))}function U(e){return t=>y.createElement(rp,Ar({attr:Pr({},e.attr)},t),ni(e.child))}function rp(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Ju(e,Xu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Ar({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return ti!==void 0?y.createElement(ti.Consumer,null,r=>t(r)):t(ei)}function np(e){return U({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function at(e){return U({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function yt(e){return U({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Qt(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function er(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function op(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function ap(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function ip(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function it(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function sp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function oi(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function lp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function cp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(e)}function tr(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function Wn(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function dp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function up(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function pp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function mp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}function ai(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=ai(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():ai(e[o],null)}}}}function J(...e){return x.useCallback(qn(...e),e)}function st(e){const t=hp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(xp);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var fp=st("Slot");function hp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=_p(o),l=bp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?qn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gp=Symbol("radix.slottable");function xp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gp}function bp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function _p(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ii(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ii(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function vp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ii(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return vp(e)}const yp="ecr-button",jp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline","outline-danger":"ecr-button--outline-danger",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},Sp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function te({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?fp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:F(yp,jp[t],Sp[r],e),...o})}function kp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(te,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(te,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(te,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Wn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(te,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(oi,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(te,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(it,{className:"ecr-admin-reels-header__spinner"}):a.jsx(yt,{})," ","Create Widget"]}):null]})]})}function Cp(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function Np(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function lt(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function Ep(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(lt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Tp({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(it,{className:"ecr-admin-reels-loading__icon"})})}const si=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:F("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),wt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function Gn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Kn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Yn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Xn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const Ap="Left",Pp="Right",Op="Up",Rp="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Jn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},li="mousemove",ci="mouseup",Lp="touchend",Ip="touchmove",zp="touchstart";function Mp(e,t,r,n){return e>t?r>0?Pp:Ap:n>0?Rp:Op}function di(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function Dp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(li,n),document.addEventListener(ci,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=di([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Jn),{initial:h.slice(),xy:h,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=g?u.touches[0]:u,[h,_]=di([b,f],m.rotationAngle),v=h-p.xy[0],w=_-p.xy[1],j=Math.abs(v),k=Math.abs(w),N=(u.timeStamp||0)-p.start,C=Math.sqrt(j*j+k*k)/(N||1),E=[v/(N||1),w/(N||1)],T=Mp(j,k,v,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||jt.delta;if(j<A&&k<A&&!p.swiping)return p;const O={absX:j,absY:k,deltaX:v,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:C,vxvy:E};O.first&&m.onSwipeStart&&m.onSwipeStart(O),m.onSwiping&&m.onSwiping(O);let R=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(R=!0),R&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:O,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Jn),{eventData:g})})},i=()=>{document.removeEventListener(li,n),document.removeEventListener(ci,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},jt.touchEventOptions),p.touchEventOptions),b=[[zp,r,g],[Ip,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Lp,o,g]];b.forEach(([f,h,_])=>u.addEventListener(f,h,_)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Fp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function $p(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Jn)),n=x.useRef(Object.assign({},jt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},jt),e);let i;for(i in jt)n.current[i]===void 0&&(n.current[i]=jt[i]);const[s,l]=x.useMemo(()=>Dp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Fp(r.current,n.current,o.current,l),s}const Bp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"metadata",playsInline:!0,"webkit-playsinline":"true",muted:r,autoPlay:!n,controls:!1,loop:!1,"aria-label":"Reel video",disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onError:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},ui=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!0),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const _=p.current[h];_&&(i?_.play().catch(()=>{}):_.pause(),s(v=>!v))},g=h=>{const _=p.current[h];_&&(_.muted=!d,u(v=>!v))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=$p({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{b&&c()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((h,_)=>a.jsx("div",{className:"ecr-player__slide",children:h?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Bp,{videoRefs:p,file:h,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:i},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)}):a.jsx(Xn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)})]})]})},_))})},Up=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(wt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}):null,r.index<u-1?a.jsx(wt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(si,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(ui,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Hp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Vp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Wp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Or(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function qp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function pi(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Gp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Kp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function Yp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Xp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}const Jp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Zp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"metadata",poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Jp(r?.[e.id]??e.view_count)}),a.jsx(ap,{size:14})]})]})},Zn=y.memo(Zp);function Qp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:F("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Zn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(te,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(mp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(te,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(vt,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Or,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(te,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(Wn,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:F("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(te,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Gp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Kp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function em({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(Qp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const rr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Cp,{size:24})})};function tm(e){return U({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const nr=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(vt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(tm,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Rr=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(lp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(it,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Lr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(vt,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Ir=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(it,{className:"ecr-admin-loader__icon",size:64})}),St=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(y.Fragment,{children:s},l))})]}),kt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function rm(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const zr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(rm,{}),"ReelsWP"]});function mi(e,t){return function(){return e.apply(t,arguments)}}const{toString:nm}=Object.prototype,{getPrototypeOf:Qn}=Object,{iterator:Mr,toStringTag:fi}=Symbol,Dr=(e=>t=>{const r=nm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>Dr(t)===e),Fr=e=>t=>typeof t===e,{isArray:Ct}=Array,Nt=Fr("undefined");function or(e){return e!==null&&!Nt(e)&&e.constructor!==null&&!Nt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const hi=we("ArrayBuffer");function om(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&hi(e.buffer),t}const am=Fr("string"),me=Fr("function"),gi=Fr("number"),ar=e=>e!==null&&typeof e=="object",im=e=>e===!0||e===!1,$r=e=>{if(Dr(e)!=="object")return!1;const t=Qn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(fi in e)&&!(Mr in e)},sm=e=>{if(!ar(e)||or(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},lm=we("Date"),cm=we("File"),dm=we("Blob"),um=we("FileList"),pm=e=>ar(e)&&me(e.pipe),mm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=Dr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},fm=we("URLSearchParams"),[hm,gm,xm,bm]=["ReadableStream","Request","Response","Headers"].map(we),_m=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ir(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(or(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function xi(e,t){if(or(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bi=e=>!Nt(e)&&e!==ct;function eo(){const{caseless:e,skipUndefined:t}=bi(this)&&this||{},r={},n=(o,i)=>{const s=e&&xi(r,i)||i;$r(r[s])&&$r(o)?r[s]=eo(r[s],o):$r(o)?r[s]=eo({},o):Ct(o)?r[s]=o.slice():(!t||!Nt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ir(arguments[o],n);return r}const vm=(e,t,r,{allOwnKeys:n}={})=>(ir(t,(o,i)=>{r&&me(o)?e[i]=mi(o,r):e[i]=o},{allOwnKeys:n}),e),ym=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),wm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},jm=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Qn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Sm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},km=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!gi(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Cm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qn(Uint8Array)),Nm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Em=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Tm=we("HTMLFormElement"),Am=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),_i=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Pm=we("RegExp"),vi=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ir(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Om=e=>{vi(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Rm=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},Lm=()=>{},Im=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function zm(e){return!!(e&&me(e.append)&&e[fi]==="FormData"&&e[Mr])}const Mm=e=>{const t=new Array(10),r=(n,o)=>{if(ar(n)){if(t.indexOf(n)>=0)return;if(or(n))return n;if(!("toJSON"in n)){t[o]=n;const i=Ct(n)?[]:{};return ir(n,(s,l)=>{const c=r(s,o+1);!Nt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},Dm=we("AsyncFunction"),Fm=e=>e&&(ar(e)||me(e))&&me(e.then)&&me(e.catch),yi=((e,t)=>e?setImmediate:t?((r,n)=>(ct.addEventListener("message",({source:o,data:i})=>{o===ct&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ct.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(ct.postMessage)),$m=typeof queueMicrotask<"u"?queueMicrotask.bind(ct):typeof process<"u"&&process.nextTick||yi,S={isArray:Ct,isArrayBuffer:hi,isBuffer:or,isFormData:mm,isArrayBufferView:om,isString:am,isNumber:gi,isBoolean:im,isObject:ar,isPlainObject:$r,isEmptyObject:sm,isReadableStream:hm,isRequest:gm,isResponse:xm,isHeaders:bm,isUndefined:Nt,isDate:lm,isFile:cm,isBlob:dm,isRegExp:Pm,isFunction:me,isStream:pm,isURLSearchParams:fm,isTypedArray:Cm,isFileList:um,forEach:ir,merge:eo,extend:vm,trim:_m,stripBOM:ym,inherits:wm,toFlatObject:jm,kindOf:Dr,kindOfTest:we,endsWith:Sm,toArray:km,forEachEntry:Nm,matchAll:Em,isHTMLForm:Tm,hasOwnProperty:_i,hasOwnProp:_i,reduceDescriptors:vi,freezeMethods:Om,toObjectSet:Rm,toCamelCase:Am,noop:Lm,toFiniteNumber:Im,findKey:xi,global:ct,isContextDefined:bi,isSpecCompliantForm:zm,toJSONObject:Mm,isAsyncFn:Dm,isThenable:Fm,setImmediate:yi,asap:$m,isIterable:e=>e!=null&&me(e[Mr])};function H(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(H,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const wi=H.prototype,ji={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ji[e]={value:e}}),Object.defineProperties(H,ji),Object.defineProperty(wi,"isAxiosError",{value:!0}),H.from=(e,t,r,n,o,i)=>{const s=Object.create(wi);S.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return H.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Bm=null;function to(e){return S.isPlainObject(e)||S.isArray(e)}function Si(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function ki(e,t,r){return e?e.concat(t).map(function(o,i){return o=Si(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Um(e){return S.isArray(e)&&!e.some(to)}const Hm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Br(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!S.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!c&&S.isBlob(b))throw new H("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let _=b;if(b&&!h&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Um(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(_=S.toArray(b)))return f=Si(f),_.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(s===!0?ki([f],j,i):s===null?f:f+"[]",d(w))}),!1}return to(b)?!0:(t.append(ki(h,f,i),d(b)),!1)}const p=[],m=Object.assign(Hm,{defaultVisitor:u,convertValue:d,isVisitable:to});function g(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(_,v){(!(S.isUndefined(_)||_===null)&&o.call(t,_,S.isString(v)?v.trim():v,f,m))===!0&&g(_,f?f.concat(v):[v])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ci(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ro(e,t){this._pairs=[],e&&Br(e,this,t)}const Ni=ro.prototype;Ni.append=function(t,r){this._pairs.push([t,r])},Ni.toString=function(t){const r=t?function(n){return t.call(this,n,Ci)}:Ci;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Vm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ei(e,t,r){if(!t)return e;const n=r&&r.encode||Vm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=S.isURLSearchParams(t)?t.toString():new ro(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ti{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ai={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Wm={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ro,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},no=typeof window<"u"&&typeof document<"u",oo=typeof navigator=="object"&&navigator||void 0,qm=no&&(!oo||["ReactNative","NativeScript","NS"].indexOf(oo.product)<0),Gm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Km=no&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:no,hasStandardBrowserEnv:qm,hasStandardBrowserWebWorkerEnv:Gm,navigator:oo,origin:Km},Symbol.toStringTag,{value:"Module"})),...Wm};function Ym(e,t){return Br(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Xm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Jm(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Pi(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&S.isArray(o)?o.length:s,c?(S.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!S.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&S.isArray(o[s])&&(o[s]=Jm(o[s])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Xm(n),o,r,0)}),r}return null}function Zm(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const sr={transitional:Ai,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Pi(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ym(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Br(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Zm(t)):t}],transformResponse:[function(t){const r=this.transitional||sr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?H.from(l,H.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{sr.headers[e]={}});const Qm=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ef=e=>{const t={};let r,n,o;return e&&e.split(`
     213`,Tr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=xu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Tr,left:Tr,right:Tr,bottom:Tr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?Cr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},q=ne;const Za={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],ot={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Za.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Wu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Qa=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Ku=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Yu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var ei={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ti=y.createContext&&y.createContext(ei),Xu=["attr","size","title"];function Ju(e,t){if(e==null)return{};var r=Zu(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ar.apply(this,arguments)}function ri(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ri(Object(r),!0).forEach(function(n){Qu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ri(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qu(e,t,r){return t=ep(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ep(e){var t=tp(e,"string");return typeof t=="symbol"?t:t+""}function tp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ni(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),ni(t.child)))}function U(e){return t=>y.createElement(rp,Ar({attr:Pr({},e.attr)},t),ni(e.child))}function rp(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Ju(e,Xu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Ar({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return ti!==void 0?y.createElement(ti.Consumer,null,r=>t(r)):t(ei)}function np(e){return U({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function at(e){return U({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function yt(e){return U({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Qt(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function er(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function op(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function ap(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function ip(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function it(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function sp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function oi(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function lp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function cp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(e)}function tr(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function Wn(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function dp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function up(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function pp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function mp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}function ai(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=ai(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():ai(e[o],null)}}}}function J(...e){return x.useCallback(qn(...e),e)}function st(e){const t=hp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(xp);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var fp=st("Slot");function hp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=vp(o),l=bp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?qn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gp=Symbol("radix.slottable");function xp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gp}function bp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function vp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ii(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ii(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function _p(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ii(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return _p(e)}const yp="ecr-button",jp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline","outline-danger":"ecr-button--outline-danger",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},Sp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function te({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?fp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:F(yp,jp[t],Sp[r],e),...o})}function kp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(te,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(te,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(te,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Wn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(te,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(oi,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(te,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(it,{className:"ecr-admin-reels-header__spinner"}):a.jsx(yt,{})," ","Create Widget"]}):null]})]})}function Cp(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function Np(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function lt(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function Ep(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(lt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Tp({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(it,{className:"ecr-admin-reels-loading__icon"})})}const si=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:F("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),wt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function Gn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Kn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Yn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Xn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const Ap="Left",Pp="Right",Op="Up",Rp="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Jn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},li="mousemove",ci="mouseup",Lp="touchend",Ip="touchmove",zp="touchstart";function Mp(e,t,r,n){return e>t?r>0?Pp:Ap:n>0?Rp:Op}function di(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function Dp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(li,n),document.addEventListener(ci,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=di([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Jn),{initial:h.slice(),xy:h,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=g?u.touches[0]:u,[h,v]=di([b,f],m.rotationAngle),_=h-p.xy[0],w=v-p.xy[1],j=Math.abs(_),k=Math.abs(w),N=(u.timeStamp||0)-p.start,C=Math.sqrt(j*j+k*k)/(N||1),E=[_/(N||1),w/(N||1)],T=Mp(j,k,_,w),O=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||jt.delta;if(j<O&&k<O&&!p.swiping)return p;const R={absX:j,absY:k,deltaX:_,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:C,vxvy:E};R.first&&m.onSwipeStart&&m.onSwipeStart(R),m.onSwiping&&m.onSwiping(R);let L=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(L=!0),L&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:R,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Jn),{eventData:g})})},i=()=>{document.removeEventListener(li,n),document.removeEventListener(ci,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},jt.touchEventOptions),p.touchEventOptions),b=[[zp,r,g],[Ip,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Lp,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Fp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function $p(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Jn)),n=x.useRef(Object.assign({},jt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},jt),e);let i;for(i in jt)n.current[i]===void 0&&(n.current[i]=jt[i]);const[s,l]=x.useMemo(()=>Dp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Fp(r.current,n.current,o.current,l),s}const Bp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"metadata",playsInline:!0,"webkit-playsinline":"true",muted:r,autoPlay:!n,controls:!1,loop:!1,"aria-label":"Reel video",disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onError:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},ui=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!0),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const v=p.current[h];v&&(i?v.play().catch(()=>{}):v.pause(),s(_=>!_))},g=h=>{const v=p.current[h];v&&(v.muted=!d,u(_=>!_))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=$p({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{b&&c()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((h,v)=>a.jsx("div",{className:"ecr-player__slide",children:h?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Bp,{videoRefs:p,file:h,isMuted:d,i:v,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:i},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}),d?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)}):a.jsx(Xn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)})]})]})},v))})},Up=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(wt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}):null,r.index<u-1?a.jsx(wt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(si,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(ui,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Hp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Vp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Wp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Or(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function qp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function pi(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Gp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Kp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function Yp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Xp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}const Jp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Zp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"metadata",poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Jp(r?.[e.id]??e.view_count)}),a.jsx(ap,{size:14})]})]})},Zn=y.memo(Zp);function Qp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:F("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Zn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(te,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(mp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(te,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(_t,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Or,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(te,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(Wn,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:F("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(te,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Gp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Kp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function em({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(Qp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const rr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Cp,{size:24})})};function tm(e){return U({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const nr=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(_t,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(tm,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Rr=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(lp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(it,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Lr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(_t,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Ir=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(it,{className:"ecr-admin-loader__icon",size:64})}),St=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(y.Fragment,{children:s},l))})]}),kt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function rm(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const zr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(rm,{}),"ReelsWP"]});function mi(e,t){return function(){return e.apply(t,arguments)}}const{toString:nm}=Object.prototype,{getPrototypeOf:Qn}=Object,{iterator:Mr,toStringTag:fi}=Symbol,Dr=(e=>t=>{const r=nm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>Dr(t)===e),Fr=e=>t=>typeof t===e,{isArray:Ct}=Array,Nt=Fr("undefined");function or(e){return e!==null&&!Nt(e)&&e.constructor!==null&&!Nt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const hi=we("ArrayBuffer");function om(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&hi(e.buffer),t}const am=Fr("string"),me=Fr("function"),gi=Fr("number"),ar=e=>e!==null&&typeof e=="object",im=e=>e===!0||e===!1,$r=e=>{if(Dr(e)!=="object")return!1;const t=Qn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(fi in e)&&!(Mr in e)},sm=e=>{if(!ar(e)||or(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},lm=we("Date"),cm=we("File"),dm=we("Blob"),um=we("FileList"),pm=e=>ar(e)&&me(e.pipe),mm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=Dr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},fm=we("URLSearchParams"),[hm,gm,xm,bm]=["ReadableStream","Request","Response","Headers"].map(we),vm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ir(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(or(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function xi(e,t){if(or(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bi=e=>!Nt(e)&&e!==ct;function eo(){const{caseless:e,skipUndefined:t}=bi(this)&&this||{},r={},n=(o,i)=>{const s=e&&xi(r,i)||i;$r(r[s])&&$r(o)?r[s]=eo(r[s],o):$r(o)?r[s]=eo({},o):Ct(o)?r[s]=o.slice():(!t||!Nt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ir(arguments[o],n);return r}const _m=(e,t,r,{allOwnKeys:n}={})=>(ir(t,(o,i)=>{r&&me(o)?e[i]=mi(o,r):e[i]=o},{allOwnKeys:n}),e),ym=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),wm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},jm=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Qn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Sm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},km=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!gi(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Cm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qn(Uint8Array)),Nm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Em=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Tm=we("HTMLFormElement"),Am=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),vi=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Pm=we("RegExp"),_i=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ir(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Om=e=>{_i(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Rm=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},Lm=()=>{},Im=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function zm(e){return!!(e&&me(e.append)&&e[fi]==="FormData"&&e[Mr])}const Mm=e=>{const t=new Array(10),r=(n,o)=>{if(ar(n)){if(t.indexOf(n)>=0)return;if(or(n))return n;if(!("toJSON"in n)){t[o]=n;const i=Ct(n)?[]:{};return ir(n,(s,l)=>{const c=r(s,o+1);!Nt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},Dm=we("AsyncFunction"),Fm=e=>e&&(ar(e)||me(e))&&me(e.then)&&me(e.catch),yi=((e,t)=>e?setImmediate:t?((r,n)=>(ct.addEventListener("message",({source:o,data:i})=>{o===ct&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ct.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(ct.postMessage)),$m=typeof queueMicrotask<"u"?queueMicrotask.bind(ct):typeof process<"u"&&process.nextTick||yi,S={isArray:Ct,isArrayBuffer:hi,isBuffer:or,isFormData:mm,isArrayBufferView:om,isString:am,isNumber:gi,isBoolean:im,isObject:ar,isPlainObject:$r,isEmptyObject:sm,isReadableStream:hm,isRequest:gm,isResponse:xm,isHeaders:bm,isUndefined:Nt,isDate:lm,isFile:cm,isBlob:dm,isRegExp:Pm,isFunction:me,isStream:pm,isURLSearchParams:fm,isTypedArray:Cm,isFileList:um,forEach:ir,merge:eo,extend:_m,trim:vm,stripBOM:ym,inherits:wm,toFlatObject:jm,kindOf:Dr,kindOfTest:we,endsWith:Sm,toArray:km,forEachEntry:Nm,matchAll:Em,isHTMLForm:Tm,hasOwnProperty:vi,hasOwnProp:vi,reduceDescriptors:_i,freezeMethods:Om,toObjectSet:Rm,toCamelCase:Am,noop:Lm,toFiniteNumber:Im,findKey:xi,global:ct,isContextDefined:bi,isSpecCompliantForm:zm,toJSONObject:Mm,isAsyncFn:Dm,isThenable:Fm,setImmediate:yi,asap:$m,isIterable:e=>e!=null&&me(e[Mr])};function H(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(H,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const wi=H.prototype,ji={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ji[e]={value:e}}),Object.defineProperties(H,ji),Object.defineProperty(wi,"isAxiosError",{value:!0}),H.from=(e,t,r,n,o,i)=>{const s=Object.create(wi);S.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return H.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Bm=null;function to(e){return S.isPlainObject(e)||S.isArray(e)}function Si(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function ki(e,t,r){return e?e.concat(t).map(function(o,i){return o=Si(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Um(e){return S.isArray(e)&&!e.some(to)}const Hm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Br(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!S.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!c&&S.isBlob(b))throw new H("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let v=b;if(b&&!h&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Um(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(v=S.toArray(b)))return f=Si(f),v.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(s===!0?ki([f],j,i):s===null?f:f+"[]",d(w))}),!1}return to(b)?!0:(t.append(ki(h,f,i),d(b)),!1)}const p=[],m=Object.assign(Hm,{defaultVisitor:u,convertValue:d,isVisitable:to});function g(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(v,_){(!(S.isUndefined(v)||v===null)&&o.call(t,v,S.isString(_)?_.trim():_,f,m))===!0&&g(v,f?f.concat(_):[_])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ci(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ro(e,t){this._pairs=[],e&&Br(e,this,t)}const Ni=ro.prototype;Ni.append=function(t,r){this._pairs.push([t,r])},Ni.toString=function(t){const r=t?function(n){return t.call(this,n,Ci)}:Ci;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Vm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ei(e,t,r){if(!t)return e;const n=r&&r.encode||Vm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=S.isURLSearchParams(t)?t.toString():new ro(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ti{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ai={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Wm={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ro,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},no=typeof window<"u"&&typeof document<"u",oo=typeof navigator=="object"&&navigator||void 0,qm=no&&(!oo||["ReactNative","NativeScript","NS"].indexOf(oo.product)<0),Gm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Km=no&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:no,hasStandardBrowserEnv:qm,hasStandardBrowserWebWorkerEnv:Gm,navigator:oo,origin:Km},Symbol.toStringTag,{value:"Module"})),...Wm};function Ym(e,t){return Br(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Xm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Jm(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Pi(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&S.isArray(o)?o.length:s,c?(S.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!S.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&S.isArray(o[s])&&(o[s]=Jm(o[s])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Xm(n),o,r,0)}),r}return null}function Zm(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const sr={transitional:Ai,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Pi(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ym(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Br(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Zm(t)):t}],transformResponse:[function(t){const r=this.transitional||sr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?H.from(l,H.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{sr.headers[e]={}});const Qm=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ef=e=>{const t={};let r,n,o;return e&&e.split(`
    214214`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Qm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Oi=Symbol("internals");function lr(e){return e&&String(e).trim().toLowerCase()}function Ur(e){return e===!1||e==null?e:S.isArray(e)?e.map(Ur):String(e)}function tf(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const rf=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ao(e,t,r,n,o){if(S.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!S.isString(t)){if(S.isString(n))return t.indexOf(n)!==-1;if(S.isRegExp(n))return n.test(t)}}function nf(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function of(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=lr(c);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Ur(l))}const s=(l,c)=>S.forEach(l,(d,u)=>i(d,u,c));if(S.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(S.isString(t)&&(t=t.trim())&&!rf(t))s(ef(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},c,d;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?S.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=lr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return tf(o);if(S.isFunction(r))return r.call(this,o,n);if(S.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=lr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ao(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=lr(s),s){const l=S.findKey(n,s);l&&(!r||ao(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||ao(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,i)=>{const s=S.findKey(n,i);if(s){r[s]=Ur(o),delete r[i];return}const l=t?nf(i):String(i).trim();l!==i&&delete r[i],r[l]=Ur(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return S.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&S.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
    215 `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Oi]=this[Oi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=lr(s);n[l]||(of(o,s),n[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(fe);function io(e,t){const r=this||sr,n=t||r,o=fe.from(n.headers);let i=n.data;return S.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ri(e){return!!(e&&e.__CANCEL__)}function Et(e,t,r){H.call(this,e??"canceled",H.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(Et,H,{__CANCEL__:!0});function Li(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new H("Request failed with status code "+r.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function af(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function sf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function lf(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Hr=(e,t,r=3)=>{let n=0;const o=sf(50,250);return lf(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Ii=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},zi=e=>(...t)=>S.asap(()=>e(...t)),cf=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,df=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function uf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function pf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Mi(e,t,r){let n=!uf(t);return e&&(n||r==!1)?pf(e,t):t}const Di=e=>e instanceof fe?{...e}:e;function dt(e,t){t=t||{};const r={};function n(d,u,p,m){return S.isPlainObject(d)&&S.isPlainObject(u)?S.merge.call({caseless:m},d,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(d,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!S.isUndefined(u))return n(void 0,u)}function s(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Di(d),Di(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Fi=e=>{const t=dt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Ei(Mi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&cf(t.url))){const c=o&&i&&df.read(i);c&&s.set(o,c)}return t},mf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Fi(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function _(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Li(function(C){r(C),f()},function(C){n(C),f()},k),h=null}"onloadend"in h?h.onloadend=_:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(_)},h.onabort=function(){h&&(n(new H("Request aborted",H.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const k=j&&j.message?j.message:"Network Error",N=new H(k,H.ERR_NETWORK,e,h);N.event=j||null,n(N),h=null},h.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const k=o.transitional||Ai;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new H(j,k.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&S.forEach(s.toJSON(),function(j,k){h.setRequestHeader(k,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Hr(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Hr(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Et(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const v=af(o.url);if(v&&ue.protocols.indexOf(v)===-1){n(new H("Unsupported protocol "+v+":",H.ERR_BAD_REQUEST,e));return}h.send(i||null)})},ff=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof H?u:new Et(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new H(`timeout ${t} of ms exceeded`,H.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>S.asap(l),c}},hf=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},gf=async function*(e,t){for await(const r of xf(e))yield*hf(r,t)},xf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},$i=(e,t,r,n)=>{const o=gf(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Bi=64*1024,{isFunction:Vr}=S,bf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Ui,TextEncoder:Hi}=S.global,Vi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},_f=e=>{e=S.merge.call({skipUndefined:!0},bf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Vr(t):typeof fetch=="function",i=Vr(r),s=Vr(n);if(!o)return!1;const l=o&&Vr(Ui),c=o&&(typeof Hi=="function"?(b=>f=>b.encode(f))(new Hi):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Vi(()=>{let b=!1;const f=new r(ue.origin,{body:new Ui,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Vi(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,h)=>{let _=f&&f[b];if(_)return _.call(f);throw new H(`Response type '${b}' is not supported`,H.ERR_NOT_SUPPORT,h)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=S.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:_,signal:v,cancelToken:w,timeout:j,onDownloadProgress:k,onUploadProgress:N,responseType:C,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Fi(b),O=t||fetch;C=C?(C+"").toLowerCase():"text";let R=ff([v,w&&w.toAbortSignal()],j),L=null;const P=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let M;try{if(N&&d&&h!=="get"&&h!=="head"&&(M=await g(E,_))!==0){let ie=new r(f,{method:"POST",body:_,duplex:"half"}),ge;if(S.isFormData(_)&&(ge=ie.headers.get("content-type"))&&E.setContentType(ge),ie.body){const[_e,pe]=Ii(M,Hr(zi(N)));_=$i(ie.body,Bi,_e,pe)}}S.isString(T)||(T=T?"include":"omit");const I=i&&"credentials"in r.prototype,B={...A,signal:R,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:I?T:void 0};L=i&&new r(f,B);let z=await(i?O(L,A):O(f,B));const G=u&&(C==="stream"||C==="response");if(u&&(k||G&&P)){const ie={};["status","statusText","headers"].forEach(K=>{ie[K]=z[K]});const ge=S.toFiniteNumber(z.headers.get("content-length")),[_e,pe]=k&&Ii(ge,Hr(zi(k),!0))||[];z=new n($i(z.body,Bi,_e,()=>{pe&&pe(),P&&P()}),ie)}C=C||"text";let ae=await p[S.findKey(p,C)||"text"](z,b);return!G&&P&&P(),await new Promise((ie,ge)=>{Li(ie,ge,{data:ae,headers:fe.from(z.headers),status:z.status,statusText:z.statusText,config:b,request:L})})}catch(I){throw P&&P(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new H("Network Error",H.ERR_NETWORK,b,L),{cause:I.cause||I}):H.from(I,I&&I.code,b,L)}}},vf=new Map,Wi=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=vf;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:_f(t)),u=d;return d};Wi();const so={http:Bm,xhr:mf,fetch:{get:Wi}};S.forEach(so,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const qi=e=>`- ${e}`,yf=e=>S.isFunction(e)||e===null||e===!1;function wf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!yf(n)&&(o=so[(l=String(n)).toLowerCase()],o===void 0))throw new H(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
     215`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Oi]=this[Oi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=lr(s);n[l]||(of(o,s),n[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(fe);function io(e,t){const r=this||sr,n=t||r,o=fe.from(n.headers);let i=n.data;return S.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ri(e){return!!(e&&e.__CANCEL__)}function Et(e,t,r){H.call(this,e??"canceled",H.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(Et,H,{__CANCEL__:!0});function Li(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new H("Request failed with status code "+r.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function af(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function sf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function lf(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Hr=(e,t,r=3)=>{let n=0;const o=sf(50,250);return lf(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Ii=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},zi=e=>(...t)=>S.asap(()=>e(...t)),cf=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,df=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function uf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function pf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Mi(e,t,r){let n=!uf(t);return e&&(n||r==!1)?pf(e,t):t}const Di=e=>e instanceof fe?{...e}:e;function dt(e,t){t=t||{};const r={};function n(d,u,p,m){return S.isPlainObject(d)&&S.isPlainObject(u)?S.merge.call({caseless:m},d,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(d,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!S.isUndefined(u))return n(void 0,u)}function s(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Di(d),Di(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Fi=e=>{const t=dt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Ei(Mi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&cf(t.url))){const c=o&&i&&df.read(i);c&&s.set(o,c)}return t},mf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Fi(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function v(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Li(function(C){r(C),f()},function(C){n(C),f()},k),h=null}"onloadend"in h?h.onloadend=v:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(v)},h.onabort=function(){h&&(n(new H("Request aborted",H.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const k=j&&j.message?j.message:"Network Error",N=new H(k,H.ERR_NETWORK,e,h);N.event=j||null,n(N),h=null},h.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const k=o.transitional||Ai;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new H(j,k.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&S.forEach(s.toJSON(),function(j,k){h.setRequestHeader(k,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Hr(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Hr(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Et(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const _=af(o.url);if(_&&ue.protocols.indexOf(_)===-1){n(new H("Unsupported protocol "+_+":",H.ERR_BAD_REQUEST,e));return}h.send(i||null)})},ff=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof H?u:new Et(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new H(`timeout ${t} of ms exceeded`,H.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>S.asap(l),c}},hf=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},gf=async function*(e,t){for await(const r of xf(e))yield*hf(r,t)},xf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},$i=(e,t,r,n)=>{const o=gf(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Bi=64*1024,{isFunction:Vr}=S,bf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Ui,TextEncoder:Hi}=S.global,Vi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},vf=e=>{e=S.merge.call({skipUndefined:!0},bf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Vr(t):typeof fetch=="function",i=Vr(r),s=Vr(n);if(!o)return!1;const l=o&&Vr(Ui),c=o&&(typeof Hi=="function"?(b=>f=>b.encode(f))(new Hi):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Vi(()=>{let b=!1;const f=new r(ue.origin,{body:new Ui,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Vi(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,h)=>{let v=f&&f[b];if(v)return v.call(f);throw new H(`Response type '${b}' is not supported`,H.ERR_NOT_SUPPORT,h)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=S.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:v,signal:_,cancelToken:w,timeout:j,onDownloadProgress:k,onUploadProgress:N,responseType:C,headers:E,withCredentials:T="same-origin",fetchOptions:O}=Fi(b),R=t||fetch;C=C?(C+"").toLowerCase():"text";let L=ff([_,w&&w.toAbortSignal()],j),A=null;const P=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let z;try{if(N&&d&&h!=="get"&&h!=="head"&&(z=await g(E,v))!==0){let se=new r(f,{method:"POST",body:v,duplex:"half"}),ge;if(S.isFormData(v)&&(ge=se.headers.get("content-type"))&&E.setContentType(ge),se.body){const[ve,pe]=Ii(z,Hr(zi(N)));v=$i(se.body,Bi,ve,pe)}}S.isString(T)||(T=T?"include":"omit");const I=i&&"credentials"in r.prototype,B={...O,signal:L,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:I?T:void 0};A=i&&new r(f,B);let M=await(i?R(A,O):R(f,B));const G=u&&(C==="stream"||C==="response");if(u&&(k||G&&P)){const se={};["status","statusText","headers"].forEach(K=>{se[K]=M[K]});const ge=S.toFiniteNumber(M.headers.get("content-length")),[ve,pe]=k&&Ii(ge,Hr(zi(k),!0))||[];M=new n($i(M.body,Bi,ve,()=>{pe&&pe(),P&&P()}),se)}C=C||"text";let ie=await p[S.findKey(p,C)||"text"](M,b);return!G&&P&&P(),await new Promise((se,ge)=>{Li(se,ge,{data:ie,headers:fe.from(M.headers),status:M.status,statusText:M.statusText,config:b,request:A})})}catch(I){throw P&&P(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new H("Network Error",H.ERR_NETWORK,b,A),{cause:I.cause||I}):H.from(I,I&&I.code,b,A)}}},_f=new Map,Wi=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=_f;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:vf(t)),u=d;return d};Wi();const so={http:Bm,xhr:mf,fetch:{get:Wi}};S.forEach(so,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const qi=e=>`- ${e}`,yf=e=>S.isFunction(e)||e===null||e===!1;function wf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!yf(n)&&(o=so[(l=String(n)).toLowerCase()],o===void 0))throw new H(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
    216216`+s.map(qi).join(`
    217217`):" "+qi(s[0]):"as no adapter specified";throw new H("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Gi={getAdapter:wf,adapters:so};function lo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Et(null,e)}function Ki(e){return lo(e),e.headers=fe.from(e.headers),e.data=io.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Gi.getAdapter(e.adapter||sr.adapter,e)(e).then(function(n){return lo(e),n.data=io.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return Ri(n)||(lo(e),n&&n.response&&(n.response.data=io.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const Yi="1.13.1",Wr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Xi={};Wr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Yi+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new H(o(s," has been removed"+(r?" in "+r:"")),H.ERR_DEPRECATED);return r&&!Xi[s]&&(Xi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Wr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function jf(e,t,r){if(typeof e!="object")throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new H("option "+i+" must be "+c,H.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new H("Unknown option "+i,H.ERR_BAD_OPTION)}}const qr={assertOptions:jf,validators:Wr},Te=qr.validators;let ut=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ti,response:new Ti}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
    218 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=dt(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&qr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:qr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),qr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[r.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[Ki.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=Ki.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=dt(this.defaults,t);const r=Mi(t.baseURL,t.url,t.allowAbsoluteUrls);return Ei(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){ut.prototype[t]=function(r,n){return this.request(dt(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(dt(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ut.prototype[t]=r(),ut.prototype[t+"Form"]=r(!0)});let Sf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Et(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sd(function(o){t=o}),cancel:t}}};function kf(e){return function(r){return e.apply(null,r)}}function Cf(e){return S.isObject(e)&&e.isAxiosError===!0}const co={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(co).forEach(([e,t])=>{co[t]=e});function Ji(e){const t=new ut(e),r=mi(ut.prototype.request,t);return S.extend(r,ut.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Ji(dt(e,o))},r}const ee=Ji(sr);ee.Axios=ut,ee.CanceledError=Et,ee.CancelToken=Sf,ee.isCancel=Ri,ee.VERSION=Yi,ee.toFormData=Br,ee.AxiosError=H,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=kf,ee.isAxiosError=Cf,ee.mergeConfig=dt,ee.AxiosHeaders=fe,ee.formToJSON=e=>Pi(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=Gi.getAdapter,ee.HttpStatusCode=co,ee.default=ee;const{Axios:qv,AxiosError:Gv,CanceledError:Kv,isCancel:Yv,CancelToken:Xv,VERSION:Jv,all:Zv,Cancel:Qv,isAxiosError:e1,spread:t1,toFormData:r1,AxiosHeaders:n1,HttpStatusCode:o1,formToJSON:a1,getAdapter:i1,mergeConfig:s1}=ee,Zi=ecommreelsInfo,he=ee.create({baseURL:`${Zi.apiBase}`,headers:{"X-WP-Nonce":Zi.nonce,"Content-Type":"application/json"}}),Nf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:ot,story_ids:s},c=await he.post("stories/manage-group-stories",l);return q.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?q.error(l.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||q.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||q.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:ot,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function uo(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Qi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),g=uo(p,500),b=y.useRef(!0),f=y.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const k=await he.get("stories",{params:j}),N=k.data,C=parseInt(k.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<C)}catch(j){j instanceof Error?q.error(j.message):q.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=y.useCallback(()=>{o(1),r([]),f(1)},[f]);y.useEffect(()=>{h()},[g,h]);const _=y.useRef(null),v=y.useCallback(w=>{l||(_.current&&_.current.disconnect(),_.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&_.current.observe(w))},[l,i,n,f]);return y.useEffect(()=>()=>{_.current&&_.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:v,refreshReels:h}};function Ef(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Qi(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Nf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[_,v]=y.useState(null),[w,j]=y.useState([]),k=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},C=A=>{j(O=>O.includes(A)?O.filter(R=>R!==A):[...O,A])},E=()=>{w.length&&h(w)},T=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(P=>m(P,r,{silent:!0}))),O=f.filter((P,M)=>A[M]?.ok),R=O.length,L=f.length-R;R&&(r(P=>P.filter(M=>!O.includes(M.id))),j(P=>P.filter(M=>!O.includes(M)))),R&&q.success(`${R} reels deleted successfully!`),L&&q.error(`${L} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Rr,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(St,{left:[a.jsx(kt,{name:"All Reels",Icon:np},"page"),a.jsx(rr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsx(Lr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:yt},"add-reel-all-reel")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(kp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:k,handleBulkDelete:E}),t.length?a.jsx(em,{reels:t,styles:c,selectedReelIds:w,onSelectReel:C,onDeleteReel:b,onPreviewReel:v,lastStoryElementRef:o}):!n&&!l?a.jsx(Ep,{}):null,n&&a.jsx(Tp,{isFullScreen:!t.length})]}),!!_&&a.jsx(Up,{previewReel:_,setPreviewReel:v})]})}const Tf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,thumbnail:l,links:s};n&&(c.story_id=n);const d=await he.post("files",c);return q.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},po=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(te,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(it,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(sp,{className:"ecr-admin-save-button__icon"})," ",r]}),es=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Af=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Jt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=Tf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:l?"Update Reel":"Add Reel",Icon:yt},"page"),a.jsx(rr,{},"back")],center:[a.jsx(es,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(po,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})};/**
     218`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=dt(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&qr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:qr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),qr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[r.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[Ki.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=Ki.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=dt(this.defaults,t);const r=Mi(t.baseURL,t.url,t.allowAbsoluteUrls);return Ei(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){ut.prototype[t]=function(r,n){return this.request(dt(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(dt(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ut.prototype[t]=r(),ut.prototype[t+"Form"]=r(!0)});let Sf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Et(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sd(function(o){t=o}),cancel:t}}};function kf(e){return function(r){return e.apply(null,r)}}function Cf(e){return S.isObject(e)&&e.isAxiosError===!0}const co={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(co).forEach(([e,t])=>{co[t]=e});function Ji(e){const t=new ut(e),r=mi(ut.prototype.request,t);return S.extend(r,ut.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Ji(dt(e,o))},r}const ee=Ji(sr);ee.Axios=ut,ee.CanceledError=Et,ee.CancelToken=Sf,ee.isCancel=Ri,ee.VERSION=Yi,ee.toFormData=Br,ee.AxiosError=H,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=kf,ee.isAxiosError=Cf,ee.mergeConfig=dt,ee.AxiosHeaders=fe,ee.formToJSON=e=>Pi(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=Gi.getAdapter,ee.HttpStatusCode=co,ee.default=ee;const{Axios:G_,AxiosError:K_,CanceledError:Y_,isCancel:X_,CancelToken:J_,VERSION:Z_,all:Q_,Cancel:e1,isAxiosError:t1,spread:r1,toFormData:n1,AxiosHeaders:o1,HttpStatusCode:a1,formToJSON:i1,getAdapter:s1,mergeConfig:l1}=ee,Zi=ecommreelsInfo,he=ee.create({baseURL:`${Zi.apiBase}`,headers:{"X-WP-Nonce":Zi.nonce,"Content-Type":"application/json"}}),Nf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:ot,story_ids:s},c=await he.post("stories/manage-group-stories",l);return q.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?q.error(l.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||q.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||q.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:ot,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function uo(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Qi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),g=uo(p,500),b=y.useRef(!0),f=y.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const k=await he.get("stories",{params:j}),N=k.data,C=parseInt(k.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<C)}catch(j){j instanceof Error?q.error(j.message):q.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=y.useCallback(()=>{o(1),r([]),f(1)},[f]);y.useEffect(()=>{h()},[g,h]);const v=y.useRef(null),_=y.useCallback(w=>{l||(v.current&&v.current.disconnect(),v.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&v.current.observe(w))},[l,i,n,f]);return y.useEffect(()=>()=>{v.current&&v.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:_,refreshReels:h}};function Ef(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Qi(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Nf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[v,_]=y.useState(null),[w,j]=y.useState([]),k=async()=>{const O=await p(w);O&&e(`?view=${X.mg}&gid=${O}`)},N=()=>{j(t.map(O=>O.id))},C=O=>{j(R=>R.includes(O)?R.filter(L=>L!==O):[...R,O])},E=()=>{w.length&&h(w)},T=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const O=await Promise.all(f.map(P=>m(P,r,{silent:!0}))),R=f.filter((P,z)=>O[z]?.ok),L=R.length,A=f.length-L;L&&(r(P=>P.filter(z=>!R.includes(z.id))),j(P=>P.filter(z=>!R.includes(z)))),L&&q.success(`${L} reels deleted successfully!`),A&&q.error(`${A} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Rr,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(St,{left:[a.jsx(kt,{name:"All Reels",Icon:np},"page"),a.jsx(rr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsx(Lr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:yt},"add-reel-all-reel")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(kp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:k,handleBulkDelete:E}),t.length?a.jsx(em,{reels:t,styles:c,selectedReelIds:w,onSelectReel:C,onDeleteReel:b,onPreviewReel:_,lastStoryElementRef:o}):!n&&!l?a.jsx(Ep,{}):null,n&&a.jsx(Tp,{isFullScreen:!t.length})]}),!!v&&a.jsx(Up,{previewReel:v,setPreviewReel:_})]})}const Tf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,thumbnail:l,links:s};n&&(c.story_id=n);const d=await he.post("files",c);return q.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},po=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(te,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(it,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(sp,{className:"ecr-admin-save-button__icon"})," ",r]}),es=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Af=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Jt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=Tf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:l?"Update Reel":"Add Reel",Icon:yt},"page"),a.jsx(rr,{},"back")],center:[a.jsx(es,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(po,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})};/**
    219219 * @license lucide-react v0.552.0 - ISC
    220220 *
     
    236236 * This source code is licensed under the ISC license.
    237237 * See the LICENSE file in the root directory of this source tree.
    238  */const se=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(If,{ref:i,iconNode:t,className:rs(`lucide-${Pf(ts(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ts(e),r};/**
    239  * @license lucide-react v0.552.0 - ISC
    240  *
    241  * This source code is licensed under the ISC license.
    242  * See the LICENSE file in the root directory of this source tree.
    243  */const zf=se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
    244  * @license lucide-react v0.552.0 - ISC
    245  *
    246  * This source code is licensed under the ISC license.
    247  * See the LICENSE file in the root directory of this source tree.
    248  */const mo=se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
    249  * @license lucide-react v0.552.0 - ISC
    250  *
    251  * This source code is licensed under the ISC license.
    252  * See the LICENSE file in the root directory of this source tree.
    253  */const Mf=se("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
    254  * @license lucide-react v0.552.0 - ISC
    255  *
    256  * This source code is licensed under the ISC license.
    257  * See the LICENSE file in the root directory of this source tree.
    258  */const Df=se("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
    259  * @license lucide-react v0.552.0 - ISC
    260  *
    261  * This source code is licensed under the ISC license.
    262  * See the LICENSE file in the root directory of this source tree.
    263  */const Ff=se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
    264  * @license lucide-react v0.552.0 - ISC
    265  *
    266  * This source code is licensed under the ISC license.
    267  * See the LICENSE file in the root directory of this source tree.
    268  */const $f=se("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
    269  * @license lucide-react v0.552.0 - ISC
    270  *
    271  * This source code is licensed under the ISC license.
    272  * See the LICENSE file in the root directory of this source tree.
    273  */const Bf=se("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
    274  * @license lucide-react v0.552.0 - ISC
    275  *
    276  * This source code is licensed under the ISC license.
    277  * See the LICENSE file in the root directory of this source tree.
    278  */const Uf=se("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
    279  * @license lucide-react v0.552.0 - ISC
    280  *
    281  * This source code is licensed under the ISC license.
    282  * See the LICENSE file in the root directory of this source tree.
    283  */const Hf=se("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
    284  * @license lucide-react v0.552.0 - ISC
    285  *
    286  * This source code is licensed under the ISC license.
    287  * See the LICENSE file in the root directory of this source tree.
    288  */const Vf=se("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
    289  * @license lucide-react v0.552.0 - ISC
    290  *
    291  * This source code is licensed under the ISC license.
    292  * See the LICENSE file in the root directory of this source tree.
    293  */const Wf=se("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
    294  * @license lucide-react v0.552.0 - ISC
    295  *
    296  * This source code is licensed under the ISC license.
    297  * See the LICENSE file in the root directory of this source tree.
    298  */const qf=se("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
    299  * @license lucide-react v0.552.0 - ISC
    300  *
    301  * This source code is licensed under the ISC license.
    302  * See the LICENSE file in the root directory of this source tree.
    303  */const Gf=se("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
    304  * @license lucide-react v0.552.0 - ISC
    305  *
    306  * This source code is licensed under the ISC license.
    307  * See the LICENSE file in the root directory of this source tree.
    308  */const Kf=se("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
    309  * @license lucide-react v0.552.0 - ISC
    310  *
    311  * This source code is licensed under the ISC license.
    312  * See the LICENSE file in the root directory of this source tree.
    313  */const Yf=se("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
    314  * @license lucide-react v0.552.0 - ISC
    315  *
    316  * This source code is licensed under the ISC license.
    317  * See the LICENSE file in the root directory of this source tree.
    318  */const Xf=se("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
    319  * @license lucide-react v0.552.0 - ISC
    320  *
    321  * This source code is licensed under the ISC license.
    322  * See the LICENSE file in the root directory of this source tree.
    323  */const ns=se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Jf(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,Zf(o,...t)]}function Zf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Qf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=Qf.reduce((e,t)=>{const r=st(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function eh(e,t){e&&_r.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function th(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var rh="DismissableLayer",fo="dismissableLayer.update",nh="dismissableLayer.pointerDownOutside",oh="dismissableLayer.focusOutside",os,as=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(as),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,C=>p(C)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(h),v=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=v>=_,k=sh(C=>{const E=C.target,T=[...d.branches].some(A=>A.contains(E));!j||T||(o?.(C),s?.(C),C.defaultPrevented||l?.())},m),N=lh(C=>{const E=C.target;[...d.branches].some(A=>A.contains(E))||(i?.(C),s?.(C),C.defaultPrevented||l?.())},m);return th(C=>{v===d.layers.size-1&&(n?.(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(os=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),is(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=os)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),is())},[u,d]),x.useEffect(()=>{const C=()=>g({});return document.addEventListener(fo,C),()=>document.removeEventListener(fo,C)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,k.onPointerDownCapture)})});Gr.displayName=rh;var ah="DismissableLayerBranch",ih=x.forwardRef((e,t)=>{const r=x.useContext(as),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ih.displayName=ah;function sh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ss(nh,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function lh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ss(oh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function is(){const e=new CustomEvent(fo);document.dispatchEvent(e)}function ss(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?eh(o,i):o.dispatchEvent(i)}var ho=0;function go(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ls()),document.body.insertAdjacentElement("beforeend",e[1]??ls()),ho++,()=>{ho===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ho--}},[])}function ls(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xo="focusScope.autoFocusOnMount",bo="focusScope.autoFocusOnUnmount",cs={bubbles:!1,cancelable:!0},ch="FocusScope",Kr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const v=new MutationObserver(_);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),v.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){ps.add(g);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(xo,cs);l.addEventListener(xo,d),l.dispatchEvent(_),_.defaultPrevented||(dh(hh(ds(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(xo,d),setTimeout(()=>{const _=new CustomEvent(bo,cs);l.addEventListener(bo,u),l.dispatchEvent(_),_.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(bo,u),ps.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(h&&_){const v=f.currentTarget,[w,j]=uh(v);w&&j?!f.shiftKey&&_===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&qe(j,{select:!0})):_===v&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Kr.displayName=ch;function dh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function uh(e){const t=ds(e),r=us(t,e),n=us(t.reverse(),e);return[r,n]}function ds(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function us(e,t){for(const r of e)if(!ph(r,{upTo:t}))return r}function ph(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function mh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&mh(e)&&t&&e.select()}}var ps=fh();function fh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=ms(e,t),e.unshift(t)},remove(t){e=ms(e,t),e[0]?.resume()}}}function ms(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function hh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},gh=x[" useId ".trim().toString()]||(()=>{}),xh=0;function Ae(e){const[t,r]=x.useState(gh());return le(()=>{r(n=>n??String(xh++))},[e]),e||(t?`radix-${t}`:"")}const bh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Yr=Math.round,Xr=Math.floor,Pe=e=>({x:e,y:e}),_h={left:"right",right:"left",bottom:"top",top:"bottom"},vh={start:"end",end:"start"};function _o(e,t,r){return xe(e,Ge(t,r))}function Fe(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function vo(e){return e==="x"?"y":"x"}function yo(e){return e==="y"?"height":"width"}const yh=new Set(["top","bottom"]);function Oe(e){return yh.has($e(e))?"y":"x"}function wo(e){return vo(Oe(e))}function wh(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=wo(e),i=yo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function jh(e){const t=Jr(e);return[jo(e),t,jo(t)]}function jo(e){return e.replace(/start|end/g,t=>vh[t])}const fs=["left","right"],hs=["right","left"],Sh=["top","bottom"],kh=["bottom","top"];function Ch(e,t,r){switch(e){case"top":case"bottom":return r?t?hs:fs:t?fs:hs;case"left":case"right":return t?Sh:kh;default:return[]}}function Nh(e,t,r,n){const o=Tt(e);let i=Ch($e(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(jo)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>_h[t])}function Eh(e){return{top:0,right:0,bottom:0,left:0,...e}}function gs(e){return typeof e!="number"?Eh(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function xs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=wo(t),l=yo(s),c=$e(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Th=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=xs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:_}=l[f],{x:v,y:w,data:j,reset:k}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=v??u,p=w??p,g={...g,[h]:{...g[h],...j}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(d=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:u,y:p}=xs(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function cr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Fe(t,e),b=gs(g),h=l[m?p==="floating"?"reference":"floating":p],_=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},k=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(_.top-k.top+b.top)/j.y,bottom:(k.bottom-_.bottom+b.bottom)/j.y,left:(_.left-k.left+b.left)/j.x,right:(k.right-_.right+b.right)/j.x}}const Ah=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Fe(e,t)||{};if(d==null)return{};const p=gs(u),m={x:r,y:n},g=wo(o),b=yo(g),f=await s.getDimensions(d),h=g==="y",_=h?"top":"left",v=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],k=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let C=N?N[w]:0;(!C||!await(s.isElement==null?void 0:s.isElement(N)))&&(C=l.floating[w]||i.floating[b]);const E=j/2-k/2,T=C/2-f[b]/2-1,A=Ge(p[_],T),O=Ge(p[v],T),R=A,L=C-f[b]-O,P=C/2-f[b]/2+E,M=_o(R,P,L),I=!c.arrow&&Tt(o)!=null&&P!==M&&i.reference[b]/2-(P<R?A:O)-f[b]/2<0,B=I?P<R?P-R:P-L:0;return{[g]:m[g]+B,data:{[g]:M,centerOffset:P-M-B,...I&&{alignmentOffset:B}},reset:I}}}),Ph=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=Fe(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const _=$e(o),v=Oe(l),w=$e(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=m||(w||!f?[Jr(l)]:jh(l)),N=b!=="none";!m&&N&&k.push(...Nh(l,f,b,j));const C=[l,...k],E=await cr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[_]),p){const P=wh(o,s,j);T.push(E[P[0]],E[P[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(P=>P<=0)){var O,R;const P=(((O=i.flip)==null?void 0:O.index)||0)+1,M=C[P];if(M&&(!(p==="alignment"?v!==Oe(M):!1)||A.every(z=>Oe(z.placement)===v?z.overflows[0]>0:!0)))return{data:{index:P,overflows:A},reset:{placement:M}};let I=(R=A.filter(B=>B.overflows[0]<=0).sort((B,z)=>B.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!I)switch(g){case"bestFit":{var L;const B=(L=A.filter(z=>{if(N){const G=Oe(z.placement);return G===v||G==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(G=>G>0).reduce((G,ae)=>G+ae,0)]).sort((z,G)=>z[1]-G[1])[0])==null?void 0:L[0];B&&(I=B);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function bs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _s(e){return bh.some(t=>e[t]>=0)}const Oh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fe(e,t);switch(n){case"referenceHidden":{const i=await cr(t,{...o,elementContext:"reference"}),s=bs(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_s(s)}}}case"escaped":{const i=await cr(t,{...o,altBoundary:!0}),s=bs(i,r.floating);return{data:{escapedOffsets:s,escaped:_s(s)}}}default:return{}}}}},vs=new Set(["left","top"]);async function Rh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$e(r),l=Tt(r),c=Oe(r)==="y",d=vs.has(s)?-1:1,u=i&&c?-1:1,p=Fe(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const Lh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Rh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Ih=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:_,y:v}=h;return{x:_,y:v}}},...c}=Fe(e,t),d={x:r,y:n},u=await cr(t,c),p=Oe($e(o)),m=vo(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",_=m==="y"?"bottom":"right",v=g+u[h],w=g-u[_];g=_o(v,g,w)}if(s){const h=p==="y"?"top":"left",_=p==="y"?"bottom":"right",v=b+u[h],w=b-u[_];b=_o(v,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},zh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Fe(e,t),u={x:r,y:n},p=Oe(o),m=vo(p);let g=u[m],b=u[p];const f=Fe(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,k=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>k&&(g=k)}if(d){var _,v;const w=m==="y"?"width":"height",j=vs.has($e(o)),k=i.reference[p]-i.floating[w]+(j&&((_=s.offset)==null?void 0:_[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((v=s.offset)==null?void 0:v[p])||0)-(j?h.crossAxis:0);b<k?b=k:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Mh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Fe(e,t),u=await cr(t,d),p=$e(o),m=Tt(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,_;p==="top"||p==="bottom"?(h=p,_=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,h=m==="end"?"top":"bottom");const v=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],v),k=Ge(b-u[_],w),N=!t.middlewareData.shift;let C=j,E=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=v),N&&!m){const A=xe(u.left,0),O=xe(u.right,0),R=xe(u.top,0),L=xe(u.bottom,0);g?E=b-2*(A!==0||O!==0?A+O:xe(u.left,u.right)):C=f-2*(R!==0||L!==0?R+L:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:C});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function At(e){return ys(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ys(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ys(e){return Qr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Qr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Qr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function ws(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Dh=new Set(["inline","contents"]);function dr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Dh.has(o)}const Fh=new Set(["table","td","th"]);function $h(e){return Fh.has(At(e))}const Bh=[":popover-open",":modal"];function en(e){return Bh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Uh=["transform","translate","scale","rotate","perspective"],Hh=["transform","translate","scale","rotate","perspective","filter"],Vh=["paint","layout","strict","content"];function So(e){const t=ko(),r=je(e)?Se(e):e;return Uh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Hh.some(n=>(r.willChange||"").includes(n))||Vh.some(n=>(r.contain||"").includes(n))}function Wh(e){let t=Ke(e);for(;Le(t)&&!Pt(t);){if(So(t))return t;if(en(t))return null;t=Ke(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qh=new Set(["html","body","#document"]);function Pt(e){return qh.has(At(e))}function Se(e){return be(e).getComputedStyle(e)}function tn(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ws(e)&&e.host||Re(e);return ws(t)?t.host:t}function js(e){const t=Ke(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&dr(t)?t:js(t)}function ur(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=js(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=Co(s);return t.concat(s,s.visualViewport||[],dr(o)?o:[],l&&r?ur(l):[])}return t.concat(o,ur(o,[],r))}function Co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ss(e){const t=Se(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function No(e){return je(e)?e:e.contextElement}function Ot(e){const t=No(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Ss(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Gh=Pe(0);function ks(e){const t=be(e);return!ko()||!t.visualViewport?Gh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function pt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=No(e);let s=Pe(1);t&&(n?je(n)&&(s=Ot(n)):s=Ot(e));const l=Kh(i,r,n)?ks(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=Co(b);for(;f&&n&&g!==b;){const h=Ot(f),_=f.getBoundingClientRect(),v=Se(f),w=_.left+(f.clientLeft+parseFloat(v.paddingLeft))*h.x,j=_.top+(f.clientTop+parseFloat(v.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=Co(b)}}return Zr({width:u,height:p,x:c,y:d})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:pt(Re(e)).left+r}function Cs(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Yh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((At(n)!=="body"||dr(s))&&(c=tn(n)),Le(n))){const g=pt(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Cs(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Xh(e){return Array.from(e.getClientRects())}function Jh(e){const t=Re(e),r=tn(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return Se(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ns=25;function Zh(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=rn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Ns&&(i-=b)}else d<=Ns&&(i+=d);return{width:i,height:s,x:l,y:c}}const Qh=new Set(["absolute","fixed"]);function eg(e,t){const r=pt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Ot(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Es(e,t,r){let n;if(t==="viewport")n=Zh(e,r);else if(t==="document")n=Jh(Re(e));else if(je(t))n=eg(t,r);else{const o=ks(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function Ts(e,t){const r=Ke(e);return r===t||!je(r)||Pt(r)?!1:Se(r).position==="fixed"||Ts(r,t)}function tg(e,t){const r=t.get(e);if(r)return r;let n=ur(e,[],!1).filter(l=>je(l)&&At(l)!=="body"),o=null;const i=Se(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!Pt(s);){const l=Se(s),c=So(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&Qh.has(o.position)||dr(s)&&!c&&Ts(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function rg(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:tg(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Es(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Es(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ng(e){const{width:t,height:r}=Ss(e);return{width:t,height:r}}function og(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=pt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=rn(o)}if(n||!n&&!i)if((At(t)!=="body"||dr(o))&&(l=tn(t)),n){const g=pt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Cs(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function Eo(e){return Se(e).position==="static"}function As(e,t){if(!Le(e)||Se(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Ps(e,t){const r=be(e);if(en(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!Pt(o);){if(je(o)&&!Eo(o))return o;o=Ke(o)}return r}let n=As(e,t);for(;n&&$h(n)&&Eo(n);)n=As(n,t);return n&&Pt(n)&&Eo(n)&&!So(n)?r:n||Wh(e)||r}const ag=async function(e){const t=this.getOffsetParent||Ps,r=this.getDimensions,n=await r(e.floating);return{reference:og(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ig(e){return Se(e).direction==="rtl"}const sg={convertOffsetParentRelativeRectToViewportRelativeRect:Yh,getDocumentElement:Re,getClippingRect:rg,getOffsetParent:Ps,getElementRects:ag,getClientRects:Xh,getDimensions:ng,getScale:Ot,isElement:je,isRTL:ig};function Os(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lg(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Xr(p),f=Xr(o.clientWidth-(u+m)),h=Xr(o.clientHeight-(p+g)),_=Xr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-_+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function k(N){const C=N[0].intersectionRatio;if(C!==c){if(!j)return s();C?s(!1,C):n=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!Os(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(k,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(k,w)}r.observe(e)}return s(!0),i}function cg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=No(e),u=o||i?[...d?ur(d):[],...ur(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),i&&_.addEventListener("resize",r)});const p=d&&l?lg(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(_=>{let[v]=_;v&&v.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?pt(e):null;c&&h();function h(){const _=pt(e);f&&!Os(f,_)&&r(),f=_,b=requestAnimationFrame(h)}return r(),()=>{var _;u.forEach(v=>{o&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r)}),p?.(),(_=g)==null||_.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const dg=Lh,ug=Ih,pg=Ph,mg=Mh,fg=Oh,Rs=Ah,hg=zh,gg=(e,t,r)=>{const n=new Map,o={platform:sg,...r},i={...o.platform,_c:n};return Th(e,t,{...o,platform:i})};var xg=typeof document<"u",bg=function(){},nn=xg?y.useLayoutEffect:bg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ls(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Is(e,t){const r=Ls(e);return Math.round(t*r)/r}function To(e){const t=x.useRef(e);return nn(()=>{t.current=e}),t}function _g(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);on(m,n)||g(n);const[b,f]=x.useState(null),[h,_]=x.useState(null),v=x.useCallback(z=>{z!==N.current&&(N.current=z,f(z))},[]),w=x.useCallback(z=>{z!==C.current&&(C.current=z,_(z))},[]),j=i||b,k=s||h,N=x.useRef(null),C=x.useRef(null),E=x.useRef(u),T=c!=null,A=To(c),O=To(o),R=To(d),L=x.useCallback(()=>{if(!N.current||!C.current)return;const z={placement:t,strategy:r,middleware:m};O.current&&(z.platform=O.current),gg(N.current,C.current,z).then(G=>{const ae={...G,isPositioned:R.current!==!1};P.current&&!on(E.current,ae)&&(E.current=ae,_r.flushSync(()=>{p(ae)}))})},[m,t,r,O,R]);nn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[d]);const P=x.useRef(!1);nn(()=>(P.current=!0,()=>{P.current=!1}),[]),nn(()=>{if(j&&(N.current=j),k&&(C.current=k),j&&k){if(A.current)return A.current(j,k,L);L()}},[j,k,L,A,T]);const M=x.useMemo(()=>({reference:N,floating:C,setReference:v,setFloating:w}),[v,w]),I=x.useMemo(()=>({reference:j,floating:k}),[j,k]),B=x.useMemo(()=>{const z={position:r,left:0,top:0};if(!I.floating)return z;const G=Is(I.floating,u.x),ae=Is(I.floating,u.y);return l?{...z,transform:"translate("+G+"px, "+ae+"px)",...Ls(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:G,top:ae}},[r,l,I.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:L,refs:M,elements:I,floatingStyles:B}),[u,L,M,I,B])}const vg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Rs({element:n.current,padding:o}).fn(r):{}:n?Rs({element:n,padding:o}).fn(r):{}}}},yg=(e,t)=>({...dg(e),options:[e,t]}),wg=(e,t)=>({...ug(e),options:[e,t]}),jg=(e,t)=>({...hg(e),options:[e,t]}),Sg=(e,t)=>({...pg(e),options:[e,t]}),kg=(e,t)=>({...mg(e),options:[e,t]}),Cg=(e,t)=>({...fg(e),options:[e,t]}),Ng=(e,t)=>({...vg(e),options:[e,t]});var Eg="Arrow",zs=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});zs.displayName=Eg;var Tg=zs;function Ag(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ao="Popper",[Ms,an]=Ve(Ao),[Pg,Ds]=Ms(Ao),Fs=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Pg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Fs.displayName=Ao;var $s="PopperAnchor",Bs=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ds($s,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Bs.displayName=$s;var Po="PopperContent",[Og,Rg]=Ms(Po),Us=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Ds(Po,r),[_,v]=x.useState(null),w=J(t,$=>v($)),[j,k]=x.useState(null),N=Ag(j),C=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(d)?d:[d],R=O.length>0,L={padding:A,boundary:O.filter(Ig),altBoundary:R},{refs:P,floatingStyles:M,placement:I,isPositioned:B,middlewareData:z}=_g({strategy:"fixed",placement:T,whileElementsMounted:(...$)=>cg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[yg({mainAxis:o+E,alignmentAxis:s}),c&&wg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?jg():void 0,...L}),c&&Sg({...L}),kg({...L,apply:({elements:$,rects:Y,availableWidth:oe,availableHeight:Z})=>{const{width:Q,height:re}=Y.reference,ve=$.floating.style;ve.setProperty("--radix-popper-available-width",`${oe}px`),ve.setProperty("--radix-popper-available-height",`${Z}px`),ve.setProperty("--radix-popper-anchor-width",`${Q}px`),ve.setProperty("--radix-popper-anchor-height",`${re}px`)}}),j&&Ng({element:j,padding:l}),zg({arrowWidth:C,arrowHeight:E}),m&&Cg({strategy:"referenceHidden",...L})]}),[G,ae]=Ws(I),ie=We(b);le(()=>{B&&ie?.()},[B,ie]);const ge=z.arrow?.x,_e=z.arrow?.y,pe=z.arrow?.centerOffset!==0,[K,de]=x.useState();return le(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),a.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:B?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Og,{scope:r,placedSide:G,onArrowChange:k,arrowX:ge,arrowY:_e,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":G,"data-align":ae,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Us.displayName=Po;var Hs="PopperArrow",Lg={top:"bottom",right:"left",bottom:"top",left:"right"},Vs=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Rg(Hs,n),s=Lg[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Tg,{...o,ref:r,style:{...o.style,display:"block"}})})});Vs.displayName=Hs;function Ig(e){return e!==null}var zg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Ws(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function Ws(e){const[t,r="center"]=e.split("-");return[t,r]}var qs=Fs,Oo=Bs,Gs=Us,Ks=Vs,Mg="Portal",sn=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ya.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=Mg;function Dg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Fg(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,$g(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function Fg(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Dg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=ln(n.current);i.current=l==="mounted"?d:"none"},[l]),le(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),le(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function ln(e){return e?.animationName||"none"}function $g(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Bg=x[" useInsertionEffect ".trim().toString()]||le;function mt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Ug({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=Hg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Ug({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Bg(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Hg(e){return typeof e=="function"}var Vg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,cn=new WeakMap,dn={},Ro=0,Ys=function(e){return e&&(e.host||Ys(e.parentNode))},Wg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ys(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},qg=function(e,t,r,n){var o=Wg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,h=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,h),s.push(m),f===1&&b&&cn.set(m,!0),h===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return u(t),l.clear(),Ro++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),Ro--,Ro||(Rt=new WeakMap,Rt=new WeakMap,cn=new WeakMap,dn={})}},Lo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Vg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),qg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Xs(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Gg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Kg="with-scroll-bars-hidden",Yg="--removed-body-scroll-bar-size";function Io(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Xg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Jg=typeof window<"u"?x.useLayoutEffect:x.useEffect,Js=new WeakMap;function Zg(e,t){var r=Xg(null,function(n){return e.forEach(function(o){return Io(o,n)})});return Jg(function(){var n=Js.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||Io(l,null)}),i.forEach(function(l){o.has(l)||Io(l,s)})}Js.set(r,e)},[e]),r}function Qg(e){return e}function ex(e,t){t===void 0&&(t=Qg);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function tx(e){e===void 0&&(e={});var t=ex(null);return t.options=Ie({async:!0,ssr:!1},e),t}var Zs=function(e){var t=e.sideCar,r=Xs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};Zs.isSideCarExport=!0;function rx(e,t){return e.useMedium(t),Zs}var Qs=tx(),zo=function(){},mn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:zo,onWheelCapture:zo,onTouchMoveCapture:zo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,_=e.as,v=_===void 0?"div":_,w=e.gapMode,j=Xs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=m,N=Zg([r,t]),C=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(k,{sideCar:Qs,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},C),{ref:N})):x.createElement(v,Ie({},C,{className:c,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var nx=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ox(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nx();return t&&e.setAttribute("nonce",t),e}function ax(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ix(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ox())&&(ax(t,r),ix(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lx=function(){var e=sx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},el=function(){var e=lx(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},cx={left:0,top:0,right:0,gap:0},Mo=function(e){return parseInt(e||"",10)||0},dx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Mo(r),Mo(n),Mo(o)]},ux=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cx;var t=dx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},px=el(),Lt="data-scroll-locked",mx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
    324   .`.concat(Kg,` {
     238 */const ae=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(If,{ref:i,iconNode:t,className:rs(`lucide-${Pf(ts(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ts(e),r};/**
     239 * @license lucide-react v0.552.0 - ISC
     240 *
     241 * This source code is licensed under the ISC license.
     242 * See the LICENSE file in the root directory of this source tree.
     243 */const zf=ae("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
     244 * @license lucide-react v0.552.0 - ISC
     245 *
     246 * This source code is licensed under the ISC license.
     247 * See the LICENSE file in the root directory of this source tree.
     248 */const mo=ae("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
     249 * @license lucide-react v0.552.0 - ISC
     250 *
     251 * This source code is licensed under the ISC license.
     252 * See the LICENSE file in the root directory of this source tree.
     253 */const Mf=ae("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
     254 * @license lucide-react v0.552.0 - ISC
     255 *
     256 * This source code is licensed under the ISC license.
     257 * See the LICENSE file in the root directory of this source tree.
     258 */const Df=ae("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
     259 * @license lucide-react v0.552.0 - ISC
     260 *
     261 * This source code is licensed under the ISC license.
     262 * See the LICENSE file in the root directory of this source tree.
     263 */const Ff=ae("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
     264 * @license lucide-react v0.552.0 - ISC
     265 *
     266 * This source code is licensed under the ISC license.
     267 * See the LICENSE file in the root directory of this source tree.
     268 */const $f=ae("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
     269 * @license lucide-react v0.552.0 - ISC
     270 *
     271 * This source code is licensed under the ISC license.
     272 * See the LICENSE file in the root directory of this source tree.
     273 */const Bf=ae("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
     274 * @license lucide-react v0.552.0 - ISC
     275 *
     276 * This source code is licensed under the ISC license.
     277 * See the LICENSE file in the root directory of this source tree.
     278 */const Uf=ae("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
     279 * @license lucide-react v0.552.0 - ISC
     280 *
     281 * This source code is licensed under the ISC license.
     282 * See the LICENSE file in the root directory of this source tree.
     283 */const Hf=ae("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
     284 * @license lucide-react v0.552.0 - ISC
     285 *
     286 * This source code is licensed under the ISC license.
     287 * See the LICENSE file in the root directory of this source tree.
     288 */const Vf=ae("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
     289 * @license lucide-react v0.552.0 - ISC
     290 *
     291 * This source code is licensed under the ISC license.
     292 * See the LICENSE file in the root directory of this source tree.
     293 */const Wf=ae("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
     294 * @license lucide-react v0.552.0 - ISC
     295 *
     296 * This source code is licensed under the ISC license.
     297 * See the LICENSE file in the root directory of this source tree.
     298 */const qf=ae("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
     299 * @license lucide-react v0.552.0 - ISC
     300 *
     301 * This source code is licensed under the ISC license.
     302 * See the LICENSE file in the root directory of this source tree.
     303 */const Gf=ae("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
     304 * @license lucide-react v0.552.0 - ISC
     305 *
     306 * This source code is licensed under the ISC license.
     307 * See the LICENSE file in the root directory of this source tree.
     308 */const Kf=ae("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
     309 * @license lucide-react v0.552.0 - ISC
     310 *
     311 * This source code is licensed under the ISC license.
     312 * See the LICENSE file in the root directory of this source tree.
     313 */const Yf=ae("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
     314 * @license lucide-react v0.552.0 - ISC
     315 *
     316 * This source code is licensed under the ISC license.
     317 * See the LICENSE file in the root directory of this source tree.
     318 */const Xf=ae("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
     319 * @license lucide-react v0.552.0 - ISC
     320 *
     321 * This source code is licensed under the ISC license.
     322 * See the LICENSE file in the root directory of this source tree.
     323 */const Jf=ae("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
     324 * @license lucide-react v0.552.0 - ISC
     325 *
     326 * This source code is licensed under the ISC license.
     327 * See the LICENSE file in the root directory of this source tree.
     328 */const ns=ae("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Zf(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,Qf(o,...t)]}function Qf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var eh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=eh.reduce((e,t)=>{const r=st(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function th(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function rh(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var nh="DismissableLayer",fo="dismissableLayer.update",oh="dismissableLayer.pointerDownOutside",ah="dismissableLayer.focusOutside",os,as=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(as),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,C=>p(C)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),_=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=_>=v,k=lh(C=>{const E=C.target,T=[...d.branches].some(O=>O.contains(E));!j||T||(o?.(C),s?.(C),C.defaultPrevented||l?.())},m),N=ch(C=>{const E=C.target;[...d.branches].some(O=>O.contains(E))||(i?.(C),s?.(C),C.defaultPrevented||l?.())},m);return rh(C=>{_===d.layers.size-1&&(n?.(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(os=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),is(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=os)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),is())},[u,d]),x.useEffect(()=>{const C=()=>g({});return document.addEventListener(fo,C),()=>document.removeEventListener(fo,C)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,k.onPointerDownCapture)})});Gr.displayName=nh;var ih="DismissableLayerBranch",sh=x.forwardRef((e,t)=>{const r=x.useContext(as),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});sh.displayName=ih;function lh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ss(oh,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ch(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ss(ah,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function is(){const e=new CustomEvent(fo);document.dispatchEvent(e)}function ss(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?th(o,i):o.dispatchEvent(i)}var ho=0;function go(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ls()),document.body.insertAdjacentElement("beforeend",e[1]??ls()),ho++,()=>{ho===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ho--}},[])}function ls(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xo="focusScope.autoFocusOnMount",bo="focusScope.autoFocusOnUnmount",cs={bubbles:!1,cancelable:!0},dh="FocusScope",Kr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const _=new MutationObserver(v);return l&&_.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),_.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){ps.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(xo,cs);l.addEventListener(xo,d),l.dispatchEvent(v),v.defaultPrevented||(uh(gh(ds(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(xo,d),setTimeout(()=>{const v=new CustomEvent(bo,cs);l.addEventListener(bo,u),l.dispatchEvent(v),v.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(bo,u),ps.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(h&&v){const _=f.currentTarget,[w,j]=ph(_);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&qe(j,{select:!0})):v===_&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Kr.displayName=dh;function uh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function ph(e){const t=ds(e),r=us(t,e),n=us(t.reverse(),e);return[r,n]}function ds(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function us(e,t){for(const r of e)if(!mh(r,{upTo:t}))return r}function mh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&fh(e)&&t&&e.select()}}var ps=hh();function hh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=ms(e,t),e.unshift(t)},remove(t){e=ms(e,t),e[0]?.resume()}}}function ms(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function gh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},xh=x[" useId ".trim().toString()]||(()=>{}),bh=0;function Ae(e){const[t,r]=x.useState(xh());return le(()=>{r(n=>n??String(bh++))},[e]),e||(t?`radix-${t}`:"")}const vh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Yr=Math.round,Xr=Math.floor,Pe=e=>({x:e,y:e}),_h={left:"right",right:"left",bottom:"top",top:"bottom"},yh={start:"end",end:"start"};function vo(e,t,r){return xe(e,Ge(t,r))}function Fe(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function _o(e){return e==="x"?"y":"x"}function yo(e){return e==="y"?"height":"width"}const wh=new Set(["top","bottom"]);function Oe(e){return wh.has($e(e))?"y":"x"}function wo(e){return _o(Oe(e))}function jh(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=wo(e),i=yo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function Sh(e){const t=Jr(e);return[jo(e),t,jo(t)]}function jo(e){return e.replace(/start|end/g,t=>yh[t])}const fs=["left","right"],hs=["right","left"],kh=["top","bottom"],Ch=["bottom","top"];function Nh(e,t,r){switch(e){case"top":case"bottom":return r?t?hs:fs:t?fs:hs;case"left":case"right":return t?kh:Ch;default:return[]}}function Eh(e,t,r,n){const o=Tt(e);let i=Nh($e(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(jo)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>_h[t])}function Th(e){return{top:0,right:0,bottom:0,left:0,...e}}function gs(e){return typeof e!="number"?Th(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function xs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=wo(t),l=yo(s),c=$e(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Ah=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=xs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:v}=l[f],{x:_,y:w,data:j,reset:k}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=_??u,p=w??p,g={...g,[h]:{...g[h],...j}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(d=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:u,y:p}=xs(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function cr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Fe(t,e),b=gs(g),h=l[m?p==="floating"?"reference":"floating":p],v=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),_=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},k=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:w,strategy:c}):_);return{top:(v.top-k.top+b.top)/j.y,bottom:(k.bottom-v.bottom+b.bottom)/j.y,left:(v.left-k.left+b.left)/j.x,right:(k.right-v.right+b.right)/j.x}}const Ph=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Fe(e,t)||{};if(d==null)return{};const p=gs(u),m={x:r,y:n},g=wo(o),b=yo(g),f=await s.getDimensions(d),h=g==="y",v=h?"top":"left",_=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],k=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let C=N?N[w]:0;(!C||!await(s.isElement==null?void 0:s.isElement(N)))&&(C=l.floating[w]||i.floating[b]);const E=j/2-k/2,T=C/2-f[b]/2-1,O=Ge(p[v],T),R=Ge(p[_],T),L=O,A=C-f[b]-R,P=C/2-f[b]/2+E,z=vo(L,P,A),I=!c.arrow&&Tt(o)!=null&&P!==z&&i.reference[b]/2-(P<L?O:R)-f[b]/2<0,B=I?P<L?P-L:P-A:0;return{[g]:m[g]+B,data:{[g]:z,centerOffset:P-z-B,...I&&{alignmentOffset:B}},reset:I}}}),Oh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=Fe(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=$e(o),_=Oe(l),w=$e(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=m||(w||!f?[Jr(l)]:Sh(l)),N=b!=="none";!m&&N&&k.push(...Eh(l,f,b,j));const C=[l,...k],E=await cr(t,h),T=[];let O=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const P=jh(o,s,j);T.push(E[P[0]],E[P[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(P=>P<=0)){var R,L;const P=(((R=i.flip)==null?void 0:R.index)||0)+1,z=C[P];if(z&&(!(p==="alignment"?_!==Oe(z):!1)||O.every(M=>Oe(M.placement)===_?M.overflows[0]>0:!0)))return{data:{index:P,overflows:O},reset:{placement:z}};let I=(L=O.filter(B=>B.overflows[0]<=0).sort((B,M)=>B.overflows[1]-M.overflows[1])[0])==null?void 0:L.placement;if(!I)switch(g){case"bestFit":{var A;const B=(A=O.filter(M=>{if(N){const G=Oe(M.placement);return G===_||G==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(G=>G>0).reduce((G,ie)=>G+ie,0)]).sort((M,G)=>M[1]-G[1])[0])==null?void 0:A[0];B&&(I=B);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function bs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vs(e){return vh.some(t=>e[t]>=0)}const Rh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fe(e,t);switch(n){case"referenceHidden":{const i=await cr(t,{...o,elementContext:"reference"}),s=bs(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:vs(s)}}}case"escaped":{const i=await cr(t,{...o,altBoundary:!0}),s=bs(i,r.floating);return{data:{escapedOffsets:s,escaped:vs(s)}}}default:return{}}}}},_s=new Set(["left","top"]);async function Lh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$e(r),l=Tt(r),c=Oe(r)==="y",d=_s.has(s)?-1:1,u=i&&c?-1:1,p=Fe(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const Ih=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Lh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},zh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:v,y:_}=h;return{x:v,y:_}}},...c}=Fe(e,t),d={x:r,y:n},u=await cr(t,c),p=Oe($e(o)),m=_o(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",_=g+u[h],w=g-u[v];g=vo(_,g,w)}if(s){const h=p==="y"?"top":"left",v=p==="y"?"bottom":"right",_=b+u[h],w=b-u[v];b=vo(_,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Mh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Fe(e,t),u={x:r,y:n},p=Oe(o),m=_o(p);let g=u[m],b=u[p];const f=Fe(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,k=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>k&&(g=k)}if(d){var v,_;const w=m==="y"?"width":"height",j=_s.has($e(o)),k=i.reference[p]-i.floating[w]+(j&&((v=s.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((_=s.offset)==null?void 0:_[p])||0)-(j?h.crossAxis:0);b<k?b=k:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Dh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Fe(e,t),u=await cr(t,d),p=$e(o),m=Tt(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,h=m==="end"?"top":"bottom");const _=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],_),k=Ge(b-u[v],w),N=!t.middlewareData.shift;let C=j,E=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=_),N&&!m){const O=xe(u.left,0),R=xe(u.right,0),L=xe(u.top,0),A=xe(u.bottom,0);g?E=b-2*(O!==0||R!==0?O+R:xe(u.left,u.right)):C=f-2*(L!==0||A!==0?L+A:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:C});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function At(e){return ys(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ys(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ys(e){return Qr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Qr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Qr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function ws(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Fh=new Set(["inline","contents"]);function dr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Fh.has(o)}const $h=new Set(["table","td","th"]);function Bh(e){return $h.has(At(e))}const Uh=[":popover-open",":modal"];function en(e){return Uh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Hh=["transform","translate","scale","rotate","perspective"],Vh=["transform","translate","scale","rotate","perspective","filter"],Wh=["paint","layout","strict","content"];function So(e){const t=ko(),r=je(e)?Se(e):e;return Hh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Vh.some(n=>(r.willChange||"").includes(n))||Wh.some(n=>(r.contain||"").includes(n))}function qh(e){let t=Ke(e);for(;Le(t)&&!Pt(t);){if(So(t))return t;if(en(t))return null;t=Ke(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Gh=new Set(["html","body","#document"]);function Pt(e){return Gh.has(At(e))}function Se(e){return be(e).getComputedStyle(e)}function tn(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ws(e)&&e.host||Re(e);return ws(t)?t.host:t}function js(e){const t=Ke(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&dr(t)?t:js(t)}function ur(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=js(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=Co(s);return t.concat(s,s.visualViewport||[],dr(o)?o:[],l&&r?ur(l):[])}return t.concat(o,ur(o,[],r))}function Co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ss(e){const t=Se(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function No(e){return je(e)?e:e.contextElement}function Ot(e){const t=No(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Ss(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Kh=Pe(0);function ks(e){const t=be(e);return!ko()||!t.visualViewport?Kh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function pt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=No(e);let s=Pe(1);t&&(n?je(n)&&(s=Ot(n)):s=Ot(e));const l=Yh(i,r,n)?ks(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=Co(b);for(;f&&n&&g!==b;){const h=Ot(f),v=f.getBoundingClientRect(),_=Se(f),w=v.left+(f.clientLeft+parseFloat(_.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(_.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=Co(b)}}return Zr({width:u,height:p,x:c,y:d})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:pt(Re(e)).left+r}function Cs(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Xh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((At(n)!=="body"||dr(s))&&(c=tn(n)),Le(n))){const g=pt(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Cs(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Jh(e){return Array.from(e.getClientRects())}function Zh(e){const t=Re(e),r=tn(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return Se(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ns=25;function Qh(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=rn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Ns&&(i-=b)}else d<=Ns&&(i+=d);return{width:i,height:s,x:l,y:c}}const eg=new Set(["absolute","fixed"]);function tg(e,t){const r=pt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Ot(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Es(e,t,r){let n;if(t==="viewport")n=Qh(e,r);else if(t==="document")n=Zh(Re(e));else if(je(t))n=tg(t,r);else{const o=ks(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function Ts(e,t){const r=Ke(e);return r===t||!je(r)||Pt(r)?!1:Se(r).position==="fixed"||Ts(r,t)}function rg(e,t){const r=t.get(e);if(r)return r;let n=ur(e,[],!1).filter(l=>je(l)&&At(l)!=="body"),o=null;const i=Se(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!Pt(s);){const l=Se(s),c=So(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&eg.has(o.position)||dr(s)&&!c&&Ts(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function ng(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:rg(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Es(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Es(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function og(e){const{width:t,height:r}=Ss(e);return{width:t,height:r}}function ag(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=pt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=rn(o)}if(n||!n&&!i)if((At(t)!=="body"||dr(o))&&(l=tn(t)),n){const g=pt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Cs(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function Eo(e){return Se(e).position==="static"}function As(e,t){if(!Le(e)||Se(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Ps(e,t){const r=be(e);if(en(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!Pt(o);){if(je(o)&&!Eo(o))return o;o=Ke(o)}return r}let n=As(e,t);for(;n&&Bh(n)&&Eo(n);)n=As(n,t);return n&&Pt(n)&&Eo(n)&&!So(n)?r:n||qh(e)||r}const ig=async function(e){const t=this.getOffsetParent||Ps,r=this.getDimensions,n=await r(e.floating);return{reference:ag(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function sg(e){return Se(e).direction==="rtl"}const lg={convertOffsetParentRelativeRectToViewportRelativeRect:Xh,getDocumentElement:Re,getClippingRect:ng,getOffsetParent:Ps,getElementRects:ig,getClientRects:Jh,getDimensions:og,getScale:Ot,isElement:je,isRTL:sg};function Os(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cg(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Xr(p),f=Xr(o.clientWidth-(u+m)),h=Xr(o.clientHeight-(p+g)),v=Xr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function k(N){const C=N[0].intersectionRatio;if(C!==c){if(!j)return s();C?s(!1,C):n=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!Os(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(k,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(k,w)}r.observe(e)}return s(!0),i}function dg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=No(e),u=o||i?[...d?ur(d):[],...ur(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const p=d&&l?cg(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(v=>{let[_]=v;_&&_.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?pt(e):null;c&&h();function h(){const v=pt(e);f&&!Os(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(_=>{o&&_.removeEventListener("scroll",r),i&&_.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const ug=Ih,pg=zh,mg=Oh,fg=Dh,hg=Rh,Rs=Ph,gg=Mh,xg=(e,t,r)=>{const n=new Map,o={platform:lg,...r},i={...o.platform,_c:n};return Ah(e,t,{...o,platform:i})};var bg=typeof document<"u",vg=function(){},nn=bg?y.useLayoutEffect:vg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ls(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Is(e,t){const r=Ls(e);return Math.round(t*r)/r}function To(e){const t=x.useRef(e);return nn(()=>{t.current=e}),t}function _g(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);on(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),_=x.useCallback(M=>{M!==N.current&&(N.current=M,f(M))},[]),w=x.useCallback(M=>{M!==C.current&&(C.current=M,v(M))},[]),j=i||b,k=s||h,N=x.useRef(null),C=x.useRef(null),E=x.useRef(u),T=c!=null,O=To(c),R=To(o),L=To(d),A=x.useCallback(()=>{if(!N.current||!C.current)return;const M={placement:t,strategy:r,middleware:m};R.current&&(M.platform=R.current),xg(N.current,C.current,M).then(G=>{const ie={...G,isPositioned:L.current!==!1};P.current&&!on(E.current,ie)&&(E.current=ie,vr.flushSync(()=>{p(ie)}))})},[m,t,r,R,L]);nn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(M=>({...M,isPositioned:!1})))},[d]);const P=x.useRef(!1);nn(()=>(P.current=!0,()=>{P.current=!1}),[]),nn(()=>{if(j&&(N.current=j),k&&(C.current=k),j&&k){if(O.current)return O.current(j,k,A);A()}},[j,k,A,O,T]);const z=x.useMemo(()=>({reference:N,floating:C,setReference:_,setFloating:w}),[_,w]),I=x.useMemo(()=>({reference:j,floating:k}),[j,k]),B=x.useMemo(()=>{const M={position:r,left:0,top:0};if(!I.floating)return M;const G=Is(I.floating,u.x),ie=Is(I.floating,u.y);return l?{...M,transform:"translate("+G+"px, "+ie+"px)",...Ls(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:G,top:ie}},[r,l,I.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:A,refs:z,elements:I,floatingStyles:B}),[u,A,z,I,B])}const yg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Rs({element:n.current,padding:o}).fn(r):{}:n?Rs({element:n,padding:o}).fn(r):{}}}},wg=(e,t)=>({...ug(e),options:[e,t]}),jg=(e,t)=>({...pg(e),options:[e,t]}),Sg=(e,t)=>({...gg(e),options:[e,t]}),kg=(e,t)=>({...mg(e),options:[e,t]}),Cg=(e,t)=>({...fg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...yg(e),options:[e,t]});var Tg="Arrow",zs=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});zs.displayName=Tg;var Ag=zs;function Pg(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ao="Popper",[Ms,an]=Ve(Ao),[Og,Ds]=Ms(Ao),Fs=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Og,{scope:t,anchor:n,onAnchorChange:o,children:r})};Fs.displayName=Ao;var $s="PopperAnchor",Bs=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ds($s,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Bs.displayName=$s;var Po="PopperContent",[Rg,Lg]=Ms(Po),Us=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Ds(Po,r),[v,_]=x.useState(null),w=J(t,$=>_($)),[j,k]=x.useState(null),N=Pg(j),C=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(d)?d:[d],L=R.length>0,A={padding:O,boundary:R.filter(zg),altBoundary:L},{refs:P,floatingStyles:z,placement:I,isPositioned:B,middlewareData:M}=_g({strategy:"fixed",placement:T,whileElementsMounted:(...$)=>dg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[wg({mainAxis:o+E,alignmentAxis:s}),c&&jg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Sg():void 0,...A}),c&&kg({...A}),Cg({...A,apply:({elements:$,rects:Y,availableWidth:oe,availableHeight:Z})=>{const{width:Q,height:re}=Y.reference,_e=$.floating.style;_e.setProperty("--radix-popper-available-width",`${oe}px`),_e.setProperty("--radix-popper-available-height",`${Z}px`),_e.setProperty("--radix-popper-anchor-width",`${Q}px`),_e.setProperty("--radix-popper-anchor-height",`${re}px`)}}),j&&Eg({element:j,padding:l}),Mg({arrowWidth:C,arrowHeight:E}),m&&Ng({strategy:"referenceHidden",...A})]}),[G,ie]=Ws(I),se=We(b);le(()=>{B&&se?.()},[B,se]);const ge=M.arrow?.x,ve=M.arrow?.y,pe=M.arrow?.centerOffset!==0,[K,de]=x.useState();return le(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:B?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(" "),...M.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Rg,{scope:r,placedSide:G,onArrowChange:k,arrowX:ge,arrowY:ve,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":G,"data-align":ie,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Us.displayName=Po;var Hs="PopperArrow",Ig={top:"bottom",right:"left",bottom:"top",left:"right"},Vs=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Lg(Hs,n),s=Ig[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Ag,{...o,ref:r,style:{...o.style,display:"block"}})})});Vs.displayName=Hs;function zg(e){return e!==null}var Mg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Ws(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function Ws(e){const[t,r="center"]=e.split("-");return[t,r]}var qs=Fs,Oo=Bs,Gs=Us,Ks=Vs,Dg="Portal",sn=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ya.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=Dg;function Fg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=$g(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Bg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function $g(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Fg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=ln(n.current);i.current=l==="mounted"?d:"none"},[l]),le(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),le(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function ln(e){return e?.animationName||"none"}function Bg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ug=x[" useInsertionEffect ".trim().toString()]||le;function mt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Hg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=Vg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Hg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Ug(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Vg(e){return typeof e=="function"}var Wg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,cn=new WeakMap,dn={},Ro=0,Ys=function(e){return e&&(e.host||Ys(e.parentNode))},qg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ys(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Gg=function(e,t,r,n){var o=qg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,h=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,h),s.push(m),f===1&&b&&cn.set(m,!0),h===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return u(t),l.clear(),Ro++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),Ro--,Ro||(Rt=new WeakMap,Rt=new WeakMap,cn=new WeakMap,dn={})}},Lo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Wg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Gg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Xs(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Kg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Yg="with-scroll-bars-hidden",Xg="--removed-body-scroll-bar-size";function Io(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Jg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Zg=typeof window<"u"?x.useLayoutEffect:x.useEffect,Js=new WeakMap;function Qg(e,t){var r=Jg(null,function(n){return e.forEach(function(o){return Io(o,n)})});return Zg(function(){var n=Js.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||Io(l,null)}),i.forEach(function(l){o.has(l)||Io(l,s)})}Js.set(r,e)},[e]),r}function ex(e){return e}function tx(e,t){t===void 0&&(t=ex);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function rx(e){e===void 0&&(e={});var t=tx(null);return t.options=Ie({async:!0,ssr:!1},e),t}var Zs=function(e){var t=e.sideCar,r=Xs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};Zs.isSideCarExport=!0;function nx(e,t){return e.useMedium(t),Zs}var Qs=rx(),zo=function(){},mn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:zo,onWheelCapture:zo,onTouchMoveCapture:zo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,v=e.as,_=v===void 0?"div":v,w=e.gapMode,j=Xs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=m,N=Qg([r,t]),C=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(k,{sideCar:Qs,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},C),{ref:N})):x.createElement(_,Ie({},C,{className:c,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var ox=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ax(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ox();return t&&e.setAttribute("nonce",t),e}function ix(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ax())&&(ix(t,r),sx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cx=function(){var e=lx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},el=function(){var e=cx(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},dx={left:0,top:0,right:0,gap:0},Mo=function(e){return parseInt(e||"",10)||0},ux=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Mo(r),Mo(n),Mo(o)]},px=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dx;var t=ux(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},mx=el(),Lt="data-scroll-locked",fx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
     329  .`.concat(Yg,` {
    325330   overflow: hidden `).concat(n,`;
    326331   padding-right: `).concat(l,"px ").concat(n,`;
     
    356361 
    357362  body[`).concat(Lt,`] {
    358     `).concat(Yg,": ").concat(l,`px;
    359   }
    360 `)},tl=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0},fx=function(){x.useEffect(function(){return document.body.setAttribute(Lt,(tl()+1).toString()),function(){var e=tl()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},hx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;fx();var i=x.useMemo(function(){return ux(o)},[o]);return x.createElement(px,{styles:mx(i,!t,o,r?"":"!important")})},Do=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Do=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Do=!1}var It=Do?{passive:!1}:!1,gx=function(e){return e.tagName==="TEXTAREA"},rl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!gx(e)&&r[t]==="visible")},xx=function(e){return rl(e,"overflowY")},bx=function(e){return rl(e,"overflowX")},nl=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=ol(e,n);if(o){var i=al(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},_x=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},vx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},ol=function(e,t){return e==="v"?xx(t):bx(t)},al=function(e,t){return e==="v"?_x(t):vx(t)},yx=function(e,t){return e==="h"&&t==="rtl"?-1:1},wx=function(e,t,r,n,o){var i=yx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=al(e,l),b=g[0],f=g[1],h=g[2],_=f-h-i*b;(b||_)&&ol(e,l)&&(p+=_,m+=b);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},il=function(e){return[e.deltaX,e.deltaY]},sl=function(e){return e&&"current"in e?e.current:e},jx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sx=function(e){return`
     363    `).concat(Xg,": ").concat(l,`px;
     364  }
     365`)},tl=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0},hx=function(){x.useEffect(function(){return document.body.setAttribute(Lt,(tl()+1).toString()),function(){var e=tl()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},gx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;hx();var i=x.useMemo(function(){return px(o)},[o]);return x.createElement(mx,{styles:fx(i,!t,o,r?"":"!important")})},Do=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Do=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Do=!1}var It=Do?{passive:!1}:!1,xx=function(e){return e.tagName==="TEXTAREA"},rl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!xx(e)&&r[t]==="visible")},bx=function(e){return rl(e,"overflowY")},vx=function(e){return rl(e,"overflowX")},nl=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=ol(e,n);if(o){var i=al(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},_x=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},yx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},ol=function(e,t){return e==="v"?bx(t):vx(t)},al=function(e,t){return e==="v"?_x(t):yx(t)},wx=function(e,t){return e==="h"&&t==="rtl"?-1:1},jx=function(e,t,r,n,o){var i=wx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=al(e,l),b=g[0],f=g[1],h=g[2],v=f-h-i*b;(b||v)&&ol(e,l)&&(p+=v,m+=b);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},il=function(e){return[e.deltaX,e.deltaY]},sl=function(e){return e&&"current"in e?e.current:e},Sx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kx=function(e){return`
    361366  .block-interactivity-`.concat(e,` {pointer-events: none;}
    362367  .allow-interactivity-`).concat(e,` {pointer-events: all;}
    363 `)},kx=0,zt=[];function Cx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(kx++)[0],i=x.useState(el)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Gg([e.lockRef.current],(e.shards||[]).map(sl),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var _=hn(f),v=r.current,w="deltaX"in f?f.deltaX:v[0]-_[0],j="deltaY"in f?f.deltaY:v[1]-_[1],k,N=f.target,C=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&C==="h"&&N.type==="range")return!1;var E=nl(C,N);if(!E)return!0;if(E?k=C:(k=C==="v"?"h":"v",E=nl(C,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=k),!k)return!0;var T=n.current||k;return wx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!zt.length||zt[zt.length-1]!==i)){var _="deltaY"in h?il(h):hn(h),v=t.current.filter(function(k){return k.name===h.type&&(k.target===h.target||h.target===k.shadowParent)&&jx(k.delta,_)})[0];if(v&&v.should){h.cancelable&&h.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(sl).filter(Boolean).filter(function(k){return k.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,_,v){var w={name:f,delta:h,target:_,should:v,shadowParent:Nx(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=x.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,il(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return zt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){zt=zt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Sx(o)}):null,g?x.createElement(hx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Nx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ex=rx(Qs,Cx);var gn=x.forwardRef(function(e,t){return x.createElement(mn,Ie({},e,{ref:t,sideCar:Ex}))});gn.classNames=mn.classNames;var xn="Popover",[ll]=Ve(xn,[an]),pr=an(),[Tx,Xe]=ll(xn),cl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=pr(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(qs,{...l,children:a.jsx(Tx,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};cl.displayName=xn;var dl="PopoverAnchor",Ax=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(dl,r),i=pr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Oo,{...i,...n,ref:t})});Ax.displayName=dl;var ul="PopoverTrigger",pl=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ul,r),i=pr(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":xl(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Oo,{asChild:!0,...i,children:l})});pl.displayName=ul;var Fo="PopoverPortal",[Px,Ox]=ll(Fo,{forceMount:void 0}),ml=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe(Fo,t);return a.jsx(Px,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};ml.displayName=Fo;var Mt="PopoverContent",fl=x.forwardRef((e,t)=>{const r=Ox(Mt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(Mt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(Lx,{...o,ref:t}):a.jsx(Ix,{...o,ref:t})})});fl.displayName=Mt;var Rx=st("PopoverContent.RemoveScroll"),Lx=x.forwardRef((e,t)=>{const r=Xe(Mt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Lo(s)},[]),a.jsx(gn,{as:Rx,allowPinchZoom:!0,children:a.jsx(hl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ix=x.forwardRef((e,t)=>{const r=Xe(Mt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(hl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),hl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(Mt,r),g=pr(r);return go(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Gs,{"data-state":xl(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),gl="PopoverClose",zx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(gl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});zx.displayName=gl;var Mx="PopoverArrow",Dx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=pr(r);return a.jsx(Ks,{...o,...n,ref:t})});Dx.displayName=Mx;function xl(e){return e?"open":"closed"}var Fx=cl,$x=pl,Bx=ml,Ux=fl;function Je({...e}){return a.jsx(Fx,{"data-slot":"popover",...e})}function Ze({...e}){return a.jsx($x,{"data-slot":"popover-trigger",...e})}function Qe({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Bx,{container:o,children:a.jsx(Ux,{"data-slot":"popover-content",align:t,sideOffset:r,className:F("ecr-popover",e),...n})})}const $o="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var Hx=Symbol.for("react.lazy"),bn=x[" use ".trim().toString()];function Vx(e){return typeof e=="object"&&e!==null&&"then"in e}function bl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Hx&&"_payload"in e&&Vx(e._payload)}function Wx(e){const t=qx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;bl(i)&&typeof bn=="function"&&(i=bn(i._payload));const l=x.Children.toArray(i),c=l.find(Kx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function qx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(bl(o)&&typeof bn=="function"&&(o=bn(o._payload)),x.isValidElement(o)){const s=Xx(o),l=Yx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?qn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gx=Symbol("radix.slottable");function Kx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gx}function Yx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Xx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Jx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zx=Jx.reduce((e,t)=>{const r=Wx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Qx="Separator",_l="horizontal",e0=["horizontal","vertical"],vl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=_l,...o}=e,i=t0(n)?n:_l,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(Zx.div,{"data-orientation":i,...l,...o,ref:t})});vl.displayName=Qx;function t0(e){return e0.includes(e)}var r0=vl;function _n({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(r0,{"data-slot":"separator",decorative:r,orientation:t,className:F("ecr-separator",e),...n})}const ft=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(_n,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(_n,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(te,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})},ce=[];for(let e=0;e<256;++e)ce.push((e+256).toString(16).slice(1));function n0(e,t=0){return(ce[e[t+0]]+ce[e[t+1]]+ce[e[t+2]]+ce[e[t+3]]+"-"+ce[e[t+4]]+ce[e[t+5]]+"-"+ce[e[t+6]]+ce[e[t+7]]+"-"+ce[e[t+8]]+ce[e[t+9]]+"-"+ce[e[t+10]]+ce[e[t+11]]+ce[e[t+12]]+ce[e[t+13]]+ce[e[t+14]]+ce[e[t+15]]).toLowerCase()}let Bo;const o0=new Uint8Array(16);function a0(){if(!Bo){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Bo=crypto.getRandomValues.bind(crypto)}return Bo(o0)}const yl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function i0(e,t,r){e=e||{};const n=e.random??e.rng?.()??a0();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,n0(n)}function vn(e,t,r){return yl.randomUUID&&!e?yl.randomUUID():i0(e)}const s0=new Set(["video/mp4"]),l0=[".mp4",".m4v"],c0=e=>(e.mime||"").toLowerCase().trim(),d0=e=>(e.url||"").toLowerCase().trim(),u0=e=>e.split("?")[0].split("#")[0],p0=e=>{const t=u0(e);return l0.some(r=>t.endsWith(r))},m0=()=>{if(typeof document>"u")return!0;const t=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');return t==="probably"||t==="maybe"},f0=e=>{const t=c0(e),r=d0(e),n=t&&s0.has(t),o=r&&p0(r);return!n&&!o?!1:m0()},h0=e=>{const t=[],r=[];for(const n of e)f0(n)?t.push(n):r.push(n);return{compatible:t,incompatible:r}},g0=({setUploadedFiles:e,setShowOptions:t})=>{const r=()=>{if(!window.wp?.media){q.error("Media library is not available.");return}const n=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:!0,library:{type:["video"]}});n.on("select",()=>{const o=n.state().get("selection").toJSON();if(!e)return;const{incompatible:i}=h0(o);i.length>0&&q.error(`${i.length} video(s) may not play reliably on iOS/macOS Safari. Recommended format: MP4 (H.264/AAC).`);const s=o.map(l=>({url:l.url,mime_type:l.mime,file_uuid:vn(),source:"native"}));e(l=>[...l,...s]),t(!1)}),n.open()};return a.jsxs("button",{className:"ecr-admin-upload-native-video-btn",type:"button",onClick:r,children:[a.jsx(cp,{})," Choose from Media"]})},x0=({setUploadedFiles:e})=>{const[t,r]=y.useState(!1);return a.jsxs("div",{className:"ecr-admin-upload",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload__label",onClick:()=>r(!0),children:a.jsxs("span",{className:"ecr-admin-upload__text-icon_wrapper",children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Upload videos"}),a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click here to upload videos"})]})})]})}),t?a.jsxs("div",{className:"ecr-admin-upload-source-panel",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload-source-panel__close",onClick:()=>r(!1),"aria-label":"Close upload source picker",children:a.jsx(ns,{size:16})}),a.jsx("p",{className:"ecr-admin-upload-source-popover__title",children:"Add Videos"}),a.jsx("p",{className:"ecr-admin-upload-source-popover__description",children:"Upload from media library or paste Vimeo links."}),a.jsxs("div",{className:"ecr-admin-upload-source-popover__options",children:[a.jsx(g0,{setUploadedFiles:e,setShowOptions:r}),a.jsxs(Je,{children:[a.jsx(Ze,{asChild:!0,children:a.jsxs("button",{className:"ecr-admin-upload-vimeo-video-btn",type:"button",children:[a.jsx(ip,{})," Add Vimeo Videos ",a.jsx(at,{size:20})]})}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Vimeo Videos",text:a.jsx(a.Fragment,{children:"To embed Vimeo videos directly into your reels, giving your content a professional, seamless, and engaging playback experience for your audience."})})})]})]})]}):null]})};var yn="Dialog",[wl]=Ve(yn),[b0,ke]=wl(yn),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:yn});return a.jsx(b0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};jl.displayName=yn;var Sl="DialogTrigger",kl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Sl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Vo(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)})});kl.displayName=Sl;var Uo="DialogPortal",[_0,Cl]=wl(Uo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=ke(Uo,t);return a.jsx(_0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};Nl.displayName=Uo;var wn="DialogOverlay",El=x.forwardRef((e,t)=>{const r=Cl(wn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=ke(wn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(y0,{...o,ref:t})}):null});El.displayName=wn;var v0=st("DialogOverlay.RemoveScroll"),y0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(wn,r);return a.jsx(gn,{as:v0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Vo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ht="DialogContent",Tl=x.forwardRef((e,t)=>{const r=Cl(ht,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=ke(ht,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(w0,{...o,ref:t}):a.jsx(j0,{...o,ref:t})})});Tl.displayName=ht;var w0=x.forwardRef((e,t)=>{const r=ke(ht,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Lo(i)},[]),a.jsx(Al,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault())})}),j0=x.forwardRef((e,t)=>{const r=ke(ht,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Al,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=ke(ht,r),c=x.useRef(null),d=J(t,c);return go(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Vo(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(k0,{titleId:l.titleId}),a.jsx(N0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Ho="DialogTitle",Pl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Ho,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Pl.displayName=Ho;var Ol="DialogDescription",S0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});S0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Vo(e){return e?"open":"closed"}var Il="DialogTitleWarning",[C1,zl]=Jf(Il,{contentName:ht,titleName:Ho,docsSlug:"dialog"}),k0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
     368`)},Cx=0,zt=[];function Nx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(Cx++)[0],i=x.useState(el)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Kg([e.lockRef.current],(e.shards||[]).map(sl),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var v=hn(f),_=r.current,w="deltaX"in f?f.deltaX:_[0]-v[0],j="deltaY"in f?f.deltaY:_[1]-v[1],k,N=f.target,C=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&C==="h"&&N.type==="range")return!1;var E=nl(C,N);if(!E)return!0;if(E?k=C:(k=C==="v"?"h":"v",E=nl(C,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=k),!k)return!0;var T=n.current||k;return jx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!zt.length||zt[zt.length-1]!==i)){var v="deltaY"in h?il(h):hn(h),_=t.current.filter(function(k){return k.name===h.type&&(k.target===h.target||h.target===k.shadowParent)&&Sx(k.delta,v)})[0];if(_&&_.should){h.cancelable&&h.preventDefault();return}if(!_){var w=(s.current.shards||[]).map(sl).filter(Boolean).filter(function(k){return k.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,v,_){var w={name:f,delta:h,target:v,should:_,shadowParent:Ex(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=x.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,il(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return zt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){zt=zt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:kx(o)}):null,g?x.createElement(gx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ex(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tx=nx(Qs,Nx);var gn=x.forwardRef(function(e,t){return x.createElement(mn,Ie({},e,{ref:t,sideCar:Tx}))});gn.classNames=mn.classNames;var xn="Popover",[ll]=Ve(xn,[an]),pr=an(),[Ax,Xe]=ll(xn),cl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=pr(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(qs,{...l,children:a.jsx(Ax,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};cl.displayName=xn;var dl="PopoverAnchor",Px=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(dl,r),i=pr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Oo,{...i,...n,ref:t})});Px.displayName=dl;var ul="PopoverTrigger",pl=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ul,r),i=pr(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":xl(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Oo,{asChild:!0,...i,children:l})});pl.displayName=ul;var Fo="PopoverPortal",[Ox,Rx]=ll(Fo,{forceMount:void 0}),ml=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe(Fo,t);return a.jsx(Ox,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};ml.displayName=Fo;var Mt="PopoverContent",fl=x.forwardRef((e,t)=>{const r=Rx(Mt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(Mt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(Ix,{...o,ref:t}):a.jsx(zx,{...o,ref:t})})});fl.displayName=Mt;var Lx=st("PopoverContent.RemoveScroll"),Ix=x.forwardRef((e,t)=>{const r=Xe(Mt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Lo(s)},[]),a.jsx(gn,{as:Lx,allowPinchZoom:!0,children:a.jsx(hl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),zx=x.forwardRef((e,t)=>{const r=Xe(Mt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(hl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),hl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(Mt,r),g=pr(r);return go(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Gs,{"data-state":xl(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),gl="PopoverClose",Mx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(gl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Mx.displayName=gl;var Dx="PopoverArrow",Fx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=pr(r);return a.jsx(Ks,{...o,...n,ref:t})});Fx.displayName=Dx;function xl(e){return e?"open":"closed"}var $x=cl,Bx=pl,Ux=ml,Hx=fl;function Je({...e}){return a.jsx($x,{"data-slot":"popover",...e})}function Ze({...e}){return a.jsx(Bx,{"data-slot":"popover-trigger",...e})}function Qe({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Ux,{container:o,children:a.jsx(Hx,{"data-slot":"popover-content",align:t,sideOffset:r,className:F("ecr-popover",e),...n})})}const $o="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var Vx=Symbol.for("react.lazy"),bn=x[" use ".trim().toString()];function Wx(e){return typeof e=="object"&&e!==null&&"then"in e}function bl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Vx&&"_payload"in e&&Wx(e._payload)}function qx(e){const t=Gx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;bl(i)&&typeof bn=="function"&&(i=bn(i._payload));const l=x.Children.toArray(i),c=l.find(Yx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Gx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(bl(o)&&typeof bn=="function"&&(o=bn(o._payload)),x.isValidElement(o)){const s=Jx(o),l=Xx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?qn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kx=Symbol("radix.slottable");function Yx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kx}function Xx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Jx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Zx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qx=Zx.reduce((e,t)=>{const r=qx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),e0="Separator",vl="horizontal",t0=["horizontal","vertical"],_l=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=vl,...o}=e,i=r0(n)?n:vl,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(Qx.div,{"data-orientation":i,...l,...o,ref:t})});_l.displayName=e0;function r0(e){return t0.includes(e)}var n0=_l;function vn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(n0,{"data-slot":"separator",decorative:r,orientation:t,className:F("ecr-separator",e),...n})}const ft=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(vn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(vn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(te,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})},ce=[];for(let e=0;e<256;++e)ce.push((e+256).toString(16).slice(1));function o0(e,t=0){return(ce[e[t+0]]+ce[e[t+1]]+ce[e[t+2]]+ce[e[t+3]]+"-"+ce[e[t+4]]+ce[e[t+5]]+"-"+ce[e[t+6]]+ce[e[t+7]]+"-"+ce[e[t+8]]+ce[e[t+9]]+"-"+ce[e[t+10]]+ce[e[t+11]]+ce[e[t+12]]+ce[e[t+13]]+ce[e[t+14]]+ce[e[t+15]]).toLowerCase()}let Bo;const a0=new Uint8Array(16);function i0(){if(!Bo){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Bo=crypto.getRandomValues.bind(crypto)}return Bo(a0)}const yl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function s0(e,t,r){e=e||{};const n=e.random??e.rng?.()??i0();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,o0(n)}function _n(e,t,r){return yl.randomUUID&&!e?yl.randomUUID():s0(e)}const l0=new Set(["video/mp4"]),c0=[".mp4",".m4v"],d0=e=>(e.mime||"").toLowerCase().trim(),u0=e=>(e.url||"").toLowerCase().trim(),p0=e=>e.split("?")[0].split("#")[0],m0=e=>{const t=p0(e);return c0.some(r=>t.endsWith(r))},f0=()=>{if(typeof document>"u")return!0;const t=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');return t==="probably"||t==="maybe"},h0=e=>{const t=d0(e),r=u0(e),n=t&&l0.has(t),o=r&&m0(r);return!n&&!o?!1:f0()},g0=e=>{const t=[],r=[];for(const n of e)h0(n)?t.push(n):r.push(n);return{compatible:t,incompatible:r}},x0=({setUploadedFiles:e,setShowOptions:t})=>{const r=()=>{if(!window.wp?.media){q.error("Media library is not available.");return}const n=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:!1,library:{type:["video"]}});n.on("select",()=>{const o=n.state().get("selection").toJSON();if(!e)return;const{incompatible:i}=g0(o);i.length>0&&q(a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[a.jsx(Jf,{style:{flexShrink:0},color:"oklch(66.6% 0.179 58.318)"}),i.length," video(s) may not play reliably on iOS/macOS Safari. Recommended format: MP4 (H.264/AAC)."]}));const s=o.map(l=>({url:l.url,mime_type:l.mime,file_uuid:_n(),source:"native"}));e(l=>[...l,...s]),t(!1)}),n.open()};return a.jsxs("button",{className:"ecr-admin-upload-native-video-btn",type:"button",onClick:r,children:[a.jsx(cp,{})," Choose from Media"]})},b0=({setUploadedFiles:e})=>{const[t,r]=y.useState(!1);return a.jsxs("div",{className:"ecr-admin-upload",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload__label",onClick:()=>r(!0),children:a.jsxs("span",{className:"ecr-admin-upload__text-icon_wrapper",children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Upload videos"}),a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click here to upload videos"})]})})]})}),t?a.jsxs("div",{className:"ecr-admin-upload-source-panel",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload-source-panel__close",onClick:()=>r(!1),"aria-label":"Close upload source picker",children:a.jsx(ns,{size:16})}),a.jsx("p",{className:"ecr-admin-upload-source-popover__title",children:"Add Videos"}),a.jsx("p",{className:"ecr-admin-upload-source-popover__description",children:"Upload from media library or paste Vimeo links."}),a.jsxs("div",{className:"ecr-admin-upload-source-popover__options",children:[a.jsx(x0,{setUploadedFiles:e,setShowOptions:r}),a.jsxs(Je,{children:[a.jsx(Ze,{asChild:!0,children:a.jsxs("button",{className:"ecr-admin-upload-vimeo-video-btn",type:"button",children:[a.jsx(ip,{})," Add Vimeo Videos ",a.jsx(at,{size:20})]})}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Vimeo Videos",text:a.jsx(a.Fragment,{children:"To embed Vimeo videos directly into your reels, giving your content a professional, seamless, and engaging playback experience for your audience."})})})]})]})]}):null]})};var yn="Dialog",[wl]=Ve(yn),[v0,ke]=wl(yn),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:yn});return a.jsx(v0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};jl.displayName=yn;var Sl="DialogTrigger",kl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Sl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Vo(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)})});kl.displayName=Sl;var Uo="DialogPortal",[_0,Cl]=wl(Uo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=ke(Uo,t);return a.jsx(_0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};Nl.displayName=Uo;var wn="DialogOverlay",El=x.forwardRef((e,t)=>{const r=Cl(wn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=ke(wn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(w0,{...o,ref:t})}):null});El.displayName=wn;var y0=st("DialogOverlay.RemoveScroll"),w0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(wn,r);return a.jsx(gn,{as:y0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Vo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ht="DialogContent",Tl=x.forwardRef((e,t)=>{const r=Cl(ht,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=ke(ht,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(j0,{...o,ref:t}):a.jsx(S0,{...o,ref:t})})});Tl.displayName=ht;var j0=x.forwardRef((e,t)=>{const r=ke(ht,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Lo(i)},[]),a.jsx(Al,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault())})}),S0=x.forwardRef((e,t)=>{const r=ke(ht,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Al,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=ke(ht,r),c=x.useRef(null),d=J(t,c);return go(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Vo(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(C0,{titleId:l.titleId}),a.jsx(E0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Ho="DialogTitle",Pl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Ho,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Pl.displayName=Ho;var Ol="DialogDescription",k0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});k0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Vo(e){return e?"open":"closed"}var Il="DialogTitleWarning",[E1,zl]=Zf(Il,{contentName:ht,titleName:Ho,docsSlug:"dialog"}),C0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
    364369
    365370If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
    366371
    367 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},C0="DialogDescriptionWarning",N0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(C0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},E0=jl,T0=kl,A0=Nl,P0=El,O0=Tl,R0=Pl,Ml=Ll;function Wo({...e}){return a.jsx(E0,{"data-slot":"dialog",...e})}function qo({...e}){return a.jsx(T0,{"data-slot":"dialog-trigger",...e})}function L0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(A0,{"data-slot":"dialog-portal",container:t,...e})}function I0({className:e,...t}){return a.jsx(P0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function Go({className:e,children:t,...r}){return a.jsxs(L0,{children:[a.jsx(I0,{}),a.jsxs(O0,{"data-slot":"dialog-content",className:F("ecr-dialog__content",e),...r,children:[t,a.jsx(Ml,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(ns,{className:"ecr-dialog__close-icon"})})]})]})}function Ko({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Yo({className:e,...t}){return a.jsx(R0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function z0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const M0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=y.useState([]),[s,l]=y.useState(1),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=uo(b,500),_=y.useRef(!0),v=y.useRef(0),w=y.useRef(null),[j,k]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){k("Missing API configuration."),g(!1),p(!1);return}const A=++v.current;w.current&&w.current.abort();const O=new AbortController;w.current=O,T===1&&_.current?g(!0):p(!0);try{const R={page:T,per_page:50};h&&(R.search=h);const L=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:R,signal:O.signal}),P=L.data,M=parseInt(L.headers["x-wp-totalpages"]||"1",10);A===v.current&&(i(I=>T===1?P:[...I,...P]),l(T+1),d(T<M))}catch(R){if(O.signal.aborted)return;R instanceof Error?k(R.message):k("An unknown error occurred")}finally{_.current&&(_.current=!1),A===v.current&&!O.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),i([]),k(null),_.current=!0,N(1))},[h,N,t]);const C=y.useRef(null),E=y.useCallback(T=>{u||(C.current&&C.current.disconnect(),C.current=new IntersectionObserver(A=>{A[0].isIntersecting&&c&&N(s)}),T&&C.current.observe(T))},[u,c,s,N]);return y.useEffect(()=>()=>{C.current&&C.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},jn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",Dl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:F("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),D0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(_=>_!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),_=[];for(const v of r)h.has(v.id)&&_.push({btn_type:"product",btn_uuid:vn(),buttonText:v.name,buttonUrl:v.permalink,rating:v.average_rating,price:v.price_html,thumbnail:v.images?.[0]?.thumbnail||v.images?.[0]?.src||jn,product_id:v.id});e(_),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Fl,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const _=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!_?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(te,{type:"button",onClick:()=>g(f),className:F("ecr-admin-product-link__button",_?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[_?a.jsx(qf,{size:20,color:"#2563eb"}):a.jsx(Gf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||jn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Fl,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(Dl,{name:"add",handleClick:b})})]})]})},Fl=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),F0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,$0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&F0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:vn(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(Sn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function Sn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const B0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=y.useState(null),[s,l]=y.useState(!1),c=M0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(_n,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Wo,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(qo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Bf,{size:20})," Add Custom Link"]}),a.jsxs(Go,{className:"ecr-admin-link-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx($0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Wo,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(qo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Yf,{size:20})," Tag Products"]}),a.jsxs(Go,{className:"ecr-admin-link-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(D0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},U0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(te,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Xf,{size:16})})]},o.btn_uuid)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(at,{size:20})]}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(B0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const H0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,playsInline:!0,preload:"metadata",onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onError:o,"webkit-playsinline":"true",onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},V0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(H0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Xn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},W0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(V0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(at,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(Qe,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ft,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},q0=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:vn()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:F("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})},G0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx($l,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(q0,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),K0=()=>{const e=Ne(),[t]=Jt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(h=>{i(_=>({..._,title:typeof h=="function"?h(_.title):h}))},[]),p=y.useCallback(h=>{i(_=>({..._,files:typeof h=="function"?h(_.files):h}))},[]),m=y.useCallback(h=>{i(_=>({..._,links:typeof h=="function"?h(_.links):h}))},[]),g=y.useCallback(h=>{i(_=>({..._,thumbnail:typeof h=="function"?h(_.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(_=>_.file_uuid!==c)),d(null))},f=y.useCallback(async h=>{try{l(!0);const _=await he.get(`story/${h}`);i({title:_.data.title,files:_.data.files,links:_.data.links,thumbnail:_.data.thumbnail})}catch(_){_ instanceof Error?q.error(_.message):q.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[a.jsx(Af,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Rr,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(W0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(x0,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(G0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(_n,{className:"ecr-admin-create__separator"}),a.jsx(U0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(up,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Xo,Ul;function Y0(){return Ul||(Ul=1,Xo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Xo}var Jo,Hl;function X0(){if(Hl)return Jo;Hl=1;var e=Y0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Jo=o,Jo}var J0=X0();const Vl=kd(J0);function Wl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:F("ecr-table",e),...t})})}function ql({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:F("ecr-table__header",e),...t})}function Gl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:F("ecr-table__body",e),...t})}function kn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:F("ecr-table__row",e),...t})}function Kl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:F("ecr-table__head",e),...t})}function ze({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:F("ecr-table__cell",e),...t})}function Yl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:F("ecr-table__caption",e),...t})}const Z0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],Q0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Vl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Wl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(lt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(ql,{children:a.jsx(kn,{children:Z0.map((s,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Gl,{children:e.map((s,l)=>a.jsxs(kn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(ze,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(op,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:F("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(te,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(pi,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Or,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(dp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Xl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),eb=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[b]=y.useState(20),[f,h]=y.useState(0),[_,v]=y.useState(1),w=uo(u,500),j=y.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const O=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),R=Number(O.headers?.["x-wp-total"]??0),L=Number(O.headers?.["x-wp-totalpages"]??1),P=Math.max(1,L||1);t(M=>{if(A)return O.data;const I=new Set(M.map(z=>z.id)),B=O.data.filter(z=>!I.has(z.id));return[...M,...B]}),h(R),v(P),E>P&&g(P)}catch(O){if(T.signal.aborted)return;O instanceof Error?n(O.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),k=y.useCallback(()=>{g(E=>o||s||E>=_?E:E+1)},[o,s,_]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),C=y.useCallback(async E=>{try{d(!0),await he.delete(`group/${E}`),await N(),q.success("Group deleted successfully!")}catch(T){T instanceof Error?q.error(T.message):q.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:_,hasMore:m<=_,loadMore:k,refreshGroups:N,deleteGroup:C}},tb={docs:"https://reelswp.com/docs/"},rb=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=eb(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:"All Widgets",Icon:pp},"page")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsxs("a",{href:tb.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Ff,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Lr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:yt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Rr,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(te,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(oi,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Lr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:yt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx(Q0,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Uf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},nb=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){q.error("Please enter valid numbers.");return}try{l(!0),d(!1),await he.post("settings",{rate_limit:m,time_limit:g}),q.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?q.error(b.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?q.error(b.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},ob=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=nb();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Ir,{}),a.jsx(St,{left:[a.jsx(kt,{name:"Settings",Icon:Np},"Settings"),a.jsx(rr,{},"back-settings")],center:[a.jsx(zr,{},"Settings-widget-name")],right:[a.jsx(po,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},ab=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],ib=({tableData:e})=>a.jsxs(Wl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(kn,{children:ab.map((t,r)=>a.jsx(Kl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Gl,{children:e.map((t,r)=>a.jsxs(kn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),sb=()=>{const[e]=Jt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?q.error(g.message):q.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:"Statistics",Icon:pi},"Statistics"),a.jsx(rr,{},"Statistics-back")],center:[a.jsx(zr,{},"Statistics-widget-name")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Xl,{}):d?a.jsx(Bl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(ib,{tableData:i})})]})]})};function lb(e){return U({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function cb(e){return U({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const db=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:F("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(lb,{size:24})}),ub=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Zo=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:F("ecr-input",e),...r}));Zo.displayName="Input";const Qo=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Zo,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,et=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*et:0,v:i/Dt*et,a:o}},Jl=e=>{var{h:t,s:r,l:n,a:o}=Zl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/et;return{h:t,s:i>0&&i<200?r*n/et/(i<=et?i:200-i)*et:0,l:i/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},pb=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(i||"")},fr=e=>mr(mb(e)),mb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Cn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/et,l=n/et,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},fb=e=>{var{r:t,g:r,b:n,a:o}=Cn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},hb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},gb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},ea=e=>Ql(Cn(e)),xb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},bb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},Ft=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&ta(e)?(s=fr(e),c=e):typeof e!="string"&&(s=e),s&&(n=xb(s),i=Zl(s),o=Cn(s),d=pb(o),c=ea(s),r=gb(i),t=hb(o),l=bb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},ta=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ec(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var hr=e=>"touches"in e,tc=e=>{!hr(e)&&e.preventDefault&&e.preventDefault()},rc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nc=(e,t)=>{var r=e.getBoundingClientRect(),n=hr(t)?t.touches[0]:t;return{left:rc((n.pageX-(r.left+window.pageXOffset))/r.width),top:rc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},_b=["prefixCls","className","onMove","onDown"],ra=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,_b),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=ec(o),m=ec(i),g=v=>c.current&&!hr(v)?!1:(c.current=hr(v),!0),b=y.useCallback(v=>{if(tc(v),!!l.current){var w=hr(v)?v.touches.length>0:v.buttons>0;if(!w){u(!1);return}p?.(nc(l.current,v),v)}},[p]),f=y.useCallback(()=>u(!1),[]),h=y.useCallback(v=>{v?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var _=y.useCallback(v=>{var w=document.activeElement;w?.blur(),tc(v.nativeEvent),g(v.nativeEvent)&&l.current&&(m?.(nc(l.current,v.nativeEvent),v.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:_,onTouchStart:_}))});ra.displayName="Interactive";var vb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},yb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,yb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(_,v)=>{u&&d&&u({h:d.h,s:_.left*100,v:(1-_.top)*100,a:d.a})},b=y.useCallback(_=>{if(!(!d||!u)){var v=1,w=d.s,j=d.v,k=!1;switch(_.key){case"ArrowLeft":w=Math.max(0,d.s-v),k=!0,_.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+v),k=!0,_.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+v),k=!0,_.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-v),k=!0,_.preventDefault();break;default:return}k&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var _={top:100-d.v+"%",left:d.s+"%",color:Jl(d)};return i&&typeof i=="function"?i(D({prefixCls:n},_)):a.jsx(vb,D({prefixCls:n},_))},[d,i,n]),h=y.useCallback(_=>{_.target.focus()},[]);return a.jsx(ra,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});oc.displayName="Saturation";var wb=["className","prefixCls","left","top","style","fillProps"],jb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,wb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},Sb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],kb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Nn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,Sb),_=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},v=Jl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+v+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var k=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+kb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var A=.01,O=o.a,R=O;switch(T.key){case"ArrowLeft":m==="horizontal"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(R=Math.min(1,O+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(R=Math.min(1,O+A),T.preventDefault());break;default:return}if(R!==O){var L={left:m==="horizontal"?R:o.a,top:m==="vertical"?R:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:R}),L)}},[o,m,b]),C=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(jb,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:k,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(ra,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:_,onDown:_,onClick:C,onKeyDown:N,children:E}))]}))});Nn.displayName="Alpha";var Cb=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Nb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),Eb=e=>Number(String(e).replace(/%/g,"")),$t=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,Cb),[b,f]=y.useState(i),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function _(C,E){var T=(E||C.target.value).trim().replace(/^#/,"");Nb(T)&&u&&u(C,T);var A=Eb(T);isNaN(A)||u&&u(C,A),f(T)}function v(C){h.current=!1,f(e.value),p&&p(C)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),k=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:_,onBlur:v,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:k,onFocusCapture:C=>{var E=C.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});$t.displayName="EditableInput";var Tb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,Tb),g=n?Cn(n):{};function b(v){var w=Number(v.target.value);w&&w>255&&(v.target.value="255"),w&&w<0&&(v.target.value="0")}var f=v=>{var w=Number(v.target.value);w&&w>100&&(v.target.value="100"),w&&w<0&&(v.target.value="0")},h=(v,w,j)=>{typeof v=="number"&&(w==="a"&&(v<0&&(v=0),v>100&&(v=100),p&&p(Ft(mr(D({},g,{a:v/100}))))),v>255&&(v=255,j.target.value="255"),v<0&&(v=0,j.target.value="0"),w==="r"&&p&&p(Ft(mr(D({},g,{r:v})))),w==="g"&&p&&p(Ft(mr(D({},g,{g:v})))),w==="b"&&p&&p(Ft(mr(D({},g,{b:v})))))},_=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx($t,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"r",v)},i,{style:D({},i.style)})),a.jsx($t,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"g",v)},s,{style:D({marginLeft:5},i.style)})),a.jsx($t,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"b",v)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx($t,D({label:"A",value:parseInt(String(_*100),10),onBlur:f,placement:o,onChange:(v,w)=>h(w,"a",v)},c,{style:D({marginLeft:5},c.style)}))]}))});ac.displayName="EditableInputRGBA";var Ab=["prefixCls","className","hue","onChange","direction"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,Ab);return a.jsx(Nn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});ic.displayName="Hue";var Pb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,Pb),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(fr(f),Ft(fr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var _="",v="";typeof f=="string"&&(_=f,v=f),typeof f=="object"&&f.color&&(_=f.title||f.color,v=f.color);var w=o&&o.toLocaleLowerCase()===v.toLocaleLowerCase(),j=p&&p({title:_,color:v,checked:!!w,style:D({},g,{background:v}),onClick:N=>b(v,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var k=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:v,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:_,onClick:N=>b(v,N)},l,{children:k,style:D({},g,{background:v})}),h)}),d&&y.isValidElement(d)&&d]}))});sc.displayName="Swatch";var Ob=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],Rb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],lc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),cc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=Rb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,Ob),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ta(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Ft(N))},f=(N,C)=>{typeof N=="string"&&ta(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(D({},m,{a:N.a})),_=N=>b(D({},m,N,{a:m.a})),v=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:fb(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},k={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",D({},p,{className:r+" "+(n||""),ref:t,style:v,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(oc,{hsva:m,style:{width:"auto",height:150},onChange:_}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ic,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(Nn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!d&&a.jsx(Nn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx($t,{label:"Hex",value:ea(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,C)=>f(C),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(sc,{style:j,colors:s,color:ea(m),onChange:N=>b(N),rectProps:{style:k}})]}))});cc.displayName="Sketch";const dc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Je,{children:[a.jsx(Ze,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(Qe,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(cc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),Lb=[{value:"left",title:"Align Left",Icon:Hp},{value:"center",title:"Align Center",Icon:Vp},{value:"right",title:"Align Right",Icon:Wp},{value:"hidden",title:"Hidden",Icon:qp}],Ib=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:Lb.map(({value:r,title:n,Icon:o})=>a.jsx(te,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),zb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(Ib,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Qo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Mb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Vl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Db=({gid:e})=>{const[t,r]=Mb(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Df,{color:"#ffffff",size:12})}),a.jsx("span",{className:F("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},uc=y.createContext({requestLeave:e=>e()}),Fb=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function $b(e){return U({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const Bb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Ub,{link:e,usedFor:t})}),Ub=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||jn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||jn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx($b,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Hb=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},En=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(Bb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Hb,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=pc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",_=!b&&!f&&g;return a.jsxs("div",{className:F("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Zn,{story:e,styles:t}),!b&&!f&&h?_?a.jsx(En,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(te,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(vt,{to:c,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:v=>{v.preventDefault(),s(()=>i(c))},children:a.jsx(Or,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(te,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(it,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Wn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},fc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,_=f.scrollWidth,v=f.clientWidth;c(h>0),u(h+v<_-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,_,v;const w=A=>{h=!0,_=A.pageX-f.offsetLeft,v=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},k=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const R=(A.pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-R,g()},C=A=>{h=!0,_=A.touches[0].pageX-f.offsetLeft,v=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const R=(A.touches[0].pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-R,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",k),f.addEventListener("mousemove",N),f.addEventListener("touchstart",C,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",k),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",C),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:F("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(mc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Qt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(er,{size:20})})]})},Vb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:F("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(mc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Wb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(wt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsx(wt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(er,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,_=h.videoWidth,v=h.videoHeight;d(()=>v>_)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Xn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"?b?a.jsx(En,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,g==="title"?a.jsx(Bt,{title:e.title}):null]})})},qb={carousel:hc,grid:Vb},Gb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=qb[s]||hc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(Db,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Wb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(lt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Kb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=pc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Lr,{to:u,text:"Add Reel",Icon:yt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(it,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:_}=f,v=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:v,children:_})};s.displayName=t;const l=e+"CollectionSlot",c=st(l),d=y.forwardRef((f,h)=>{const{scope:_,children:v}=f,w=i(l,_),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:v})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=st(u),g=y.forwardRef((f,h)=>{const{scope:_,children:v,...w}=f,j=y.useRef(null),k=J(h,j),N=i(u,_);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:k,children:v})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const v=h.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,C)=>w.indexOf(N.ref.current)-w.indexOf(C.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var Yb=x.createContext(void 0);function na(e){const t=x.useContext(Yb);return e||t||"ltr"}var oa="rovingFocusGroup.onEntryFocus",Xb={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[aa,bc,Jb]=xc(gr),[Zb,_c]=Ve(gr,[Jb]),[Qb,e_]=Zb(gr),vc=x.forwardRef((e,t)=>a.jsx(aa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(aa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(t_,{...e,ref:t})})}));vc.displayName=gr;var t_=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=na(i),[f,h]=mt({prop:s,defaultProp:l??null,onChange:c,caller:gr}),[_,v]=x.useState(!1),w=We(d),j=bc(r),k=x.useRef(!1),[N,C]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(oa,w),()=>E.removeEventListener(oa,w)},[w]),a.jsx(Qb,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>C(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:_||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{k.current=!0}),onFocus:V(e.onFocus,E=>{const T=!k.current;if(E.target===E.currentTarget&&T&&!_){const A=new CustomEvent(oa,Xb);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const O=j().filter(I=>I.focusable),R=O.find(I=>I.active),L=O.find(I=>I.id===f),M=[R,L,...O].filter(Boolean).map(I=>I.ref.current);jc(M,u)}}k.current=!1}),onBlur:V(e.onBlur,()=>v(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=e_(yc,r),p=u.currentTabStopId===d,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(aa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const _=o_(h,u.orientation,u.dir);if(_!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")w.reverse();else if(_==="prev"||_==="next"){_==="prev"&&w.reverse();const j=w.indexOf(h.currentTarget);w=u.loop?a_(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});wc.displayName=yc;var r_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function n_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function o_(e,t,r){const n=n_(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return r_[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function a_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var i_=vc,s_=wc,Tn="Tabs",[l_]=Ve(Tn,[_c]),Sc=_c(),[c_,ia]=l_(Tn),kc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=na(l),[p,m]=mt({prop:n,onChange:o,defaultProp:i??"",caller:Tn});return a.jsx(c_,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});kc.displayName=Tn;var Cc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=ia(Cc,r),s=Sc(r);return a.jsx(i_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Nc.displayName=Cc;var Ec="TabsTrigger",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=ia(Ec,r),l=Sc(r),c=Oc(s.baseId,n),d=Rc(s.baseId,n),u=n===s.value;return a.jsx(s_,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=ia(Ac,r),c=Oc(l.baseId,n),d=Rc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var d_=kc,u_=Nc,p_=Tc,m_=Pc;function f_({className:e,...t}){return a.jsx(d_,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function h_({className:e,...t}){return a.jsx(u_,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(p_,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(m_,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}const xr=({label:e,text:t})=>a.jsxs(Je,{children:[a.jsx(Ze,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(at,{size:20})]}),a.jsx(cb,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(Qe,{className:"ecr-admin-popover",children:a.jsx(ft,{name:e,text:t})})]});function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function g_(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),x_="VisuallyHidden",b_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));b_.displayName=x_;var __=[" ","Enter","ArrowUp","ArrowDown"],v_=[" ","Enter"],gt="Select",[An,Pn,y_]=xc(gt),[Ut]=Ve(gt,[y_,an]),On=an(),[w_,tt]=Ut(gt),[j_,S_]=Ut(gt),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=On(t),[h,_]=x.useState(null),[v,w]=x.useState(null),[j,k]=x.useState(!1),N=na(d),[C,E]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gt}),[T,A]=mt({prop:s,defaultProp:l,onChange:c,caller:gt}),O=x.useRef(null),R=h?b||!!h.closest("form"):!0,[L,P]=x.useState(new Set),M=Array.from(L).map(I=>I.props.value).join(";");return a.jsx(qs,{...f,children:a.jsxs(w_,{required:g,scope:t,trigger:h,onTriggerChange:_,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:k,contentId:Ae(),value:T,onValueChange:A,open:C,onOpenChange:E,dir:N,triggerPointerDownPosRef:O,disabled:m,children:[a.jsx(An.Provider,{scope:t,children:a.jsx(j_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(I=>{P(B=>new Set(B).add(I))},[]),onNativeOptionRemove:x.useCallback(I=>{P(B=>{const z=new Set(B);return z.delete(I),z})},[]),children:r})}),R?a.jsxs(id,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:I=>A(I.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(L)]},M):null]})})};Dc.displayName=gt;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=On(r),s=tt(Fc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=Pn(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=d().filter(w=>!w.disabled),_=h.find(w=>w.value===s.value),v=cd(h,f,_);v!==void 0&&s.onValueChange(v.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Oo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sd(s.value)?"":void 0,...o,ref:c,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&__.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=tt(Bc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return le(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:sd(c.value)?a.jsx(a.Fragment,{children:s}):i})});Uc.displayName=Bc;var k_="SelectIcon",Hc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=k_;var C_="SelectPortal",Vc=e=>a.jsx(sn,{asChild:!0,...e});Vc.displayName=C_;var xt="SelectContent",Wc=x.forwardRef((e,t)=>{const r=tt(xt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?_r.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(An.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=xt;var Ce=10,[qc,rt]=Ut(xt),N_="SelectContentImpl",E_=st("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,..._}=e,v=tt(xt,r),[w,j]=x.useState(null),[k,N]=x.useState(null),C=J(t,$=>j($)),[E,T]=x.useState(null),[A,O]=x.useState(null),R=Pn(r),[L,P]=x.useState(!1),M=x.useRef(!1);x.useEffect(()=>{if(w)return Lo(w)},[w]),go();const I=x.useCallback($=>{const[Y,...oe]=R().map(re=>re.ref.current),[Z]=oe.slice(-1),Q=document.activeElement;for(const re of $)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===Y&&k&&(k.scrollTop=0),re===Z&&k&&(k.scrollTop=k.scrollHeight),re?.focus(),document.activeElement!==Q))return},[R,k]),B=x.useCallback(()=>I([E,w]),[I,E,w]);x.useEffect(()=>{L&&B()},[L,B]);const{onOpenChange:z,triggerPointerDownPosRef:G}=v;x.useEffect(()=>{if(w){let $={x:0,y:0};const Y=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(G.current?.y??0))}},oe=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||z(!1),document.removeEventListener("pointermove",Y),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,z,G]),x.useEffect(()=>{const $=()=>z(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[z]);const[ae,ie]=ld($=>{const Y=R().filter(Q=>!Q.disabled),oe=Y.find(Q=>Q.ref.current===document.activeElement),Z=cd(Y,$,oe);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(v.value!==void 0&&v.value===Y||Z)&&(T($),Z&&(M.current=!0))},[v.value]),_e=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(v.value!==void 0&&v.value===Y||Z)&&O($)},[v.value]),K=n==="popper"?sa:Kc,de=K===sa?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:k,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:_e,itemTextRefCallback:pe,focusSelectedItem:B,selectedItemText:A,position:n,isPositioned:L,searchRef:ae,children:a.jsx(gn,{as:E_,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:v.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{v.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:a.jsx(K,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:$=>$.preventDefault(),..._,...de,onPlaced:()=>P(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:V(_.onKeyDown,$=>{const Y=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Y&&$.key.length===1&&ie($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=R().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,re=Z.indexOf(Q);Z=Z.slice(re+1)}setTimeout(()=>I(Z)),$.preventDefault()}})})})})})})});Gc.displayName=N_;var T_="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=tt(xt,r),s=rt(xt,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,C=>u(C)),m=Pn(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:_,focusSelectedItem:v}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&_){const C=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=_.getBoundingClientRect();if(i.dir!=="rtl"){const Q=A.left-E.left,re=T.left-Q,ve=C.left-re,bt=C.width+ve,xa=Math.max(bt,E.width),ba=window.innerWidth-Ce,_a=zc(re,[Ce,Math.max(Ce,ba-xa)]);l.style.minWidth=bt+"px",l.style.left=_a+"px"}else{const Q=E.right-A.right,re=window.innerWidth-T.right-Q,ve=window.innerWidth-C.right-re,bt=C.width+ve,xa=Math.max(bt,E.width),ba=window.innerWidth-Ce,_a=zc(re,[Ce,Math.max(Ce,ba-xa)]);l.style.minWidth=bt+"px",l.style.right=_a+"px"}const O=m(),R=window.innerHeight-Ce*2,L=f.scrollHeight,P=window.getComputedStyle(d),M=parseInt(P.borderTopWidth,10),I=parseInt(P.paddingTop,10),B=parseInt(P.borderBottomWidth,10),z=parseInt(P.paddingBottom,10),G=M+I+L+z+B,ae=Math.min(h.offsetHeight*5,G),ie=window.getComputedStyle(f),ge=parseInt(ie.paddingTop,10),_e=parseInt(ie.paddingBottom,10),pe=C.top+C.height/2-Ce,K=R-pe,de=h.offsetHeight/2,$=h.offsetTop+de,Y=M+I+$,oe=G-Y;if(Y<=pe){const Q=O.length>0&&h===O[O.length-1].ref.current;l.style.bottom="0px";const re=d.clientHeight-f.offsetTop-f.offsetHeight,ve=Math.max(K,de+(Q?_e:0)+re+B),bt=Y+ve;l.style.height=bt+"px"}else{const Q=O.length>0&&h===O[0].ref.current;l.style.top="0px";const ve=Math.max(pe,M+f.offsetTop+(Q?ge:0)+de)+oe;l.style.height=ve+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${Ce}px 0`,l.style.minHeight=ae+"px",l.style.maxHeight=R+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,_,i.dir,n]);le(()=>w(),[w]);const[j,k]=x.useState();le(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(C=>{C&&b.current===!0&&(w(),v?.(),b.current=!1)},[w,v]);return a.jsx(P_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=T_;var A_="SelectPopperPosition",sa=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ce,...i}=e,s=On(r);return a.jsx(Gs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});sa.displayName=A_;var[P_,la]=Ut(xt,{}),ca="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=rt(ca,r),s=la(ca,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(An.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-Ce*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),_=Math.max(f,h);if(_<b){const v=_+g,w=Math.min(b,v),j=v-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Yc.displayName=ca;var Xc="SelectGroup",[O_,R_]=Ut(Xc),L_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(O_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});L_.displayName=Xc;var Jc="SelectLabel",I_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=R_(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});I_.displayName=Jc;var Rn="SelectItem",[z_,Zc]=Ut(Rn),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=tt(Rn,r),c=rt(Rn,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,v=>c.itemRefCallback?.(v,n,o)),f=Ae(),h=x.useRef("touch"),_=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(z_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(v=>{p(w=>w||(v?.textContent??"").trim())},[]),children:a.jsx(An.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:b,onFocus:V(s.onFocus,()=>g(!0)),onBlur:V(s.onBlur,()=>g(!1)),onClick:V(s.onClick,()=>{h.current!=="mouse"&&_()}),onPointerUp:V(s.onPointerUp,()=>{h.current==="mouse"&&_()}),onPointerDown:V(s.onPointerDown,v=>{h.current=v.pointerType}),onPointerMove:V(s.onPointerMove,v=>{h.current=v.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(s.onKeyDown,v=>{c.searchRef?.current!==""&&v.key===" "||(v_.includes(v.key)&&_(),v.key===" "&&v.preventDefault())})})})})});Qc.displayName=Rn;var br="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=tt(br,r),l=rt(br,r),c=Zc(br,r),d=S_(br,r),[u,p]=x.useState(null),m=J(t,_=>p(_),c.onItemTextChange,_=>l.itemTextRefCallback?.(_,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_r.createPortal(i.children,s.valueNode):null]})});ed.displayName=br;var td="SelectItemIndicator",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var da="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=rt(da,e.__scopeSelect),n=la(da,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});nd.displayName=da;var ua="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=rt(ua,e.__scopeSelect),n=la(ua,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});od.displayName=ua;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=rt("SelectScrollButton",r),s=x.useRef(null),l=Pn(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{c()})})}),M_="SelectSeparator",D_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});D_.displayName=M_;var pa="SelectArrow",F_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=On(r),i=tt(pa,r),s=rt(pa,r);return i.open&&s.position==="popper"?a.jsx(Ks,{...o,...n,ref:t}):null});F_.displayName=pa;var $_="SelectBubbleInput",id=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=g_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:i,defaultValue:t})});id.displayName=$_;function sd(e){return e===""||e===void 0}function ld(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=B_(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function B_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var U_=Dc,H_=$c,V_=Uc,W_=Hc,q_=Vc,G_=Wc,K_=Yc,Y_=Qc,X_=ed,J_=rd,Z_=nd,Q_=od;function Ht({...e}){return a.jsx(U_,{"data-slot":"select",...e})}function Vt({...e}){return a.jsx(V_,{"data-slot":"select-value",...e})}function Wt({className:e,size:t="default",children:r,...n}){return a.jsxs(H_,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(W_,{asChild:!0,children:a.jsx(mo,{className:"ecr-select__icon"})})]})}function qt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(q_,{container:i,children:a.jsxs(G_,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(ev,{}),a.jsx(K_,{className:F("ecr-select__viewport"),children:t}),a.jsx(tv,{})]})})}function Gt({className:e,children:t,...r}){return a.jsxs(Y_,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(J_,{children:a.jsx(zf,{className:"ecr-select__check-icon"})})}),a.jsx(X_,{children:t})]})}function ev({className:e,...t}){return a.jsx(Z_,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Mf,{className:"ecr-select__icon"})})}function tv({className:e,...t}){return a.jsx(Q_,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(mo,{className:"ecr-select__icon"})})}const rv=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Yu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),nv={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function ov(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(Ht,{defaultValue:Qa[0].value,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Qa.map(e=>a.jsx(Gt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:e.label,text:nv[e.value]})})]})},e.value))]})]})]})}const av=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(xr,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(ov,{}),a.jsx(rv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Ln="Collapsible",[iv]=Ve(Ln),[sv,ma]=iv(Ln),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=mt({prop:n,defaultProp:o??!1,onChange:s,caller:Ln});return a.jsx(sv,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":ha(c),"data-disabled":i?"":void 0,...l,ref:t})})});dd.displayName=Ln;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ma(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ha(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var fa="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ma(fa,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(lv,{...n,ref:t,present:i})})});md.displayName=fa;var lv=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ma(fa,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),_=x.useRef(void 0);return x.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),le(()=>{const v=d.current;if(v){_.current=_.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(v.style.transitionDuration=_.current.transitionDuration,v.style.animationName=_.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":ha(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function ha(e){return e?"open":"closed"}var cv=dd,dv=pd,uv=md;function fd({className:e,...t}){return a.jsx(cv,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(dv,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(mo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(uv,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const pv={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},mv=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Gu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Ku.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r.label,text:pv[r.value]})})]})},r.value))]})]})]}),fv=[{Icon:Hf,label:"Desktop",value:"desktop"},{Icon:Kf,label:"Tab",value:"tab"},{Icon:Wf,label:"Mobile",value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=y.useState(n),g=y.useRef(null);y.useEffect(()=>{m(n)},[n]);const b=h=>{const _=Math.min(r,Math.max(t,Number(h)));o(_)},f=h=>{const _=Number(h);m(_),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(_>r?r:_<t?t:_)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Ht,{value:d,onValueChange:h=>u(h),children:[a.jsx(Wt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Vt,{})}),a.jsx(qt,{style:{minWidth:"60px"},children:fv.map(h=>a.jsx(Gt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const _=Number(h.target.value);m(_),b(_)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Zo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},hv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(xd,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},gv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(xd,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},xv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],bv=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:xv.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(Yp,{color:"#2563eb",size:16}):a.jsx(Xp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},_v=Object.values(Za),vv={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},yv=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[_v.map(r=>a.jsx(Gt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r,text:vv[r]})})]})},r))]})]})]}),wv=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx($f,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(bv,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(yv,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(mv,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(gv,{styles:r,updateStyles:n}),a.jsx(hv,{styles:r,updateStyles:n}),a.jsx(xr,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(xr,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(xr,{label:"Show Add to Cart",text:a.jsx(a.Fragment,{children:"Show a clear “Add to Cart” button on your tagged product to encourage quick purchases and boost conversions."})}),a.jsx(xr,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),jv=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Wu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Sv=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Vf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Qo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Qo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(jv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),kv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(wv,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(Sv,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},Cv=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(f_,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(h_,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:i.preview,children:"Preview"})]}),a.jsx(Ic,{value:i.thumbnail,children:a.jsx(kv,{styles:e,updateStyles:c})}),a.jsx(Ic,{value:i.preview,children:a.jsx(av,{styles:e,updateStyles:c})})]})})]})]})},Nv=e=>{const t=Ne(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(ot),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const v=(await he.get(`stories/${e}`)).data;n(v.group_name),i(v.stories),l(v.styles??ot)}catch(_){_ instanceof Error?q.error(_.message):q.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const _=o.map(j=>j.id),v={group_name:r,styles:s,story_ids:_};e&&(v.group_id=e);const w=await he.post("stories/manage-group-stories",v);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),q.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?q.error(h.message):q.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},Ev=e=>{const[t,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return y.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},Tv=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},Av=()=>{const e=Ne(),[t]=Jt(),r=t.get("gid"),n=Ev("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=Nv(r),{allReels:f,searchTerm:h,setSearchTerm:_,isSearching:v,lastStoryElementRef:w,refreshReels:j}=Qi(r),[k,N]=y.useState(""),[C,E]=y.useState(n),[T,A]=y.useState(bd.thumbnail),[O,R]=y.useState([]),L=y.useMemo(()=>new Set(s.map(K=>K.story_uuid)),[s]),P=y.useMemo(()=>h.trim().toLowerCase(),[h]),M=y.useMemo(()=>P?O.filter(K=>K.title.toLowerCase().includes(P)):O,[O,P]),I=y.useMemo(()=>{const K=new Map;for(const de of M)K.set(de.story_uuid,de);for(const de of f)K.has(de.story_uuid)||K.set(de.story_uuid,de);return Array.from(K.values())},[M,f]),B=y.useMemo(()=>I.filter(K=>!L.has(K.story_uuid)),[I,L]);y.useEffect(()=>{E(n)},[n]),y.useEffect(()=>{R([])},[r]);const{showLeaveModal:z,requestLeave:G,confirmLeave:ae,cancelLeave:ie,allowNextNavigation:ge}=Tv(m),_e=async(K,de)=>{try{N(K.story_uuid);const $=de==="add"?[K,...s]:s.filter(Y=>Y.story_uuid!==K.story_uuid);l($),R(de==="add"?Y=>Y.filter(oe=>oe.story_uuid!==K.story_uuid):Y=>Y.some(oe=>oe.story_uuid===K.story_uuid)?Y:[K,...Y]),g(!0)}catch($){$ instanceof Error?q.error($.message):q.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const K=await b();K&&(R([]),j()),K?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${K.group_id}`,{replace:!0})})};return u?a.jsx(Ir,{}):a.jsxs(Fb,{value:{requestLeave:G},children:[a.jsx(St,{left:[a.jsx(kt,{name:"Manage Widget",Icon:Or},"page"),a.jsx(rr,{cb:()=>G(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(es,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Wo,{children:[a.jsx(qo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(ub,{})}),a.jsxs(Go,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Customize title appearance"})}),a.jsx(zb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(z0,{asChild:!0,children:a.jsx(te,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(db,{isExpanded:C,setIsExpanded:E},"toggle"),a.jsx(po,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:K=>G(()=>e(K))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Kb,{allReels:B,gid:r,handleSelectReel:_e,searchTerm:h,setSearchTerm:_,isSearching:v,togglingId:k,lastStoryElementRef:w}),a.jsx(Gb,{gid:r,reels:s,styles:c,handleRemoveReel:_e,togglingId:k,currentTab:T}),C&&a.jsx(Cv,{isExpanded:C,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:bd,setCurrentTab:A,currentTab:T})]}),z&&a.jsx(Rr,{onReject:ie,onAccept:ae,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function Pv(){const[e]=Jt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(ob,{});break;case X.ar:r=a.jsx(Ef,{});break;case X.stat:r=a.jsx(sb,{});break;case X.cr:r=a.jsx(K0,{});break;case X.mg:r=a.jsx(Av,{});break;default:r=a.jsx(rb,{})}return a.jsxs("div",{children:[r,a.jsx(Hu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const _d=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},vd=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),Ov=()=>{const e=y.useContext(ga);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=y.useState(r.length-1),[d,u]=y.useState(null),[p,m]=y.useState(!0),[g,b]=y.useState(0),[f,h]=y.useState(!1),[_,v]=y.useState({index:0,story_uuid:r[0]?.story_uuid??""}),w=d?.links&&d.links.length>0?d.links[0]:null,j=t?.playerAppearance??"overlay",k=y.useRef(""),N=y.useCallback((L,P=1)=>{if(r.length===0)return null;let M=L;for(let I=0;I<r.length;I+=1){const B=r[M];if(vd(B))return{story:B,index:M};M=(M+P+r.length)%r.length}return null},[r]),C=y.useCallback(()=>{c(r.length-1);const L=r.findIndex(I=>String(I.story_uuid)===o),P=L>=0?r[L]:null,M=vd(P)?{story:P,index:L}:N(Math.max(L,0),1);if(!M?.story){u(null),m(!1);return}u(M.story),L!==M.index&&M.story.story_uuid!==o&&i(M.story.story_uuid),v({index:0,story_uuid:M.story.story_uuid}),m(!1)},[N,o,i,r]);y.useEffect(()=>{C()},[C]),y.useEffect(()=>(k.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=k.current}),[]);const E=y.useCallback(()=>{i(null)},[i]),T=y.useCallback((L=1)=>{m(!0);const P=r.findIndex(G=>String(G.story_uuid)===String(o)),M=L>0?1:-1,I=L>0?l>P?P+1:0:P>0?P-1:l,B=N(I,M);if(!B?.story){m(!1);return}const z=B.story;if(z.story_uuid===o){m(!1),E();return}v({index:0,story_uuid:z.story_uuid}),n&&_d(n,z.id,s),i(z.story_uuid),m(!1)},[E,N,n,o,l,i,s,r]),A=y.useCallback(()=>{const L=d?.files??[];if(_.index>0){v(P=>({index:P.index-1,story_uuid:L[P.index-1].story_uuid??""}));return}T(-1)},[_.index,T,d?.files]),O=y.useCallback(()=>{const L=d?.files??[];if(_.index+1<L.length){v(P=>({index:P.index+1,story_uuid:L[P.index+1].story_uuid??""}));return}T(1)},[_.index,T,d?.files]),R=y.useCallback(L=>{L.target===L.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:_,duration:g,handleBackdropClick:R,handleNextFile:O,handlePrevFile:A,isLoadingNext:p,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsPlaying:i,firstLink:w,playerAppearance:j}},Rv=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),Lv=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:i,isLoadingNext:s,isPaused:l,playerAppearance:c,playingStory:d,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=Ov();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:d&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(wt,{onClick:i,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}),a.jsx(wt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[d&&a.jsx(si,{playingStory:d,duration:r,currentFileIndex:t,isPaused:l},`${d.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),s?a.jsx(Rv,{}):d?.files.length>0&&a.jsx(ui,{currentFileIndex:t,files:d?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:i,handleNextFile:o,storyId:d.id,storyTitle:d?.title}),c==="overlay"?u?a.jsx(En,{link:u,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:d.title}):null,c==="title"?a.jsx(Bt,{title:d.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Zn,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(En,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},Iv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Qt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(er,{size:20,style:{width:"20px",height:"20px"}})})]})},wd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),zv={carousel:Iv,grid:wd},Mv=()=>{const e=y.useContext(ga),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=zv[d]||wd,p=({sid:m,story_uuid:g})=>{i(g),o&&_d(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Dv=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(ot),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(ot),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||ot)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ga=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=Dv(e);return a.jsxs(ga.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(Lv,{}),a.jsx(Mv,{})]})};va(()=>{const e=document.getElementById("ecommreels-admin-app");e&&In.createRoot(e).render(a.jsx(Zd,{children:a.jsx(Pv,{})}))}),va(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
     372For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},N0="DialogDescriptionWarning",E0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(N0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},T0=jl,A0=kl,P0=Nl,O0=El,R0=Tl,L0=Pl,Ml=Ll;function Wo({...e}){return a.jsx(T0,{"data-slot":"dialog",...e})}function qo({...e}){return a.jsx(A0,{"data-slot":"dialog-trigger",...e})}function I0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(P0,{"data-slot":"dialog-portal",container:t,...e})}function z0({className:e,...t}){return a.jsx(O0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function Go({className:e,children:t,...r}){return a.jsxs(I0,{children:[a.jsx(z0,{}),a.jsxs(R0,{"data-slot":"dialog-content",className:F("ecr-dialog__content",e),...r,children:[t,a.jsx(Ml,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(ns,{className:"ecr-dialog__close-icon"})})]})]})}function Ko({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Yo({className:e,...t}){return a.jsx(L0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function M0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const D0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=y.useState([]),[s,l]=y.useState(1),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=uo(b,500),v=y.useRef(!0),_=y.useRef(0),w=y.useRef(null),[j,k]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){k("Missing API configuration."),g(!1),p(!1);return}const O=++_.current;w.current&&w.current.abort();const R=new AbortController;w.current=R,T===1&&v.current?g(!0):p(!0);try{const L={page:T,per_page:50};h&&(L.search=h);const A=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:L,signal:R.signal}),P=A.data,z=parseInt(A.headers["x-wp-totalpages"]||"1",10);O===_.current&&(i(I=>T===1?P:[...I,...P]),l(T+1),d(T<z))}catch(L){if(R.signal.aborted)return;L instanceof Error?k(L.message):k("An unknown error occurred")}finally{v.current&&(v.current=!1),O===_.current&&!R.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),i([]),k(null),v.current=!0,N(1))},[h,N,t]);const C=y.useRef(null),E=y.useCallback(T=>{u||(C.current&&C.current.disconnect(),C.current=new IntersectionObserver(O=>{O[0].isIntersecting&&c&&N(s)}),T&&C.current.observe(T))},[u,c,s,N]);return y.useEffect(()=>()=>{C.current&&C.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},jn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",Dl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:F("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),F0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),v=[];for(const _ of r)h.has(_.id)&&v.push({btn_type:"product",btn_uuid:_n(),buttonText:_.name,buttonUrl:_.permalink,rating:_.average_rating,price:_.price_html,thumbnail:_.images?.[0]?.thumbnail||_.images?.[0]?.src||jn,product_id:_.id});e(v),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Fl,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const v=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(te,{type:"button",onClick:()=>g(f),className:F("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(qf,{size:20,color:"#2563eb"}):a.jsx(Gf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||jn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Fl,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(Dl,{name:"add",handleClick:b})})]})]})},Fl=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),$0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,B0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&$0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:_n(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(Sn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function Sn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const U0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=y.useState(null),[s,l]=y.useState(!1),c=D0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(vn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Wo,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(qo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Bf,{size:20})," Add Custom Link"]}),a.jsxs(Go,{className:"ecr-admin-link-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(B0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Wo,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(qo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Yf,{size:20})," Tag Products"]}),a.jsxs(Go,{className:"ecr-admin-link-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(F0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},H0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(te,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Xf,{size:16})})]},o.btn_uuid)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(at,{size:20})]}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(U0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const V0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,playsInline:!0,preload:"metadata",onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onError:o,"webkit-playsinline":"true",onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},W0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(V0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Xn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},q0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(W0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(at,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(Qe,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ft,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},G0=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:_n()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:F("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})},K0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx($l,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(G0,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),Y0=()=>{const e=Ne(),[t]=Jt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(h=>{i(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=y.useCallback(h=>{i(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=y.useCallback(h=>{i(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=y.useCallback(h=>{i(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(v=>v.file_uuid!==c)),d(null))},f=y.useCallback(async h=>{try{l(!0);const v=await he.get(`story/${h}`);i({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?q.error(v.message):q.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[a.jsx(Af,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Rr,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(q0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(b0,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(K0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(vn,{className:"ecr-admin-create__separator"}),a.jsx(H0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(up,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Xo,Ul;function X0(){return Ul||(Ul=1,Xo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Xo}var Jo,Hl;function J0(){if(Hl)return Jo;Hl=1;var e=X0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Jo=o,Jo}var Z0=J0();const Vl=kd(Z0);function Wl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:F("ecr-table",e),...t})})}function ql({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:F("ecr-table__header",e),...t})}function Gl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:F("ecr-table__body",e),...t})}function kn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:F("ecr-table__row",e),...t})}function Kl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:F("ecr-table__head",e),...t})}function ze({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:F("ecr-table__cell",e),...t})}function Yl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:F("ecr-table__caption",e),...t})}const Q0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],eb=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Vl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Wl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(lt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(ql,{children:a.jsx(kn,{children:Q0.map((s,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Gl,{children:e.map((s,l)=>a.jsxs(kn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(ze,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(op,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:F("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(te,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(_t,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(pi,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(_t,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Or,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(dp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Xl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),tb=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[b]=y.useState(20),[f,h]=y.useState(0),[v,_]=y.useState(1),w=uo(u,500),j=y.useCallback(async E=>{const T=new AbortController,O=E===1;try{O?i(!0):l(!0),n("");const R=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),L=Number(R.headers?.["x-wp-total"]??0),A=Number(R.headers?.["x-wp-totalpages"]??1),P=Math.max(1,A||1);t(z=>{if(O)return R.data;const I=new Set(z.map(M=>M.id)),B=R.data.filter(M=>!I.has(M.id));return[...z,...B]}),h(L),_(P),E>P&&g(P)}catch(R){if(T.signal.aborted)return;R instanceof Error?n(R.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(O?i(!1):l(!1))}},[b,w]),k=y.useCallback(()=>{g(E=>o||s||E>=v?E:E+1)},[o,s,v]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),C=y.useCallback(async E=>{try{d(!0),await he.delete(`group/${E}`),await N(),q.success("Group deleted successfully!")}catch(T){T instanceof Error?q.error(T.message):q.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:k,refreshGroups:N,deleteGroup:C}},rb={docs:"https://reelswp.com/docs/"},nb=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=tb(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:"All Widgets",Icon:pp},"page")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsxs("a",{href:rb.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Ff,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Lr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:yt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Rr,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(te,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(oi,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Lr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:yt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx(eb,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Uf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},ob=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){q.error("Please enter valid numbers.");return}try{l(!0),d(!1),await he.post("settings",{rate_limit:m,time_limit:g}),q.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?q.error(b.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?q.error(b.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},ab=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=ob();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Ir,{}),a.jsx(St,{left:[a.jsx(kt,{name:"Settings",Icon:Np},"Settings"),a.jsx(rr,{},"back-settings")],center:[a.jsx(zr,{},"Settings-widget-name")],right:[a.jsx(po,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},ib=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],sb=({tableData:e})=>a.jsxs(Wl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(kn,{children:ib.map((t,r)=>a.jsx(Kl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Gl,{children:e.map((t,r)=>a.jsxs(kn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),lb=()=>{const[e]=Jt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?q.error(g.message):q.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:"Statistics",Icon:pi},"Statistics"),a.jsx(rr,{},"Statistics-back")],center:[a.jsx(zr,{},"Statistics-widget-name")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Xl,{}):d?a.jsx(Bl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(sb,{tableData:i})})]})]})};function cb(e){return U({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function db(e){return U({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const ub=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:F("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(cb,{size:24})}),pb=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Zo=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:F("ecr-input",e),...r}));Zo.displayName="Input";const Qo=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Zo,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,et=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*et:0,v:i/Dt*et,a:o}},Jl=e=>{var{h:t,s:r,l:n,a:o}=Zl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/et;return{h:t,s:i>0&&i<200?r*n/et/(i<=et?i:200-i)*et:0,l:i/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},mb=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(i||"")},fr=e=>mr(fb(e)),fb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Cn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/et,l=n/et,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},hb=e=>{var{r:t,g:r,b:n,a:o}=Cn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},gb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},xb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},ea=e=>Ql(Cn(e)),bb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},vb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},Ft=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&ta(e)?(s=fr(e),c=e):typeof e!="string"&&(s=e),s&&(n=bb(s),i=Zl(s),o=Cn(s),d=mb(o),c=ea(s),r=xb(i),t=gb(o),l=vb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},ta=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ec(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var hr=e=>"touches"in e,tc=e=>{!hr(e)&&e.preventDefault&&e.preventDefault()},rc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nc=(e,t)=>{var r=e.getBoundingClientRect(),n=hr(t)?t.touches[0]:t;return{left:rc((n.pageX-(r.left+window.pageXOffset))/r.width),top:rc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},_b=["prefixCls","className","onMove","onDown"],ra=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,_b),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=ec(o),m=ec(i),g=_=>c.current&&!hr(_)?!1:(c.current=hr(_),!0),b=y.useCallback(_=>{if(tc(_),!!l.current){var w=hr(_)?_.touches.length>0:_.buttons>0;if(!w){u(!1);return}p?.(nc(l.current,_),_)}},[p]),f=y.useCallback(()=>u(!1),[]),h=y.useCallback(_=>{_?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var v=y.useCallback(_=>{var w=document.activeElement;w?.blur(),tc(_.nativeEvent),g(_.nativeEvent)&&l.current&&(m?.(nc(l.current,_.nativeEvent),_.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});ra.displayName="Interactive";var yb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},wb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,wb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(v,_)=>{u&&d&&u({h:d.h,s:v.left*100,v:(1-v.top)*100,a:d.a})},b=y.useCallback(v=>{if(!(!d||!u)){var _=1,w=d.s,j=d.v,k=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,d.s-_),k=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+_),k=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+_),k=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-_),k=!0,v.preventDefault();break;default:return}k&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var v={top:100-d.v+"%",left:d.s+"%",color:Jl(d)};return i&&typeof i=="function"?i(D({prefixCls:n},v)):a.jsx(yb,D({prefixCls:n},v))},[d,i,n]),h=y.useCallback(v=>{v.target.focus()},[]);return a.jsx(ra,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});oc.displayName="Saturation";var jb=["className","prefixCls","left","top","style","fillProps"],Sb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,jb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},kb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],Cb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Nn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,kb),v=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},_=Jl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+_+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var k=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+Cb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var O=.01,R=o.a,L=R;switch(T.key){case"ArrowLeft":m==="horizontal"&&(L=Math.max(0,R-O),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(L=Math.min(1,R+O),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(L=Math.max(0,R-O),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(L=Math.min(1,R+O),T.preventDefault());break;default:return}if(L!==R){var A={left:m==="horizontal"?L:o.a,top:m==="vertical"?L:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:L}),A)}},[o,m,b]),C=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(Sb,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:k,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(ra,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:C,onKeyDown:N,children:E}))]}))});Nn.displayName="Alpha";var Nb=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Eb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),Tb=e=>Number(String(e).replace(/%/g,"")),$t=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,Nb),[b,f]=y.useState(i),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(C,E){var T=(E||C.target.value).trim().replace(/^#/,"");Eb(T)&&u&&u(C,T);var O=Tb(T);isNaN(O)||u&&u(C,O),f(T)}function _(C){h.current=!1,f(e.value),p&&p(C)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),k=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:v,onBlur:_,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:k,onFocusCapture:C=>{var E=C.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});$t.displayName="EditableInput";var Ab=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,Ab),g=n?Cn(n):{};function b(_){var w=Number(_.target.value);w&&w>255&&(_.target.value="255"),w&&w<0&&(_.target.value="0")}var f=_=>{var w=Number(_.target.value);w&&w>100&&(_.target.value="100"),w&&w<0&&(_.target.value="0")},h=(_,w,j)=>{typeof _=="number"&&(w==="a"&&(_<0&&(_=0),_>100&&(_=100),p&&p(Ft(mr(D({},g,{a:_/100}))))),_>255&&(_=255,j.target.value="255"),_<0&&(_=0,j.target.value="0"),w==="r"&&p&&p(Ft(mr(D({},g,{r:_})))),w==="g"&&p&&p(Ft(mr(D({},g,{g:_})))),w==="b"&&p&&p(Ft(mr(D({},g,{b:_})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx($t,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"r",_)},i,{style:D({},i.style)})),a.jsx($t,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"g",_)},s,{style:D({marginLeft:5},i.style)})),a.jsx($t,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"b",_)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx($t,D({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(_,w)=>h(w,"a",_)},c,{style:D({marginLeft:5},c.style)}))]}))});ac.displayName="EditableInputRGBA";var Pb=["prefixCls","className","hue","onChange","direction"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,Pb);return a.jsx(Nn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});ic.displayName="Hue";var Ob=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,Ob),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(fr(f),Ft(fr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var v="",_="";typeof f=="string"&&(v=f,_=f),typeof f=="object"&&f.color&&(v=f.title||f.color,_=f.color);var w=o&&o.toLocaleLowerCase()===_.toLocaleLowerCase(),j=p&&p({title:v,color:_,checked:!!w,style:D({},g,{background:_}),onClick:N=>b(_,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var k=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:_,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:v,onClick:N=>b(_,N)},l,{children:k,style:D({},g,{background:_})}),h)}),d&&y.isValidElement(d)&&d]}))});sc.displayName="Swatch";var Rb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],Lb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],lc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),cc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=Lb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,Rb),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ta(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Ft(N))},f=(N,C)=>{typeof N=="string"&&ta(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(D({},m,{a:N.a})),v=N=>b(D({},m,N,{a:m.a})),_=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:hb(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},k={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",D({},p,{className:r+" "+(n||""),ref:t,style:_,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(oc,{hsva:m,style:{width:"auto",height:150},onChange:v}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ic,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(Nn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!d&&a.jsx(Nn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx($t,{label:"Hex",value:ea(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,C)=>f(C),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(sc,{style:j,colors:s,color:ea(m),onChange:N=>b(N),rectProps:{style:k}})]}))});cc.displayName="Sketch";const dc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Je,{children:[a.jsx(Ze,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(Qe,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(cc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),Ib=[{value:"left",title:"Align Left",Icon:Hp},{value:"center",title:"Align Center",Icon:Vp},{value:"right",title:"Align Right",Icon:Wp},{value:"hidden",title:"Hidden",Icon:qp}],zb=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:Ib.map(({value:r,title:n,Icon:o})=>a.jsx(te,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),Mb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(zb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Qo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Db=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Vl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Fb=({gid:e})=>{const[t,r]=Db(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Df,{color:"#ffffff",size:12})}),a.jsx("span",{className:F("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},uc=y.createContext({requestLeave:e=>e()}),$b=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function Bb(e){return U({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const Ub=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Hb,{link:e,usedFor:t})}),Hb=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||jn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||jn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx(Bb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Vb=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},En=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(Ub,{link:e,usedFor:t},e.btn_uuid):a.jsx(Vb,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=pc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",v=!b&&!f&&g;return a.jsxs("div",{className:F("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Zn,{story:e,styles:t}),!b&&!f&&h?v?a.jsx(En,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(te,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(_t,{to:c,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:_=>{_.preventDefault(),s(()=>i(c))},children:a.jsx(Or,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(te,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(it,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Wn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},fc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,v=f.scrollWidth,_=f.clientWidth;c(h>0),u(h+_<v-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,v,_;const w=O=>{h=!0,v=O.pageX-f.offsetLeft,_=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},k=()=>{h=!1,f.style.cursor="default"},N=O=>{if(!h)return;O.preventDefault();const L=(O.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-L,g()},C=O=>{h=!0,v=O.touches[0].pageX-f.offsetLeft,_=f.scrollLeft},E=()=>{h=!1},T=O=>{if(!h)return;const L=(O.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-L,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",k),f.addEventListener("mousemove",N),f.addEventListener("touchstart",C,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",k),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",C),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:F("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(mc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Qt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(er,{size:20})})]})},Wb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:F("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(mc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),qb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(wt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsx(wt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(er,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,v=h.videoWidth,_=h.videoHeight;d(()=>_>v)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Xn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"?b?a.jsx(En,{link:b,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,g==="title"?a.jsx(Bt,{title:e.title}):null]})})},Gb={carousel:hc,grid:Wb},Kb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Gb[s]||hc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(Fb,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(qb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(lt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Yb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=pc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Lr,{to:u,text:"Add Reel",Icon:yt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(it,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:v}=f,_=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:_,children:v})};s.displayName=t;const l=e+"CollectionSlot",c=st(l),d=y.forwardRef((f,h)=>{const{scope:v,children:_}=f,w=i(l,v),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:_})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=st(u),g=y.forwardRef((f,h)=>{const{scope:v,children:_,...w}=f,j=y.useRef(null),k=J(h,j),N=i(u,v);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:k,children:_})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const _=h.collectionRef.current;if(!_)return[];const w=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,C)=>w.indexOf(N.ref.current)-w.indexOf(C.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var Xb=x.createContext(void 0);function na(e){const t=x.useContext(Xb);return e||t||"ltr"}var oa="rovingFocusGroup.onEntryFocus",Jb={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[aa,bc,Zb]=xc(gr),[Qb,vc]=Ve(gr,[Zb]),[ev,tv]=Qb(gr),_c=x.forwardRef((e,t)=>a.jsx(aa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(aa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(rv,{...e,ref:t})})}));_c.displayName=gr;var rv=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=na(i),[f,h]=mt({prop:s,defaultProp:l??null,onChange:c,caller:gr}),[v,_]=x.useState(!1),w=We(d),j=bc(r),k=x.useRef(!1),[N,C]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(oa,w),()=>E.removeEventListener(oa,w)},[w]),a.jsx(ev,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>C(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:v||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{k.current=!0}),onFocus:V(e.onFocus,E=>{const T=!k.current;if(E.target===E.currentTarget&&T&&!v){const O=new CustomEvent(oa,Jb);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const R=j().filter(I=>I.focusable),L=R.find(I=>I.active),A=R.find(I=>I.id===f),z=[L,A,...R].filter(Boolean).map(I=>I.ref.current);jc(z,u)}}k.current=!1}),onBlur:V(e.onBlur,()=>_(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=tv(yc,r),p=u.currentTabStopId===d,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(aa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=av(h,u.orientation,u.dir);if(v!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const j=w.indexOf(h.currentTarget);w=u.loop?iv(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});wc.displayName=yc;var nv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ov(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function av(e,t,r){const n=ov(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return nv[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function iv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var sv=_c,lv=wc,Tn="Tabs",[cv]=Ve(Tn,[vc]),Sc=vc(),[dv,ia]=cv(Tn),kc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=na(l),[p,m]=mt({prop:n,onChange:o,defaultProp:i??"",caller:Tn});return a.jsx(dv,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});kc.displayName=Tn;var Cc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=ia(Cc,r),s=Sc(r);return a.jsx(sv,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Nc.displayName=Cc;var Ec="TabsTrigger",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=ia(Ec,r),l=Sc(r),c=Oc(s.baseId,n),d=Rc(s.baseId,n),u=n===s.value;return a.jsx(lv,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=ia(Ac,r),c=Oc(l.baseId,n),d=Rc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var uv=kc,pv=Nc,mv=Tc,fv=Pc;function hv({className:e,...t}){return a.jsx(uv,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function gv({className:e,...t}){return a.jsx(pv,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(mv,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(fv,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}const xr=({label:e,text:t})=>a.jsxs(Je,{children:[a.jsx(Ze,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(at,{size:20})]}),a.jsx(db,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(Qe,{className:"ecr-admin-popover",children:a.jsx(ft,{name:e,text:t})})]});function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function xv(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bv="VisuallyHidden",vv=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));vv.displayName=bv;var _v=[" ","Enter","ArrowUp","ArrowDown"],yv=[" ","Enter"],gt="Select",[An,Pn,wv]=xc(gt),[Ut]=Ve(gt,[wv,an]),On=an(),[jv,tt]=Ut(gt),[Sv,kv]=Ut(gt),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=On(t),[h,v]=x.useState(null),[_,w]=x.useState(null),[j,k]=x.useState(!1),N=na(d),[C,E]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gt}),[T,O]=mt({prop:s,defaultProp:l,onChange:c,caller:gt}),R=x.useRef(null),L=h?b||!!h.closest("form"):!0,[A,P]=x.useState(new Set),z=Array.from(A).map(I=>I.props.value).join(";");return a.jsx(qs,{...f,children:a.jsxs(jv,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:k,contentId:Ae(),value:T,onValueChange:O,open:C,onOpenChange:E,dir:N,triggerPointerDownPosRef:R,disabled:m,children:[a.jsx(An.Provider,{scope:t,children:a.jsx(Sv,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(I=>{P(B=>new Set(B).add(I))},[]),onNativeOptionRemove:x.useCallback(I=>{P(B=>{const M=new Set(B);return M.delete(I),M})},[]),children:r})}),L?a.jsxs(id,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:I=>O(I.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(A)]},z):null]})})};Dc.displayName=gt;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=On(r),s=tt(Fc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=Pn(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=d().filter(w=>!w.disabled),v=h.find(w=>w.value===s.value),_=cd(h,f,v);_!==void 0&&s.onValueChange(_.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Oo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sd(s.value)?"":void 0,...o,ref:c,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&_v.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=tt(Bc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return le(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:sd(c.value)?a.jsx(a.Fragment,{children:s}):i})});Uc.displayName=Bc;var Cv="SelectIcon",Hc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=Cv;var Nv="SelectPortal",Vc=e=>a.jsx(sn,{asChild:!0,...e});Vc.displayName=Nv;var xt="SelectContent",Wc=x.forwardRef((e,t)=>{const r=tt(xt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?vr.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(An.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=xt;var Ce=10,[qc,rt]=Ut(xt),Ev="SelectContentImpl",Tv=st("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,_=tt(xt,r),[w,j]=x.useState(null),[k,N]=x.useState(null),C=J(t,$=>j($)),[E,T]=x.useState(null),[O,R]=x.useState(null),L=Pn(r),[A,P]=x.useState(!1),z=x.useRef(!1);x.useEffect(()=>{if(w)return Lo(w)},[w]),go();const I=x.useCallback($=>{const[Y,...oe]=L().map(re=>re.ref.current),[Z]=oe.slice(-1),Q=document.activeElement;for(const re of $)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===Y&&k&&(k.scrollTop=0),re===Z&&k&&(k.scrollTop=k.scrollHeight),re?.focus(),document.activeElement!==Q))return},[L,k]),B=x.useCallback(()=>I([E,w]),[I,E,w]);x.useEffect(()=>{A&&B()},[A,B]);const{onOpenChange:M,triggerPointerDownPosRef:G}=_;x.useEffect(()=>{if(w){let $={x:0,y:0};const Y=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(G.current?.y??0))}},oe=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||M(!1),document.removeEventListener("pointermove",Y),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,M,G]),x.useEffect(()=>{const $=()=>M(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[M]);const[ie,se]=ld($=>{const Y=L().filter(Q=>!Q.disabled),oe=Y.find(Q=>Q.ref.current===document.activeElement),Z=cd(Y,$,oe);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback(($,Y,oe)=>{const Z=!z.current&&!oe;(_.value!==void 0&&_.value===Y||Z)&&(T($),Z&&(z.current=!0))},[_.value]),ve=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback(($,Y,oe)=>{const Z=!z.current&&!oe;(_.value!==void 0&&_.value===Y||Z)&&R($)},[_.value]),K=n==="popper"?sa:Kc,de=K===sa?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:k,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:ve,itemTextRefCallback:pe,focusSelectedItem:B,selectedItemText:O,position:n,isPositioned:A,searchRef:ie,children:a.jsx(gn,{as:Tv,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:_.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{_.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:a.jsx(K,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:$=>$.preventDefault(),...v,...de,onPlaced:()=>P(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:V(v.onKeyDown,$=>{const Y=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Y&&$.key.length===1&&se($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=L().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,re=Z.indexOf(Q);Z=Z.slice(re+1)}setTimeout(()=>I(Z)),$.preventDefault()}})})})})})})});Gc.displayName=Ev;var Av="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=tt(xt,r),s=rt(xt,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,C=>u(C)),m=Pn(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:_}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&v){const C=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),O=v.getBoundingClientRect();if(i.dir!=="rtl"){const Q=O.left-E.left,re=T.left-Q,_e=C.left-re,bt=C.width+_e,xa=Math.max(bt,E.width),ba=window.innerWidth-Ce,va=zc(re,[Ce,Math.max(Ce,ba-xa)]);l.style.minWidth=bt+"px",l.style.left=va+"px"}else{const Q=E.right-O.right,re=window.innerWidth-T.right-Q,_e=window.innerWidth-C.right-re,bt=C.width+_e,xa=Math.max(bt,E.width),ba=window.innerWidth-Ce,va=zc(re,[Ce,Math.max(Ce,ba-xa)]);l.style.minWidth=bt+"px",l.style.right=va+"px"}const R=m(),L=window.innerHeight-Ce*2,A=f.scrollHeight,P=window.getComputedStyle(d),z=parseInt(P.borderTopWidth,10),I=parseInt(P.paddingTop,10),B=parseInt(P.borderBottomWidth,10),M=parseInt(P.paddingBottom,10),G=z+I+A+M+B,ie=Math.min(h.offsetHeight*5,G),se=window.getComputedStyle(f),ge=parseInt(se.paddingTop,10),ve=parseInt(se.paddingBottom,10),pe=C.top+C.height/2-Ce,K=L-pe,de=h.offsetHeight/2,$=h.offsetTop+de,Y=z+I+$,oe=G-Y;if(Y<=pe){const Q=R.length>0&&h===R[R.length-1].ref.current;l.style.bottom="0px";const re=d.clientHeight-f.offsetTop-f.offsetHeight,_e=Math.max(K,de+(Q?ve:0)+re+B),bt=Y+_e;l.style.height=bt+"px"}else{const Q=R.length>0&&h===R[0].ref.current;l.style.top="0px";const _e=Math.max(pe,z+f.offsetTop+(Q?ge:0)+de)+oe;l.style.height=_e+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${Ce}px 0`,l.style.minHeight=ie+"px",l.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,v,i.dir,n]);le(()=>w(),[w]);const[j,k]=x.useState();le(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(C=>{C&&b.current===!0&&(w(),_?.(),b.current=!1)},[w,_]);return a.jsx(Ov,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=Av;var Pv="SelectPopperPosition",sa=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ce,...i}=e,s=On(r);return a.jsx(Gs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});sa.displayName=Pv;var[Ov,la]=Ut(xt,{}),ca="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=rt(ca,r),s=la(ca,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(An.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-Ce*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),v=Math.max(f,h);if(v<b){const _=v+g,w=Math.min(b,_),j=_-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Yc.displayName=ca;var Xc="SelectGroup",[Rv,Lv]=Ut(Xc),Iv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(Rv,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Iv.displayName=Xc;var Jc="SelectLabel",zv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Lv(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});zv.displayName=Jc;var Rn="SelectItem",[Mv,Zc]=Ut(Rn),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=tt(Rn,r),c=rt(Rn,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,_=>c.itemRefCallback?.(_,n,o)),f=Ae(),h=x.useRef("touch"),v=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(Mv,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(_=>{p(w=>w||(_?.textContent??"").trim())},[]),children:a.jsx(An.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:b,onFocus:V(s.onFocus,()=>g(!0)),onBlur:V(s.onBlur,()=>g(!1)),onClick:V(s.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:V(s.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:V(s.onPointerDown,_=>{h.current=_.pointerType}),onPointerMove:V(s.onPointerMove,_=>{h.current=_.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(s.onPointerLeave,_=>{_.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(s.onKeyDown,_=>{c.searchRef?.current!==""&&_.key===" "||(yv.includes(_.key)&&v(),_.key===" "&&_.preventDefault())})})})})});Qc.displayName=Rn;var br="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=tt(br,r),l=rt(br,r),c=Zc(br,r),d=kv(br,r),[u,p]=x.useState(null),m=J(t,v=>p(v),c.onItemTextChange,v=>l.itemTextRefCallback?.(v,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?vr.createPortal(i.children,s.valueNode):null]})});ed.displayName=br;var td="SelectItemIndicator",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var da="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=rt(da,e.__scopeSelect),n=la(da,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});nd.displayName=da;var ua="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=rt(ua,e.__scopeSelect),n=la(ua,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});od.displayName=ua;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=rt("SelectScrollButton",r),s=x.useRef(null),l=Pn(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{c()})})}),Dv="SelectSeparator",Fv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});Fv.displayName=Dv;var pa="SelectArrow",$v=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=On(r),i=tt(pa,r),s=rt(pa,r);return i.open&&s.position==="popper"?a.jsx(Ks,{...o,...n,ref:t}):null});$v.displayName=pa;var Bv="SelectBubbleInput",id=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=xv(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:i,defaultValue:t})});id.displayName=Bv;function sd(e){return e===""||e===void 0}function ld(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=Uv(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function Uv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Hv=Dc,Vv=$c,Wv=Uc,qv=Hc,Gv=Vc,Kv=Wc,Yv=Yc,Xv=Qc,Jv=ed,Zv=rd,Qv=nd,e_=od;function Ht({...e}){return a.jsx(Hv,{"data-slot":"select",...e})}function Vt({...e}){return a.jsx(Wv,{"data-slot":"select-value",...e})}function Wt({className:e,size:t="default",children:r,...n}){return a.jsxs(Vv,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(qv,{asChild:!0,children:a.jsx(mo,{className:"ecr-select__icon"})})]})}function qt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Gv,{container:i,children:a.jsxs(Kv,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(t_,{}),a.jsx(Yv,{className:F("ecr-select__viewport"),children:t}),a.jsx(r_,{})]})})}function Gt({className:e,children:t,...r}){return a.jsxs(Xv,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(Zv,{children:a.jsx(zf,{className:"ecr-select__check-icon"})})}),a.jsx(Jv,{children:t})]})}function t_({className:e,...t}){return a.jsx(Qv,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Mf,{className:"ecr-select__icon"})})}function r_({className:e,...t}){return a.jsx(e_,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(mo,{className:"ecr-select__icon"})})}const n_=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Yu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),o_={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function a_(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(Ht,{defaultValue:Qa[0].value,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Qa.map(e=>a.jsx(Gt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:e.label,text:o_[e.value]})})]})},e.value))]})]})]})}const i_=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(xr,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(a_,{}),a.jsx(n_,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Ln="Collapsible",[s_]=Ve(Ln),[l_,ma]=s_(Ln),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=mt({prop:n,defaultProp:o??!1,onChange:s,caller:Ln});return a.jsx(l_,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":ha(c),"data-disabled":i?"":void 0,...l,ref:t})})});dd.displayName=Ln;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ma(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ha(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var fa="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ma(fa,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(c_,{...n,ref:t,present:i})})});md.displayName=fa;var c_=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ma(fa,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const _=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(_)},[]),le(()=>{const _=d.current;if(_){v.current=v.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const w=_.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(_.style.transitionDuration=v.current.transitionDuration,_.style.animationName=v.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":ha(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function ha(e){return e?"open":"closed"}var d_=dd,u_=pd,p_=md;function fd({className:e,...t}){return a.jsx(d_,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(u_,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(mo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(p_,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const m_={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},f_=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Gu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Ku.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r.label,text:m_[r.value]})})]})},r.value))]})]})]}),h_=[{Icon:Hf,label:"Desktop",value:"desktop"},{Icon:Kf,label:"Tab",value:"tab"},{Icon:Wf,label:"Mobile",value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=y.useState(n),g=y.useRef(null);y.useEffect(()=>{m(n)},[n]);const b=h=>{const v=Math.min(r,Math.max(t,Number(h)));o(v)},f=h=>{const v=Number(h);m(v),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(v>r?r:v<t?t:v)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Ht,{value:d,onValueChange:h=>u(h),children:[a.jsx(Wt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Vt,{})}),a.jsx(qt,{style:{minWidth:"60px"},children:h_.map(h=>a.jsx(Gt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const v=Number(h.target.value);m(v),b(v)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Zo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},g_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(xd,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},x_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(xd,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},b_=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],v_=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:b_.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(Yp,{color:"#2563eb",size:16}):a.jsx(Xp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},__=Object.values(Za),y_={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},w_=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[__.map(r=>a.jsx(Gt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r,text:y_[r]})})]})},r))]})]})]}),j_=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx($f,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(v_,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(w_,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(f_,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(x_,{styles:r,updateStyles:n}),a.jsx(g_,{styles:r,updateStyles:n}),a.jsx(xr,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(xr,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(xr,{label:"Show Add to Cart",text:a.jsx(a.Fragment,{children:"Show a clear “Add to Cart” button on your tagged product to encourage quick purchases and boost conversions."})}),a.jsx(xr,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),S_=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Wu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),k_=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Vf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Qo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Qo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(S_,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),C_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(j_,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(k_,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},N_=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(hv,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(gv,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:i.preview,children:"Preview"})]}),a.jsx(Ic,{value:i.thumbnail,children:a.jsx(C_,{styles:e,updateStyles:c})}),a.jsx(Ic,{value:i.preview,children:a.jsx(i_,{styles:e,updateStyles:c})})]})})]})]})},E_=e=>{const t=Ne(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(ot),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const _=(await he.get(`stories/${e}`)).data;n(_.group_name),i(_.stories),l(_.styles??ot)}catch(v){v instanceof Error?q.error(v.message):q.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),_={group_name:r,styles:s,story_ids:v};e&&(_.group_id=e);const w=await he.post("stories/manage-group-stories",_);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),q.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?q.error(h.message):q.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},T_=e=>{const[t,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return y.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},A_=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},P_=()=>{const e=Ne(),[t]=Jt(),r=t.get("gid"),n=T_("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=E_(r),{allReels:f,searchTerm:h,setSearchTerm:v,isSearching:_,lastStoryElementRef:w,refreshReels:j}=Qi(r),[k,N]=y.useState(""),[C,E]=y.useState(n),[T,O]=y.useState(bd.thumbnail),[R,L]=y.useState([]),A=y.useMemo(()=>new Set(s.map(K=>K.story_uuid)),[s]),P=y.useMemo(()=>h.trim().toLowerCase(),[h]),z=y.useMemo(()=>P?R.filter(K=>K.title.toLowerCase().includes(P)):R,[R,P]),I=y.useMemo(()=>{const K=new Map;for(const de of z)K.set(de.story_uuid,de);for(const de of f)K.has(de.story_uuid)||K.set(de.story_uuid,de);return Array.from(K.values())},[z,f]),B=y.useMemo(()=>I.filter(K=>!A.has(K.story_uuid)),[I,A]);y.useEffect(()=>{E(n)},[n]),y.useEffect(()=>{L([])},[r]);const{showLeaveModal:M,requestLeave:G,confirmLeave:ie,cancelLeave:se,allowNextNavigation:ge}=A_(m),ve=async(K,de)=>{try{N(K.story_uuid);const $=de==="add"?[K,...s]:s.filter(Y=>Y.story_uuid!==K.story_uuid);l($),L(de==="add"?Y=>Y.filter(oe=>oe.story_uuid!==K.story_uuid):Y=>Y.some(oe=>oe.story_uuid===K.story_uuid)?Y:[K,...Y]),g(!0)}catch($){$ instanceof Error?q.error($.message):q.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const K=await b();K&&(L([]),j()),K?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${K.group_id}`,{replace:!0})})};return u?a.jsx(Ir,{}):a.jsxs($b,{value:{requestLeave:G},children:[a.jsx(St,{left:[a.jsx(kt,{name:"Manage Widget",Icon:Or},"page"),a.jsx(rr,{cb:()=>G(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(es,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Wo,{children:[a.jsx(qo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(pb,{})}),a.jsxs(Go,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Customize title appearance"})}),a.jsx(Mb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(M0,{asChild:!0,children:a.jsx(te,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(ub,{isExpanded:C,setIsExpanded:E},"toggle"),a.jsx(po,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:K=>G(()=>e(K))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Yb,{allReels:B,gid:r,handleSelectReel:ve,searchTerm:h,setSearchTerm:v,isSearching:_,togglingId:k,lastStoryElementRef:w}),a.jsx(Kb,{gid:r,reels:s,styles:c,handleRemoveReel:ve,togglingId:k,currentTab:T}),C&&a.jsx(N_,{isExpanded:C,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:bd,setCurrentTab:O,currentTab:T})]}),M&&a.jsx(Rr,{onReject:se,onAccept:ie,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function O_(){const[e]=Jt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(ab,{});break;case X.ar:r=a.jsx(Ef,{});break;case X.stat:r=a.jsx(lb,{});break;case X.cr:r=a.jsx(Y0,{});break;case X.mg:r=a.jsx(P_,{});break;default:r=a.jsx(nb,{})}return a.jsxs("div",{children:[r,a.jsx(Hu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const vd=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},_d=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),R_=()=>{const e=y.useContext(ga);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=y.useState(r.length-1),[d,u]=y.useState(null),[p,m]=y.useState(!0),[g,b]=y.useState(0),[f,h]=y.useState(!1),[v,_]=y.useState({index:0,story_uuid:r[0]?.story_uuid??""}),w=d?.links&&d.links.length>0?d.links[0]:null,j=t?.playerAppearance??"overlay",k=y.useRef({bodyOverflow:"",bodyPosition:"",bodyTop:"",bodyWidth:"",bodyScrollBehavior:"",htmlOverflow:"",htmlScrollBehavior:"",scrollY:0}),N=y.useCallback((A,P=1)=>{if(r.length===0)return null;let z=A;for(let I=0;I<r.length;I+=1){const B=r[z];if(_d(B))return{story:B,index:z};z=(z+P+r.length)%r.length}return null},[r]),C=y.useCallback(()=>{c(r.length-1);const A=r.findIndex(I=>String(I.story_uuid)===o),P=A>=0?r[A]:null,z=_d(P)?{story:P,index:A}:N(Math.max(A,0),1);if(!z?.story){u(null),m(!1);return}u(z.story),A!==z.index&&z.story.story_uuid!==o&&i(z.story.story_uuid),_({index:0,story_uuid:z.story.story_uuid}),m(!1)},[N,o,i,r]);y.useEffect(()=>{C()},[C]),y.useEffect(()=>{const{body:A,documentElement:P}=document;return k.current={bodyOverflow:A.style.overflow,bodyPosition:A.style.position,bodyTop:A.style.top,bodyWidth:A.style.width,bodyScrollBehavior:A.style.scrollBehavior,htmlOverflow:P.style.overflow,htmlScrollBehavior:P.style.scrollBehavior,scrollY:window.scrollY},P.style.overflow="hidden",A.style.overflow="hidden",A.style.position="fixed",A.style.top=`-${k.current.scrollY}px`,A.style.width="100%",()=>{const z=k.current;P.style.overflow=z.htmlOverflow,A.style.overflow=z.bodyOverflow,A.style.position=z.bodyPosition,A.style.top=z.bodyTop,A.style.width=z.bodyWidth,P.style.scrollBehavior="auto",A.style.scrollBehavior="auto",window.scrollTo({top:z.scrollY,left:0,behavior:"auto"}),P.style.scrollBehavior=z.htmlScrollBehavior,A.style.scrollBehavior=z.bodyScrollBehavior}},[]);const E=y.useCallback(()=>{i(null)},[i]),T=y.useCallback((A=1)=>{m(!0);const P=r.findIndex(G=>String(G.story_uuid)===String(o)),z=A>0?1:-1,I=A>0?l>P?P+1:0:P>0?P-1:l,B=N(I,z);if(!B?.story){m(!1);return}const M=B.story;if(M.story_uuid===o){m(!1),E();return}_({index:0,story_uuid:M.story_uuid}),n&&vd(n,M.id,s),i(M.story_uuid),m(!1)},[E,N,n,o,l,i,s,r]),O=y.useCallback(()=>{const A=d?.files??[];if(v.index>0){_(P=>({index:P.index-1,story_uuid:A[P.index-1].story_uuid??""}));return}T(-1)},[v.index,T,d?.files]),R=y.useCallback(()=>{const A=d?.files??[];if(v.index+1<A.length){_(P=>({index:P.index+1,story_uuid:A[P.index+1].story_uuid??""}));return}T(1)},[v.index,T,d?.files]),L=y.useCallback(A=>{A.target===A.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:v,duration:g,handleBackdropClick:L,handleNextFile:R,handlePrevFile:O,isLoadingNext:p,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsPlaying:i,firstLink:w,playerAppearance:j}},L_=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),I_=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:i,isLoadingNext:s,isPaused:l,playerAppearance:c,playingStory:d,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=R_();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:d&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(wt,{onClick:i,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}),a.jsx(wt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[d&&a.jsx(si,{playingStory:d,duration:r,currentFileIndex:t,isPaused:l},`${d.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),s?a.jsx(L_,{}):d?.files.length>0&&a.jsx(ui,{currentFileIndex:t,files:d?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:i,handleNextFile:o,storyId:d.id,storyTitle:d?.title}),c==="overlay"?u?a.jsx(En,{link:u,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:d.title}):null,c==="title"?a.jsx(Bt,{title:d.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Zn,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(En,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},z_=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Qt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(er,{size:20,style:{width:"20px",height:"20px"}})})]})},wd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),M_={carousel:z_,grid:wd},D_=()=>{const e=y.useContext(ga),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=M_[d]||wd,p=({sid:m,story_uuid:g})=>{i(g),o&&vd(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},F_=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(ot),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(ot),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||ot)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ga=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=F_(e);return a.jsxs(ga.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(I_,{}),a.jsx(D_,{})]})};_a(()=>{const e=document.getElementById("ecommreels-admin-app");e&&In.createRoot(e).render(a.jsx(Zd,{children:a.jsx(O_,{})}))}),_a(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
  • ecomm-reels/tags/4.1.2/ecomm-reels.php

    r3462462 r3463454  
    33 * Plugin Name:       ReelsWp - Shoppable Videos & Vertical Reels Carousels
    44 * Description:       Create Insta style reels and stories with ReelsWP and add them anywhere on your WordPress site. Add fast, mobile friendly video grid and carousel layouts to your homepage, blog or news articles, and product pages.
    5  * Version:           4.1.1
     5 * Version:           4.1.2
    66 * Requires at least: 5.8
    77 * Requires PHP:      7.4
     
    2020define('ECOMMREELS_ASSETS', plugins_url('/', __FILE__));
    2121define('ECOMMREELS_FILE_PREFIX', 'class-');
    22 define('WP_REELS_VER', '4.1.1');
     22define('WP_REELS_VER', '4.1.2');
    2323
    2424// 1) Composer autoloader (optional, guarded)
  • ecomm-reels/tags/4.1.2/readme.txt

    r3462462 r3463454  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 4.1.1
     7Stable tag: 4.1.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    101101== Changelog ==
    102102
     103= 4.1.2 - 2026-02-17 =
     104- Fix: Fixed a scrolling issue on iPad when playing videos.
     105
    103106= 4.1.1 - 2026-02-16 =
    104107- Fix: Fixed cross-browser issues affecting video rendering.
  • ecomm-reels/trunk/CHANGELOG.md

    r3462462 r3463454  
    11# Changelog
     2
     3## [4.1.2](https://github.com/dstudio-asia/reels-wp/compare/v4.1.1...v4.1.2) (2026-02-17)
     4
     5
     6### Bug Fixes
     7
     8* **player:** prevent smooth-scroll jump on modal close + minor admin layout tweaks ([19adec0](https://github.com/dstudio-asia/reels-wp/commit/19adec0a84f253a0b1edd31129622dae7c1a067e))
     9* **player:** robust scroll lock for iOS Safari modal behavior ([3a26b8a](https://github.com/dstudio-asia/reels-wp/commit/3a26b8ac85ef332346032577015f3f6a88ba36b0))
    210
    311## [4.1.1](https://github.com/dstudio-asia/reels-wp/compare/v4.1.0...v4.1.1) (2026-02-16)
  • ecomm-reels/trunk/build/index.js

    r3462462 r3463454  
    1 (function(y,va,In,ya){"use strict";var wa=document.createElement("style");wa.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:999}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;position:relative}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer;text-align:center;height:100%;background-color:transparent}#ecommreels-admin-app .ecr-admin-upload__text-icon_wrapper{display:grid;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-admin-video-upload-options{position:absolute;inset:2px;border-radius:10px;background-color:#fff;box-shadow:0 0 4px 8px #f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px}#ecommreels-admin-app .ecr-admin-upload-source-panel{position:absolute;inset:6px;z-index:3;border-radius:10px;border:1px solid #dbeafe;background:#fff;box-shadow:0 12px 24px #0f172a26;padding:12px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-upload-source-panel__close{align-self:flex-end;width:28px;height:28px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#6b7280;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-upload-source-panel__close:hover{color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__title{margin:0;font-size:14px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__description{margin:4px 0 0;font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-upload-source-popover__options{margin-top:12px;display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload-source-option{width:100%;padding:12px;border:1px solid #dbeafe;border-radius:8px;background:#eff6ff;color:#1d4ed8;text-align:left;font-weight:600;font-size:13px;transition:all .2s ease}#ecommreels-admin-app .ecr-admin-upload-source-option:hover{border-color:#3b82f6;background:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-admin-upload-vimeo-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px;opacity:.8}#ecommreels-admin-app .ecr-admin-upload-native-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-upload-native-video-btn:hover{background-color:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;max-height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;height:100vh;position:fixed;top:0;right:0}@media(max-width:1024px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-sidepanel-content{padding-top:32px}}@media(max-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel-content{z-index:999}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:999}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-tab, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-tab, 150px),1fr))}}
    2 /*$vite$:1*/`,document.head.appendChild(wa);function ja(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=ja(y),_r=ja(ya);function kd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},Kt={};/**
     1(function(y,_a,In,ya){"use strict";var wa=document.createElement("style");wa.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:#1f29371a}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:#e5e7eb1a}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--outline-danger{background:transparent;border-color:#dc2626;color:#dc2626}#ecommreels-admin-app .ecr-button--outline-danger:hover{background:#dc26261a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{display:flex;align-items:center;justify-content:center;padding-top:50px}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:2;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:5;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important;z-index:2147483647;background-color:#000c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed!important;top:0!important;left:0!important;display:grid;place-items:center;width:100vw!important;height:100vh!important}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:4;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:5;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:6;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__select:hover{background:none}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto;white-space:nowrap}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:5;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px;gap:16px;flex-wrap:wrap}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-navbar{justify-content:center}}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:999}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;position:relative}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer;text-align:center;height:100%;background-color:transparent}#ecommreels-admin-app .ecr-admin-upload__text-icon_wrapper{display:grid;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-admin-video-upload-options{position:absolute;inset:2px;border-radius:10px;background-color:#fff;box-shadow:0 0 4px 8px #f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px}#ecommreels-admin-app .ecr-admin-upload-source-panel{position:absolute;inset:6px;z-index:3;border-radius:10px;border:1px solid #dbeafe;background:#fff;box-shadow:0 12px 24px #0f172a26;padding:12px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-upload-source-panel__close{align-self:flex-end;width:28px;height:28px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;color:#6b7280;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-upload-source-panel__close:hover{color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__title{margin:0;font-size:14px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-upload-source-popover__description{margin:4px 0 0;font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-upload-source-popover__options{margin-top:12px;display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload-source-option{width:100%;padding:12px;border:1px solid #dbeafe;border-radius:8px;background:#eff6ff;color:#1d4ed8;text-align:left;font-weight:600;font-size:13px;transition:all .2s ease}#ecommreels-admin-app .ecr-admin-upload-source-option:hover{border-color:#3b82f6;background:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-admin-upload-vimeo-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px;opacity:.8}#ecommreels-admin-app .ecr-admin-upload-native-video-btn{padding:12px;border-radius:6px;background:#eff6ff;width:100%;text-align:center;transition:all .2s ease;cursor:pointer;display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-upload-native-video-btn:hover{background-color:#3b82f6;color:#fff}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:6}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;gap:8px;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:3;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{width:100%}@media(max-width:767px){#ecommreels-admin-app .ecr-admin-thumbnail__uploader{width:260px}}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-docs-link{color:#2563eb;display:flex;align-items:center;text-decoration:none;gap:4px;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-docs-link:focus{box-shadow:none}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px;position:relative}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row-reverse}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-nav-btn-reverse{flex-direction:row}}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0;z-index:9}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-reelitem{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:1;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:16px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0;border-bottom-left-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);border-bottom-right-radius:max(calc(var(--thumbnail-border-radius, 0px) - 4px),8px);transition:all .3s ease-in-out;min-height:var(--thumbnail-border-radius);padding-inline:max(var(--thumbnail-border-radius) / 5,8px)}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:4px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-product-card-one__price ins,.ecommreels-short-code .ecr-product-card-one__price ins,.reelswp-group-short-code .ecr-product-card-one__price ins,.reelswp-reel-short-code .ecr-product-card-one__price ins{text-decoration:none}#ecommreels-admin-app .ecr-thumb__link-wrapper,.ecommreels-short-code .ecr-thumb__link-wrapper,.reelswp-group-short-code .ecr-thumb__link-wrapper,.reelswp-reel-short-code .ecr-thumb__link-wrapper{display:flex;flex-direction:column;gap:4px;flex-shrink:0}#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background-color:transparent;position:relative;min-height:max(var(--thumbnail-border-radius, 48px),48px);text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);transition:all .3s ease-in-out;isolation:isolate}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):hover{text-decoration:underline}:is(#ecommreels-admin-app .ecr-thumb__link-wrapper a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-wrapper a.ecr-thumb__link):before{content:"";position:absolute;inset:0;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;border-bottom-left-radius:max(var(--thumbnail-border-radius, 8px),8px);border-bottom-right-radius:max(var(--thumbnail-border-radius, 8px),8px);overflow:hidden;z-index:-1;transition:all .3s ease-in-out}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:2;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-editor-grid{column-gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:5;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:5;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}@media(min-width:767px)and (max-width:1199px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-reellist__items{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:100%;max-height:100%;position:absolute;right:16px;top:0}#ecommreels-admin-app .ecr-admin-mobile-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#0f172abf;z-index:5}#ecommreels-admin-app .ecr-admin-sidepanel-content{width:280px;background:#fff;margin-left:auto;border:2px solid #e5e7eb;height:100vh;position:fixed;top:0;right:0}@media(max-width:1024px)and (min-width:640px){#ecommreels-admin-app .ecr-admin-sidepanel-content{padding-top:32px}}@media(max-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel-content{z-index:999}}@media(min-width:1200px){#ecommreels-admin-app .ecr-admin-sidepanel--expanded{position:static}#ecommreels-admin-app .ecr-admin-mobile-overlay{display:none}#ecommreels-admin-app .ecr-admin-sidepanel-content{position:static;width:280px;background:#fff;margin-left:0;border:2px solid #e5e7eb;height:100%;border-radius:8px}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:fit-content}}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:999}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:9;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block;width:var(--thumbnail-size, 150px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-mobile, 150px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{width:var(--thumbnail-size-tab, 150px)}}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{width:100%;margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content;gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-mobile, 16px)}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{gap:var(--thumbnail-gap-tab, 16px)}}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:1;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid, 150px),1fr));row-gap:16px;column-gap:var(--thumbnail-gap, 16px)}@media screen and (max-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-mobile, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-mobile, 150px),1fr))}}@media screen and (max-width:991px)and (min-width:640px){#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{column-gap:var(--thumbnail-gap-tab, 16px);grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size-grid-tab, 150px),1fr))}}
     2/*$vite$:1*/`,document.head.appendChild(wa);function ja(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=ja(y),vr=ja(ya);function kd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},Kt={};/**
    33 * @license React
    44 * react-jsx-runtime.production.min.js
     
    1717 *
    1818 * @license MIT
    19  */function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yt.apply(this,arguments)}var nt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(nt||(nt={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Xt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Mn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:vr(i))}function n(o,i){Na(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ad(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Na(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Td(){return Math.random().toString(36).substr(2,8)}function Ea(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Yt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Xt(t):t,{state:r,key:t&&t.key||n||Td()})}function vr(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Xt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ad(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=nt.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Yt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=nt.Pop;let h=u(),_=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:_})}function m(h,_){l=nt.Push;let v=Mn(f.location,h,_);r&&r(v,h),d=u()+1;let w=Ea(v,d),j=f.createHref(v);try{s.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,_){l=nt.Replace;let v=Mn(f.location,h,_);r&&r(v,h),d=u();let w=Ea(v,d),j=f.createHref(v);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let _=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof h=="string"?h:vr(h);return v=v.replace(/ $/,"%20"),ye(_,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,_)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),c=h,()=>{o.removeEventListener(Ca,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let _=b(h);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Ta;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ta||(Ta={}));function Aa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Pd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Pd.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Xt(e):e,i;if(r)if(Od(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Na(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Pa(r.substring(1),"/"):i=Pa(r,t)}else i=t;return{pathname:i,search:Id(n),hash:zd(o)}}function Pa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Dn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ld(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Oa(e,t){let r=Ld(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ra(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Xt(e):(o=Yt({},e),ye(!o.pathname||!o.pathname.includes("?"),Dn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),Dn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),Dn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Rd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const La=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ia=["post","put","patch","delete"];new Set(Ia);const Md=["get",...Ia];new Set(Md);/**
     19 */function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yt.apply(this,arguments)}var nt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(nt||(nt={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Xt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Mn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:_r(i))}function n(o,i){Na(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Ad(t,r,n,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Na(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Td(){return Math.random().toString(36).substr(2,8)}function Ea(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Yt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Xt(t):t,{state:r,key:t&&t.key||n||Td()})}function _r(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Xt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ad(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=nt.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Yt({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=nt.Pop;let h=u(),v=h==null?null:h-d;d=h,c&&c({action:l,location:f.location,delta:v})}function m(h,v){l=nt.Push;let _=Mn(f.location,h,v);r&&r(_,h),d=u()+1;let w=Ea(_,d),j=f.createHref(_);try{s.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(j)}i&&c&&c({action:l,location:f.location,delta:1})}function g(h,v){l=nt.Replace;let _=Mn(f.location,h,v);r&&r(_,h),d=u();let w=Ea(_,d),j=f.createHref(_);s.replaceState(w,"",j),i&&c&&c({action:l,location:f.location,delta:0})}function b(h){let v=o.location.origin!=="null"?o.location.origin:o.location.href,_=typeof h=="string"?h:_r(h);return _=_.replace(/ $/,"%20"),ye(v,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,v)}let f={get action(){return l},get location(){return e(o,s)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),c=h,()=>{o.removeEventListener(Ca,p),c=null}},createHref(h){return t(o,h)},createURL:b,encodeLocation(h){let v=b(h);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:g,go(h){return s.go(h)}};return f}var Ta;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ta||(Ta={}));function Aa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Pd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Pd.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Xt(e):e,i;if(r)if(Od(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Na(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=Pa(r.substring(1),"/"):i=Pa(r,t)}else i=t;return{pathname:i,search:Id(n),hash:zd(o)}}function Pa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Dn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ld(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Oa(e,t){let r=Ld(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ra(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Xt(e):(o=Yt({},e),ye(!o.pathname||!o.pathname.includes("?"),Dn("?","pathname","search",o)),ye(!o.pathname||!o.pathname.includes("#"),Dn("#","pathname","hash",o)),ye(!o.search||!o.search.includes("#"),Dn("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Rd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const La=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ia=["post","put","patch","delete"];new Set(Ia);const Md=["get",...Ia];new Set(Md);/**
    2020 * React Router v6.30.3
    2121 *
     
    2626 *
    2727 * @license MIT
    28  */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const za=x.createContext(null),_t=x.createContext(null),Fn=x.createContext(null),wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;jr()||ye(!1);let{basename:n,navigator:o}=x.useContext(_t),{hash:i,pathname:s,search:l}=Da(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:La([n,s])),o.createHref({pathname:c,search:l,hash:i})}function jr(){return x.useContext(Fn)!=null}function Sr(){return jr()||ye(!1),x.useContext(Fn).location}function Ma(e){x.useContext(_t).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(wr);return e?Hd():Fd()}function Fd(){jr()||ye(!1);let e=x.useContext(za),{basename:t,future:r,navigator:n}=x.useContext(_t),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Oa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return Ma(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ra(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:La([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Da(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(_t),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Oa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Ra(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Fa=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Fa||{}),$a=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})($a||{});function $d(e){let t=x.useContext(za);return t||ye(!1),t}function Bd(e){let t=x.useContext(wr);return t||ye(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Hd(){let{router:e}=$d(Fa.UseNavigateStable),t=Ud($a.UseNavigateStable),r=x.useRef(!1);return Ma(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function Vd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Wd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=nt.Pop,navigator:i,static:s=!1,future:l}=e;jr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Xt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Aa(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(_t.Provider,{value:d},x.createElement(Fn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
     28 */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const za=x.createContext(null),vt=x.createContext(null),Fn=x.createContext(null),wr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;jr()||ye(!1);let{basename:n,navigator:o}=x.useContext(vt),{hash:i,pathname:s,search:l}=Da(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:La([n,s])),o.createHref({pathname:c,search:l,hash:i})}function jr(){return x.useContext(Fn)!=null}function Sr(){return jr()||ye(!1),x.useContext(Fn).location}function Ma(e){x.useContext(vt).static||x.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=x.useContext(wr);return e?Hd():Fd()}function Fd(){jr()||ye(!1);let e=x.useContext(za),{basename:t,future:r,navigator:n}=x.useContext(vt),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Oa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return Ma(()=>{l.current=!0}),x.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ra(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:La([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function Da(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(vt),{matches:o}=x.useContext(wr),{pathname:i}=Sr(),s=JSON.stringify(Oa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Ra(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Fa=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Fa||{}),$a=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})($a||{});function $d(e){let t=x.useContext(za);return t||ye(!1),t}function Bd(e){let t=x.useContext(wr);return t||ye(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||ye(!1),r.route.id}function Hd(){let{router:e}=$d(Fa.UseNavigateStable),t=Ud($a.UseNavigateStable),r=x.useRef(!1);return Ma(()=>{r.current=!0}),x.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function Vd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Wd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=nt.Pop,navigator:i,static:s=!1,future:l}=e;jr()&&ye(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Xt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Aa(u,c);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[c,u,p,m,g,b,o]);return f==null?null:x.createElement(vt.Provider,{value:d},x.createElement(Fn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
    2929 * React Router DOM v6.30.3
    3030 *
     
    3535 *
    3636 * @license MIT
    37  */function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$n.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Gd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kd(e,t){return e.button===0&&(!t||t==="_self")&&!Gd(e)}function Bn(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Yd(e,t){let r=Bn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const Ba=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ed({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&Ba?Ba(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(_t),b,f=!1;if(typeof d=="string"&&eu.test(d)&&(b=d,Qd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),k=Aa(j.pathname,g);j.origin===w.origin&&k!=null?d=k+j.search+j.hash:f=!0}catch{}let h=Dd(d,{relative:o}),_=tu(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function v(w){n&&n(w),w.defaultPrevented||_(w)}return x.createElement("a",$n({},m,{href:b||h,onClick:f||i?n:v,ref:r,target:c}))});var Ua;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ua||(Ua={}));var Ha;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ha||(Ha={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=Sr(),u=Da(e,{relative:s});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:vr(d)===vr(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Jt(e){let t=x.useRef(Bn(e)),r=x.useRef(!1),n=Sr(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=Bn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let ru={data:""},nu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ru},ou=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,au=/\/\*[^]*?\*\/|  +/g,Va=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Me={},Wa=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Wa(e[r]);return t}return e},iu=(e,t,r,n,o)=>{let i=Wa(e),s=Me[i]||(Me[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!Me[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=ou.exec(d.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Va," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Va," ").trim();return m[0]})(e);Me[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&Me.g?Me.g:null;return r&&(Me.g=Me[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Me[s],t,n,l),s},su=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function kr(e){let t=this||{},r=e.call?e(t.p):e;return iu(r.unshift?r.raw?su(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,nu(t.target),t.g,t.o,t.k)}let qa,Un,Hn;kr.bind({g:1});let De=kr.bind({k:1});function lu(e,t,r,n){Ue.p=t,qa=e,Un=r,Hn=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Un&&Un()},l),r.o=/ *go\d+/.test(c),l.className=kr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Hn&&d[0]&&Hn(l),qa(d,l)}return o}}var cu=e=>typeof e=="function",Cr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),Ga=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uu=20,Vn="default",Ka=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ka(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Nr=[],Ya={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ee={},Xa=(e,t=Vn)=>{Ee[t]=Ka(Ee[t]||Ya,e),Nr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Ja=e=>Object.keys(Ee).forEach(t=>Xa(e,t)),pu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Er=(e=Vn)=>t=>{Xa(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Vn)=>{let[r,n]=y.useState(Ee[t]||Ya),o=y.useRef(Ee[t]);y.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Nr.push([t,n]),()=>{let s=Nr.findIndex(([l])=>l===t);s>-1&&Nr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||mu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},hu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||du()}),Zt=e=>(t,r)=>{let n=hu(t,e,r);return Er(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>Zt("blank")(e,t);ne.error=Zt("error"),ne.success=Zt("success"),ne.loading=Zt("loading"),ne.custom=Zt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Er(t)(r):Ja(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Er(t)(r):Ja(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?Cr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?Cr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(b<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Er(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:f}=m||{},h=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),_=h.findIndex(w=>w.id===p.id),v=h.filter((w,j)=>j<_&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[v+1]:[0,v]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},bu=De`
     37 */function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$n.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Gd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kd(e,t){return e.button===0&&(!t||t==="_self")&&!Gd(e)}function Bn(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Yd(e,t){let r=Bn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const Ba=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,i=x.useRef();i.current==null&&(i.current=Ed({window:o,v5Compat:!0}));let s=i.current,[l,c]=x.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=x.useCallback(p=>{d&&Ba?Ba(()=>c(p)):c(p)},[c,d]);return x.useLayoutEffect(()=>s.listen(u),[s,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_t=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(vt),b,f=!1;if(typeof d=="string"&&eu.test(d)&&(b=d,Qd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),k=Aa(j.pathname,g);j.origin===w.origin&&k!=null?d=k+j.search+j.hash:f=!0}catch{}let h=Dd(d,{relative:o}),v=tu(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function _(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",$n({},m,{href:b||h,onClick:f||i?n:_,ref:r,target:c}))});var Ua;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ua||(Ua={}));var Ha;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ha||(Ha={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Ne(),d=Sr(),u=Da(e,{relative:s});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(d)===_r(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Jt(e){let t=x.useRef(Bn(e)),r=x.useRef(!1),n=Sr(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),i=Ne(),s=x.useCallback((l,c)=>{const d=Bn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let ru={data:""},nu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ru},ou=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,au=/\/\*[^]*?\*\/|  +/g,Va=/\n+/g,Ue=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Ue(s,i):i+"{"+Ue(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Ue(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Ue.p?Ue.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Me={},Wa=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Wa(e[r]);return t}return e},iu=(e,t,r,n,o)=>{let i=Wa(e),s=Me[i]||(Me[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!Me[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=ou.exec(d.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Va," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Va," ").trim();return m[0]})(e);Me[s]=Ue(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&Me.g?Me.g:null;return r&&(Me.g=Me[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Me[s],t,n,l),s},su=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Ue(l,""):l===!1?"":l}return n+o+(s??"")},"");function kr(e){let t=this||{},r=e.call?e(t.p):e;return iu(r.unshift?r.raw?su(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,nu(t.target),t.g,t.o,t.k)}let qa,Un,Hn;kr.bind({g:1});let De=kr.bind({k:1});function lu(e,t,r,n){Ue.p=t,qa=e,Un=r,Hn=n}function He(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Un&&Un()},l),r.o=/ *go\d+/.test(c),l.className=kr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Hn&&d[0]&&Hn(l),qa(d,l)}return o}}var cu=e=>typeof e=="function",Cr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),Ga=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uu=20,Vn="default",Ka=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ka(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},Nr=[],Ya={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ee={},Xa=(e,t=Vn)=>{Ee[t]=Ka(Ee[t]||Ya,e),Nr.forEach(([r,n])=>{r===t&&n(Ee[t])})},Ja=e=>Object.keys(Ee).forEach(t=>Xa(e,t)),pu=e=>Object.keys(Ee).find(t=>Ee[t].toasts.some(r=>r.id===e)),Er=(e=Vn)=>t=>{Xa(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Vn)=>{let[r,n]=y.useState(Ee[t]||Ya),o=y.useRef(Ee[t]);y.useEffect(()=>(o.current!==Ee[t]&&n(Ee[t]),Nr.push([t,n]),()=>{let s=Nr.findIndex(([l])=>l===t);s>-1&&Nr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||mu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},hu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||du()}),Zt=e=>(t,r)=>{let n=hu(t,e,r);return Er(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>Zt("blank")(e,t);ne.error=Zt("error"),ne.success=Zt("success"),ne.loading=Zt("loading"),ne.custom=Zt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Er(t)(r):Ja(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Er(t)(r):Ja(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?Cr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?Cr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let b=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(b<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Er(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:b=8,defaultPosition:f}=m||{},h=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),v=h.findIndex(w=>w.id===p.id),_=h.filter((w,j)=>j<v&&w.visible).length;return h.filter(w=>w.visible).slice(...g?[_+1]:[0,_]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},bu=De`
    3838from {
    3939  transform: scale(0) rotate(45deg);
     
    4343 transform: scale(1) rotate(45deg);
    4444  opacity: 1;
    45 }`,_u=De`
     45}`,vu=De`
    4646from {
    4747  transform: scale(0);
     
    5151  transform: scale(1);
    5252  opacity: 1;
    53 }`,vu=De`
     53}`,_u=De`
    5454from {
    5555  transform: scale(0) rotate(90deg);
     
    7575  &:before {
    7676    content: '';
    77     animation: ${_u} 0.15s ease-out forwards;
     77    animation: ${vu} 0.15s ease-out forwards;
    7878    animation-delay: 150ms;
    7979    position: absolute;
     
    8888
    8989  &:before {
    90     animation: ${vu} 0.15s ease-out forwards;
     90    animation: ${_u} 0.15s ease-out forwards;
    9191    animation-delay: 180ms;
    9292    transform: rotate(90deg);
     
    211211    pointer-events: auto;
    212212  }
    213 `,Tr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=xu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Tr,left:Tr,right:Tr,bottom:Tr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?Cr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},q=ne;const Za={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],ot={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Za.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Wu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Qa=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Ku=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Yu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var ei={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ti=y.createContext&&y.createContext(ei),Xu=["attr","size","title"];function Ju(e,t){if(e==null)return{};var r=Zu(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ar.apply(this,arguments)}function ri(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ri(Object(r),!0).forEach(function(n){Qu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ri(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qu(e,t,r){return t=ep(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ep(e){var t=tp(e,"string");return typeof t=="symbol"?t:t+""}function tp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ni(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),ni(t.child)))}function U(e){return t=>y.createElement(rp,Ar({attr:Pr({},e.attr)},t),ni(e.child))}function rp(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Ju(e,Xu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Ar({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return ti!==void 0?y.createElement(ti.Consumer,null,r=>t(r)):t(ei)}function np(e){return U({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function at(e){return U({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function yt(e){return U({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Qt(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function er(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function op(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function ap(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function ip(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function it(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function sp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function oi(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function lp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function cp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(e)}function tr(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function Wn(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function dp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function up(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function pp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function mp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}function ai(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=ai(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():ai(e[o],null)}}}}function J(...e){return x.useCallback(qn(...e),e)}function st(e){const t=hp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(xp);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var fp=st("Slot");function hp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=_p(o),l=bp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?qn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gp=Symbol("radix.slottable");function xp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gp}function bp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function _p(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ii(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ii(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function vp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ii(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return vp(e)}const yp="ecr-button",jp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline","outline-danger":"ecr-button--outline-danger",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},Sp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function te({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?fp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:F(yp,jp[t],Sp[r],e),...o})}function kp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(te,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(te,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(te,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Wn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(te,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(oi,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(te,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(it,{className:"ecr-admin-reels-header__spinner"}):a.jsx(yt,{})," ","Create Widget"]}):null]})]})}function Cp(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function Np(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function lt(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function Ep(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(lt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Tp({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(it,{className:"ecr-admin-reels-loading__icon"})})}const si=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:F("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),wt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function Gn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Kn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Yn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Xn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const Ap="Left",Pp="Right",Op="Up",Rp="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Jn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},li="mousemove",ci="mouseup",Lp="touchend",Ip="touchmove",zp="touchstart";function Mp(e,t,r,n){return e>t?r>0?Pp:Ap:n>0?Rp:Op}function di(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function Dp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(li,n),document.addEventListener(ci,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=di([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Jn),{initial:h.slice(),xy:h,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=g?u.touches[0]:u,[h,_]=di([b,f],m.rotationAngle),v=h-p.xy[0],w=_-p.xy[1],j=Math.abs(v),k=Math.abs(w),N=(u.timeStamp||0)-p.start,C=Math.sqrt(j*j+k*k)/(N||1),E=[v/(N||1),w/(N||1)],T=Mp(j,k,v,w),A=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||jt.delta;if(j<A&&k<A&&!p.swiping)return p;const O={absX:j,absY:k,deltaX:v,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:C,vxvy:E};O.first&&m.onSwipeStart&&m.onSwipeStart(O),m.onSwiping&&m.onSwiping(O);let R=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(R=!0),R&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:O,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Jn),{eventData:g})})},i=()=>{document.removeEventListener(li,n),document.removeEventListener(ci,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},jt.touchEventOptions),p.touchEventOptions),b=[[zp,r,g],[Ip,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Lp,o,g]];b.forEach(([f,h,_])=>u.addEventListener(f,h,_)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Fp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function $p(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Jn)),n=x.useRef(Object.assign({},jt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},jt),e);let i;for(i in jt)n.current[i]===void 0&&(n.current[i]=jt[i]);const[s,l]=x.useMemo(()=>Dp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Fp(r.current,n.current,o.current,l),s}const Bp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"metadata",playsInline:!0,"webkit-playsinline":"true",muted:r,autoPlay:!n,controls:!1,loop:!1,"aria-label":"Reel video",disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onError:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},ui=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!0),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const _=p.current[h];_&&(i?_.play().catch(()=>{}):_.pause(),s(v=>!v))},g=h=>{const _=p.current[h];_&&(_.muted=!d,u(v=>!v))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=$p({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{b&&c()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((h,_)=>a.jsx("div",{className:"ecr-player__slide",children:h?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Bp,{videoRefs:p,file:h,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:i},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)}):a.jsx(Xn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)})]})]})},_))})},Up=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(wt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}):null,r.index<u-1?a.jsx(wt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(si,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(ui,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Hp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Vp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Wp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Or(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function qp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function pi(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Gp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Kp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function Yp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Xp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}const Jp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Zp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"metadata",poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Jp(r?.[e.id]??e.view_count)}),a.jsx(ap,{size:14})]})]})},Zn=y.memo(Zp);function Qp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:F("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Zn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(te,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(mp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(te,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(vt,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Or,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(te,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(Wn,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:F("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(te,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Gp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Kp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function em({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(Qp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const rr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Cp,{size:24})})};function tm(e){return U({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const nr=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(vt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(tm,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Rr=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(lp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(it,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Lr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(vt,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Ir=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(it,{className:"ecr-admin-loader__icon",size:64})}),St=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(y.Fragment,{children:s},l))})]}),kt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function rm(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const zr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(rm,{}),"ReelsWP"]});function mi(e,t){return function(){return e.apply(t,arguments)}}const{toString:nm}=Object.prototype,{getPrototypeOf:Qn}=Object,{iterator:Mr,toStringTag:fi}=Symbol,Dr=(e=>t=>{const r=nm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>Dr(t)===e),Fr=e=>t=>typeof t===e,{isArray:Ct}=Array,Nt=Fr("undefined");function or(e){return e!==null&&!Nt(e)&&e.constructor!==null&&!Nt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const hi=we("ArrayBuffer");function om(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&hi(e.buffer),t}const am=Fr("string"),me=Fr("function"),gi=Fr("number"),ar=e=>e!==null&&typeof e=="object",im=e=>e===!0||e===!1,$r=e=>{if(Dr(e)!=="object")return!1;const t=Qn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(fi in e)&&!(Mr in e)},sm=e=>{if(!ar(e)||or(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},lm=we("Date"),cm=we("File"),dm=we("Blob"),um=we("FileList"),pm=e=>ar(e)&&me(e.pipe),mm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=Dr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},fm=we("URLSearchParams"),[hm,gm,xm,bm]=["ReadableStream","Request","Response","Headers"].map(we),_m=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ir(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(or(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function xi(e,t){if(or(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bi=e=>!Nt(e)&&e!==ct;function eo(){const{caseless:e,skipUndefined:t}=bi(this)&&this||{},r={},n=(o,i)=>{const s=e&&xi(r,i)||i;$r(r[s])&&$r(o)?r[s]=eo(r[s],o):$r(o)?r[s]=eo({},o):Ct(o)?r[s]=o.slice():(!t||!Nt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ir(arguments[o],n);return r}const vm=(e,t,r,{allOwnKeys:n}={})=>(ir(t,(o,i)=>{r&&me(o)?e[i]=mi(o,r):e[i]=o},{allOwnKeys:n}),e),ym=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),wm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},jm=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Qn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Sm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},km=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!gi(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Cm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qn(Uint8Array)),Nm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Em=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Tm=we("HTMLFormElement"),Am=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),_i=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Pm=we("RegExp"),vi=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ir(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Om=e=>{vi(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Rm=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},Lm=()=>{},Im=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function zm(e){return!!(e&&me(e.append)&&e[fi]==="FormData"&&e[Mr])}const Mm=e=>{const t=new Array(10),r=(n,o)=>{if(ar(n)){if(t.indexOf(n)>=0)return;if(or(n))return n;if(!("toJSON"in n)){t[o]=n;const i=Ct(n)?[]:{};return ir(n,(s,l)=>{const c=r(s,o+1);!Nt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},Dm=we("AsyncFunction"),Fm=e=>e&&(ar(e)||me(e))&&me(e.then)&&me(e.catch),yi=((e,t)=>e?setImmediate:t?((r,n)=>(ct.addEventListener("message",({source:o,data:i})=>{o===ct&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ct.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(ct.postMessage)),$m=typeof queueMicrotask<"u"?queueMicrotask.bind(ct):typeof process<"u"&&process.nextTick||yi,S={isArray:Ct,isArrayBuffer:hi,isBuffer:or,isFormData:mm,isArrayBufferView:om,isString:am,isNumber:gi,isBoolean:im,isObject:ar,isPlainObject:$r,isEmptyObject:sm,isReadableStream:hm,isRequest:gm,isResponse:xm,isHeaders:bm,isUndefined:Nt,isDate:lm,isFile:cm,isBlob:dm,isRegExp:Pm,isFunction:me,isStream:pm,isURLSearchParams:fm,isTypedArray:Cm,isFileList:um,forEach:ir,merge:eo,extend:vm,trim:_m,stripBOM:ym,inherits:wm,toFlatObject:jm,kindOf:Dr,kindOfTest:we,endsWith:Sm,toArray:km,forEachEntry:Nm,matchAll:Em,isHTMLForm:Tm,hasOwnProperty:_i,hasOwnProp:_i,reduceDescriptors:vi,freezeMethods:Om,toObjectSet:Rm,toCamelCase:Am,noop:Lm,toFiniteNumber:Im,findKey:xi,global:ct,isContextDefined:bi,isSpecCompliantForm:zm,toJSONObject:Mm,isAsyncFn:Dm,isThenable:Fm,setImmediate:yi,asap:$m,isIterable:e=>e!=null&&me(e[Mr])};function H(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(H,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const wi=H.prototype,ji={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ji[e]={value:e}}),Object.defineProperties(H,ji),Object.defineProperty(wi,"isAxiosError",{value:!0}),H.from=(e,t,r,n,o,i)=>{const s=Object.create(wi);S.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return H.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Bm=null;function to(e){return S.isPlainObject(e)||S.isArray(e)}function Si(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function ki(e,t,r){return e?e.concat(t).map(function(o,i){return o=Si(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Um(e){return S.isArray(e)&&!e.some(to)}const Hm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Br(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!S.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!c&&S.isBlob(b))throw new H("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let _=b;if(b&&!h&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Um(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(_=S.toArray(b)))return f=Si(f),_.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(s===!0?ki([f],j,i):s===null?f:f+"[]",d(w))}),!1}return to(b)?!0:(t.append(ki(h,f,i),d(b)),!1)}const p=[],m=Object.assign(Hm,{defaultVisitor:u,convertValue:d,isVisitable:to});function g(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(_,v){(!(S.isUndefined(_)||_===null)&&o.call(t,_,S.isString(v)?v.trim():v,f,m))===!0&&g(_,f?f.concat(v):[v])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ci(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ro(e,t){this._pairs=[],e&&Br(e,this,t)}const Ni=ro.prototype;Ni.append=function(t,r){this._pairs.push([t,r])},Ni.toString=function(t){const r=t?function(n){return t.call(this,n,Ci)}:Ci;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Vm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ei(e,t,r){if(!t)return e;const n=r&&r.encode||Vm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=S.isURLSearchParams(t)?t.toString():new ro(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ti{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ai={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Wm={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ro,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},no=typeof window<"u"&&typeof document<"u",oo=typeof navigator=="object"&&navigator||void 0,qm=no&&(!oo||["ReactNative","NativeScript","NS"].indexOf(oo.product)<0),Gm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Km=no&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:no,hasStandardBrowserEnv:qm,hasStandardBrowserWebWorkerEnv:Gm,navigator:oo,origin:Km},Symbol.toStringTag,{value:"Module"})),...Wm};function Ym(e,t){return Br(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Xm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Jm(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Pi(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&S.isArray(o)?o.length:s,c?(S.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!S.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&S.isArray(o[s])&&(o[s]=Jm(o[s])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Xm(n),o,r,0)}),r}return null}function Zm(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const sr={transitional:Ai,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Pi(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ym(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Br(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Zm(t)):t}],transformResponse:[function(t){const r=this.transitional||sr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?H.from(l,H.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{sr.headers[e]={}});const Qm=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ef=e=>{const t={};let r,n,o;return e&&e.split(`
     213`,Tr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=xu(r,i);return x.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Tr,left:Tr,right:Tr,bottom:Tr,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?Cr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},q=ne;const Za={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],ot={topBottomSpacing:0,gap:16,gapOnTab:16,gapOnMobile:16,shape:"rectangle",size:200,sizeOnTab:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Za.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},X={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Wu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Qa=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"},{label:"None",value:"none"}],Ku=[{label:"Modern",value:"modern"},{label:"Classic",value:"classic"}],Yu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"},{label:"None",value:"none"}];var ei={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ti=y.createContext&&y.createContext(ei),Xu=["attr","size","title"];function Ju(e,t){if(e==null)return{};var r=Zu(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ar.apply(this,arguments)}function ri(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ri(Object(r),!0).forEach(function(n){Qu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ri(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qu(e,t,r){return t=ep(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ep(e){var t=tp(e,"string");return typeof t=="symbol"?t:t+""}function tp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ni(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),ni(t.child)))}function U(e){return t=>y.createElement(rp,Ar({attr:Pr({},e.attr)},t),ni(e.child))}function rp(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Ju(e,Xu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Ar({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return ti!==void 0?y.createElement(ti.Consumer,null,r=>t(r)):t(ei)}function np(e){return U({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function at(e){return U({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function yt(e){return U({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Qt(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function er(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function op(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function ap(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function ip(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(e)}function it(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function sp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function oi(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function lp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function cp(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(e)}function tr(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function Wn(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function dp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function up(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function pp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function mp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}function ai(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=ai(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():ai(e[o],null)}}}}function J(...e){return x.useCallback(qn(...e),e)}function st(e){const t=hp(e),r=x.forwardRef((n,o)=>{const{children:i,...s}=n,l=x.Children.toArray(i),c=l.find(xp);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var fp=st("Slot");function hp(e){const t=x.forwardRef((r,n)=>{const{children:o,...i}=r;if(x.isValidElement(o)){const s=vp(o),l=bp(i,o.props);return o.type!==x.Fragment&&(l.ref=n?qn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gp=Symbol("radix.slottable");function xp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gp}function bp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function vp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ii(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=ii(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function _p(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ii(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return _p(e)}const yp="ecr-button",jp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline","outline-danger":"ecr-button--outline-danger",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},Sp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function te({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?fp:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:F(yp,jp[t],Sp[r],e),...o})}function kp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s,handleBulkDelete:l}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(te,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(te,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(te,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Wn,{size:22,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"}),"Delete Selected"]})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:c=>o(c.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(te,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(oi,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(te,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(it,{className:"ecr-admin-reels-header__spinner"}):a.jsx(yt,{})," ","Create Widget"]}):null]})]})}function Cp(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function Np(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function lt(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function Ep(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(lt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function Tp({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(it,{className:"ecr-admin-reels-loading__icon"})})}const si=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:F("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),wt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function Gn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Kn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Yn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Xn(e){return U({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const Ap="Left",Pp="Right",Op="Up",Rp="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Jn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},li="mousemove",ci="mouseup",Lp="touchend",Ip="touchmove",zp="touchstart";function Mp(e,t,r,n){return e>t?r>0?Pp:Ap:n>0?Rp:Op}function di(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function Dp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(li,n),document.addEventListener(ci,s));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=di([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Jn),{initial:h.slice(),xy:h,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=g?u.touches[0]:u,[h,v]=di([b,f],m.rotationAngle),_=h-p.xy[0],w=v-p.xy[1],j=Math.abs(_),k=Math.abs(w),N=(u.timeStamp||0)-p.start,C=Math.sqrt(j*j+k*k)/(N||1),E=[_/(N||1),w/(N||1)],T=Mp(j,k,_,w),O=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||jt.delta;if(j<O&&k<O&&!p.swiping)return p;const R={absX:j,absY:k,deltaX:_,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:C,vxvy:E};R.first&&m.onSwipeStart&&m.onSwipeStart(R),m.onSwiping&&m.onSwiping(R);let L=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(L=!0),L&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:R,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const b=m[`onSwiped${g.dir}`];b&&b(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Jn),{eventData:g})})},i=()=>{document.removeEventListener(li,n),document.removeEventListener(ci,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},jt.touchEventOptions),p.touchEventOptions),b=[[zp,r,g],[Ip,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Lp,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Fp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function $p(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Jn)),n=x.useRef(Object.assign({},jt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},jt),e);let i;for(i in jt)n.current[i]===void 0&&(n.current[i]=jt[i]);const[s,l]=x.useMemo(()=>Dp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Fp(r.current,n.current,o.current,l),s}const Bp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"metadata",playsInline:!0,"webkit-playsinline":"true",muted:r,autoPlay:!n,controls:!1,loop:!1,"aria-label":"Reel video",disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onError:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},ui=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!0),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const v=p.current[h];v&&(i?v.play().catch(()=>{}):v.pause(),s(_=>!_))},g=h=>{const v=p.current[h];v&&(v.muted=!d,u(_=>!_))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=$p({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{b&&c()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((h,v)=>a.jsx("div",{className:"ecr-player__slide",children:h?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Bp,{videoRefs:p,file:h,isMuted:d,i:v,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:i},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}),d?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)}):a.jsx(Xn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)})]})]})},v))})},Up=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(wt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}):null,r.index<u-1?a.jsx(wt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(si,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(ui,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Hp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Vp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Wp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Or(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function qp(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function pi(e){return U({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Gp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Kp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function Yp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Xp(e){return U({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}const Jp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Zp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,muted:!0,playsInline:!0,"webkit-playsinline":"true",preload:"metadata",poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":`calc(-120% - ${t.border.border_radius/2}px)`})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Jp(r?.[e.id]??e.view_count)}),a.jsx(ap,{size:14})]})]})},Zn=y.memo(Zp);function Qp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:F("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Zn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(te,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(mp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(te,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(_t,{to:`?view=${X.cr}&from=${X.ar}&sid=${e.id}`,children:a.jsx(Or,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(te,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(Wn,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:F("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(te,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Gp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Kp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function em({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(Qp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const rr=({cb:e})=>{const t=Ne(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(Cp,{size:24})})};function tm(e){return U({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const nr=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(_t,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(tm,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Rr=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(lp,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(it,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Lr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(_t,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Ir=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(it,{className:"ecr-admin-loader__icon",size:64})}),St=({left:e=[],center:t=[],right:r=[],leftClass:n="",centerClass:o="",rightClass:i=""})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:`ecr-admin-navbar__section ${n}`.trim(),children:e.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${o}`.trim(),children:t.map((s,l)=>a.jsx(y.Fragment,{children:s},l))}),a.jsx("div",{className:`ecr-admin-navbar__section ${i}`.trim(),children:r.map((s,l)=>a.jsx(y.Fragment,{children:s},l))})]}),kt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function rm(e){return U({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const zr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(rm,{}),"ReelsWP"]});function mi(e,t){return function(){return e.apply(t,arguments)}}const{toString:nm}=Object.prototype,{getPrototypeOf:Qn}=Object,{iterator:Mr,toStringTag:fi}=Symbol,Dr=(e=>t=>{const r=nm.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>Dr(t)===e),Fr=e=>t=>typeof t===e,{isArray:Ct}=Array,Nt=Fr("undefined");function or(e){return e!==null&&!Nt(e)&&e.constructor!==null&&!Nt(e.constructor)&&me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const hi=we("ArrayBuffer");function om(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&hi(e.buffer),t}const am=Fr("string"),me=Fr("function"),gi=Fr("number"),ar=e=>e!==null&&typeof e=="object",im=e=>e===!0||e===!1,$r=e=>{if(Dr(e)!=="object")return!1;const t=Qn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(fi in e)&&!(Mr in e)},sm=e=>{if(!ar(e)||or(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},lm=we("Date"),cm=we("File"),dm=we("Blob"),um=we("FileList"),pm=e=>ar(e)&&me(e.pipe),mm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||me(e.append)&&((t=Dr(e))==="formdata"||t==="object"&&me(e.toString)&&e.toString()==="[object FormData]"))},fm=we("URLSearchParams"),[hm,gm,xm,bm]=["ReadableStream","Request","Response","Headers"].map(we),vm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ir(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(or(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function xi(e,t){if(or(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bi=e=>!Nt(e)&&e!==ct;function eo(){const{caseless:e,skipUndefined:t}=bi(this)&&this||{},r={},n=(o,i)=>{const s=e&&xi(r,i)||i;$r(r[s])&&$r(o)?r[s]=eo(r[s],o):$r(o)?r[s]=eo({},o):Ct(o)?r[s]=o.slice():(!t||!Nt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&ir(arguments[o],n);return r}const _m=(e,t,r,{allOwnKeys:n}={})=>(ir(t,(o,i)=>{r&&me(o)?e[i]=mi(o,r):e[i]=o},{allOwnKeys:n}),e),ym=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),wm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},jm=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Qn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Sm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},km=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!gi(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Cm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qn(Uint8Array)),Nm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Em=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Tm=we("HTMLFormElement"),Am=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),vi=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Pm=we("RegExp"),_i=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ir(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},Om=e=>{_i(e,(t,r)=>{if(me(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(me(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Rm=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},Lm=()=>{},Im=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function zm(e){return!!(e&&me(e.append)&&e[fi]==="FormData"&&e[Mr])}const Mm=e=>{const t=new Array(10),r=(n,o)=>{if(ar(n)){if(t.indexOf(n)>=0)return;if(or(n))return n;if(!("toJSON"in n)){t[o]=n;const i=Ct(n)?[]:{};return ir(n,(s,l)=>{const c=r(s,o+1);!Nt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},Dm=we("AsyncFunction"),Fm=e=>e&&(ar(e)||me(e))&&me(e.then)&&me(e.catch),yi=((e,t)=>e?setImmediate:t?((r,n)=>(ct.addEventListener("message",({source:o,data:i})=>{o===ct&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ct.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",me(ct.postMessage)),$m=typeof queueMicrotask<"u"?queueMicrotask.bind(ct):typeof process<"u"&&process.nextTick||yi,S={isArray:Ct,isArrayBuffer:hi,isBuffer:or,isFormData:mm,isArrayBufferView:om,isString:am,isNumber:gi,isBoolean:im,isObject:ar,isPlainObject:$r,isEmptyObject:sm,isReadableStream:hm,isRequest:gm,isResponse:xm,isHeaders:bm,isUndefined:Nt,isDate:lm,isFile:cm,isBlob:dm,isRegExp:Pm,isFunction:me,isStream:pm,isURLSearchParams:fm,isTypedArray:Cm,isFileList:um,forEach:ir,merge:eo,extend:_m,trim:vm,stripBOM:ym,inherits:wm,toFlatObject:jm,kindOf:Dr,kindOfTest:we,endsWith:Sm,toArray:km,forEachEntry:Nm,matchAll:Em,isHTMLForm:Tm,hasOwnProperty:vi,hasOwnProp:vi,reduceDescriptors:_i,freezeMethods:Om,toObjectSet:Rm,toCamelCase:Am,noop:Lm,toFiniteNumber:Im,findKey:xi,global:ct,isContextDefined:bi,isSpecCompliantForm:zm,toJSONObject:Mm,isAsyncFn:Dm,isThenable:Fm,setImmediate:yi,asap:$m,isIterable:e=>e!=null&&me(e[Mr])};function H(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(H,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const wi=H.prototype,ji={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ji[e]={value:e}}),Object.defineProperties(H,ji),Object.defineProperty(wi,"isAxiosError",{value:!0}),H.from=(e,t,r,n,o,i)=>{const s=Object.create(wi);S.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return H.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Bm=null;function to(e){return S.isPlainObject(e)||S.isArray(e)}function Si(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function ki(e,t,r){return e?e.concat(t).map(function(o,i){return o=Si(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Um(e){return S.isArray(e)&&!e.some(to)}const Hm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Br(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!S.isUndefined(h[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!c&&S.isBlob(b))throw new H("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,h){let v=b;if(b&&!h&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Um(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(v=S.toArray(b)))return f=Si(f),v.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(s===!0?ki([f],j,i):s===null?f:f+"[]",d(w))}),!1}return to(b)?!0:(t.append(ki(h,f,i),d(b)),!1)}const p=[],m=Object.assign(Hm,{defaultVisitor:u,convertValue:d,isVisitable:to});function g(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(v,_){(!(S.isUndefined(v)||v===null)&&o.call(t,v,S.isString(_)?_.trim():_,f,m))===!0&&g(v,f?f.concat(_):[_])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ci(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ro(e,t){this._pairs=[],e&&Br(e,this,t)}const Ni=ro.prototype;Ni.append=function(t,r){this._pairs.push([t,r])},Ni.toString=function(t){const r=t?function(n){return t.call(this,n,Ci)}:Ci;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Vm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ei(e,t,r){if(!t)return e;const n=r&&r.encode||Vm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=S.isURLSearchParams(t)?t.toString():new ro(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ti{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ai={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Wm={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ro,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},no=typeof window<"u"&&typeof document<"u",oo=typeof navigator=="object"&&navigator||void 0,qm=no&&(!oo||["ReactNative","NativeScript","NS"].indexOf(oo.product)<0),Gm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Km=no&&window.location.href||"http://localhost",ue={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:no,hasStandardBrowserEnv:qm,hasStandardBrowserWebWorkerEnv:Gm,navigator:oo,origin:Km},Symbol.toStringTag,{value:"Module"})),...Wm};function Ym(e,t){return Br(e,new ue.classes.URLSearchParams,{visitor:function(r,n,o,i){return ue.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Xm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Jm(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Pi(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&S.isArray(o)?o.length:s,c?(S.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!S.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&S.isArray(o[s])&&(o[s]=Jm(o[s])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Xm(n),o,r,0)}),r}return null}function Zm(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const sr={transitional:Ai,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=S.isObject(t);if(i&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Pi(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ym(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Br(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Zm(t)):t}],transformResponse:[function(t){const r=this.transitional||sr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?H.from(l,H.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{sr.headers[e]={}});const Qm=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ef=e=>{const t={};let r,n,o;return e&&e.split(`
    214214`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Qm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Oi=Symbol("internals");function lr(e){return e&&String(e).trim().toLowerCase()}function Ur(e){return e===!1||e==null?e:S.isArray(e)?e.map(Ur):String(e)}function tf(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const rf=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ao(e,t,r,n,o){if(S.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!S.isString(t)){if(S.isString(n))return t.indexOf(n)!==-1;if(S.isRegExp(n))return n.test(t)}}function nf(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function of(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let fe=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=lr(c);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Ur(l))}const s=(l,c)=>S.forEach(l,(d,u)=>i(d,u,c));if(S.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(S.isString(t)&&(t=t.trim())&&!rf(t))s(ef(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},c,d;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?S.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=lr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return tf(o);if(S.isFunction(r))return r.call(this,o,n);if(S.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=lr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ao(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=lr(s),s){const l=S.findKey(n,s);l&&(!r||ao(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||ao(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,i)=>{const s=S.findKey(n,i);if(s){r[s]=Ur(o),delete r[i];return}const l=t?nf(i):String(i).trim();l!==i&&delete r[i],r[l]=Ur(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return S.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&S.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
    215 `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Oi]=this[Oi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=lr(s);n[l]||(of(o,s),n[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(fe);function io(e,t){const r=this||sr,n=t||r,o=fe.from(n.headers);let i=n.data;return S.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ri(e){return!!(e&&e.__CANCEL__)}function Et(e,t,r){H.call(this,e??"canceled",H.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(Et,H,{__CANCEL__:!0});function Li(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new H("Request failed with status code "+r.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function af(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function sf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function lf(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Hr=(e,t,r=3)=>{let n=0;const o=sf(50,250);return lf(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Ii=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},zi=e=>(...t)=>S.asap(()=>e(...t)),cf=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,df=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function uf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function pf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Mi(e,t,r){let n=!uf(t);return e&&(n||r==!1)?pf(e,t):t}const Di=e=>e instanceof fe?{...e}:e;function dt(e,t){t=t||{};const r={};function n(d,u,p,m){return S.isPlainObject(d)&&S.isPlainObject(u)?S.merge.call({caseless:m},d,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(d,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!S.isUndefined(u))return n(void 0,u)}function s(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Di(d),Di(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Fi=e=>{const t=dt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Ei(Mi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&cf(t.url))){const c=o&&i&&df.read(i);c&&s.set(o,c)}return t},mf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Fi(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function _(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Li(function(C){r(C),f()},function(C){n(C),f()},k),h=null}"onloadend"in h?h.onloadend=_:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(_)},h.onabort=function(){h&&(n(new H("Request aborted",H.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const k=j&&j.message?j.message:"Network Error",N=new H(k,H.ERR_NETWORK,e,h);N.event=j||null,n(N),h=null},h.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const k=o.transitional||Ai;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new H(j,k.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&S.forEach(s.toJSON(),function(j,k){h.setRequestHeader(k,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Hr(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Hr(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Et(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const v=af(o.url);if(v&&ue.protocols.indexOf(v)===-1){n(new H("Unsupported protocol "+v+":",H.ERR_BAD_REQUEST,e));return}h.send(i||null)})},ff=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof H?u:new Et(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new H(`timeout ${t} of ms exceeded`,H.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>S.asap(l),c}},hf=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},gf=async function*(e,t){for await(const r of xf(e))yield*hf(r,t)},xf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},$i=(e,t,r,n)=>{const o=gf(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Bi=64*1024,{isFunction:Vr}=S,bf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Ui,TextEncoder:Hi}=S.global,Vi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},_f=e=>{e=S.merge.call({skipUndefined:!0},bf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Vr(t):typeof fetch=="function",i=Vr(r),s=Vr(n);if(!o)return!1;const l=o&&Vr(Ui),c=o&&(typeof Hi=="function"?(b=>f=>b.encode(f))(new Hi):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Vi(()=>{let b=!1;const f=new r(ue.origin,{body:new Ui,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Vi(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,h)=>{let _=f&&f[b];if(_)return _.call(f);throw new H(`Response type '${b}' is not supported`,H.ERR_NOT_SUPPORT,h)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=S.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:_,signal:v,cancelToken:w,timeout:j,onDownloadProgress:k,onUploadProgress:N,responseType:C,headers:E,withCredentials:T="same-origin",fetchOptions:A}=Fi(b),O=t||fetch;C=C?(C+"").toLowerCase():"text";let R=ff([v,w&&w.toAbortSignal()],j),L=null;const P=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let M;try{if(N&&d&&h!=="get"&&h!=="head"&&(M=await g(E,_))!==0){let ie=new r(f,{method:"POST",body:_,duplex:"half"}),ge;if(S.isFormData(_)&&(ge=ie.headers.get("content-type"))&&E.setContentType(ge),ie.body){const[_e,pe]=Ii(M,Hr(zi(N)));_=$i(ie.body,Bi,_e,pe)}}S.isString(T)||(T=T?"include":"omit");const I=i&&"credentials"in r.prototype,B={...A,signal:R,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:I?T:void 0};L=i&&new r(f,B);let z=await(i?O(L,A):O(f,B));const G=u&&(C==="stream"||C==="response");if(u&&(k||G&&P)){const ie={};["status","statusText","headers"].forEach(K=>{ie[K]=z[K]});const ge=S.toFiniteNumber(z.headers.get("content-length")),[_e,pe]=k&&Ii(ge,Hr(zi(k),!0))||[];z=new n($i(z.body,Bi,_e,()=>{pe&&pe(),P&&P()}),ie)}C=C||"text";let ae=await p[S.findKey(p,C)||"text"](z,b);return!G&&P&&P(),await new Promise((ie,ge)=>{Li(ie,ge,{data:ae,headers:fe.from(z.headers),status:z.status,statusText:z.statusText,config:b,request:L})})}catch(I){throw P&&P(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new H("Network Error",H.ERR_NETWORK,b,L),{cause:I.cause||I}):H.from(I,I&&I.code,b,L)}}},vf=new Map,Wi=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=vf;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:_f(t)),u=d;return d};Wi();const so={http:Bm,xhr:mf,fetch:{get:Wi}};S.forEach(so,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const qi=e=>`- ${e}`,yf=e=>S.isFunction(e)||e===null||e===!1;function wf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!yf(n)&&(o=so[(l=String(n)).toLowerCase()],o===void 0))throw new H(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
     215`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Oi]=this[Oi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=lr(s);n[l]||(of(o,s),n[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(fe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(fe);function io(e,t){const r=this||sr,n=t||r,o=fe.from(n.headers);let i=n.data;return S.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ri(e){return!!(e&&e.__CANCEL__)}function Et(e,t,r){H.call(this,e??"canceled",H.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(Et,H,{__CANCEL__:!0});function Li(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new H("Request failed with status code "+r.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function af(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function sf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function lf(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Hr=(e,t,r=3)=>{let n=0;const o=sf(50,250);return lf(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Ii=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},zi=e=>(...t)=>S.asap(()=>e(...t)),cf=ue.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ue.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ue.origin),ue.navigator&&/(msie|trident)/i.test(ue.navigator.userAgent)):()=>!0,df=ue.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function uf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function pf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Mi(e,t,r){let n=!uf(t);return e&&(n||r==!1)?pf(e,t):t}const Di=e=>e instanceof fe?{...e}:e;function dt(e,t){t=t||{};const r={};function n(d,u,p,m){return S.isPlainObject(d)&&S.isPlainObject(u)?S.merge.call({caseless:m},d,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(d,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!S.isUndefined(u))return n(void 0,u)}function s(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Di(d),Di(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Fi=e=>{const t=dt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=fe.from(s),t.url=Ei(Mi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(ue.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&cf(t.url))){const c=o&&i&&df.read(i);c&&s.set(o,c)}return t},mf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Fi(e);let i=o.data;const s=fe.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,b;function f(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function v(){if(!h)return;const w=fe.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Li(function(C){r(C),f()},function(C){n(C),f()},k),h=null}"onloadend"in h?h.onloadend=v:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(v)},h.onabort=function(){h&&(n(new H("Request aborted",H.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const k=j&&j.message?j.message:"Network Error",N=new H(k,H.ERR_NETWORK,e,h);N.event=j||null,n(N),h=null},h.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const k=o.transitional||Ai;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new H(j,k.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,h)),h=null},i===void 0&&s.setContentType(null),"setRequestHeader"in h&&S.forEach(s.toJSON(),function(j,k){h.setRequestHeader(k,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),d&&([m,b]=Hr(d,!0),h.addEventListener("progress",m)),c&&h.upload&&([p,g]=Hr(c),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new Et(null,e,h):w),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const _=af(o.url);if(_&&ue.protocols.indexOf(_)===-1){n(new H("Unsupported protocol "+_+":",H.ERR_BAD_REQUEST,e));return}h.send(i||null)})},ff=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof H?u:new Et(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new H(`timeout ${t} of ms exceeded`,H.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>S.asap(l),c}},hf=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},gf=async function*(e,t){for await(const r of xf(e))yield*hf(r,t)},xf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},$i=(e,t,r,n)=>{const o=gf(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Bi=64*1024,{isFunction:Vr}=S,bf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Ui,TextEncoder:Hi}=S.global,Vi=(e,...t)=>{try{return!!e(...t)}catch{return!1}},vf=e=>{e=S.merge.call({skipUndefined:!0},bf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Vr(t):typeof fetch=="function",i=Vr(r),s=Vr(n);if(!o)return!1;const l=o&&Vr(Ui),c=o&&(typeof Hi=="function"?(b=>f=>b.encode(f))(new Hi):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=i&&l&&Vi(()=>{let b=!1;const f=new r(ue.origin,{body:new Ui,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=s&&l&&Vi(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,h)=>{let v=f&&f[b];if(v)return v.call(f);throw new H(`Response type '${b}' is not supported`,H.ERR_NOT_SUPPORT,h)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ue.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await c(b)).byteLength},g=async(b,f)=>{const h=S.toFiniteNumber(b.getContentLength());return h??m(f)};return async b=>{let{url:f,method:h,data:v,signal:_,cancelToken:w,timeout:j,onDownloadProgress:k,onUploadProgress:N,responseType:C,headers:E,withCredentials:T="same-origin",fetchOptions:O}=Fi(b),R=t||fetch;C=C?(C+"").toLowerCase():"text";let L=ff([_,w&&w.toAbortSignal()],j),A=null;const P=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let z;try{if(N&&d&&h!=="get"&&h!=="head"&&(z=await g(E,v))!==0){let se=new r(f,{method:"POST",body:v,duplex:"half"}),ge;if(S.isFormData(v)&&(ge=se.headers.get("content-type"))&&E.setContentType(ge),se.body){const[ve,pe]=Ii(z,Hr(zi(N)));v=$i(se.body,Bi,ve,pe)}}S.isString(T)||(T=T?"include":"omit");const I=i&&"credentials"in r.prototype,B={...O,signal:L,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:I?T:void 0};A=i&&new r(f,B);let M=await(i?R(A,O):R(f,B));const G=u&&(C==="stream"||C==="response");if(u&&(k||G&&P)){const se={};["status","statusText","headers"].forEach(K=>{se[K]=M[K]});const ge=S.toFiniteNumber(M.headers.get("content-length")),[ve,pe]=k&&Ii(ge,Hr(zi(k),!0))||[];M=new n($i(M.body,Bi,ve,()=>{pe&&pe(),P&&P()}),se)}C=C||"text";let ie=await p[S.findKey(p,C)||"text"](M,b);return!G&&P&&P(),await new Promise((se,ge)=>{Li(se,ge,{data:ie,headers:fe.from(M.headers),status:M.status,statusText:M.statusText,config:b,request:A})})}catch(I){throw P&&P(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new H("Network Error",H.ERR_NETWORK,b,A),{cause:I.cause||I}):H.from(I,I&&I.code,b,A)}}},_f=new Map,Wi=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=_f;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:vf(t)),u=d;return d};Wi();const so={http:Bm,xhr:mf,fetch:{get:Wi}};S.forEach(so,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const qi=e=>`- ${e}`,yf=e=>S.isFunction(e)||e===null||e===!1;function wf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!yf(n)&&(o=so[(l=String(n)).toLowerCase()],o===void 0))throw new H(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
    216216`+s.map(qi).join(`
    217217`):" "+qi(s[0]):"as no adapter specified";throw new H("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Gi={getAdapter:wf,adapters:so};function lo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Et(null,e)}function Ki(e){return lo(e),e.headers=fe.from(e.headers),e.data=io.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Gi.getAdapter(e.adapter||sr.adapter,e)(e).then(function(n){return lo(e),n.data=io.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return Ri(n)||(lo(e),n&&n.response&&(n.response.data=io.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const Yi="1.13.1",Wr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Xi={};Wr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Yi+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new H(o(s," has been removed"+(r?" in "+r:"")),H.ERR_DEPRECATED);return r&&!Xi[s]&&(Xi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Wr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function jf(e,t,r){if(typeof e!="object")throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new H("option "+i+" must be "+c,H.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new H("Unknown option "+i,H.ERR_BAD_OPTION)}}const qr={assertOptions:jf,validators:Wr},Te=qr.validators;let ut=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ti,response:new Ti}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
    218 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=dt(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&qr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:qr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),qr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[r.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[Ki.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=Ki.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=dt(this.defaults,t);const r=Mi(t.baseURL,t.url,t.allowAbsoluteUrls);return Ei(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){ut.prototype[t]=function(r,n){return this.request(dt(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(dt(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ut.prototype[t]=r(),ut.prototype[t+"Form"]=r(!0)});let Sf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Et(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sd(function(o){t=o}),cancel:t}}};function kf(e){return function(r){return e.apply(null,r)}}function Cf(e){return S.isObject(e)&&e.isAxiosError===!0}const co={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(co).forEach(([e,t])=>{co[t]=e});function Ji(e){const t=new ut(e),r=mi(ut.prototype.request,t);return S.extend(r,ut.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Ji(dt(e,o))},r}const ee=Ji(sr);ee.Axios=ut,ee.CanceledError=Et,ee.CancelToken=Sf,ee.isCancel=Ri,ee.VERSION=Yi,ee.toFormData=Br,ee.AxiosError=H,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=kf,ee.isAxiosError=Cf,ee.mergeConfig=dt,ee.AxiosHeaders=fe,ee.formToJSON=e=>Pi(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=Gi.getAdapter,ee.HttpStatusCode=co,ee.default=ee;const{Axios:qv,AxiosError:Gv,CanceledError:Kv,isCancel:Yv,CancelToken:Xv,VERSION:Jv,all:Zv,Cancel:Qv,isAxiosError:e1,spread:t1,toFormData:r1,AxiosHeaders:n1,HttpStatusCode:o1,formToJSON:a1,getAdapter:i1,mergeConfig:s1}=ee,Zi=ecommreelsInfo,he=ee.create({baseURL:`${Zi.apiBase}`,headers:{"X-WP-Nonce":Zi.nonce,"Content-Type":"application/json"}}),Nf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:ot,story_ids:s},c=await he.post("stories/manage-group-stories",l);return q.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?q.error(l.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||q.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||q.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:ot,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function uo(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Qi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),g=uo(p,500),b=y.useRef(!0),f=y.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const k=await he.get("stories",{params:j}),N=k.data,C=parseInt(k.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<C)}catch(j){j instanceof Error?q.error(j.message):q.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=y.useCallback(()=>{o(1),r([]),f(1)},[f]);y.useEffect(()=>{h()},[g,h]);const _=y.useRef(null),v=y.useCallback(w=>{l||(_.current&&_.current.disconnect(),_.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&_.current.observe(w))},[l,i,n,f]);return y.useEffect(()=>()=>{_.current&&_.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:v,refreshReels:h}};function Ef(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Qi(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Nf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[_,v]=y.useState(null),[w,j]=y.useState([]),k=async()=>{const A=await p(w);A&&e(`?view=${X.mg}&gid=${A}`)},N=()=>{j(t.map(A=>A.id))},C=A=>{j(O=>O.includes(A)?O.filter(R=>R!==A):[...O,A])},E=()=>{w.length&&h(w)},T=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const A=await Promise.all(f.map(P=>m(P,r,{silent:!0}))),O=f.filter((P,M)=>A[M]?.ok),R=O.length,L=f.length-R;R&&(r(P=>P.filter(M=>!O.includes(M.id))),j(P=>P.filter(M=>!O.includes(M)))),R&&q.success(`${R} reels deleted successfully!`),L&&q.error(`${L} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Rr,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(St,{left:[a.jsx(kt,{name:"All Reels",Icon:np},"page"),a.jsx(rr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsx(Lr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:yt},"add-reel-all-reel")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(kp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:k,handleBulkDelete:E}),t.length?a.jsx(em,{reels:t,styles:c,selectedReelIds:w,onSelectReel:C,onDeleteReel:b,onPreviewReel:v,lastStoryElementRef:o}):!n&&!l?a.jsx(Ep,{}):null,n&&a.jsx(Tp,{isFullScreen:!t.length})]}),!!_&&a.jsx(Up,{previewReel:_,setPreviewReel:v})]})}const Tf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,thumbnail:l,links:s};n&&(c.story_id=n);const d=await he.post("files",c);return q.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},po=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(te,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(it,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(sp,{className:"ecr-admin-save-button__icon"})," ",r]}),es=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Af=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Jt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=Tf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:l?"Update Reel":"Add Reel",Icon:yt},"page"),a.jsx(rr,{},"back")],center:[a.jsx(es,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(po,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})};/**
     218`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=dt(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&qr.assertOptions(n,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:qr.assertOptions(o,{encode:Te.function,serialize:Te.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),qr.assertOptions(r,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[r.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),r.headers=fe.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[Ki.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let g=r;for(;p<m;){const b=l[p++],f=l[p++];try{g=b(g)}catch(h){f.call(this,h);break}}try{u=Ki.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=dt(this.defaults,t);const r=Mi(t.baseURL,t.url,t.allowAbsoluteUrls);return Ei(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){ut.prototype[t]=function(r,n){return this.request(dt(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(dt(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ut.prototype[t]=r(),ut.prototype[t+"Form"]=r(!0)});let Sf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Et(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Sd(function(o){t=o}),cancel:t}}};function kf(e){return function(r){return e.apply(null,r)}}function Cf(e){return S.isObject(e)&&e.isAxiosError===!0}const co={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(co).forEach(([e,t])=>{co[t]=e});function Ji(e){const t=new ut(e),r=mi(ut.prototype.request,t);return S.extend(r,ut.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Ji(dt(e,o))},r}const ee=Ji(sr);ee.Axios=ut,ee.CanceledError=Et,ee.CancelToken=Sf,ee.isCancel=Ri,ee.VERSION=Yi,ee.toFormData=Br,ee.AxiosError=H,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=kf,ee.isAxiosError=Cf,ee.mergeConfig=dt,ee.AxiosHeaders=fe,ee.formToJSON=e=>Pi(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=Gi.getAdapter,ee.HttpStatusCode=co,ee.default=ee;const{Axios:G_,AxiosError:K_,CanceledError:Y_,isCancel:X_,CancelToken:J_,VERSION:Z_,all:Q_,Cancel:e1,isAxiosError:t1,spread:r1,toFormData:n1,AxiosHeaders:o1,HttpStatusCode:a1,formToJSON:i1,getAdapter:s1,mergeConfig:l1}=ee,Zi=ecommreelsInfo,he=ee.create({baseURL:`${Zi.apiBase}`,headers:{"X-WP-Nonce":Zi.nonce,"Content-Type":"application/json"}}),Nf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:ot,story_ids:s},c=await he.post("stories/manage-group-stories",l);return q.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?q.error(l.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l,c)=>{try{return n(!0),await he.delete(`story/${s}`),l(d=>d.filter(u=>u.id!==s)),c?.silent||q.success("Reel deleted successfully!"),{ok:!0}}catch(d){const u=d instanceof Error?d.message:"Something went wrong. Try again later!";return c?.silent||q.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:ot,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function uo(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Qi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),g=uo(p,500),b=y.useRef(!0),f=y.useCallback(async w=>{w===1&&b.current?u(!0):c(!0);try{const j={page:w,per_page:20};e&&(j.group_id=e),g&&(j.search=g);const k=await he.get("stories",{params:j}),N=k.data,C=parseInt(k.headers["x-wp-totalpages"]);r(E=>w===1?N:[...E,...N]),o(w+1),s(w<C)}catch(j){j instanceof Error?q.error(j.message):q.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,g]),h=y.useCallback(()=>{o(1),r([]),f(1)},[f]);y.useEffect(()=>{h()},[g,h]);const v=y.useRef(null),_=y.useCallback(w=>{l||(v.current&&v.current.disconnect(),v.current=new IntersectionObserver(j=>{j[0].isIntersecting&&i&&f(n)}),w&&v.current.observe(w))},[l,i,n,f]);return y.useEffect(()=>()=>{v.current&&v.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:_,refreshReels:h}};function Ef(){const e=Ne(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Qi(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=Nf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[v,_]=y.useState(null),[w,j]=y.useState([]),k=async()=>{const O=await p(w);O&&e(`?view=${X.mg}&gid=${O}`)},N=()=>{j(t.map(O=>O.id))},C=O=>{j(R=>R.includes(O)?R.filter(L=>L!==O):[...R,O])},E=()=>{w.length&&h(w)},T=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const O=await Promise.all(f.map(P=>m(P,r,{silent:!0}))),R=f.filter((P,z)=>O[z]?.ok),L=R.length,A=f.length-L;L&&(r(P=>P.filter(z=>!R.includes(z.id))),j(P=>P.filter(z=>!R.includes(z)))),L&&q.success(`${L} reels deleted successfully!`),A&&q.error(`${A} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Rr,{onReject:()=>{b(null),h(null)},onAccept:T,isLoading:u,message:f?.length?`Are you sure you want to remove ${f.length} reels?`:"Are you sure you want to remove this reel?"}),a.jsx(St,{left:[a.jsx(kt,{name:"All Reels",Icon:np},"page"),a.jsx(rr,{cb:()=>e(`?view=${X.ag}`)},"back")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsx(Lr,{to:`?view=${X.cr}&from=${X.ar}`,text:"Add Reel",Icon:yt},"add-reel-all-reel")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(kp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:k,handleBulkDelete:E}),t.length?a.jsx(em,{reels:t,styles:c,selectedReelIds:w,onSelectReel:C,onDeleteReel:b,onPreviewReel:_,lastStoryElementRef:o}):!n&&!l?a.jsx(Ep,{}):null,n&&a.jsx(Tp,{isFullScreen:!t.length})]}),!!v&&a.jsx(Up,{previewReel:v,setPreviewReel:_})]})}const Tf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,thumbnail:l,links:s};n&&(c.story_id=n);const d=await he.post("files",c);return q.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},po=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(te,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(it,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(sp,{className:"ecr-admin-save-button__icon"})," ",r]}),es=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),Af=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=Ne(),[s]=Jt(),l=s.get("sid"),c=s.get("from")||X.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=Tf(),m=async()=>{u||!await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o})||i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0})};return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:l?"Update Reel":"Add Reel",Icon:yt},"page"),a.jsx(rr,{},"back")],center:[a.jsx(es,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(po,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})};/**
    219219 * @license lucide-react v0.552.0 - ISC
    220220 *
     
    236236 * This source code is licensed under the ISC license.
    237237 * See the LICENSE file in the root directory of this source tree.
    238  */const se=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(If,{ref:i,iconNode:t,className:rs(`lucide-${Pf(ts(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ts(e),r};/**
    239  * @license lucide-react v0.552.0 - ISC
    240  *
    241  * This source code is licensed under the ISC license.
    242  * See the LICENSE file in the root directory of this source tree.
    243  */const zf=se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
    244  * @license lucide-react v0.552.0 - ISC
    245  *
    246  * This source code is licensed under the ISC license.
    247  * See the LICENSE file in the root directory of this source tree.
    248  */const mo=se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
    249  * @license lucide-react v0.552.0 - ISC
    250  *
    251  * This source code is licensed under the ISC license.
    252  * See the LICENSE file in the root directory of this source tree.
    253  */const Mf=se("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
    254  * @license lucide-react v0.552.0 - ISC
    255  *
    256  * This source code is licensed under the ISC license.
    257  * See the LICENSE file in the root directory of this source tree.
    258  */const Df=se("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
    259  * @license lucide-react v0.552.0 - ISC
    260  *
    261  * This source code is licensed under the ISC license.
    262  * See the LICENSE file in the root directory of this source tree.
    263  */const Ff=se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
    264  * @license lucide-react v0.552.0 - ISC
    265  *
    266  * This source code is licensed under the ISC license.
    267  * See the LICENSE file in the root directory of this source tree.
    268  */const $f=se("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
    269  * @license lucide-react v0.552.0 - ISC
    270  *
    271  * This source code is licensed under the ISC license.
    272  * See the LICENSE file in the root directory of this source tree.
    273  */const Bf=se("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
    274  * @license lucide-react v0.552.0 - ISC
    275  *
    276  * This source code is licensed under the ISC license.
    277  * See the LICENSE file in the root directory of this source tree.
    278  */const Uf=se("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
    279  * @license lucide-react v0.552.0 - ISC
    280  *
    281  * This source code is licensed under the ISC license.
    282  * See the LICENSE file in the root directory of this source tree.
    283  */const Hf=se("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
    284  * @license lucide-react v0.552.0 - ISC
    285  *
    286  * This source code is licensed under the ISC license.
    287  * See the LICENSE file in the root directory of this source tree.
    288  */const Vf=se("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
    289  * @license lucide-react v0.552.0 - ISC
    290  *
    291  * This source code is licensed under the ISC license.
    292  * See the LICENSE file in the root directory of this source tree.
    293  */const Wf=se("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
    294  * @license lucide-react v0.552.0 - ISC
    295  *
    296  * This source code is licensed under the ISC license.
    297  * See the LICENSE file in the root directory of this source tree.
    298  */const qf=se("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
    299  * @license lucide-react v0.552.0 - ISC
    300  *
    301  * This source code is licensed under the ISC license.
    302  * See the LICENSE file in the root directory of this source tree.
    303  */const Gf=se("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
    304  * @license lucide-react v0.552.0 - ISC
    305  *
    306  * This source code is licensed under the ISC license.
    307  * See the LICENSE file in the root directory of this source tree.
    308  */const Kf=se("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
    309  * @license lucide-react v0.552.0 - ISC
    310  *
    311  * This source code is licensed under the ISC license.
    312  * See the LICENSE file in the root directory of this source tree.
    313  */const Yf=se("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
    314  * @license lucide-react v0.552.0 - ISC
    315  *
    316  * This source code is licensed under the ISC license.
    317  * See the LICENSE file in the root directory of this source tree.
    318  */const Xf=se("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
    319  * @license lucide-react v0.552.0 - ISC
    320  *
    321  * This source code is licensed under the ISC license.
    322  * See the LICENSE file in the root directory of this source tree.
    323  */const ns=se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Jf(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,Zf(o,...t)]}function Zf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Qf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=Qf.reduce((e,t)=>{const r=st(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function eh(e,t){e&&_r.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function th(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var rh="DismissableLayer",fo="dismissableLayer.update",nh="dismissableLayer.pointerDownOutside",oh="dismissableLayer.focusOutside",os,as=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(as),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,C=>p(C)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(h),v=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=v>=_,k=sh(C=>{const E=C.target,T=[...d.branches].some(A=>A.contains(E));!j||T||(o?.(C),s?.(C),C.defaultPrevented||l?.())},m),N=lh(C=>{const E=C.target;[...d.branches].some(A=>A.contains(E))||(i?.(C),s?.(C),C.defaultPrevented||l?.())},m);return th(C=>{v===d.layers.size-1&&(n?.(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(os=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),is(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=os)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),is())},[u,d]),x.useEffect(()=>{const C=()=>g({});return document.addEventListener(fo,C),()=>document.removeEventListener(fo,C)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,k.onPointerDownCapture)})});Gr.displayName=rh;var ah="DismissableLayerBranch",ih=x.forwardRef((e,t)=>{const r=x.useContext(as),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ih.displayName=ah;function sh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ss(nh,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function lh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ss(oh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function is(){const e=new CustomEvent(fo);document.dispatchEvent(e)}function ss(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?eh(o,i):o.dispatchEvent(i)}var ho=0;function go(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ls()),document.body.insertAdjacentElement("beforeend",e[1]??ls()),ho++,()=>{ho===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ho--}},[])}function ls(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xo="focusScope.autoFocusOnMount",bo="focusScope.autoFocusOnUnmount",cs={bubbles:!1,cancelable:!0},ch="FocusScope",Kr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const v=new MutationObserver(_);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),v.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){ps.add(g);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(xo,cs);l.addEventListener(xo,d),l.dispatchEvent(_),_.defaultPrevented||(dh(hh(ds(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(xo,d),setTimeout(()=>{const _=new CustomEvent(bo,cs);l.addEventListener(bo,u),l.dispatchEvent(_),_.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(bo,u),ps.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(h&&_){const v=f.currentTarget,[w,j]=uh(v);w&&j?!f.shiftKey&&_===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&qe(j,{select:!0})):_===v&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Kr.displayName=ch;function dh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function uh(e){const t=ds(e),r=us(t,e),n=us(t.reverse(),e);return[r,n]}function ds(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function us(e,t){for(const r of e)if(!ph(r,{upTo:t}))return r}function ph(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function mh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&mh(e)&&t&&e.select()}}var ps=fh();function fh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=ms(e,t),e.unshift(t)},remove(t){e=ms(e,t),e[0]?.resume()}}}function ms(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function hh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},gh=x[" useId ".trim().toString()]||(()=>{}),xh=0;function Ae(e){const[t,r]=x.useState(gh());return le(()=>{r(n=>n??String(xh++))},[e]),e||(t?`radix-${t}`:"")}const bh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Yr=Math.round,Xr=Math.floor,Pe=e=>({x:e,y:e}),_h={left:"right",right:"left",bottom:"top",top:"bottom"},vh={start:"end",end:"start"};function _o(e,t,r){return xe(e,Ge(t,r))}function Fe(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function vo(e){return e==="x"?"y":"x"}function yo(e){return e==="y"?"height":"width"}const yh=new Set(["top","bottom"]);function Oe(e){return yh.has($e(e))?"y":"x"}function wo(e){return vo(Oe(e))}function wh(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=wo(e),i=yo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function jh(e){const t=Jr(e);return[jo(e),t,jo(t)]}function jo(e){return e.replace(/start|end/g,t=>vh[t])}const fs=["left","right"],hs=["right","left"],Sh=["top","bottom"],kh=["bottom","top"];function Ch(e,t,r){switch(e){case"top":case"bottom":return r?t?hs:fs:t?fs:hs;case"left":case"right":return t?Sh:kh;default:return[]}}function Nh(e,t,r,n){const o=Tt(e);let i=Ch($e(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(jo)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>_h[t])}function Eh(e){return{top:0,right:0,bottom:0,left:0,...e}}function gs(e){return typeof e!="number"?Eh(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function xs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=wo(t),l=yo(s),c=$e(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Th=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=xs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:_}=l[f],{x:v,y:w,data:j,reset:k}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=v??u,p=w??p,g={...g,[h]:{...g[h],...j}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(d=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:u,y:p}=xs(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function cr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Fe(t,e),b=gs(g),h=l[m?p==="floating"?"reference":"floating":p],_=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},k=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(_.top-k.top+b.top)/j.y,bottom:(k.bottom-_.bottom+b.bottom)/j.y,left:(_.left-k.left+b.left)/j.x,right:(k.right-_.right+b.right)/j.x}}const Ah=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Fe(e,t)||{};if(d==null)return{};const p=gs(u),m={x:r,y:n},g=wo(o),b=yo(g),f=await s.getDimensions(d),h=g==="y",_=h?"top":"left",v=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],k=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let C=N?N[w]:0;(!C||!await(s.isElement==null?void 0:s.isElement(N)))&&(C=l.floating[w]||i.floating[b]);const E=j/2-k/2,T=C/2-f[b]/2-1,A=Ge(p[_],T),O=Ge(p[v],T),R=A,L=C-f[b]-O,P=C/2-f[b]/2+E,M=_o(R,P,L),I=!c.arrow&&Tt(o)!=null&&P!==M&&i.reference[b]/2-(P<R?A:O)-f[b]/2<0,B=I?P<R?P-R:P-L:0;return{[g]:m[g]+B,data:{[g]:M,centerOffset:P-M-B,...I&&{alignmentOffset:B}},reset:I}}}),Ph=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=Fe(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const _=$e(o),v=Oe(l),w=$e(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=m||(w||!f?[Jr(l)]:jh(l)),N=b!=="none";!m&&N&&k.push(...Nh(l,f,b,j));const C=[l,...k],E=await cr(t,h),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[_]),p){const P=wh(o,s,j);T.push(E[P[0]],E[P[1]])}if(A=[...A,{placement:o,overflows:T}],!T.every(P=>P<=0)){var O,R;const P=(((O=i.flip)==null?void 0:O.index)||0)+1,M=C[P];if(M&&(!(p==="alignment"?v!==Oe(M):!1)||A.every(z=>Oe(z.placement)===v?z.overflows[0]>0:!0)))return{data:{index:P,overflows:A},reset:{placement:M}};let I=(R=A.filter(B=>B.overflows[0]<=0).sort((B,z)=>B.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!I)switch(g){case"bestFit":{var L;const B=(L=A.filter(z=>{if(N){const G=Oe(z.placement);return G===v||G==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(G=>G>0).reduce((G,ae)=>G+ae,0)]).sort((z,G)=>z[1]-G[1])[0])==null?void 0:L[0];B&&(I=B);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function bs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _s(e){return bh.some(t=>e[t]>=0)}const Oh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fe(e,t);switch(n){case"referenceHidden":{const i=await cr(t,{...o,elementContext:"reference"}),s=bs(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_s(s)}}}case"escaped":{const i=await cr(t,{...o,altBoundary:!0}),s=bs(i,r.floating);return{data:{escapedOffsets:s,escaped:_s(s)}}}default:return{}}}}},vs=new Set(["left","top"]);async function Rh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$e(r),l=Tt(r),c=Oe(r)==="y",d=vs.has(s)?-1:1,u=i&&c?-1:1,p=Fe(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const Lh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Rh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Ih=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:_,y:v}=h;return{x:_,y:v}}},...c}=Fe(e,t),d={x:r,y:n},u=await cr(t,c),p=Oe($e(o)),m=vo(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",_=m==="y"?"bottom":"right",v=g+u[h],w=g-u[_];g=_o(v,g,w)}if(s){const h=p==="y"?"top":"left",_=p==="y"?"bottom":"right",v=b+u[h],w=b-u[_];b=_o(v,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},zh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Fe(e,t),u={x:r,y:n},p=Oe(o),m=vo(p);let g=u[m],b=u[p];const f=Fe(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,k=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>k&&(g=k)}if(d){var _,v;const w=m==="y"?"width":"height",j=vs.has($e(o)),k=i.reference[p]-i.floating[w]+(j&&((_=s.offset)==null?void 0:_[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((v=s.offset)==null?void 0:v[p])||0)-(j?h.crossAxis:0);b<k?b=k:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Mh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Fe(e,t),u=await cr(t,d),p=$e(o),m=Tt(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,_;p==="top"||p==="bottom"?(h=p,_=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,h=m==="end"?"top":"bottom");const v=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],v),k=Ge(b-u[_],w),N=!t.middlewareData.shift;let C=j,E=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=v),N&&!m){const A=xe(u.left,0),O=xe(u.right,0),R=xe(u.top,0),L=xe(u.bottom,0);g?E=b-2*(A!==0||O!==0?A+O:xe(u.left,u.right)):C=f-2*(R!==0||L!==0?R+L:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:C});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function At(e){return ys(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ys(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ys(e){return Qr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Qr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Qr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function ws(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Dh=new Set(["inline","contents"]);function dr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Dh.has(o)}const Fh=new Set(["table","td","th"]);function $h(e){return Fh.has(At(e))}const Bh=[":popover-open",":modal"];function en(e){return Bh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Uh=["transform","translate","scale","rotate","perspective"],Hh=["transform","translate","scale","rotate","perspective","filter"],Vh=["paint","layout","strict","content"];function So(e){const t=ko(),r=je(e)?Se(e):e;return Uh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Hh.some(n=>(r.willChange||"").includes(n))||Vh.some(n=>(r.contain||"").includes(n))}function Wh(e){let t=Ke(e);for(;Le(t)&&!Pt(t);){if(So(t))return t;if(en(t))return null;t=Ke(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qh=new Set(["html","body","#document"]);function Pt(e){return qh.has(At(e))}function Se(e){return be(e).getComputedStyle(e)}function tn(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ws(e)&&e.host||Re(e);return ws(t)?t.host:t}function js(e){const t=Ke(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&dr(t)?t:js(t)}function ur(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=js(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=Co(s);return t.concat(s,s.visualViewport||[],dr(o)?o:[],l&&r?ur(l):[])}return t.concat(o,ur(o,[],r))}function Co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ss(e){const t=Se(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function No(e){return je(e)?e:e.contextElement}function Ot(e){const t=No(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Ss(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Gh=Pe(0);function ks(e){const t=be(e);return!ko()||!t.visualViewport?Gh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function pt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=No(e);let s=Pe(1);t&&(n?je(n)&&(s=Ot(n)):s=Ot(e));const l=Kh(i,r,n)?ks(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=Co(b);for(;f&&n&&g!==b;){const h=Ot(f),_=f.getBoundingClientRect(),v=Se(f),w=_.left+(f.clientLeft+parseFloat(v.paddingLeft))*h.x,j=_.top+(f.clientTop+parseFloat(v.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=Co(b)}}return Zr({width:u,height:p,x:c,y:d})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:pt(Re(e)).left+r}function Cs(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Yh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((At(n)!=="body"||dr(s))&&(c=tn(n)),Le(n))){const g=pt(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Cs(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Xh(e){return Array.from(e.getClientRects())}function Jh(e){const t=Re(e),r=tn(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return Se(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ns=25;function Zh(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=rn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Ns&&(i-=b)}else d<=Ns&&(i+=d);return{width:i,height:s,x:l,y:c}}const Qh=new Set(["absolute","fixed"]);function eg(e,t){const r=pt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Ot(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Es(e,t,r){let n;if(t==="viewport")n=Zh(e,r);else if(t==="document")n=Jh(Re(e));else if(je(t))n=eg(t,r);else{const o=ks(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function Ts(e,t){const r=Ke(e);return r===t||!je(r)||Pt(r)?!1:Se(r).position==="fixed"||Ts(r,t)}function tg(e,t){const r=t.get(e);if(r)return r;let n=ur(e,[],!1).filter(l=>je(l)&&At(l)!=="body"),o=null;const i=Se(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!Pt(s);){const l=Se(s),c=So(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&Qh.has(o.position)||dr(s)&&!c&&Ts(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function rg(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:tg(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Es(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Es(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ng(e){const{width:t,height:r}=Ss(e);return{width:t,height:r}}function og(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=pt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=rn(o)}if(n||!n&&!i)if((At(t)!=="body"||dr(o))&&(l=tn(t)),n){const g=pt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Cs(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function Eo(e){return Se(e).position==="static"}function As(e,t){if(!Le(e)||Se(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Ps(e,t){const r=be(e);if(en(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!Pt(o);){if(je(o)&&!Eo(o))return o;o=Ke(o)}return r}let n=As(e,t);for(;n&&$h(n)&&Eo(n);)n=As(n,t);return n&&Pt(n)&&Eo(n)&&!So(n)?r:n||Wh(e)||r}const ag=async function(e){const t=this.getOffsetParent||Ps,r=this.getDimensions,n=await r(e.floating);return{reference:og(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ig(e){return Se(e).direction==="rtl"}const sg={convertOffsetParentRelativeRectToViewportRelativeRect:Yh,getDocumentElement:Re,getClippingRect:rg,getOffsetParent:Ps,getElementRects:ag,getClientRects:Xh,getDimensions:ng,getScale:Ot,isElement:je,isRTL:ig};function Os(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lg(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Xr(p),f=Xr(o.clientWidth-(u+m)),h=Xr(o.clientHeight-(p+g)),_=Xr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-_+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function k(N){const C=N[0].intersectionRatio;if(C!==c){if(!j)return s();C?s(!1,C):n=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!Os(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(k,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(k,w)}r.observe(e)}return s(!0),i}function cg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=No(e),u=o||i?[...d?ur(d):[],...ur(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),i&&_.addEventListener("resize",r)});const p=d&&l?lg(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(_=>{let[v]=_;v&&v.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?pt(e):null;c&&h();function h(){const _=pt(e);f&&!Os(f,_)&&r(),f=_,b=requestAnimationFrame(h)}return r(),()=>{var _;u.forEach(v=>{o&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r)}),p?.(),(_=g)==null||_.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const dg=Lh,ug=Ih,pg=Ph,mg=Mh,fg=Oh,Rs=Ah,hg=zh,gg=(e,t,r)=>{const n=new Map,o={platform:sg,...r},i={...o.platform,_c:n};return Th(e,t,{...o,platform:i})};var xg=typeof document<"u",bg=function(){},nn=xg?y.useLayoutEffect:bg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ls(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Is(e,t){const r=Ls(e);return Math.round(t*r)/r}function To(e){const t=x.useRef(e);return nn(()=>{t.current=e}),t}function _g(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);on(m,n)||g(n);const[b,f]=x.useState(null),[h,_]=x.useState(null),v=x.useCallback(z=>{z!==N.current&&(N.current=z,f(z))},[]),w=x.useCallback(z=>{z!==C.current&&(C.current=z,_(z))},[]),j=i||b,k=s||h,N=x.useRef(null),C=x.useRef(null),E=x.useRef(u),T=c!=null,A=To(c),O=To(o),R=To(d),L=x.useCallback(()=>{if(!N.current||!C.current)return;const z={placement:t,strategy:r,middleware:m};O.current&&(z.platform=O.current),gg(N.current,C.current,z).then(G=>{const ae={...G,isPositioned:R.current!==!1};P.current&&!on(E.current,ae)&&(E.current=ae,_r.flushSync(()=>{p(ae)}))})},[m,t,r,O,R]);nn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[d]);const P=x.useRef(!1);nn(()=>(P.current=!0,()=>{P.current=!1}),[]),nn(()=>{if(j&&(N.current=j),k&&(C.current=k),j&&k){if(A.current)return A.current(j,k,L);L()}},[j,k,L,A,T]);const M=x.useMemo(()=>({reference:N,floating:C,setReference:v,setFloating:w}),[v,w]),I=x.useMemo(()=>({reference:j,floating:k}),[j,k]),B=x.useMemo(()=>{const z={position:r,left:0,top:0};if(!I.floating)return z;const G=Is(I.floating,u.x),ae=Is(I.floating,u.y);return l?{...z,transform:"translate("+G+"px, "+ae+"px)",...Ls(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:G,top:ae}},[r,l,I.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:L,refs:M,elements:I,floatingStyles:B}),[u,L,M,I,B])}const vg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Rs({element:n.current,padding:o}).fn(r):{}:n?Rs({element:n,padding:o}).fn(r):{}}}},yg=(e,t)=>({...dg(e),options:[e,t]}),wg=(e,t)=>({...ug(e),options:[e,t]}),jg=(e,t)=>({...hg(e),options:[e,t]}),Sg=(e,t)=>({...pg(e),options:[e,t]}),kg=(e,t)=>({...mg(e),options:[e,t]}),Cg=(e,t)=>({...fg(e),options:[e,t]}),Ng=(e,t)=>({...vg(e),options:[e,t]});var Eg="Arrow",zs=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});zs.displayName=Eg;var Tg=zs;function Ag(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ao="Popper",[Ms,an]=Ve(Ao),[Pg,Ds]=Ms(Ao),Fs=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Pg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Fs.displayName=Ao;var $s="PopperAnchor",Bs=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ds($s,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Bs.displayName=$s;var Po="PopperContent",[Og,Rg]=Ms(Po),Us=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Ds(Po,r),[_,v]=x.useState(null),w=J(t,$=>v($)),[j,k]=x.useState(null),N=Ag(j),C=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(d)?d:[d],R=O.length>0,L={padding:A,boundary:O.filter(Ig),altBoundary:R},{refs:P,floatingStyles:M,placement:I,isPositioned:B,middlewareData:z}=_g({strategy:"fixed",placement:T,whileElementsMounted:(...$)=>cg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[yg({mainAxis:o+E,alignmentAxis:s}),c&&wg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?jg():void 0,...L}),c&&Sg({...L}),kg({...L,apply:({elements:$,rects:Y,availableWidth:oe,availableHeight:Z})=>{const{width:Q,height:re}=Y.reference,ve=$.floating.style;ve.setProperty("--radix-popper-available-width",`${oe}px`),ve.setProperty("--radix-popper-available-height",`${Z}px`),ve.setProperty("--radix-popper-anchor-width",`${Q}px`),ve.setProperty("--radix-popper-anchor-height",`${re}px`)}}),j&&Ng({element:j,padding:l}),zg({arrowWidth:C,arrowHeight:E}),m&&Cg({strategy:"referenceHidden",...L})]}),[G,ae]=Ws(I),ie=We(b);le(()=>{B&&ie?.()},[B,ie]);const ge=z.arrow?.x,_e=z.arrow?.y,pe=z.arrow?.centerOffset!==0,[K,de]=x.useState();return le(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),a.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:B?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Og,{scope:r,placedSide:G,onArrowChange:k,arrowX:ge,arrowY:_e,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":G,"data-align":ae,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Us.displayName=Po;var Hs="PopperArrow",Lg={top:"bottom",right:"left",bottom:"top",left:"right"},Vs=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Rg(Hs,n),s=Lg[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Tg,{...o,ref:r,style:{...o.style,display:"block"}})})});Vs.displayName=Hs;function Ig(e){return e!==null}var zg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Ws(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function Ws(e){const[t,r="center"]=e.split("-");return[t,r]}var qs=Fs,Oo=Bs,Gs=Us,Ks=Vs,Mg="Portal",sn=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ya.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=Mg;function Dg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=Fg(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,$g(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function Fg(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Dg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=ln(n.current);i.current=l==="mounted"?d:"none"},[l]),le(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),le(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function ln(e){return e?.animationName||"none"}function $g(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Bg=x[" useInsertionEffect ".trim().toString()]||le;function mt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Ug({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=Hg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Ug({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Bg(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Hg(e){return typeof e=="function"}var Vg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,cn=new WeakMap,dn={},Ro=0,Ys=function(e){return e&&(e.host||Ys(e.parentNode))},Wg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ys(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},qg=function(e,t,r,n){var o=Wg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,h=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,h),s.push(m),f===1&&b&&cn.set(m,!0),h===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return u(t),l.clear(),Ro++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),Ro--,Ro||(Rt=new WeakMap,Rt=new WeakMap,cn=new WeakMap,dn={})}},Lo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Vg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),qg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Xs(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Gg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Kg="with-scroll-bars-hidden",Yg="--removed-body-scroll-bar-size";function Io(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Xg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Jg=typeof window<"u"?x.useLayoutEffect:x.useEffect,Js=new WeakMap;function Zg(e,t){var r=Xg(null,function(n){return e.forEach(function(o){return Io(o,n)})});return Jg(function(){var n=Js.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||Io(l,null)}),i.forEach(function(l){o.has(l)||Io(l,s)})}Js.set(r,e)},[e]),r}function Qg(e){return e}function ex(e,t){t===void 0&&(t=Qg);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function tx(e){e===void 0&&(e={});var t=ex(null);return t.options=Ie({async:!0,ssr:!1},e),t}var Zs=function(e){var t=e.sideCar,r=Xs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};Zs.isSideCarExport=!0;function rx(e,t){return e.useMedium(t),Zs}var Qs=tx(),zo=function(){},mn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:zo,onWheelCapture:zo,onTouchMoveCapture:zo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,_=e.as,v=_===void 0?"div":_,w=e.gapMode,j=Xs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=m,N=Zg([r,t]),C=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(k,{sideCar:Qs,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},C),{ref:N})):x.createElement(v,Ie({},C,{className:c,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var nx=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ox(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nx();return t&&e.setAttribute("nonce",t),e}function ax(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ix(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ox())&&(ax(t,r),ix(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lx=function(){var e=sx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},el=function(){var e=lx(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},cx={left:0,top:0,right:0,gap:0},Mo=function(e){return parseInt(e||"",10)||0},dx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Mo(r),Mo(n),Mo(o)]},ux=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cx;var t=dx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},px=el(),Lt="data-scroll-locked",mx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
    324   .`.concat(Kg,` {
     238 */const ae=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(If,{ref:i,iconNode:t,className:rs(`lucide-${Pf(ts(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ts(e),r};/**
     239 * @license lucide-react v0.552.0 - ISC
     240 *
     241 * This source code is licensed under the ISC license.
     242 * See the LICENSE file in the root directory of this source tree.
     243 */const zf=ae("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
     244 * @license lucide-react v0.552.0 - ISC
     245 *
     246 * This source code is licensed under the ISC license.
     247 * See the LICENSE file in the root directory of this source tree.
     248 */const mo=ae("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
     249 * @license lucide-react v0.552.0 - ISC
     250 *
     251 * This source code is licensed under the ISC license.
     252 * See the LICENSE file in the root directory of this source tree.
     253 */const Mf=ae("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
     254 * @license lucide-react v0.552.0 - ISC
     255 *
     256 * This source code is licensed under the ISC license.
     257 * See the LICENSE file in the root directory of this source tree.
     258 */const Df=ae("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
     259 * @license lucide-react v0.552.0 - ISC
     260 *
     261 * This source code is licensed under the ISC license.
     262 * See the LICENSE file in the root directory of this source tree.
     263 */const Ff=ae("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
     264 * @license lucide-react v0.552.0 - ISC
     265 *
     266 * This source code is licensed under the ISC license.
     267 * See the LICENSE file in the root directory of this source tree.
     268 */const $f=ae("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
     269 * @license lucide-react v0.552.0 - ISC
     270 *
     271 * This source code is licensed under the ISC license.
     272 * See the LICENSE file in the root directory of this source tree.
     273 */const Bf=ae("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
     274 * @license lucide-react v0.552.0 - ISC
     275 *
     276 * This source code is licensed under the ISC license.
     277 * See the LICENSE file in the root directory of this source tree.
     278 */const Uf=ae("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
     279 * @license lucide-react v0.552.0 - ISC
     280 *
     281 * This source code is licensed under the ISC license.
     282 * See the LICENSE file in the root directory of this source tree.
     283 */const Hf=ae("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
     284 * @license lucide-react v0.552.0 - ISC
     285 *
     286 * This source code is licensed under the ISC license.
     287 * See the LICENSE file in the root directory of this source tree.
     288 */const Vf=ae("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
     289 * @license lucide-react v0.552.0 - ISC
     290 *
     291 * This source code is licensed under the ISC license.
     292 * See the LICENSE file in the root directory of this source tree.
     293 */const Wf=ae("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
     294 * @license lucide-react v0.552.0 - ISC
     295 *
     296 * This source code is licensed under the ISC license.
     297 * See the LICENSE file in the root directory of this source tree.
     298 */const qf=ae("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
     299 * @license lucide-react v0.552.0 - ISC
     300 *
     301 * This source code is licensed under the ISC license.
     302 * See the LICENSE file in the root directory of this source tree.
     303 */const Gf=ae("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
     304 * @license lucide-react v0.552.0 - ISC
     305 *
     306 * This source code is licensed under the ISC license.
     307 * See the LICENSE file in the root directory of this source tree.
     308 */const Kf=ae("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
     309 * @license lucide-react v0.552.0 - ISC
     310 *
     311 * This source code is licensed under the ISC license.
     312 * See the LICENSE file in the root directory of this source tree.
     313 */const Yf=ae("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
     314 * @license lucide-react v0.552.0 - ISC
     315 *
     316 * This source code is licensed under the ISC license.
     317 * See the LICENSE file in the root directory of this source tree.
     318 */const Xf=ae("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
     319 * @license lucide-react v0.552.0 - ISC
     320 *
     321 * This source code is licensed under the ISC license.
     322 * See the LICENSE file in the root directory of this source tree.
     323 */const Jf=ae("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
     324 * @license lucide-react v0.552.0 - ISC
     325 *
     326 * This source code is licensed under the ISC license.
     327 * See the LICENSE file in the root directory of this source tree.
     328 */const ns=ae("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Zf(e,t){const r=x.createContext(t),n=i=>{const{children:s,...l}=i,c=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=x.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function Ve(e,t=[]){let r=[];function n(i,s){const l=x.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[c]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>x.createContext(s));return function(l){const c=l?.[e]||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,Qf(o,...t)]}function Qf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var eh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=eh.reduce((e,t)=>{const r=st(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function th(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}function We(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function rh(e,t=globalThis?.document){const r=We(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var nh="DismissableLayer",fo="dismissableLayer.update",oh="dismissableLayer.pointerDownOutside",ah="dismissableLayer.focusOutside",os,as=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=x.useContext(as),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=J(t,C=>p(C)),f=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),_=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=_>=v,k=lh(C=>{const E=C.target,T=[...d.branches].some(O=>O.contains(E));!j||T||(o?.(C),s?.(C),C.defaultPrevented||l?.())},m),N=ch(C=>{const E=C.target;[...d.branches].some(O=>O.contains(E))||(i?.(C),s?.(C),C.defaultPrevented||l?.())},m);return rh(C=>{_===d.layers.size-1&&(n?.(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(os=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),is(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=os)}},[u,m,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),is())},[u,d]),x.useEffect(()=>{const C=()=>g({});return document.addEventListener(fo,C),()=>document.removeEventListener(fo,C)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,k.onPointerDownCapture)})});Gr.displayName=nh;var ih="DismissableLayerBranch",sh=x.forwardRef((e,t)=>{const r=x.useContext(as),n=x.useRef(null),o=J(t,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});sh.displayName=ih;function lh(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ss(oh,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ch(e,t=globalThis?.document){const r=We(e),n=x.useRef(!1);return x.useEffect(()=>{const o=i=>{i.target&&!n.current&&ss(ah,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function is(){const e=new CustomEvent(fo);document.dispatchEvent(e)}function ss(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?th(o,i):o.dispatchEvent(i)}var ho=0;function go(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ls()),document.body.insertAdjacentElement("beforeend",e[1]??ls()),ho++,()=>{ho===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ho--}},[])}function ls(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xo="focusScope.autoFocusOnMount",bo="focusScope.autoFocusOnUnmount",cs={bubbles:!1,cancelable:!0},dh="FocusScope",Kr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=x.useState(null),d=We(o),u=We(i),p=x.useRef(null),m=J(t,f=>c(f)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:qe(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||qe(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&qe(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",h);const _=new MutationObserver(v);return l&&_.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),_.disconnect()}}},[n,l,g.paused]),x.useEffect(()=>{if(l){ps.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(xo,cs);l.addEventListener(xo,d),l.dispatchEvent(v),v.defaultPrevented||(uh(gh(ds(l)),{select:!0}),document.activeElement===f&&qe(l))}return()=>{l.removeEventListener(xo,d),setTimeout(()=>{const v=new CustomEvent(bo,cs);l.addEventListener(bo,u),l.dispatchEvent(v),v.defaultPrevented||qe(f??document.body,{select:!0}),l.removeEventListener(bo,u),ps.remove(g)},0)}}},[l,d,u,g]);const b=x.useCallback(f=>{if(!r&&!n||g.paused)return;const h=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(h&&v){const _=f.currentTarget,[w,j]=ph(_);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&qe(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&qe(j,{select:!0})):v===_&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Kr.displayName=dh;function uh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(qe(n,{select:t}),document.activeElement!==r)return}function ph(e){const t=ds(e),r=us(t,e),n=us(t.reverse(),e);return[r,n]}function ds(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function us(e,t){for(const r of e)if(!mh(r,{upTo:t}))return r}function mh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fh(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&fh(e)&&t&&e.select()}}var ps=hh();function hh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=ms(e,t),e.unshift(t)},remove(t){e=ms(e,t),e[0]?.resume()}}}function ms(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function gh(e){return e.filter(t=>t.tagName!=="A")}var le=globalThis?.document?x.useLayoutEffect:()=>{},xh=x[" useId ".trim().toString()]||(()=>{}),bh=0;function Ae(e){const[t,r]=x.useState(xh());return le(()=>{r(n=>n??String(bh++))},[e]),e||(t?`radix-${t}`:"")}const vh=["top","right","bottom","left"],Ge=Math.min,xe=Math.max,Yr=Math.round,Xr=Math.floor,Pe=e=>({x:e,y:e}),_h={left:"right",right:"left",bottom:"top",top:"bottom"},yh={start:"end",end:"start"};function vo(e,t,r){return xe(e,Ge(t,r))}function Fe(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function _o(e){return e==="x"?"y":"x"}function yo(e){return e==="y"?"height":"width"}const wh=new Set(["top","bottom"]);function Oe(e){return wh.has($e(e))?"y":"x"}function wo(e){return _o(Oe(e))}function jh(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=wo(e),i=yo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function Sh(e){const t=Jr(e);return[jo(e),t,jo(t)]}function jo(e){return e.replace(/start|end/g,t=>yh[t])}const fs=["left","right"],hs=["right","left"],kh=["top","bottom"],Ch=["bottom","top"];function Nh(e,t,r){switch(e){case"top":case"bottom":return r?t?hs:fs:t?fs:hs;case"left":case"right":return t?kh:Ch;default:return[]}}function Eh(e,t,r,n){const o=Tt(e);let i=Nh($e(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(jo)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>_h[t])}function Th(e){return{top:0,right:0,bottom:0,left:0,...e}}function gs(e){return typeof e!="number"?Th(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function xs(e,t,r){let{reference:n,floating:o}=e;const i=Oe(t),s=wo(t),l=yo(s),c=$e(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Ah=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=xs(d,n,c),m=n,g={},b=0;for(let f=0;f<l.length;f++){const{name:h,fn:v}=l[f],{x:_,y:w,data:j,reset:k}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=_??u,p=w??p,g={...g,[h]:{...g[h],...j}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(d=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:u,y:p}=xs(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function cr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Fe(t,e),b=gs(g),h=l[m?p==="floating"?"reference":"floating":p],v=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),_=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},k=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:w,strategy:c}):_);return{top:(v.top-k.top+b.top)/j.y,bottom:(k.bottom-v.bottom+b.bottom)/j.y,left:(v.left-k.left+b.left)/j.x,right:(k.right-v.right+b.right)/j.x}}const Ph=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Fe(e,t)||{};if(d==null)return{};const p=gs(u),m={x:r,y:n},g=wo(o),b=yo(g),f=await s.getDimensions(d),h=g==="y",v=h?"top":"left",_=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=i.reference[b]+i.reference[g]-m[g]-i.floating[b],k=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let C=N?N[w]:0;(!C||!await(s.isElement==null?void 0:s.isElement(N)))&&(C=l.floating[w]||i.floating[b]);const E=j/2-k/2,T=C/2-f[b]/2-1,O=Ge(p[v],T),R=Ge(p[_],T),L=O,A=C-f[b]-R,P=C/2-f[b]/2+E,z=vo(L,P,A),I=!c.arrow&&Tt(o)!=null&&P!==z&&i.reference[b]/2-(P<L?O:R)-f[b]/2<0,B=I?P<L?P-L:P-A:0;return{[g]:m[g]+B,data:{[g]:z,centerOffset:P-z-B,...I&&{alignmentOffset:B}},reset:I}}}),Oh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=Fe(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=$e(o),_=Oe(l),w=$e(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=m||(w||!f?[Jr(l)]:Sh(l)),N=b!=="none";!m&&N&&k.push(...Eh(l,f,b,j));const C=[l,...k],E=await cr(t,h),T=[];let O=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const P=jh(o,s,j);T.push(E[P[0]],E[P[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(P=>P<=0)){var R,L;const P=(((R=i.flip)==null?void 0:R.index)||0)+1,z=C[P];if(z&&(!(p==="alignment"?_!==Oe(z):!1)||O.every(M=>Oe(M.placement)===_?M.overflows[0]>0:!0)))return{data:{index:P,overflows:O},reset:{placement:z}};let I=(L=O.filter(B=>B.overflows[0]<=0).sort((B,M)=>B.overflows[1]-M.overflows[1])[0])==null?void 0:L.placement;if(!I)switch(g){case"bestFit":{var A;const B=(A=O.filter(M=>{if(N){const G=Oe(M.placement);return G===_||G==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(G=>G>0).reduce((G,ie)=>G+ie,0)]).sort((M,G)=>M[1]-G[1])[0])==null?void 0:A[0];B&&(I=B);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function bs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vs(e){return vh.some(t=>e[t]>=0)}const Rh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Fe(e,t);switch(n){case"referenceHidden":{const i=await cr(t,{...o,elementContext:"reference"}),s=bs(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:vs(s)}}}case"escaped":{const i=await cr(t,{...o,altBoundary:!0}),s=bs(i,r.floating);return{data:{escapedOffsets:s,escaped:vs(s)}}}default:return{}}}}},_s=new Set(["left","top"]);async function Lh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$e(r),l=Tt(r),c=Oe(r)==="y",d=_s.has(s)?-1:1,u=i&&c?-1:1,p=Fe(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const Ih=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Lh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},zh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:h=>{let{x:v,y:_}=h;return{x:v,y:_}}},...c}=Fe(e,t),d={x:r,y:n},u=await cr(t,c),p=Oe($e(o)),m=_o(p);let g=d[m],b=d[p];if(i){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",_=g+u[h],w=g-u[v];g=vo(_,g,w)}if(s){const h=p==="y"?"top":"left",v=p==="y"?"bottom":"right",_=b+u[h],w=b-u[v];b=vo(_,b,w)}const f=l.fn({...t,[m]:g,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Mh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Fe(e,t),u={x:r,y:n},p=Oe(o),m=_o(p);let g=u[m],b=u[p];const f=Fe(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=i.reference[m]-i.floating[w]+h.mainAxis,k=i.reference[m]+i.reference[w]-h.mainAxis;g<j?g=j:g>k&&(g=k)}if(d){var v,_;const w=m==="y"?"width":"height",j=_s.has($e(o)),k=i.reference[p]-i.floating[w]+(j&&((v=s.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=i.reference[p]+i.reference[w]+(j?0:((_=s.offset)==null?void 0:_[p])||0)-(j?h.crossAxis:0);b<k?b=k:b>N&&(b=N)}return{[m]:g,[p]:b}}}},Dh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Fe(e,t),u=await cr(t,d),p=$e(o),m=Tt(o),g=Oe(o)==="y",{width:b,height:f}=i.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,h=m==="end"?"top":"bottom");const _=f-u.top-u.bottom,w=b-u.left-u.right,j=Ge(f-u[h],_),k=Ge(b-u[v],w),N=!t.middlewareData.shift;let C=j,E=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=_),N&&!m){const O=xe(u.left,0),R=xe(u.right,0),L=xe(u.top,0),A=xe(u.bottom,0);g?E=b-2*(O!==0||R!==0?O+R:xe(u.left,u.right)):C=f-2*(L!==0||A!==0?L+A:xe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:C});const T=await s.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function At(e){return ys(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ys(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ys(e){return Qr()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return Qr()?e instanceof Element||e instanceof be(e).Element:!1}function Le(e){return Qr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function ws(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Fh=new Set(["inline","contents"]);function dr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Fh.has(o)}const $h=new Set(["table","td","th"]);function Bh(e){return $h.has(At(e))}const Uh=[":popover-open",":modal"];function en(e){return Uh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Hh=["transform","translate","scale","rotate","perspective"],Vh=["transform","translate","scale","rotate","perspective","filter"],Wh=["paint","layout","strict","content"];function So(e){const t=ko(),r=je(e)?Se(e):e;return Hh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Vh.some(n=>(r.willChange||"").includes(n))||Wh.some(n=>(r.contain||"").includes(n))}function qh(e){let t=Ke(e);for(;Le(t)&&!Pt(t);){if(So(t))return t;if(en(t))return null;t=Ke(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Gh=new Set(["html","body","#document"]);function Pt(e){return Gh.has(At(e))}function Se(e){return be(e).getComputedStyle(e)}function tn(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ws(e)&&e.host||Re(e);return ws(t)?t.host:t}function js(e){const t=Ke(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&dr(t)?t:js(t)}function ur(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=js(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=be(o);if(i){const l=Co(s);return t.concat(s,s.visualViewport||[],dr(o)?o:[],l&&r?ur(l):[])}return t.concat(o,ur(o,[],r))}function Co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ss(e){const t=Se(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Le(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function No(e){return je(e)?e:e.contextElement}function Ot(e){const t=No(e);if(!Le(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Ss(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Kh=Pe(0);function ks(e){const t=be(e);return!ko()||!t.visualViewport?Kh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function pt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=No(e);let s=Pe(1);t&&(n?je(n)&&(s=Ot(n)):s=Ot(e));const l=Yh(i,r,n)?ks(i):Pe(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=be(i),g=n&&je(n)?be(n):n;let b=m,f=Co(b);for(;f&&n&&g!==b;){const h=Ot(f),v=f.getBoundingClientRect(),_=Se(f),w=v.left+(f.clientLeft+parseFloat(_.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(_.paddingTop))*h.y;c*=h.x,d*=h.y,u*=h.x,p*=h.y,c+=w,d+=j,b=be(f),f=Co(b)}}return Zr({width:u,height:p,x:c,y:d})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:pt(Re(e)).left+r}function Cs(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Xh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Re(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Pe(1);const u=Pe(0),p=Le(n);if((p||!p&&!i)&&((At(n)!=="body"||dr(s))&&(c=tn(n)),Le(n))){const g=pt(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?Cs(s,c):Pe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Jh(e){return Array.from(e.getClientRects())}function Zh(e){const t=Re(e),r=tn(e),n=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=xe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return Se(n).direction==="rtl"&&(s+=xe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ns=25;function Qh(e,t){const r=be(e),n=Re(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=rn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Ns&&(i-=b)}else d<=Ns&&(i+=d);return{width:i,height:s,x:l,y:c}}const eg=new Set(["absolute","fixed"]);function tg(e,t){const r=pt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Le(e)?Ot(e):Pe(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function Es(e,t,r){let n;if(t==="viewport")n=Qh(e,r);else if(t==="document")n=Zh(Re(e));else if(je(t))n=tg(t,r);else{const o=ks(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function Ts(e,t){const r=Ke(e);return r===t||!je(r)||Pt(r)?!1:Se(r).position==="fixed"||Ts(r,t)}function rg(e,t){const r=t.get(e);if(r)return r;let n=ur(e,[],!1).filter(l=>je(l)&&At(l)!=="body"),o=null;const i=Se(e).position==="fixed";let s=i?Ke(e):e;for(;je(s)&&!Pt(s);){const l=Se(s),c=So(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&eg.has(o.position)||dr(s)&&!c&&Ts(e,s))?n=n.filter(u=>u!==s):o=l,s=Ke(s)}return t.set(e,n),n}function ng(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:rg(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=Es(t,u,o);return d.top=xe(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},Es(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function og(e){const{width:t,height:r}=Ss(e);return{width:t,height:r}}function ag(e,t,r){const n=Le(t),o=Re(t),i=r==="fixed",s=pt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Pe(0);function d(){c.x=rn(o)}if(n||!n&&!i)if((At(t)!=="body"||dr(o))&&(l=tn(t)),n){const g=pt(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Cs(o,l):Pe(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function Eo(e){return Se(e).position==="static"}function As(e,t){if(!Le(e)||Se(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function Ps(e,t){const r=be(e);if(en(e))return r;if(!Le(e)){let o=Ke(e);for(;o&&!Pt(o);){if(je(o)&&!Eo(o))return o;o=Ke(o)}return r}let n=As(e,t);for(;n&&Bh(n)&&Eo(n);)n=As(n,t);return n&&Pt(n)&&Eo(n)&&!So(n)?r:n||qh(e)||r}const ig=async function(e){const t=this.getOffsetParent||Ps,r=this.getDimensions,n=await r(e.floating);return{reference:ag(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function sg(e){return Se(e).direction==="rtl"}const lg={convertOffsetParentRelativeRectToViewportRelativeRect:Xh,getDocumentElement:Re,getClippingRect:ng,getOffsetParent:Ps,getElementRects:ig,getClientRects:Jh,getDimensions:og,getScale:Ot,isElement:je,isRTL:sg};function Os(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cg(e,t){let r=null,n;const o=Re(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const b=Xr(p),f=Xr(o.clientWidth-(u+m)),h=Xr(o.clientHeight-(p+g)),v=Xr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:xe(0,Ge(1,c))||1};let j=!0;function k(N){const C=N[0].intersectionRatio;if(C!==c){if(!j)return s();C?s(!1,C):n=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!Os(d,e.getBoundingClientRect())&&s(),j=!1}try{r=new IntersectionObserver(k,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(k,w)}r.observe(e)}return s(!0),i}function dg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=No(e),u=o||i?[...d?ur(d):[],...ur(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const p=d&&l?cg(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(v=>{let[_]=v;_&&_.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let b,f=c?pt(e):null;c&&h();function h(){const v=pt(e);f&&!Os(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(_=>{o&&_.removeEventListener("scroll",r),i&&_.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(b)}}const ug=Ih,pg=zh,mg=Oh,fg=Dh,hg=Rh,Rs=Ph,gg=Mh,xg=(e,t,r)=>{const n=new Map,o={platform:lg,...r},i={...o.platform,_c:n};return Ah(e,t,{...o,platform:i})};var bg=typeof document<"u",vg=function(){},nn=bg?y.useLayoutEffect:vg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ls(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Is(e,t){const r=Ls(e);return Math.round(t*r)/r}function To(e){const t=x.useRef(e);return nn(()=>{t.current=e}),t}function _g(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);on(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),_=x.useCallback(M=>{M!==N.current&&(N.current=M,f(M))},[]),w=x.useCallback(M=>{M!==C.current&&(C.current=M,v(M))},[]),j=i||b,k=s||h,N=x.useRef(null),C=x.useRef(null),E=x.useRef(u),T=c!=null,O=To(c),R=To(o),L=To(d),A=x.useCallback(()=>{if(!N.current||!C.current)return;const M={placement:t,strategy:r,middleware:m};R.current&&(M.platform=R.current),xg(N.current,C.current,M).then(G=>{const ie={...G,isPositioned:L.current!==!1};P.current&&!on(E.current,ie)&&(E.current=ie,vr.flushSync(()=>{p(ie)}))})},[m,t,r,R,L]);nn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(M=>({...M,isPositioned:!1})))},[d]);const P=x.useRef(!1);nn(()=>(P.current=!0,()=>{P.current=!1}),[]),nn(()=>{if(j&&(N.current=j),k&&(C.current=k),j&&k){if(O.current)return O.current(j,k,A);A()}},[j,k,A,O,T]);const z=x.useMemo(()=>({reference:N,floating:C,setReference:_,setFloating:w}),[_,w]),I=x.useMemo(()=>({reference:j,floating:k}),[j,k]),B=x.useMemo(()=>{const M={position:r,left:0,top:0};if(!I.floating)return M;const G=Is(I.floating,u.x),ie=Is(I.floating,u.y);return l?{...M,transform:"translate("+G+"px, "+ie+"px)",...Ls(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:G,top:ie}},[r,l,I.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:A,refs:z,elements:I,floatingStyles:B}),[u,A,z,I,B])}const yg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Rs({element:n.current,padding:o}).fn(r):{}:n?Rs({element:n,padding:o}).fn(r):{}}}},wg=(e,t)=>({...ug(e),options:[e,t]}),jg=(e,t)=>({...pg(e),options:[e,t]}),Sg=(e,t)=>({...gg(e),options:[e,t]}),kg=(e,t)=>({...mg(e),options:[e,t]}),Cg=(e,t)=>({...fg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...yg(e),options:[e,t]});var Tg="Arrow",zs=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});zs.displayName=Tg;var Ag=zs;function Pg(e){const[t,r]=x.useState(void 0);return le(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ao="Popper",[Ms,an]=Ve(Ao),[Og,Ds]=Ms(Ao),Fs=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Og,{scope:t,anchor:n,onAnchorChange:o,children:r})};Fs.displayName=Ao;var $s="PopperAnchor",Bs=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ds($s,r),s=x.useRef(null),l=J(t,s),c=x.useRef(null);return x.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Bs.displayName=$s;var Po="PopperContent",[Rg,Lg]=Ms(Po),Us=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Ds(Po,r),[v,_]=x.useState(null),w=J(t,$=>_($)),[j,k]=x.useState(null),N=Pg(j),C=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(d)?d:[d],L=R.length>0,A={padding:O,boundary:R.filter(zg),altBoundary:L},{refs:P,floatingStyles:z,placement:I,isPositioned:B,middlewareData:M}=_g({strategy:"fixed",placement:T,whileElementsMounted:(...$)=>dg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[wg({mainAxis:o+E,alignmentAxis:s}),c&&jg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Sg():void 0,...A}),c&&kg({...A}),Cg({...A,apply:({elements:$,rects:Y,availableWidth:oe,availableHeight:Z})=>{const{width:Q,height:re}=Y.reference,_e=$.floating.style;_e.setProperty("--radix-popper-available-width",`${oe}px`),_e.setProperty("--radix-popper-available-height",`${Z}px`),_e.setProperty("--radix-popper-anchor-width",`${Q}px`),_e.setProperty("--radix-popper-anchor-height",`${re}px`)}}),j&&Eg({element:j,padding:l}),Mg({arrowWidth:C,arrowHeight:E}),m&&Ng({strategy:"referenceHidden",...A})]}),[G,ie]=Ws(I),se=We(b);le(()=>{B&&se?.()},[B,se]);const ge=M.arrow?.x,ve=M.arrow?.y,pe=M.arrow?.centerOffset!==0,[K,de]=x.useState();return le(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:B?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(" "),...M.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Rg,{scope:r,placedSide:G,onArrowChange:k,arrowX:ge,arrowY:ve,shouldHideArrow:pe,children:a.jsx(W.div,{"data-side":G,"data-align":ie,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Us.displayName=Po;var Hs="PopperArrow",Ig={top:"bottom",right:"left",bottom:"top",left:"right"},Vs=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Lg(Hs,n),s=Ig[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Ag,{...o,ref:r,style:{...o.style,display:"block"}})})});Vs.displayName=Hs;function zg(e){return e!==null}var Mg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Ws(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=s?p:`${m}px`,f=`${-c}px`):d==="top"?(b=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:b,y:f}}}});function Ws(e){const[t,r="center"]=e.split("-");return[t,r]}var qs=Fs,Oo=Bs,Gs=Us,Ks=Vs,Dg="Portal",sn=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=x.useState(!1);le(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ya.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=Dg;function Fg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ye=e=>{const{present:t,children:r}=e,n=$g(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=J(n.ref,Bg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:i}):null};Ye.displayName="Presence";function $g(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Fg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=ln(n.current);i.current=l==="mounted"?d:"none"},[l]),le(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),le(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function ln(e){return e?.animationName||"none"}function Bg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ug=x[" useInsertionEffect ".trim().toString()]||le;function mt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Hg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=x.useRef(e!==void 0);x.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=x.useCallback(u=>{if(l){const p=Vg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Hg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),i=x.useRef(t);return Ug(()=>{i.current=t},[t]),x.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Vg(e){return typeof e=="function"}var Wg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,cn=new WeakMap,dn={},Ro=0,Ys=function(e){return e&&(e.host||Ys(e.parentNode))},qg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ys(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Gg=function(e,t,r,n){var o=qg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,h=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,h),s.push(m),f===1&&b&&cn.set(m,!0),h===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return u(t),l.clear(),Ro++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),Ro--,Ro||(Rt=new WeakMap,Rt=new WeakMap,cn=new WeakMap,dn={})}},Lo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Wg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Gg(n,o,r,"aria-hidden")):function(){return null}},Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ie.apply(this,arguments)};function Xs(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Kg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Yg="with-scroll-bars-hidden",Xg="--removed-body-scroll-bar-size";function Io(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Jg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Zg=typeof window<"u"?x.useLayoutEffect:x.useEffect,Js=new WeakMap;function Qg(e,t){var r=Jg(null,function(n){return e.forEach(function(o){return Io(o,n)})});return Zg(function(){var n=Js.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||Io(l,null)}),i.forEach(function(l){o.has(l)||Io(l,s)})}Js.set(r,e)},[e]),r}function ex(e){return e}function tx(e,t){t===void 0&&(t=ex);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function rx(e){e===void 0&&(e={});var t=tx(null);return t.options=Ie({async:!0,ssr:!1},e),t}var Zs=function(e){var t=e.sideCar,r=Xs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Ie({},r))};Zs.isSideCarExport=!0;function nx(e,t){return e.useMedium(t),Zs}var Qs=rx(),zo=function(){},mn=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:zo,onWheelCapture:zo,onTouchMoveCapture:zo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,b=e.noIsolation,f=e.inert,h=e.allowPinchZoom,v=e.as,_=v===void 0?"div":v,w=e.gapMode,j=Xs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=m,N=Qg([r,t]),C=Ie(Ie({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(k,{sideCar:Qs,removeScrollBar:d,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:w}),s?x.cloneElement(x.Children.only(l),Ie(Ie({},C),{ref:N})):x.createElement(_,Ie({},C,{className:c,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var ox=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ax(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ox();return t&&e.setAttribute("nonce",t),e}function ix(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ax())&&(ix(t,r),sx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cx=function(){var e=lx();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},el=function(){var e=cx(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},dx={left:0,top:0,right:0,gap:0},Mo=function(e){return parseInt(e||"",10)||0},ux=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Mo(r),Mo(n),Mo(o)]},px=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dx;var t=ux(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},mx=el(),Lt="data-scroll-locked",fx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
     329  .`.concat(Yg,` {
    325330   overflow: hidden `).concat(n,`;
    326331   padding-right: `).concat(l,"px ").concat(n,`;
     
    356361 
    357362  body[`).concat(Lt,`] {
    358     `).concat(Yg,": ").concat(l,`px;
    359   }
    360 `)},tl=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0},fx=function(){x.useEffect(function(){return document.body.setAttribute(Lt,(tl()+1).toString()),function(){var e=tl()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},hx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;fx();var i=x.useMemo(function(){return ux(o)},[o]);return x.createElement(px,{styles:mx(i,!t,o,r?"":"!important")})},Do=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Do=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Do=!1}var It=Do?{passive:!1}:!1,gx=function(e){return e.tagName==="TEXTAREA"},rl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!gx(e)&&r[t]==="visible")},xx=function(e){return rl(e,"overflowY")},bx=function(e){return rl(e,"overflowX")},nl=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=ol(e,n);if(o){var i=al(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},_x=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},vx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},ol=function(e,t){return e==="v"?xx(t):bx(t)},al=function(e,t){return e==="v"?_x(t):vx(t)},yx=function(e,t){return e==="h"&&t==="rtl"?-1:1},wx=function(e,t,r,n,o){var i=yx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=al(e,l),b=g[0],f=g[1],h=g[2],_=f-h-i*b;(b||_)&&ol(e,l)&&(p+=_,m+=b);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},il=function(e){return[e.deltaX,e.deltaY]},sl=function(e){return e&&"current"in e?e.current:e},jx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sx=function(e){return`
     363    `).concat(Xg,": ").concat(l,`px;
     364  }
     365`)},tl=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0},hx=function(){x.useEffect(function(){return document.body.setAttribute(Lt,(tl()+1).toString()),function(){var e=tl()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},gx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;hx();var i=x.useMemo(function(){return px(o)},[o]);return x.createElement(mx,{styles:fx(i,!t,o,r?"":"!important")})},Do=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Do=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Do=!1}var It=Do?{passive:!1}:!1,xx=function(e){return e.tagName==="TEXTAREA"},rl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!xx(e)&&r[t]==="visible")},bx=function(e){return rl(e,"overflowY")},vx=function(e){return rl(e,"overflowX")},nl=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=ol(e,n);if(o){var i=al(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},_x=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},yx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},ol=function(e,t){return e==="v"?bx(t):vx(t)},al=function(e,t){return e==="v"?_x(t):yx(t)},wx=function(e,t){return e==="h"&&t==="rtl"?-1:1},jx=function(e,t,r,n,o){var i=wx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=al(e,l),b=g[0],f=g[1],h=g[2],v=f-h-i*b;(b||v)&&ol(e,l)&&(p+=v,m+=b);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},il=function(e){return[e.deltaX,e.deltaY]},sl=function(e){return e&&"current"in e?e.current:e},Sx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kx=function(e){return`
    361366  .block-interactivity-`.concat(e,` {pointer-events: none;}
    362367  .allow-interactivity-`).concat(e,` {pointer-events: all;}
    363 `)},kx=0,zt=[];function Cx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(kx++)[0],i=x.useState(el)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Gg([e.lockRef.current],(e.shards||[]).map(sl),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var _=hn(f),v=r.current,w="deltaX"in f?f.deltaX:v[0]-_[0],j="deltaY"in f?f.deltaY:v[1]-_[1],k,N=f.target,C=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&C==="h"&&N.type==="range")return!1;var E=nl(C,N);if(!E)return!0;if(E?k=C:(k=C==="v"?"h":"v",E=nl(C,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=k),!k)return!0;var T=n.current||k;return wx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!zt.length||zt[zt.length-1]!==i)){var _="deltaY"in h?il(h):hn(h),v=t.current.filter(function(k){return k.name===h.type&&(k.target===h.target||h.target===k.shadowParent)&&jx(k.delta,_)})[0];if(v&&v.should){h.cancelable&&h.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(sl).filter(Boolean).filter(function(k){return k.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,_,v){var w={name:f,delta:h,target:_,should:v,shadowParent:Nx(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=x.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,il(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return zt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){zt=zt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:Sx(o)}):null,g?x.createElement(hx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Nx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ex=rx(Qs,Cx);var gn=x.forwardRef(function(e,t){return x.createElement(mn,Ie({},e,{ref:t,sideCar:Ex}))});gn.classNames=mn.classNames;var xn="Popover",[ll]=Ve(xn,[an]),pr=an(),[Tx,Xe]=ll(xn),cl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=pr(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(qs,{...l,children:a.jsx(Tx,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};cl.displayName=xn;var dl="PopoverAnchor",Ax=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(dl,r),i=pr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Oo,{...i,...n,ref:t})});Ax.displayName=dl;var ul="PopoverTrigger",pl=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ul,r),i=pr(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":xl(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Oo,{asChild:!0,...i,children:l})});pl.displayName=ul;var Fo="PopoverPortal",[Px,Ox]=ll(Fo,{forceMount:void 0}),ml=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe(Fo,t);return a.jsx(Px,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};ml.displayName=Fo;var Mt="PopoverContent",fl=x.forwardRef((e,t)=>{const r=Ox(Mt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(Mt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(Lx,{...o,ref:t}):a.jsx(Ix,{...o,ref:t})})});fl.displayName=Mt;var Rx=st("PopoverContent.RemoveScroll"),Lx=x.forwardRef((e,t)=>{const r=Xe(Mt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Lo(s)},[]),a.jsx(gn,{as:Rx,allowPinchZoom:!0,children:a.jsx(hl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ix=x.forwardRef((e,t)=>{const r=Xe(Mt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(hl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),hl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(Mt,r),g=pr(r);return go(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Gs,{"data-state":xl(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),gl="PopoverClose",zx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(gl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});zx.displayName=gl;var Mx="PopoverArrow",Dx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=pr(r);return a.jsx(Ks,{...o,...n,ref:t})});Dx.displayName=Mx;function xl(e){return e?"open":"closed"}var Fx=cl,$x=pl,Bx=ml,Ux=fl;function Je({...e}){return a.jsx(Fx,{"data-slot":"popover",...e})}function Ze({...e}){return a.jsx($x,{"data-slot":"popover-trigger",...e})}function Qe({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Bx,{container:o,children:a.jsx(Ux,{"data-slot":"popover-content",align:t,sideOffset:r,className:F("ecr-popover",e),...n})})}const $o="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var Hx=Symbol.for("react.lazy"),bn=x[" use ".trim().toString()];function Vx(e){return typeof e=="object"&&e!==null&&"then"in e}function bl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Hx&&"_payload"in e&&Vx(e._payload)}function Wx(e){const t=qx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;bl(i)&&typeof bn=="function"&&(i=bn(i._payload));const l=x.Children.toArray(i),c=l.find(Kx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function qx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(bl(o)&&typeof bn=="function"&&(o=bn(o._payload)),x.isValidElement(o)){const s=Xx(o),l=Yx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?qn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gx=Symbol("radix.slottable");function Kx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gx}function Yx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Xx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Jx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zx=Jx.reduce((e,t)=>{const r=Wx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Qx="Separator",_l="horizontal",e0=["horizontal","vertical"],vl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=_l,...o}=e,i=t0(n)?n:_l,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(Zx.div,{"data-orientation":i,...l,...o,ref:t})});vl.displayName=Qx;function t0(e){return e0.includes(e)}var r0=vl;function _n({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(r0,{"data-slot":"separator",decorative:r,orientation:t,className:F("ecr-separator",e),...n})}const ft=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(_n,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(_n,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(te,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})},ce=[];for(let e=0;e<256;++e)ce.push((e+256).toString(16).slice(1));function n0(e,t=0){return(ce[e[t+0]]+ce[e[t+1]]+ce[e[t+2]]+ce[e[t+3]]+"-"+ce[e[t+4]]+ce[e[t+5]]+"-"+ce[e[t+6]]+ce[e[t+7]]+"-"+ce[e[t+8]]+ce[e[t+9]]+"-"+ce[e[t+10]]+ce[e[t+11]]+ce[e[t+12]]+ce[e[t+13]]+ce[e[t+14]]+ce[e[t+15]]).toLowerCase()}let Bo;const o0=new Uint8Array(16);function a0(){if(!Bo){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Bo=crypto.getRandomValues.bind(crypto)}return Bo(o0)}const yl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function i0(e,t,r){e=e||{};const n=e.random??e.rng?.()??a0();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,n0(n)}function vn(e,t,r){return yl.randomUUID&&!e?yl.randomUUID():i0(e)}const s0=new Set(["video/mp4"]),l0=[".mp4",".m4v"],c0=e=>(e.mime||"").toLowerCase().trim(),d0=e=>(e.url||"").toLowerCase().trim(),u0=e=>e.split("?")[0].split("#")[0],p0=e=>{const t=u0(e);return l0.some(r=>t.endsWith(r))},m0=()=>{if(typeof document>"u")return!0;const t=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');return t==="probably"||t==="maybe"},f0=e=>{const t=c0(e),r=d0(e),n=t&&s0.has(t),o=r&&p0(r);return!n&&!o?!1:m0()},h0=e=>{const t=[],r=[];for(const n of e)f0(n)?t.push(n):r.push(n);return{compatible:t,incompatible:r}},g0=({setUploadedFiles:e,setShowOptions:t})=>{const r=()=>{if(!window.wp?.media){q.error("Media library is not available.");return}const n=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:!0,library:{type:["video"]}});n.on("select",()=>{const o=n.state().get("selection").toJSON();if(!e)return;const{incompatible:i}=h0(o);i.length>0&&q.error(`${i.length} video(s) may not play reliably on iOS/macOS Safari. Recommended format: MP4 (H.264/AAC).`);const s=o.map(l=>({url:l.url,mime_type:l.mime,file_uuid:vn(),source:"native"}));e(l=>[...l,...s]),t(!1)}),n.open()};return a.jsxs("button",{className:"ecr-admin-upload-native-video-btn",type:"button",onClick:r,children:[a.jsx(cp,{})," Choose from Media"]})},x0=({setUploadedFiles:e})=>{const[t,r]=y.useState(!1);return a.jsxs("div",{className:"ecr-admin-upload",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload__label",onClick:()=>r(!0),children:a.jsxs("span",{className:"ecr-admin-upload__text-icon_wrapper",children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Upload videos"}),a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click here to upload videos"})]})})]})}),t?a.jsxs("div",{className:"ecr-admin-upload-source-panel",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload-source-panel__close",onClick:()=>r(!1),"aria-label":"Close upload source picker",children:a.jsx(ns,{size:16})}),a.jsx("p",{className:"ecr-admin-upload-source-popover__title",children:"Add Videos"}),a.jsx("p",{className:"ecr-admin-upload-source-popover__description",children:"Upload from media library or paste Vimeo links."}),a.jsxs("div",{className:"ecr-admin-upload-source-popover__options",children:[a.jsx(g0,{setUploadedFiles:e,setShowOptions:r}),a.jsxs(Je,{children:[a.jsx(Ze,{asChild:!0,children:a.jsxs("button",{className:"ecr-admin-upload-vimeo-video-btn",type:"button",children:[a.jsx(ip,{})," Add Vimeo Videos ",a.jsx(at,{size:20})]})}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Vimeo Videos",text:a.jsx(a.Fragment,{children:"To embed Vimeo videos directly into your reels, giving your content a professional, seamless, and engaging playback experience for your audience."})})})]})]})]}):null]})};var yn="Dialog",[wl]=Ve(yn),[b0,ke]=wl(yn),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:yn});return a.jsx(b0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};jl.displayName=yn;var Sl="DialogTrigger",kl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Sl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Vo(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)})});kl.displayName=Sl;var Uo="DialogPortal",[_0,Cl]=wl(Uo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=ke(Uo,t);return a.jsx(_0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};Nl.displayName=Uo;var wn="DialogOverlay",El=x.forwardRef((e,t)=>{const r=Cl(wn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=ke(wn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(y0,{...o,ref:t})}):null});El.displayName=wn;var v0=st("DialogOverlay.RemoveScroll"),y0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(wn,r);return a.jsx(gn,{as:v0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Vo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ht="DialogContent",Tl=x.forwardRef((e,t)=>{const r=Cl(ht,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=ke(ht,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(w0,{...o,ref:t}):a.jsx(j0,{...o,ref:t})})});Tl.displayName=ht;var w0=x.forwardRef((e,t)=>{const r=ke(ht,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Lo(i)},[]),a.jsx(Al,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault())})}),j0=x.forwardRef((e,t)=>{const r=ke(ht,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Al,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=ke(ht,r),c=x.useRef(null),d=J(t,c);return go(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Vo(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(k0,{titleId:l.titleId}),a.jsx(N0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Ho="DialogTitle",Pl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Ho,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Pl.displayName=Ho;var Ol="DialogDescription",S0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});S0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Vo(e){return e?"open":"closed"}var Il="DialogTitleWarning",[C1,zl]=Jf(Il,{contentName:ht,titleName:Ho,docsSlug:"dialog"}),k0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
     368`)},Cx=0,zt=[];function Nx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(Cx++)[0],i=x.useState(el)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Kg([e.lockRef.current],(e.shards||[]).map(sl),!0).filter(Boolean);return f.forEach(function(h){return h.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(f,h){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var v=hn(f),_=r.current,w="deltaX"in f?f.deltaX:_[0]-v[0],j="deltaY"in f?f.deltaY:_[1]-v[1],k,N=f.target,C=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&C==="h"&&N.type==="range")return!1;var E=nl(C,N);if(!E)return!0;if(E?k=C:(k=C==="v"?"h":"v",E=nl(C,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=k),!k)return!0;var T=n.current||k;return jx(T,h,f,T==="h"?w:j)},[]),c=x.useCallback(function(f){var h=f;if(!(!zt.length||zt[zt.length-1]!==i)){var v="deltaY"in h?il(h):hn(h),_=t.current.filter(function(k){return k.name===h.type&&(k.target===h.target||h.target===k.shadowParent)&&Sx(k.delta,v)})[0];if(_&&_.should){h.cancelable&&h.preventDefault();return}if(!_){var w=(s.current.shards||[]).map(sl).filter(Boolean).filter(function(k){return k.contains(h.target)}),j=w.length>0?l(h,w[0]):!s.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),d=x.useCallback(function(f,h,v,_){var w={name:f,delta:h,target:v,should:_,shadowParent:Ex(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=x.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=x.useCallback(function(f){d(f.type,il(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){d(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return zt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){zt=zt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:kx(o)}):null,g?x.createElement(gx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ex(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tx=nx(Qs,Nx);var gn=x.forwardRef(function(e,t){return x.createElement(mn,Ie({},e,{ref:t,sideCar:Tx}))});gn.classNames=mn.classNames;var xn="Popover",[ll]=Ve(xn,[an]),pr=an(),[Ax,Xe]=ll(xn),cl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=pr(t),c=x.useRef(null),[d,u]=x.useState(!1),[p,m]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(qs,{...l,children:a.jsx(Ax,{scope:t,contentId:Ae(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s,children:r})})};cl.displayName=xn;var dl="PopoverAnchor",Px=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(dl,r),i=pr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Oo,{...i,...n,ref:t})});Px.displayName=dl;var ul="PopoverTrigger",pl=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(ul,r),i=pr(r),s=J(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":xl(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Oo,{asChild:!0,...i,children:l})});pl.displayName=ul;var Fo="PopoverPortal",[Ox,Rx]=ll(Fo,{forceMount:void 0}),ml=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Xe(Fo,t);return a.jsx(Ox,{scope:t,forceMount:r,children:a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};ml.displayName=Fo;var Mt="PopoverContent",fl=x.forwardRef((e,t)=>{const r=Rx(Mt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Xe(Mt,e.__scopePopover);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(Ix,{...o,ref:t}):a.jsx(zx,{...o,ref:t})})});fl.displayName=Mt;var Lx=st("PopoverContent.RemoveScroll"),Ix=x.forwardRef((e,t)=>{const r=Xe(Mt,e.__scopePopover),n=x.useRef(null),o=J(t,n),i=x.useRef(!1);return x.useEffect(()=>{const s=n.current;if(s)return Lo(s)},[]),a.jsx(gn,{as:Lx,allowPinchZoom:!0,children:a.jsx(hl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),zx=x.forwardRef((e,t)=>{const r=Xe(Mt,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(hl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),hl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Xe(Mt,r),g=pr(r);return go(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Gs,{"data-state":xl(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),gl="PopoverClose",Mx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Xe(gl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Mx.displayName=gl;var Dx="PopoverArrow",Fx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=pr(r);return a.jsx(Ks,{...o,...n,ref:t})});Fx.displayName=Dx;function xl(e){return e?"open":"closed"}var $x=cl,Bx=pl,Ux=ml,Hx=fl;function Je({...e}){return a.jsx($x,{"data-slot":"popover",...e})}function Ze({...e}){return a.jsx(Bx,{"data-slot":"popover-trigger",...e})}function Qe({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Ux,{container:o,children:a.jsx(Hx,{"data-slot":"popover-content",align:t,sideOffset:r,className:F("ecr-popover",e),...n})})}const $o="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var Vx=Symbol.for("react.lazy"),bn=x[" use ".trim().toString()];function Wx(e){return typeof e=="object"&&e!==null&&"then"in e}function bl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Vx&&"_payload"in e&&Wx(e._payload)}function qx(e){const t=Gx(e),r=x.forwardRef((n,o)=>{let{children:i,...s}=n;bl(i)&&typeof bn=="function"&&(i=bn(i._payload));const l=x.Children.toArray(i),c=l.find(Yx);if(c){const d=c.props.children,u=l.map(p=>p===c?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Gx(e){const t=x.forwardRef((r,n)=>{let{children:o,...i}=r;if(bl(o)&&typeof bn=="function"&&(o=bn(o._payload)),x.isValidElement(o)){const s=Jx(o),l=Xx(i,o.props);return o.type!==x.Fragment&&(l.ref=n?qn(n,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kx=Symbol("radix.slottable");function Yx(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kx}function Xx(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Jx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Zx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qx=Zx.reduce((e,t)=>{const r=qx(`Primitive.${t}`),n=x.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),e0="Separator",vl="horizontal",t0=["horizontal","vertical"],_l=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=vl,...o}=e,i=r0(n)?n:vl,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(Qx.div,{"data-orientation":i,...l,...o,ref:t})});_l.displayName=e0;function r0(e){return t0.includes(e)}var n0=_l;function vn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(n0,{"data-slot":"separator",decorative:r,orientation:t,className:F("ecr-separator",e),...n})}const ft=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(vn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(vn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(te,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})},ce=[];for(let e=0;e<256;++e)ce.push((e+256).toString(16).slice(1));function o0(e,t=0){return(ce[e[t+0]]+ce[e[t+1]]+ce[e[t+2]]+ce[e[t+3]]+"-"+ce[e[t+4]]+ce[e[t+5]]+"-"+ce[e[t+6]]+ce[e[t+7]]+"-"+ce[e[t+8]]+ce[e[t+9]]+"-"+ce[e[t+10]]+ce[e[t+11]]+ce[e[t+12]]+ce[e[t+13]]+ce[e[t+14]]+ce[e[t+15]]).toLowerCase()}let Bo;const a0=new Uint8Array(16);function i0(){if(!Bo){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Bo=crypto.getRandomValues.bind(crypto)}return Bo(a0)}const yl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function s0(e,t,r){e=e||{};const n=e.random??e.rng?.()??i0();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,o0(n)}function _n(e,t,r){return yl.randomUUID&&!e?yl.randomUUID():s0(e)}const l0=new Set(["video/mp4"]),c0=[".mp4",".m4v"],d0=e=>(e.mime||"").toLowerCase().trim(),u0=e=>(e.url||"").toLowerCase().trim(),p0=e=>e.split("?")[0].split("#")[0],m0=e=>{const t=p0(e);return c0.some(r=>t.endsWith(r))},f0=()=>{if(typeof document>"u")return!0;const t=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');return t==="probably"||t==="maybe"},h0=e=>{const t=d0(e),r=u0(e),n=t&&l0.has(t),o=r&&m0(r);return!n&&!o?!1:f0()},g0=e=>{const t=[],r=[];for(const n of e)h0(n)?t.push(n):r.push(n);return{compatible:t,incompatible:r}},x0=({setUploadedFiles:e,setShowOptions:t})=>{const r=()=>{if(!window.wp?.media){q.error("Media library is not available.");return}const n=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:!1,library:{type:["video"]}});n.on("select",()=>{const o=n.state().get("selection").toJSON();if(!e)return;const{incompatible:i}=g0(o);i.length>0&&q(a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[a.jsx(Jf,{style:{flexShrink:0},color:"oklch(66.6% 0.179 58.318)"}),i.length," video(s) may not play reliably on iOS/macOS Safari. Recommended format: MP4 (H.264/AAC)."]}));const s=o.map(l=>({url:l.url,mime_type:l.mime,file_uuid:_n(),source:"native"}));e(l=>[...l,...s]),t(!1)}),n.open()};return a.jsxs("button",{className:"ecr-admin-upload-native-video-btn",type:"button",onClick:r,children:[a.jsx(cp,{})," Choose from Media"]})},b0=({setUploadedFiles:e})=>{const[t,r]=y.useState(!1);return a.jsxs("div",{className:"ecr-admin-upload",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload__label",onClick:()=>r(!0),children:a.jsxs("span",{className:"ecr-admin-upload__text-icon_wrapper",children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Upload videos"}),a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click here to upload videos"})]})})]})}),t?a.jsxs("div",{className:"ecr-admin-upload-source-panel",children:[a.jsx("button",{type:"button",className:"ecr-admin-upload-source-panel__close",onClick:()=>r(!1),"aria-label":"Close upload source picker",children:a.jsx(ns,{size:16})}),a.jsx("p",{className:"ecr-admin-upload-source-popover__title",children:"Add Videos"}),a.jsx("p",{className:"ecr-admin-upload-source-popover__description",children:"Upload from media library or paste Vimeo links."}),a.jsxs("div",{className:"ecr-admin-upload-source-popover__options",children:[a.jsx(x0,{setUploadedFiles:e,setShowOptions:r}),a.jsxs(Je,{children:[a.jsx(Ze,{asChild:!0,children:a.jsxs("button",{className:"ecr-admin-upload-vimeo-video-btn",type:"button",children:[a.jsx(ip,{})," Add Vimeo Videos ",a.jsx(at,{size:20})]})}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Vimeo Videos",text:a.jsx(a.Fragment,{children:"To embed Vimeo videos directly into your reels, giving your content a professional, seamless, and engaging playback experience for your audience."})})})]})]})]}):null]})};var yn="Dialog",[wl]=Ve(yn),[v0,ke]=wl(yn),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=x.useRef(null),c=x.useRef(null),[d,u]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:yn});return a.jsx(v0,{scope:t,triggerRef:l,contentRef:c,contentId:Ae(),titleId:Ae(),descriptionId:Ae(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};jl.displayName=yn;var Sl="DialogTrigger",kl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Sl,r),i=J(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Vo(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)})});kl.displayName=Sl;var Uo="DialogPortal",[_0,Cl]=wl(Uo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=ke(Uo,t);return a.jsx(_0,{scope:t,forceMount:r,children:x.Children.map(n,s=>a.jsx(Ye,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};Nl.displayName=Uo;var wn="DialogOverlay",El=x.forwardRef((e,t)=>{const r=Cl(wn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=ke(wn,e.__scopeDialog);return i.modal?a.jsx(Ye,{present:n||i.open,children:a.jsx(w0,{...o,ref:t})}):null});El.displayName=wn;var y0=st("DialogOverlay.RemoveScroll"),w0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(wn,r);return a.jsx(gn,{as:y0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Vo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ht="DialogContent",Tl=x.forwardRef((e,t)=>{const r=Cl(ht,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=ke(ht,e.__scopeDialog);return a.jsx(Ye,{present:n||i.open,children:i.modal?a.jsx(j0,{...o,ref:t}):a.jsx(S0,{...o,ref:t})})});Tl.displayName=ht;var j0=x.forwardRef((e,t)=>{const r=ke(ht,e.__scopeDialog),n=x.useRef(null),o=J(t,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return Lo(i)},[]),a.jsx(Al,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault())})}),S0=x.forwardRef((e,t)=>{const r=ke(ht,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Al,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=ke(ht,r),c=x.useRef(null),d=J(t,c);return go(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Gr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Vo(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(C0,{titleId:l.titleId}),a.jsx(E0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Ho="DialogTitle",Pl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Ho,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Pl.displayName=Ho;var Ol="DialogDescription",k0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});k0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=ke(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Vo(e){return e?"open":"closed"}var Il="DialogTitleWarning",[E1,zl]=Zf(Il,{contentName:ht,titleName:Ho,docsSlug:"dialog"}),C0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
    364369
    365370If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
    366371
    367 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},C0="DialogDescriptionWarning",N0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(C0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},E0=jl,T0=kl,A0=Nl,P0=El,O0=Tl,R0=Pl,Ml=Ll;function Wo({...e}){return a.jsx(E0,{"data-slot":"dialog",...e})}function qo({...e}){return a.jsx(T0,{"data-slot":"dialog-trigger",...e})}function L0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(A0,{"data-slot":"dialog-portal",container:t,...e})}function I0({className:e,...t}){return a.jsx(P0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function Go({className:e,children:t,...r}){return a.jsxs(L0,{children:[a.jsx(I0,{}),a.jsxs(O0,{"data-slot":"dialog-content",className:F("ecr-dialog__content",e),...r,children:[t,a.jsx(Ml,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(ns,{className:"ecr-dialog__close-icon"})})]})]})}function Ko({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Yo({className:e,...t}){return a.jsx(R0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function z0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const M0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=y.useState([]),[s,l]=y.useState(1),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=uo(b,500),_=y.useRef(!0),v=y.useRef(0),w=y.useRef(null),[j,k]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){k("Missing API configuration."),g(!1),p(!1);return}const A=++v.current;w.current&&w.current.abort();const O=new AbortController;w.current=O,T===1&&_.current?g(!0):p(!0);try{const R={page:T,per_page:50};h&&(R.search=h);const L=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:R,signal:O.signal}),P=L.data,M=parseInt(L.headers["x-wp-totalpages"]||"1",10);A===v.current&&(i(I=>T===1?P:[...I,...P]),l(T+1),d(T<M))}catch(R){if(O.signal.aborted)return;R instanceof Error?k(R.message):k("An unknown error occurred")}finally{_.current&&(_.current=!1),A===v.current&&!O.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),i([]),k(null),_.current=!0,N(1))},[h,N,t]);const C=y.useRef(null),E=y.useCallback(T=>{u||(C.current&&C.current.disconnect(),C.current=new IntersectionObserver(A=>{A[0].isIntersecting&&c&&N(s)}),T&&C.current.observe(T))},[u,c,s,N]);return y.useEffect(()=>()=>{C.current&&C.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},jn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",Dl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:F("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),D0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(_=>_!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),_=[];for(const v of r)h.has(v.id)&&_.push({btn_type:"product",btn_uuid:vn(),buttonText:v.name,buttonUrl:v.permalink,rating:v.average_rating,price:v.price_html,thumbnail:v.images?.[0]?.thumbnail||v.images?.[0]?.src||jn,product_id:v.id});e(_),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Fl,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const _=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!_?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(te,{type:"button",onClick:()=>g(f),className:F("ecr-admin-product-link__button",_?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[_?a.jsx(qf,{size:20,color:"#2563eb"}):a.jsx(Gf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||jn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Fl,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(Dl,{name:"add",handleClick:b})})]})]})},Fl=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),F0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,$0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&F0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:vn(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(Sn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function Sn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const B0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=y.useState(null),[s,l]=y.useState(!1),c=M0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(_n,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Wo,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(qo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Bf,{size:20})," Add Custom Link"]}),a.jsxs(Go,{className:"ecr-admin-link-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx($0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Wo,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(qo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Yf,{size:20})," Tag Products"]}),a.jsxs(Go,{className:"ecr-admin-link-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(D0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},U0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(te,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Xf,{size:16})})]},o.btn_uuid)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(at,{size:20})]}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(B0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const H0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,playsInline:!0,preload:"metadata",onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onError:o,"webkit-playsinline":"true",onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},V0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(H0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Xn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},W0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(V0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(at,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(Qe,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ft,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},q0=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:vn()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:F("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})},G0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx($l,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(q0,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),K0=()=>{const e=Ne(),[t]=Jt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(h=>{i(_=>({..._,title:typeof h=="function"?h(_.title):h}))},[]),p=y.useCallback(h=>{i(_=>({..._,files:typeof h=="function"?h(_.files):h}))},[]),m=y.useCallback(h=>{i(_=>({..._,links:typeof h=="function"?h(_.links):h}))},[]),g=y.useCallback(h=>{i(_=>({..._,thumbnail:typeof h=="function"?h(_.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(_=>_.file_uuid!==c)),d(null))},f=y.useCallback(async h=>{try{l(!0);const _=await he.get(`story/${h}`);i({title:_.data.title,files:_.data.files,links:_.data.links,thumbnail:_.data.thumbnail})}catch(_){_ instanceof Error?q.error(_.message):q.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[a.jsx(Af,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Rr,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(W0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(x0,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(G0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(_n,{className:"ecr-admin-create__separator"}),a.jsx(U0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(up,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Xo,Ul;function Y0(){return Ul||(Ul=1,Xo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Xo}var Jo,Hl;function X0(){if(Hl)return Jo;Hl=1;var e=Y0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Jo=o,Jo}var J0=X0();const Vl=kd(J0);function Wl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:F("ecr-table",e),...t})})}function ql({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:F("ecr-table__header",e),...t})}function Gl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:F("ecr-table__body",e),...t})}function kn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:F("ecr-table__row",e),...t})}function Kl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:F("ecr-table__head",e),...t})}function ze({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:F("ecr-table__cell",e),...t})}function Yl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:F("ecr-table__caption",e),...t})}const Z0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],Q0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Vl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Wl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(lt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(ql,{children:a.jsx(kn,{children:Z0.map((s,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Gl,{children:e.map((s,l)=>a.jsxs(kn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(ze,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(op,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:F("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(te,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(pi,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Or,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(dp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Xl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),eb=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[b]=y.useState(20),[f,h]=y.useState(0),[_,v]=y.useState(1),w=uo(u,500),j=y.useCallback(async E=>{const T=new AbortController,A=E===1;try{A?i(!0):l(!0),n("");const O=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),R=Number(O.headers?.["x-wp-total"]??0),L=Number(O.headers?.["x-wp-totalpages"]??1),P=Math.max(1,L||1);t(M=>{if(A)return O.data;const I=new Set(M.map(z=>z.id)),B=O.data.filter(z=>!I.has(z.id));return[...M,...B]}),h(R),v(P),E>P&&g(P)}catch(O){if(T.signal.aborted)return;O instanceof Error?n(O.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(A?i(!1):l(!1))}},[b,w]),k=y.useCallback(()=>{g(E=>o||s||E>=_?E:E+1)},[o,s,_]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),C=y.useCallback(async E=>{try{d(!0),await he.delete(`group/${E}`),await N(),q.success("Group deleted successfully!")}catch(T){T instanceof Error?q.error(T.message):q.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:_,hasMore:m<=_,loadMore:k,refreshGroups:N,deleteGroup:C}},tb={docs:"https://reelswp.com/docs/"},rb=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=eb(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:"All Widgets",Icon:pp},"page")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsxs("a",{href:tb.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Ff,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Lr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:yt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Rr,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(te,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(oi,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Lr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:yt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx(Q0,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Uf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},nb=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){q.error("Please enter valid numbers.");return}try{l(!0),d(!1),await he.post("settings",{rate_limit:m,time_limit:g}),q.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?q.error(b.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?q.error(b.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},ob=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=nb();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Ir,{}),a.jsx(St,{left:[a.jsx(kt,{name:"Settings",Icon:Np},"Settings"),a.jsx(rr,{},"back-settings")],center:[a.jsx(zr,{},"Settings-widget-name")],right:[a.jsx(po,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},ab=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],ib=({tableData:e})=>a.jsxs(Wl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(kn,{children:ab.map((t,r)=>a.jsx(Kl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Gl,{children:e.map((t,r)=>a.jsxs(kn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),sb=()=>{const[e]=Jt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?q.error(g.message):q.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:"Statistics",Icon:pi},"Statistics"),a.jsx(rr,{},"Statistics-back")],center:[a.jsx(zr,{},"Statistics-widget-name")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Xl,{}):d?a.jsx(Bl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(ib,{tableData:i})})]})]})};function lb(e){return U({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function cb(e){return U({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const db=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:F("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(lb,{size:24})}),ub=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Zo=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:F("ecr-input",e),...r}));Zo.displayName="Input";const Qo=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Zo,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,et=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*et:0,v:i/Dt*et,a:o}},Jl=e=>{var{h:t,s:r,l:n,a:o}=Zl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/et;return{h:t,s:i>0&&i<200?r*n/et/(i<=et?i:200-i)*et:0,l:i/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},pb=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(i||"")},fr=e=>mr(mb(e)),mb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Cn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/et,l=n/et,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},fb=e=>{var{r:t,g:r,b:n,a:o}=Cn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},hb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},gb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},ea=e=>Ql(Cn(e)),xb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},bb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},Ft=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&ta(e)?(s=fr(e),c=e):typeof e!="string"&&(s=e),s&&(n=xb(s),i=Zl(s),o=Cn(s),d=pb(o),c=ea(s),r=gb(i),t=hb(o),l=bb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},ta=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ec(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var hr=e=>"touches"in e,tc=e=>{!hr(e)&&e.preventDefault&&e.preventDefault()},rc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nc=(e,t)=>{var r=e.getBoundingClientRect(),n=hr(t)?t.touches[0]:t;return{left:rc((n.pageX-(r.left+window.pageXOffset))/r.width),top:rc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},_b=["prefixCls","className","onMove","onDown"],ra=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,_b),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=ec(o),m=ec(i),g=v=>c.current&&!hr(v)?!1:(c.current=hr(v),!0),b=y.useCallback(v=>{if(tc(v),!!l.current){var w=hr(v)?v.touches.length>0:v.buttons>0;if(!w){u(!1);return}p?.(nc(l.current,v),v)}},[p]),f=y.useCallback(()=>u(!1),[]),h=y.useCallback(v=>{v?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var _=y.useCallback(v=>{var w=document.activeElement;w?.blur(),tc(v.nativeEvent),g(v.nativeEvent)&&l.current&&(m?.(nc(l.current,v.nativeEvent),v.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:_,onTouchStart:_}))});ra.displayName="Interactive";var vb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},yb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,yb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(_,v)=>{u&&d&&u({h:d.h,s:_.left*100,v:(1-_.top)*100,a:d.a})},b=y.useCallback(_=>{if(!(!d||!u)){var v=1,w=d.s,j=d.v,k=!1;switch(_.key){case"ArrowLeft":w=Math.max(0,d.s-v),k=!0,_.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+v),k=!0,_.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+v),k=!0,_.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-v),k=!0,_.preventDefault();break;default:return}k&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var _={top:100-d.v+"%",left:d.s+"%",color:Jl(d)};return i&&typeof i=="function"?i(D({prefixCls:n},_)):a.jsx(vb,D({prefixCls:n},_))},[d,i,n]),h=y.useCallback(_=>{_.target.focus()},[]);return a.jsx(ra,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});oc.displayName="Saturation";var wb=["className","prefixCls","left","top","style","fillProps"],jb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,wb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},Sb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],kb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Nn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,Sb),_=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},v=Jl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+v+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var k=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+kb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var A=.01,O=o.a,R=O;switch(T.key){case"ArrowLeft":m==="horizontal"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(R=Math.min(1,O+A),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(R=Math.max(0,O-A),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(R=Math.min(1,O+A),T.preventDefault());break;default:return}if(R!==O){var L={left:m==="horizontal"?R:o.a,top:m==="vertical"?R:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:R}),L)}},[o,m,b]),C=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(jb,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:k,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(ra,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:_,onDown:_,onClick:C,onKeyDown:N,children:E}))]}))});Nn.displayName="Alpha";var Cb=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Nb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),Eb=e=>Number(String(e).replace(/%/g,"")),$t=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,Cb),[b,f]=y.useState(i),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function _(C,E){var T=(E||C.target.value).trim().replace(/^#/,"");Nb(T)&&u&&u(C,T);var A=Eb(T);isNaN(A)||u&&u(C,A),f(T)}function v(C){h.current=!1,f(e.value),p&&p(C)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),k=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:_,onBlur:v,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:k,onFocusCapture:C=>{var E=C.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});$t.displayName="EditableInput";var Tb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,Tb),g=n?Cn(n):{};function b(v){var w=Number(v.target.value);w&&w>255&&(v.target.value="255"),w&&w<0&&(v.target.value="0")}var f=v=>{var w=Number(v.target.value);w&&w>100&&(v.target.value="100"),w&&w<0&&(v.target.value="0")},h=(v,w,j)=>{typeof v=="number"&&(w==="a"&&(v<0&&(v=0),v>100&&(v=100),p&&p(Ft(mr(D({},g,{a:v/100}))))),v>255&&(v=255,j.target.value="255"),v<0&&(v=0,j.target.value="0"),w==="r"&&p&&p(Ft(mr(D({},g,{r:v})))),w==="g"&&p&&p(Ft(mr(D({},g,{g:v})))),w==="b"&&p&&p(Ft(mr(D({},g,{b:v})))))},_=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx($t,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"r",v)},i,{style:D({},i.style)})),a.jsx($t,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"g",v)},s,{style:D({marginLeft:5},i.style)})),a.jsx($t,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(v,w)=>h(w,"b",v)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx($t,D({label:"A",value:parseInt(String(_*100),10),onBlur:f,placement:o,onChange:(v,w)=>h(w,"a",v)},c,{style:D({marginLeft:5},c.style)}))]}))});ac.displayName="EditableInputRGBA";var Ab=["prefixCls","className","hue","onChange","direction"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,Ab);return a.jsx(Nn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});ic.displayName="Hue";var Pb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,Pb),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(fr(f),Ft(fr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var _="",v="";typeof f=="string"&&(_=f,v=f),typeof f=="object"&&f.color&&(_=f.title||f.color,v=f.color);var w=o&&o.toLocaleLowerCase()===v.toLocaleLowerCase(),j=p&&p({title:_,color:v,checked:!!w,style:D({},g,{background:v}),onClick:N=>b(v,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var k=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:v,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:_,onClick:N=>b(v,N)},l,{children:k,style:D({},g,{background:v})}),h)}),d&&y.isValidElement(d)&&d]}))});sc.displayName="Swatch";var Ob=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],Rb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],lc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),cc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=Rb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,Ob),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ta(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Ft(N))},f=(N,C)=>{typeof N=="string"&&ta(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(D({},m,{a:N.a})),_=N=>b(D({},m,N,{a:m.a})),v=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:fb(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},k={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",D({},p,{className:r+" "+(n||""),ref:t,style:v,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(oc,{hsva:m,style:{width:"auto",height:150},onChange:_}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ic,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(Nn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!d&&a.jsx(Nn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx($t,{label:"Hex",value:ea(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,C)=>f(C),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(sc,{style:j,colors:s,color:ea(m),onChange:N=>b(N),rectProps:{style:k}})]}))});cc.displayName="Sketch";const dc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Je,{children:[a.jsx(Ze,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(Qe,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(cc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),Lb=[{value:"left",title:"Align Left",Icon:Hp},{value:"center",title:"Align Center",Icon:Vp},{value:"right",title:"Align Right",Icon:Wp},{value:"hidden",title:"Hidden",Icon:qp}],Ib=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:Lb.map(({value:r,title:n,Icon:o})=>a.jsx(te,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),zb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(Ib,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Qo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Mb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Vl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Db=({gid:e})=>{const[t,r]=Mb(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Df,{color:"#ffffff",size:12})}),a.jsx("span",{className:F("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},uc=y.createContext({requestLeave:e=>e()}),Fb=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function $b(e){return U({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const Bb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Ub,{link:e,usedFor:t})}),Ub=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||jn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||jn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx($b,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Hb=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},En=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(Bb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Hb,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=pc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",_=!b&&!f&&g;return a.jsxs("div",{className:F("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Zn,{story:e,styles:t}),!b&&!f&&h?_?a.jsx(En,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(te,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(vt,{to:c,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:v=>{v.preventDefault(),s(()=>i(c))},children:a.jsx(Or,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(te,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(it,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Wn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},fc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,_=f.scrollWidth,v=f.clientWidth;c(h>0),u(h+v<_-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,_,v;const w=A=>{h=!0,_=A.pageX-f.offsetLeft,v=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},k=()=>{h=!1,f.style.cursor="default"},N=A=>{if(!h)return;A.preventDefault();const R=(A.pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-R,g()},C=A=>{h=!0,_=A.touches[0].pageX-f.offsetLeft,v=f.scrollLeft},E=()=>{h=!1},T=A=>{if(!h)return;const R=(A.touches[0].pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-R,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",k),f.addEventListener("mousemove",N),f.addEventListener("touchstart",C,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",k),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",C),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:F("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(mc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Qt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(er,{size:20})})]})},Vb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:F("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(mc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),Wb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(wt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsx(wt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(er,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,_=h.videoWidth,v=h.videoHeight;d(()=>v>_)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Xn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"?b?a.jsx(En,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,g==="title"?a.jsx(Bt,{title:e.title}):null]})})},qb={carousel:hc,grid:Vb},Gb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=qb[s]||hc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(Db,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Wb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(lt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Kb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=pc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Lr,{to:u,text:"Add Reel",Icon:yt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(it,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:_}=f,v=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:v,children:_})};s.displayName=t;const l=e+"CollectionSlot",c=st(l),d=y.forwardRef((f,h)=>{const{scope:_,children:v}=f,w=i(l,_),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:v})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=st(u),g=y.forwardRef((f,h)=>{const{scope:_,children:v,...w}=f,j=y.useRef(null),k=J(h,j),N=i(u,_);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:k,children:v})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const v=h.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,C)=>w.indexOf(N.ref.current)-w.indexOf(C.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var Yb=x.createContext(void 0);function na(e){const t=x.useContext(Yb);return e||t||"ltr"}var oa="rovingFocusGroup.onEntryFocus",Xb={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[aa,bc,Jb]=xc(gr),[Zb,_c]=Ve(gr,[Jb]),[Qb,e_]=Zb(gr),vc=x.forwardRef((e,t)=>a.jsx(aa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(aa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(t_,{...e,ref:t})})}));vc.displayName=gr;var t_=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=na(i),[f,h]=mt({prop:s,defaultProp:l??null,onChange:c,caller:gr}),[_,v]=x.useState(!1),w=We(d),j=bc(r),k=x.useRef(!1),[N,C]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(oa,w),()=>E.removeEventListener(oa,w)},[w]),a.jsx(Qb,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>C(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:_||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{k.current=!0}),onFocus:V(e.onFocus,E=>{const T=!k.current;if(E.target===E.currentTarget&&T&&!_){const A=new CustomEvent(oa,Xb);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const O=j().filter(I=>I.focusable),R=O.find(I=>I.active),L=O.find(I=>I.id===f),M=[R,L,...O].filter(Boolean).map(I=>I.ref.current);jc(M,u)}}k.current=!1}),onBlur:V(e.onBlur,()=>v(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=e_(yc,r),p=u.currentTabStopId===d,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(aa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const _=o_(h,u.orientation,u.dir);if(_!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")w.reverse();else if(_==="prev"||_==="next"){_==="prev"&&w.reverse();const j=w.indexOf(h.currentTarget);w=u.loop?a_(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});wc.displayName=yc;var r_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function n_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function o_(e,t,r){const n=n_(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return r_[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function a_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var i_=vc,s_=wc,Tn="Tabs",[l_]=Ve(Tn,[_c]),Sc=_c(),[c_,ia]=l_(Tn),kc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=na(l),[p,m]=mt({prop:n,onChange:o,defaultProp:i??"",caller:Tn});return a.jsx(c_,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});kc.displayName=Tn;var Cc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=ia(Cc,r),s=Sc(r);return a.jsx(i_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Nc.displayName=Cc;var Ec="TabsTrigger",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=ia(Ec,r),l=Sc(r),c=Oc(s.baseId,n),d=Rc(s.baseId,n),u=n===s.value;return a.jsx(s_,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=ia(Ac,r),c=Oc(l.baseId,n),d=Rc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var d_=kc,u_=Nc,p_=Tc,m_=Pc;function f_({className:e,...t}){return a.jsx(d_,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function h_({className:e,...t}){return a.jsx(u_,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(p_,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(m_,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}const xr=({label:e,text:t})=>a.jsxs(Je,{children:[a.jsx(Ze,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(at,{size:20})]}),a.jsx(cb,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(Qe,{className:"ecr-admin-popover",children:a.jsx(ft,{name:e,text:t})})]});function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function g_(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),x_="VisuallyHidden",b_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));b_.displayName=x_;var __=[" ","Enter","ArrowUp","ArrowDown"],v_=[" ","Enter"],gt="Select",[An,Pn,y_]=xc(gt),[Ut]=Ve(gt,[y_,an]),On=an(),[w_,tt]=Ut(gt),[j_,S_]=Ut(gt),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=On(t),[h,_]=x.useState(null),[v,w]=x.useState(null),[j,k]=x.useState(!1),N=na(d),[C,E]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gt}),[T,A]=mt({prop:s,defaultProp:l,onChange:c,caller:gt}),O=x.useRef(null),R=h?b||!!h.closest("form"):!0,[L,P]=x.useState(new Set),M=Array.from(L).map(I=>I.props.value).join(";");return a.jsx(qs,{...f,children:a.jsxs(w_,{required:g,scope:t,trigger:h,onTriggerChange:_,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:k,contentId:Ae(),value:T,onValueChange:A,open:C,onOpenChange:E,dir:N,triggerPointerDownPosRef:O,disabled:m,children:[a.jsx(An.Provider,{scope:t,children:a.jsx(j_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(I=>{P(B=>new Set(B).add(I))},[]),onNativeOptionRemove:x.useCallback(I=>{P(B=>{const z=new Set(B);return z.delete(I),z})},[]),children:r})}),R?a.jsxs(id,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:I=>A(I.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(L)]},M):null]})})};Dc.displayName=gt;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=On(r),s=tt(Fc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=Pn(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=d().filter(w=>!w.disabled),_=h.find(w=>w.value===s.value),v=cd(h,f,_);v!==void 0&&s.onValueChange(v.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Oo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sd(s.value)?"":void 0,...o,ref:c,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&__.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=tt(Bc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return le(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:sd(c.value)?a.jsx(a.Fragment,{children:s}):i})});Uc.displayName=Bc;var k_="SelectIcon",Hc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=k_;var C_="SelectPortal",Vc=e=>a.jsx(sn,{asChild:!0,...e});Vc.displayName=C_;var xt="SelectContent",Wc=x.forwardRef((e,t)=>{const r=tt(xt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?_r.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(An.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=xt;var Ce=10,[qc,rt]=Ut(xt),N_="SelectContentImpl",E_=st("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,..._}=e,v=tt(xt,r),[w,j]=x.useState(null),[k,N]=x.useState(null),C=J(t,$=>j($)),[E,T]=x.useState(null),[A,O]=x.useState(null),R=Pn(r),[L,P]=x.useState(!1),M=x.useRef(!1);x.useEffect(()=>{if(w)return Lo(w)},[w]),go();const I=x.useCallback($=>{const[Y,...oe]=R().map(re=>re.ref.current),[Z]=oe.slice(-1),Q=document.activeElement;for(const re of $)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===Y&&k&&(k.scrollTop=0),re===Z&&k&&(k.scrollTop=k.scrollHeight),re?.focus(),document.activeElement!==Q))return},[R,k]),B=x.useCallback(()=>I([E,w]),[I,E,w]);x.useEffect(()=>{L&&B()},[L,B]);const{onOpenChange:z,triggerPointerDownPosRef:G}=v;x.useEffect(()=>{if(w){let $={x:0,y:0};const Y=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(G.current?.y??0))}},oe=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||z(!1),document.removeEventListener("pointermove",Y),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,z,G]),x.useEffect(()=>{const $=()=>z(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[z]);const[ae,ie]=ld($=>{const Y=R().filter(Q=>!Q.disabled),oe=Y.find(Q=>Q.ref.current===document.activeElement),Z=cd(Y,$,oe);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(v.value!==void 0&&v.value===Y||Z)&&(T($),Z&&(M.current=!0))},[v.value]),_e=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback(($,Y,oe)=>{const Z=!M.current&&!oe;(v.value!==void 0&&v.value===Y||Z)&&O($)},[v.value]),K=n==="popper"?sa:Kc,de=K===sa?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:k,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:_e,itemTextRefCallback:pe,focusSelectedItem:B,selectedItemText:A,position:n,isPositioned:L,searchRef:ae,children:a.jsx(gn,{as:E_,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:v.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{v.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:a.jsx(K,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:$=>$.preventDefault(),..._,...de,onPlaced:()=>P(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:V(_.onKeyDown,$=>{const Y=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Y&&$.key.length===1&&ie($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=R().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,re=Z.indexOf(Q);Z=Z.slice(re+1)}setTimeout(()=>I(Z)),$.preventDefault()}})})})})})})});Gc.displayName=N_;var T_="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=tt(xt,r),s=rt(xt,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,C=>u(C)),m=Pn(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:_,focusSelectedItem:v}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&_){const C=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=_.getBoundingClientRect();if(i.dir!=="rtl"){const Q=A.left-E.left,re=T.left-Q,ve=C.left-re,bt=C.width+ve,xa=Math.max(bt,E.width),ba=window.innerWidth-Ce,_a=zc(re,[Ce,Math.max(Ce,ba-xa)]);l.style.minWidth=bt+"px",l.style.left=_a+"px"}else{const Q=E.right-A.right,re=window.innerWidth-T.right-Q,ve=window.innerWidth-C.right-re,bt=C.width+ve,xa=Math.max(bt,E.width),ba=window.innerWidth-Ce,_a=zc(re,[Ce,Math.max(Ce,ba-xa)]);l.style.minWidth=bt+"px",l.style.right=_a+"px"}const O=m(),R=window.innerHeight-Ce*2,L=f.scrollHeight,P=window.getComputedStyle(d),M=parseInt(P.borderTopWidth,10),I=parseInt(P.paddingTop,10),B=parseInt(P.borderBottomWidth,10),z=parseInt(P.paddingBottom,10),G=M+I+L+z+B,ae=Math.min(h.offsetHeight*5,G),ie=window.getComputedStyle(f),ge=parseInt(ie.paddingTop,10),_e=parseInt(ie.paddingBottom,10),pe=C.top+C.height/2-Ce,K=R-pe,de=h.offsetHeight/2,$=h.offsetTop+de,Y=M+I+$,oe=G-Y;if(Y<=pe){const Q=O.length>0&&h===O[O.length-1].ref.current;l.style.bottom="0px";const re=d.clientHeight-f.offsetTop-f.offsetHeight,ve=Math.max(K,de+(Q?_e:0)+re+B),bt=Y+ve;l.style.height=bt+"px"}else{const Q=O.length>0&&h===O[0].ref.current;l.style.top="0px";const ve=Math.max(pe,M+f.offsetTop+(Q?ge:0)+de)+oe;l.style.height=ve+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${Ce}px 0`,l.style.minHeight=ae+"px",l.style.maxHeight=R+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,_,i.dir,n]);le(()=>w(),[w]);const[j,k]=x.useState();le(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(C=>{C&&b.current===!0&&(w(),v?.(),b.current=!1)},[w,v]);return a.jsx(P_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=T_;var A_="SelectPopperPosition",sa=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ce,...i}=e,s=On(r);return a.jsx(Gs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});sa.displayName=A_;var[P_,la]=Ut(xt,{}),ca="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=rt(ca,r),s=la(ca,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(An.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-Ce*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),_=Math.max(f,h);if(_<b){const v=_+g,w=Math.min(b,v),j=v-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Yc.displayName=ca;var Xc="SelectGroup",[O_,R_]=Ut(Xc),L_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(O_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});L_.displayName=Xc;var Jc="SelectLabel",I_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=R_(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});I_.displayName=Jc;var Rn="SelectItem",[z_,Zc]=Ut(Rn),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=tt(Rn,r),c=rt(Rn,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,v=>c.itemRefCallback?.(v,n,o)),f=Ae(),h=x.useRef("touch"),_=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(z_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(v=>{p(w=>w||(v?.textContent??"").trim())},[]),children:a.jsx(An.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:b,onFocus:V(s.onFocus,()=>g(!0)),onBlur:V(s.onBlur,()=>g(!1)),onClick:V(s.onClick,()=>{h.current!=="mouse"&&_()}),onPointerUp:V(s.onPointerUp,()=>{h.current==="mouse"&&_()}),onPointerDown:V(s.onPointerDown,v=>{h.current=v.pointerType}),onPointerMove:V(s.onPointerMove,v=>{h.current=v.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(s.onKeyDown,v=>{c.searchRef?.current!==""&&v.key===" "||(v_.includes(v.key)&&_(),v.key===" "&&v.preventDefault())})})})})});Qc.displayName=Rn;var br="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=tt(br,r),l=rt(br,r),c=Zc(br,r),d=S_(br,r),[u,p]=x.useState(null),m=J(t,_=>p(_),c.onItemTextChange,_=>l.itemTextRefCallback?.(_,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_r.createPortal(i.children,s.valueNode):null]})});ed.displayName=br;var td="SelectItemIndicator",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var da="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=rt(da,e.__scopeSelect),n=la(da,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});nd.displayName=da;var ua="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=rt(ua,e.__scopeSelect),n=la(ua,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});od.displayName=ua;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=rt("SelectScrollButton",r),s=x.useRef(null),l=Pn(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{c()})})}),M_="SelectSeparator",D_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});D_.displayName=M_;var pa="SelectArrow",F_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=On(r),i=tt(pa,r),s=rt(pa,r);return i.open&&s.position==="popper"?a.jsx(Ks,{...o,...n,ref:t}):null});F_.displayName=pa;var $_="SelectBubbleInput",id=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=g_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:i,defaultValue:t})});id.displayName=$_;function sd(e){return e===""||e===void 0}function ld(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=B_(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function B_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var U_=Dc,H_=$c,V_=Uc,W_=Hc,q_=Vc,G_=Wc,K_=Yc,Y_=Qc,X_=ed,J_=rd,Z_=nd,Q_=od;function Ht({...e}){return a.jsx(U_,{"data-slot":"select",...e})}function Vt({...e}){return a.jsx(V_,{"data-slot":"select-value",...e})}function Wt({className:e,size:t="default",children:r,...n}){return a.jsxs(H_,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(W_,{asChild:!0,children:a.jsx(mo,{className:"ecr-select__icon"})})]})}function qt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(q_,{container:i,children:a.jsxs(G_,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(ev,{}),a.jsx(K_,{className:F("ecr-select__viewport"),children:t}),a.jsx(tv,{})]})})}function Gt({className:e,children:t,...r}){return a.jsxs(Y_,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(J_,{children:a.jsx(zf,{className:"ecr-select__check-icon"})})}),a.jsx(X_,{children:t})]})}function ev({className:e,...t}){return a.jsx(Z_,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Mf,{className:"ecr-select__icon"})})}function tv({className:e,...t}){return a.jsx(Q_,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(mo,{className:"ecr-select__icon"})})}const rv=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Yu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),nv={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function ov(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(Ht,{defaultValue:Qa[0].value,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Qa.map(e=>a.jsx(Gt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:e.label,text:nv[e.value]})})]})},e.value))]})]})]})}const av=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(xr,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(ov,{}),a.jsx(rv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Ln="Collapsible",[iv]=Ve(Ln),[sv,ma]=iv(Ln),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=mt({prop:n,defaultProp:o??!1,onChange:s,caller:Ln});return a.jsx(sv,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":ha(c),"data-disabled":i?"":void 0,...l,ref:t})})});dd.displayName=Ln;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ma(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ha(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var fa="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ma(fa,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(lv,{...n,ref:t,present:i})})});md.displayName=fa;var lv=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ma(fa,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),_=x.useRef(void 0);return x.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),le(()=>{const v=d.current;if(v){_.current=_.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(v.style.transitionDuration=_.current.transitionDuration,v.style.animationName=_.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":ha(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function ha(e){return e?"open":"closed"}var cv=dd,dv=pd,uv=md;function fd({className:e,...t}){return a.jsx(cv,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(dv,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(mo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(uv,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const pv={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},mv=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Gu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Ku.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r.label,text:pv[r.value]})})]})},r.value))]})]})]}),fv=[{Icon:Hf,label:"Desktop",value:"desktop"},{Icon:Kf,label:"Tab",value:"tab"},{Icon:Wf,label:"Mobile",value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=y.useState(n),g=y.useRef(null);y.useEffect(()=>{m(n)},[n]);const b=h=>{const _=Math.min(r,Math.max(t,Number(h)));o(_)},f=h=>{const _=Number(h);m(_),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(_>r?r:_<t?t:_)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Ht,{value:d,onValueChange:h=>u(h),children:[a.jsx(Wt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Vt,{})}),a.jsx(qt,{style:{minWidth:"60px"},children:fv.map(h=>a.jsx(Gt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const _=Number(h.target.value);m(_),b(_)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Zo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},hv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(xd,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},gv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(xd,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},xv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],bv=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:xv.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(Yp,{color:"#2563eb",size:16}):a.jsx(Xp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},_v=Object.values(Za),vv={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},yv=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[_v.map(r=>a.jsx(Gt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r,text:vv[r]})})]})},r))]})]})]}),wv=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx($f,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(bv,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(yv,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(mv,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(gv,{styles:r,updateStyles:n}),a.jsx(hv,{styles:r,updateStyles:n}),a.jsx(xr,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(xr,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(xr,{label:"Show Add to Cart",text:a.jsx(a.Fragment,{children:"Show a clear “Add to Cart” button on your tagged product to encourage quick purchases and boost conversions."})}),a.jsx(xr,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),jv=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Wu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Sv=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Vf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Qo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Qo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(jv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),kv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(wv,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(Sv,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},Cv=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(f_,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(h_,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:i.preview,children:"Preview"})]}),a.jsx(Ic,{value:i.thumbnail,children:a.jsx(kv,{styles:e,updateStyles:c})}),a.jsx(Ic,{value:i.preview,children:a.jsx(av,{styles:e,updateStyles:c})})]})})]})]})},Nv=e=>{const t=Ne(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(ot),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const v=(await he.get(`stories/${e}`)).data;n(v.group_name),i(v.stories),l(v.styles??ot)}catch(_){_ instanceof Error?q.error(_.message):q.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const _=o.map(j=>j.id),v={group_name:r,styles:s,story_ids:_};e&&(v.group_id=e);const w=await he.post("stories/manage-group-stories",v);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),q.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?q.error(h.message):q.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},Ev=e=>{const[t,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return y.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},Tv=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},Av=()=>{const e=Ne(),[t]=Jt(),r=t.get("gid"),n=Ev("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=Nv(r),{allReels:f,searchTerm:h,setSearchTerm:_,isSearching:v,lastStoryElementRef:w,refreshReels:j}=Qi(r),[k,N]=y.useState(""),[C,E]=y.useState(n),[T,A]=y.useState(bd.thumbnail),[O,R]=y.useState([]),L=y.useMemo(()=>new Set(s.map(K=>K.story_uuid)),[s]),P=y.useMemo(()=>h.trim().toLowerCase(),[h]),M=y.useMemo(()=>P?O.filter(K=>K.title.toLowerCase().includes(P)):O,[O,P]),I=y.useMemo(()=>{const K=new Map;for(const de of M)K.set(de.story_uuid,de);for(const de of f)K.has(de.story_uuid)||K.set(de.story_uuid,de);return Array.from(K.values())},[M,f]),B=y.useMemo(()=>I.filter(K=>!L.has(K.story_uuid)),[I,L]);y.useEffect(()=>{E(n)},[n]),y.useEffect(()=>{R([])},[r]);const{showLeaveModal:z,requestLeave:G,confirmLeave:ae,cancelLeave:ie,allowNextNavigation:ge}=Tv(m),_e=async(K,de)=>{try{N(K.story_uuid);const $=de==="add"?[K,...s]:s.filter(Y=>Y.story_uuid!==K.story_uuid);l($),R(de==="add"?Y=>Y.filter(oe=>oe.story_uuid!==K.story_uuid):Y=>Y.some(oe=>oe.story_uuid===K.story_uuid)?Y:[K,...Y]),g(!0)}catch($){$ instanceof Error?q.error($.message):q.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const K=await b();K&&(R([]),j()),K?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${K.group_id}`,{replace:!0})})};return u?a.jsx(Ir,{}):a.jsxs(Fb,{value:{requestLeave:G},children:[a.jsx(St,{left:[a.jsx(kt,{name:"Manage Widget",Icon:Or},"page"),a.jsx(rr,{cb:()=>G(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(es,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Wo,{children:[a.jsx(qo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(ub,{})}),a.jsxs(Go,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Customize title appearance"})}),a.jsx(zb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(z0,{asChild:!0,children:a.jsx(te,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(db,{isExpanded:C,setIsExpanded:E},"toggle"),a.jsx(po,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:K=>G(()=>e(K))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Kb,{allReels:B,gid:r,handleSelectReel:_e,searchTerm:h,setSearchTerm:_,isSearching:v,togglingId:k,lastStoryElementRef:w}),a.jsx(Gb,{gid:r,reels:s,styles:c,handleRemoveReel:_e,togglingId:k,currentTab:T}),C&&a.jsx(Cv,{isExpanded:C,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:bd,setCurrentTab:A,currentTab:T})]}),z&&a.jsx(Rr,{onReject:ie,onAccept:ae,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function Pv(){const[e]=Jt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(ob,{});break;case X.ar:r=a.jsx(Ef,{});break;case X.stat:r=a.jsx(sb,{});break;case X.cr:r=a.jsx(K0,{});break;case X.mg:r=a.jsx(Av,{});break;default:r=a.jsx(rb,{})}return a.jsxs("div",{children:[r,a.jsx(Hu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const _d=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},vd=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),Ov=()=>{const e=y.useContext(ga);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=y.useState(r.length-1),[d,u]=y.useState(null),[p,m]=y.useState(!0),[g,b]=y.useState(0),[f,h]=y.useState(!1),[_,v]=y.useState({index:0,story_uuid:r[0]?.story_uuid??""}),w=d?.links&&d.links.length>0?d.links[0]:null,j=t?.playerAppearance??"overlay",k=y.useRef(""),N=y.useCallback((L,P=1)=>{if(r.length===0)return null;let M=L;for(let I=0;I<r.length;I+=1){const B=r[M];if(vd(B))return{story:B,index:M};M=(M+P+r.length)%r.length}return null},[r]),C=y.useCallback(()=>{c(r.length-1);const L=r.findIndex(I=>String(I.story_uuid)===o),P=L>=0?r[L]:null,M=vd(P)?{story:P,index:L}:N(Math.max(L,0),1);if(!M?.story){u(null),m(!1);return}u(M.story),L!==M.index&&M.story.story_uuid!==o&&i(M.story.story_uuid),v({index:0,story_uuid:M.story.story_uuid}),m(!1)},[N,o,i,r]);y.useEffect(()=>{C()},[C]),y.useEffect(()=>(k.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=k.current}),[]);const E=y.useCallback(()=>{i(null)},[i]),T=y.useCallback((L=1)=>{m(!0);const P=r.findIndex(G=>String(G.story_uuid)===String(o)),M=L>0?1:-1,I=L>0?l>P?P+1:0:P>0?P-1:l,B=N(I,M);if(!B?.story){m(!1);return}const z=B.story;if(z.story_uuid===o){m(!1),E();return}v({index:0,story_uuid:z.story_uuid}),n&&_d(n,z.id,s),i(z.story_uuid),m(!1)},[E,N,n,o,l,i,s,r]),A=y.useCallback(()=>{const L=d?.files??[];if(_.index>0){v(P=>({index:P.index-1,story_uuid:L[P.index-1].story_uuid??""}));return}T(-1)},[_.index,T,d?.files]),O=y.useCallback(()=>{const L=d?.files??[];if(_.index+1<L.length){v(P=>({index:P.index+1,story_uuid:L[P.index+1].story_uuid??""}));return}T(1)},[_.index,T,d?.files]),R=y.useCallback(L=>{L.target===L.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:_,duration:g,handleBackdropClick:R,handleNextFile:O,handlePrevFile:A,isLoadingNext:p,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsPlaying:i,firstLink:w,playerAppearance:j}},Rv=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),Lv=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:i,isLoadingNext:s,isPaused:l,playerAppearance:c,playingStory:d,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=Ov();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:d&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(wt,{onClick:i,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}),a.jsx(wt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[d&&a.jsx(si,{playingStory:d,duration:r,currentFileIndex:t,isPaused:l},`${d.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),s?a.jsx(Rv,{}):d?.files.length>0&&a.jsx(ui,{currentFileIndex:t,files:d?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:i,handleNextFile:o,storyId:d.id,storyTitle:d?.title}),c==="overlay"?u?a.jsx(En,{link:u,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:d.title}):null,c==="title"?a.jsx(Bt,{title:d.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Zn,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(En,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},Iv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Qt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(er,{size:20,style:{width:"20px",height:"20px"}})})]})},wd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),zv={carousel:Iv,grid:wd},Mv=()=>{const e=y.useContext(ga),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=zv[d]||wd,p=({sid:m,story_uuid:g})=>{i(g),o&&_d(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Dv=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(ot),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(ot),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||ot)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ga=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=Dv(e);return a.jsxs(ga.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(Lv,{}),a.jsx(Mv,{})]})};va(()=>{const e=document.getElementById("ecommreels-admin-app");e&&In.createRoot(e).render(a.jsx(Zd,{children:a.jsx(Pv,{})}))}),va(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
     372For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},N0="DialogDescriptionWarning",E0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(N0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},T0=jl,A0=kl,P0=Nl,O0=El,R0=Tl,L0=Pl,Ml=Ll;function Wo({...e}){return a.jsx(T0,{"data-slot":"dialog",...e})}function qo({...e}){return a.jsx(A0,{"data-slot":"dialog-trigger",...e})}function I0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(P0,{"data-slot":"dialog-portal",container:t,...e})}function z0({className:e,...t}){return a.jsx(O0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function Go({className:e,children:t,...r}){return a.jsxs(I0,{children:[a.jsx(z0,{}),a.jsxs(R0,{"data-slot":"dialog-content",className:F("ecr-dialog__content",e),...r,children:[t,a.jsx(Ml,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(ns,{className:"ecr-dialog__close-icon"})})]})]})}function Ko({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Yo({className:e,...t}){return a.jsx(L0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function M0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const D0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,i]=y.useState([]),[s,l]=y.useState(1),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=uo(b,500),v=y.useRef(!0),_=y.useRef(0),w=y.useRef(null),[j,k]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){k("Missing API configuration."),g(!1),p(!1);return}const O=++_.current;w.current&&w.current.abort();const R=new AbortController;w.current=R,T===1&&v.current?g(!0):p(!0);try{const L={page:T,per_page:50};h&&(L.search=h);const A=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:L,signal:R.signal}),P=A.data,z=parseInt(A.headers["x-wp-totalpages"]||"1",10);O===_.current&&(i(I=>T===1?P:[...I,...P]),l(T+1),d(T<z))}catch(L){if(R.signal.aborted)return;L instanceof Error?k(L.message):k("An unknown error occurred")}finally{v.current&&(v.current=!1),O===_.current&&!R.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),i([]),k(null),v.current=!0,N(1))},[h,N,t]);const C=y.useRef(null),E=y.useCallback(T=>{u||(C.current&&C.current.disconnect(),C.current=new IntersectionObserver(O=>{O[0].isIntersecting&&c&&N(s)}),T&&C.current.observe(T))},[u,c,s,N]);return y.useEffect(()=>()=>{C.current&&C.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:i,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},jn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",Dl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:F("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),F0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:i,searchTerm:s,setSearchTerm:l,error:c})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),g=f=>{m(!1),u(h=>h.includes(f.id)?h.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const h=new Set(d),v=[];for(const _ of r)h.has(_.id)&&v.push({btn_type:"product",btn_uuid:_n(),buttonText:_.name,buttonUrl:_.permalink,rating:_.average_rating,price:_.price_html,thumbnail:_.images?.[0]?.thumbnail||_.images?.[0]?.src||jn,product_id:_.id});e(v),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:s,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Fl,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,h)=>{const v=d.includes(f.id);return a.jsx("div",{ref:r.length===h+1?i:null,className:"ecr-admin-product-link__item",style:d.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(te,{type:"button",onClick:()=>g(f),className:F("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(qf,{size:20,color:"#2563eb"}):a.jsx(Gf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||jn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Fl,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(Dl,{name:"add",handleClick:b})})]})]})},Fl=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),$0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,B0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&$0.test(n)||b.push("url"),i||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:_n(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(Sn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(Sn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function Sn({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const U0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,i]=y.useState(null),[s,l]=y.useState(!1),c=D0({enabled:s}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(g=>g.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(vn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Wo,{open:o==="custom",onOpenChange:g=>i(g?"custom":null),children:[a.jsxs(qo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Bf,{size:20})," Add Custom Link"]}),a.jsxs(Go,{className:"ecr-admin-link-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(B0,{handleLinks:g=>{e(b=>[...b,g]),i(null)}})})]})]}),u&&a.jsxs(Wo,{open:o==="product",onOpenChange:g=>i(g?"product":null),children:[a.jsxs(qo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Yf,{size:20})," Tag Products"]}),a.jsxs(Go,{className:"ecr-admin-link-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(F0,{handleLinks:g=>{e(g),i(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},H0=({links:e,onLinksChange:t})=>{const r=o=>{t(i=>i.filter(s=>s.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(te,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Xf,{size:16})})]},o.btn_uuid)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(at,{size:20})]}),a.jsx(Qe,{className:"ecr-admin-links__popover",children:a.jsx(ft,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(U0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return U({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const V0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,playsInline:!0,preload:"metadata",onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onError:o,"webkit-playsinline":"true",onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},W0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(V0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Xn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},q0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(W0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(Je,{children:[a.jsxs(Ze,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(at,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(Qe,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ft,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},G0=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:_n()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:F("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:$o,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})},K0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx($l,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(G0,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),Y0=()=>{const e=Ne(),[t]=Jt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(h=>{i(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=y.useCallback(h=>{i(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=y.useCallback(h=>{i(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=y.useCallback(h=>{i(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{c&&(p(h=>h.filter(v=>v.file_uuid!==c)),d(null))},f=y.useCallback(async h=>{try{l(!0);const v=await he.get(`story/${h}`);i({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?q.error(v.message):q.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Ir,{}):a.jsxs(a.Fragment,{children:[a.jsx(Af,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Rr,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(q0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(b0,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(K0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(vn,{className:"ecr-admin-create__separator"}),a.jsx(H0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(up,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Xo,Ul;function X0(){return Ul||(Ul=1,Xo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Xo}var Jo,Hl;function J0(){if(Hl)return Jo;Hl=1;var e=X0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=t[s.format]||t.default;window.clipboardData.setData(h,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return Jo=o,Jo}var Z0=J0();const Vl=kd(Z0);function Wl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:F("ecr-table",e),...t})})}function ql({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:F("ecr-table__header",e),...t})}function Gl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:F("ecr-table__body",e),...t})}function kn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:F("ecr-table__row",e),...t})}function Kl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:F("ecr-table__head",e),...t})}function ze({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:F("ecr-table__cell",e),...t})}function Yl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:F("ecr-table__caption",e),...t})}const Q0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],eb=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Vl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Wl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(lt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(ql,{children:a.jsx(kn,{children:Q0.map((s,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Gl,{children:e.map((s,l)=>a.jsxs(kn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(ze,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(op,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:F("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(ze,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(te,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(_t,{to:`?view=${X.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(pi,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(_t,{to:`?view=${X.mg}&gid=${s.id}`,children:a.jsx(Or,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(te,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(dp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Xl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),tb=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[b]=y.useState(20),[f,h]=y.useState(0),[v,_]=y.useState(1),w=uo(u,500),j=y.useCallback(async E=>{const T=new AbortController,O=E===1;try{O?i(!0):l(!0),n("");const R=await he.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),L=Number(R.headers?.["x-wp-total"]??0),A=Number(R.headers?.["x-wp-totalpages"]??1),P=Math.max(1,A||1);t(z=>{if(O)return R.data;const I=new Set(z.map(M=>M.id)),B=R.data.filter(M=>!I.has(M.id));return[...z,...B]}),h(L),_(P),E>P&&g(P)}catch(R){if(T.signal.aborted)return;R instanceof Error?n(R.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(O?i(!1):l(!1))}},[b,w]),k=y.useCallback(()=>{g(E=>o||s||E>=v?E:E+1)},[o,s,v]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),C=y.useCallback(async E=>{try{d(!0),await he.delete(`group/${E}`),await N(),q.success("Group deleted successfully!")}catch(T){T instanceof Error?q.error(T.message):q.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:k,refreshGroups:N,deleteGroup:C}},rb={docs:"https://reelswp.com/docs/"},nb=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=tb(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:"All Widgets",Icon:pp},"page")],center:[a.jsx(zr,{},"reel-wp")],right:[a.jsxs("a",{href:rb.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Ff,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Lr,{to:`?view=${X.cr}`,text:"Add Reel",Icon:yt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Rr,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(te,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(tr,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(oi,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Lr,{to:`?view=${X.mg}`,text:"Create Widget",Icon:yt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx(eb,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(Uf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},ob=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(b=>({...b,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){q.error("Please enter valid numbers.");return}try{l(!0),d(!1),await he.post("settings",{rate_limit:m,time_limit:g}),q.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?q.error(b.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const b=await he.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?q.error(b.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},ab=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=ob();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Ir,{}),a.jsx(St,{left:[a.jsx(kt,{name:"Settings",Icon:Np},"Settings"),a.jsx(rr,{},"back-settings")],center:[a.jsx(zr,{},"Settings-widget-name")],right:[a.jsx(po,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},ib=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],sb=({tableData:e})=>a.jsxs(Wl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Yl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(kn,{children:ib.map((t,r)=>a.jsx(Kl,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Gl,{children:e.map((t,r)=>a.jsxs(kn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(ze,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(ze,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),lb=()=>{const[e]=Jt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await he.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?q.error(g.message):q.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(kt,{name:"Statistics",Icon:pi},"Statistics"),a.jsx(rr,{},"Statistics-back")],center:[a.jsx(zr,{},"Statistics-widget-name")]}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Xl,{}):d?a.jsx(Bl,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(lt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(sb,{tableData:i})})]})]})};function cb(e){return U({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function db(e){return U({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const ub=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:F("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(cb,{size:24})}),pb=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Zo=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:F("ecr-input",e),...r}));Zo.displayName="Input";const Qo=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},g=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Zo,{type:"number",min:t,max:r,value:d,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function Be(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,et=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*et:0,v:i/Dt*et,a:o}},Jl=e=>{var{h:t,s:r,l:n,a:o}=Zl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/et;return{h:t,s:i>0&&i<200?r*n/et/(i<=et?i:200-i)*et:0,l:i/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},mb=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(i||"")},fr=e=>mr(fb(e)),fb=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},Cn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/et,l=n/et,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),D({},g,{a:o})},hb=e=>{var{r:t,g:r,b:n,a:o}=Cn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},gb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},xb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},ea=e=>Ql(Cn(e)),bb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},vb=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},Ft=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&ta(e)?(s=fr(e),c=e):typeof e!="string"&&(s=e),s&&(n=bb(s),i=Zl(s),o=Cn(s),d=mb(o),c=ea(s),r=xb(i),t=gb(o),l=vb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},ta=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ec(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var hr=e=>"touches"in e,tc=e=>{!hr(e)&&e.preventDefault&&e.preventDefault()},rc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nc=(e,t)=>{var r=e.getBoundingClientRect(),n=hr(t)?t.touches[0]:t;return{left:rc((n.pageX-(r.left+window.pageXOffset))/r.width),top:rc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},_b=["prefixCls","className","onMove","onDown"],ra=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=Be(e,_b),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=ec(o),m=ec(i),g=_=>c.current&&!hr(_)?!1:(c.current=hr(_),!0),b=y.useCallback(_=>{if(tc(_),!!l.current){var w=hr(_)?_.touches.length>0:_.buttons>0;if(!w){u(!1);return}p?.(nc(l.current,_),_)}},[p]),f=y.useCallback(()=>u(!1),[]),h=y.useCallback(_=>{_?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(h(d),()=>{h(!1)}),[d,b,f,h]);var v=y.useCallback(_=>{var w=document.activeElement;w?.blur(),tc(_.nativeEvent),g(_.nativeEvent)&&l.current&&(m?.(nc(l.current,_.nativeEvent),_.nativeEvent),u(!0))},[m]);return a.jsx("div",D({},s,{className:[r,n||""].filter(Boolean).join(" "),style:D({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});ra.displayName="Interactive";var yb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},wb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=Be(e,wb),m=D({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(v,_)=>{u&&d&&u({h:d.h,s:v.left*100,v:(1-v.top)*100,a:d.a})},b=y.useCallback(v=>{if(!(!d||!u)){var _=1,w=d.s,j=d.v,k=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,d.s-_),k=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+_),k=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+_),k=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-_),k=!0,v.preventDefault();break;default:return}k&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var v={top:100-d.v+"%",left:d.s+"%",color:Jl(d)};return i&&typeof i=="function"?i(D({prefixCls:n},v)):a.jsx(yb,D({prefixCls:n},v))},[d,i,n]),h=y.useCallback(v=>{v.target.focus()},[]);return a.jsx(ra,D({className:[n,s||""].filter(Boolean).join(" ")},p,{style:D({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:b,onClick:h,children:f}))});oc.displayName="Saturation";var jb=["className","prefixCls","left","top","style","fillProps"],Sb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=Be(e,jb),c=D({},i,{position:"absolute",left:n,top:o}),d=D({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",D({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",D({className:r+"-fill"},s,{style:d}))}))},kb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],Cb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Nn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=Be(e,kb),v=T=>{b&&b(D({},o,{a:m==="horizontal"?T.left:T.top}),T)},_=Jl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+_+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var k=D({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+Cb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var O=.01,R=o.a,L=R;switch(T.key){case"ArrowLeft":m==="horizontal"&&(L=Math.max(0,R-O),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(L=Math.min(1,R+O),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(L=Math.max(0,R-O),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(L=Math.min(1,R+O),T.preventDefault());break;default:return}if(L!==R){var A={left:m==="horizontal"?L:o.a,top:m==="vertical"?L:o.a,width:0,height:0,x:0,y:0};b&&b(D({},o,{a:L}),A)}},[o,m,b]),C=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(D({prefixCls:r},c,j)):a.jsx(Sb,D({},c,{prefixCls:r},j));return a.jsxs("div",D({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:k,ref:t,children:[a.jsx("div",D({},s,{style:D({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(ra,D({},l,{style:D({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:C,onKeyDown:N,children:E}))]}))});Nn.displayName="Alpha";var Nb=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Eb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),Tb=e=>Number(String(e).replace(/%/g,"")),$t=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=Be(e,Nb),[b,f]=y.useState(i),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(C,E){var T=(E||C.target.value).trim().replace(/^#/,"");Eb(T)&&u&&u(C,T);var O=Tb(T);isNaN(O)||u&&u(C,O),f(T)}function _(C){h.current=!1,f(e.value),p&&p(C)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=D({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),k=D({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=D({value:b,onChange:v,onBlur:_,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:k,onFocusCapture:C=>{var E=C.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",D({ref:t},N)),o&&a.jsx("span",{style:D({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});$t.displayName="EditableInput";var Ab=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=Be(e,Ab),g=n?Cn(n):{};function b(_){var w=Number(_.target.value);w&&w>255&&(_.target.value="255"),w&&w<0&&(_.target.value="0")}var f=_=>{var w=Number(_.target.value);w&&w>100&&(_.target.value="100"),w&&w<0&&(_.target.value="0")},h=(_,w,j)=>{typeof _=="number"&&(w==="a"&&(_<0&&(_=0),_>100&&(_=100),p&&p(Ft(mr(D({},g,{a:_/100}))))),_>255&&(_=255,j.target.value="255"),_<0&&(_=0,j.target.value="0"),w==="r"&&p&&p(Ft(mr(D({},g,{r:_})))),w==="g"&&p&&p(Ft(mr(D({},g,{g:_})))),w==="b"&&p&&p(Ft(mr(D({},g,{b:_})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",D({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:D({fontSize:11,display:"flex"},u),children:[a.jsx($t,D({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"r",_)},i,{style:D({},i.style)})),a.jsx($t,D({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"g",_)},s,{style:D({marginLeft:5},i.style)})),a.jsx($t,D({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"b",_)},l,{style:D({marginLeft:5},l.style)})),c&&a.jsx($t,D({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(_,w)=>h(w,"a",_)},c,{style:D({marginLeft:5},c.style)}))]}))});ac.displayName="EditableInputRGBA";var Pb=["prefixCls","className","hue","onChange","direction"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=Be(e,Pb);return a.jsx(Nn,D({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});ic.displayName="Hue";var Ob=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=Be(e,Ob),g=D({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,h)=>{c&&c(fr(f),Ft(fr(f)),h)};return a.jsxs("div",D({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:D({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,h)=>{var v="",_="";typeof f=="string"&&(v=f,_=f),typeof f=="object"&&f.color&&(v=f.title||f.color,_=f.color);var w=o&&o.toLocaleLowerCase()===_.toLocaleLowerCase(),j=p&&p({title:v,color:_,checked:!!w,style:D({},g,{background:_}),onClick:N=>b(_,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var k=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:_,checked:w}):null;return a.jsx("div",D({tabIndex:0,title:v,onClick:N=>b(_,N)},l,{children:k,style:D({},g,{background:_})}),h)}),d&&y.isValidElement(d)&&d]}))});sc.displayName="Swatch";var Rb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],Lb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],lc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),cc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=Lb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=Be(e,Rb),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ta(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Ft(N))},f=(N,C)=>{typeof N=="string"&&ta(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(D({},m,{a:N.a})),v=N=>b(D({},m,N,{a:m.a})),_=D({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:hb(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},k={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",D({},p,{className:r+" "+(n||""),ref:t,style:_,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(oc,{hsva:m,style:{width:"auto",height:150},onChange:v}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ic,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(D({},m,N))}),!d&&a.jsx(Nn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!d&&a.jsx(Nn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx($t,{label:"Hex",value:ea(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,C)=>f(C),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),s&&s.length>0&&a.jsx(sc,{style:j,colors:s,color:ea(m),onChange:N=>b(N),rectProps:{style:k}})]}))});cc.displayName="Sketch";const dc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Je,{children:[a.jsx(Ze,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(Qe,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(cc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),Ib=[{value:"left",title:"Align Left",Icon:Hp},{value:"center",title:"Align Center",Icon:Vp},{value:"right",title:"Align Right",Icon:Wp},{value:"hidden",title:"Hidden",Icon:qp}],zb=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:Ib.map(({value:r,title:n,Icon:o})=>a.jsx(te,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),Mb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(zb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Qo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},Db=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Vl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},Fb=({gid:e})=>{const[t,r]=Db(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Df,{color:"#ffffff",size:12})}),a.jsx("span",{className:F("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},uc=y.createContext({requestLeave:e=>e()}),$b=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function Bb(e){return U({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const Ub=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Hb,{link:e,usedFor:t})}),Hb=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||jn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||jn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx(Bb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Vb=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},En=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(Ub,{link:e,usedFor:t},e.btn_uuid):a.jsx(Vb,{link:e,usedFor:t},e.btn_uuid)}),Bt=({title:e,styles:t})=>a.jsx("p",{className:"ecr-reel_title",style:t,children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=Ne(),{requestLeave:s}=pc(),l=n===e.story_uuid,c=`?view=${X.cr}&from=${X.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=t.border.border_radius,m=p>50?p+16:p>20?p:0,g=e.links&&e.links.length>0?e.links[0]:null,b=d==="none",f=d==="title",h=t.shape==="rectangle",v=!b&&!f&&g;return a.jsxs("div",{className:F("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Zn,{story:e,styles:t}),!b&&!f&&h?v?a.jsx(En,{link:g,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(te,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(_t,{to:c,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:_=>{_.preventDefault(),s(()=>i(c))},children:a.jsx(Or,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(te,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(it,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Wn,{size:18})})]})]}),f?a.jsx("p",{className:"ecr-admin-reel__title",children:e.title}):null]})},fc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const h=f.scrollLeft,v=f.scrollWidth,_=f.clientWidth;c(h>0),u(h+_<v-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(s(h.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const b=f=>{const h=r.current;h&&(h.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let h=!1,v,_;const w=O=>{h=!0,v=O.pageX-f.offsetLeft,_=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},k=()=>{h=!1,f.style.cursor="default"},N=O=>{if(!h)return;O.preventDefault();const L=(O.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-L,g()},C=O=>{h=!0,v=O.touches[0].pageX-f.offsetLeft,_=f.scrollLeft},E=()=>{h=!1},T=O=>{if(!h)return;const L=(O.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-L,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",k),f.addEventListener("mousemove",N),f.addEventListener("touchstart",C,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",k),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",C),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"}},className:F("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(mc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Qt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(er,{size:20})})]})},Wb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>a.jsx("div",{className:F("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(mc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(lt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})}),qb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(wt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsx(wt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(er,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,v=h.videoWidth,_=h.videoHeight;d(()=>_>v)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Xn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"?b?a.jsx(En,{link:b,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title}):null,g==="title"?a.jsx(Bt,{title:e.title}):null]})})},Gb={carousel:hc,grid:Wb},Kb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=Gb[s]||hc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(Fb,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(qb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(lt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Yb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=Ne(),{requestLeave:d}=pc(),u=`?view=${X.cr}&from=${X.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Lr,{to:u,text:"Add Reel",Icon:yt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(it,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=Ve(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:h,children:v}=f,_=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:h,itemMap:w,collectionRef:_,children:v})};s.displayName=t;const l=e+"CollectionSlot",c=st(l),d=y.forwardRef((f,h)=>{const{scope:v,children:_}=f,w=i(l,v),j=J(h,w.collectionRef);return a.jsx(c,{ref:j,children:_})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=st(u),g=y.forwardRef((f,h)=>{const{scope:v,children:_,...w}=f,j=y.useRef(null),k=J(h,j),N=i(u,v);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:k,children:_})});g.displayName=u;function b(f){const h=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const _=h.collectionRef.current;if(!_)return[];const w=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((N,C)=>w.indexOf(N.ref.current)-w.indexOf(C.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,n]}var Xb=x.createContext(void 0);function na(e){const t=x.useContext(Xb);return e||t||"ltr"}var oa="rovingFocusGroup.onEntryFocus",Jb={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[aa,bc,Zb]=xc(gr),[Qb,vc]=Ve(gr,[Zb]),[ev,tv]=Qb(gr),_c=x.forwardRef((e,t)=>a.jsx(aa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(aa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(rv,{...e,ref:t})})}));_c.displayName=gr;var rv=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=J(t,m),b=na(i),[f,h]=mt({prop:s,defaultProp:l??null,onChange:c,caller:gr}),[v,_]=x.useState(!1),w=We(d),j=bc(r),k=x.useRef(!1),[N,C]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(oa,w),()=>E.removeEventListener(oa,w)},[w]),a.jsx(ev,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>C(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:v||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{k.current=!0}),onFocus:V(e.onFocus,E=>{const T=!k.current;if(E.target===E.currentTarget&&T&&!v){const O=new CustomEvent(oa,Jb);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const R=j().filter(I=>I.focusable),L=R.find(I=>I.active),A=R.find(I=>I.id===f),z=[L,A,...R].filter(Boolean).map(I=>I.ref.current);jc(z,u)}}k.current=!1}),onBlur:V(e.onBlur,()=>_(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ae(),d=i||c,u=tv(yc,r),p=u.currentTabStopId===d,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(aa.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,h=>{n?u.onItemFocus(d):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=av(h,u.orientation,u.dir);if(v!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const j=w.indexOf(h.currentTarget);w=u.loop?iv(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});wc.displayName=yc;var nv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ov(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function av(e,t,r){const n=ov(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return nv[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function iv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var sv=_c,lv=wc,Tn="Tabs",[cv]=Ve(Tn,[vc]),Sc=vc(),[dv,ia]=cv(Tn),kc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=na(l),[p,m]=mt({prop:n,onChange:o,defaultProp:i??"",caller:Tn});return a.jsx(dv,{scope:r,baseId:Ae(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});kc.displayName=Tn;var Cc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=ia(Cc,r),s=Sc(r);return a.jsx(sv,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Nc.displayName=Cc;var Ec="TabsTrigger",Tc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=ia(Ec,r),l=Sc(r),c=Oc(s.baseId,n),d=Rc(s.baseId,n),u=n===s.value;return a.jsx(lv,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=ia(Ac,r),c=Oc(l.baseId,n),d=Rc(l.baseId,n),u=n===l.value,p=x.useRef(u);return x.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ye,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var uv=kc,pv=Nc,mv=Tc,fv=Pc;function hv({className:e,...t}){return a.jsx(uv,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function gv({className:e,...t}){return a.jsx(pv,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(mv,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(fv,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}const xr=({label:e,text:t})=>a.jsxs(Je,{children:[a.jsx(Ze,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(at,{size:20})]}),a.jsx(db,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(Qe,{className:"ecr-admin-popover",children:a.jsx(ft,{name:e,text:t})})]});function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function xv(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bv="VisuallyHidden",vv=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));vv.displayName=bv;var _v=[" ","Enter","ArrowUp","ArrowDown"],yv=[" ","Enter"],gt="Select",[An,Pn,wv]=xc(gt),[Ut]=Ve(gt,[wv,an]),On=an(),[jv,tt]=Ut(gt),[Sv,kv]=Ut(gt),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=On(t),[h,v]=x.useState(null),[_,w]=x.useState(null),[j,k]=x.useState(!1),N=na(d),[C,E]=mt({prop:n,defaultProp:o??!1,onChange:i,caller:gt}),[T,O]=mt({prop:s,defaultProp:l,onChange:c,caller:gt}),R=x.useRef(null),L=h?b||!!h.closest("form"):!0,[A,P]=x.useState(new Set),z=Array.from(A).map(I=>I.props.value).join(";");return a.jsx(qs,{...f,children:a.jsxs(jv,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:k,contentId:Ae(),value:T,onValueChange:O,open:C,onOpenChange:E,dir:N,triggerPointerDownPosRef:R,disabled:m,children:[a.jsx(An.Provider,{scope:t,children:a.jsx(Sv,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(I=>{P(B=>new Set(B).add(I))},[]),onNativeOptionRemove:x.useCallback(I=>{P(B=>{const M=new Set(B);return M.delete(I),M})},[]),children:r})}),L?a.jsxs(id,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:I=>O(I.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(A)]},z):null]})})};Dc.displayName=gt;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=On(r),s=tt(Fc,r),l=s.disabled||n,c=J(t,s.onTriggerChange),d=Pn(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=d().filter(w=>!w.disabled),v=h.find(w=>w.value===s.value),_=cd(h,f,v);_!==void 0&&s.onValueChange(_.value)}),b=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Oo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":sd(s.value)?"":void 0,...o,ref:c,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const h=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(h&&f.key===" ")&&_v.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=tt(Bc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=J(t,c.onValueNodeChange);return le(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:sd(c.value)?a.jsx(a.Fragment,{children:s}):i})});Uc.displayName=Bc;var Cv="SelectIcon",Hc=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=Cv;var Nv="SelectPortal",Vc=e=>a.jsx(sn,{asChild:!0,...e});Vc.displayName=Nv;var xt="SelectContent",Wc=x.forwardRef((e,t)=>{const r=tt(xt,e.__scopeSelect),[n,o]=x.useState();if(le(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?vr.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(An.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=xt;var Ce=10,[qc,rt]=Ut(xt),Ev="SelectContentImpl",Tv=st("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,_=tt(xt,r),[w,j]=x.useState(null),[k,N]=x.useState(null),C=J(t,$=>j($)),[E,T]=x.useState(null),[O,R]=x.useState(null),L=Pn(r),[A,P]=x.useState(!1),z=x.useRef(!1);x.useEffect(()=>{if(w)return Lo(w)},[w]),go();const I=x.useCallback($=>{const[Y,...oe]=L().map(re=>re.ref.current),[Z]=oe.slice(-1),Q=document.activeElement;for(const re of $)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===Y&&k&&(k.scrollTop=0),re===Z&&k&&(k.scrollTop=k.scrollHeight),re?.focus(),document.activeElement!==Q))return},[L,k]),B=x.useCallback(()=>I([E,w]),[I,E,w]);x.useEffect(()=>{A&&B()},[A,B]);const{onOpenChange:M,triggerPointerDownPosRef:G}=_;x.useEffect(()=>{if(w){let $={x:0,y:0};const Y=Z=>{$={x:Math.abs(Math.round(Z.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(G.current?.y??0))}},oe=Z=>{$.x<=10&&$.y<=10?Z.preventDefault():w.contains(Z.target)||M(!1),document.removeEventListener("pointermove",Y),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,M,G]),x.useEffect(()=>{const $=()=>M(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[M]);const[ie,se]=ld($=>{const Y=L().filter(Q=>!Q.disabled),oe=Y.find(Q=>Q.ref.current===document.activeElement),Z=cd(Y,$,oe);Z&&setTimeout(()=>Z.ref.current.focus())}),ge=x.useCallback(($,Y,oe)=>{const Z=!z.current&&!oe;(_.value!==void 0&&_.value===Y||Z)&&(T($),Z&&(z.current=!0))},[_.value]),ve=x.useCallback(()=>w?.focus(),[w]),pe=x.useCallback(($,Y,oe)=>{const Z=!z.current&&!oe;(_.value!==void 0&&_.value===Y||Z)&&R($)},[_.value]),K=n==="popper"?sa:Kc,de=K===sa?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:k,onViewportChange:N,itemRefCallback:ge,selectedItem:E,onItemLeave:ve,itemTextRefCallback:pe,focusSelectedItem:B,selectedItemText:O,position:n,isPositioned:A,searchRef:ie,children:a.jsx(gn,{as:Tv,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:_.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{_.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Gr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:a.jsx(K,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:$=>$.preventDefault(),...v,...de,onPlaced:()=>P(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:V(v.onKeyDown,$=>{const Y=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Y&&$.key.length===1&&se($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let Z=L().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,re=Z.indexOf(Q);Z=Z.slice(re+1)}setTimeout(()=>I(Z)),$.preventDefault()}})})})})})})});Gc.displayName=Ev;var Av="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=tt(xt,r),s=rt(xt,r),[l,c]=x.useState(null),[d,u]=x.useState(null),p=J(t,C=>u(C)),m=Pn(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:_}=s,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&h&&v){const C=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),O=v.getBoundingClientRect();if(i.dir!=="rtl"){const Q=O.left-E.left,re=T.left-Q,_e=C.left-re,bt=C.width+_e,xa=Math.max(bt,E.width),ba=window.innerWidth-Ce,va=zc(re,[Ce,Math.max(Ce,ba-xa)]);l.style.minWidth=bt+"px",l.style.left=va+"px"}else{const Q=E.right-O.right,re=window.innerWidth-T.right-Q,_e=window.innerWidth-C.right-re,bt=C.width+_e,xa=Math.max(bt,E.width),ba=window.innerWidth-Ce,va=zc(re,[Ce,Math.max(Ce,ba-xa)]);l.style.minWidth=bt+"px",l.style.right=va+"px"}const R=m(),L=window.innerHeight-Ce*2,A=f.scrollHeight,P=window.getComputedStyle(d),z=parseInt(P.borderTopWidth,10),I=parseInt(P.paddingTop,10),B=parseInt(P.borderBottomWidth,10),M=parseInt(P.paddingBottom,10),G=z+I+A+M+B,ie=Math.min(h.offsetHeight*5,G),se=window.getComputedStyle(f),ge=parseInt(se.paddingTop,10),ve=parseInt(se.paddingBottom,10),pe=C.top+C.height/2-Ce,K=L-pe,de=h.offsetHeight/2,$=h.offsetTop+de,Y=z+I+$,oe=G-Y;if(Y<=pe){const Q=R.length>0&&h===R[R.length-1].ref.current;l.style.bottom="0px";const re=d.clientHeight-f.offsetTop-f.offsetHeight,_e=Math.max(K,de+(Q?ve:0)+re+B),bt=Y+_e;l.style.height=bt+"px"}else{const Q=R.length>0&&h===R[0].ref.current;l.style.top="0px";const _e=Math.max(pe,z+f.offsetTop+(Q?ge:0)+de)+oe;l.style.height=_e+"px",f.scrollTop=Y-pe+f.offsetTop}l.style.margin=`${Ce}px 0`,l.style.minHeight=ie+"px",l.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,h,v,i.dir,n]);le(()=>w(),[w]);const[j,k]=x.useState();le(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const N=x.useCallback(C=>{C&&b.current===!0&&(w(),_?.(),b.current=!1)},[w,_]);return a.jsx(Ov,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=Av;var Pv="SelectPopperPosition",sa=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ce,...i}=e,s=On(r);return a.jsx(Gs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});sa.displayName=Pv;var[Ov,la]=Ut(xt,{}),ca="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=rt(ca,r),s=la(ca,r),l=J(t,i.onViewportChange),c=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(An.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const b=window.innerHeight-Ce*2,f=parseFloat(p.style.minHeight),h=parseFloat(p.style.height),v=Math.max(f,h);if(v<b){const _=v+g,w=Math.min(b,_),j=_-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Yc.displayName=ca;var Xc="SelectGroup",[Rv,Lv]=Ut(Xc),Iv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ae();return a.jsx(Rv,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Iv.displayName=Xc;var Jc="SelectLabel",zv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Lv(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});zv.displayName=Jc;var Rn="SelectItem",[Mv,Zc]=Ut(Rn),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=tt(Rn,r),c=rt(Rn,r),d=l.value===n,[u,p]=x.useState(i??""),[m,g]=x.useState(!1),b=J(t,_=>c.itemRefCallback?.(_,n,o)),f=Ae(),h=x.useRef("touch"),v=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(Mv,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:x.useCallback(_=>{p(w=>w||(_?.textContent??"").trim())},[]),children:a.jsx(An.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:b,onFocus:V(s.onFocus,()=>g(!0)),onBlur:V(s.onBlur,()=>g(!1)),onClick:V(s.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:V(s.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:V(s.onPointerDown,_=>{h.current=_.pointerType}),onPointerMove:V(s.onPointerMove,_=>{h.current=_.pointerType,o?c.onItemLeave?.():h.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(s.onPointerLeave,_=>{_.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(s.onKeyDown,_=>{c.searchRef?.current!==""&&_.key===" "||(yv.includes(_.key)&&v(),_.key===" "&&_.preventDefault())})})})})});Qc.displayName=Rn;var br="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=tt(br,r),l=rt(br,r),c=Zc(br,r),d=kv(br,r),[u,p]=x.useState(null),m=J(t,v=>p(v),c.onItemTextChange,v=>l.itemTextRefCallback?.(v,c.value,c.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=d;return le(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?vr.createPortal(i.children,s.valueNode):null]})});ed.displayName=br;var td="SelectItemIndicator",rd=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var da="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=rt(da,e.__scopeSelect),n=la(da,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});nd.displayName=da;var ua="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=rt(ua,e.__scopeSelect),n=la(ua,e.__scopeSelect),[o,i]=x.useState(!1),s=J(t,n.onScrollButtonChange);return le(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});od.displayName=ua;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=rt("SelectScrollButton",r),s=x.useRef(null),l=Pn(r),c=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),le(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{c()})})}),Dv="SelectSeparator",Fv=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});Fv.displayName=Dv;var pa="SelectArrow",$v=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=On(r),i=tt(pa,r),s=rt(pa,r);return i.open&&s.position==="popper"?a.jsx(Ks,{...o,...n,ref:t}):null});$v.displayName=pa;var Bv="SelectBubbleInput",id=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),i=J(n,o),s=xv(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:i,defaultValue:t})});id.displayName=Bv;function sd(e){return e===""||e===void 0}function ld(e){const t=We(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=Uv(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function Uv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Hv=Dc,Vv=$c,Wv=Uc,qv=Hc,Gv=Vc,Kv=Wc,Yv=Yc,Xv=Qc,Jv=ed,Zv=rd,Qv=nd,e_=od;function Ht({...e}){return a.jsx(Hv,{"data-slot":"select",...e})}function Vt({...e}){return a.jsx(Wv,{"data-slot":"select-value",...e})}function Wt({className:e,size:t="default",children:r,...n}){return a.jsxs(Vv,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(qv,{asChild:!0,children:a.jsx(mo,{className:"ecr-select__icon"})})]})}function qt({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Gv,{container:i,children:a.jsxs(Kv,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(t_,{}),a.jsx(Yv,{className:F("ecr-select__viewport"),children:t}),a.jsx(r_,{})]})})}function Gt({className:e,children:t,...r}){return a.jsxs(Xv,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(Zv,{children:a.jsx(zf,{className:"ecr-select__check-icon"})})}),a.jsx(Jv,{children:t})]})}function t_({className:e,...t}){return a.jsx(Qv,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Mf,{className:"ecr-select__icon"})})}function r_({className:e,...t}){return a.jsx(e_,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(mo,{className:"ecr-select__icon"})})}const n_=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Yu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),o_={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function a_(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(Ht,{defaultValue:Qa[0].value,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Qa.map(e=>a.jsx(Gt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:e.label,text:o_[e.value]})})]})},e.value))]})]})]})}const i_=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(xr,{label:"Disable Preview",text:a.jsx(a.Fragment,{children:"Turn off previews for a cleaner look and a more focused browsing experience!"})}),a.jsx(a_,{}),a.jsx(n_,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var Ln="Collapsible",[s_]=Ve(Ln),[l_,ma]=s_(Ln),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=mt({prop:n,defaultProp:o??!1,onChange:s,caller:Ln});return a.jsx(l_,{scope:r,disabled:i,contentId:Ae(),open:c,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":ha(c),"data-disabled":i?"":void 0,...l,ref:t})})});dd.displayName=Ln;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ma(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ha(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var fa="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ma(fa,e.__scopeCollapsible);return a.jsx(Ye,{present:r||o.open,children:({present:i})=>a.jsx(c_,{...n,ref:t,present:i})})});md.displayName=fa;var c_=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ma(fa,r),[l,c]=x.useState(n),d=x.useRef(null),u=J(t,d),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=s.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const _=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(_)},[]),le(()=>{const _=d.current;if(_){v.current=v.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const w=_.getBoundingClientRect();p.current=w.height,g.current=w.width,h.current||(_.style.transitionDuration=v.current.transitionDuration,_.style.animationName=v.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":ha(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function ha(e){return e?"open":"closed"}var d_=dd,u_=pd,p_=md;function fd({className:e,...t}){return a.jsx(d_,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(u_,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(mo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(p_,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const m_={modern:a.jsx(a.Fragment,{children:"Give your reel’s product card a sleek, modern appearance that feels fresh, clean, and visually engaging."}),classic:a.jsx(a.Fragment,{children:"Give your reel’s product card a timeless, classic appearance that feels familiar, simple, and easy to recognize."})},f_=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[Gu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value)),Ku.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r.label}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r.label,text:m_[r.value]})})]})},r.value))]})]})]}),h_=[{Icon:Hf,label:"Desktop",value:"desktop"},{Icon:Kf,label:"Tab",value:"tab"},{Icon:Wf,label:"Mobile",value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c,device:d,setDevice:u})=>{const[p,m]=y.useState(n),g=y.useRef(null);y.useEffect(()=>{m(n)},[n]);const b=h=>{const v=Math.min(r,Math.max(t,Number(h)));o(v)},f=h=>{const v=Number(h);m(v),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(v>r?r:v<t?t:v)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":",a.jsxs(Ht,{value:d,onValueChange:h=>u(h),children:[a.jsx(Wt,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Vt,{})}),a.jsx(qt,{style:{minWidth:"60px"},children:h_.map(h=>a.jsx(Gt,{value:h.value,title:h.label,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:h=>{const v=Number(h.target.value);m(v),b(v)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Zo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},g_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.gapOnMobile,tab:e?.gapOnTab,desktop:e?.gap}[r]??e?.gap,s=l=>{switch(r){case"mobile":t(c=>({...c,gapOnMobile:l}));break;case"tab":t(c=>({...c,gapOnTab:l}));break;default:t(c=>({...c,gap:l}));break}};return a.jsx(xd,{label:"Gap",min:0,max:80,value:i,onChange:s,name:"column_gap",id:"column-gap",device:r,setDevice:n})},x_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop"),i={mobile:e?.sizeOnMobile,tab:e?.sizeOnTab,desktop:e?.size}[r]??e?.size,s=l=>{switch(r){case"mobile":t(c=>({...c,sizeOnMobile:l}));break;case"tab":t(c=>({...c,sizeOnTab:l}));break;default:t(c=>({...c,size:l}));break}};return a.jsx(xd,{label:"Size",min:150,max:400,value:i,onChange:s,name:"size",id:"size",device:r,setDevice:n})},b_=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],v_=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:b_.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(Yp,{color:"#2563eb",size:16}):a.jsx(Xp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},__=Object.values(Za),y_={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},w_=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsxs(qt,{children:[__.map(r=>a.jsx(Gt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(Je,{modal:!0,children:[a.jsxs(Ze,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(at,{size:18})]}),a.jsx(Qe,{className:"ecr-admin-control__popover",children:a.jsx(ft,{name:r,text:y_[r]})})]})},r))]})]})]}),j_=({isLayoutOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("layout"),children:[a.jsx($f,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(v_,{selectedShape:r?.shape,handleShape:o=>n(i=>({...i,shape:o}))}),a.jsx(w_,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(i=>({...i,template:o}))}),a.jsx(f_,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(i=>({...i,appearance:o}))}),a.jsx(x_,{styles:r,updateStyles:n}),a.jsx(g_,{styles:r,updateStyles:n}),a.jsx(xr,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(xr,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(xr,{label:"Show Add to Cart",text:a.jsx(a.Fragment,{children:"Show a clear “Add to Cart” button on your tagged product to encourage quick purchases and boost conversions."})}),a.jsx(xr,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),S_=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(Ht,{value:e,onValueChange:t,children:[a.jsx(Wt,{className:"ecr-admin-control__trigger",children:a.jsx(Vt,{placeholder:"Layout"})}),a.jsx(qt,{children:Wu.map(r=>a.jsx(Gt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),k_=({isStyleOpen:e,handleSectionOpen:t,styles:r,updateStyles:n})=>a.jsxs(fd,{open:e,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>t("style"),children:[a.jsx(Vf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Qo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(i=>({...i,border:{...i.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(i=>({...i,border:{...i.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Qo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(i=>({...i,border:{...i.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(S_,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(i=>({...i,hoverEffect:o}))})]})]}),C_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(j_,{handleSectionOpen:s,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(k_,{isStyleOpen:i,handleSectionOpen:s,styles:e,updateStyles:t})]})},N_=({styles:e,setStyles:t,isExpanded:r,setIsExpanded:n,setIsEdited:o,tabs:i,currentTab:s,setCurrentTab:l})=>{const c=u=>{t(p=>{const m=u(p);return o(!0),m})},d=u=>{(u===i.thumbnail||u===i.preview)&&l(u)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[r&&a.jsx("div",{className:"ecr-admin-mobile-overlay",onClick:()=>n(!1)}),a.jsxs("div",{className:"ecr-admin-sidepanel-content",children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(hv,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(gv,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:i.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:i.preview,children:"Preview"})]}),a.jsx(Ic,{value:i.thumbnail,children:a.jsx(C_,{styles:e,updateStyles:c})}),a.jsx(Ic,{value:i.preview,children:a.jsx(i_,{styles:e,updateStyles:c})})]})})]})]})},E_=e=>{const t=Ne(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(ot),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const _=(await he.get(`stories/${e}`)).data;n(_.group_name),i(_.stories),l(_.styles??ot)}catch(v){v instanceof Error?q.error(v.message):q.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),_={group_name:r,styles:s,story_ids:v};e&&(_.group_id=e);const w=await he.post("stories/manage-group-stories",_);if(!e){const j=w.data.group_id;t(`?view=${X.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),q.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?q.error(h.message):q.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},T_=e=>{const[t,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return y.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),o=i=>{r(i.matches)};return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t},A_=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},P_=()=>{const e=Ne(),[t]=Jt(),r=t.get("gid"),n=T_("(min-width: 1024px)"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=E_(r),{allReels:f,searchTerm:h,setSearchTerm:v,isSearching:_,lastStoryElementRef:w,refreshReels:j}=Qi(r),[k,N]=y.useState(""),[C,E]=y.useState(n),[T,O]=y.useState(bd.thumbnail),[R,L]=y.useState([]),A=y.useMemo(()=>new Set(s.map(K=>K.story_uuid)),[s]),P=y.useMemo(()=>h.trim().toLowerCase(),[h]),z=y.useMemo(()=>P?R.filter(K=>K.title.toLowerCase().includes(P)):R,[R,P]),I=y.useMemo(()=>{const K=new Map;for(const de of z)K.set(de.story_uuid,de);for(const de of f)K.has(de.story_uuid)||K.set(de.story_uuid,de);return Array.from(K.values())},[z,f]),B=y.useMemo(()=>I.filter(K=>!A.has(K.story_uuid)),[I,A]);y.useEffect(()=>{E(n)},[n]),y.useEffect(()=>{L([])},[r]);const{showLeaveModal:M,requestLeave:G,confirmLeave:ie,cancelLeave:se,allowNextNavigation:ge}=A_(m),ve=async(K,de)=>{try{N(K.story_uuid);const $=de==="add"?[K,...s]:s.filter(Y=>Y.story_uuid!==K.story_uuid);l($),L(de==="add"?Y=>Y.filter(oe=>oe.story_uuid!==K.story_uuid):Y=>Y.some(oe=>oe.story_uuid===K.story_uuid)?Y:[K,...Y]),g(!0)}catch($){$ instanceof Error?q.error($.message):q.error("Something went wrong. Please try again later!")}finally{N("")}},pe=async()=>{const K=await b();K&&(L([]),j()),K?.isNewGroup&&ge(()=>{e(`?view=${X.mg}&gid=${K.group_id}`,{replace:!0})})};return u?a.jsx(Ir,{}):a.jsxs($b,{value:{requestLeave:G},children:[a.jsx(St,{left:[a.jsx(kt,{name:"Manage Widget",Icon:Or},"page"),a.jsx(rr,{cb:()=>G(()=>e(`?view=${X.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(es,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Wo,{children:[a.jsx(qo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(pb,{})}),a.jsxs(Go,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Ko,{children:a.jsx(Yo,{children:"Customize title appearance"})}),a.jsx(Mb,{styles:c,setStyles:d,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(M0,{asChild:!0,children:a.jsx(te,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(ub,{isExpanded:C,setIsExpanded:E},"toggle"),a.jsx(po,{onSave:pe,isSaving:p,disabled:!m},"save")],rightClass:"ecr-admin-nav-btn-reverse"}),a.jsx(nr,{breads:[{label:"Dashboard",href:`?view=${X.ag}`},{label:"Manage Widget"}],onNavigate:K=>G(()=>e(K))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Yb,{allReels:B,gid:r,handleSelectReel:ve,searchTerm:h,setSearchTerm:v,isSearching:_,togglingId:k,lastStoryElementRef:w}),a.jsx(Kb,{gid:r,reels:s,styles:c,handleRemoveReel:ve,togglingId:k,currentTab:T}),C&&a.jsx(N_,{isExpanded:C,setIsExpanded:E,setIsEdited:g,styles:c,setStyles:d,tabs:bd,setCurrentTab:O,currentTab:T})]}),M&&a.jsx(Rr,{onReject:se,onAccept:ie,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function O_(){const[e]=Jt(),t=e.get("view")||X.ag;let r;switch(t){case X.settings:r=a.jsx(ab,{});break;case X.ar:r=a.jsx(Ef,{});break;case X.stat:r=a.jsx(lb,{});break;case X.cr:r=a.jsx(Y0,{});break;case X.mg:r=a.jsx(P_,{});break;default:r=a.jsx(nb,{})}return a.jsxs("div",{children:[r,a.jsx(Hu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const vd=async(e,t,r,n={})=>{try{if(await he.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},_d=e=>!!e?.files?.[0]?.mime_type?.startsWith("video"),R_=()=>{const e=y.useContext(ga);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=y.useState(r.length-1),[d,u]=y.useState(null),[p,m]=y.useState(!0),[g,b]=y.useState(0),[f,h]=y.useState(!1),[v,_]=y.useState({index:0,story_uuid:r[0]?.story_uuid??""}),w=d?.links&&d.links.length>0?d.links[0]:null,j=t?.playerAppearance??"overlay",k=y.useRef({bodyOverflow:"",bodyPosition:"",bodyTop:"",bodyWidth:"",bodyScrollBehavior:"",htmlOverflow:"",htmlScrollBehavior:"",scrollY:0}),N=y.useCallback((A,P=1)=>{if(r.length===0)return null;let z=A;for(let I=0;I<r.length;I+=1){const B=r[z];if(_d(B))return{story:B,index:z};z=(z+P+r.length)%r.length}return null},[r]),C=y.useCallback(()=>{c(r.length-1);const A=r.findIndex(I=>String(I.story_uuid)===o),P=A>=0?r[A]:null,z=_d(P)?{story:P,index:A}:N(Math.max(A,0),1);if(!z?.story){u(null),m(!1);return}u(z.story),A!==z.index&&z.story.story_uuid!==o&&i(z.story.story_uuid),_({index:0,story_uuid:z.story.story_uuid}),m(!1)},[N,o,i,r]);y.useEffect(()=>{C()},[C]),y.useEffect(()=>{const{body:A,documentElement:P}=document;return k.current={bodyOverflow:A.style.overflow,bodyPosition:A.style.position,bodyTop:A.style.top,bodyWidth:A.style.width,bodyScrollBehavior:A.style.scrollBehavior,htmlOverflow:P.style.overflow,htmlScrollBehavior:P.style.scrollBehavior,scrollY:window.scrollY},P.style.overflow="hidden",A.style.overflow="hidden",A.style.position="fixed",A.style.top=`-${k.current.scrollY}px`,A.style.width="100%",()=>{const z=k.current;P.style.overflow=z.htmlOverflow,A.style.overflow=z.bodyOverflow,A.style.position=z.bodyPosition,A.style.top=z.bodyTop,A.style.width=z.bodyWidth,P.style.scrollBehavior="auto",A.style.scrollBehavior="auto",window.scrollTo({top:z.scrollY,left:0,behavior:"auto"}),P.style.scrollBehavior=z.htmlScrollBehavior,A.style.scrollBehavior=z.bodyScrollBehavior}},[]);const E=y.useCallback(()=>{i(null)},[i]),T=y.useCallback((A=1)=>{m(!0);const P=r.findIndex(G=>String(G.story_uuid)===String(o)),z=A>0?1:-1,I=A>0?l>P?P+1:0:P>0?P-1:l,B=N(I,z);if(!B?.story){m(!1);return}const M=B.story;if(M.story_uuid===o){m(!1),E();return}_({index:0,story_uuid:M.story_uuid}),n&&vd(n,M.id,s),i(M.story_uuid),m(!1)},[E,N,n,o,l,i,s,r]),O=y.useCallback(()=>{const A=d?.files??[];if(v.index>0){_(P=>({index:P.index-1,story_uuid:A[P.index-1].story_uuid??""}));return}T(-1)},[v.index,T,d?.files]),R=y.useCallback(()=>{const A=d?.files??[];if(v.index+1<A.length){_(P=>({index:P.index+1,story_uuid:A[P.index+1].story_uuid??""}));return}T(1)},[v.index,T,d?.files]),L=y.useCallback(A=>{A.target===A.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:v,duration:g,handleBackdropClick:L,handleNextFile:R,handlePrevFile:O,isLoadingNext:p,isPaused:f,playingStory:d,setDuration:b,setIsPaused:h,setIsPlaying:i,firstLink:w,playerAppearance:j}},L_=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),I_=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:i,isLoadingNext:s,isPaused:l,playerAppearance:c,playingStory:d,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=R_();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:d&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(wt,{onClick:i,className:"ecr-player__nav--left",children:a.jsx(Qt,{size:24})}),a.jsx(wt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(er,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[d&&a.jsx(si,{playingStory:d,duration:r,currentFileIndex:t,isPaused:l},`${d.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(tr,{className:"ecr-player__close-icon"})}),s?a.jsx(L_,{}):d?.files.length>0&&a.jsx(ui,{currentFileIndex:t,files:d?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:i,handleNextFile:o,storyId:d.id,storyTitle:d?.title}),c==="overlay"?u?a.jsx(En,{link:u,usedFor:"user",usedIn:"player",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):a.jsx(Bt,{title:d.title}):null,c==="title"?a.jsx(Bt,{title:d.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const i=t.appearance??"overlay",s=e.links&&e.links.length>0?e.links[0]:null,l=i==="none",c=i==="title",d=t.shape==="rectangle",u=!l&&!c&&s,p=t.border.border_radius,m=p>50?p+16:p>20?p:0;return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Zn,{story:e,styles:t,storyViews:n,setStoryViews:o}),!l&&!c&&d?u?a.jsx(En,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Bt,{title:e.title,styles:{width:`calc(95% - ${m}px)`}}):null]}),c?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},z_=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:m,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Qt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(er,{size:20,style:{width:"20px",height:"20px"}})})]})},wd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:i,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},i.story_uuid):null)})}),M_={carousel:z_,grid:wd},D_=()=>{const e=y.useContext(ga),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=M_[d]||wd,p=({sid:m,story_uuid:g})=>{i(g),o&&vd(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${r?.size}px`,"--thumbnail-size-tab":r.template==="grid"?"auto":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-grid-tab":`${r?.sizeOnTab??r?.size}px`,"--thumbnail-size-mobile":r.template==="grid"?"auto":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-size-grid-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-tab":`${r?.gapOnTab??r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`,"--thumbnail-border-radius":`${r?.border?.border_radius}px`},children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},F_=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(ot),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(ot),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const b=await he.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),s(b.data.styles||ot)}catch(b){if(g.signal.aborted)return;u(b)}finally{c(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},ga=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=F_(e);return a.jsxs(ga.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(I_,{}),a.jsx(D_,{})]})};_a(()=>{const e=document.getElementById("ecommreels-admin-app");e&&In.createRoot(e).render(a.jsx(Zd,{children:a.jsx(O_,{})}))}),_a(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
  • ecomm-reels/trunk/ecomm-reels.php

    r3462462 r3463454  
    33 * Plugin Name:       ReelsWp - Shoppable Videos & Vertical Reels Carousels
    44 * Description:       Create Insta style reels and stories with ReelsWP and add them anywhere on your WordPress site. Add fast, mobile friendly video grid and carousel layouts to your homepage, blog or news articles, and product pages.
    5  * Version:           4.1.1
     5 * Version:           4.1.2
    66 * Requires at least: 5.8
    77 * Requires PHP:      7.4
     
    2020define('ECOMMREELS_ASSETS', plugins_url('/', __FILE__));
    2121define('ECOMMREELS_FILE_PREFIX', 'class-');
    22 define('WP_REELS_VER', '4.1.1');
     22define('WP_REELS_VER', '4.1.2');
    2323
    2424// 1) Composer autoloader (optional, guarded)
  • ecomm-reels/trunk/readme.txt

    r3462462 r3463454  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 4.1.1
     7Stable tag: 4.1.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    101101== Changelog ==
    102102
     103= 4.1.2 - 2026-02-17 =
     104- Fix: Fixed a scrolling issue on iPad when playing videos.
     105
    103106= 4.1.1 - 2026-02-16 =
    104107- Fix: Fixed cross-browser issues affecting video rendering.
Note: See TracChangeset for help on using the changeset viewer.