Changeset 3454572
- Timestamp:
- 02/05/2026 11:40:41 AM (8 weeks ago)
- Location:
- ecomm-reels
- Files:
-
- 8 edited
- 1 copied
-
tags/4.0.11 (copied) (copied from ecomm-reels/trunk)
-
tags/4.0.11/CHANGELOG.md (modified) (1 diff)
-
tags/4.0.11/build/index.js (modified) (23 diffs)
-
tags/4.0.11/ecomm-reels.php (modified) (2 diffs)
-
tags/4.0.11/readme.txt (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/build/index.js (modified) (23 diffs)
-
trunk/ecomm-reels.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ecomm-reels/tags/4.0.11/CHANGELOG.md
r3452800 r3454572 1 1 # Changelog 2 3 ## [4.0.11](https://github.com/dstudio-asia/reels-wp/compare/v4.0.10...v4.0.11) (2026-02-05) 4 5 6 ### Features 7 8 * add bulk delete for selected reels ([9a7beb2](https://github.com/dstudio-asia/reels-wp/commit/9a7beb29f8072707188bb8c776aeed35c1d3c4c6)) 9 * add bulk delete for selected reels ([e2dfdca](https://github.com/dstudio-asia/reels-wp/commit/e2dfdcaa9eb3d280659f87b10762b9f4fbef7dc1)) 10 * add danger outline button style for bulk delete ([a64cd70](https://github.com/dstudio-asia/reels-wp/commit/a64cd702b7ac072fccaf624dd8d9d3020c40c815)) 11 * add danger outline button style for bulk delete ([114056c](https://github.com/dstudio-asia/reels-wp/commit/114056c9807186b9d01ba983a4886bbd69612184)) 12 * **ui:** add responsive size and gap controls ([6769ac0](https://github.com/dstudio-asia/reels-wp/commit/6769ac0967b6be5c0fbf10845a817a44c927f79e)) 13 * **ui:** add responsive thumbnail size and gap support ([12a4bfd](https://github.com/dstudio-asia/reels-wp/commit/12a4bfd9edc0ae3268dfdfd7180888772b9de8a6)) 14 15 16 ### Bug Fixes 17 18 * **player:** move modal backdrop styles to CSS ([e5ddd91](https://github.com/dstudio-asia/reels-wp/commit/e5ddd9170ce06840bc9cf177d84f91b401da5104)) 19 * remove unused bulk delete code ([8ae4d6d](https://github.com/dstudio-asia/reels-wp/commit/8ae4d6d18316dc5a707504c5779f827b8358bdb7)) 2 20 3 21 ## [4.0.10](https://github.com/dstudio-asia/reels-wp/compare/v4.0.9...v4.0.10) (2026-02-03) -
ecomm-reels/tags/4.0.11/build/index.js
r3452800 r3454572 1 (function(y, xa,In,ba){"use strict";var _a=document.createElement("style");_a.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:color-mix(in srgb,#1f2937) 90%,#000}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:color-mix(in srgb,#e5e7eb 90%,#000)}#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--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{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}#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:20;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:50;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:50;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}#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;inset:0;display:grid;place-items:center;width:100%;height:100vh}#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:50;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(var(--thumbnail-size, 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:40;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:50;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:999;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__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{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:50;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-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#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:grid;cursor:pointer;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-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:70}#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-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:50}#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:60}#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:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:50;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:30;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}@media(min-width:1024px){#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-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}#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}#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}#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:10;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{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:12px;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}#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:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:48px;text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff}: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}#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}#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:20;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}#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:50;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:50;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:1024px){#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}#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;background:#fff;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:280px;border:2px solid #e5e7eb}#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-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:50}#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-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-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:50;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}#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{cursor:pointer;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{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}#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:10;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, 150px),1fr))}2 /*$vite$:1*/`,document.head.appendChild( _a);function va(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 g=va(y),_r=va(ba);function jd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},$t={};/**1 (function(y,_a,Ln,va){"use strict";var ya=document.createElement("style");ya.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{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}#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:20;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:50;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:50;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:50;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:40;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:50;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:999;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__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:50;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-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#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:grid;cursor:pointer;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-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:70}#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-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:50}#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:60}#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:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:50;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:30;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}@media(min-width:1024px){#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-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}#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)}}#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:10;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:12px;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}#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:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:48px;text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff}: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}#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)}}#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:20;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)}}#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:50;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:50;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:1024px){#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}#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;background:#fff;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:280px;border:2px solid #e5e7eb}#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-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:50}#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-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-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:50;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)}}#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{cursor:pointer;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)}}#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:10;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))}} 2 /*$vite$:1*/`,document.head.appendChild(ya);function wa(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=wa(y),br=wa(va);function Cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},Wt={};/** 3 3 * @license React 4 4 * react-jsx-runtime.production.min.js … … 8 8 * This source code is licensed under the MIT license found in the 9 9 * LICENSE file in the root directory of this source tree. 10 */var ya;function Sd(){if(ya)return $t;ya=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(c,l,d){var u,p={},m=null,h=null;d!==void 0&&(m=""+d),l.key!==void 0&&(m=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)n.call(l,u)&&!s.hasOwnProperty(u)&&(p[u]=l[u]);if(c&&c.defaultProps)for(u in l=c.defaultProps,l)p[u]===void 0&&(p[u]=l[u]);return{$$typeof:t,type:c,key:m,ref:h,props:p,_owner:o.current}}return $t.Fragment=r,$t.jsx=i,$t.jsxs=i,$t}var wa;function Cd(){return wa||(wa=1,zn.exports=Sd()),zn.exports}var a=Cd();/**10 */var ja;function kd(){if(ja)return Wt;ja=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(l,d,c){var u,p={},m=null,g=null;c!==void 0&&(m=""+c),d.key!==void 0&&(m=""+d.key),d.ref!==void 0&&(g=d.ref);for(u in d)n.call(d,u)&&!s.hasOwnProperty(u)&&(p[u]=d[u]);if(l&&l.defaultProps)for(u in d=l.defaultProps,d)p[u]===void 0&&(p[u]=d[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Wt.Fragment=r,Wt.jsx=i,Wt.jsxs=i,Wt}var Sa;function Nd(){return Sa||(Sa=1,In.exports=kd()),In.exports}var a=Nd();/** 11 11 * @remix-run/router v1.23.2 12 12 * … … 17 17 * 18 18 * @license MIT 19 */function Bt(){return Bt=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},Bt.apply(this,arguments)}var Qe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qe||(Qe={}));const ja="popstate";function kd(e){e===void 0&&(e={});function t(o,s){let{pathname:i="/",search:c="",hash:l=""}=Ut(o.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),Mn("",{pathname:i,search:c,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(o,s){let i=o.document.querySelector("base"),c="";if(i&&i.getAttribute("href")){let l=o.location.href,d=l.indexOf("#");c=d===-1?l:l.slice(0,d)}return c+"#"+(typeof s=="string"?s:vr(s))}function n(o,s){Sa(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(s)+")")}return Ed(t,r,n,e)}function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Sa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Nd(){return Math.random().toString(36).substr(2,8)}function Ca(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Bt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ut(t):t,{state:r,key:t&&t.key||n||Nd()})}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 Ut(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 Ed(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,c=Qe.Pop,l=null,d=u();d==null&&(d=0,i.replaceState(Bt({},i.state,{idx:d}),""));function u(){return(i.state||{idx:null}).idx}function p(){c=Qe.Pop;let x=u(),v=x==null?null:x-d;d=x,l&&l({action:c,location:f.location,delta:v})}function m(x,v){c=Qe.Push;let _=Mn(f.location,x,v);r&&r(_,x),d=u()+1;let w=Ca(_,d),j=f.createHref(_);try{i.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}s&&l&&l({action:c,location:f.location,delta:1})}function h(x,v){c=Qe.Replace;let _=Mn(f.location,x,v);r&&r(_,x),d=u();let w=Ca(_,d),j=f.createHref(_);i.replaceState(w,"",j),s&&l&&l({action:c,location:f.location,delta:0})}function b(x){let v=o.location.origin!=="null"?o.location.origin:o.location.href,_=typeof x=="string"?x:vr(x);return _=_.replace(/ $/,"%20"),be(v,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,v)}let f={get action(){return c},get location(){return e(o,i)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(ja,p),l=x,()=>{o.removeEventListener(ja,p),l=null}},createHref(x){return t(o,x)},createURL:b,encodeLocation(x){let v=b(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:h,go(x){return i.go(x)}};return f}var ka;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ka||(ka={}));function Na(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 Td=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ad=e=>Td.test(e);function Pd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Ut(e):e,s;if(r)if(Ad(r))s=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),Sa(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+r))}r.startsWith("/")?s=Ea(r.substring(1),"/"):s=Ea(r,t)}else s=t;return{pathname:s,search:Rd(n),hash:Ld(o)}}function Ea(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 Od(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ta(e,t){let r=Od(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Aa(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Ut(e):(o=Bt({},e),be(!o.pathname||!o.pathname.includes("?"),Dn("?","pathname","search",o)),be(!o.pathname||!o.pathname.includes("#"),Dn("#","pathname","hash",o)),be(!o.search||!o.search.includes("#"),Dn("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,c;if(i==null)c=r;else{let p=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}c=p>=0?t[p]:"/"}let l=Pd(o,c),d=i&&i!=="/"&&i.endsWith("/"),u=(s||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(d||u)&&(l.pathname+="/"),l}const Pa=e=>e.join("/").replace(/\/\/+/g,"/"),Rd=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ld=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Oa=["post","put","patch","delete"];new Set(Oa);const Id=["get",...Oa];new Set(Id);/**19 */function qt(){return qt=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},qt.apply(this,arguments)}var Qe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qe||(Qe={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,s){let{pathname:i="/",search:l="",hash:d=""}=Gt(o.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),zn("",{pathname:i,search:l,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(o,s){let i=o.document.querySelector("base"),l="";if(i&&i.getAttribute("href")){let d=o.location.href,c=d.indexOf("#");l=c===-1?d:d.slice(0,c)}return l+"#"+(typeof s=="string"?s:_r(s))}function n(o,s){ka(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(s)+")")}return Td(t,r,n,e)}function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Pd(){return Math.random().toString(36).substr(2,8)}function Na(e,t){return{usr:e.state,key:e.key,idx:t}}function zn(e,t,r,n){return r===void 0&&(r=null),qt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Gt(t):t,{state:r,key:t&&t.key||n||Pd()})}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 Gt(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 Td(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,l=Qe.Pop,d=null,c=u();c==null&&(c=0,i.replaceState(qt({},i.state,{idx:c}),""));function u(){return(i.state||{idx:null}).idx}function p(){l=Qe.Pop;let h=u(),v=h==null?null:h-c;c=h,d&&d({action:l,location:f.location,delta:v})}function m(h,v){l=Qe.Push;let _=zn(f.location,h,v);r&&r(_,h),c=u()+1;let w=Na(_,c),j=f.createHref(_);try{i.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}s&&d&&d({action:l,location:f.location,delta:1})}function g(h,v){l=Qe.Replace;let _=zn(f.location,h,v);r&&r(_,h),c=u();let w=Na(_,c),j=f.createHref(_);i.replaceState(w,"",j),s&&d&&d({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"),be(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,i)},listen(h){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),d=h,()=>{o.removeEventListener(Ca,p),d=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 i.go(h)}};return f}var Ea;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ea||(Ea={}));function Pa(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 Ad=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Ad.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Gt(e):e,s;if(r)if(Od(r))s=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),ka(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+r))}r.startsWith("/")?s=Ta(r.substring(1),"/"):s=Ta(r,t)}else s=t;return{pathname:s,search:Id(n),hash:zd(o)}}function Ta(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 Mn(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 Aa(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 Oa(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Gt(e):(o=qt({},e),be(!o.pathname||!o.pathname.includes("?"),Mn("?","pathname","search",o)),be(!o.pathname||!o.pathname.includes("#"),Mn("#","pathname","hash",o)),be(!o.search||!o.search.includes("#"),Mn("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,l;if(i==null)l=r;else{let p=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let d=Rd(o,l),c=i&&i!=="/"&&i.endsWith("/"),u=(s||i===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(c||u)&&(d.pathname+="/"),d}const Ra=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,La=["post","put","patch","delete"];new Set(La);const Md=["get",...La];new Set(Md);/** 20 20 * React Router v6.30.3 21 21 * … … 26 26 * 27 27 * @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 Ra=g.createContext(null),ft=g.createContext(null),Fn=g.createContext(null),wr=g.createContext({outlet:null,matches:[],isDataRoute:!1});function zd(e,t){let{relative:r}=t===void 0?{}:t;jr()||be(!1);let{basename:n,navigator:o}=g.useContext(ft),{hash:s,pathname:i,search:c}=Ia(e,{relative:r}),l=i;return n!=="/"&&(l=i==="/"?n:Pa([n,i])),o.createHref({pathname:l,search:c,hash:s})}function jr(){return g.useContext(Fn)!=null}function Ht(){return jr()||be(!1),g.useContext(Fn).location}function La(e){g.useContext(ft).static||g.useLayoutEffect(e)}function Se(){let{isDataRoute:e}=g.useContext(wr);return e?Bd():Md()}function Md(){jr()||be(!1);let e=g.useContext(Ra),{basename:t,future:r,navigator:n}=g.useContext(ft),{matches:o}=g.useContext(wr),{pathname:s}=Ht(),i=JSON.stringify(Ta(o,r.v7_relativeSplatPath)),c=g.useRef(!1);return La(()=>{c.current=!0}),g.useCallback(function(d,u){if(u===void 0&&(u={}),!c.current)return;if(typeof d=="number"){n.go(d);return}let p=Aa(d,JSON.parse(i),s,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Pa([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,i,s,e])}function Ia(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=g.useContext(ft),{matches:o}=g.useContext(wr),{pathname:s}=Ht(),i=JSON.stringify(Ta(o,n.v7_relativeSplatPath));return g.useMemo(()=>Aa(e,JSON.parse(i),s,r==="path"),[e,i,s,r])}var za=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(za||{}),Ma=(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})(Ma||{});function Dd(e){let t=g.useContext(Ra);return t||be(!1),t}function Fd(e){let t=g.useContext(wr);return t||be(!1),t}function $d(e){let t=Fd(),r=t.matches[t.matches.length-1];return r.route.id||be(!1),r.route.id}function Bd(){let{router:e}=Dd(za.UseNavigateStable),t=$d(Ma.UseNavigateStable),r=g.useRef(!1);return La(()=>{r.current=!0}),g.useCallback(function(o,s){s===void 0&&(s={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},s)))},[e,t])}function Ud(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Hd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Qe.Pop,navigator:s,static:i=!1,future:c}=e;jr()&&be(!1);let l=t.replace(/^\/*/,"/"),d=g.useMemo(()=>({basename:l,navigator:s,static:i,future:yr({v7_relativeSplatPath:!1},c)}),[l,c,s,i]);typeof n=="string"&&(n=Ut(n));let{pathname:u="/",search:p="",hash:m="",state:h=null,key:b="default"}=n,f=g.useMemo(()=>{let x=Na(u,l);return x==null?null:{location:{pathname:x,search:p,hash:m,state:h,key:b},navigationType:o}},[l,u,p,m,h,b,o]);return f==null?null:g.createElement(ft.Provider,{value:d},g.createElement(Fn.Provider,{children:r,value:f}))}new Promise(()=>{});/**28 */function vr(){return vr=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},vr.apply(this,arguments)}const Ia=x.createContext(null),ft=x.createContext(null),Dn=x.createContext(null),yr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;wr()||be(!1);let{basename:n,navigator:o}=x.useContext(ft),{hash:s,pathname:i,search:l}=Ma(e,{relative:r}),d=i;return n!=="/"&&(d=i==="/"?n:Ra([n,i])),o.createHref({pathname:d,search:l,hash:s})}function wr(){return x.useContext(Dn)!=null}function Kt(){return wr()||be(!1),x.useContext(Dn).location}function za(e){x.useContext(ft).static||x.useLayoutEffect(e)}function Se(){let{isDataRoute:e}=x.useContext(yr);return e?Hd():Fd()}function Fd(){wr()||be(!1);let e=x.useContext(Ia),{basename:t,future:r,navigator:n}=x.useContext(ft),{matches:o}=x.useContext(yr),{pathname:s}=Kt(),i=JSON.stringify(Aa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return za(()=>{l.current=!0}),x.useCallback(function(c,u){if(u===void 0&&(u={}),!l.current)return;if(typeof c=="number"){n.go(c);return}let p=Oa(c,JSON.parse(i),s,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ra([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,i,s,e])}function Ma(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(ft),{matches:o}=x.useContext(yr),{pathname:s}=Kt(),i=JSON.stringify(Aa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Oa(e,JSON.parse(i),s,r==="path"),[e,i,s,r])}var Da=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Da||{}),Fa=(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})(Fa||{});function $d(e){let t=x.useContext(Ia);return t||be(!1),t}function Bd(e){let t=x.useContext(yr);return t||be(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||be(!1),r.route.id}function Hd(){let{router:e}=$d(Da.UseNavigateStable),t=Ud(Fa.UseNavigateStable),r=x.useRef(!1);return za(()=>{r.current=!0}),x.useCallback(function(o,s){s===void 0&&(s={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,vr({fromRouteId:t},s)))},[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=Qe.Pop,navigator:s,static:i=!1,future:l}=e;wr()&&be(!1);let d=t.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:d,navigator:s,static:i,future:vr({v7_relativeSplatPath:!1},l)}),[d,l,s,i]);typeof n=="string"&&(n=Gt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Pa(u,d);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[d,u,p,m,g,b,o]);return f==null?null:x.createElement(ft.Provider,{value:c},x.createElement(Dn.Provider,{children:r,value:f}))}new Promise(()=>{});/** 29 29 * React Router DOM v6.30.3 30 30 * … … 35 35 * 36 36 * @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 Vd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Wd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qd(e,t){return e.button===0&&(!t||t==="_self")&&!Wd(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 Gd(e,t){let r=Bn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}const Kd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yd="6";try{window.__reactRouterVersion=Yd}catch{}const Da=g["startTransition"];function Xd(e){let{basename:t,children:r,future:n,window:o}=e,s=g.useRef();s.current==null&&(s.current=kd({window:o,v5Compat:!0}));let i=s.current,[c,l]=g.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},u=g.useCallback(p=>{d&&Da?Da(()=>l(p)):l(p)},[l,d]);return g.useLayoutEffect(()=>i.listen(u),[i,u]),g.useEffect(()=>Ud(n),[n]),g.createElement(Hd,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:i,future:n})}const Jd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ht=g.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:s,replace:i,state:c,target:l,to:d,preventScrollReset:u,viewTransition:p}=t,m=Vd(t,Kd),{basename:h}=g.useContext(ft),b,f=!1;if(typeof d=="string"&&Zd.test(d)&&(b=d,Jd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=Na(j.pathname,h);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let x=zd(d,{relative:o}),v=Qd(d,{replace:i,state:c,target:l,preventScrollReset:u,relative:o,viewTransition:p});function _(w){n&&n(w),w.defaultPrevented||v(w)}return g.createElement("a",$n({},m,{href:b||x,onClick:f||s?n:_,ref:r,target:l}))});var Fa;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Fa||(Fa={}));var $a;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})($a||($a={}));function Qd(e,t){let{target:r,replace:n,state:o,preventScrollReset:s,relative:i,viewTransition:c}=t===void 0?{}:t,l=Se(),d=Ht(),u=Ia(e,{relative:i});return g.useCallback(p=>{if(qd(p,r)){p.preventDefault();let m=n!==void 0?n:vr(d)===vr(u);l(e,{replace:m,state:o,preventScrollReset:s,relative:i,viewTransition:c})}},[d,l,u,n,o,r,e,s,i,c])}function Vt(e){let t=g.useRef(Bn(e)),r=g.useRef(!1),n=Ht(),o=g.useMemo(()=>Gd(n.search,r.current?null:t.current),[n.search]),s=Se(),i=g.useCallback((c,l)=>{const d=Bn(typeof c=="function"?c(o):c);r.current=!0,s("?"+d,l)},[s,o]);return[o,i]}let eu={data:""},tu=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||eu},ru=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,nu=/\/\*[^]*?\*\/| +/g,Ba=/\n+/g,Be=(e,t)=>{let r="",n="",o="";for(let s in e){let i=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+i+";":n+=s[1]=="f"?Be(i,s):s+"{"+Be(i,s[1]=="k"?"":t)+"}":typeof i=="object"?n+=Be(i,t?t.replace(/([^,])+/g,c=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,c):c?c+" "+l:l)):s):i!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Be.p?Be.p(s,i):s+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Le={},Ua=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ua(e[r]);return t}return e},ou=(e,t,r,n,o)=>{let s=Ua(e),i=Le[s]||(Le[s]=(l=>{let d=0,u=11;for(;d<l.length;)u=101*u+l.charCodeAt(d++)>>>0;return"go"+u})(s));if(!Le[i]){let l=s!==e?e:(d=>{let u,p,m=[{}];for(;u=ru.exec(d.replace(nu,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Ba," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Ba," ").trim();return m[0]})(e);Le[i]=Be(o?{["@keyframes "+i]:l}:l,r?"":"."+i)}let c=r&&Le.g?Le.g:null;return r&&(Le.g=Le[i]),((l,d,u,p)=>{p?d.data=d.data.replace(p,l):d.data.indexOf(l)===-1&&(d.data=u?l+d.data:d.data+l)})(Le[i],t,n,c),i},au=(e,t,r)=>e.reduce((n,o,s)=>{let i=t[s];if(i&&i.call){let c=i(r),l=c&&c.props&&c.props.className||/^go/.test(c)&&c;i=l?"."+l:c&&typeof c=="object"?c.props?"":Be(c,""):c===!1?"":c}return n+o+(i??"")},"");function Sr(e){let t=this||{},r=e.call?e(t.p):e;return ou(r.unshift?r.raw?au(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,tu(t.target),t.g,t.o,t.k)}let Ha,Un,Hn;Sr.bind({g:1});let Ie=Sr.bind({k:1});function su(e,t,r,n){Be.p=t,Ha=e,Un=r,Hn=n}function Ue(e,t){let r=this||{};return function(){let n=arguments;function o(s,i){let c=Object.assign({},s),l=c.className||o.className;r.p=Object.assign({theme:Un&&Un()},c),r.o=/ *go\d+/.test(l),c.className=Sr.apply(r,n)+(l?" "+l:"");let d=e;return e[0]&&(d=c.as||e,delete c.as),Hn&&d[0]&&Hn(c),Ha(d,c)}return o}}var iu=e=>typeof e=="function",Cr=(e,t)=>iu(e)?e(t):e,cu=(()=>{let e=0;return()=>(++e).toString()})(),Va=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),lu=20,Vn="default",Wa=(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(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return Wa(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+s}))}}},kr=[],qa={toasts:[],pausedAt:void 0,settings:{toastLimit:lu}},Ce={},Ga=(e,t=Vn)=>{Ce[t]=Wa(Ce[t]||qa,e),kr.forEach(([r,n])=>{r===t&&n(Ce[t])})},Ka=e=>Object.keys(Ce).forEach(t=>Ga(e,t)),du=e=>Object.keys(Ce).find(t=>Ce[t].toasts.some(r=>r.id===e)),Nr=(e=Vn)=>t=>{Ga(t,e)},uu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},pu=(e={},t=Vn)=>{let[r,n]=y.useState(Ce[t]||qa),o=y.useRef(Ce[t]);y.useEffect(()=>(o.current!==Ce[t]&&n(Ce[t]),kr.push([t,n]),()=>{let i=kr.findIndex(([c])=>c===t);i>-1&&kr.splice(i,1)}),[t]);let s=r.toasts.map(i=>{var c,l,d;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((c=e[i.type])==null?void 0:c.removeDelay)||e?.removeDelay,duration:i.duration||((l=e[i.type])==null?void 0:l.duration)||e?.duration||uu[i.type],style:{...e.style,...(d=e[i.type])==null?void 0:d.style,...i.style}}});return{...r,toasts:s}},mu=(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||cu()}),Wt=e=>(t,r)=>{let n=mu(t,e,r);return Nr(n.toasterId||du(n.id))({type:2,toast:n}),n.id},oe=(e,t)=>Wt("blank")(e,t);oe.error=Wt("error"),oe.success=Wt("success"),oe.loading=Wt("loading"),oe.custom=Wt("custom"),oe.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Nr(t)(r):Ka(r)},oe.dismissAll=e=>oe.dismiss(void 0,e),oe.remove=(e,t)=>{let r={type:4,toastId:e};t?Nr(t)(r):Ka(r)},oe.removeAll=e=>oe.remove(void 0,e),oe.promise=(e,t,r)=>{let n=oe.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?Cr(t.success,o):void 0;return s?oe.success(s,{id:n,...r,...r?.success}):oe.dismiss(n),o}).catch(o=>{let s=t.error?Cr(t.error,o):void 0;s?oe.error(s,{id:n,...r,...r?.error}):oe.dismiss(n)}),e};var fu=1e3,hu=(e,t="default")=>{let{toasts:r,pausedAt:n}=pu(e,t),o=y.useRef(new Map).current,s=y.useCallback((p,m=fu)=>{if(o.has(p))return;let h=setTimeout(()=>{o.delete(p),i({type:4,toastId:p})},m);o.set(p,h)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(h=>{if(h.duration===1/0)return;let b=(h.duration||0)+h.pauseDuration-(p-h.createdAt);if(b<0){h.visible&&oe.dismiss(h.id);return}return setTimeout(()=>oe.dismiss(h.id,t),b)});return()=>{m.forEach(h=>h&&clearTimeout(h))}},[r,n,t]);let i=y.useCallback(Nr(t),[t]),c=y.useCallback(()=>{i({type:5,time:Date.now()})},[i]),l=y.useCallback((p,m)=>{i({type:1,toast:{id:p,height:m}})},[i]),d=y.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),u=y.useCallback((p,m)=>{let{reverseOrder:h=!1,gutter:b=8,defaultPosition:f}=m||{},x=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),v=x.findIndex(w=>w.id===p.id),_=x.filter((w,j)=>j<v&&w.visible).length;return x.filter(w=>w.visible).slice(...h?[_+1]:[0,_]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)s(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:l,startPause:c,endPause:d,calculateOffset:u}}},gu=Ie`37 */function Fn(){return Fn=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},Fn.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(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 $n(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=$n(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const $a=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,s=x.useRef();s.current==null&&(s.current=Ed({window:o,v5Compat:!0}));let i=s.current,[l,d]=x.useState({action:i.action,location:i.location}),{v7_startTransition:c}=n||{},u=x.useCallback(p=>{c&&$a?$a(()=>d(p)):d(p)},[d,c]);return x.useLayoutEffect(()=>i.listen(u),[i,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ht=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:s,replace:i,state:l,target:d,to:c,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(ft),b,f=!1;if(typeof c=="string"&&eu.test(c)&&(b=c,Qd))try{let w=new URL(window.location.href),j=c.startsWith("//")?new URL(w.protocol+c):new URL(c),C=Pa(j.pathname,g);j.origin===w.origin&&C!=null?c=C+j.search+j.hash:f=!0}catch{}let h=Dd(c,{relative:o}),v=tu(c,{replace:i,state:l,target:d,preventScrollReset:u,relative:o,viewTransition:p});function _(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",Fn({},m,{href:b||h,onClick:f||s?n:_,ref:r,target:d}))});var Ba;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ba||(Ba={}));var Ua;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ua||(Ua={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:s,relative:i,viewTransition:l}=t===void 0?{}:t,d=Se(),c=Kt(),u=Ma(e,{relative:i});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(c)===_r(u);d(e,{replace:m,state:o,preventScrollReset:s,relative:i,viewTransition:l})}},[c,d,u,n,o,r,e,s,i,l])}function Yt(e){let t=x.useRef($n(e)),r=x.useRef(!1),n=Kt(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),s=Se(),i=x.useCallback((l,d)=>{const c=$n(typeof l=="function"?l(o):l);r.current=!0,s("?"+c,d)},[s,o]);return[o,i]}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,Ha=/\n+/g,Be=(e,t)=>{let r="",n="",o="";for(let s in e){let i=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+i+";":n+=s[1]=="f"?Be(i,s):s+"{"+Be(i,s[1]=="k"?"":t)+"}":typeof i=="object"?n+=Be(i,t?t.replace(/([^,])+/g,l=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,d=>/&/.test(d)?d.replace(/&/g,l):l?l+" "+d:d)):s):i!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Be.p?Be.p(s,i):s+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Le={},Va=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Va(e[r]);return t}return e},su=(e,t,r,n,o)=>{let s=Va(e),i=Le[s]||(Le[s]=(d=>{let c=0,u=11;for(;c<d.length;)u=101*u+d.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Le[i]){let d=s!==e?e:(c=>{let u,p,m=[{}];for(;u=ou.exec(c.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Ha," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Ha," ").trim();return m[0]})(e);Le[i]=Be(o?{["@keyframes "+i]:d}:d,r?"":"."+i)}let l=r&&Le.g?Le.g:null;return r&&(Le.g=Le[i]),((d,c,u,p)=>{p?c.data=c.data.replace(p,d):c.data.indexOf(d)===-1&&(c.data=u?d+c.data:c.data+d)})(Le[i],t,n,l),i},iu=(e,t,r)=>e.reduce((n,o,s)=>{let i=t[s];if(i&&i.call){let l=i(r),d=l&&l.props&&l.props.className||/^go/.test(l)&&l;i=d?"."+d:l&&typeof l=="object"?l.props?"":Be(l,""):l===!1?"":l}return n+o+(i??"")},"");function jr(e){let t=this||{},r=e.call?e(t.p):e;return su(r.unshift?r.raw?iu(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 Wa,Bn,Un;jr.bind({g:1});let Ie=jr.bind({k:1});function lu(e,t,r,n){Be.p=t,Wa=e,Bn=r,Un=n}function Ue(e,t){let r=this||{};return function(){let n=arguments;function o(s,i){let l=Object.assign({},s),d=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(d),l.className=jr.apply(r,n)+(d?" "+d:"");let c=e;return e[0]&&(c=l.as||e,delete l.as),Un&&c[0]&&Un(l),Wa(c,l)}return o}}var cu=e=>typeof e=="function",Sr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),qa=(()=>{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,Hn="default",Ga=(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(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return Ga(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+s}))}}},Cr=[],Ka={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ce={},Ya=(e,t=Hn)=>{Ce[t]=Ga(Ce[t]||Ka,e),Cr.forEach(([r,n])=>{r===t&&n(Ce[t])})},Xa=e=>Object.keys(Ce).forEach(t=>Ya(e,t)),pu=e=>Object.keys(Ce).find(t=>Ce[t].toasts.some(r=>r.id===e)),kr=(e=Hn)=>t=>{Ya(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Hn)=>{let[r,n]=y.useState(Ce[t]||Ka),o=y.useRef(Ce[t]);y.useEffect(()=>(o.current!==Ce[t]&&n(Ce[t]),Cr.push([t,n]),()=>{let i=Cr.findIndex(([l])=>l===t);i>-1&&Cr.splice(i,1)}),[t]);let s=r.toasts.map(i=>{var l,d,c;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((l=e[i.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:i.duration||((d=e[i.type])==null?void 0:d.duration)||e?.duration||mu[i.type],style:{...e.style,...(c=e[i.type])==null?void 0:c.style,...i.style}}});return{...r,toasts:s}},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()}),Xt=e=>(t,r)=>{let n=hu(t,e,r);return kr(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},oe=(e,t)=>Xt("blank")(e,t);oe.error=Xt("error"),oe.success=Xt("success"),oe.loading=Xt("loading"),oe.custom=Xt("custom"),oe.dismiss=(e,t)=>{let r={type:3,toastId:e};t?kr(t)(r):Xa(r)},oe.dismissAll=e=>oe.dismiss(void 0,e),oe.remove=(e,t)=>{let r={type:4,toastId:e};t?kr(t)(r):Xa(r)},oe.removeAll=e=>oe.remove(void 0,e),oe.promise=(e,t,r)=>{let n=oe.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?Sr(t.success,o):void 0;return s?oe.success(s,{id:n,...r,...r?.success}):oe.dismiss(n),o}).catch(o=>{let s=t.error?Sr(t.error,o):void 0;s?oe.error(s,{id:n,...r,...r?.error}):oe.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,s=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),i({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&&oe.dismiss(g.id);return}return setTimeout(()=>oe.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let i=y.useCallback(kr(t),[t]),l=y.useCallback(()=>{i({type:5,time:Date.now()})},[i]),d=y.useCallback((p,m)=>{i({type:1,toast:{id:p,height:m}})},[i]),c=y.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),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)s(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:d,startPause:l,endPause:c,calculateOffset:u}}},bu=Ie` 38 38 from { 39 39 transform: scale(0) rotate(45deg); … … 43 43 transform: scale(1) rotate(45deg); 44 44 opacity: 1; 45 }`, xu=Ie`45 }`,_u=Ie` 46 46 from { 47 47 transform: scale(0); … … 51 51 transform: scale(1); 52 52 opacity: 1; 53 }`, bu=Ie`53 }`,vu=Ie` 54 54 from { 55 55 transform: scale(0) rotate(90deg); … … 59 59 transform: scale(1) rotate(90deg); 60 60 opacity: 1; 61 }`, _u=Ue("div")`61 }`,yu=Ue("div")` 62 62 width: 20px; 63 63 opacity: 0; … … 68 68 transform: rotate(45deg); 69 69 70 animation: ${ gu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)70 animation: ${bu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 71 71 forwards; 72 72 animation-delay: 100ms; … … 75 75 &:before { 76 76 content: ''; 77 animation: ${ xu} 0.15s ease-out forwards;77 animation: ${_u} 0.15s ease-out forwards; 78 78 animation-delay: 150ms; 79 79 position: absolute; … … 88 88 89 89 &:before { 90 animation: ${ bu} 0.15s ease-out forwards;90 animation: ${vu} 0.15s ease-out forwards; 91 91 animation-delay: 180ms; 92 92 transform: rotate(90deg); 93 93 } 94 `, vu=Ie`94 `,wu=Ie` 95 95 from { 96 96 transform: rotate(0deg); … … 99 99 transform: rotate(360deg); 100 100 } 101 `, yu=Ue("div")`101 `,ju=Ue("div")` 102 102 width: 12px; 103 103 height: 12px; … … 107 107 border-color: ${e=>e.secondary||"#e0e0e0"}; 108 108 border-right-color: ${e=>e.primary||"#616161"}; 109 animation: ${ vu} 1s linear infinite;110 `, wu=Ie`109 animation: ${wu} 1s linear infinite; 110 `,Su=Ie` 111 111 from { 112 112 transform: scale(0) rotate(45deg); … … 116 116 transform: scale(1) rotate(45deg); 117 117 opacity: 1; 118 }`, ju=Ie`118 }`,Cu=Ie` 119 119 0% { 120 120 height: 0; … … 130 130 opacity: 1; 131 131 height: 10px; 132 }`, Su=Ue("div")`132 }`,ku=Ue("div")` 133 133 width: 20px; 134 134 opacity: 0; … … 139 139 transform: rotate(45deg); 140 140 141 animation: ${ wu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)141 animation: ${Su} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 142 142 forwards; 143 143 animation-delay: 100ms; … … 145 145 content: ''; 146 146 box-sizing: border-box; 147 animation: ${ ju} 0.2s ease-out forwards;147 animation: ${Cu} 0.2s ease-out forwards; 148 148 opacity: 0; 149 149 animation-delay: 200ms; … … 157 157 width: 6px; 158 158 } 159 `, Cu=Ue("div")`159 `,Nu=Ue("div")` 160 160 position: absolute; 161 `, ku=Ue("div")`161 `,Eu=Ue("div")` 162 162 position: relative; 163 163 display: flex; … … 166 166 min-width: 20px; 167 167 min-height: 20px; 168 `, Nu=Ie`168 `,Pu=Ie` 169 169 from { 170 170 transform: scale(0.6); … … 174 174 transform: scale(1); 175 175 opacity: 1; 176 }`, Eu=Ue("div")`176 }`,Tu=Ue("div")` 177 177 position: relative; 178 178 transform: scale(0.6); 179 179 opacity: 0.4; 180 180 min-width: 20px; 181 animation: ${ Nu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)181 animation: ${Pu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) 182 182 forwards; 183 `, Tu=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?g.createElement(Eu,null,t):t:r==="blank"?null:g.createElement(ku,null,g.createElement(yu,{...n}),r!=="loading"&&g.createElement(Cu,null,r==="error"?g.createElement(_u,{...n}):g.createElement(Su,{...n})))},Au=e=>`183 `,Au=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?x.createElement(Tu,null,t):t:r==="blank"?null:x.createElement(Eu,null,x.createElement(ju,{...n}),r!=="loading"&&x.createElement(Nu,null,r==="error"?x.createElement(yu,{...n}):x.createElement(ku,{...n})))},Ou=e=>` 184 184 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 185 185 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} 186 `, Pu=e=>`186 `,Ru=e=>` 187 187 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 188 188 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} 189 `, Ou="0%{opacity:0;} 100%{opacity:1;}",Ru="0%{opacity:1;} 100%{opacity:0;}",Lu=Ue("div")`189 `,Lu="0%{opacity:0;} 100%{opacity:1;}",Iu="0%{opacity:1;} 100%{opacity:0;}",zu=Ue("div")` 190 190 display: flex; 191 191 align-items: center; … … 199 199 padding: 8px 10px; 200 200 border-radius: 8px; 201 `, Iu=Ue("div")`201 `,Mu=Ue("div")` 202 202 display: flex; 203 203 justify-content: center; … … 206 206 flex: 1 1 auto; 207 207 white-space: pre-line; 208 `, zu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Va()?[Ou,Ru]:[Au(r),Pu(r)];return{animation:t?`${Ie(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ie(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Mu=g.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?zu(e.position||t||"top-center",e.visible):{opacity:0},s=g.createElement(Tu,{toast:e}),i=g.createElement(Iu,{...e.ariaProps},Cr(e.message,e));return g.createElement(Lu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:s,message:i}):g.createElement(g.Fragment,null,s,i))});su(g.createElement);var Du=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let s=g.useCallback(i=>{if(i){let c=()=>{let l=i.getBoundingClientRect().height;n(e,l)};c(),new MutationObserver(c).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return g.createElement("div",{ref:s,className:t,style:r},o)},Fu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Va()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},$u=Sr`208 `,Du=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=qa()?[Lu,Iu]:[Ou(r),Ru(r)];return{animation:t?`${Ie(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ie(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Du(e.position||t||"top-center",e.visible):{opacity:0},s=x.createElement(Au,{toast:e}),i=x.createElement(Mu,{...e.ariaProps},Sr(e.message,e));return x.createElement(zu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:s,message:i}):x.createElement(x.Fragment,null,s,i))});lu(x.createElement);var $u=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let s=x.useCallback(i=>{if(i){let l=()=>{let d=i.getBoundingClientRect().height;n(e,d)};l(),new MutationObserver(l).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:s,className:t,style:r},o)},Bu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:qa()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Uu=jr` 209 209 z-index: 9999; 210 210 > * { 211 211 pointer-events: auto; 212 212 } 213 `,Er=16,Bu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:i,containerClassName:c})=>{let{toasts:l,handlers:d}=hu(r,s);return g.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Er,left:Er,right:Er,bottom:Er,pointerEvents:"none",...i},className:c,onMouseEnter:d.startPause,onMouseLeave:d.endPause},l.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),h=Fu(p,m);return g.createElement(Du,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?$u:"",style:h},u.type==="custom"?Cr(u.message,u):o?o(u):g.createElement(Mu,{toast:u,position:p}))}))},G=oe;const Ya={carousel:"carousel",grid:"grid"},Uu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,shape:"rectangle",size:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ya.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Hu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Xa=[{label:"Horizontal",value:"horizontal"}],Vu=[{label:"Vertical",value:"vertical"}],Wu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],qu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Ja={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Za=y.createContext&&y.createContext(Ja),Gu=["attr","size","title"];function Ku(e,t){if(e==null)return{};var r=Yu(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yu(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 Tr(){return Tr=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},Tr.apply(this,arguments)}function Qa(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 Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qa(Object(r),!0).forEach(function(n){Xu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xu(e,t,r){return t=Ju(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ju(e){var t=Zu(e,"string");return typeof t=="symbol"?t:t+""}function Zu(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 es(e){return e&&e.map((t,r)=>y.createElement(t.tag,Ar({key:r},t.attr),es(t.child)))}function H(e){return t=>y.createElement(Qu,Tr({attr:Ar({},e.attr)},t),es(e.child))}function Qu(e){var t=r=>{var{attr:n,size:o,title:s}=e,i=Ku(e,Gu),c=o||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),y.createElement("svg",Tr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:l,style:Ar(Ar({color:e.color||r.color},r.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),s&&y.createElement("title",null,s),e.children)};return Za!==void 0?y.createElement(Za.Consumer,null,r=>t(r)):t(Ja)}function ep(e){return H({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 qt(e){return H({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 gt(e){return H({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 Gt(e){return H({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 Kt(e){return H({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 tp(e){return H({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 rp(e){return H({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 tt(e){return H({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 np(e){return H({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 ts(e){return H({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 op(e){return H({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 Yt(e){return H({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 rs(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wn(...e){return t=>{let r=!1;const n=e.map(o=>{const s=rs(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():rs(e[o],null)}}}}function Y(...e){return g.useCallback(Wn(...e),e)}function rt(e){const t=sp(e),r=g.forwardRef((n,o)=>{const{children:s,...i}=n,c=g.Children.toArray(s),l=c.find(cp);if(l){const d=l.props.children,u=c.map(p=>p===l?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var ap=rt("Slot");function sp(e){const t=g.forwardRef((r,n)=>{const{children:o,...s}=r;if(g.isValidElement(o)){const i=dp(o),c=lp(s,o.props);return o.type!==g.Fragment&&(c.ref=n?Wn(n,i):i),g.cloneElement(o,c)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ip=Symbol("radix.slottable");function cp(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ip}function lp(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...c)=>{const l=s(...c);return o(...c),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function dp(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 ns(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=ns(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function up(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ns(e))&&(n&&(n+=" "),n+=t);return n}function D(...e){return up(e)}const pp="ecr-button",mp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},fp={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 re({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const s=n?ap:"button";return a.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:D(pp,mp[t],fp[r],e),...o})}function hp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:s,handleCreateGroup:i}){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(re,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(re,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"})]}):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(re,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(Yt,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ts,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(re,{disabled:s,onClick:i,className:"ecr-admin-reels-header__create",children:[s?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(gt,{})," ","Create Group"]}):null]})]})}function gp(e){return H({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 xp(e){return H({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 nt(e){return H({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 bp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function _p({isFullScreen:e}){return a.jsx("div",{className:D("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const os=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,s)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:D("ecr-player__progress-fill",s===r?.index?"ecr-player__progress-fill--active":s<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},s))}),xt=({className:e,children:t,...r})=>a.jsx("button",{className:D("ecr-player__nav",e),...r,children:t});function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Gn(e){return H({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 Kn(e){return H({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 Yn(e){return H({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 vp="Left",yp="Right",jp="Up",Sp="Down",bt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},as="mousemove",ss="mouseup",Cp="touchend",kp="touchmove",Np="touchstart";function Ep(e,t,r,n){return e>t?r>0?yp:vp:n>0?Sp:jp}function is(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 Tp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,h)=>{h.trackMouse&&!p&&(document.addEventListener(as,n),document.addEventListener(ss,i));const{clientX:b,clientY:f}=p?u.touches[0]:u,x=is([b,f],h.rotationAngle);return h.onTouchStartOrOnMouseDown&&h.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Xn),{initial:x.slice(),xy:x,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const h="touches"in u;if(h&&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}=h?u.touches[0]:u,[x,v]=is([b,f],m.rotationAngle),_=x-p.xy[0],w=v-p.xy[1],j=Math.abs(_),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[_/(N||1),w/(N||1)],T=Ep(j,C,_,w),O=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||bt.delta;if(j<O&&C<O&&!p.swiping)return p;const L={absX:j,absY:C,deltaX:_,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};L.first&&m.onSwipeStart&&m.onSwipeStart(L),m.onSwiping&&m.onSwiping(L);let A=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(A=!0),A&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:L,swiping:!0})})},o=u=>{e((p,m)=>{let h;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){h=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(h);const b=m[`onSwiped${h.dir}`];b&&b(h)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Xn),{eventData:h})})},s=()=>{document.removeEventListener(as,n),document.removeEventListener(ss,i)},i=u=>{s(),o(u)},c=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const h=Object.assign(Object.assign({},bt.touchEventOptions),p.touchEventOptions),b=[[Np,r,h],[kp,n,Object.assign(Object.assign({},h),p.preventScrollOnSwipe?{passive:!1}:{})],[Cp,o,h]];b.forEach(([f,x,v])=>u.addEventListener(f,x,v)),m=()=>b.forEach(([f,x])=>u.removeEventListener(f,x))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const h={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),h.cleanUpTouch=void 0),m.trackTouch&&u&&(h.cleanUpTouch=c(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),h)})}};return t.trackMouse&&(d.onMouseDown=r),[d,c]}function Ap(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 Pp(e){const{trackMouse:t}=e,r=g.useRef(Object.assign({},Xn)),n=g.useRef(Object.assign({},bt)),o=g.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},bt),e);let s;for(s in bt)n.current[s]===void 0&&(n.current[s]=bt[s]);const[i,c]=g.useMemo(()=>Tp(l=>r.current=l(r.current,n.current),{trackMouse:t}),[t]);return r.current=Ap(r.current,n.current,o.current,c),i}const Op=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:s,handleNextFile:i,setDuration:c})=>{const[l,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,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:l?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>s(o),onEnded:i,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,h=p.videoHeight;d(h>m),c(p.duration)}})})},cs=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:s,setIsPaused:i,handlePrevFile:c,handleNextFile:l})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=x=>{const v=p.current[x];v&&(s?v.play():v.pause(),i(_=>!_))},h=x=>{const v=p.current[x];v&&(v.muted=!d,u(_=>!_))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Pp({trackMouse:!0,onSwipedRight:c,onSwipedLeft:l,onSwipedUp:()=>{b&&l()},onSwipedDown:()=>{if(b){c();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((x,v)=>a.jsx("div",{className:"ecr-player__slide",children:x?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Op,{videoRefs:p,file:x,isMuted:d,i:v,togglePlayPause:m,handleNextFile:l,setDuration:r,isPaused:s},x.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[s?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}),d?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(v)}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(v)})]})]})},v))})},Rp=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,s]=y.useState(!1),[i,c]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const l=()=>{const m=e?.files??[];r?.index>0?n(h=>({index:h.index-1,story_uuid:m[h.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(h=>({index:h.index+1,story_uuid:m[h.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(xt,{onClick:l,className:"ecr-player__nav--left",children:a.jsx(Gt,{size:24})}):null,r.index<u-1?a.jsx(xt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Kt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(os,{playingStory:e,duration:i,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(cs,{currentFileIndex:r,files:e?.files,setDuration:c,setPreviewReel:t,isPaused:o,setIsPaused:s,handlePrevFile:l,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Lp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Ip(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function zp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return H({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 Mp(e){return H({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 ls(e){return H({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 Dp(e){return H({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 Fp(e){return H({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 $p(e){return H({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 Bp(e){return H({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)}function ds(e){return H({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 Up(e){return H({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 Hp(e){return H({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 Vp(e){return H({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 Wp(e){return H({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)}const qp=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`},Gp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(i=>({...i,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),s=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,poster:s}):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%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:qp(r?.[e.id]??e.view_count)}),a.jsx(rp,{size:14})]})]})},Jn=y.memo(Gp);function Kp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:i}){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:D("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Jn,{story:e,styles:t}),a.jsxs("div",{className:D("ecr-admin-reel-card__actions",i?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(re,{onClick:()=>s(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(re,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(ht,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(re,{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(ds,{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:D("ecr-admin-reel-card__corner",i?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(re,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Dp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Fp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel-card__title",children:e.title})]})}function Yp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:s,lastStoryElementRef:i}){return a.jsx("div",{style:{"--thumbnail-size":`${t?.size}px`},className:"ecr-admin-reels-grid",children:e?.map((c,l)=>a.jsx("div",{ref:e.length===l+1?i:null,children:a.jsx(Kp,{reel:c,styles:t,isSelected:r.includes(c.id),onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:r.length>0})},c.id))})}const Xt=({cb:e})=>{const t=Se(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(gp,{size:24})})};function Xp(e){return H({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 Jt=({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(ht,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:s=>{if(!t)return;const i=r.href;i&&(s.preventDefault(),t(i))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Xp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Or=({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:s=>{s.currentTarget.contains(s.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(op,{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(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:s})=>a.jsxs(ht,{style:{color:r},to:e,className:D("ecr-admin-link-button",o),onClick:i=>{s&&(i.preventDefault(),s(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:D("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),_t=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),vt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Jp(e){return H({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 Ir=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Jp,{}),"ReelsWP"]});function us(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zp}=Object.prototype,{getPrototypeOf:Zn}=Object,{iterator:zr,toStringTag:ps}=Symbol,Mr=(e=>t=>{const r=Zp.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),_e=e=>(e=e.toLowerCase(),t=>Mr(t)===e),Dr=e=>t=>typeof t===e,{isArray:yt}=Array,wt=Dr("undefined");function Zt(e){return e!==null&&!wt(e)&&e.constructor!==null&&!wt(e.constructor)&&le(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ms=_e("ArrayBuffer");function Qp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ms(e.buffer),t}const em=Dr("string"),le=Dr("function"),fs=Dr("number"),Qt=e=>e!==null&&typeof e=="object",tm=e=>e===!0||e===!1,Fr=e=>{if(Mr(e)!=="object")return!1;const t=Zn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ps in e)&&!(zr in e)},rm=e=>{if(!Qt(e)||Zt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},nm=_e("Date"),om=_e("File"),am=_e("Blob"),sm=_e("FileList"),im=e=>Qt(e)&&le(e.pipe),cm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||le(e.append)&&((t=Mr(e))==="formdata"||t==="object"&&le(e.toString)&&e.toString()==="[object FormData]"))},lm=_e("URLSearchParams"),[dm,um,pm,mm]=["ReadableStream","Request","Response","Headers"].map(_e),fm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function er(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Zt(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let c;for(n=0;n<i;n++)c=s[n],t.call(null,e[c],c,e)}}function hs(e,t){if(Zt(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 ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gs=e=>!wt(e)&&e!==ot;function Qn(){const{caseless:e,skipUndefined:t}=gs(this)&&this||{},r={},n=(o,s)=>{const i=e&&hs(r,s)||s;Fr(r[i])&&Fr(o)?r[i]=Qn(r[i],o):Fr(o)?r[i]=Qn({},o):yt(o)?r[i]=o.slice():(!t||!wt(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&er(arguments[o],n);return r}const hm=(e,t,r,{allOwnKeys:n}={})=>(er(t,(o,s)=>{r&&le(o)?e[s]=us(o,r):e[s]=o},{allOwnKeys:n}),e),gm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xm=(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)},bm=(e,t,r,n)=>{let o,s,i;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&Zn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},_m=(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},vm=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!fs(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ym=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zn(Uint8Array)),wm=(e,t)=>{const n=(e&&e[zr]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},jm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Sm=_e("HTMLFormElement"),Cm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),xs=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),km=_e("RegExp"),bs=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};er(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},Nm=e=>{bs(e,(t,r)=>{if(le(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(le(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+"'")})}})},Em=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return yt(e)?n(e):n(String(e).split(t)),r},Tm=()=>{},Am=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Pm(e){return!!(e&&le(e.append)&&e[ps]==="FormData"&&e[zr])}const Om=e=>{const t=new Array(10),r=(n,o)=>{if(Qt(n)){if(t.indexOf(n)>=0)return;if(Zt(n))return n;if(!("toJSON"in n)){t[o]=n;const s=yt(n)?[]:{};return er(n,(i,c)=>{const l=r(i,o+1);!wt(l)&&(s[c]=l)}),t[o]=void 0,s}}return n};return r(e,0)},Rm=_e("AsyncFunction"),Lm=e=>e&&(Qt(e)||le(e))&&le(e.then)&&le(e.catch),_s=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:s})=>{o===ot&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",le(ot.postMessage)),Im=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||_s,S={isArray:yt,isArrayBuffer:ms,isBuffer:Zt,isFormData:cm,isArrayBufferView:Qp,isString:em,isNumber:fs,isBoolean:tm,isObject:Qt,isPlainObject:Fr,isEmptyObject:rm,isReadableStream:dm,isRequest:um,isResponse:pm,isHeaders:mm,isUndefined:wt,isDate:nm,isFile:om,isBlob:am,isRegExp:km,isFunction:le,isStream:im,isURLSearchParams:lm,isTypedArray:ym,isFileList:sm,forEach:er,merge:Qn,extend:hm,trim:fm,stripBOM:gm,inherits:xm,toFlatObject:bm,kindOf:Mr,kindOfTest:_e,endsWith:_m,toArray:vm,forEachEntry:wm,matchAll:jm,isHTMLForm:Sm,hasOwnProperty:xs,hasOwnProp:xs,reduceDescriptors:bs,freezeMethods:Nm,toObjectSet:Em,toCamelCase:Cm,noop:Tm,toFiniteNumber:Am,findKey:hs,global:ot,isContextDefined:gs,isSpecCompliantForm:Pm,toJSONObject:Om,isAsyncFn:Rm,isThenable:Lm,setImmediate:_s,asap:Im,isIterable:e=>e!=null&&le(e[zr])};function B(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(B,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 vs=B.prototype,ys={};["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=>{ys[e]={value:e}}),Object.defineProperties(B,ys),Object.defineProperty(vs,"isAxiosError",{value:!0}),B.from=(e,t,r,n,o,s)=>{const i=Object.create(vs);S.toFlatObject(e,i,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const c=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return B.call(i,c,l,r,n,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const zm=null;function eo(e){return S.isPlainObject(e)||S.isArray(e)}function ws(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function js(e,t,r){return e?e.concat(t).map(function(o,s){return o=ws(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function Mm(e){return S.isArray(e)&&!e.some(eo)}const Dm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(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,x){return!S.isUndefined(x[f])});const n=r.metaTokens,o=r.visitor||u,s=r.dots,i=r.indexes,l=(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(!l&&S.isBlob(b))throw new B("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?l&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,x){let v=b;if(b&&!x&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Mm(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(v=S.toArray(b)))return f=ws(f),v.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(i===!0?js([f],j,s):i===null?f:f+"[]",d(w))}),!1}return eo(b)?!0:(t.append(js(x,f,s),d(b)),!1)}const p=[],m=Object.assign(Dm,{defaultVisitor:u,convertValue:d,isVisitable:eo});function h(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&&h(v,f?f.concat(_):[_])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Ss(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function to(e,t){this._pairs=[],e&&$r(e,this,t)}const Cs=to.prototype;Cs.append=function(t,r){this._pairs.push([t,r])},Cs.toString=function(t){const r=t?function(n){return t.call(this,n,Ss)}:Ss;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Fm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ks(e,t,r){if(!t)return e;const n=r&&r.encode||Fm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(o?s=o(t,r):s=S.isURLSearchParams(t)?t.toString():new to(t,r).toString(n),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Ns{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 Es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$m={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:to,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ro=typeof window<"u"&&typeof document<"u",no=typeof navigator=="object"&&navigator||void 0,Bm=ro&&(!no||["ReactNative","NativeScript","NS"].indexOf(no.product)<0),Um=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hm=ro&&window.location.href||"http://localhost",ie={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ro,hasStandardBrowserEnv:Bm,hasStandardBrowserWebWorkerEnv:Um,navigator:no,origin:Hm},Symbol.toStringTag,{value:"Module"})),...$m};function Vm(e,t){return $r(e,new ie.classes.URLSearchParams,{visitor:function(r,n,o,s){return ie.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Wm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function qm(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function Ts(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),l=s>=r.length;return i=!i&&S.isArray(o)?o.length:i,l?(S.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!c):((!o[i]||!S.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&S.isArray(o[i])&&(o[i]=qm(o[i])),!c)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Wm(n),o,r,0)}),r}return null}function Gm(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 tr={transitional:Es,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=S.isObject(t);if(s&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Ts(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 c;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Vm(t,this.formSerializer).toString();if((c=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return $r(c?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),Gm(t)):t}],transformResponse:[function(t){const r=this.transitional||tr.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 i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?B.from(c,B.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.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=>{tr.headers[e]={}});const Km=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"]),Ym=e=>{const t={};let r,n,o;return e&&e.split(` 214 `).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&Km[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},As=Symbol("internals");function rr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:S.isArray(e)?e.map(Br):String(e)}function Xm(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 Jm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oo(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 Zm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Qm(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,s,i){return this[n].call(this,t,o,s,i)},configurable:!0})})}let de=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(c,l,d){const u=rr(l);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||l]=Br(c))}const i=(c,l)=>S.forEach(c,(d,u)=>s(d,u,l));if(S.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(S.isString(t)&&(t=t.trim())&&!Jm(t))i(Ym(t),r);else if(S.isObject(t)&&S.isIterable(t)){let c={},l,d;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[d=u[0]]=(l=c[d])?S.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}i(c,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=rr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Xm(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=rr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||oo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(i){if(i=rr(i),i){const c=S.findKey(n,i);c&&(!r||oo(n,n[c],c,r))&&(delete n[c],o=!0)}}return S.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||oo(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,s)=>{const i=S.findKey(n,s);if(i){r[i]=Br(o),delete r[s];return}const c=t?Zm(s):String(s).trim();c!==s&&delete r[s],r[c]=Br(o),n[c]=!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[As]=this[As]={accessors:{}}).accessors,o=this.prototype;function s(i){const c=rr(i);n[c]||(Qm(o,i),n[c]=!0)}return S.isArray(t)?t.forEach(s):s(t),this}};de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(de.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(de);function ao(e,t){const r=this||tr,n=t||r,o=de.from(n.headers);let s=n.data;return S.forEach(e,function(c){s=c.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Ps(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){B.call(this,e??"canceled",B.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(jt,B,{__CANCEL__:!0});function Os(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ef(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function tf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(l){const d=Date.now(),u=n[s];i||(i=d),r[o]=l,n[o]=d;let p=s,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-i<t)return;const h=u&&d-u;return h?Math.round(m*1e3/h):void 0}}function rf(e,t){let r=0,n=1e3/t,o,s;const i=(d,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?i(d,u):(o=d,s||(s=setTimeout(()=>{s=null,i(o)},n-p)))},()=>o&&i(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=tf(50,250);return rf(s=>{const i=s.loaded,c=s.lengthComputable?s.total:void 0,l=i-n,d=o(l),u=i<=c;n=i;const p={loaded:i,total:c,progress:c?i/c:void 0,bytes:l,rate:d||void 0,estimated:d&&c&&u?(c-i)/d:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},r)},Rs=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ls=e=>(...t)=>S.asap(()=>e(...t)),nf=ie.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ie.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ie.origin),ie.navigator&&/(msie|trident)/i.test(ie.navigator.userAgent)):()=>!0,of=ie.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&c.push(`path=${n}`),S.isString(o)&&c.push(`domain=${o}`),s===!0&&c.push("secure"),S.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.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 af(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Is(e,t,r){let n=!af(t);return e&&(n||r==!1)?sf(e,t):t}const zs=e=>e instanceof de?{...e}:e;function at(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 s(d,u){if(!S.isUndefined(u))return n(void 0,u)}function i(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function c(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const l={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(d,u,p)=>o(zs(d),zs(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=l[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==c||(r[u]=m)}),r}const Ms=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:c}=t;if(t.headers=i=de.from(i),t.url=ks(Is(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),S.isFormData(r)){if(ie.hasStandardBrowserEnv||ie.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const l=r.getHeaders(),d=["content-type","content-length"];Object.entries(l).forEach(([u,p])=>{d.includes(u.toLowerCase())&&i.set(u,p)})}}if(ie.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&nf(t.url))){const l=o&&s&&of.read(s);l&&i.set(o,l)}return t},cf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Ms(e);let s=o.data;const i=de.from(o.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:d}=o,u,p,m,h,b;function f(){h&&h(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function v(){if(!x)return;const w=de.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),C={data:!c||c==="text"||c==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};Os(function(k){r(k),f()},function(k){n(k),f()},C),x=null}"onloadend"in x?x.onloadend=v:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(v)},x.onabort=function(){x&&(n(new B("Request aborted",B.ECONNABORTED,e,x)),x=null)},x.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new B(C,B.ERR_NETWORK,e,x);N.event=j||null,n(N),x=null},x.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Es;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new B(j,C.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,x)),x=null},s===void 0&&i.setContentType(null),"setRequestHeader"in x&&S.forEach(i.toJSON(),function(j,C){x.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),c&&c!=="json"&&(x.responseType=o.responseType),d&&([m,b]=Ur(d,!0),x.addEventListener("progress",m)),l&&x.upload&&([p,h]=Ur(l),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(u=w=>{x&&(n(!w||w.type?new jt(null,e,x):w),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const _=ef(o.url);if(_&&ie.protocols.indexOf(_)===-1){n(new B("Unsupported protocol "+_+":",B.ERR_BAD_REQUEST,e));return}x.send(s||null)})},lf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const s=function(d){if(!o){o=!0,c();const u=d instanceof Error?d:this.reason;n.abort(u instanceof B?u:new jt(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new B(`timeout ${t} of ms exceeded`,B.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));const{signal:l}=n;return l.unsubscribe=()=>S.asap(c),l}},df=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},uf=async function*(e,t){for await(const r of pf(e))yield*df(r,t)},pf=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()}},Ds=(e,t,r,n)=>{const o=uf(e,t);let s=0,i,c=l=>{i||(i=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:d,value:u}=await o.next();if(d){c(),l.close();return}let p=u.byteLength;if(r){let m=s+=p;r(m)}l.enqueue(new Uint8Array(u))}catch(d){throw c(d),d}},cancel(l){return c(l),o.return()}},{highWaterMark:2})},Fs=64*1024,{isFunction:Hr}=S,mf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:$s,TextEncoder:Bs}=S.global,Us=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ff=e=>{e=S.merge.call({skipUndefined:!0},mf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",s=Hr(r),i=Hr(n);if(!o)return!1;const c=o&&Hr($s),l=o&&(typeof Bs=="function"?(b=>f=>b.encode(f))(new Bs):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=s&&c&&Us(()=>{let b=!1;const f=new r(ie.origin,{body:new $s,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=i&&c&&Us(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,x)=>{let v=f&&f[b];if(v)return v.call(f);throw new B(`Response type '${b}' is not supported`,B.ERR_NOT_SUPPORT,x)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ie.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 l(b)).byteLength},h=async(b,f)=>{const x=S.toFiniteNumber(b.getContentLength());return x??m(f)};return async b=>{let{url:f,method:x,data:v,signal:_,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:O}=Ms(b),L=t||fetch;k=k?(k+"").toLowerCase():"text";let A=lf([_,w&&w.toAbortSignal()],j),I=null;const z=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let $;try{if(N&&d&&x!=="get"&&x!=="head"&&($=await h(E,v))!==0){let Z=new r(f,{method:"POST",body:v,duplex:"half"}),me;if(S.isFormData(v)&&(me=Z.headers.get("content-type"))&&E.setContentType(me),Z.body){const[Fe,ge]=Rs($,Ur(Ls(N)));v=Ds(Z.body,Fs,Fe,ge)}}S.isString(T)||(T=T?"include":"omit");const R=s&&"credentials"in r.prototype,U={...O,signal:A,method:x.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:R?T:void 0};I=s&&new r(f,U);let P=await(s?L(I,O):L(f,U));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&z)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=P[$e]});const me=S.toFiniteNumber(P.headers.get("content-length")),[Fe,ge]=C&&Rs(me,Ur(Ls(C),!0))||[];P=new n(Ds(P.body,Fs,Fe,()=>{ge&&ge(),z&&z()}),Z)}k=k||"text";let X=await p[S.findKey(p,k)||"text"](P,b);return!q&&z&&z(),await new Promise((Z,me)=>{Os(Z,me,{data:X,headers:de.from(P.headers),status:P.status,statusText:P.statusText,config:b,request:I})})}catch(R){throw z&&z(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new B("Network Error",B.ERR_NETWORK,b,I),{cause:R.cause||R}):B.from(R,R&&R.code,b,I)}}},hf=new Map,Hs=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let i=s.length,c=i,l,d,u=hf;for(;c--;)l=s[c],d=u.get(l),d===void 0&&u.set(l,d=c?new Map:ff(t)),u=d;return d};Hs();const so={http:zm,xhr:cf,fetch:{get:Hs}};S.forEach(so,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Vs=e=>`- ${e}`,gf=e=>S.isFunction(e)||e===null||e===!1;function xf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let i=0;i<r;i++){n=e[i];let c;if(o=n,!gf(n)&&(o=so[(c=String(n)).toLowerCase()],o===void 0))throw new B(`Unknown adapter '${c}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;s[c||"#"+i]=o}if(!o){const i=Object.entries(s).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let c=r?i.length>1?`since : 216 `+i.map(Vs).join(` 217 `):" "+Vs(i[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return o}const Ws={getAdapter:xf,adapters:so};function io(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function qs(e){return io(e),e.headers=de.from(e.headers),e.data=ao.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ws.getAdapter(e.adapter||tr.adapter,e)(e).then(function(n){return io(e),n.data=ao.call(e,e.transformResponse,n),n.headers=de.from(n.headers),n},function(n){return Ps(n)||(io(e),n&&n.response&&(n.response.data=ao.call(e,e.transformResponse,n.response),n.response.headers=de.from(n.response.headers))),Promise.reject(n)})}const Gs="1.13.1",Vr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ks={};Vr.transitional=function(t,r,n){function o(s,i){return"[Axios v"+Gs+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,c)=>{if(t===!1)throw new B(o(i," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!Ks[i]&&(Ks[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,c):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function bf(e,t,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const c=e[s],l=c===void 0||i(c,s,e);if(l!==!0)throw new B("option "+s+" must be "+l,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+s,B.ERR_BAD_OPTION)}}const Wr={assertOptions:bf,validators:Vr},ke=Wr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ns,response:new Ns}}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 s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` 218 `+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&S.merge(s.common,s[r.method]);s&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),r.headers=de.concat(i,s);const c=[];let l=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(l=l&&f.synchronous,c.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(!l){const b=[qs.bind(this),void 0];for(b.unshift(...c),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=c.length;let h=r;for(;p<m;){const b=c[p++],f=c[p++];try{h=b(h)}catch(x){f.call(this,x);break}}try{u=qs.call(this,h)}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=at(this.defaults,t);const r=Is(t.baseURL,t.url,t.allowAbsoluteUrls);return ks(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,c){return this.request(at(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let _f=class wd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(c=>{n.subscribe(c),s=c}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,c){n.reason||(n.reason=new jt(s,i,c),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 wd(function(o){t=o}),cancel:t}}};function vf(e){return function(r){return e.apply(null,r)}}function yf(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 Ys(e){const t=new st(e),r=us(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Ys(at(e,o))},r}const ee=Ys(tr);ee.Axios=st,ee.CanceledError=jt,ee.CancelToken=_f,ee.isCancel=Ps,ee.VERSION=Gs,ee.toFormData=$r,ee.AxiosError=B,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=vf,ee.isAxiosError=yf,ee.mergeConfig=at,ee.AxiosHeaders=de,ee.formToJSON=e=>Ts(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=Ws.getAdapter,ee.HttpStatusCode=co,ee.default=ee;const{Axios:yv,AxiosError:wv,CanceledError:jv,isCancel:Sv,CancelToken:Cv,VERSION:kv,all:Nv,Cancel:Ev,isAxiosError:Tv,spread:Av,toFormData:Pv,AxiosHeaders:Ov,HttpStatusCode:Rv,formToJSON:Lv,getAdapter:Iv,mergeConfig:zv}=ee,Xs=ecommreelsInfo,ue=ee.create({baseURL:`${Xs.apiBase}`,headers:{"X-WP-Nonce":Xs.nonce,"Content-Type":"application/json"}}),wf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async i=>{try{t(!0);const c={styles:et,story_ids:i},l=await ue.post("stories/manage-group-stories",c);return G.success("Group created successfully!"),l.data.group_id}catch(c){return c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),s=y.useCallback(async(i,c)=>{try{n(!0),await ue.delete(`story/${i}`),c(l=>l.filter(d=>d.id!==i)),G.success("Reel deleted successfully!")}catch(l){l instanceof Error?G.error(l.message):G.error("Something went wrong. Try again later!")}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:s}};function lo(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Js=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[s,i]=y.useState(!0),[c,l]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),h=lo(p,500),b=y.useRef(!0),f=y.useCallback(async _=>{_===1&&b.current?u(!0):l(!0);try{const w={page:_,per_page:20};e&&(w.group_id=e),h&&(w.search=h);const j=await ue.get("stories",{params:w}),C=j.data,N=parseInt(j.headers["x-wp-totalpages"]);r(k=>_===1?C:[...k,...C]),o(_+1),i(_<N)}catch(w){w instanceof Error?G.error(w.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),l(!1),u(!1)}},[e,h]);y.useEffect(()=>{o(1),r([]),f(1)},[h,f]);const x=y.useRef(null),v=y.useCallback(_=>{c||(x.current&&x.current.disconnect(),x.current=new IntersectionObserver(w=>{w[0].isIntersecting&&s&&f(n)}),_&&x.current.observe(_))},[c,s,n,f]);return y.useEffect(()=>()=>{x.current&&x.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:c,isLoading:d,lastStoryElementRef:v}};function jf(){const e=Se(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:s,setSearchTerm:i,isLoading:c}=Js(null),{styles:l,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=wf(),[h,b]=y.useState(null),[f,x]=y.useState(null),[v,_]=y.useState([]),w=async()=>{const k=await p(v);k&&e(`?view=${K.mg}&gid=${k}`)},j=()=>{_(t.map(k=>k.id))},C=k=>{_(E=>E.includes(k)?E.filter(T=>T!==k):[...E,k])},N=y.useCallback(async()=>{h&&(await m(h,r),b(null))},[m,h,r]);return c&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[h&&a.jsx(Or,{onReject:()=>b(null),onAccept:N,isLoading:u,message:"Are you sure, You want to remove this reel?"}),a.jsx(_t,{left:[a.jsx(vt,{name:"All Reels",Icon:ep},"page"),a.jsx(Xt,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:gt},"add-reel-all-reel")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(hp,{selectedReelIds:v,handleSelectAll:j,clearSelection:()=>_([]),searchTerm:s,setSearchTerm:i,isCreating:d,handleCreateGroup:w}),t.length?a.jsx(Yp,{reels:t,styles:l,selectedReelIds:v,onSelectReel:C,onDeleteReel:b,onPreviewReel:x,lastStoryElementRef:o}):!n&&!c?a.jsx(bp,{}):null,n&&a.jsx(_p,{isFullScreen:!t.length})]}),!!f&&a.jsx(Rp,{previewReel:f,setPreviewReel:x})]})}const Sf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:s,links:i,thumbnail:c})=>{try{t(!0);const l={story_title:o,files:s,links:i};typeof c=="string"&&c.trim().length>0&&(l.thumbnail=c),n&&(l.story_id=n);const d=await ue.post("files",l);return G.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(l){return l instanceof Error?G.error(l.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},uo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(re,{onClick:t,className:D("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(np,{className:"ecr-admin-save-button__icon"})," ",r]}),Zs=({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:s=>{e&&e(!0),r(s.target.value)}})}),Cf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const s=Se(),[i]=Vt(),c=i.get("sid"),l=i.get("from")||K.ag,d=i.get("gid"),{isSaving:u,saveStory:p}=Sf(),m=async()=>{if(u)return;const h=await p({storyId:c,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});h&&s(`?view=${l}${d?`&gid=${d}`:""}`,{replace:!0,...c?{}:{state:{storyId:h}}})};return a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:c?"Update Reel":"Add Reel",Icon:gt},"page"),a.jsx(Xt,{},"back")],center:[a.jsx(Zs,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(uo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:c?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function kf(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let po;const Nf=new Uint8Array(16);function Ef(){if(!po){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");po=crypto.getRandomValues.bind(crypto)}return po(Nf)}const Qs={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Tf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Ef();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,kf(n)}function mo(e,t,r){return Qs.randomUUID&&!e?Qs.randomUUID():Tf(e)}const ei="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",ti=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:s})=>{const[i,c]=y.useState(!1),l=()=>{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:mo()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:D("ecr-admin-upload",i?"ecr-admin-upload--active":"ecr-admin-upload--idle",s),onDragOver:d=>{d.preventDefault(),c(!0)},onDragLeave:()=>c(!1),onDrop:d=>{d.preventDefault(),c(!1),l()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:l,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:ei,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:i?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]})})]})})};/** 219 * @license lucide-react v0.552.0 - ISC 220 * 221 * This source code is licensed under the ISC license. 222 * See the LICENSE file in the root directory of this source tree. 223 */const Af=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ri=e=>{const t=Pf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ni=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Of=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** 224 * @license lucide-react v0.552.0 - ISC 225 * 226 * This source code is licensed under the ISC license. 227 * See the LICENSE file in the root directory of this source tree. 228 */var Rf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 229 * @license lucide-react v0.552.0 - ISC 230 * 231 * This source code is licensed under the ISC license. 232 * See the LICENSE file in the root directory of this source tree. 233 */const Lf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...c},l)=>y.createElement("svg",{ref:l,...Rf,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ni("lucide",o),...!s&&!Of(c)&&{"aria-hidden":"true"},...c},[...i.map(([d,u])=>y.createElement(d,u)),...Array.isArray(s)?s:[s]]));/** 234 * @license lucide-react v0.552.0 - ISC 235 * 236 * This source code is licensed under the ISC license. 237 * See the LICENSE file in the root directory of this source tree. 238 */const pe=(e,t)=>{const r=y.forwardRef(({className:n,...o},s)=>y.createElement(Lf,{ref:s,iconNode:t,className:ni(`lucide-${Af(ri(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ri(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 If=pe("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 fo=pe("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 zf=pe("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 Mf=pe("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 Df=pe("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 Ff=pe("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 $f=pe("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 Bf=pe("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 Uf=pe("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"}]]);/** 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 Hf=pe("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"}]]);/** 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 Vf=pe("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 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 Wf=pe("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"}]]);/** 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 qf=pe("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"}]]);/** 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 Gf=pe("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 Kf(e,t){const r=g.createContext(t),n=s=>{const{children:i,...c}=s,l=g.useMemo(()=>c,Object.values(c));return a.jsx(r.Provider,{value:l,children:i})};n.displayName=e+"Provider";function o(s){const i=g.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(s,i){const c=g.createContext(i),l=r.length;r=[...r,i];const d=p=>{const{scope:m,children:h,...b}=p,f=m?.[e]?.[l]||c,x=g.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:x,children:h})};d.displayName=s+"Provider";function u(p,m){const h=m?.[e]?.[l]||c,b=g.useContext(h);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,u]}const o=()=>{const s=r.map(i=>g.createContext(i));return function(c){const l=c?.[e]||s;return g.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[n,Yf(o,...t)]}function Yf(...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(s){const i=n.reduce((c,{useScope:l,scopeName:d})=>{const p=l(s)[`__scope${d}`];return{...c,...p}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Xf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=Xf.reduce((e,t)=>{const r=rt(`Primitive.${t}`),n=g.forwardRef((o,s)=>{const{asChild:i,...c}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Jf(e,t){e&&_r.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>t.current?.(...r),[])}function Zf(e,t=globalThis?.document){const r=Ve(e);g.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 Qf="DismissableLayer",ho="dismissableLayer.update",eh="dismissableLayer.pointerDownOutside",th="dismissableLayer.focusOutside",oi,ai=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:c,...l}=e,d=g.useContext(ai),[u,p]=g.useState(null),m=u?.ownerDocument??globalThis?.document,[,h]=g.useState({}),b=Y(t,k=>p(k)),f=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(x),_=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=_>=v,C=oh(k=>{const E=k.target,T=[...d.branches].some(O=>O.contains(E));!j||T||(o?.(k),i?.(k),k.defaultPrevented||c?.())},m),N=ah(k=>{const E=k.target;[...d.branches].some(O=>O.contains(E))||(s?.(k),i?.(k),k.defaultPrevented||c?.())},m);return Zf(k=>{_===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&c&&(k.preventDefault(),c()))},m),g.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(oi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),si(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=oi)}},[u,m,r,d]),g.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),si())},[u,d]),g.useEffect(()=>{const k=()=>h({});return document.addEventListener(ho,k),()=>document.removeEventListener(ho,k)},[]),a.jsx(W.div,{...l,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,C.onPointerDownCapture)})});qr.displayName=Qf;var rh="DismissableLayerBranch",nh=g.forwardRef((e,t)=>{const r=g.useContext(ai),n=g.useRef(null),o=Y(t,n);return g.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});nh.displayName=rh;function oh(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const s=c=>{if(c.target&&!n.current){let l=function(){ii(eh,r,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ah(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1);return g.useEffect(()=>{const o=s=>{s.target&&!n.current&&ii(th,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function si(){const e=new CustomEvent(ho);document.dispatchEvent(e)}function ii(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Jf(o,s):o.dispatchEvent(s)}var go=0;function xo(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ci()),document.body.insertAdjacentElement("beforeend",e[1]??ci()),go++,()=>{go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),go--}},[])}function ci(){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 bo="focusScope.autoFocusOnMount",_o="focusScope.autoFocusOnUnmount",li={bubbles:!1,cancelable:!0},sh="FocusScope",Gr=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[c,l]=g.useState(null),d=Ve(o),u=Ve(s),p=g.useRef(null),m=Y(t,f=>l(f)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let f=function(w){if(h.paused||!c)return;const j=w.target;c.contains(j)?p.current=j:We(p.current,{select:!0})},x=function(w){if(h.paused||!c)return;const j=w.relatedTarget;j!==null&&(c.contains(j)||We(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(c)};document.addEventListener("focusin",f),document.addEventListener("focusout",x);const _=new MutationObserver(v);return c&&_.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",x),_.disconnect()}}},[n,c,h.paused]),g.useEffect(()=>{if(c){pi.add(h);const f=document.activeElement;if(!c.contains(f)){const v=new CustomEvent(bo,li);c.addEventListener(bo,d),c.dispatchEvent(v),v.defaultPrevented||(ih(ph(di(c)),{select:!0}),document.activeElement===f&&We(c))}return()=>{c.removeEventListener(bo,d),setTimeout(()=>{const v=new CustomEvent(_o,li);c.addEventListener(_o,u),c.dispatchEvent(v),v.defaultPrevented||We(f??document.body,{select:!0}),c.removeEventListener(_o,u),pi.remove(h)},0)}}},[c,d,u,h]);const b=g.useCallback(f=>{if(!r&&!n||h.paused)return;const x=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(x&&v){const _=f.currentTarget,[w,j]=ch(_);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&We(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&We(j,{select:!0})):v===_&&f.preventDefault()}},[r,n,h.paused]);return a.jsx(W.div,{tabIndex:-1,...i,ref:m,onKeyDown:b})});Gr.displayName=sh;function ih(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function ch(e){const t=di(e),r=ui(t,e),n=ui(t.reverse(),e);return[r,n]}function di(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 ui(e,t){for(const r of e)if(!lh(r,{upTo:t}))return r}function lh(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 dh(e){return e instanceof HTMLInputElement&&"select"in e}function We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&dh(e)&&t&&e.select()}}var pi=uh();function uh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=mi(e,t),e.unshift(t)},remove(t){e=mi(e,t),e[0]?.resume()}}}function mi(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function ph(e){return e.filter(t=>t.tagName!=="A")}var se=globalThis?.document?g.useLayoutEffect:()=>{},mh=g[" useId ".trim().toString()]||(()=>{}),fh=0;function Ne(e){const[t,r]=g.useState(mh());return se(()=>{r(n=>n??String(fh++))},[e]),e||(t?`radix-${t}`:"")}const hh=["top","right","bottom","left"],qe=Math.min,fe=Math.max,Kr=Math.round,Yr=Math.floor,Ee=e=>({x:e,y:e}),gh={left:"right",right:"left",bottom:"top",top:"bottom"},xh={start:"end",end:"start"};function vo(e,t,r){return fe(e,qe(t,r))}function ze(e,t){return typeof e=="function"?e(t):e}function Me(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function yo(e){return e==="x"?"y":"x"}function wo(e){return e==="y"?"height":"width"}const bh=new Set(["top","bottom"]);function Te(e){return bh.has(Me(e))?"y":"x"}function jo(e){return yo(Te(e))}function _h(e,t,r){r===void 0&&(r=!1);const n=St(e),o=jo(e),s=wo(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xr(i)),[i,Xr(i)]}function vh(e){const t=Xr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>xh[t])}const fi=["left","right"],hi=["right","left"],yh=["top","bottom"],wh=["bottom","top"];function jh(e,t,r){switch(e){case"top":case"bottom":return r?t?hi:fi:t?fi:hi;case"left":case"right":return t?yh:wh;default:return[]}}function Sh(e,t,r,n){const o=St(e);let s=jh(Me(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(So)))),s}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>gh[t])}function Ch(e){return{top:0,right:0,bottom:0,left:0,...e}}function gi(e){return typeof e!="number"?Ch(e):{top:e,right:e,bottom:e,left:e}}function Jr(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 xi(e,t,r){let{reference:n,floating:o}=e;const s=Te(t),i=jo(t),c=wo(i),l=Me(t),d=s==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[c]/2-o[c]/2;let h;switch(l){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:p};break;case"left":h={x:n.x-o.width,y:p};break;default:h={x:n.x,y:n.y}}switch(St(t)){case"start":h[i]-=m*(r&&d?-1:1);break;case"end":h[i]+=m*(r&&d?-1:1);break}return h}const kh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,c=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=xi(d,n,l),m=n,h={},b=0;for(let f=0;f<c.length;f++){const{name:x,fn:v}=c[f],{x:_,y:w,data:j,reset:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:h,rects:d,platform:i,elements:{reference:e,floating:t}});u=_??u,p=w??p,h={...h,[x]:{...h[x],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=xi(d,m,l)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:h}};async function nr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:h=0}=ze(t,e),b=gi(h),x=c[m?p==="floating"?"reference":"floating":p],v=Jr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:u,strategy:l})),_=p==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),j=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:_,offsetParent:w,strategy:l}):_);return{top:(v.top-C.top+b.top)/j.y,bottom:(C.bottom-v.bottom+b.bottom)/j.y,left:(v.left-C.left+b.left)/j.x,right:(C.right-v.right+b.right)/j.x}}const Nh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:d,padding:u=0}=ze(e,t)||{};if(d==null)return{};const p=gi(u),m={x:r,y:n},h=jo(o),b=wo(h),f=await i.getDimensions(d),x=h==="y",v=x?"top":"left",_=x?"bottom":"right",w=x?"clientHeight":"clientWidth",j=s.reference[b]+s.reference[h]-m[h]-s.floating[b],C=m[h]-s.reference[h],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let k=N?N[w]:0;(!k||!await(i.isElement==null?void 0:i.isElement(N)))&&(k=c.floating[w]||s.floating[b]);const E=j/2-C/2,T=k/2-f[b]/2-1,O=qe(p[v],T),L=qe(p[_],T),A=O,I=k-f[b]-L,z=k/2-f[b]/2+E,$=vo(A,z,I),R=!l.arrow&&St(o)!=null&&z!==$&&s.reference[b]/2-(z<A?O:L)-f[b]/2<0,U=R?z<A?z-A:z-I:0;return{[h]:m[h]+U,data:{[h]:$,centerOffset:z-$-U,...R&&{alignmentOffset:U}},reset:R}}}),Eh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...x}=ze(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=Me(o),_=Te(c),w=Me(c)===c,j=await(l.isRTL==null?void 0:l.isRTL(d.floating)),C=m||(w||!f?[Xr(c)]:vh(c)),N=b!=="none";!m&&N&&C.push(...Sh(c,f,b,j));const k=[c,...C],E=await nr(t,x),T=[];let O=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const z=_h(o,i,j);T.push(E[z[0]],E[z[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(z=>z<=0)){var L,A;const z=(((L=s.flip)==null?void 0:L.index)||0)+1,$=k[z];if($&&(!(p==="alignment"?_!==Te($):!1)||O.every(P=>Te(P.placement)===_?P.overflows[0]>0:!0)))return{data:{index:z,overflows:O},reset:{placement:$}};let R=(A=O.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!R)switch(h){case"bestFit":{var I;const U=(I=O.filter(P=>{if(N){const q=Te(P.placement);return q===_||q==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((P,q)=>P[1]-q[1])[0])==null?void 0:I[0];U&&(R=U);break}case"initialPlacement":R=c;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function bi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _i(e){return hh.some(t=>e[t]>=0)}const Th=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=ze(e,t);switch(n){case"referenceHidden":{const s=await nr(t,{...o,elementContext:"reference"}),i=bi(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:_i(i)}}}case"escaped":{const s=await nr(t,{...o,altBoundary:!0}),i=bi(s,r.floating);return{data:{escapedOffsets:i,escaped:_i(i)}}}default:return{}}}}},vi=new Set(["left","top"]);async function Ah(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Me(r),c=St(r),l=Te(r)==="y",d=vi.has(i)?-1:1,u=s&&l?-1:1,p=ze(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof b=="number"&&(h=c==="end"?b*-1:b),l?{x:h*u,y:m*d}:{x:m*d,y:h*u}}const Ph=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:c}=t,l=await Ah(t,e);return i===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},Oh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:x=>{let{x:v,y:_}=x;return{x:v,y:_}}},...l}=ze(e,t),d={x:r,y:n},u=await nr(t,l),p=Te(Me(o)),m=yo(p);let h=d[m],b=d[p];if(s){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",_=h+u[x],w=h-u[v];h=vo(_,h,w)}if(i){const x=p==="y"?"top":"left",v=p==="y"?"bottom":"right",_=b+u[x],w=b-u[v];b=vo(_,b,w)}const f=c.fn({...t,[m]:h,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:s,[p]:i}}}}}},Rh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:l=!0,crossAxis:d=!0}=ze(e,t),u={x:r,y:n},p=Te(o),m=yo(p);let h=u[m],b=u[p];const f=ze(c,t),x=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const w=m==="y"?"height":"width",j=s.reference[m]-s.floating[w]+x.mainAxis,C=s.reference[m]+s.reference[w]-x.mainAxis;h<j?h=j:h>C&&(h=C)}if(d){var v,_;const w=m==="y"?"width":"height",j=vi.has(Me(o)),C=s.reference[p]-s.floating[w]+(j&&((v=i.offset)==null?void 0:v[p])||0)+(j?0:x.crossAxis),N=s.reference[p]+s.reference[w]+(j?0:((_=i.offset)==null?void 0:_[p])||0)-(j?x.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:h,[p]:b}}}},Lh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:l=()=>{},...d}=ze(e,t),u=await nr(t,d),p=Me(o),m=St(o),h=Te(o)==="y",{width:b,height:f}=s.floating;let x,v;p==="top"||p==="bottom"?(x=p,v=m===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(v=p,x=m==="end"?"top":"bottom");const _=f-u.top-u.bottom,w=b-u.left-u.right,j=qe(f-u[x],_),C=qe(b-u[v],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=_),N&&!m){const O=fe(u.left,0),L=fe(u.right,0),A=fe(u.top,0),I=fe(u.bottom,0);h?E=b-2*(O!==0||L!==0?O+L:fe(u.left,u.right)):k=f-2*(A!==0||I!==0?A+I:fe(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:k});const T=await i.getDimensions(c.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Zr(){return typeof window<"u"}function Ct(e){return yi(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(yi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yi(e){return Zr()?e instanceof Node||e instanceof he(e).Node:!1}function ve(e){return Zr()?e instanceof Element||e instanceof he(e).Element:!1}function Pe(e){return Zr()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function wi(e){return!Zr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}const Ih=new Set(["inline","contents"]);function or(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Ih.has(o)}const zh=new Set(["table","td","th"]);function Mh(e){return zh.has(Ct(e))}const Dh=[":popover-open",":modal"];function Qr(e){return Dh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Fh=["transform","translate","scale","rotate","perspective"],$h=["transform","translate","scale","rotate","perspective","filter"],Bh=["paint","layout","strict","content"];function Co(e){const t=ko(),r=ve(e)?ye(e):e;return Fh.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)||$h.some(n=>(r.willChange||"").includes(n))||Bh.some(n=>(r.contain||"").includes(n))}function Uh(e){let t=Ge(e);for(;Pe(t)&&!kt(t);){if(Co(t))return t;if(Qr(t))return null;t=Ge(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Hh=new Set(["html","body","#document"]);function kt(e){return Hh.has(Ct(e))}function ye(e){return he(e).getComputedStyle(e)}function en(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wi(e)&&e.host||Ae(e);return wi(t)?t.host:t}function ji(e){const t=Ge(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&or(t)?t:ji(t)}function ar(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ji(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=he(o);if(s){const c=No(i);return t.concat(i,i.visualViewport||[],or(o)?o:[],c&&r?ar(c):[])}return t.concat(o,ar(o,[],r))}function No(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Si(e){const t=ye(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Pe(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,c=Kr(r)!==s||Kr(n)!==i;return c&&(r=s,n=i),{width:r,height:n,$:c}}function Eo(e){return ve(e)?e:e.contextElement}function Nt(e){const t=Eo(e);if(!Pe(t))return Ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=Si(t);let i=(s?Kr(r.width):r.width)/n,c=(s?Kr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Vh=Ee(0);function Ci(e){const t=he(e);return!ko()||!t.visualViewport?Vh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==he(e)?!1:t}function it(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Eo(e);let i=Ee(1);t&&(n?ve(n)&&(i=Nt(n)):i=Nt(e));const c=Wh(s,r,n)?Ci(s):Ee(0);let l=(o.left+c.x)/i.x,d=(o.top+c.y)/i.y,u=o.width/i.x,p=o.height/i.y;if(s){const m=he(s),h=n&&ve(n)?he(n):n;let b=m,f=No(b);for(;f&&n&&h!==b;){const x=Nt(f),v=f.getBoundingClientRect(),_=ye(f),w=v.left+(f.clientLeft+parseFloat(_.paddingLeft))*x.x,j=v.top+(f.clientTop+parseFloat(_.paddingTop))*x.y;l*=x.x,d*=x.y,u*=x.x,p*=x.y,l+=w,d+=j,b=he(f),f=No(b)}}return Jr({width:u,height:p,x:l,y:d})}function tn(e,t){const r=en(e).scrollLeft;return t?t.left+r:it(Ae(e)).left+r}function ki(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-tn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function qh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=Ae(n),c=t?Qr(t.floating):!1;if(n===i||c&&s)return r;let l={scrollLeft:0,scrollTop:0},d=Ee(1);const u=Ee(0),p=Pe(n);if((p||!p&&!s)&&((Ct(n)!=="body"||or(i))&&(l=en(n)),Pe(n))){const h=it(n);d=Nt(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const m=i&&!p&&!s?ki(i,l):Ee(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-l.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-l.scrollTop*d.y+u.y+m.y}}function Gh(e){return Array.from(e.getClientRects())}function Kh(e){const t=Ae(e),r=en(e),n=e.ownerDocument.body,o=fe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=fe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+tn(e);const c=-r.scrollTop;return ye(n).direction==="rtl"&&(i+=fe(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:c}}const Ni=25;function Yh(e,t){const r=he(e),n=Ae(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,c=0,l=0;if(o){s=o.width,i=o.height;const u=ko();(!u||u&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const d=tn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-h);b<=Ni&&(s-=b)}else d<=Ni&&(s+=d);return{width:s,height:i,x:c,y:l}}const Xh=new Set(["absolute","fixed"]);function Jh(e,t){const r=it(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=Pe(e)?Nt(e):Ee(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=o*s.x,d=n*s.y;return{width:i,height:c,x:l,y:d}}function Ei(e,t,r){let n;if(t==="viewport")n=Yh(e,r);else if(t==="document")n=Kh(Ae(e));else if(ve(t))n=Jh(t,r);else{const o=Ci(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(n)}function Ti(e,t){const r=Ge(e);return r===t||!ve(r)||kt(r)?!1:ye(r).position==="fixed"||Ti(r,t)}function Zh(e,t){const r=t.get(e);if(r)return r;let n=ar(e,[],!1).filter(c=>ve(c)&&Ct(c)!=="body"),o=null;const s=ye(e).position==="fixed";let i=s?Ge(e):e;for(;ve(i)&&!kt(i);){const c=ye(i),l=Co(i);!l&&c.position==="fixed"&&(o=null),(s?!l&&!o:!l&&c.position==="static"&&!!o&&Xh.has(o.position)||or(i)&&!l&&Ti(e,i))?n=n.filter(u=>u!==i):o=c,i=Ge(i)}return t.set(e,n),n}function Qh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Qr(t)?[]:Zh(t,this._c):[].concat(r),n],c=i[0],l=i.reduce((d,u)=>{const p=Ei(t,u,o);return d.top=fe(p.top,d.top),d.right=qe(p.right,d.right),d.bottom=qe(p.bottom,d.bottom),d.left=fe(p.left,d.left),d},Ei(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function eg(e){const{width:t,height:r}=Si(e);return{width:t,height:r}}function tg(e,t,r){const n=Pe(t),o=Ae(t),s=r==="fixed",i=it(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=Ee(0);function d(){l.x=tn(o)}if(n||!n&&!s)if((Ct(t)!=="body"||or(o))&&(c=en(t)),n){const h=it(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&d();s&&!n&&o&&d();const u=o&&!n&&!s?ki(o,c):Ee(0),p=i.left+c.scrollLeft-l.x-u.x,m=i.top+c.scrollTop-l.y-u.y;return{x:p,y:m,width:i.width,height:i.height}}function To(e){return ye(e).position==="static"}function Ai(e,t){if(!Pe(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Pi(e,t){const r=he(e);if(Qr(e))return r;if(!Pe(e)){let o=Ge(e);for(;o&&!kt(o);){if(ve(o)&&!To(o))return o;o=Ge(o)}return r}let n=Ai(e,t);for(;n&&Mh(n)&&To(n);)n=Ai(n,t);return n&&kt(n)&&To(n)&&!Co(n)?r:n||Uh(e)||r}const rg=async function(e){const t=this.getOffsetParent||Pi,r=this.getDimensions,n=await r(e.floating);return{reference:tg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ng(e){return ye(e).direction==="rtl"}const og={convertOffsetParentRelativeRectToViewportRelativeRect:qh,getDocumentElement:Ae,getClippingRect:Qh,getOffsetParent:Pi,getElementRects:rg,getClientRects:Gh,getDimensions:eg,getScale:Nt,isElement:ve,isRTL:ng};function Oi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ag(e,t){let r=null,n;const o=Ae(e);function s(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:h}=d;if(c||t(),!m||!h)return;const b=Yr(p),f=Yr(o.clientWidth-(u+m)),x=Yr(o.clientHeight-(p+h)),v=Yr(u),w={rootMargin:-b+"px "+-f+"px "+-x+"px "+-v+"px",threshold:fe(0,qe(1,l))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==l){if(!j)return i();k?i(!1,k):n=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Oi(d,e.getBoundingClientRect())&&i(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return i(!0),s}function sg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,d=Eo(e),u=o||s?[...d?ar(d):[],...ar(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const p=d&&c?ag(d,r):null;let m=-1,h=null;i&&(h=new ResizeObserver(v=>{let[_]=v;_&&_.target===d&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),r()}),d&&!l&&h.observe(d),h.observe(t));let b,f=l?it(e):null;l&&x();function x(){const v=it(e);f&&!Oi(f,v)&&r(),f=v,b=requestAnimationFrame(x)}return r(),()=>{var v;u.forEach(_=>{o&&_.removeEventListener("scroll",r),s&&_.removeEventListener("resize",r)}),p?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(b)}}const ig=Ph,cg=Oh,lg=Eh,dg=Lh,ug=Th,Ri=Nh,pg=Rh,mg=(e,t,r)=>{const n=new Map,o={platform:og,...r},s={...o.platform,_c:n};return kh(e,t,{...o,platform:s})};var fg=typeof document<"u",hg=function(){},rn=fg?y.useLayoutEffect:hg;function nn(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(!nn(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 s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!nn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Li(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ii(e,t){const r=Li(e);return Math.round(t*r)/r}function Ao(e){const t=g.useRef(e);return rn(()=>{t.current=e}),t}function gg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:d}=e,[u,p]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=g.useState(n);nn(m,n)||h(n);const[b,f]=g.useState(null),[x,v]=g.useState(null),_=g.useCallback(P=>{P!==N.current&&(N.current=P,f(P))},[]),w=g.useCallback(P=>{P!==k.current&&(k.current=P,v(P))},[]),j=s||b,C=i||x,N=g.useRef(null),k=g.useRef(null),E=g.useRef(u),T=l!=null,O=Ao(l),L=Ao(o),A=Ao(d),I=g.useCallback(()=>{if(!N.current||!k.current)return;const P={placement:t,strategy:r,middleware:m};L.current&&(P.platform=L.current),mg(N.current,k.current,P).then(q=>{const X={...q,isPositioned:A.current!==!1};z.current&&!nn(E.current,X)&&(E.current=X,_r.flushSync(()=>{p(X)}))})},[m,t,r,L,A]);rn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[d]);const z=g.useRef(!1);rn(()=>(z.current=!0,()=>{z.current=!1}),[]),rn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(O.current)return O.current(j,C,I);I()}},[j,C,I,O,T]);const $=g.useMemo(()=>({reference:N,floating:k,setReference:_,setFloating:w}),[_,w]),R=g.useMemo(()=>({reference:j,floating:C}),[j,C]),U=g.useMemo(()=>{const P={position:r,left:0,top:0};if(!R.floating)return P;const q=Ii(R.floating,u.x),X=Ii(R.floating,u.y);return c?{...P,transform:"translate("+q+"px, "+X+"px)",...Li(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:X}},[r,c,R.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:I,refs:$,elements:R,floatingStyles:U}),[u,I,$,R,U])}const xg=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?Ri({element:n.current,padding:o}).fn(r):{}:n?Ri({element:n,padding:o}).fn(r):{}}}},bg=(e,t)=>({...ig(e),options:[e,t]}),_g=(e,t)=>({...cg(e),options:[e,t]}),vg=(e,t)=>({...pg(e),options:[e,t]}),yg=(e,t)=>({...lg(e),options:[e,t]}),wg=(e,t)=>({...dg(e),options:[e,t]}),jg=(e,t)=>({...ug(e),options:[e,t]}),Sg=(e,t)=>({...xg(e),options:[e,t]});var Cg="Arrow",zi=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return a.jsx(W.svg,{...s,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"})})});zi.displayName=Cg;var kg=zi;function Ng(e){const[t,r]=g.useState(void 0);return se(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,d=Array.isArray(l)?l[0]:l;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;r({width:i,height:c})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Po="Popper",[Mi,on]=He(Po),[Eg,Di]=Mi(Po),Fi=e=>{const{__scopePopper:t,children:r}=e,[n,o]=g.useState(null);return a.jsx(Eg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Fi.displayName=Po;var $i="PopperAnchor",Bi=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Di($i,r),i=g.useRef(null),c=Y(t,i),l=g.useRef(null);return g.useEffect(()=>{const d=l.current;l.current=n?.current||i.current,d!==l.current&&s.onAnchorChange(l.current)}),n?null:a.jsx(W.div,{...o,ref:c})});Bi.displayName=$i;var Oo="PopperContent",[Tg,Ag]=Mi(Oo),Ui=g.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:b,...f}=e,x=Di(Oo,r),[v,_]=g.useState(null),w=Y(t,F=>_(F)),[j,C]=g.useState(null),N=Ng(j),k=N?.width??0,E=N?.height??0,T=n+(s!=="center"?"-"+s:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(d)?d:[d],A=L.length>0,I={padding:O,boundary:L.filter(Og),altBoundary:A},{refs:z,floatingStyles:$,placement:R,isPositioned:U,middlewareData:P}=gg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>sg(...F,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[bg({mainAxis:o+E,alignmentAxis:i}),l&&_g({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?vg():void 0,...I}),l&&yg({...I}),wg({...I,apply:({elements:F,rects:te,availableWidth:ce,availableHeight:J})=>{const{width:Q,height:ne}=te.reference,xe=F.floating.style;xe.setProperty("--radix-popper-available-width",`${ce}px`),xe.setProperty("--radix-popper-available-height",`${J}px`),xe.setProperty("--radix-popper-anchor-width",`${Q}px`),xe.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),j&&Sg({element:j,padding:c}),Rg({arrowWidth:k,arrowHeight:E}),m&&jg({strategy:"referenceHidden",...I})]}),[q,X]=Wi(R),Z=Ve(b);se(()=>{U&&Z?.()},[U,Z]);const me=P.arrow?.x,Fe=P.arrow?.y,ge=P.arrow?.centerOffset!==0,[$e,pt]=g.useState();return se(()=>{v&&pt(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Tg,{scope:r,placedSide:q,onArrowChange:C,arrowX:me,arrowY:Fe,shouldHideArrow:ge,children:a.jsx(W.div,{"data-side":q,"data-align":X,...f,ref:w,style:{...f.style,animation:U?void 0:"none"}})})})});Ui.displayName=Oo;var Hi="PopperArrow",Pg={top:"bottom",right:"left",bottom:"top",left:"right"},Vi=g.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Ag(Hi,n),i=Pg[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(kg,{...o,ref:r,style:{...o.style,display:"block"}})})});Vi.displayName=Hi;function Og(e){return e!==null}var Rg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[d,u]=Wi(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+c/2,h=(o.arrow?.y??0)+l/2;let b="",f="";return d==="bottom"?(b=i?p:`${m}px`,f=`${-l}px`):d==="top"?(b=i?p:`${m}px`,f=`${n.floating.height+l}px`):d==="right"?(b=`${-l}px`,f=i?p:`${h}px`):d==="left"&&(b=`${n.floating.width+l}px`,f=i?p:`${h}px`),{data:{x:b,y:f}}}});function Wi(e){const[t,r="center"]=e.split("-");return[t,r]}var qi=Fi,Ro=Bi,Gi=Ui,Ki=Vi,Lg="Portal",an=g.forwardRef((e,t)=>{const{container:r,...n}=e,[o,s]=g.useState(!1);se(()=>s(!0),[]);const i=r||o&&globalThis?.document?.body;return i?ba.createPortal(a.jsx(W.div,{...n,ref:t}),i):null});an.displayName=Lg;function Ig(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Ke=e=>{const{present:t,children:r}=e,n=zg(t),o=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),s=Y(n.ref,Mg(o));return typeof r=="function"||n.isPresent?g.cloneElement(o,{ref:s}):null};Ke.displayName="Presence";function zg(e){const[t,r]=g.useState(),n=g.useRef(null),o=g.useRef(e),s=g.useRef("none"),i=e?"mounted":"unmounted",[c,l]=Ig(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const d=sn(n.current);s.current=c==="mounted"?d:"none"},[c]),se(()=>{const d=n.current,u=o.current;if(u!==e){const m=s.current,h=sn(d);e?l("MOUNT"):h==="none"||d?.display==="none"?l("UNMOUNT"):l(u&&m!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),se(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=h=>{const f=sn(n.current).includes(CSS.escape(h.animationName));if(h.target===t&&f&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=h=>{h.target===t&&(s.current=sn(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 l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function sn(e){return e?.animationName||"none"}function Mg(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 Dg=g[" useInsertionEffect ".trim().toString()]||se;function ct({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=Fg({defaultProp:t,onChange:r}),c=e!==void 0,l=c?e:o;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const p=u.current;p!==c&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${c?"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=c},[c,n])}const d=g.useCallback(u=>{if(c){const p=$g(u)?u(e):u;p!==e&&i.current?.(p)}else s(u)},[c,e,s,i]);return[l,d]}function Fg({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),o=g.useRef(r),s=g.useRef(t);return Dg(()=>{s.current=t},[t]),g.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,n,s]}function $g(e){return typeof e=="function"}var Bg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Et=new WeakMap,cn=new WeakMap,ln={},Lo=0,Yi=function(e){return e&&(e.host||Yi(e.parentNode))},Ug=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Yi(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})},Hg=function(e,t,r,n){var o=Ug(t,Array.isArray(e)?e:[e]);ln[r]||(ln[r]=new WeakMap);var s=ln[r],i=[],c=new Set,l=new Set(o),d=function(p){!p||c.has(p)||(c.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(m){if(c.has(m))u(m);else try{var h=m.getAttribute(n),b=h!==null&&h!=="false",f=(Et.get(m)||0)+1,x=(s.get(m)||0)+1;Et.set(m,f),s.set(m,x),i.push(m),f===1&&b&&cn.set(m,!0),x===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return u(t),c.clear(),Lo++,function(){i.forEach(function(p){var m=Et.get(p)-1,h=s.get(p)-1;Et.set(p,m),s.set(p,h),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),h||p.removeAttribute(r)}),Lo--,Lo||(Et=new WeakMap,Et=new WeakMap,cn=new WeakMap,ln={})}},Io=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Bg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Hg(n,o,r,"aria-hidden")):function(){return null}},Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Oe.apply(this,arguments)};function Xi(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 Vg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var dn="right-scroll-bar-position",un="width-before-scroll-bar",Wg="with-scroll-bars-hidden",qg="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Gg(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 Kg=typeof window<"u"?g.useLayoutEffect:g.useEffect,Ji=new WeakMap;function Yg(e,t){var r=Gg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return Kg(function(){var n=Ji.get(r);if(n){var o=new Set(n),s=new Set(e),i=r.current;o.forEach(function(c){s.has(c)||zo(c,null)}),s.forEach(function(c){o.has(c)||zo(c,i)})}Ji.set(r,e)},[e]),r}function Xg(e){return e}function Jg(e,t){t===void 0&&(t=Xg);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(s){var i=t(s,n);return r.push(i),function(){r=r.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(n=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(c){return s(c)},filter:function(){return r}}},assignMedium:function(s){n=!0;var i=[];if(r.length){var c=r;r=[],c.forEach(s),i=r}var l=function(){var u=i;i=[],u.forEach(s)},d=function(){return Promise.resolve().then(l)};d(),r={push:function(u){i.push(u),d()},filter:function(u){return i=i.filter(u),r}}}};return o}function Zg(e){e===void 0&&(e={});var t=Jg(null);return t.options=Oe({async:!0,ssr:!1},e),t}var Zi=function(e){var t=e.sideCar,r=Xi(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 g.createElement(n,Oe({},r))};Zi.isSideCarExport=!0;function Qg(e,t){return e.useMedium(t),Zi}var Qi=Zg(),Mo=function(){},pn=g.forwardRef(function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:Mo,onWheelCapture:Mo,onTouchMoveCapture:Mo}),o=n[0],s=n[1],i=e.forwardProps,c=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,b=e.noIsolation,f=e.inert,x=e.allowPinchZoom,v=e.as,_=v===void 0?"div":v,w=e.gapMode,j=Xi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=Yg([r,t]),k=Oe(Oe({},j),o);return g.createElement(g.Fragment,null,u&&g.createElement(C,{sideCar:Qi,removeScrollBar:d,shards:p,noRelative:h,noIsolation:b,inert:f,setCallbacks:s,allowPinchZoom:!!x,lockRef:r,gapMode:w}),i?g.cloneElement(g.Children.only(c),Oe(Oe({},k),{ref:N})):g.createElement(_,Oe({},k,{className:l,ref:N}),c))});pn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pn.classNames={fullWidth:un,zeroRight:dn};var ex=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ex();return t&&e.setAttribute("nonce",t),e}function rx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ox=function(){var e=0,t=null;return{add:function(r){e==0&&(t=tx())&&(rx(t,r),nx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ax=function(){var e=ox();return function(t,r){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ec=function(){var e=ax(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},sx={left:0,top:0,right:0,gap:0},Do=function(e){return parseInt(e||"",10)||0},ix=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[Do(r),Do(n),Do(o)]},cx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sx;var t=ix(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])}},lx=ec(),Tt="data-scroll-locked",dx=function(e,t,r,n){var o=e.left,s=e.top,i=e.right,c=e.gap;return r===void 0&&(r="margin"),` 309 .`.concat(Wg,` { 213 `,Nr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:i,containerClassName:l})=>{let{toasts:d,handlers:c}=xu(r,s);return x.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Nr,left:Nr,right:Nr,bottom:Nr,pointerEvents:"none",...i},className:l,onMouseEnter:c.startPause,onMouseLeave:c.endPause},d.map(u=>{let p=u.position||t,m=c.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?Sr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},G=oe;const Ja={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,gapOnMobile:16,shape:"rectangle",size:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ja.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={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"}],Za=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],Ku=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Qa={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},es=y.createContext&&y.createContext(Qa),Yu=["attr","size","title"];function Xu(e,t){if(e==null)return{};var r=Ju(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ju(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 Er(){return Er=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},Er.apply(this,arguments)}function ts(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?ts(Object(r),!0).forEach(function(n){Zu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ts(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zu(e,t,r){return t=Qu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qu(e){var t=ep(e,"string");return typeof t=="symbol"?t:t+""}function ep(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 rs(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),rs(t.child)))}function H(e){return t=>y.createElement(tp,Er({attr:Pr({},e.attr)},t),rs(e.child))}function tp(e){var t=r=>{var{attr:n,size:o,title:s}=e,i=Xu(e,Yu),l=o||r.size||"1em",d;return r.className&&(d=r.className),e.className&&(d=(d?d+" ":"")+e.className),y.createElement("svg",Er({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:d,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&y.createElement("title",null,s),e.children)};return es!==void 0?y.createElement(es.Consumer,null,r=>t(r)):t(Qa)}function rp(e){return H({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 Jt(e){return H({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 gt(e){return H({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 Zt(e){return H({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 Qt(e){return H({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 np(e){return H({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 op(e){return H({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 tt(e){return H({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 ap(e){return H({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 ns(e){return H({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 sp(e){return H({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 er(e){return H({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 Vn(e){return H({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 ip(e){return H({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 lp(e){return H({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 cp(e){return H({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 dp(e){return H({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 os(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wn(...e){return t=>{let r=!1;const n=e.map(o=>{const s=os(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():os(e[o],null)}}}}function Y(...e){return x.useCallback(Wn(...e),e)}function rt(e){const t=pp(e),r=x.forwardRef((n,o)=>{const{children:s,...i}=n,l=x.Children.toArray(s),d=l.find(fp);if(d){const c=d.props.children,u=l.map(p=>p===d?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:p);return a.jsx(t,{...i,ref:o,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var up=rt("Slot");function pp(e){const t=x.forwardRef((r,n)=>{const{children:o,...s}=r;if(x.isValidElement(o)){const i=gp(o),l=hp(s,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,i):i),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mp=Symbol("radix.slottable");function fp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mp}function hp(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...l)=>{const d=s(...l);return o(...l),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function gp(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 as(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=as(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function xp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=as(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return xp(e)}const bp="ecr-button",_p={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"},vp={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 re({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const s=n?up:"button";return a.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:F(bp,_p[t],vp[r],e),...o})}function yp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:s,handleCreateGroup:i,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(re,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(re,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(re,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Vn,{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:d=>o(d.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(re,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(er,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ns,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(re,{disabled:s,onClick:i,className:"ecr-admin-reels-header__create",children:[s?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(gt,{})," ","Create Widget"]}):null]})]})}function jp(e){return H({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 Sp(e){return H({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 nt(e){return H({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 Cp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function kp({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const ss=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,s)=>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",s===r?.index?"ecr-player__progress-fill--active":s<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},s))}),xt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Gn(e){return H({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 Kn(e){return H({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 Yn(e){return H({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 Np="Left",Ep="Right",Pp="Up",Tp="Down",bt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},is="mousemove",ls="mouseup",Ap="touchend",Op="touchmove",Rp="touchstart";function Lp(e,t,r,n){return e>t?r>0?Ep:Np:n>0?Tp:Pp}function cs(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 Ip(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(is,n),document.addEventListener(ls,i));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=cs([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Xn),{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]=cs([b,f],m.rotationAngle),_=h-p.xy[0],w=v-p.xy[1],j=Math.abs(_),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[_/(N||1),w/(N||1)],P=Lp(j,C,_,w),T=typeof m.delta=="number"?m.delta:m.delta[P.toLowerCase()]||bt.delta;if(j<T&&C<T&&!p.swiping)return p;const R={absX:j,absY:C,deltaX:_,deltaY:w,dir:P,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};R.first&&m.onSwipeStart&&m.onSwipeStart(R),m.onSwiping&&m.onSwiping(R);let L=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${P}`])&&(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),Xn),{eventData:g})})},s=()=>{document.removeEventListener(is,n),document.removeEventListener(ls,i)},i=u=>{s(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},bt.touchEventOptions),p.touchEventOptions),b=[[Rp,r,g],[Op,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Ap,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},c={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&&(c.onMouseDown=r),[c,l]}function zp(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 Mp(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Xn)),n=x.useRef(Object.assign({},bt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},bt),e);let s;for(s in bt)n.current[s]===void 0&&(n.current[s]=bt[s]);const[i,l]=x.useMemo(()=>Ip(d=>r.current=d(r.current,n.current),{trackMouse:t}),[t]);return r.current=zp(r.current,n.current,o.current,l),i}const Dp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:s,handleNextFile:i,setDuration:l})=>{const[d,c]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,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:d?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>s(o),onEnded:i,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;c(g>m),l(p.duration)}})})},ds=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:s,setIsPaused:i,handlePrevFile:l,handleNextFile:d})=>{const[c,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const v=p.current[h];v&&(s?v.play():v.pause(),i(_=>!_))},g=h=>{const v=p.current[h];v&&(v.muted=!c,u(_=>!_))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Mp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:d,onSwipedUp:()=>{b&&d()},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(Dp,{videoRefs:p,file:h,isMuted:c,i:v,togglePlayPause:m,handleNextFile:d,setDuration:r,isPaused:s},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[s?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}),c?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)})]})]})},v))})},Fp=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,s]=y.useState(!1),[i,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const d=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},c=()=>{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(xt,{onClick:d,className:"ecr-player__nav--left",children:a.jsx(Zt,{size:24})}):null,r.index<u-1?a.jsx(xt,{onClick:c,className:"ecr-player__nav--right",children:a.jsx(Qt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ss,{playingStory:e,duration:i,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(er,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(ds,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:s,handlePrevFile:d,handleNextFile:c,storyId:e.id,storyTitle:e?.title})]})]})})};function $p(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Bp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Tr(e){return H({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 Hp(e){return H({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 us(e){return H({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 Vp(e){return H({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 Wp(e){return H({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 qp(e){return H({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 Gp(e){return H({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 Kp=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`},Yp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(i=>({...i,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),s=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,poster:s}):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%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Kp(r?.[e.id]??e.view_count)}),a.jsx(op,{size:14})]})]})},Jn=y.memo(Yp);function Xp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:i}){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(Jn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",i?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(re,{onClick:()=>s(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(dp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(re,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(ht,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Tr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(re,{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(Vn,{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",i?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(re,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Vp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function Jp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:s,lastStoryElementRef:i}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,d)=>a.jsx("div",{ref:e.length===d+1?i:null,children:a.jsx(Xp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:r.length>0})},l.id))})}const tr=({cb:e})=>{const t=Se(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(jp,{size:24})})};function Zp(e){return H({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 rr=({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(ht,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:s=>{if(!t)return;const i=r.href;i&&(s.preventDefault(),t(i))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Zp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Ar=({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:s=>{s.currentTarget.contains(s.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(sp,{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(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Or=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:s})=>a.jsxs(ht,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:i=>{s&&(i.preventDefault(),s(e))},children:[t&&a.jsx(t,{}),n]}),Rr=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),_t=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),vt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Qp(e){return H({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 Lr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Qp,{}),"ReelsWP"]});function ps(e,t){return function(){return e.apply(t,arguments)}}const{toString:em}=Object.prototype,{getPrototypeOf:Zn}=Object,{iterator:Ir,toStringTag:ms}=Symbol,zr=(e=>t=>{const r=em.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),_e=e=>(e=e.toLowerCase(),t=>zr(t)===e),Mr=e=>t=>typeof t===e,{isArray:yt}=Array,wt=Mr("undefined");function nr(e){return e!==null&&!wt(e)&&e.constructor!==null&&!wt(e.constructor)&&de(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fs=_e("ArrayBuffer");function tm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fs(e.buffer),t}const rm=Mr("string"),de=Mr("function"),hs=Mr("number"),or=e=>e!==null&&typeof e=="object",nm=e=>e===!0||e===!1,Dr=e=>{if(zr(e)!=="object")return!1;const t=Zn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ms in e)&&!(Ir in e)},om=e=>{if(!or(e)||nr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},am=_e("Date"),sm=_e("File"),im=_e("Blob"),lm=_e("FileList"),cm=e=>or(e)&&de(e.pipe),dm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||de(e.append)&&((t=zr(e))==="formdata"||t==="object"&&de(e.toString)&&e.toString()==="[object FormData]"))},um=_e("URLSearchParams"),[pm,mm,fm,hm]=["ReadableStream","Request","Response","Headers"].map(_e),gm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ar(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(nr(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let l;for(n=0;n<i;n++)l=s[n],t.call(null,e[l],l,e)}}function gs(e,t){if(nr(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 ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xs=e=>!wt(e)&&e!==ot;function Qn(){const{caseless:e,skipUndefined:t}=xs(this)&&this||{},r={},n=(o,s)=>{const i=e&&gs(r,s)||s;Dr(r[i])&&Dr(o)?r[i]=Qn(r[i],o):Dr(o)?r[i]=Qn({},o):yt(o)?r[i]=o.slice():(!t||!wt(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&ar(arguments[o],n);return r}const xm=(e,t,r,{allOwnKeys:n}={})=>(ar(t,(o,s)=>{r&&de(o)?e[s]=ps(o,r):e[s]=o},{allOwnKeys:n}),e),bm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),_m=(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)},vm=(e,t,r,n)=>{let o,s,i;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=r!==!1&&Zn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ym=(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},wm=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!hs(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},jm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zn(Uint8Array)),Sm=(e,t)=>{const n=(e&&e[Ir]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Cm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},km=_e("HTMLFormElement"),Nm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),bs=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Em=_e("RegExp"),_s=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ar(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},Pm=e=>{_s(e,(t,r)=>{if(de(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(de(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+"'")})}})},Tm=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return yt(e)?n(e):n(String(e).split(t)),r},Am=()=>{},Om=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Rm(e){return!!(e&&de(e.append)&&e[ms]==="FormData"&&e[Ir])}const Lm=e=>{const t=new Array(10),r=(n,o)=>{if(or(n)){if(t.indexOf(n)>=0)return;if(nr(n))return n;if(!("toJSON"in n)){t[o]=n;const s=yt(n)?[]:{};return ar(n,(i,l)=>{const d=r(i,o+1);!wt(d)&&(s[l]=d)}),t[o]=void 0,s}}return n};return r(e,0)},Im=_e("AsyncFunction"),zm=e=>e&&(or(e)||de(e))&&de(e.then)&&de(e.catch),vs=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:s})=>{o===ot&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",de(ot.postMessage)),Mm=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||vs,S={isArray:yt,isArrayBuffer:fs,isBuffer:nr,isFormData:dm,isArrayBufferView:tm,isString:rm,isNumber:hs,isBoolean:nm,isObject:or,isPlainObject:Dr,isEmptyObject:om,isReadableStream:pm,isRequest:mm,isResponse:fm,isHeaders:hm,isUndefined:wt,isDate:am,isFile:sm,isBlob:im,isRegExp:Em,isFunction:de,isStream:cm,isURLSearchParams:um,isTypedArray:jm,isFileList:lm,forEach:ar,merge:Qn,extend:xm,trim:gm,stripBOM:bm,inherits:_m,toFlatObject:vm,kindOf:zr,kindOfTest:_e,endsWith:ym,toArray:wm,forEachEntry:Sm,matchAll:Cm,isHTMLForm:km,hasOwnProperty:bs,hasOwnProp:bs,reduceDescriptors:_s,freezeMethods:Pm,toObjectSet:Tm,toCamelCase:Nm,noop:Am,toFiniteNumber:Om,findKey:gs,global:ot,isContextDefined:xs,isSpecCompliantForm:Rm,toJSONObject:Lm,isAsyncFn:Im,isThenable:zm,setImmediate:vs,asap:Mm,isIterable:e=>e!=null&&de(e[Ir])};function U(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(U,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 ys=U.prototype,ws={};["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=>{ws[e]={value:e}}),Object.defineProperties(U,ws),Object.defineProperty(ys,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,s)=>{const i=Object.create(ys);S.toFlatObject(e,i,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const l=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return U.call(i,l,d,r,n,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const Dm=null;function eo(e){return S.isPlainObject(e)||S.isArray(e)}function js(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function Ss(e,t,r){return e?e.concat(t).map(function(o,s){return o=js(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function Fm(e){return S.isArray(e)&&!e.some(eo)}const $m=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Fr(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,s=r.dots,i=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!d&&S.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?d&&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)&&Fm(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(v=S.toArray(b)))return f=js(f),v.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(i===!0?Ss([f],j,s):i===null?f:f+"[]",c(w))}),!1}return eo(b)?!0:(t.append(Ss(h,f,s),c(b)),!1)}const p=[],m=Object.assign($m,{defaultVisitor:u,convertValue:c,isVisitable:eo});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 Cs(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function to(e,t){this._pairs=[],e&&Fr(e,this,t)}const ks=to.prototype;ks.append=function(t,r){this._pairs.push([t,r])},ks.toString=function(t){const r=t?function(n){return t.call(this,n,Cs)}:Cs;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Bm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ns(e,t,r){if(!t)return e;const n=r&&r.encode||Bm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(o?s=o(t,r):s=S.isURLSearchParams(t)?t.toString():new to(t,r).toString(n),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Es{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 Ps={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Um={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:to,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ro=typeof window<"u"&&typeof document<"u",no=typeof navigator=="object"&&navigator||void 0,Hm=ro&&(!no||["ReactNative","NativeScript","NS"].indexOf(no.product)<0),Vm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wm=ro&&window.location.href||"http://localhost",ie={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ro,hasStandardBrowserEnv:Hm,hasStandardBrowserWebWorkerEnv:Vm,navigator:no,origin:Wm},Symbol.toStringTag,{value:"Module"})),...Um};function qm(e,t){return Fr(e,new ie.classes.URLSearchParams,{visitor:function(r,n,o,s){return ie.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Gm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Km(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function Ts(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),d=s>=r.length;return i=!i&&S.isArray(o)?o.length:i,d?(S.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!l):((!o[i]||!S.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&S.isArray(o[i])&&(o[i]=Km(o[i])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Gm(n),o,r,0)}),r}return null}function Ym(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:Ps,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=S.isObject(t);if(s&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Ts(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(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return qm(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Fr(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),Ym(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 i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?U.from(l,U.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:ie.classes.FormData,Blob:ie.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 Xm=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"]),Jm=e=>{const t={};let r,n,o;return e&&e.split(` 214 `).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&Xm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},As=Symbol("internals");function ir(e){return e&&String(e).trim().toLowerCase()}function $r(e){return e===!1||e==null?e:S.isArray(e)?e.map($r):String(e)}function Zm(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 Qm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oo(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 ef(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function tf(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,s,i){return this[n].call(this,t,o,s,i)},configurable:!0})})}let ue=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(l,d,c){const u=ir(d);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||c===!0||c===void 0&&o[p]!==!1)&&(o[p||d]=$r(l))}const i=(l,d)=>S.forEach(l,(c,u)=>s(c,u,d));if(S.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(S.isString(t)&&(t=t.trim())&&!Qm(t))i(Jm(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},d,c;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[c=u[0]]=(d=l[c])?S.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}i(l,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=ir(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Zm(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=ir(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||oo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(i){if(i=ir(i),i){const l=S.findKey(n,i);l&&(!r||oo(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||oo(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,s)=>{const i=S.findKey(n,s);if(i){r[i]=$r(o),delete r[s];return}const l=t?ef(s):String(s).trim();l!==s&&delete r[s],r[l]=$r(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[As]=this[As]={accessors:{}}).accessors,o=this.prototype;function s(i){const l=ir(i);n[l]||(tf(o,i),n[l]=!0)}return S.isArray(t)?t.forEach(s):s(t),this}};ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(ue.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(ue);function ao(e,t){const r=this||sr,n=t||r,o=ue.from(n.headers);let s=n.data;return S.forEach(e,function(l){s=l.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Os(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(jt,U,{__CANCEL__:!0});function Rs(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function rf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function nf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),u=n[s];i||(i=c),r[o]=d,n[o]=c;let p=s,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const g=u&&c-u;return g?Math.round(m*1e3/g):void 0}}function of(e,t){let r=0,n=1e3/t,o,s;const i=(c,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...c)};return[(...c)=>{const u=Date.now(),p=u-r;p>=n?i(c,u):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},n-p)))},()=>o&&i(o)]}const Br=(e,t,r=3)=>{let n=0;const o=nf(50,250);return of(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,d=i-n,c=o(d),u=i<=l;n=i;const p={loaded:i,total:l,progress:l?i/l:void 0,bytes:d,rate:c||void 0,estimated:c&&l&&u?(l-i)/c:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Ls=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Is=e=>(...t)=>S.asap(()=>e(...t)),af=ie.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ie.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ie.origin),ie.navigator&&/(msie|trident)/i.test(ie.navigator.userAgent)):()=>!0,sf=ie.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){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}`),s===!0&&l.push("secure"),S.isString(i)&&l.push(`SameSite=${i}`),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 lf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function cf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function zs(e,t,r){let n=!lf(t);return e&&(n||r==!1)?cf(e,t):t}const Ms=e=>e instanceof ue?{...e}:e;function at(e,t){t=t||{};const r={};function n(c,u,p,m){return S.isPlainObject(c)&&S.isPlainObject(u)?S.merge.call({caseless:m},c,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(c,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(c))return n(void 0,c,p,m)}else return n(c,u,p,m)}function s(c,u){if(!S.isUndefined(u))return n(void 0,u)}function i(c,u){if(S.isUndefined(u)){if(!S.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function l(c,u,p){if(p in t)return n(c,u);if(p in e)return n(void 0,c)}const d={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(c,u,p)=>o(Ms(c),Ms(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=d[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Ds=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:l}=t;if(t.headers=i=ue.from(i),t.url=Ns(zs(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ie.hasStandardBrowserEnv||ie.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const d=r.getHeaders(),c=["content-type","content-length"];Object.entries(d).forEach(([u,p])=>{c.includes(u.toLowerCase())&&i.set(u,p)})}}if(ie.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&af(t.url))){const d=o&&s&&sf.read(s);d&&i.set(o,d)}return t},df=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Ds(e);let s=o.data;const i=ue.from(o.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:c}=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=ue.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Rs(function(k){r(k),f()},function(k){n(k),f()},C),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 U("Request aborted",U.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new U(C,U.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 C=o.transitional||Ps;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},s===void 0&&i.setContentType(null),"setRequestHeader"in h&&S.forEach(i.toJSON(),function(j,C){h.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),c&&([m,b]=Br(c,!0),h.addEventListener("progress",m)),d&&h.upload&&([p,g]=Br(d),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new jt(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 _=rf(o.url);if(_&&ie.protocols.indexOf(_)===-1){n(new U("Unsupported protocol "+_+":",U.ERR_BAD_REQUEST,e));return}h.send(s||null)})},uf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const s=function(c){if(!o){o=!0,l();const u=c instanceof Error?c:this.reason;n.abort(u instanceof U?u:new jt(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:d}=n;return d.unsubscribe=()=>S.asap(l),d}},pf=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},mf=async function*(e,t){for await(const r of ff(e))yield*pf(r,t)},ff=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()}},Fs=(e,t,r,n)=>{const o=mf(e,t);let s=0,i,l=d=>{i||(i=!0,n&&n(d))};return new ReadableStream({async pull(d){try{const{done:c,value:u}=await o.next();if(c){l(),d.close();return}let p=u.byteLength;if(r){let m=s+=p;r(m)}d.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(d){return l(d),o.return()}},{highWaterMark:2})},$s=64*1024,{isFunction:Ur}=S,hf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Bs,TextEncoder:Us}=S.global,Hs=(e,...t)=>{try{return!!e(...t)}catch{return!1}},gf=e=>{e=S.merge.call({skipUndefined:!0},hf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Ur(t):typeof fetch=="function",s=Ur(r),i=Ur(n);if(!o)return!1;const l=o&&Ur(Bs),d=o&&(typeof Us=="function"?(b=>f=>b.encode(f))(new Us):async b=>new Uint8Array(await new r(b).arrayBuffer())),c=s&&l&&Hs(()=>{let b=!1;const f=new r(ie.origin,{body:new Bs,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=i&&l&&Hs(()=>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 U(`Response type '${b}' is not supported`,U.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(ie.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 d(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:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:P="same-origin",fetchOptions:T}=Ds(b),R=t||fetch;k=k?(k+"").toLowerCase():"text";let L=uf([_,w&&w.toAbortSignal()],j),I=null;const O=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let D;try{if(N&&c&&h!=="get"&&h!=="head"&&(D=await g(E,v))!==0){let Z=new r(f,{method:"POST",body:v,duplex:"half"}),me;if(S.isFormData(v)&&(me=Z.headers.get("content-type"))&&E.setContentType(me),Z.body){const[Fe,ge]=Ls(D,Br(Is(N)));v=Fs(Z.body,$s,Fe,ge)}}S.isString(P)||(P=P?"include":"omit");const z=s&&"credentials"in r.prototype,B={...T,signal:L,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:z?P:void 0};I=s&&new r(f,B);let A=await(s?R(I,T):R(f,B));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&O)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=A[$e]});const me=S.toFiniteNumber(A.headers.get("content-length")),[Fe,ge]=C&&Ls(me,Br(Is(C),!0))||[];A=new n(Fs(A.body,$s,Fe,()=>{ge&&ge(),O&&O()}),Z)}k=k||"text";let X=await p[S.findKey(p,k)||"text"](A,b);return!q&&O&&O(),await new Promise((Z,me)=>{Rs(Z,me,{data:X,headers:ue.from(A.headers),status:A.status,statusText:A.statusText,config:b,request:I})})}catch(z){throw O&&O(),z&&z.name==="TypeError"&&/Load failed|fetch/i.test(z.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,I),{cause:z.cause||z}):U.from(z,z&&z.code,b,I)}}},xf=new Map,Vs=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let i=s.length,l=i,d,c,u=xf;for(;l--;)d=s[l],c=u.get(d),c===void 0&&u.set(d,c=l?new Map:gf(t)),u=c;return c};Vs();const so={http:Dm,xhr:df,fetch:{get:Vs}};S.forEach(so,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ws=e=>`- ${e}`,bf=e=>S.isFunction(e)||e===null||e===!1;function _f(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let i=0;i<r;i++){n=e[i];let l;if(o=n,!bf(n)&&(o=so[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;s[l||"#"+i]=o}if(!o){const i=Object.entries(s).map(([d,c])=>`adapter ${d} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=r?i.length>1?`since : 216 `+i.map(Ws).join(` 217 `):" "+Ws(i[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const qs={getAdapter:_f,adapters:so};function io(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function Gs(e){return io(e),e.headers=ue.from(e.headers),e.data=ao.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),qs.getAdapter(e.adapter||sr.adapter,e)(e).then(function(n){return io(e),n.data=ao.call(e,e.transformResponse,n),n.headers=ue.from(n.headers),n},function(n){return Os(n)||(io(e),n&&n.response&&(n.response.data=ao.call(e,e.transformResponse,n.response),n.response.headers=ue.from(n.response.headers))),Promise.reject(n)})}const Ks="1.13.1",Hr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Hr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ys={};Hr.transitional=function(t,r,n){function o(s,i){return"[Axios v"+Ks+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,l)=>{if(t===!1)throw new U(o(i," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!Ys[i]&&(Ys[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,l):!0}},Hr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function vf(e,t,r){if(typeof e!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const l=e[s],d=l===void 0||i(l,s,e);if(d!==!0)throw new U("option "+s+" must be "+d,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+s,U.ERR_BAD_OPTION)}}const Vr={assertOptions:vf,validators:Hr},ke=Vr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Es,response:new Es}}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 s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` 218 `+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Vr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:Vr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Vr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&S.merge(s.common,s[r.method]);s&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),r.headers=ue.concat(i,s);const l=[];let d=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(d=d&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!d){const b=[Gs.bind(this),void 0];for(b.unshift(...l),b.push(...c),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=Gs.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=c.length;p<m;)u=u.then(c[p++],c[p++]);return u}getUri(t){t=at(this.defaults,t);const r=zs(t.baseURL,t.url,t.allowAbsoluteUrls);return Ns(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,l){return this.request(at(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let yf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(l=>{n.subscribe(l),s=l}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,l){n.reason||(n.reason=new jt(s,i,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 wf(e){return function(r){return e.apply(null,r)}}function jf(e){return S.isObject(e)&&e.isAxiosError===!0}const lo={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(lo).forEach(([e,t])=>{lo[t]=e});function Xs(e){const t=new st(e),r=ps(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Xs(at(e,o))},r}const ee=Xs(sr);ee.Axios=st,ee.CanceledError=jt,ee.CancelToken=yf,ee.isCancel=Os,ee.VERSION=Ks,ee.toFormData=Fr,ee.AxiosError=U,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=wf,ee.isAxiosError=jf,ee.mergeConfig=at,ee.AxiosHeaders=ue,ee.formToJSON=e=>Ts(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=qs.getAdapter,ee.HttpStatusCode=lo,ee.default=ee;const{Axios:Pv,AxiosError:Tv,CanceledError:Av,isCancel:Ov,CancelToken:Rv,VERSION:Lv,all:Iv,Cancel:zv,isAxiosError:Mv,spread:Dv,toFormData:Fv,AxiosHeaders:$v,HttpStatusCode:Bv,formToJSON:Uv,getAdapter:Hv,mergeConfig:Vv}=ee,Js=ecommreelsInfo,pe=ee.create({baseURL:`${Js.apiBase}`,headers:{"X-WP-Nonce":Js.nonce,"Content-Type":"application/json"}}),Sf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async i=>{try{t(!0);const l={styles:et,story_ids:i},d=await pe.post("stories/manage-group-stories",l);return G.success("Group created successfully!"),d.data.group_id}catch(l){return l instanceof Error?G.error(l.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),s=y.useCallback(async(i,l,d)=>{try{return n(!0),await pe.delete(`story/${i}`),l(c=>c.filter(u=>u.id!==i)),d?.silent||G.success("Reel deleted successfully!"),{ok:!0}}catch(c){const u=c instanceof Error?c.message:"Something went wrong. Try again later!";return d?.silent||G.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:s}};function co(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Zs=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[s,i]=y.useState(!0),[l,d]=y.useState(!1),[c,u]=y.useState(!1),[p,m]=y.useState(""),g=co(p,500),b=y.useRef(!0),f=y.useCallback(async _=>{_===1&&b.current?u(!0):d(!0);try{const w={page:_,per_page:20};e&&(w.group_id=e),g&&(w.search=g);const j=await pe.get("stories",{params:w}),C=j.data,N=parseInt(j.headers["x-wp-totalpages"]);r(k=>_===1?C:[...k,...C]),o(_+1),i(_<N)}catch(w){w instanceof Error?G.error(w.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),d(!1),u(!1)}},[e,g]);y.useEffect(()=>{o(1),r([]),f(1)},[g,f]);const h=y.useRef(null),v=y.useCallback(_=>{l||(h.current&&h.current.disconnect(),h.current=new IntersectionObserver(w=>{w[0].isIntersecting&&s&&f(n)}),_&&h.current.observe(_))},[l,s,n,f]);return y.useEffect(()=>()=>{h.current&&h.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:c,lastStoryElementRef:v}};function Cf(){const e=Se(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:s,setSearchTerm:i,isLoading:l}=Zs(null),{styles:d,isCreating:c,isDeleting:u,createGroup:p,deleteReel:m}=Sf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[v,_]=y.useState(null),[w,j]=y.useState([]),C=async()=>{const T=await p(w);T&&e(`?view=${K.mg}&gid=${T}`)},N=()=>{j(t.map(T=>T.id))},k=T=>{j(R=>R.includes(T)?R.filter(L=>L!==T):[...R,T])},E=()=>{w.length&&h(w)},P=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const T=await Promise.all(f.map(O=>m(O,r,{silent:!0}))),R=f.filter((O,D)=>T[D]?.ok),L=R.length,I=f.length-L;L&&(r(O=>O.filter(D=>!R.includes(D.id))),j(O=>O.filter(D=>!R.includes(D)))),L&&G.success(`${L} reels deleted successfully!`),I&&G.error(`${I} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Rr,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Ar,{onReject:()=>{b(null),h(null)},onAccept:P,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(_t,{left:[a.jsx(vt,{name:"All Reels",Icon:rp},"page"),a.jsx(tr,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Lr,{},"reel-wp")],right:[a.jsx(Or,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:gt},"add-reel-all-reel")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(yp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:s,setSearchTerm:i,isCreating:c,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(Jp,{reels:t,styles:d,selectedReelIds:w,onSelectReel:k,onDeleteReel:b,onPreviewReel:_,lastStoryElementRef:o}):!n&&!l?a.jsx(Cp,{}):null,n&&a.jsx(kp,{isFullScreen:!t.length})]}),!!v&&a.jsx(Fp,{previewReel:v,setPreviewReel:_})]})}const kf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:s,links:i,thumbnail:l})=>{try{t(!0);const d={story_title:o,files:s,links:i};typeof l=="string"&&l.trim().length>0&&(d.thumbnail=l),n&&(d.story_id=n);const c=await pe.post("files",d);return G.success(`Story ${n?"updated":"created"} successfully!`),c.data.story_id}catch(d){return d instanceof Error?G.error(d.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},uo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(re,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(ap,{className:"ecr-admin-save-button__icon"})," ",r]}),Qs=({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:s=>{e&&e(!0),r(s.target.value)}})}),Nf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const s=Se(),[i]=Yt(),l=i.get("sid"),d=i.get("from")||K.ag,c=i.get("gid"),{isSaving:u,saveStory:p}=kf(),m=async()=>{if(u)return;const g=await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});g&&s(`?view=${d}${c?`&gid=${c}`:""}`,{replace:!0,...l?{}:{state:{storyId:g}}})};return a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:l?"Update Reel":"Add Reel",Icon:gt},"page"),a.jsx(tr,{},"back")],center:[a.jsx(Qs,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(uo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function Ef(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let po;const Pf=new Uint8Array(16);function Tf(){if(!po){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");po=crypto.getRandomValues.bind(crypto)}return po(Pf)}const ei={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Af(e,t,r){e=e||{};const n=e.random??e.rng?.()??Tf();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,Ef(n)}function mo(e,t,r){return ei.randomUUID&&!e?ei.randomUUID():Af(e)}const ti="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",ri=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:s})=>{const[i,l]=y.useState(!1),d=()=>{const c=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});c.on("select",()=>{const u=c.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:mo()}));e(m=>[...m,...p])}),c.open()};return a.jsx("div",{className:F("ecr-admin-upload",i?"ecr-admin-upload--active":"ecr-admin-upload--idle",s),onDragOver:c=>{c.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:c=>{c.preventDefault(),l(!1),d()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:d,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:ti,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:i?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]})})]})})};/** 219 * @license lucide-react v0.552.0 - ISC 220 * 221 * This source code is licensed under the ISC license. 222 * See the LICENSE file in the root directory of this source tree. 223 */const Of=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ni=e=>{const t=Rf(e);return t.charAt(0).toUpperCase()+t.slice(1)},oi=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Lf=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** 224 * @license lucide-react v0.552.0 - ISC 225 * 226 * This source code is licensed under the ISC license. 227 * See the LICENSE file in the root directory of this source tree. 228 */var If={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 229 * @license lucide-react v0.552.0 - ISC 230 * 231 * This source code is licensed under the ISC license. 232 * See the LICENSE file in the root directory of this source tree. 233 */const zf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...l},d)=>y.createElement("svg",{ref:d,...If,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:oi("lucide",o),...!s&&!Lf(l)&&{"aria-hidden":"true"},...l},[...i.map(([c,u])=>y.createElement(c,u)),...Array.isArray(s)?s:[s]]));/** 234 * @license lucide-react v0.552.0 - ISC 235 * 236 * This source code is licensed under the ISC license. 237 * See the LICENSE file in the root directory of this source tree. 238 */const le=(e,t)=>{const r=y.forwardRef(({className:n,...o},s)=>y.createElement(zf,{ref:s,iconNode:t,className:oi(`lucide-${Of(ni(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ni(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 Mf=le("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 fo=le("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 Df=le("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 Ff=le("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 $f=le("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 Bf=le("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 Uf=le("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 Hf=le("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 Vf=le("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 Wf=le("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 qf=le("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 Gf=le("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 Kf=le("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 Yf=le("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"}]]);/** 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 Xf=le("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"}]]);/** 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 Jf=le("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=s=>{const{children:i,...l}=s,d=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:d,children:i})};n.displayName=e+"Provider";function o(s){const i=x.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(s,i){const l=x.createContext(i),d=r.length;r=[...r,i];const c=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[d]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};c.displayName=s+"Provider";function u(p,m){const g=m?.[e]?.[d]||l,b=x.useContext(g);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[c,u]}const o=()=>{const s=r.map(i=>x.createContext(i));return function(l){const d=l?.[e]||s;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};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(s){const i=n.reduce((l,{useScope:d,scopeName:c})=>{const p=d(s)[`__scope${c}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};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=rt(`Primitive.${t}`),n=x.forwardRef((o,s)=>{const{asChild:i,...l}=o,d=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function th(e,t){e&&br.flushSync(()=>e.dispatchEvent(t))}function Ve(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=Ve(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",ho="dismissableLayer.update",oh="dismissableLayer.pointerDownOutside",ah="dismissableLayer.focusOutside",ai,si=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...d}=e,c=x.useContext(si),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=Y(t,k=>p(k)),f=Array.from(c.layers),[h]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),_=u?f.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,j=_>=v,C=lh(k=>{const E=k.target,P=[...c.branches].some(T=>T.contains(E));!j||P||(o?.(k),i?.(k),k.defaultPrevented||l?.())},m),N=ch(k=>{const E=k.target;[...c.branches].some(T=>T.contains(E))||(s?.(k),i?.(k),k.defaultPrevented||l?.())},m);return rh(k=>{_===c.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ai=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ii(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ai)}},[u,m,r,c]),x.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ii())},[u,c]),x.useEffect(()=>{const k=()=>g({});return document.addEventListener(ho,k),()=>document.removeEventListener(ho,k)},[]),a.jsx(W.div,{...d,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,C.onPointerDownCapture)})});Wr.displayName=nh;var sh="DismissableLayerBranch",ih=x.forwardRef((e,t)=>{const r=x.useContext(si),n=x.useRef(null),o=Y(t,n);return x.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ih.displayName=sh;function lh(e,t=globalThis?.document){const r=Ve(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const s=l=>{if(l.target&&!n.current){let d=function(){li(oh,r,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ch(e,t=globalThis?.document){const r=Ve(e),n=x.useRef(!1);return x.useEffect(()=>{const o=s=>{s.target&&!n.current&&li(ah,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ii(){const e=new CustomEvent(ho);document.dispatchEvent(e)}function li(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?th(o,s):o.dispatchEvent(s)}var go=0;function xo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ci()),document.body.insertAdjacentElement("beforeend",e[1]??ci()),go++,()=>{go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),go--}},[])}function ci(){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 bo="focusScope.autoFocusOnMount",_o="focusScope.autoFocusOnUnmount",di={bubbles:!1,cancelable:!0},dh="FocusScope",qr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[l,d]=x.useState(null),c=Ve(o),u=Ve(s),p=x.useRef(null),m=Y(t,f=>d(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:We(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||We(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(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){mi.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(bo,di);l.addEventListener(bo,c),l.dispatchEvent(v),v.defaultPrevented||(uh(gh(ui(l)),{select:!0}),document.activeElement===f&&We(l))}return()=>{l.removeEventListener(bo,c),setTimeout(()=>{const v=new CustomEvent(_o,di);l.addEventListener(_o,u),l.dispatchEvent(v),v.defaultPrevented||We(f??document.body,{select:!0}),l.removeEventListener(_o,u),mi.remove(g)},0)}}},[l,c,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&&We(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&We(j,{select:!0})):v===_&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...i,ref:m,onKeyDown:b})});qr.displayName=dh;function uh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function ph(e){const t=ui(e),r=pi(t,e),n=pi(t.reverse(),e);return[r,n]}function ui(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 pi(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 We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&fh(e)&&t&&e.select()}}var mi=hh();function hh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=fi(e,t),e.unshift(t)},remove(t){e=fi(e,t),e[0]?.resume()}}}function fi(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 se=globalThis?.document?x.useLayoutEffect:()=>{},xh=x[" useId ".trim().toString()]||(()=>{}),bh=0;function Ne(e){const[t,r]=x.useState(xh());return se(()=>{r(n=>n??String(bh++))},[e]),e||(t?`radix-${t}`:"")}const _h=["top","right","bottom","left"],qe=Math.min,fe=Math.max,Gr=Math.round,Kr=Math.floor,Ee=e=>({x:e,y:e}),vh={left:"right",right:"left",bottom:"top",top:"bottom"},yh={start:"end",end:"start"};function vo(e,t,r){return fe(e,qe(t,r))}function ze(e,t){return typeof e=="function"?e(t):e}function Me(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function yo(e){return e==="x"?"y":"x"}function wo(e){return e==="y"?"height":"width"}const wh=new Set(["top","bottom"]);function Pe(e){return wh.has(Me(e))?"y":"x"}function jo(e){return yo(Pe(e))}function jh(e,t,r){r===void 0&&(r=!1);const n=St(e),o=jo(e),s=wo(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Yr(i)),[i,Yr(i)]}function Sh(e){const t=Yr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>yh[t])}const hi=["left","right"],gi=["right","left"],Ch=["top","bottom"],kh=["bottom","top"];function Nh(e,t,r){switch(e){case"top":case"bottom":return r?t?gi:hi:t?hi:gi;case"left":case"right":return t?Ch:kh;default:return[]}}function Eh(e,t,r,n){const o=St(e);let s=Nh(Me(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(So)))),s}function Yr(e){return e.replace(/left|right|bottom|top/g,t=>vh[t])}function Ph(e){return{top:0,right:0,bottom:0,left:0,...e}}function xi(e){return typeof e!="number"?Ph(e):{top:e,right:e,bottom:e,left:e}}function Xr(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 bi(e,t,r){let{reference:n,floating:o}=e;const s=Pe(t),i=jo(t),l=wo(i),d=Me(t),c=s==="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(d){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(St(t)){case"start":g[i]-=m*(r&&c?-1:1);break;case"end":g[i]+=m*(r&&c?-1:1);break}return g}const Th=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,l=s.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=bi(c,n,d),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:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:c,platform:i,elements:{reference:e,floating:t}});u=_??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=bi(c,m,d)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function lr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:l,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=ze(t,e),b=xi(g),h=l[m?p==="floating"?"reference":"floating":p],v=Xr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(h)))==null||r?h:h.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:d})),_=p==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),j=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Xr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:w,strategy:d}):_);return{top:(v.top-C.top+b.top)/j.y,bottom:(C.bottom-v.bottom+b.bottom)/j.y,left:(v.left-C.left+b.left)/j.x,right:(C.right-v.right+b.right)/j.x}}const Ah=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:l,middlewareData:d}=t,{element:c,padding:u=0}=ze(e,t)||{};if(c==null)return{};const p=xi(u),m={x:r,y:n},g=jo(o),b=wo(g),f=await i.getDimensions(c),h=g==="y",v=h?"top":"left",_=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=s.reference[b]+s.reference[g]-m[g]-s.floating[b],C=m[g]-s.reference[g],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let k=N?N[w]:0;(!k||!await(i.isElement==null?void 0:i.isElement(N)))&&(k=l.floating[w]||s.floating[b]);const E=j/2-C/2,P=k/2-f[b]/2-1,T=qe(p[v],P),R=qe(p[_],P),L=T,I=k-f[b]-R,O=k/2-f[b]/2+E,D=vo(L,O,I),z=!d.arrow&&St(o)!=null&&O!==D&&s.reference[b]/2-(O<L?T:R)-f[b]/2<0,B=z?O<L?O-L:O-I:0;return{[g]:m[g]+B,data:{[g]:D,centerOffset:O-D-B,...z&&{alignmentOffset:B}},reset:z}}}),Oh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:d,elements:c}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=ze(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=Me(o),_=Pe(l),w=Me(l)===l,j=await(d.isRTL==null?void 0:d.isRTL(c.floating)),C=m||(w||!f?[Yr(l)]:Sh(l)),N=b!=="none";!m&&N&&C.push(...Eh(l,f,b,j));const k=[l,...C],E=await lr(t,h),P=[];let T=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&P.push(E[v]),p){const O=jh(o,i,j);P.push(E[O[0]],E[O[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(O=>O<=0)){var R,L;const O=(((R=s.flip)==null?void 0:R.index)||0)+1,D=k[O];if(D&&(!(p==="alignment"?_!==Pe(D):!1)||T.every(A=>Pe(A.placement)===_?A.overflows[0]>0:!0)))return{data:{index:O,overflows:T},reset:{placement:D}};let z=(L=T.filter(B=>B.overflows[0]<=0).sort((B,A)=>B.overflows[1]-A.overflows[1])[0])==null?void 0:L.placement;if(!z)switch(g){case"bestFit":{var I;const B=(I=T.filter(A=>{if(N){const q=Pe(A.placement);return q===_||q==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((A,q)=>A[1]-q[1])[0])==null?void 0:I[0];B&&(z=B);break}case"initialPlacement":z=l;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function _i(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vi(e){return _h.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}=ze(e,t);switch(n){case"referenceHidden":{const s=await lr(t,{...o,elementContext:"reference"}),i=_i(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:vi(i)}}}case"escaped":{const s=await lr(t,{...o,altBoundary:!0}),i=_i(s,r.floating);return{data:{escapedOffsets:i,escaped:vi(i)}}}default:return{}}}}},yi=new Set(["left","top"]);async function Lh(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Me(r),l=St(r),d=Pe(r)==="y",c=yi.has(i)?-1:1,u=s&&d?-1:1,p=ze(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),d?{x:g*u,y:m*c}:{x:m*c,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:s,placement:i,middlewareData:l}=t,d=await Lh(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+d.x,y:s+d.y,data:{...d,placement:i}}}}},zh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:h=>{let{x:v,y:_}=h;return{x:v,y:_}}},...d}=ze(e,t),c={x:r,y:n},u=await lr(t,d),p=Pe(Me(o)),m=yo(p);let g=c[m],b=c[p];if(s){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",_=g+u[h],w=g-u[v];g=vo(_,g,w)}if(i){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]:s,[p]:i}}}}}},Mh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:d=!0,crossAxis:c=!0}=ze(e,t),u={x:r,y:n},p=Pe(o),m=yo(p);let g=u[m],b=u[p];const f=ze(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(d){const w=m==="y"?"height":"width",j=s.reference[m]-s.floating[w]+h.mainAxis,C=s.reference[m]+s.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(c){var v,_;const w=m==="y"?"width":"height",j=yi.has(Me(o)),C=s.reference[p]-s.floating[w]+(j&&((v=i.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=s.reference[p]+s.reference[w]+(j?0:((_=i.offset)==null?void 0:_[p])||0)-(j?h.crossAxis:0);b<C?b=C: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:s,platform:i,elements:l}=t,{apply:d=()=>{},...c}=ze(e,t),u=await lr(t,c),p=Me(o),m=St(o),g=Pe(o)==="y",{width:b,height:f}=s.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(i.isRTL==null?void 0:i.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=qe(f-u[h],_),C=qe(b-u[v],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=_),N&&!m){const T=fe(u.left,0),R=fe(u.right,0),L=fe(u.top,0),I=fe(u.bottom,0);g?E=b-2*(T!==0||R!==0?T+R:fe(u.left,u.right)):k=f-2*(L!==0||I!==0?L+I:fe(u.top,u.bottom))}await d({...t,availableWidth:E,availableHeight:k});const P=await i.getDimensions(l.floating);return b!==P.width||f!==P.height?{reset:{rects:!0}}:{}}}};function Jr(){return typeof window<"u"}function Ct(e){return wi(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Te(e){var t;return(t=(wi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wi(e){return Jr()?e instanceof Node||e instanceof he(e).Node:!1}function ve(e){return Jr()?e instanceof Element||e instanceof he(e).Element:!1}function Ae(e){return Jr()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function ji(e){return!Jr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}const Fh=new Set(["inline","contents"]);function cr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ye(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(Ct(e))}const Uh=[":popover-open",":modal"];function Zr(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 Co(e){const t=ko(),r=ve(e)?ye(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=Ge(e);for(;Ae(t)&&!kt(t);){if(Co(t))return t;if(Zr(t))return null;t=Ge(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 kt(e){return Gh.has(Ct(e))}function ye(e){return he(e).getComputedStyle(e)}function Qr(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ji(e)&&e.host||Te(e);return ji(t)?t.host:t}function Si(e){const t=Ge(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ae(t)&&cr(t)?t:Si(t)}function dr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Si(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=he(o);if(s){const l=No(i);return t.concat(i,i.visualViewport||[],cr(o)?o:[],l&&r?dr(l):[])}return t.concat(o,dr(o,[],r))}function No(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ci(e){const t=ye(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Ae(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,l=Gr(r)!==s||Gr(n)!==i;return l&&(r=s,n=i),{width:r,height:n,$:l}}function Eo(e){return ve(e)?e:e.contextElement}function Nt(e){const t=Eo(e);if(!Ae(t))return Ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=Ci(t);let i=(s?Gr(r.width):r.width)/n,l=(s?Gr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Kh=Ee(0);function ki(e){const t=he(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!==he(e)?!1:t}function it(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Eo(e);let i=Ee(1);t&&(n?ve(n)&&(i=Nt(n)):i=Nt(e));const l=Yh(s,r,n)?ki(s):Ee(0);let d=(o.left+l.x)/i.x,c=(o.top+l.y)/i.y,u=o.width/i.x,p=o.height/i.y;if(s){const m=he(s),g=n&&ve(n)?he(n):n;let b=m,f=No(b);for(;f&&n&&g!==b;){const h=Nt(f),v=f.getBoundingClientRect(),_=ye(f),w=v.left+(f.clientLeft+parseFloat(_.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(_.paddingTop))*h.y;d*=h.x,c*=h.y,u*=h.x,p*=h.y,d+=w,c+=j,b=he(f),f=No(b)}}return Xr({width:u,height:p,x:d,y:c})}function en(e,t){const r=Qr(e).scrollLeft;return t?t.left+r:it(Te(e)).left+r}function Ni(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-en(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 s=o==="fixed",i=Te(n),l=t?Zr(t.floating):!1;if(n===i||l&&s)return r;let d={scrollLeft:0,scrollTop:0},c=Ee(1);const u=Ee(0),p=Ae(n);if((p||!p&&!s)&&((Ct(n)!=="body"||cr(i))&&(d=Qr(n)),Ae(n))){const g=it(n);c=Nt(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=i&&!p&&!s?Ni(i,d):Ee(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-d.scrollLeft*c.x+u.x+m.x,y:r.y*c.y-d.scrollTop*c.y+u.y+m.y}}function Jh(e){return Array.from(e.getClientRects())}function Zh(e){const t=Te(e),r=Qr(e),n=e.ownerDocument.body,o=fe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=fe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+en(e);const l=-r.scrollTop;return ye(n).direction==="rtl"&&(i+=fe(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:l}}const Ei=25;function Qh(e,t){const r=he(e),n=Te(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,l=0,d=0;if(o){s=o.width,i=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,d=o.offsetTop)}const c=en(n);if(c<=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<=Ei&&(s-=b)}else c<=Ei&&(s+=c);return{width:s,height:i,x:l,y:d}}const eg=new Set(["absolute","fixed"]);function tg(e,t){const r=it(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=Ae(e)?Nt(e):Ee(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,d=o*s.x,c=n*s.y;return{width:i,height:l,x:d,y:c}}function Pi(e,t,r){let n;if(t==="viewport")n=Qh(e,r);else if(t==="document")n=Zh(Te(e));else if(ve(t))n=tg(t,r);else{const o=ki(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Xr(n)}function Ti(e,t){const r=Ge(e);return r===t||!ve(r)||kt(r)?!1:ye(r).position==="fixed"||Ti(r,t)}function rg(e,t){const r=t.get(e);if(r)return r;let n=dr(e,[],!1).filter(l=>ve(l)&&Ct(l)!=="body"),o=null;const s=ye(e).position==="fixed";let i=s?Ge(e):e;for(;ve(i)&&!kt(i);){const l=ye(i),d=Co(i);!d&&l.position==="fixed"&&(o=null),(s?!d&&!o:!d&&l.position==="static"&&!!o&&eg.has(o.position)||cr(i)&&!d&&Ti(e,i))?n=n.filter(u=>u!==i):o=l,i=Ge(i)}return t.set(e,n),n}function ng(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Zr(t)?[]:rg(t,this._c):[].concat(r),n],l=i[0],d=i.reduce((c,u)=>{const p=Pi(t,u,o);return c.top=fe(p.top,c.top),c.right=qe(p.right,c.right),c.bottom=qe(p.bottom,c.bottom),c.left=fe(p.left,c.left),c},Pi(t,l,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function og(e){const{width:t,height:r}=Ci(e);return{width:t,height:r}}function ag(e,t,r){const n=Ae(t),o=Te(t),s=r==="fixed",i=it(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const d=Ee(0);function c(){d.x=en(o)}if(n||!n&&!s)if((Ct(t)!=="body"||cr(o))&&(l=Qr(t)),n){const g=it(t,!0,s,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else o&&c();s&&!n&&o&&c();const u=o&&!n&&!s?Ni(o,l):Ee(0),p=i.left+l.scrollLeft-d.x-u.x,m=i.top+l.scrollTop-d.y-u.y;return{x:p,y:m,width:i.width,height:i.height}}function Po(e){return ye(e).position==="static"}function Ai(e,t){if(!Ae(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Te(e)===r&&(r=r.ownerDocument.body),r}function Oi(e,t){const r=he(e);if(Zr(e))return r;if(!Ae(e)){let o=Ge(e);for(;o&&!kt(o);){if(ve(o)&&!Po(o))return o;o=Ge(o)}return r}let n=Ai(e,t);for(;n&&Bh(n)&&Po(n);)n=Ai(n,t);return n&&kt(n)&&Po(n)&&!Co(n)?r:n||qh(e)||r}const sg=async function(e){const t=this.getOffsetParent||Oi,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 ig(e){return ye(e).direction==="rtl"}const lg={convertOffsetParentRelativeRectToViewportRelativeRect:Xh,getDocumentElement:Te,getClippingRect:ng,getOffsetParent:Oi,getElementRects:sg,getClientRects:Jh,getDimensions:og,getScale:Nt,isElement:ve,isRTL:ig};function Ri(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=Te(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),s();const c=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=c;if(l||t(),!m||!g)return;const b=Kr(p),f=Kr(o.clientWidth-(u+m)),h=Kr(o.clientHeight-(p+g)),v=Kr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:fe(0,qe(1,d))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==d){if(!j)return i();k?i(!1,k):n=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Ri(c,e.getBoundingClientRect())&&i(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return i(!0),s}function dg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,c=Eo(e),u=o||s?[...c?dr(c):[],...dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const p=c&&l?cg(c,r):null;let m=-1,g=null;i&&(g=new ResizeObserver(v=>{let[_]=v;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),c&&!d&&g.observe(c),g.observe(t));let b,f=d?it(e):null;d&&h();function h(){const v=it(e);f&&!Ri(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(_=>{o&&_.removeEventListener("scroll",r),s&&_.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,d&&cancelAnimationFrame(b)}}const ug=Ih,pg=zh,mg=Oh,fg=Dh,hg=Rh,Li=Ah,gg=Mh,xg=(e,t,r)=>{const n=new Map,o={platform:lg,...r},s={...o.platform,_c:n};return Th(e,t,{...o,platform:s})};var bg=typeof document<"u",_g=function(){},tn=bg?y.useLayoutEffect:_g;function rn(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(!rn(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 s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!rn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ii(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zi(e,t){const r=Ii(e);return Math.round(t*r)/r}function To(e){const t=x.useRef(e);return tn(()=>{t.current=e}),t}function vg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:d,open:c}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);rn(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),_=x.useCallback(A=>{A!==N.current&&(N.current=A,f(A))},[]),w=x.useCallback(A=>{A!==k.current&&(k.current=A,v(A))},[]),j=s||b,C=i||h,N=x.useRef(null),k=x.useRef(null),E=x.useRef(u),P=d!=null,T=To(d),R=To(o),L=To(c),I=x.useCallback(()=>{if(!N.current||!k.current)return;const A={placement:t,strategy:r,middleware:m};R.current&&(A.platform=R.current),xg(N.current,k.current,A).then(q=>{const X={...q,isPositioned:L.current!==!1};O.current&&!rn(E.current,X)&&(E.current=X,br.flushSync(()=>{p(X)}))})},[m,t,r,R,L]);tn(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(A=>({...A,isPositioned:!1})))},[c]);const O=x.useRef(!1);tn(()=>(O.current=!0,()=>{O.current=!1}),[]),tn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(T.current)return T.current(j,C,I);I()}},[j,C,I,T,P]);const D=x.useMemo(()=>({reference:N,floating:k,setReference:_,setFloating:w}),[_,w]),z=x.useMemo(()=>({reference:j,floating:C}),[j,C]),B=x.useMemo(()=>{const A={position:r,left:0,top:0};if(!z.floating)return A;const q=zi(z.floating,u.x),X=zi(z.floating,u.y);return l?{...A,transform:"translate("+q+"px, "+X+"px)",...Ii(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:X}},[r,l,z.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:I,refs:D,elements:z,floatingStyles:B}),[u,I,D,z,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?Li({element:n.current,padding:o}).fn(r):{}:n?Li({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]}),Cg=(e,t)=>({...mg(e),options:[e,t]}),kg=(e,t)=>({...fg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...yg(e),options:[e,t]});var Pg="Arrow",Mi=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return a.jsx(W.svg,{...s,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"})})});Mi.displayName=Pg;var Tg=Mi;function Ag(e){const[t,r]=x.useState(void 0);return se(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const d=s.borderBoxSize,c=Array.isArray(d)?d[0]:d;i=c.inlineSize,l=c.blockSize}else i=e.offsetWidth,l=e.offsetHeight;r({width:i,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ao="Popper",[Di,nn]=He(Ao),[Og,Fi]=Di(Ao),$i=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Og,{scope:t,anchor:n,onAnchorChange:o,children:r})};$i.displayName=Ao;var Bi="PopperAnchor",Ui=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Fi(Bi,r),i=x.useRef(null),l=Y(t,i),d=x.useRef(null);return x.useEffect(()=>{const c=d.current;d.current=n?.current||i.current,c!==d.current&&s.onAnchorChange(d.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Ui.displayName=Bi;var Oo="PopperContent",[Rg,Lg]=Di(Oo),Hi=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Fi(Oo,r),[v,_]=x.useState(null),w=Y(t,$=>_($)),[j,C]=x.useState(null),N=Ag(j),k=N?.width??0,E=N?.height??0,P=n+(s!=="center"?"-"+s:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(c)?c:[c],L=R.length>0,I={padding:T,boundary:R.filter(zg),altBoundary:L},{refs:O,floatingStyles:D,placement:z,isPositioned:B,middlewareData:A}=vg({strategy:"fixed",placement:P,whileElementsMounted:(...$)=>dg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[wg({mainAxis:o+E,alignmentAxis:i}),d&&jg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Sg():void 0,...I}),d&&Cg({...I}),kg({...I,apply:({elements:$,rects:te,availableWidth:ce,availableHeight:J})=>{const{width:Q,height:ne}=te.reference,xe=$.floating.style;xe.setProperty("--radix-popper-available-width",`${ce}px`),xe.setProperty("--radix-popper-available-height",`${J}px`),xe.setProperty("--radix-popper-anchor-width",`${Q}px`),xe.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),j&&Eg({element:j,padding:l}),Mg({arrowWidth:k,arrowHeight:E}),m&&Ng({strategy:"referenceHidden",...I})]}),[q,X]=qi(z),Z=Ve(b);se(()=>{B&&Z?.()},[B,Z]);const me=A.arrow?.x,Fe=A.arrow?.y,ge=A.arrow?.centerOffset!==0,[$e,pt]=x.useState();return se(()=>{v&&pt(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:B?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Rg,{scope:r,placedSide:q,onArrowChange:C,arrowX:me,arrowY:Fe,shouldHideArrow:ge,children:a.jsx(W.div,{"data-side":q,"data-align":X,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Hi.displayName=Oo;var Vi="PopperArrow",Ig={top:"bottom",right:"left",bottom:"top",left:"right"},Wi=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Lg(Vi,n),i=Ig[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(Tg,{...o,ref:r,style:{...o.style,display:"block"}})})});Wi.displayName=Vi;function zg(e){return e!==null}var Mg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,d=i?0:e.arrowHeight,[c,u]=qi(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+d/2;let b="",f="";return c==="bottom"?(b=i?p:`${m}px`,f=`${-d}px`):c==="top"?(b=i?p:`${m}px`,f=`${n.floating.height+d}px`):c==="right"?(b=`${-d}px`,f=i?p:`${g}px`):c==="left"&&(b=`${n.floating.width+d}px`,f=i?p:`${g}px`),{data:{x:b,y:f}}}});function qi(e){const[t,r="center"]=e.split("-");return[t,r]}var Gi=$i,Ro=Ui,Ki=Hi,Yi=Wi,Dg="Portal",on=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,s]=x.useState(!1);se(()=>s(!0),[]);const i=r||o&&globalThis?.document?.body;return i?va.createPortal(a.jsx(W.div,{...n,ref:t}),i):null});on.displayName=Dg;function Fg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ke=e=>{const{present:t,children:r}=e,n=$g(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),s=Y(n.ref,Bg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:s}):null};Ke.displayName="Presence";function $g(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),s=x.useRef("none"),i=e?"mounted":"unmounted",[l,d]=Fg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=an(n.current);s.current=l==="mounted"?c:"none"},[l]),se(()=>{const c=n.current,u=o.current;if(u!==e){const m=s.current,g=an(c);e?d("MOUNT"):g==="none"||c?.display==="none"?d("UNMOUNT"):d(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),se(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,p=g=>{const f=an(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(d("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(s.current=an(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function an(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()]||se;function lt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=Hg({defaultProp:t,onChange:r}),l=e!==void 0,d=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 c=x.useCallback(u=>{if(l){const p=Vg(u)?u(e):u;p!==e&&i.current?.(p)}else s(u)},[l,e,s,i]);return[d,c]}function Hg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),s=x.useRef(t);return Ug(()=>{s.current=t},[t]),x.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,n,s]}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},Et=new WeakMap,sn=new WeakMap,ln={},Lo=0,Xi=function(e){return e&&(e.host||Xi(e.parentNode))},qg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Xi(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]);ln[r]||(ln[r]=new WeakMap);var s=ln[r],i=[],l=new Set,d=new Set(o),c=function(p){!p||l.has(p)||(l.add(p),c(p.parentNode))};o.forEach(c);var u=function(p){!p||d.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=(Et.get(m)||0)+1,h=(s.get(m)||0)+1;Et.set(m,f),s.set(m,h),i.push(m),f===1&&b&&sn.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(),Lo++,function(){i.forEach(function(p){var m=Et.get(p)-1,g=s.get(p)-1;Et.set(p,m),s.set(p,g),m||(sn.has(p)||p.removeAttribute(n),sn.delete(p)),g||p.removeAttribute(r)}),Lo--,Lo||(Et=new WeakMap,Et=new WeakMap,sn=new WeakMap,ln={})}},Io=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}},Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Oe.apply(this,arguments)};function Ji(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,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var cn="right-scroll-bar-position",dn="width-before-scroll-bar",Yg="with-scroll-bars-hidden",Xg="--removed-body-scroll-bar-size";function zo(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,Zi=new WeakMap;function Qg(e,t){var r=Jg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return Zg(function(){var n=Zi.get(r);if(n){var o=new Set(n),s=new Set(e),i=r.current;o.forEach(function(l){s.has(l)||zo(l,null)}),s.forEach(function(l){o.has(l)||zo(l,i)})}Zi.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(s){var i=t(s,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(n=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(l){return s(l)},filter:function(){return r}}},assignMedium:function(s){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(s),i=r}var d=function(){var u=i;i=[],u.forEach(s)},c=function(){return Promise.resolve().then(d)};c(),r={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),r}}}};return o}function rx(e){e===void 0&&(e={});var t=tx(null);return t.options=Oe({async:!0,ssr:!1},e),t}var Qi=function(e){var t=e.sideCar,r=Ji(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,Oe({},r))};Qi.isSideCarExport=!0;function nx(e,t){return e.useMedium(t),Qi}var el=rx(),Mo=function(){},un=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Mo,onWheelCapture:Mo,onTouchMoveCapture:Mo}),o=n[0],s=n[1],i=e.forwardProps,l=e.children,d=e.className,c=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=Ji(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=Qg([r,t]),k=Oe(Oe({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:el,removeScrollBar:c,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:s,allowPinchZoom:!!h,lockRef:r,gapMode:w}),i?x.cloneElement(x.Children.only(l),Oe(Oe({},k),{ref:N})):x.createElement(_,Oe({},k,{className:d,ref:N}),l))});un.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},un.classNames={fullWidth:dn,zeroRight:cn};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 sx(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 lx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ax())&&(sx(t,r),ix(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])}},tl=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},Do=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[Do(r),Do(n),Do(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=tl(),Pt="data-scroll-locked",fx=function(e,t,r,n){var o=e.left,s=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),` 319 .`.concat(Yg,` { 310 320 overflow: hidden `).concat(n,`; 311 padding-right: `).concat( c,"px ").concat(n,`;312 } 313 body[`).concat( Tt,`] {321 padding-right: `).concat(l,"px ").concat(n,`; 322 } 323 body[`).concat(Pt,`] { 314 324 overflow: hidden `).concat(n,`; 315 325 overscroll-behavior: contain; … … 320 330 margin-left:0; 321 331 margin-top:0; 322 margin-right: `).concat(c,"px ").concat(n,`; 323 `),r==="padding"&&"padding-right: ".concat(c,"px ").concat(n,";")].filter(Boolean).join(""),` 332 margin-right: `).concat(l,"px ").concat(n,`; 333 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),` 334 } 335 336 .`).concat(cn,` { 337 right: `).concat(l,"px ").concat(n,`; 324 338 } 325 339 326 340 .`).concat(dn,` { 327 right: `).concat(c,"px ").concat(n,`;328 } 329 330 .`).concat( un,` {331 margin-right: `).concat(c,"px ").concat(n,`;341 margin-right: `).concat(l,"px ").concat(n,`; 342 } 343 344 .`).concat(cn," .").concat(cn,` { 345 right: 0 `).concat(n,`; 332 346 } 333 347 334 348 .`).concat(dn," .").concat(dn,` { 335 right: 0 `).concat(n,`;336 }337 338 .`).concat(un," .").concat(un,` {339 349 margin-right: 0 `).concat(n,`; 340 350 } 341 351 342 body[`).concat( Tt,`] {343 `).concat( qg,": ").concat(c,`px;344 } 345 `)}, tc=function(){var e=parseInt(document.body.getAttribute(Tt)||"0",10);return isFinite(e)?e:0},ux=function(){g.useEffect(function(){return document.body.setAttribute(Tt,(tc()+1).toString()),function(){var e=tc()-1;e<=0?document.body.removeAttribute(Tt):document.body.setAttribute(Tt,e.toString())}},[])},px=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;ux();var s=g.useMemo(function(){return cx(o)},[o]);return g.createElement(lx,{styles:dx(s,!t,o,r?"":"!important")})},Fo=!1;if(typeof window<"u")try{var mn=Object.defineProperty({},"passive",{get:function(){return Fo=!0,!0}});window.addEventListener("test",mn,mn),window.removeEventListener("test",mn,mn)}catch{Fo=!1}var At=Fo?{passive:!1}:!1,mx=function(e){return e.tagName==="TEXTAREA"},rc=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!mx(e)&&r[t]==="visible")},fx=function(e){return rc(e,"overflowY")},hx=function(e){return rc(e,"overflowX")},nc=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=oc(e,n);if(o){var s=ac(e,n),i=s[1],c=s[2];if(i>c)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},gx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},xx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},oc=function(e,t){return e==="v"?fx(t):hx(t)},ac=function(e,t){return e==="v"?gx(t):xx(t)},bx=function(e,t){return e==="h"&&t==="rtl"?-1:1},_x=function(e,t,r,n,o){var s=bx(e,window.getComputedStyle(t).direction),i=s*n,c=r.target,l=t.contains(c),d=!1,u=i>0,p=0,m=0;do{if(!c)break;var h=ac(e,c),b=h[0],f=h[1],x=h[2],v=f-x-s*b;(b||v)&&oc(e,c)&&(p+=v,m+=b);var _=c.parentNode;c=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},fn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sc=function(e){return[e.deltaX,e.deltaY]},ic=function(e){return e&&"current"in e?e.current:e},vx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yx=function(e){return`352 body[`).concat(Pt,`] { 353 `).concat(Xg,": ").concat(l,`px; 354 } 355 `)},rl=function(){var e=parseInt(document.body.getAttribute(Pt)||"0",10);return isFinite(e)?e:0},hx=function(){x.useEffect(function(){return document.body.setAttribute(Pt,(rl()+1).toString()),function(){var e=rl()-1;e<=0?document.body.removeAttribute(Pt):document.body.setAttribute(Pt,e.toString())}},[])},gx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;hx();var s=x.useMemo(function(){return px(o)},[o]);return x.createElement(mx,{styles:fx(s,!t,o,r?"":"!important")})},Fo=!1;if(typeof window<"u")try{var pn=Object.defineProperty({},"passive",{get:function(){return Fo=!0,!0}});window.addEventListener("test",pn,pn),window.removeEventListener("test",pn,pn)}catch{Fo=!1}var Tt=Fo?{passive:!1}:!1,xx=function(e){return e.tagName==="TEXTAREA"},nl=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 nl(e,"overflowY")},_x=function(e){return nl(e,"overflowX")},ol=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=al(e,n);if(o){var s=sl(e,n),i=s[1],l=s[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},vx=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]},al=function(e,t){return e==="v"?bx(t):_x(t)},sl=function(e,t){return e==="v"?vx(t):yx(t)},wx=function(e,t){return e==="h"&&t==="rtl"?-1:1},jx=function(e,t,r,n,o){var s=wx(e,window.getComputedStyle(t).direction),i=s*n,l=r.target,d=t.contains(l),c=!1,u=i>0,p=0,m=0;do{if(!l)break;var g=sl(e,l),b=g[0],f=g[1],h=g[2],v=f-h-s*b;(b||v)&&al(e,l)&&(p+=v,m+=b);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!d&&l!==document.body||d&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(c=!0),c},mn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},il=function(e){return[e.deltaX,e.deltaY]},ll=function(e){return e&&"current"in e?e.current:e},Sx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Cx=function(e){return` 346 356 .block-interactivity-`.concat(e,` {pointer-events: none;} 347 357 .allow-interactivity-`).concat(e,` {pointer-events: all;} 348 `)}, wx=0,Pt=[];function jx(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),o=g.useState(wx++)[0],s=g.useState(ec)[0],i=g.useRef(e);g.useEffect(function(){i.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Vg([e.lockRef.current],(e.shards||[]).map(ic),!0).filter(Boolean);return f.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=g.useCallback(function(f,x){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!i.current.allowPinchZoom;var v=fn(f),_=r.current,w="deltaX"in f?f.deltaX:_[0]-v[0],j="deltaY"in f?f.deltaY:_[1]-v[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=nc(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=nc(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return _x(T,x,f,T==="h"?w:j)},[]),l=g.useCallback(function(f){var x=f;if(!(!Pt.length||Pt[Pt.length-1]!==s)){var v="deltaY"in x?sc(x):fn(x),_=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&vx(C.delta,v)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var w=(i.current.shards||[]).map(ic).filter(Boolean).filter(function(C){return C.contains(x.target)}),j=w.length>0?c(x,w[0]):!i.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),d=g.useCallback(function(f,x,v,_){var w={name:f,delta:x,target:v,should:_,shadowParent:Sx(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=g.useCallback(function(f){r.current=fn(f),n.current=void 0},[]),p=g.useCallback(function(f){d(f.type,sc(f),f.target,c(f,e.lockRef.current))},[]),m=g.useCallback(function(f){d(f.type,fn(f),f.target,c(f,e.lockRef.current))},[]);g.useEffect(function(){return Pt.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,At),document.addEventListener("touchmove",l,At),document.addEventListener("touchstart",u,At),function(){Pt=Pt.filter(function(f){return f!==s}),document.removeEventListener("wheel",l,At),document.removeEventListener("touchmove",l,At),document.removeEventListener("touchstart",u,At)}},[]);var h=e.removeScrollBar,b=e.inert;return g.createElement(g.Fragment,null,b?g.createElement(s,{styles:yx(o)}):null,h?g.createElement(px,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Cx=Qg(Qi,jx);var hn=g.forwardRef(function(e,t){return g.createElement(pn,Oe({},e,{ref:t,sideCar:Cx}))});hn.classNames=pn.classNames;var gn="Popover",[cc]=He(gn,[on]),sr=on(),[kx,Ye]=cc(gn),lc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,c=sr(t),l=g.useRef(null),[d,u]=g.useState(!1),[p,m]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:gn});return a.jsx(qi,{...c,children:a.jsx(kx,{scope:t,contentId:Ne(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(h=>!h),[m]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>u(!0),[]),onCustomAnchorRemove:g.useCallback(()=>u(!1),[]),modal:i,children:r})})};lc.displayName=gn;var dc="PopoverAnchor",Nx=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(dc,r),s=sr(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=o;return g.useEffect(()=>(i(),()=>c()),[i,c]),a.jsx(Ro,{...s,...n,ref:t})});Nx.displayName=dc;var uc="PopoverTrigger",pc=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(uc,r),s=sr(r),i=Y(t,o.triggerRef),c=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":xc(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:a.jsx(Ro,{asChild:!0,...s,children:c})});pc.displayName=uc;var $o="PopoverPortal",[Ex,Tx]=cc($o,{forceMount:void 0}),mc=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=Ye($o,t);return a.jsx(Ex,{scope:t,forceMount:r,children:a.jsx(Ke,{present:r||s.open,children:a.jsx(an,{asChild:!0,container:o,children:n})})})};mc.displayName=$o;var Ot="PopoverContent",fc=g.forwardRef((e,t)=>{const r=Tx(Ot,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=Ye(Ot,e.__scopePopover);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(Px,{...o,ref:t}):a.jsx(Ox,{...o,ref:t})})});fc.displayName=Ot;var Ax=rt("PopoverContent.RemoveScroll"),Px=g.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=g.useRef(null),o=Y(t,n),s=g.useRef(!1);return g.useEffect(()=>{const i=n.current;if(i)return Io(i)},[]),a.jsx(hn,{as:Ax,allowPinchZoom:!0,children:a.jsx(hc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,d=c.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ox=g.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=g.useRef(!1),o=g.useRef(!1);return a.jsx(hc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),hc=g.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Ye(Ot,r),h=sr(r);return xo(),a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Gi,{"data-state":xc(m.open),role:"dialog",id:m.contentId,...h,...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)"}})})})}),gc="PopoverClose",Rx=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(gc,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Rx.displayName=gc;var Lx="PopoverArrow",Ix=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=sr(r);return a.jsx(Ki,{...o,...n,ref:t})});Ix.displayName=Lx;function xc(e){return e?"open":"closed"}var zx=lc,Mx=pc,Dx=mc,Fx=fc;function Rt({...e}){return a.jsx(zx,{"data-slot":"popover",...e})}function Lt({...e}){return a.jsx(Mx,{"data-slot":"popover-trigger",...e})}function It({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(Dx,{container:o,children:a.jsx(Fx,{"data-slot":"popover-content",align:t,sideOffset:r,className:D("ecr-popover",e),...n})})}var $x=Symbol.for("react.lazy"),xn=g[" use ".trim().toString()];function Bx(e){return typeof e=="object"&&e!==null&&"then"in e}function bc(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$x&&"_payload"in e&&Bx(e._payload)}function Ux(e){const t=Hx(e),r=g.forwardRef((n,o)=>{let{children:s,...i}=n;bc(s)&&typeof xn=="function"&&(s=xn(s._payload));const c=g.Children.toArray(s),l=c.find(Wx);if(l){const d=l.props.children,u=c.map(p=>p===l?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Hx(e){const t=g.forwardRef((r,n)=>{let{children:o,...s}=r;if(bc(o)&&typeof xn=="function"&&(o=xn(o._payload)),g.isValidElement(o)){const i=Gx(o),c=qx(s,o.props);return o.type!==g.Fragment&&(c.ref=n?Wn(n,i):i),g.cloneElement(o,c)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vx=Symbol("radix.slottable");function Wx(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vx}function qx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...c)=>{const l=s(...c);return o(...c),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Gx(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 Kx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yx=Kx.reduce((e,t)=>{const r=Ux(`Primitive.${t}`),n=g.forwardRef((o,s)=>{const{asChild:i,...c}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xx="Separator",_c="horizontal",Jx=["horizontal","vertical"],vc=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=_c,...o}=e,s=Zx(n)?n:_c,c=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(Yx.div,{"data-orientation":s,...c,...o,ref:t})});vc.displayName=Xx;function Zx(e){return Jx.includes(e)}var Qx=vc;function bn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(Qx,{"data-slot":"separator",decorative:r,orientation:t,className:D("ecr-separator",e),...n})}const ir=({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(bn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(bn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(re,{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"})})})]})};var _n="Dialog",[yc]=He(_n),[e0,we]=yc(_n),wc=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,c=g.useRef(null),l=g.useRef(null),[d,u]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:_n});return a.jsx(e0,{scope:t,triggerRef:c,contentRef:l,contentId:Ne(),titleId:Ne(),descriptionId:Ne(),open:d,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(p=>!p),[u]),modal:i,children:r})};wc.displayName=_n;var jc="DialogTrigger",Sc=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(jc,r),s=Y(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ho(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)})});Sc.displayName=jc;var Bo="DialogPortal",[t0,Cc]=yc(Bo,{forceMount:void 0}),kc=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=we(Bo,t);return a.jsx(t0,{scope:t,forceMount:r,children:g.Children.map(n,i=>a.jsx(Ke,{present:r||s.open,children:a.jsx(an,{asChild:!0,container:o,children:i})}))})};kc.displayName=Bo;var vn="DialogOverlay",Nc=g.forwardRef((e,t)=>{const r=Cc(vn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(vn,e.__scopeDialog);return s.modal?a.jsx(Ke,{present:n||s.open,children:a.jsx(n0,{...o,ref:t})}):null});Nc.displayName=vn;var r0=rt("DialogOverlay.RemoveScroll"),n0=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(vn,r);return a.jsx(hn,{as:r0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Ho(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),lt="DialogContent",Ec=g.forwardRef((e,t)=>{const r=Cc(lt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(lt,e.__scopeDialog);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(o0,{...o,ref:t}):a.jsx(a0,{...o,ref:t})})});Ec.displayName=lt;var o0=g.forwardRef((e,t)=>{const r=we(lt,e.__scopeDialog),n=g.useRef(null),o=Y(t,r.contentRef,n);return g.useEffect(()=>{const s=n.current;if(s)return Io(s)},[]),a.jsx(Tc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&s.preventDefault()}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault())})}),a0=g.forwardRef((e,t)=>{const r=we(lt,e.__scopeDialog),n=g.useRef(!1),o=g.useRef(!1);return a.jsx(Tc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Tc=g.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,c=we(lt,r),l=g.useRef(null),d=Y(t,l);return xo(),a.jsxs(a.Fragment,{children:[a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(qr,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ho(c.open),...i,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(i0,{titleId:c.titleId}),a.jsx(l0,{contentRef:l,descriptionId:c.descriptionId})]})]})}),Uo="DialogTitle",Ac=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Uo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Ac.displayName=Uo;var Pc="DialogDescription",s0=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Pc,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});s0.displayName=Pc;var Oc="DialogClose",Rc=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Oc,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Rc.displayName=Oc;function Ho(e){return e?"open":"closed"}var Lc="DialogTitleWarning",[Zv,Ic]=Kf(Lc,{contentName:lt,titleName:Uo,docsSlug:"dialog"}),i0=({titleId:e})=>{const t=Ic(Lc),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.358 `)},kx=0,At=[];function Nx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(kx++)[0],s=x.useState(tl)[0],i=x.useRef(e);x.useEffect(function(){i.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(ll),!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!i.current.allowPinchZoom;var v=mn(f),_=r.current,w="deltaX"in f?f.deltaX:_[0]-v[0],j="deltaY"in f?f.deltaY:_[1]-v[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=ol(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=ol(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var P=n.current||C;return jx(P,h,f,P==="h"?w:j)},[]),d=x.useCallback(function(f){var h=f;if(!(!At.length||At[At.length-1]!==s)){var v="deltaY"in h?il(h):mn(h),_=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&Sx(C.delta,v)})[0];if(_&&_.should){h.cancelable&&h.preventDefault();return}if(!_){var w=(i.current.shards||[]).map(ll).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!i.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),c=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=mn(f),n.current=void 0},[]),p=x.useCallback(function(f){c(f.type,il(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){c(f.type,mn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return At.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",d,Tt),document.addEventListener("touchmove",d,Tt),document.addEventListener("touchstart",u,Tt),function(){At=At.filter(function(f){return f!==s}),document.removeEventListener("wheel",d,Tt),document.removeEventListener("touchmove",d,Tt),document.removeEventListener("touchstart",u,Tt)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(s,{styles:Cx(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 Px=nx(el,Nx);var fn=x.forwardRef(function(e,t){return x.createElement(un,Oe({},e,{ref:t,sideCar:Px}))});fn.classNames=un.classNames;var hn="Popover",[cl]=He(hn,[nn]),ur=nn(),[Tx,Ye]=cl(hn),dl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,l=ur(t),d=x.useRef(null),[c,u]=x.useState(!1),[p,m]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:hn});return a.jsx(Gi,{...l,children:a.jsx(Tx,{scope:t,contentId:Ne(),triggerRef:d,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:c,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:i,children:r})})};dl.displayName=hn;var ul="PopoverAnchor",Ax=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(ul,r),s=ur(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(i(),()=>l()),[i,l]),a.jsx(Ro,{...s,...n,ref:t})});Ax.displayName=ul;var pl="PopoverTrigger",ml=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(pl,r),s=ur(r),i=Y(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":bl(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Ro,{asChild:!0,...s,children:l})});ml.displayName=pl;var $o="PopoverPortal",[Ox,Rx]=cl($o,{forceMount:void 0}),fl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=Ye($o,t);return a.jsx(Ox,{scope:t,forceMount:r,children:a.jsx(Ke,{present:r||s.open,children:a.jsx(on,{asChild:!0,container:o,children:n})})})};fl.displayName=$o;var Ot="PopoverContent",hl=x.forwardRef((e,t)=>{const r=Rx(Ot,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=Ye(Ot,e.__scopePopover);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(Ix,{...o,ref:t}):a.jsx(zx,{...o,ref:t})})});hl.displayName=Ot;var Lx=rt("PopoverContent.RemoveScroll"),Ix=x.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=x.useRef(null),o=Y(t,n),s=x.useRef(!1);return x.useEffect(()=>{const i=n.current;if(i)return Io(i)},[]),a.jsx(fn,{as:Lx,allowPinchZoom:!0,children:a.jsx(gl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,d=l.button===0&&l.ctrlKey===!0,c=l.button===2||d;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),zx=x.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(gl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),gl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...p}=e,m=Ye(Ot,r),g=ur(r);return xo(),a.jsx(qr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(Wr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Ki,{"data-state":bl(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)"}})})})}),xl="PopoverClose",Mx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(xl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Mx.displayName=xl;var Dx="PopoverArrow",Fx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=ur(r);return a.jsx(Yi,{...o,...n,ref:t})});Fx.displayName=Dx;function bl(e){return e?"open":"closed"}var $x=dl,Bx=ml,Ux=fl,Hx=hl;function Rt({...e}){return a.jsx($x,{"data-slot":"popover",...e})}function Lt({...e}){return a.jsx(Bx,{"data-slot":"popover-trigger",...e})}function It({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})})}var Vx=Symbol.for("react.lazy"),gn=x[" use ".trim().toString()];function Wx(e){return typeof e=="object"&&e!==null&&"then"in e}function _l(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:s,...i}=n;_l(s)&&typeof gn=="function"&&(s=gn(s._payload));const l=x.Children.toArray(s),d=l.find(Yx);if(d){const c=d.props.children,u=l.map(p=>p===d?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:p);return a.jsx(t,{...i,ref:o,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Gx(e){const t=x.forwardRef((r,n)=>{let{children:o,...s}=r;if(_l(o)&&typeof gn=="function"&&(o=gn(o._payload)),x.isValidElement(o)){const i=Jx(o),l=Xx(s,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,i):i),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],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...l)=>{const d=s(...l);return o(...l),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].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,s)=>{const{asChild:i,...l}=o,d=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),e0="Separator",vl="horizontal",t0=["horizontal","vertical"],yl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=vl,...o}=e,s=r0(n)?n:vl,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(Qx.div,{"data-orientation":s,...l,...o,ref:t})});yl.displayName=e0;function r0(e){return t0.includes(e)}var n0=yl;function xn({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 pr=({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(xn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(xn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(re,{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"})})})]})};var bn="Dialog",[wl]=He(bn),[o0,we]=wl(bn),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,l=x.useRef(null),d=x.useRef(null),[c,u]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:bn});return a.jsx(o0,{scope:t,triggerRef:l,contentRef:d,contentId:Ne(),titleId:Ne(),descriptionId:Ne(),open:c,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:i,children:r})};jl.displayName=bn;var Sl="DialogTrigger",Cl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Sl,r),s=Y(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ho(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)})});Cl.displayName=Sl;var Bo="DialogPortal",[a0,kl]=wl(Bo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=we(Bo,t);return a.jsx(a0,{scope:t,forceMount:r,children:x.Children.map(n,i=>a.jsx(Ke,{present:r||s.open,children:a.jsx(on,{asChild:!0,container:o,children:i})}))})};Nl.displayName=Bo;var _n="DialogOverlay",El=x.forwardRef((e,t)=>{const r=kl(_n,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(_n,e.__scopeDialog);return s.modal?a.jsx(Ke,{present:n||s.open,children:a.jsx(i0,{...o,ref:t})}):null});El.displayName=_n;var s0=rt("DialogOverlay.RemoveScroll"),i0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(_n,r);return a.jsx(fn,{as:s0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Ho(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ct="DialogContent",Pl=x.forwardRef((e,t)=>{const r=kl(ct,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(ct,e.__scopeDialog);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(l0,{...o,ref:t}):a.jsx(c0,{...o,ref:t})})});Pl.displayName=ct;var l0=x.forwardRef((e,t)=>{const r=we(ct,e.__scopeDialog),n=x.useRef(null),o=Y(t,r.contentRef,n);return x.useEffect(()=>{const s=n.current;if(s)return Io(s)},[]),a.jsx(Tl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault())})}),c0=x.forwardRef((e,t)=>{const r=we(ct,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Tl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Tl=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,l=we(ct,r),d=x.useRef(null),c=Y(t,d);return xo(),a.jsxs(a.Fragment,{children:[a.jsx(qr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(Wr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ho(l.open),...i,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(u0,{titleId:l.titleId}),a.jsx(m0,{contentRef:d,descriptionId:l.descriptionId})]})]})}),Uo="DialogTitle",Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Uo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Al.displayName=Uo;var Ol="DialogDescription",d0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});d0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Ho(e){return e?"open":"closed"}var Il="DialogTitleWarning",[l1,zl]=Zf(Il,{contentName:ct,titleName:Uo,docsSlug:"dialog"}),u0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 349 359 350 360 If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 351 361 352 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},c0="DialogDescriptionWarning",l0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ic(c0).contentName}}.`;return g.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},d0=wc,u0=Sc,p0=kc,m0=Nc,f0=Ec,h0=Ac,zc=Rc;function Vo({...e}){return a.jsx(d0,{"data-slot":"dialog",...e})}function Wo({...e}){return a.jsx(u0,{"data-slot":"dialog-trigger",...e})}function g0({...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 x0({className:e,...t}){return a.jsx(m0,{"data-slot":"dialog-overlay",className:D("ecr-dialog__overlay",e),...t})}function qo({className:e,children:t,...r}){return a.jsxs(g0,{children:[a.jsx(x0,{}),a.jsxs(f0,{"data-slot":"dialog-content",className:D("ecr-dialog__content",e),...r,children:[t,a.jsx(zc,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(Gf,{className:"ecr-dialog__close-icon"})})]})]})}function Go({className:e,...t}){return a.jsx("div",{className:D("ecr-dialog__header",e),...t})}function Ko({className:e,...t}){return a.jsx(h0,{"data-slot":"dialog-title",className:D("ecr-dialog__title",e),...t})}function b0({...e}){return a.jsx(zc,{"data-slot":"dialog-close",...e})}const _0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,s]=y.useState([]),[i,c]=y.useState(1),[l,d]=y.useState(!0),[u,p]=y.useState(!1),[m,h]=y.useState(!1),[b,f]=y.useState(""),x=lo(b,500),v=y.useRef(!0),_=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),h(!1),p(!1);return}const O=++_.current;w.current&&w.current.abort();const L=new AbortController;w.current=L,T===1&&v.current?h(!0):p(!0);try{const A={page:T,per_page:50};x&&(A.search=x);const I=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:A,signal:L.signal}),z=I.data,$=parseInt(I.headers["x-wp-totalpages"]||"1",10);O===_.current&&(s(R=>T===1?z:[...R,...z]),c(T+1),d(T<$))}catch(A){if(L.signal.aborted)return;A instanceof Error?C(A.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),O===_.current&&!L.signal.aborted&&(p(!1),h(!1))}},[x,n,r]);y.useEffect(()=>{t&&(c(1),s([]),C(null),v.current=!0,N(1))},[x,N,t]);const k=y.useRef(null),E=y.useCallback(T=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(O=>{O[0].isIntersecting&&l&&N(i)}),T&&k.current.observe(T))},[u,l,i,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:s,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},yn="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",Mc=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:D("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),v0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:s,searchTerm:i,setSearchTerm:c,error:l})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),h=f=>{m(!1),u(x=>x.includes(f.id)?x.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const x=new Set(d),v=[];for(const _ of r)x.has(_.id)&&v.push({btn_type:"product",btn_uuid:mo(),buttonText:_.name,buttonUrl:_.permalink,rating:_.average_rating,price:_.price_html,thumbnail:_.images?.[0]?.thumbnail||_.images?.[0]?.src||yn,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:i,onChange:f=>c(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(Dc,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:l||"No products are available to add."}):r.map((f,x)=>{const v=d.includes(f.id);return a.jsx("div",{ref:r.length===x+1?s:null,className:"ecr-admin-product-link__item",style:d.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(re,{type:"button",onClick:()=>h(f),className:D("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(Hf,{size:20,color:"#2563eb"}):a.jsx(Vf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||yn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Dc,{})]})}),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(Mc,{name:"add",handleClick:b})})]})]})},Dc=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),y0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,w0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[s,i]=y.useState(""),[c,l]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),h=()=>{const b=[];t||b.push("text"),n&&y0.test(n)||b.push("url"),s||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:mo(),buttonText:t,buttonUrl:n,openInNewTab:c,campaignName:s,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(wn,{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(wn,{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(wn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:s,setValue:i}),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:c,onChange:b=>l(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(wn,{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(Mc,{name:"add",handleClick:h})})]})};function wn({error:e,type:t,name:r,label:n,placeholder:o,value:s,setValue:i}){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:s,onChange:c=>i(c.target.value),className:D("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const j0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,s]=y.useState(null),[i,c]=y.useState(!1),l=_0({enabled:i}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(h=>h.btn_type==="product"),m=()=>c(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(bn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Vo,{open:o==="custom",onOpenChange:h=>s(h?"custom":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx($f,{size:20})," Add Custom Link"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(w0,{handleLinks:h=>{e(b=>[...b,h]),s(null)}})})]})]}),u&&a.jsxs(Vo,{open:o==="product",onOpenChange:h=>s(h?"product":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Wf,{size:20})," Tag Products"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(v0,{handleLinks:h=>{e(h),s(null)},taggedProducts:p,products:l.products,isSearching:l.isSearching,isLoading:l.isLoading,lastProductElementRef:l.lastProductElementRef,searchTerm:l.searchTerm,setSearchTerm:l.setSearchTerm,error:l.error})})]})]})]})})]})},S0=({links:e,onLinksChange:t})=>{const r=o=>{t(s=>s.filter(i=>i.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(re,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(qf,{size:16})})]},o.btn_uuid)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(qt,{size:20})]}),a.jsx(It,{className:"ecr-admin-links__popover",children:a.jsx(ir,{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(j0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function Fc(e){return H({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 C0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[s,i]=y.useState(!1);return a.jsx("video",{ref:n,className:D("ecr-admin-reelvideo",s?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:c=>{const l=c.currentTarget,d=l.videoWidth,u=l.videoHeight;i(()=>u>d)}})},k0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:s,dragEnd:i})=>{const[c,l]=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))},h=()=>{p.current&&(p.current.muted=!c,l(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>s(e),onDragEnd:i,className:D("ecr-admin-customization__panel"),children:[a.jsx(Fc,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(C0,{togglePlayPause:m,isMuted:c,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}),c?a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:h}):a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:h})]})]})},N0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),s=l=>{n.current=l},i=l=>{o.current=l},c=()=>{if(n.current===null||o.current===null)return;const l=[...e],d=l[n.current];l.splice(n.current,1),l.splice(o.current,0,d),n.current=null,o.current=null,r(l)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((l,d)=>a.jsx(k0,{setIsAttemptingDelete:t,file:l,file_uuid:l.file_uuid,index:d,dragStart:s,dragEnter:i,dragEnd:c},d)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:ei,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(qt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(It,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ir,{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!"]})})})]})]})},E0=({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(Fc,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(ti,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),T0=()=>{const e=Se(),[t]=Vt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,s]=y.useState({files:[],title:"",links:[],thumbnail:null}),[i,c]=y.useState(!1),[l,d]=y.useState(null),u=y.useCallback(x=>{s(v=>({...v,title:typeof x=="function"?x(v.title):x}))},[]),p=y.useCallback(x=>{s(v=>({...v,files:typeof x=="function"?x(v.files):x}))},[]),m=y.useCallback(x=>{s(v=>({...v,links:typeof x=="function"?x(v.links):x}))},[]),h=y.useCallback(x=>{s(v=>({...v,thumbnail:typeof x=="function"?x(v.thumbnail):x}))},[]),b=()=>{l&&(p(x=>x.filter(v=>v.file_uuid!==l)),d(null))},f=y.useCallback(async x=>{try{c(!0);const v=await ue.get(`story/${x}`);s({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{c(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),i?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(Cf,{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"}),l&&a.jsx(Or,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(N0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(ti,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(E0,{thumbnail:o.thumbnail,onThumbnailChange:h}),a.jsx(bn,{className:"ecr-admin-create__separator"}),a.jsx(S0,{links:o.links,onLinksChange:m})]})]})]})},$c=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(Hp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Yo,Bc;function A0(){return Bc||(Bc=1,Yo=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()}}),Yo}var Xo,Uc;function P0(){if(Uc)return Xo;Uc=1;var e=A0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(s){var i=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,i)}function o(s,i){var c,l,d,u,p,m,h=!1;i||(i={}),c=i.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=s,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(),i.format)if(f.preventDefault(),typeof f.clipboardData>"u"){c&&console.warn("unable to use e.clipboardData"),c&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=t[i.format]||t.default;window.clipboardData.setData(x,s)}else f.clipboardData.clearData(),f.clipboardData.setData(i.format,s);i.onCopy&&(f.preventDefault(),i.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");h=!0}catch(f){c&&console.error("unable to copy using execCommand: ",f),c&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(i.format||"text",s),i.onCopy&&i.onCopy(window.clipboardData),h=!0}catch(x){c&&console.error("unable to copy using clipboardData: ",x),c&&console.error("falling back to prompt"),l=n("message"in i?i.message:r),window.prompt(l,s)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return h}return Xo=o,Xo}var O0=P0();const Hc=jd(O0);function Vc({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:D("ecr-table",e),...t})})}function Wc({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:D("ecr-table__header",e),...t})}function qc({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:D("ecr-table__body",e),...t})}function jn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:D("ecr-table__row",e),...t})}function Gc({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:D("ecr-table__head",e),...t})}function Re({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:D("ecr-table__cell",e),...t})}function Kc({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:D("ecr-table__caption",e),...t})}const R0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],L0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),s=(i,c)=>{Hc(i),n(c),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Vc,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Kc,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(nt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(Wc,{children:a.jsx(jn,{children:R0.map((i,c)=>a.jsx(Gc,{className:"ecr-admin-groups__head",style:{width:i?.width||"auto",textAlign:i?.align},children:i.label},c))})}),a.jsx(qc,{children:e.map((i,c)=>a.jsxs(jn,{className:D("ecr-admin-groups__row",c%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:c+1}),a.jsx(Re,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:i.group_name})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${i.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>s(`[reelswp-group id='${i.id}']`,c),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(tp,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:D("ecr-admin-groups__copy-tooltip",r===c&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(re,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.stat}&group=${i.id}&name=${i.group_name}`,children:a.jsx(ls,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.mg}&gid=${i.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Delete Group",onClick:()=>t(i.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(Up,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},i.id??c))})]}):null]})},Yc=()=>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))})]}),I0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,s]=y.useState(!1),[i,c]=y.useState(!1),[l,d]=y.useState(!1),[u,p]=y.useState(""),[m,h]=y.useState(1),[b]=y.useState(20),[f,x]=y.useState(0),[v,_]=y.useState(1),w=lo(u,500),j=y.useCallback(async E=>{const T=new AbortController,O=E===1;try{O?s(!0):c(!0),n("");const L=await ue.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),A=Number(L.headers?.["x-wp-total"]??0),I=Number(L.headers?.["x-wp-totalpages"]??1),z=Math.max(1,I||1);t($=>{if(O)return L.data;const R=new Set($.map(P=>P.id)),U=L.data.filter(P=>!R.has(P.id));return[...$,...U]}),x(A),_(z),E>z&&h(z)}catch(L){if(T.signal.aborted)return;L instanceof Error?n(L.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(O?s(!1):c(!1))}},[b,w]),C=y.useCallback(()=>{h(E=>o||i||E>=v?E:E+1)},[o,i,v]),N=y.useCallback(async()=>{if(m!==1){h(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{d(!0),await ue.delete(`group/${E}`),await N(),G.success("Group deleted successfully!")}catch(T){T instanceof Error?G.error(T.message):G.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:i,isDeleting:l,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:k}},z0={docs:"https://reelswp.com/docs/"},M0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:s,isDeleting:i,deleteGroup:c,hasMore:l,loadMore:d,searchTerm:u,setSearchTerm:p}=I0(),m=y.useRef(null),h=async()=>{e&&(await c(e),t(null))};return y.useEffect(()=>{if(!m.current||!l)return;const b=new IntersectionObserver(f=>{const[x]=f;x.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[l,d]),a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:"All Widgets",Icon:Vp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsxs("a",{href:z0.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Df,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Rr,{to:`?view=${K.cr}`,text:"Add Reel",Icon:gt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:h,onReject:()=>t(null),isLoading:i}),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(re,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(Yt,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ts,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${K.mg}`,text:"Create Widget",Icon:gt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Yc,{}):n?a.jsx($c,{}):a.jsxs(a.Fragment,{children:[a.jsx(L0,{tableData:r,setIsAttemptingDelete:t}),l&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:s?a.jsx(Bf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},D0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,s]=y.useState(!1),[i,c]=y.useState(!1),[l,d]=y.useState(!1),u=y.useCallback((m,h)=>{t(!0),n(b=>({...b,[m]:h}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),h=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(h)){G.error("Please enter valid numbers.");return}try{c(!0),d(!1),await ue.post("settings",{rate_limit:m,time_limit:h}),G.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{c(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{s(!0),d(!1);const b=await ue.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?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||s(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:i,isError:l,handleOnChange:u,handleSave:p}},F0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:s,handleSave:i}=D0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(_t,{left:[a.jsx(vt,{name:"Settings",Icon:xp},"Settings"),a.jsx(Xt,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(uo,{onSave:i,isSaving:n,disabled:!t},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.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:c=>s("rateLimit",c.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:c=>s("timeLimit",c.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},$0=[{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"}],B0=({tableData:e})=>a.jsxs(Vc,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Kc,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(Wc,{children:a.jsx(jn,{children:$0.map((t,r)=>a.jsx(Gc,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(qc,{children:e.map((t,r)=>a.jsxs(jn,{className:D("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Re,{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(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),U0=()=>{const[e]=Vt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[s,i]=y.useState([]),[c,l]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{l(!0);const h=await ue.get(`/group/${t}/stats`);o(h.data.stories),i(h.data.buttons)}catch(h){h instanceof Error?G.error(h.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{l(!1)}})()},[t]);const p=n.length>0?n.reduce((m,h)=>m+=h.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:"Statistics",Icon:ls},"Statistics"),a.jsx(Xt,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.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]}),c?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:c?a.jsx(Yc,{}):d?a.jsx($c,{}):s.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(B0,{tableData:s})})]})]})};function H0(e){return H({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 V0(e){return H({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 W0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:D("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(H0,{size:24})}),q0=({...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"})]})}),Xc=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:D("ecr-input",e),...r}));Xc.displayName="Input";const cr=({label:e,min:t,max:r,value:n,onChange:o,name:s,id:i,wrapperStyles:c,hideSlider:l})=>{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)},h=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:c,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:i,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!l&&a.jsx("input",{type:"range",id:i,name:s,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(Xc,{type:"number",min:t,max:r,value:d,onChange:b=>h(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function M(){return M=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},M.apply(null,arguments)}function De(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 zt=255,Xe=100,lr=e=>{var{r:t,g:r,b:n,a:o}=e,s=Math.max(t,r,n),i=s-Math.min(t,r,n),c=i?s===t?(r-n)/i:s===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(c<0?c+6:c),s:s?i/s*Xe:0,v:s/zt*Xe,a:o}},Jc=e=>{var{h:t,s:r,l:n,a:o}=Zc(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zc=e=>{var{h:t,s:r,v:n,a:o}=e,s=(200-r)*n/Xe;return{h:t,s:s>0&&s<200?r*n/Xe/(s<=Xe?s:200-s)*Xe:0,l:s/2,a:o}},Qc=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(s=>new Array(7-s.length).join("0")+s)(o.toString(16))},G0=e=>{var{r:t,g:r,b:n,a:o}=e,s=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Qc({r:t,g:r,b:n})+(s||"")},dr=e=>lr(K0(e)),K0=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,s=0,i]=e.match(r).map(c=>parseInt(c,16));return{r:n,g:o,b:s,a:(i??255)/zt}},Sn=e=>{var{h:t,s:r,v:n,a:o}=e,s=t/60,i=r/Xe,c=n/Xe,l=Math.floor(s)%6,d=s-Math.floor(s),u=zt*c*(1-i),p=zt*c*(1-i*d),m=zt*c*(1-i*(1-d));c*=zt;var h={};switch(l){case 0:h.r=c,h.g=m,h.b=u;break;case 1:h.r=p,h.g=c,h.b=u;break;case 2:h.r=u,h.g=c,h.b=m;break;case 3:h.r=u,h.g=p,h.b=c;break;case 4:h.r=m,h.g=u,h.b=c;break;case 5:h.r=c,h.g=u,h.b=p;break}return h.r=Math.round(h.r),h.g=Math.round(h.g),h.b=Math.round(h.b),M({},h,{a:o})},Y0=e=>{var{r:t,g:r,b:n,a:o}=Sn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},X0=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},J0=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Jo=e=>Qc(Sn(e)),Z0=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},Q0=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)},s=o(t/255),i=o(r/255),c=o(n/255),l={};return l.x=s*.4124+i*.3576+c*.1805,l.y=s*.2126+i*.7152+c*.0722,l.bri=s*.0193+i*.1192+c*.9505,l},Mt=e=>{var t,r,n,o,s,i,c,l,d;return typeof e=="string"&&Zo(e)?(i=dr(e),l=e):typeof e!="string"&&(i=e),i&&(n=Z0(i),s=Zc(i),o=Sn(i),d=G0(o),l=Jo(i),r=J0(s),t=X0(o),c=Q0(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:s,hsva:i,hex:l,hexa:d,xy:c}},Zo=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function el(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var ur=e=>"touches"in e,tl=e=>{!ur(e)&&e.preventDefault&&e.preventDefault()},rl=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nl=(e,t)=>{var r=e.getBoundingClientRect(),n=ur(t)?t.touches[0]:t;return{left:rl((n.pageX-(r.left+window.pageXOffset))/r.width),top:rl((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)}},eb=["prefixCls","className","onMove","onDown"],Qo=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:s}=e,i=De(e,eb),c=y.useRef(null),l=y.useRef(!1),[d,u]=y.useState(!1),p=el(o),m=el(s),h=_=>l.current&&!ur(_)?!1:(l.current=ur(_),!0),b=y.useCallback(_=>{if(tl(_),!!c.current){var w=ur(_)?_.touches.length>0:_.buttons>0;if(!w){u(!1);return}p?.(nl(c.current,_),_)}},[p]),f=y.useCallback(()=>u(!1),[]),x=y.useCallback(_=>{_?(window.addEventListener(l.current?"touchmove":"mousemove",b),window.addEventListener(l.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(x(d),()=>{x(!1)}),[d,b,f,x]);var v=y.useCallback(_=>{var w=document.activeElement;w?.blur(),tl(_.nativeEvent),h(_.nativeEvent)&&c.current&&(m?.(nl(c.current,_.nativeEvent),_.nativeEvent),u(!0))},[m]);return a.jsx("div",M({},i,{className:[r,n||""].filter(Boolean).join(" "),style:M({},i.style,{touchAction:"none"}),ref:c,tabIndex:0,onMouseDown:v,onTouchStart:v}))});Qo.displayName="Interactive";var tb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:s}=e,i={position:"absolute",top:o,left:n},c={"--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:s+"-pointer "+(t||""),style:i,children:a.jsx("div",{className:s+"-fill",style:c})}),[o,n,r,t,s])},rb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],ol=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:s,className:i,hue:c=0,style:l,hsva:d,onChange:u}=e,p=De(e,rb),m=M({width:200,height:200,borderRadius:o},l,{position:"relative"}),h=(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,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,d.s-_),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+_),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+_),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-_),C=!0,v.preventDefault();break;default:return}C&&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:Jc(d)};return s&&typeof s=="function"?s(M({prefixCls:n},v)):a.jsx(tb,M({prefixCls:n},v))},[d,s,n]),x=y.useCallback(v=>{v.target.focus()},[]);return a.jsx(Qo,M({className:[n,i||""].filter(Boolean).join(" ")},p,{style:M({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:c)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:h,onDown:h,onKeyDown:b,onClick:x,children:f}))});ol.displayName="Saturation";var nb=["className","prefixCls","left","top","style","fillProps"],ob=e=>{var{className:t,prefixCls:r,left:n,top:o,style:s,fillProps:i}=e,c=De(e,nb),l=M({},s,{position:"absolute",left:n,top:o}),d=M({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},i?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",M({className:r+"-pointer "+(t||""),style:l},c,{children:a.jsx("div",M({className:r+"-fill"},i,{style:d}))}))},ab=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],sb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Cn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:s,bgProps:i={},innerProps:c={},pointerProps:l={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:h,onChange:b,pointer:f}=e,x=De(e,ab),v=T=>{b&&b(M({},o,{a:m==="horizontal"?T.left:T.top}),T)},_=Jc(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 C=M({"--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("+sb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},h,{position:"relative"}),N=y.useCallback(T=>{var O=.01,L=o.a,A=L;switch(T.key){case"ArrowLeft":m==="horizontal"&&(A=Math.max(0,L-O),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(A=Math.min(1,L+O),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(A=Math.max(0,L-O),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(A=Math.min(1,L+O),T.preventDefault());break;default:return}if(A!==L){var I={left:m==="horizontal"?A:o.a,top:m==="vertical"?A:o.a,width:0,height:0,x:0,y:0};b&&b(M({},o,{a:A}),I)}},[o,m,b]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(M({prefixCls:r},l,j)):a.jsx(ob,M({},l,{prefixCls:r},j));return a.jsxs("div",M({},x,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",M({},i,{style:M({inset:0,position:"absolute",background:s||w,borderRadius:d},i.style)})),a.jsx(Qo,M({},c,{style:M({},c.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:k,onKeyDown:N,children:E}))]}))});Cn.displayName="Alpha";var ib=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],cb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),lb=e=>Number(String(e).replace(/%/g,"")),Dt=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:s,className:i,style:c,labelStyle:l,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,h=De(e,ib),[b,f]=y.useState(s),x=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(x.current||f(e.value))},[e.value]);function v(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");cb(T)&&u&&u(k,T);var O=lb(T);isNaN(O)||u&&u(k,O),f(T)}function _(k){x.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=M({"--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,c),C=M({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=M({value:b,onChange:v,onBlur:_,autoComplete:"off",onFocus:()=>x.current=!0},h,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,i||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",M({ref:t},N)),o&&a.jsx("span",{style:M({color:"var(--editable-input-label-color)",textTransform:"capitalize"},l),children:o})]})});Dt.displayName="EditableInput";var db=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],al=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:s={},gProps:i={},bProps:c={},aProps:l={},className:d,style:u,onChange:p}=e,m=De(e,db),h=n?Sn(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")},x=(_,w,j)=>{typeof _=="number"&&(w==="a"&&(_<0&&(_=0),_>100&&(_=100),p&&p(Mt(lr(M({},h,{a:_/100}))))),_>255&&(_=255,j.target.value="255"),_<0&&(_=0,j.target.value="0"),w==="r"&&p&&p(Mt(lr(M({},h,{r:_})))),w==="g"&&p&&p(Mt(lr(M({},h,{g:_})))),w==="b"&&p&&p(Mt(lr(M({},h,{b:_})))))},v=h.a?Math.round(h.a*100)/100:0;return a.jsxs("div",M({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:M({fontSize:11,display:"flex"},u),children:[a.jsx(Dt,M({label:"R",value:h.r||0,onBlur:b,placement:o,onChange:(_,w)=>x(w,"r",_)},s,{style:M({},s.style)})),a.jsx(Dt,M({label:"G",value:h.g||0,onBlur:b,placement:o,onChange:(_,w)=>x(w,"g",_)},i,{style:M({marginLeft:5},s.style)})),a.jsx(Dt,M({label:"B",value:h.b||0,onBlur:b,placement:o,onChange:(_,w)=>x(w,"b",_)},c,{style:M({marginLeft:5},c.style)})),l&&a.jsx(Dt,M({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(_,w)=>x(w,"a",_)},l,{style:M({marginLeft:5},l.style)}))]}))});al.displayName="EditableInputRGBA";var ub=["prefixCls","className","hue","onChange","direction"],sl=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:s,direction:i="horizontal"}=e,c=De(e,ub);return a.jsx(Cn,M({ref:t,className:r+" "+(n||"")},c,{direction:i,background:"linear-gradient(to "+(i==="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:(l,d)=>{s&&s({h:i==="horizontal"?360*d.left:360*d.top})}}))});sl.displayName="Hue";var pb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],il=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:s=[],style:i,rectProps:c={},onChange:l,addonAfter:d,addonBefore:u,rectRender:p}=e,m=De(e,pb),h=M({"--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},c.style),b=(f,x)=>{l&&l(dr(f),Mt(dr(f)),x)};return a.jsxs("div",M({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:M({display:"flex",flexWrap:"wrap",position:"relative"},i),children:[u&&y.isValidElement(u)&&u,s&&Array.isArray(s)&&s.map((f,x)=>{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:M({},h,{background:_}),onClick:N=>b(_,N)});if(j)return a.jsx(y.Fragment,{children:j},x);var C=c.children&&y.isValidElement(c.children)?y.cloneElement(c.children,{color:_,checked:w}):null;return a.jsx("div",M({tabIndex:0,title:v,onClick:N=>b(_,N)},c,{children:C,style:M({},h,{background:_})}),x)}),d&&y.isValidElement(d)&&d]}))});il.displayName="Swatch";var mb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],fb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],cl=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"}}),ll=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:s=218,presetColors:i=fb,color:c,editableDisable:l=!0,disableAlpha:d=!1,style:u}=e,p=De(e,mb),[m,h]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof c=="string"&&Zo(c)&&h(dr(c)),typeof c=="object"&&h(c)},[c]);var b=N=>{h(N),o&&o(Mt(N))},f=(N,k)=>{typeof N=="string"&&Zo(N)&&/(3|6)/.test(String(N.length))&&b(dr(N))},x=N=>b(M({},m,{a:N.a})),v=N=>b(M({},m,N,{a:m.a})),_=M({"--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:s},u),w={borderRadius:2,background:Y0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",M({},p,{className:r+" "+(n||""),ref:t,style:_,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(ol,{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(sl,{width:"auto",height:10,hue:m.h,pointer:cl,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(M({},m,N))}),!d&&a.jsx(Cn,{width:"auto",height:10,hsva:m,pointer:cl,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:x})]}),!d&&a.jsx(Cn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),l&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Dt,{label:"Hex",value:Jo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(al,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),i&&i.length>0&&a.jsx(il,{style:j,colors:i,color:Jo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});ll.displayName="Sketch";const dl=({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(Rt,{children:[a.jsx(Lt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(It,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(ll,{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)})]})]}),hb=[{value:"left",title:"Align Left",Icon:Lp},{value:"center",title:"Align Center",Icon:Ip},{value:"right",title:"Align Right",Icon:zp},{value:"hidden",title:"Hidden",Icon:Mp}],gb=({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:hb.map(({value:r,title:n,Icon:o})=>a.jsx(re,{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))})]}),xb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(s=>{const i=o(s);return r(!0),i})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(gb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,alignment:o}}))}),a.jsx(dl,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(cr,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},bb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(s=>{Hc(s),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},_b=({gid:e})=>{const[t,r]=bb(),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(Mf,{color:"#ffffff",size:12})}),a.jsx("span",{className:D("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},ul=y.createContext({requestLeave:e=>e()}),vb=({value:e,children:t})=>a.jsx(ul.Provider,{value:e,children:t}),pl=()=>y.useContext(ul);function yb(e){return H({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 wb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(jb,{link:e,usedFor:t})}),jb=({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||yn,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||yn,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(yb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Sb=({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})})},kn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(wb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Sb,{link:e,usedFor:t},e.btn_uuid)}),Nn=({title:e})=>a.jsx("p",{className:"ecr-reel_title",children:e}),ml=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const s=Se(),{requestLeave:i}=pl(),c=n===e.story_uuid,l=`?view=${K.cr}&from=${K.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={width:`${t?.size}px`,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=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:D("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Jn,{story:e,styles:t}),d==="overlay"&&t.shape==="rectangle"?p?a.jsx(kn,{link:p,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Nn,{title:e.title}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(re,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:c,children:a.jsx(ht,{to:l,className:D("ecr-admin-reelitem__link",c?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:m=>{m.preventDefault(),i(()=>s(l))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(re,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:c,children:c?a.jsx(tt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(ds,{size:18})})]})]}),d==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel__title",children:e.title}):null]})},fl=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[s,i]=y.useState(!1),[c,l]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),h=()=>{const f=r.current;if(!f)return;const x=f.scrollLeft,v=f.scrollWidth,_=f.clientWidth;l(x>0),u(x+_<v-1)};y.useEffect(()=>{const f=r.current,x=n.current;f&&x&&(i(x.scrollWidth>f.clientWidth),m(f.clientWidth-100),h())},[e,t]);const b=f=>{const x=r.current;x&&(x.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(h,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let x=!1,v,_;const w=O=>{x=!0,v=O.pageX-f.offsetLeft,_=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{x=!1,f.style.cursor="default"},C=()=>{x=!1,f.style.cursor="default"},N=O=>{if(!x)return;O.preventDefault();const A=(O.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-A,h()},k=O=>{x=!0,v=O.touches[0].pageX-f.offsetLeft,_=f.scrollLeft},E=()=>{x=!1},T=O=>{if(!x)return;const A=(O.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-A,h()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:s,canScrollLeft:c,canScrollRight:d,scrollBy:b,scrollStep:p}},hl=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:c,canScrollLeft:l,canScrollRight:d,scrollBy:u,scrollStep:p}=fl([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:s,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:i,style:{...!e.length&&{margin:"auto"},gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:D("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(ml,{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(nt,{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."})]})})})}),c&&l&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Gt,{size:20})}),c&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Kt,{size:20})})]})},Cb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const s={columnGap:`${t?.gap}px`};return a.jsx("div",{style:s,className:D("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(ml,{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(nt,{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."})]})})})},kb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,s]=y.useState(!1),[i,c]=y.useState(!0),[l,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=i)},[i]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&s(f=>!f)},m=()=>{u.current&&c(f=>!f)},h=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(xt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Gt,{size:24})}),a.jsx(xt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Kt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:l?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(Yt,{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:l?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:i,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const x=f.currentTarget,v=x.videoWidth,_=x.videoHeight;d(()=>_>v)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}),i?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),h==="overlay"&&b?a.jsx(kn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,h==="title"?a.jsx(Nn,{title:e.title}):null]})})},Nb={carousel:hl,grid:Cb},Eb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:s})=>{const i=r.template??"carousel",c=Nb[i]||hl;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(_b,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:s==="thumbnail"?a.jsx(c,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(kb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(nt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gl=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Tb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:s,togglingId:i,lastStoryElementRef:c})=>{const l=Se(),{requestLeave:d}=pl(),u=`?view=${K.cr}&from=${K.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(Rr,{to:u,text:"Add Reel",Icon:gt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>l(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:s&&t.length===0?a.jsx(gl,{}):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,h)=>a.jsx("div",{ref:p.length===h+1?c:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:i==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}`}),i==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(tt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),s&&t.length>0&&a.jsx(gl,{})]})})]})]})};function xl(e){const t=e+"CollectionProvider",[r,n]=He(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=f=>{const{scope:x,children:v}=f,_=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:w,collectionRef:_,children:v})};i.displayName=t;const c=e+"CollectionSlot",l=rt(c),d=y.forwardRef((f,x)=>{const{scope:v,children:_}=f,w=s(c,v),j=Y(x,w.collectionRef);return a.jsx(l,{ref:j,children:_})});d.displayName=c;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=rt(u),h=y.forwardRef((f,x)=>{const{scope:v,children:_,...w}=f,j=y.useRef(null),C=Y(x,j),N=s(u,v);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:_})});h.displayName=u;function b(f){const x=s(e+"CollectionConsumer",f);return y.useCallback(()=>{const _=x.collectionRef.current;if(!_)return[];const w=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:d,ItemSlot:h},b,n]}var Ab=g.createContext(void 0);function ea(e){const t=g.useContext(Ab);return e||t||"ltr"}var ta="rovingFocusGroup.onEntryFocus",Pb={bubbles:!1,cancelable:!0},pr="RovingFocusGroup",[ra,bl,Ob]=xl(pr),[Rb,_l]=He(pr,[Ob]),[Lb,Ib]=Rb(pr),vl=g.forwardRef((e,t)=>a.jsx(ra.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(ra.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(zb,{...e,ref:t})})}));vl.displayName=pr;var zb=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=g.useRef(null),h=Y(t,m),b=ea(s),[f,x]=ct({prop:i,defaultProp:c??null,onChange:l,caller:pr}),[v,_]=g.useState(!1),w=Ve(d),j=bl(r),C=g.useRef(!1),[N,k]=g.useState(0);return g.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ta,w),()=>E.removeEventListener(ta,w)},[w]),a.jsx(Lb,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:g.useCallback(E=>x(E),[x]),onItemShiftTab:g.useCallback(()=>_(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:g.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:v||N===0?-1:0,"data-orientation":n,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!v){const O=new CustomEvent(ta,Pb);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const L=j().filter(R=>R.focusable),A=L.find(R=>R.active),I=L.find(R=>R.id===f),$=[A,I,...L].filter(Boolean).map(R=>R.ref.current);jl($,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>_(!1))})})}),yl="RovingFocusGroupItem",wl=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...c}=e,l=Ne(),d=s||l,u=Ib(yl,r),p=u.currentTabStopId===d,m=bl(r),{onFocusableItemAdd:h,onFocusableItemRemove:b,currentTabStopId:f}=u;return g.useEffect(()=>{if(n)return h(),()=>b()},[n,h,b]),a.jsx(ra.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...c,ref:t,onMouseDown:V(e.onMouseDown,x=>{n?u.onItemFocus(d):x.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=Fb(x,u.orientation,u.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.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(x.currentTarget);w=u.loop?$b(w,j+1):w.slice(j+1)}setTimeout(()=>jl(w))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:f!=null}):i})})});wl.displayName=yl;var Mb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Db(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Fb(e,t,r){const n=Db(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Mb[n]}function jl(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function $b(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Bb=vl,Ub=wl,En="Tabs",[Hb]=He(En,[_l]),Sl=_l(),[Vb,na]=Hb(En),Cl=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:c,activationMode:l="automatic",...d}=e,u=ea(c),[p,m]=ct({prop:n,onChange:o,defaultProp:s??"",caller:En});return a.jsx(Vb,{scope:r,baseId:Ne(),value:p,onValueChange:m,orientation:i,dir:u,activationMode:l,children:a.jsx(W.div,{dir:u,"data-orientation":i,...d,ref:t})})});Cl.displayName=En;var kl="TabsList",Nl=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,s=na(kl,r),i=Sl(r);return a.jsx(Bb,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Nl.displayName=kl;var El="TabsTrigger",Tl=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...s}=e,i=na(El,r),c=Sl(r),l=Ol(i.baseId,n),d=Rl(i.baseId,n),u=n===i.value;return a.jsx(Ub,{asChild:!0,...c,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:l,...s,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=i.activationMode!=="manual";!u&&!o&&p&&i.onValueChange(n)})})})});Tl.displayName=El;var Al="TabsContent",Pl=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:s,...i}=e,c=na(Al,r),l=Ol(c.baseId,n),d=Rl(c.baseId,n),u=n===c.value,p=g.useRef(u);return g.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ke,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&s})})});Pl.displayName=Al;function Ol(e,t){return`${e}-trigger-${t}`}function Rl(e,t){return`${e}-content-${t}`}var Wb=Cl,qb=Nl,Gb=Tl,Kb=Pl;function Yb({className:e,...t}){return a.jsx(Wb,{"data-slot":"tabs",className:D("ecr-tabs",e),...t})}function Xb({className:e,...t}){return a.jsx(qb,{"data-slot":"tabs-list",className:D("ecr-tabs__list",e),...t})}function Ll({className:e,...t}){return a.jsx(Gb,{"data-slot":"tabs-trigger",className:D("ecr-tabs__trigger",e),...t})}function Il({className:e,...t}){return a.jsx(Kb,{"data-slot":"tabs-content",className:D("ecr-tabs__content",e),...t})}function zl(e,[t,r]){return Math.min(r,Math.max(t,e))}function Jb(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ml=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"}),Zb="VisuallyHidden",Qb=g.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Ml,...e.style}}));Qb.displayName=Zb;var e_=[" ","Enter","ArrowUp","ArrowDown"],t_=[" ","Enter"],dt="Select",[Tn,An,r_]=xl(dt),[Ft]=He(dt,[r_,on]),Pn=on(),[n_,Je]=Ft(dt),[o_,a_]=Ft(dt),Dl=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:i,defaultValue:c,onValueChange:l,dir:d,name:u,autoComplete:p,disabled:m,required:h,form:b}=e,f=Pn(t),[x,v]=g.useState(null),[_,w]=g.useState(null),[j,C]=g.useState(!1),N=ea(d),[k,E]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:dt}),[T,O]=ct({prop:i,defaultProp:c,onChange:l,caller:dt}),L=g.useRef(null),A=x?b||!!x.closest("form"):!0,[I,z]=g.useState(new Set),$=Array.from(I).map(R=>R.props.value).join(";");return a.jsx(qi,{...f,children:a.jsxs(n_,{required:h,scope:t,trigger:x,onTriggerChange:v,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ne(),value:T,onValueChange:O,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:L,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(o_,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(R=>{z(U=>new Set(U).add(R))},[]),onNativeOptionRemove:g.useCallback(R=>{z(U=>{const P=new Set(U);return P.delete(R),P})},[]),children:r})}),A?a.jsxs(sd,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:R=>O(R.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(I)]},$):null]})})};Dl.displayName=dt;var Fl="SelectTrigger",$l=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=Pn(r),i=Je(Fl,r),c=i.disabled||n,l=Y(t,i.onTriggerChange),d=An(r),u=g.useRef("touch"),[p,m,h]=cd(f=>{const x=d().filter(w=>!w.disabled),v=x.find(w=>w.value===i.value),_=ld(x,f,v);_!==void 0&&i.onValueChange(_.value)}),b=f=>{c||(i.onOpenChange(!0),h()),f&&(i.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Ro,{asChild:!0,...s,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":id(i.value)?"":void 0,...o,ref:l,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const x=f.target;x.hasPointerCapture(f.pointerId)&&x.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const x=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(x&&f.key===" ")&&e_.includes(f.key)&&(b(),f.preventDefault())})})})});$l.displayName=Fl;var Bl="SelectValue",Ul=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:s,placeholder:i="",...c}=e,l=Je(Bl,r),{onValueNodeHasChildrenChange:d}=l,u=s!==void 0,p=Y(t,l.onValueNodeChange);return se(()=>{d(u)},[d,u]),a.jsx(W.span,{...c,ref:p,style:{pointerEvents:"none"},children:id(l.value)?a.jsx(a.Fragment,{children:i}):s})});Ul.displayName=Bl;var s_="SelectIcon",Hl=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hl.displayName=s_;var i_="SelectPortal",Vl=e=>a.jsx(an,{asChild:!0,...e});Vl.displayName=i_;var ut="SelectContent",Wl=g.forwardRef((e,t)=>{const r=Je(ut,e.__scopeSelect),[n,o]=g.useState();if(se(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?_r.createPortal(a.jsx(ql,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(Gl,{...e,ref:t})});Wl.displayName=ut;var je=10,[ql,Ze]=Ft(ut),c_="SelectContentImpl",l_=rt("SelectContent.RemoveScroll"),Gl=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:c,sideOffset:l,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:b,hideWhenDetached:f,avoidCollisions:x,...v}=e,_=Je(ut,r),[w,j]=g.useState(null),[C,N]=g.useState(null),k=Y(t,F=>j(F)),[E,T]=g.useState(null),[O,L]=g.useState(null),A=An(r),[I,z]=g.useState(!1),$=g.useRef(!1);g.useEffect(()=>{if(w)return Io(w)},[w]),xo();const R=g.useCallback(F=>{const[te,...ce]=A().map(ne=>ne.ref.current),[J]=ce.slice(-1),Q=document.activeElement;for(const ne of F)if(ne===Q||(ne?.scrollIntoView({block:"nearest"}),ne===te&&C&&(C.scrollTop=0),ne===J&&C&&(C.scrollTop=C.scrollHeight),ne?.focus(),document.activeElement!==Q))return},[A,C]),U=g.useCallback(()=>R([E,w]),[R,E,w]);g.useEffect(()=>{I&&U()},[I,U]);const{onOpenChange:P,triggerPointerDownPosRef:q}=_;g.useEffect(()=>{if(w){let F={x:0,y:0};const te=J=>{F={x:Math.abs(Math.round(J.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(J.pageY)-(q.current?.y??0))}},ce=J=>{F.x<=10&&F.y<=10?J.preventDefault():w.contains(J.target)||P(!1),document.removeEventListener("pointermove",te),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",ce,{capture:!0})}}},[w,P,q]),g.useEffect(()=>{const F=()=>P(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[P]);const[X,Z]=cd(F=>{const te=A().filter(Q=>!Q.disabled),ce=te.find(Q=>Q.ref.current===document.activeElement),J=ld(te,F,ce);J&&setTimeout(()=>J.ref.current.focus())}),me=g.useCallback((F,te,ce)=>{const J=!$.current&&!ce;(_.value!==void 0&&_.value===te||J)&&(T(F),J&&($.current=!0))},[_.value]),Fe=g.useCallback(()=>w?.focus(),[w]),ge=g.useCallback((F,te,ce)=>{const J=!$.current&&!ce;(_.value!==void 0&&_.value===te||J)&&L(F)},[_.value]),$e=n==="popper"?oa:Kl,pt=$e===oa?{side:c,sideOffset:l,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:b,hideWhenDetached:f,avoidCollisions:x}:{};return a.jsx(ql,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:me,selectedItem:E,onItemLeave:Fe,itemTextRefCallback:ge,focusSelectedItem:U,selectedItemText:O,position:n,isPositioned:I,searchRef:X,children:a.jsx(hn,{as:l_,allowPinchZoom:!0,children:a.jsx(Gr,{asChild:!0,trapped:_.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:V(o,F=>{_.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:a.jsx($e,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:F=>F.preventDefault(),...v,...pt,onPlaced:()=>z(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:V(v.onKeyDown,F=>{const te=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!te&&F.key.length===1&&Z(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let J=A().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(F.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const Q=F.target,ne=J.indexOf(Q);J=J.slice(ne+1)}setTimeout(()=>R(J)),F.preventDefault()}})})})})})})});Gl.displayName=c_;var d_="SelectItemAlignedPosition",Kl=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=Je(ut,r),i=Ze(ut,r),[c,l]=g.useState(null),[d,u]=g.useState(null),p=Y(t,k=>u(k)),m=An(r),h=g.useRef(!1),b=g.useRef(!0),{viewport:f,selectedItem:x,selectedItemText:v,focusSelectedItem:_}=i,w=g.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&f&&x&&v){const k=s.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),O=v.getBoundingClientRect();if(s.dir!=="rtl"){const Q=O.left-E.left,ne=T.left-Q,xe=k.left-ne,mt=k.width+xe,fa=Math.max(mt,E.width),ha=window.innerWidth-je,ga=zl(ne,[je,Math.max(je,ha-fa)]);c.style.minWidth=mt+"px",c.style.left=ga+"px"}else{const Q=E.right-O.right,ne=window.innerWidth-T.right-Q,xe=window.innerWidth-k.right-ne,mt=k.width+xe,fa=Math.max(mt,E.width),ha=window.innerWidth-je,ga=zl(ne,[je,Math.max(je,ha-fa)]);c.style.minWidth=mt+"px",c.style.right=ga+"px"}const L=m(),A=window.innerHeight-je*2,I=f.scrollHeight,z=window.getComputedStyle(d),$=parseInt(z.borderTopWidth,10),R=parseInt(z.paddingTop,10),U=parseInt(z.borderBottomWidth,10),P=parseInt(z.paddingBottom,10),q=$+R+I+P+U,X=Math.min(x.offsetHeight*5,q),Z=window.getComputedStyle(f),me=parseInt(Z.paddingTop,10),Fe=parseInt(Z.paddingBottom,10),ge=k.top+k.height/2-je,$e=A-ge,pt=x.offsetHeight/2,F=x.offsetTop+pt,te=$+R+F,ce=q-te;if(te<=ge){const Q=L.length>0&&x===L[L.length-1].ref.current;c.style.bottom="0px";const ne=d.clientHeight-f.offsetTop-f.offsetHeight,xe=Math.max($e,pt+(Q?Fe:0)+ne+U),mt=te+xe;c.style.height=mt+"px"}else{const Q=L.length>0&&x===L[0].ref.current;c.style.top="0px";const xe=Math.max(ge,$+f.offsetTop+(Q?me:0)+pt)+ce;c.style.height=xe+"px",f.scrollTop=te-ge+f.offsetTop}c.style.margin=`${je}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=A+"px",n?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,c,d,f,x,v,s.dir,n]);se(()=>w(),[w]);const[j,C]=g.useState();se(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=g.useCallback(k=>{k&&b.current===!0&&(w(),_?.(),b.current=!1)},[w,_]);return a.jsx(p_,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:a.jsx("div",{ref:l,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}})})})});Kl.displayName=d_;var u_="SelectPopperPosition",oa=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=je,...s}=e,i=Pn(r);return a.jsx(Gi,{...i,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});oa.displayName=u_;var[p_,aa]=Ft(ut,{}),sa="SelectViewport",Yl=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=Ze(sa,r),i=aa(sa,r),c=Y(t,s.onViewportChange),l=g.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(Tn.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=i;if(m?.current&&p){const h=Math.abs(l.current-u.scrollTop);if(h>0){const b=window.innerHeight-je*2,f=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),v=Math.max(f,x);if(v<b){const _=v+h,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")}}}l.current=u.scrollTop})})})]})});Yl.displayName=sa;var Xl="SelectGroup",[m_,f_]=Ft(Xl),h_=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ne();return a.jsx(m_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});h_.displayName=Xl;var Jl="SelectLabel",g_=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=f_(Jl,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});g_.displayName=Jl;var On="SelectItem",[x_,Zl]=Ft(On),Ql=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...i}=e,c=Je(On,r),l=Ze(On,r),d=c.value===n,[u,p]=g.useState(s??""),[m,h]=g.useState(!1),b=Y(t,_=>l.itemRefCallback?.(_,n,o)),f=Ne(),x=g.useRef("touch"),v=()=>{o||(c.onValueChange(n),c.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(x_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:g.useCallback(_=>{p(w=>w||(_?.textContent??"").trim())},[]),children:a.jsx(Tn.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,...i,ref:b,onFocus:V(i.onFocus,()=>h(!0)),onBlur:V(i.onBlur,()=>h(!1)),onClick:V(i.onClick,()=>{x.current!=="mouse"&&v()}),onPointerUp:V(i.onPointerUp,()=>{x.current==="mouse"&&v()}),onPointerDown:V(i.onPointerDown,_=>{x.current=_.pointerType}),onPointerMove:V(i.onPointerMove,_=>{x.current=_.pointerType,o?l.onItemLeave?.():x.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(i.onPointerLeave,_=>{_.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:V(i.onKeyDown,_=>{l.searchRef?.current!==""&&_.key===" "||(t_.includes(_.key)&&v(),_.key===" "&&_.preventDefault())})})})})});Ql.displayName=On;var mr="SelectItemText",ed=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,i=Je(mr,r),c=Ze(mr,r),l=Zl(mr,r),d=a_(mr,r),[u,p]=g.useState(null),m=Y(t,v=>p(v),l.onItemTextChange,v=>c.itemTextRefCallback?.(v,l.value,l.disabled)),h=u?.textContent,b=g.useMemo(()=>a.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:f,onNativeOptionRemove:x}=d;return se(()=>(f(b),()=>x(b)),[f,x,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:l.textId,...s,ref:m}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?_r.createPortal(s.children,i.valueNode):null]})});ed.displayName=mr;var td="SelectItemIndicator",rd=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zl(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var ia="SelectScrollUpButton",nd=g.forwardRef((e,t)=>{const r=Ze(ia,e.__scopeSelect),n=aa(ia,e.__scopeSelect),[o,s]=g.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let c=function(){const d=l.scrollTop>0;s(d)};const l=r.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=r;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});nd.displayName=ia;var ca="SelectScrollDownButton",od=g.forwardRef((e,t)=>{const r=Ze(ca,e.__scopeSelect),n=aa(ca,e.__scopeSelect),[o,s]=g.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let c=function(){const d=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<d;s(u)};const l=r.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=r;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});od.displayName=ca;var ad=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=Ze("SelectScrollButton",r),i=g.useRef(null),c=An(r),l=g.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),se(()=>{c().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{l()})})}),b_="SelectSeparator",__=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});__.displayName=b_;var la="SelectArrow",v_=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),s=Je(la,r),i=Ze(la,r);return s.open&&i.position==="popper"?a.jsx(Ki,{...o,...n,ref:t}):null});v_.displayName=la;var y_="SelectBubbleInput",sd=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=g.useRef(null),s=Y(n,o),i=Jb(t);return g.useEffect(()=>{const c=o.current;if(!c)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&u){const p=new Event("change",{bubbles:!0});u.call(c,t),c.dispatchEvent(p)}},[i,t]),a.jsx(W.select,{...r,style:{...Ml,...r.style},ref:s,defaultValue:t})});sd.displayName=y_;function id(e){return e===""||e===void 0}function cd(e){const t=Ve(e),r=g.useRef(""),n=g.useRef(0),o=g.useCallback(i=>{const c=r.current+i;t(c),(function l(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function ld(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=w_(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==r));const l=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function w_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var j_=Dl,S_=$l,C_=Ul,k_=Hl,N_=Vl,E_=Wl,T_=Yl,A_=Ql,P_=ed,O_=rd,R_=nd,L_=od;function fr({...e}){return a.jsx(j_,{"data-slot":"select",...e})}function hr({...e}){return a.jsx(C_,{"data-slot":"select-value",...e})}function gr({className:e,size:t="default",children:r,...n}){return a.jsxs(S_,{"data-slot":"select-trigger","data-size":t,className:D("ecr-select__trigger",e),...n,children:[r,a.jsx(k_,{asChild:!0,children:a.jsx(fo,{className:"ecr-select__icon"})})]})}function xr({className:e,children:t,position:r="popper",align:n="center",...o}){const s=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(N_,{container:s,children:a.jsxs(E_,{"data-slot":"select-content",className:D("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(I_,{}),a.jsx(T_,{className:D("ecr-select__viewport"),children:t}),a.jsx(z_,{})]})})}function br({className:e,children:t,...r}){return a.jsxs(A_,{"data-slot":"select-item",className:D("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(O_,{children:a.jsx(If,{className:"ecr-select__check-icon"})})}),a.jsx(P_,{children:t})]})}function I_({className:e,...t}){return a.jsx(R_,{"data-slot":"select-scroll-up-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(zf,{className:"ecr-select__icon"})})}function z_({className:e,...t}){return a.jsx(L_,{"data-slot":"select-scroll-down-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(fo,{className:"ecr-select__icon"})})}const M_=({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(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:qu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),D_={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 F_(){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(fr,{defaultValue:Xa[0].value,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Xa.map(e=>a.jsx(br,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Vu.map(e=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(qt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(ir,{name:e.label,text:D_[e.value]})})]})},e.value))]})]})]})}const $_=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(F_,{}),a.jsx(M_,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]}),Rn=({label:e,text:t})=>a.jsxs(Rt,{children:[a.jsx(Lt,{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(qt,{size:20})]}),a.jsx(V0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(It,{className:"ecr-admin-popover",children:a.jsx(ir,{name:e,text:t})})]});var Ln="Collapsible",[B_]=He(Ln),[U_,da]=B_(Ln),dd=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:s,onOpenChange:i,...c}=e,[l,d]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:Ln});return a.jsx(U_,{scope:r,disabled:s,contentId:Ne(),open:l,onOpenToggle:g.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":pa(l),"data-disabled":s?"":void 0,...c,ref:t})})});dd.displayName=Ln;var ud="CollapsibleTrigger",pd=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=da(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":pa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ua="CollapsibleContent",md=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=da(ua,e.__scopeCollapsible);return a.jsx(Ke,{present:r||o.open,children:({present:s})=>a.jsx(H_,{...n,ref:t,present:s})})});md.displayName=ua;var H_=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...s}=e,i=da(ua,r),[c,l]=g.useState(n),d=g.useRef(null),u=Y(t,d),p=g.useRef(0),m=p.current,h=g.useRef(0),b=h.current,f=i.open||c,x=g.useRef(f),v=g.useRef(void 0);return g.useEffect(()=>{const _=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(_)},[]),se(()=>{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,h.current=w.width,x.current||(_.style.transitionDuration=v.current.transitionDuration,_.style.animationName=v.current.animationName),l(n)}},[i.open,n]),a.jsx(W.div,{"data-state":pa(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!f,...s,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 pa(e){return e?"open":"closed"}var V_=dd,W_=pd,q_=md;function fd({className:e,...t}){return a.jsx(V_,{"data-slot":"collapsible",className:D("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(W_,{"data-slot":"collapsible-trigger",className:D("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(fo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(q_,{"data-slot":"collapsible-content",className:D("ecr-collapsible__content",e),...t})}const G_=({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(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Wu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),K_=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],Y_=({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:K_.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($p,{color:"#2563eb",size:16}):a.jsx(Bp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},X_=Object.values(Ya),J_={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!"})},Z_=({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(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[X_.map(r=>a.jsx(br,{value:r,className:"ecr-admin-control__option",children:r},r)),Uu.map(r=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(qt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(ir,{name:r,text:J_[r]})})]})},r))]})]})]}),Q_=({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(Ff,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Y_,{selectedShape:r?.shape,handleShape:o=>n(s=>({...s,shape:o}))}),a.jsx(Z_,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(s=>({...s,template:o}))}),a.jsx(G_,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(s=>({...s,appearance:o}))}),a.jsx(cr,{label:"Size",min:150,max:400,value:r?.size??150,onChange:o=>n(s=>({...s,size:o})),name:"size",id:"size"}),a.jsx(cr,{label:"Gap",min:0,max:80,value:r?.gap??0,onChange:o=>n(s=>({...s,gap:o})),name:"column_gap",id:"column-gap"}),a.jsx(Rn,{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(Rn,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(Rn,{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(Rn,{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!"})})]})]}),ev=({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(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Hu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),tv=({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(Uf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(cr,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(s=>({...s,border:{...s.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dl,{selectedColor:r?.border?.border_color,handleColor:o=>n(s=>({...s,border:{...s.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(cr,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(s=>({...s,border:{...s.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(ev,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(s=>({...s,hoverEffect:o}))})]})]}),rv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",s=r==="style",i=c=>{n(r!==c?c:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Q_,{handleSectionOpen:i,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(tv,{isStyleOpen:s,handleSectionOpen:i,styles:e,updateStyles:t})]})},nv=({styles:e,setStyles:t,isExpanded:r,setIsEdited:n,tabs:o,currentTab:s,setCurrentTab:i})=>{const c=d=>{t(u=>{const p=d(u);return n(!0),p})},l=d=>{(d===o.thumbnail||d===o.preview)&&i(d)};return a.jsxs("div",{className:D("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),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(Yb,{value:s,onValueChange:l,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(Xb,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Ll,{value:o.thumbnail,children:"Thumbnail"}),a.jsx(Ll,{value:o.preview,children:"Preview"})]}),a.jsx(Il,{value:o.thumbnail,children:a.jsx(rv,{styles:e,updateStyles:c})}),a.jsx(Il,{value:o.preview,children:a.jsx($_,{styles:e,updateStyles:c})})]})})]})},ov=e=>{const t=Se(),[r,n]=y.useState(""),[o,s]=y.useState([]),[i,c]=y.useState(et),[l,d]=y.useState(!0),[u,p]=y.useState(!1),[m,h]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const _=(await ue.get(`stories/${e}`)).data;n(_.group_name),s(_.stories),c(_.styles??et)}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async x=>{const v=o.map(j=>j.id),_={group_name:r,styles:i,story_ids:v};e&&(_.group_id=e);const w=await ue.post("stories/manage-group-stories",_);if(!e){const j=w.data.group_id;t(`?view=${K.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:s,styles:i,setStyles:c,isLoading:l,isSaving:u,isEdited:m,setIsEdited:h,handleSave:async()=>{try{p(!0);const x=await b();return h(!1),G.success("Changes saved successfully!"),x}catch(x){return x instanceof Error?G.error(x.message):G.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},av=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),s=y.useRef(!1),i=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){i.current=m;return}if(s.current){s.current=!1,i.current=m;return}m!==i.current&&(o.current=m,window.location.hash=i.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,s.current=!0,p();return}if(o.current){const p=o.current;o.current=null,s.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{s.current=!0,p()}}},xd={thumbnail:"thumbnail",preview:"preview"},sv=()=>{const e=Se(),{state:t}=Ht(),[r]=Vt(),n=r.get("gid"),{groupTitle:o,setGroupTitle:s,thisGroupReels:i,setThisGroupReels:c,styles:l,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:h,handleSave:b}=ov(n),{allReels:f,setAllReels:x,searchTerm:v,setSearchTerm:_,isSearching:w,lastStoryElementRef:j}=Js(n),[C,N]=y.useState(""),[k,E]=y.useState(!0),[T,O]=y.useState(xd.thumbnail),{showLeaveModal:L,requestLeave:A,confirmLeave:I,cancelLeave:z,allowNextNavigation:$}=av(m),R=async(P,q)=>{try{N(P.story_uuid);const X=q==="add"?[P,...i]:i.filter(Z=>Z.story_uuid!==P.story_uuid);c(X),x(q==="add"?Z=>Z.filter(me=>me.story_uuid!==P.story_uuid):Z=>[...Z,P]),h(!0)}catch(X){X instanceof Error?G.error(X.message):G.error("Something went wrong. Please try again later!")}finally{N("")}};y.useEffect(()=>{if(!u&&t){const P=f.findIndex(q=>q.id==t.storyId);if(P!==-1){const q=f[P];x(X=>X.filter(Z=>Z.id!=q.id)),c(X=>[q,...X]),h(!0)}}},[t,f,u,x,c,h]);const U=async()=>{const P=await b();P?.isNewGroup&&$(()=>{e(`?view=${K.mg}&gid=${P.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(vb,{value:{requestLeave:A},children:[a.jsx(_t,{left:[a.jsx(vt,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(Xt,{cb:()=>A(()=>e(`?view=${K.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Zs,{placeholder:"Enter group title",title:o,setTitle:s,setIsEdited:h,style:{paddingInline:"32px"}}),o&&a.jsxs(Vo,{children:[a.jsx(Wo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(q0,{})}),a.jsxs(qo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Customize title appearance"})}),a.jsx(xb,{styles:l,setStyles:d,setIsEdited:h}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(b0,{asChild:!0,children:a.jsx(re,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(W0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(uo,{onSave:U,isSaving:p,disabled:!m},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Manage Widget"}],onNavigate:P=>A(()=>e(P))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Tb,{allReels:f,gid:n,handleSelectReel:R,searchTerm:v,setSearchTerm:_,isSearching:w,togglingId:C,lastStoryElementRef:j}),a.jsx(Eb,{gid:n,reels:i,styles:l,handleRemoveReel:R,togglingId:C,currentTab:T}),a.jsx(nv,{isExpanded:k,setIsEdited:h,styles:l,setStyles:d,tabs:xd,setCurrentTab:O,currentTab:T})]}),L&&a.jsx(Or,{onReject:z,onAccept:I,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function iv(){const[e]=Vt(),t=e.get("view")||K.ag;let r;switch(t){case K.settings:r=a.jsx(F0,{});break;case K.ar:r=a.jsx(jf,{});break;case K.stat:r=a.jsx(U0,{});break;case K.cr:r=a.jsx(T0,{});break;case K.mg:r=a.jsx(sv,{});break;default:r=a.jsx(M0,{})}return a.jsxs("div",{children:[r,a.jsx(Bu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const bd=async(e,t,r,n={})=>{try{if(await ue.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},cv=()=>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 e=y.useContext(ma),{stories:t,styles:r,groupId:n,isPlaying:o,setIsPlaying:s,setStoryViews:i}=e,[c,l]=y.useState(null),[d,u]=y.useState(!0),[p,m]=y.useState(0),[h,b]=y.useState(!1),f=y.useRef(!0),x=t.length-1,[v,_]=y.useState({index:0,story_uuid:t[0]?.story_uuid}),w=A=>!!A?.files?.[0]?.mime_type?.startsWith("video"),j=y.useCallback((A,I=1)=>{if(t.length===0)return null;let z=A;for(let $=0;$<t.length;$+=1){const R=t[z];if(w(R))return{story:R,index:z};z=(z+I+t.length)%t.length}return null},[t]),C=y.useCallback(()=>{const A=o,I=t.findIndex(R=>String(R.story_uuid)===A),z=I>=0?t[I]:null,$=w(z)?{story:z,index:I}:j(Math.max(I,0),1);$?.story?(l($.story),I!==$.index&&$.story.story_uuid!==o&&s($.story.story_uuid)):l(null),u(!1)},[o,t,s,j]);y.useEffect(()=>{C()},[o,t,C]),y.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const N=(A=1)=>{u(!0);const I=t.findIndex(P=>String(P.story_uuid)===String(o)),z=A>0?1:-1,$=A>0?x>I?I+1:0:I>0?I-1:x,R=j($,z);if(!R?.story){u(!1);return}const U=R.story;if(U.story_uuid===o){u(!1),s(null);return}_({index:0,story_uuid:U.story_uuid}),n&&bd(n,U.id,i,{isActive:()=>f.current}),s(U.story_uuid),u(!1)},k=()=>{const A=c?.files??[];v?.index>0?_(I=>({index:I.index-1,story_uuid:A[I.index-1].story_uuid})):N(-1)},E=()=>{const A=c?.files??[];v?.index+1<A.length?_(I=>({index:I.index+1,story_uuid:A[I.index+1].story_uuid})):(N(),A[0]?.story_uuid&&_({index:0,story_uuid:A[0].story_uuid}))},T=A=>{A.target===A.currentTarget&&s(null)},O=r?.playerAppearance??"overlay",L=c?.links&&c.links.length>0?c.links[0]:null;return a.jsx("div",{onClick:T,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:c&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(xt,{onClick:k,className:"ecr-player__nav--left",children:a.jsx(Gt,{size:24})}),a.jsx(xt,{onClick:E,className:"ecr-player__nav--right",children:a.jsx(Kt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[c&&a.jsx(os,{playingStory:c,duration:p,currentFileIndex:v,isPaused:h},`${c.story_uuid}-${v.index}`),a.jsx("div",{onClick:()=>s(null),className:"ecr-player__close",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),d?a.jsx(cv,{}):c?.files.length>0&&a.jsx(cs,{currentFileIndex:v,files:c?.files,setDuration:m,setIsPlaying:s,isPaused:h,setIsPaused:b,handlePrevFile:k,handleNextFile:E,storyId:c.id,storyTitle:c?.title}),O==="overlay"&&L?a.jsx(kn,{link:L,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,O==="title"?a.jsx(Nn,{title:c.title}):null]})]})})},_d=({story:e,styles:t,handlePlaying:r,template:n,storyViews:o,setStoryViews:s})=>{const i=e.links&&e.links.length>0?e.links[0]:null,c=t.appearance??"overlay";return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,style:{width:n==="carousel"?`${t?.size}px`:"auto"},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(Jn,{story:e,styles:t,storyViews:o,setStoryViews:s}),c==="overlay"&&t.shape==="rectangle"?i?a.jsx(kn,{link:i,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Nn,{title:e.title}):null]}),c==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-reel__title",children:e.title}):null]})},dv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:c,canScrollLeft:l,canScrollRight:d,scrollBy:u,scrollStep:p}=fl([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:s,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:i,style:{gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},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(_d,{story:m,styles:t,handlePlaying:r,template:"carousel",storyViews:n,setStoryViews:o},m.story_uuid):null)})}),c&&l&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Gt,{size:20,style:{width:"20px",height:"20px"}})}),c&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Kt,{size:20,style:{width:"20px",height:"20px"}})})]})},vd=({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`,gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:"ecr-front-grid__list",children:e?.map(s=>s?.files[0]?.mime_type.startsWith("video")?a.jsx(_d,{story:s,styles:t,handlePlaying:r,template:"grid",storyViews:n,setStoryViews:o},s.story_uuid):null)})}),uv={carousel:dv,grid:vd},pv=()=>{const e=y.useContext(ma),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:s,storyViews:i,setStoryViews:c}=e,l=y.useRef(!0);y.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const d=r.template??"carousel",u=uv[d]||vd,p=({sid:m,story_uuid:h})=>{s(h),o&&bd(o,m,c,{isActive:()=>l.current})};return a.jsxs("div",{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:i,setStoryViews:c})]})},mv=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[s,i]=y.useState(et),[c,l]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),i(et),l(!1),u(null);return}const h=new AbortController;l(!0),u(null);try{const b=await ue.get(`stories/${m}`,{signal:h.signal});if(h.signal.aborted)return;r(b.data.group_name),o(b.data.stories),i(b.data.styles||et)}catch(b){if(h.signal.aborted)return;u(b)}finally{l(!1)}return()=>{h.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:s,isLoading:c,error:d}},ma=y.createContext(void 0),yd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:s,stories:i,styles:c}=mv(e);return a.jsxs(ma.Provider,{value:{groupTitle:s,groupId:e,stories:i,styles:c,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(lv,{}),a.jsx(pv,{})]})};xa(()=>{const e=document.getElementById("ecommreels-admin-app");e&&In.createRoot(e).render(a.jsx(Xd,{children:a.jsx(iv,{})}))}),xa(()=>{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(yd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(yd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);362 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},p0="DialogDescriptionWarning",m0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(p0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},f0=jl,h0=Cl,g0=Nl,x0=El,b0=Pl,_0=Al,Ml=Ll;function Vo({...e}){return a.jsx(f0,{"data-slot":"dialog",...e})}function Wo({...e}){return a.jsx(h0,{"data-slot":"dialog-trigger",...e})}function v0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(g0,{"data-slot":"dialog-portal",container:t,...e})}function y0({className:e,...t}){return a.jsx(x0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function qo({className:e,children:t,...r}){return a.jsxs(v0,{children:[a.jsx(y0,{}),a.jsxs(b0,{"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(Jf,{className:"ecr-dialog__close-icon"})})]})]})}function Go({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Ko({className:e,...t}){return a.jsx(_0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function w0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const j0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,s]=y.useState([]),[i,l]=y.useState(1),[d,c]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=co(b,500),v=y.useRef(!0),_=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async P=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const T=++_.current;w.current&&w.current.abort();const R=new AbortController;w.current=R,P===1&&v.current?g(!0):p(!0);try{const L={page:P,per_page:50};h&&(L.search=h);const I=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:L,signal:R.signal}),O=I.data,D=parseInt(I.headers["x-wp-totalpages"]||"1",10);T===_.current&&(s(z=>P===1?O:[...z,...O]),l(P+1),c(P<D))}catch(L){if(R.signal.aborted)return;L instanceof Error?C(L.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),T===_.current&&!R.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),s([]),C(null),v.current=!0,N(1))},[h,N,t]);const k=y.useRef(null),E=y.useCallback(P=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(T=>{T[0].isIntersecting&&d&&N(i)}),P&&k.current.observe(P))},[u,d,i,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:s,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},vn="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}),S0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:s,searchTerm:i,setSearchTerm:l,error:d})=>{const[c,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(),c.length===0){m(!0);return}const h=new Set(c),v=[];for(const _ of r)h.has(_.id)&&v.push({btn_type:"product",btn_uuid:mo(),buttonText:_.name,buttonUrl:_.permalink,rating:_.average_rating,price:_.price_html,thumbnail:_.images?.[0]?.thumbnail||_.images?.[0]?.src||vn,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:i,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:d||"No products are available to add."}):r.map((f,h)=>{const v=c.includes(f.id);return a.jsx("div",{ref:r.length===h+1?s:null,className:"ecr-admin-product-link__item",style:c.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(re,{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(Gf,{size:20,color:"#2563eb"}):a.jsx(Kf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||vn,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"})}),C0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,k0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[s,i]=y.useState(""),[l,d]=y.useState(!0),[c,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&C0.test(n)||b.push("url"),s||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:mo(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:s,customClass:c,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(yn,{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(yn,{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(yn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:s,setValue:i}),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=>d(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(yn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:c,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function yn({error:e,type:t,name:r,label:n,placeholder:o,value:s,setValue:i}){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:s,onChange:l=>i(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const N0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,s]=y.useState(null),[i,l]=y.useState(!1),d=j0({enabled:i}),c=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(xn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[c&&a.jsxs(Vo,{open:o==="custom",onOpenChange:g=>s(g?"custom":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Uf,{size:20})," Add Custom Link"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(k0,{handleLinks:g=>{e(b=>[...b,g]),s(null)}})})]})]}),u&&a.jsxs(Vo,{open:o==="product",onOpenChange:g=>s(g?"product":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Yf,{size:20})," Tag Products"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(S0,{handleLinks:g=>{e(g),s(null)},taggedProducts:p,products:d.products,isSearching:d.isSearching,isLoading:d.isLoading,lastProductElementRef:d.lastProductElementRef,searchTerm:d.searchTerm,setSearchTerm:d.setSearchTerm,error:d.error})})]})]})]})})]})},E0=({links:e,onLinksChange:t})=>{const r=o=>{t(s=>s.filter(i=>i.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(re,{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(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(Jt,{size:20})]}),a.jsx(It,{className:"ecr-admin-links__popover",children:a.jsx(pr,{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(N0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return H({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 P0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[s,i]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",s?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const d=l.currentTarget,c=d.videoWidth,u=d.videoHeight;i(()=>u>c)}})},T0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:s,dragEnd:i})=>{const[l,d]=y.useState(!0),[c,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(c?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,d(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>s(e),onDragEnd:i,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(P0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[c?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},A0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),s=d=>{n.current=d},i=d=>{o.current=d},l=()=>{if(n.current===null||o.current===null)return;const d=[...e],c=d[n.current];d.splice(n.current,1),d.splice(o.current,0,c),n.current=null,o.current=null,r(d)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((d,c)=>a.jsx(T0,{setIsAttemptingDelete:t,file:d,file_uuid:d.file_uuid,index:c,dragStart:s,dragEnter:i,dragEnd:l},c)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:ti,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(Jt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(It,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(pr,{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!"]})})})]})]})},O0=({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(ri,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),R0=()=>{const e=Se(),[t]=Yt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,s]=y.useState({files:[],title:"",links:[],thumbnail:null}),[i,l]=y.useState(!1),[d,c]=y.useState(null),u=y.useCallback(h=>{s(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=y.useCallback(h=>{s(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=y.useCallback(h=>{s(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=y.useCallback(h=>{s(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{d&&(p(h=>h.filter(v=>v.file_uuid!==d)),c(null))},f=y.useCallback(async h=>{try{l(!0);const v=await pe.get(`story/${h}`);s({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?G.error(v.message):G.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)},[]),i?a.jsx(Rr,{}):a.jsxs(a.Fragment,{children:[a.jsx(Nf,{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"}),d&&a.jsx(Ar,{onReject:()=>c(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(A0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:c}):a.jsx(ri,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(O0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(xn,{className:"ecr-admin-create__separator"}),a.jsx(E0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(lp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Yo,Ul;function L0(){return Ul||(Ul=1,Yo=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()}}),Yo}var Xo,Hl;function I0(){if(Hl)return Xo;Hl=1;var e=L0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(s){var i=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,i)}function o(s,i){var l,d,c,u,p,m,g=!1;i||(i={}),l=i.debug||!1;try{c=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=s,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(),i.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[i.format]||t.default;window.clipboardData.setData(h,s)}else f.clipboardData.clearData(),f.clipboardData.setData(i.format,s);i.onCopy&&(f.preventDefault(),i.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(i.format||"text",s),i.onCopy&&i.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),d=n("message"in i?i.message:r),window.prompt(d,s)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),c()}return g}return Xo=o,Xo}var z0=I0();const Vl=Cd(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 wn({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 Re({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 M0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],D0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),s=(i,l)=>{Vl(i),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(nt,{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(wn,{children:M0.map((i,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:i?.width||"auto",textAlign:i?.align},children:i.label},l))})}),a.jsx(Gl,{children:e.map((i,l)=>a.jsxs(wn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Re,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:i.group_name})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${i.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>s(`[reelswp-group id='${i.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(np,{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(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(re,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.stat}&group=${i.id}&name=${i.group_name}`,children:a.jsx(us,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.mg}&gid=${i.id}`,children:a.jsx(Tr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Delete Group",onClick:()=>t(i.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(ip,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},i.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))})]}),F0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,s]=y.useState(!1),[i,l]=y.useState(!1),[d,c]=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=co(u,500),j=y.useCallback(async E=>{const P=new AbortController,T=E===1;try{T?s(!0):l(!0),n("");const R=await pe.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:P.signal}),L=Number(R.headers?.["x-wp-total"]??0),I=Number(R.headers?.["x-wp-totalpages"]??1),O=Math.max(1,I||1);t(D=>{if(T)return R.data;const z=new Set(D.map(A=>A.id)),B=R.data.filter(A=>!z.has(A.id));return[...D,...B]}),h(L),_(O),E>O&&g(O)}catch(R){if(P.signal.aborted)return;R instanceof Error?n(R.message):n("Something went wrong. Try again later!")}finally{P.signal.aborted||(T?s(!1):l(!1))}},[b,w]),C=y.useCallback(()=>{g(E=>o||i||E>=v?E:E+1)},[o,i,v]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{c(!0),await pe.delete(`group/${E}`),await N(),G.success("Group deleted successfully!")}catch(P){P instanceof Error?G.error(P.message):G.error("Failed to delete group.")}finally{c(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:i,isDeleting:d,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:k}},$0={docs:"https://reelswp.com/docs/"},B0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:s,isDeleting:i,deleteGroup:l,hasMore:d,loadMore:c,searchTerm:u,setSearchTerm:p}=F0(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!d)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&c()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[d,c]),a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:"All Widgets",Icon:cp},"page")],center:[a.jsx(Lr,{},"reel-wp")],right:[a.jsxs("a",{href:$0.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx($f,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Or,{to:`?view=${K.cr}`,text:"Add Reel",Icon:gt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Ar,{onAccept:g,onReject:()=>t(null),isLoading:i}),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(re,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(er,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ns,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Or,{to:`?view=${K.mg}`,text:"Create Widget",Icon:gt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx(D0,{tableData:r,setIsAttemptingDelete:t}),d&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:s?a.jsx(Hf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},U0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,s]=y.useState(!1),[i,l]=y.useState(!1),[d,c]=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)){G.error("Please enter valid numbers.");return}try{l(!0),c(!1),await pe.post("settings",{rate_limit:m,time_limit:g}),G.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),c(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{s(!0),c(!1);const b=await pe.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?G.error(b.message):G.error("Something went wrong. Try again later!"),c(!0)}finally{m.signal.aborted||s(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:i,isError:d,handleOnChange:u,handleSave:p}},H0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:s,handleSave:i}=U0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Rr,{}),a.jsx(_t,{left:[a.jsx(vt,{name:"Settings",Icon:Sp},"Settings"),a.jsx(tr,{},"back-settings")],center:[a.jsx(Lr,{},"Settings-widget-name")],right:[a.jsx(uo,{onSave:i,isSaving:n,disabled:!t},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${K.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=>s("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=>s("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},V0=[{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"}],W0=({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(nt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(wn,{children:V0.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(wn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Re,{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(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),q0=()=>{const[e]=Yt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[s,i]=y.useState([]),[l,d]=y.useState(!1),[c,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{d(!0);const g=await pe.get(`/group/${t}/stats`);o(g.data.stories),i(g.data.buttons)}catch(g){g instanceof Error?G.error(g.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{d(!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(_t,{left:[a.jsx(vt,{name:"Statistics",Icon:us},"Statistics"),a.jsx(tr,{},"Statistics-back")],center:[a.jsx(Lr,{},"Statistics-widget-name")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${K.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,{}):c?a.jsx(Bl,{}):s.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(W0,{tableData:s})})]})]})};function G0(e){return H({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 K0(e){return H({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 Y0=({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(G0,{size:24})}),X0=({...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"})]})}),Jo=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}));Jo.displayName="Input";const Zo=({label:e,min:t,max:r,value:n,onChange:o,name:s,id:i,wrapperStyles:l,hideSlider:d})=>{const[c,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:i,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!d&&a.jsx("input",{type:"range",id:i,name:s,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(Jo,{type:"number",min:t,max:r,value:c,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function M(){return M=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},M.apply(null,arguments)}function De(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 zt=255,Xe=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,s=Math.max(t,r,n),i=s-Math.min(t,r,n),l=i?s===t?(r-n)/i:s===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(l<0?l+6:l),s:s?i/s*Xe:0,v:s/zt*Xe,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,s=(200-r)*n/Xe;return{h:t,s:s>0&&s<200?r*n/Xe/(s<=Xe?s:200-s)*Xe:0,l:s/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(s=>new Array(7-s.length).join("0")+s)(o.toString(16))},J0=e=>{var{r:t,g:r,b:n,a:o}=e,s=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(s||"")},fr=e=>mr(Z0(e)),Z0=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,s=0,i]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:s,a:(i??255)/zt}},jn=e=>{var{h:t,s:r,v:n,a:o}=e,s=t/60,i=r/Xe,l=n/Xe,d=Math.floor(s)%6,c=s-Math.floor(s),u=zt*l*(1-i),p=zt*l*(1-i*c),m=zt*l*(1-i*(1-c));l*=zt;var g={};switch(d){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),M({},g,{a:o})},Q0=e=>{var{r:t,g:r,b:n,a:o}=jn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},eb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},tb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Qo=e=>Ql(jn(e)),rb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},nb=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)},s=o(t/255),i=o(r/255),l=o(n/255),d={};return d.x=s*.4124+i*.3576+l*.1805,d.y=s*.2126+i*.7152+l*.0722,d.bri=s*.0193+i*.1192+l*.9505,d},Mt=e=>{var t,r,n,o,s,i,l,d,c;return typeof e=="string"&&ea(e)?(i=fr(e),d=e):typeof e!="string"&&(i=e),i&&(n=rb(i),s=Zl(i),o=jn(i),c=J0(o),d=Qo(i),r=tb(s),t=eb(o),l=nb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:s,hsva:i,hex:d,hexa:c,xy:l}},ea=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)}},ob=["prefixCls","className","onMove","onDown"],ta=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:s}=e,i=De(e,ob),l=y.useRef(null),d=y.useRef(!1),[c,u]=y.useState(!1),p=ec(o),m=ec(s),g=_=>d.current&&!hr(_)?!1:(d.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(d.current?"touchmove":"mousemove",b),window.addEventListener(d.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(c),()=>{h(!1)}),[c,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",M({},i,{className:[r,n||""].filter(Boolean).join(" "),style:M({},i.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});ta.displayName="Interactive";var ab=e=>{var{className:t,color:r,left:n,top:o,prefixCls:s}=e,i={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:s+"-pointer "+(t||""),style:i,children:a.jsx("div",{className:s+"-fill",style:l})}),[o,n,r,t,s])},sb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:s,className:i,hue:l=0,style:d,hsva:c,onChange:u}=e,p=De(e,sb),m=M({width:200,height:200,borderRadius:o},d,{position:"relative"}),g=(v,_)=>{u&&c&&u({h:c.h,s:v.left*100,v:(1-v.top)*100,a:c.a})},b=y.useCallback(v=>{if(!(!c||!u)){var _=1,w=c.s,j=c.v,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,c.s-_),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,c.s+_),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,c.v+_),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,c.v-_),C=!0,v.preventDefault();break;default:return}C&&u({h:c.h,s:w,v:j,a:c.a})}},[c,u]),f=y.useMemo(()=>{if(!c)return null;var v={top:100-c.v+"%",left:c.s+"%",color:Jl(c)};return s&&typeof s=="function"?s(M({prefixCls:n},v)):a.jsx(ab,M({prefixCls:n},v))},[c,s,n]),h=y.useCallback(v=>{v.target.focus()},[]);return a.jsx(ta,M({className:[n,i||""].filter(Boolean).join(" ")},p,{style:M({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=c?.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 ib=["className","prefixCls","left","top","style","fillProps"],lb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:s,fillProps:i}=e,l=De(e,ib),d=M({},s,{position:"absolute",left:n,top:o}),c=M({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},i?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",M({className:r+"-pointer "+(t||""),style:d},l,{children:a.jsx("div",M({className:r+"-fill"},i,{style:c}))}))},cb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],db="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Sn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:s,bgProps:i={},innerProps:l={},pointerProps:d={},radius:c=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=De(e,cb),v=P=>{b&&b(M({},o,{a:m==="horizontal"?P.left:P.top}),P)},_=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 C=M({"--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:c,background:"url("+db+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(P=>{var T=.01,R=o.a,L=R;switch(P.key){case"ArrowLeft":m==="horizontal"&&(L=Math.max(0,R-T),P.preventDefault());break;case"ArrowRight":m==="horizontal"&&(L=Math.min(1,R+T),P.preventDefault());break;case"ArrowUp":m==="vertical"&&(L=Math.max(0,R-T),P.preventDefault());break;case"ArrowDown":m==="vertical"&&(L=Math.min(1,R+T),P.preventDefault());break;default:return}if(L!==R){var I={left:m==="horizontal"?L:o.a,top:m==="vertical"?L:o.a,width:0,height:0,x:0,y:0};b&&b(M({},o,{a:L}),I)}},[o,m,b]),k=y.useCallback(P=>{P.target.focus()},[]),E=f&&typeof f=="function"?f(M({prefixCls:r},d,j)):a.jsx(lb,M({},d,{prefixCls:r},j));return a.jsxs("div",M({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",M({},i,{style:M({inset:0,position:"absolute",background:s||w,borderRadius:c},i.style)})),a.jsx(ta,M({},l,{style:M({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:k,onKeyDown:N,children:E}))]}))});Sn.displayName="Alpha";var ub=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],pb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),mb=e=>Number(String(e).replace(/%/g,"")),Dt=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:s,className:i,style:l,labelStyle:d,inputStyle:c,onChange:u,onBlur:p,renderInput:m}=e,g=De(e,ub),[b,f]=y.useState(s),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(k,E){var P=(E||k.target.value).trim().replace(/^#/,"");pb(P)&&u&&u(k,P);var T=mb(P);isNaN(T)||u&&u(k,T),f(P)}function _(k){h.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=M({"--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),C=M({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)"},c),N=M({value:b,onChange:v,onBlur:_,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,i||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",M({ref:t},N)),o&&a.jsx("span",{style:M({color:"var(--editable-input-label-color)",textTransform:"capitalize"},d),children:o})]})});Dt.displayName="EditableInput";var fb=["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:s={},gProps:i={},bProps:l={},aProps:d={},className:c,style:u,onChange:p}=e,m=De(e,fb),g=n?jn(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(Mt(mr(M({},g,{a:_/100}))))),_>255&&(_=255,j.target.value="255"),_<0&&(_=0,j.target.value="0"),w==="r"&&p&&p(Mt(mr(M({},g,{r:_})))),w==="g"&&p&&p(Mt(mr(M({},g,{g:_})))),w==="b"&&p&&p(Mt(mr(M({},g,{b:_})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",M({ref:t,className:[r,c||""].filter(Boolean).join(" ")},m,{style:M({fontSize:11,display:"flex"},u),children:[a.jsx(Dt,M({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"r",_)},s,{style:M({},s.style)})),a.jsx(Dt,M({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"g",_)},i,{style:M({marginLeft:5},s.style)})),a.jsx(Dt,M({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"b",_)},l,{style:M({marginLeft:5},l.style)})),d&&a.jsx(Dt,M({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(_,w)=>h(w,"a",_)},d,{style:M({marginLeft:5},d.style)}))]}))});ac.displayName="EditableInputRGBA";var hb=["prefixCls","className","hue","onChange","direction"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:s,direction:i="horizontal"}=e,l=De(e,hb);return a.jsx(Sn,M({ref:t,className:r+" "+(n||"")},l,{direction:i,background:"linear-gradient(to "+(i==="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:(d,c)=>{s&&s({h:i==="horizontal"?360*c.left:360*c.top})}}))});sc.displayName="Hue";var gb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:s=[],style:i,rectProps:l={},onChange:d,addonAfter:c,addonBefore:u,rectRender:p}=e,m=De(e,gb),g=M({"--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)=>{d&&d(fr(f),Mt(fr(f)),h)};return a.jsxs("div",M({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:M({display:"flex",flexWrap:"wrap",position:"relative"},i),children:[u&&y.isValidElement(u)&&u,s&&Array.isArray(s)&&s.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:M({},g,{background:_}),onClick:N=>b(_,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:_,checked:w}):null;return a.jsx("div",M({tabIndex:0,title:v,onClick:N=>b(_,N)},l,{children:C,style:M({},g,{background:_})}),h)}),c&&y.isValidElement(c)&&c]}))});ic.displayName="Swatch";var xb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],bb=["#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:s=218,presetColors:i=bb,color:l,editableDisable:d=!0,disableAlpha:c=!1,style:u}=e,p=De(e,xb),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ea(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Mt(N))},f=(N,k)=>{typeof N=="string"&&ea(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(M({},m,{a:N.a})),v=N=>b(M({},m,N,{a:m.a})),_=M({"--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:s},u),w={borderRadius:2,background:Q0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",M({},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(sc,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(M({},m,N))}),!c&&a.jsx(Sn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!c&&a.jsx(Sn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),d&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Dt,{label:"Hex",value:Qo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:c?!1:{},onChange:N=>b(N.hsva)})]}),i&&i.length>0&&a.jsx(ic,{style:j,colors:i,color:Qo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});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(Rt,{children:[a.jsx(Lt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(It,{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)})]})]}),_b=[{value:"left",title:"Align Left",Icon:$p},{value:"center",title:"Align Center",Icon:Bp},{value:"right",title:"Align Right",Icon:Up},{value:"hidden",title:"Hidden",Icon:Hp}],vb=({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:_b.map(({value:r,title:n,Icon:o})=>a.jsx(re,{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))})]}),yb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(s=>{const i=o(s);return r(!0),i})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(vb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Zo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},wb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(s=>{Vl(s),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},jb=({gid:e})=>{const[t,r]=wb(),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(Ff,{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()}),Sb=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function Cb(e){return H({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 kb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Nb,{link:e,usedFor:t})}),Nb=({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||vn,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||vn,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(Cb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Eb=({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})})},Cn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(kb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Eb,{link:e,usedFor:t},e.btn_uuid)}),kn=({title:e})=>a.jsx("p",{className:"ecr-reel_title",children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const s=Se(),{requestLeave:i}=pc(),l=n===e.story_uuid,d=`?view=${K.cr}&from=${K.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,c=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=e.links&&e.links.length>0?e.links[0]:null;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(Jn,{story:e,styles:t}),c==="overlay"&&t.shape==="rectangle"?p?a.jsx(Cn,{link:p,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(kn,{title:e.title}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(re,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(ht,{to:d,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:m=>{m.preventDefault(),i(()=>s(d))},children:a.jsx(Tr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(re,{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(tt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Vn,{size:18})})]})]}),c==="title"?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),[s,i]=y.useState(!1),[l,d]=y.useState(!1),[c,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;d(h>0),u(h+_<v-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(i(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=T=>{h=!0,v=T.pageX-f.offsetLeft,_=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=T=>{if(!h)return;T.preventDefault();const L=(T.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-L,g()},k=T=>{h=!0,v=T.touches[0].pageX-f.offsetLeft,_=f.scrollLeft},E=()=>{h=!1},P=T=>{if(!h)return;const L=(T.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-L,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",P,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",P)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:s,canScrollLeft:l,canScrollRight:c,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:l,canScrollLeft:d,canScrollRight:c,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:s,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:i,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(nt,{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&&d&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Zt,{size:20})}),l&&c&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Qt,{size:20})})]})},Pb=({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(s=>a.jsx(mc,{reel:s,styles:t,gid:r,togglingId:n,onRemove:o},s.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(nt,{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."})]})})}),Tb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,s]=y.useState(!1),[i,l]=y.useState(!0),[d,c]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=i)},[i]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&s(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(xt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Zt,{size:24})}),a.jsx(xt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:d?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(er,{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:d?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:i,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,v=h.videoWidth,_=h.videoHeight;c(()=>_>v)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}),i?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Yn,{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(Cn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,g==="title"?a.jsx(kn,{title:e.title}):null]})})},Ab={carousel:hc,grid:Pb},Ob=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:s})=>{const i=r.template??"carousel",l=Ab[i]||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(jb,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`},className:"scrollbarThin ecr-admin-existing__body",children:s==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Tb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(nt,{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"})}),Rb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:s,togglingId:i,lastStoryElementRef:l})=>{const d=Se(),{requestLeave:c}=pc(),u=`?view=${K.cr}&from=${K.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(Or,{to:u,text:"Add Reel",Icon:gt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>c(()=>d(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:s&&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:i==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}`}),i==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(tt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),s&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=He(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=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})};i.displayName=t;const l=e+"CollectionSlot",d=rt(l),c=y.forwardRef((f,h)=>{const{scope:v,children:_}=f,w=s(l,v),j=Y(h,w.collectionRef);return a.jsx(d,{ref:j,children:_})});c.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=rt(u),g=y.forwardRef((f,h)=>{const{scope:v,children:_,...w}=f,j=y.useRef(null),C=Y(h,j),N=s(u,v);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:_})});g.displayName=u;function b(f){const h=s(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,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:i,Slot:c,ItemSlot:g},b,n]}var Lb=x.createContext(void 0);function ra(e){const t=x.useContext(Lb);return e||t||"ltr"}var na="rovingFocusGroup.onEntryFocus",Ib={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[oa,bc,zb]=xc(gr),[Mb,_c]=He(gr,[zb]),[Db,Fb]=Mb(gr),vc=x.forwardRef((e,t)=>a.jsx(oa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(oa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx($b,{...e,ref:t})})}));vc.displayName=gr;var $b=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=Y(t,m),b=ra(s),[f,h]=lt({prop:i,defaultProp:l??null,onChange:d,caller:gr}),[v,_]=x.useState(!1),w=Ve(c),j=bc(r),C=x.useRef(!1),[N,k]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(na,w),()=>E.removeEventListener(na,w)},[w]),a.jsx(Db,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>k(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,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const P=!C.current;if(E.target===E.currentTarget&&P&&!v){const T=new CustomEvent(na,Ib);if(E.currentTarget.dispatchEvent(T),!T.defaultPrevented){const R=j().filter(z=>z.focusable),L=R.find(z=>z.active),I=R.find(z=>z.id===f),D=[L,I,...R].filter(Boolean).map(z=>z.ref.current);jc(D,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>_(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...l}=e,d=Ne(),c=s||d,u=Fb(yc,r),p=u.currentTabStopId===c,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(oa.ItemSlot,{scope:r,id:c,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(c):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=Hb(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?Vb(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:f!=null}):i})})});wc.displayName=yc;var Bb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ub(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hb(e,t,r){const n=Ub(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Bb[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 Vb(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Wb=vc,qb=wc,Nn="Tabs",[Gb]=He(Nn,[_c]),Sc=_c(),[Kb,aa]=Gb(Nn),Cc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:l,activationMode:d="automatic",...c}=e,u=ra(l),[p,m]=lt({prop:n,onChange:o,defaultProp:s??"",caller:Nn});return a.jsx(Kb,{scope:r,baseId:Ne(),value:p,onValueChange:m,orientation:i,dir:u,activationMode:d,children:a.jsx(W.div,{dir:u,"data-orientation":i,...c,ref:t})})});Cc.displayName=Nn;var kc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,s=aa(kc,r),i=Sc(r);return a.jsx(Wb,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Nc.displayName=kc;var Ec="TabsTrigger",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...s}=e,i=aa(Ec,r),l=Sc(r),d=Oc(i.baseId,n),c=Rc(i.baseId,n),u=n===i.value;return a.jsx(qb,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:d,...s,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=i.activationMode!=="manual";!u&&!o&&p&&i.onValueChange(n)})})})});Pc.displayName=Ec;var Tc="TabsContent",Ac=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:s,...i}=e,l=aa(Tc,r),d=Oc(l.baseId,n),c=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(Ke,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":d,hidden:!m,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&s})})});Ac.displayName=Tc;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var Yb=Cc,Xb=Nc,Jb=Pc,Zb=Ac;function Qb({className:e,...t}){return a.jsx(Yb,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function e_({className:e,...t}){return a.jsx(Xb,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(Jb,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(Zb,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function t_(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"}),r_="VisuallyHidden",n_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));n_.displayName=r_;var o_=[" ","Enter","ArrowUp","ArrowDown"],a_=[" ","Enter"],dt="Select",[En,Pn,s_]=xc(dt),[Ft]=He(dt,[s_,nn]),Tn=nn(),[i_,Je]=Ft(dt),[l_,c_]=Ft(dt),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:i,defaultValue:l,onValueChange:d,dir:c,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Tn(t),[h,v]=x.useState(null),[_,w]=x.useState(null),[j,C]=x.useState(!1),N=ra(c),[k,E]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:dt}),[P,T]=lt({prop:i,defaultProp:l,onChange:d,caller:dt}),R=x.useRef(null),L=h?b||!!h.closest("form"):!0,[I,O]=x.useState(new Set),D=Array.from(I).map(z=>z.props.value).join(";");return a.jsx(Gi,{...f,children:a.jsxs(i_,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ne(),value:P,onValueChange:T,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:R,disabled:m,children:[a.jsx(En.Provider,{scope:t,children:a.jsx(l_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(z=>{O(B=>new Set(B).add(z))},[]),onNativeOptionRemove:x.useCallback(z=>{O(B=>{const A=new Set(B);return A.delete(z),A})},[]),children:r})}),L?a.jsxs(sd,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:P,onChange:z=>T(z.target.value),disabled:m,form:b,children:[P===void 0?a.jsx("option",{value:""}):null,Array.from(I)]},D):null]})})};Dc.displayName=dt;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=Tn(r),i=Je(Fc,r),l=i.disabled||n,d=Y(t,i.onTriggerChange),c=Pn(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=c().filter(w=>!w.disabled),v=h.find(w=>w.value===i.value),_=cd(h,f,v);_!==void 0&&i.onValueChange(_.value)}),b=f=>{l||(i.onOpenChange(!0),g()),f&&(i.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Ro,{asChild:!0,...s,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":id(i.value)?"":void 0,...o,ref:d,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===" ")&&o_.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:s,placeholder:i="",...l}=e,d=Je(Bc,r),{onValueNodeHasChildrenChange:c}=d,u=s!==void 0,p=Y(t,d.onValueNodeChange);return se(()=>{c(u)},[c,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:id(d.value)?a.jsx(a.Fragment,{children:i}):s})});Uc.displayName=Bc;var d_="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=d_;var u_="SelectPortal",Vc=e=>a.jsx(on,{asChild:!0,...e});Vc.displayName=u_;var ut="SelectContent",Wc=x.forwardRef((e,t)=>{const r=Je(ut,e.__scopeSelect),[n,o]=x.useState();if(se(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?br.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(En.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=ut;var je=10,[qc,Ze]=Ft(ut),p_="SelectContentImpl",m_=rt("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:d,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,_=Je(ut,r),[w,j]=x.useState(null),[C,N]=x.useState(null),k=Y(t,$=>j($)),[E,P]=x.useState(null),[T,R]=x.useState(null),L=Pn(r),[I,O]=x.useState(!1),D=x.useRef(!1);x.useEffect(()=>{if(w)return Io(w)},[w]),xo();const z=x.useCallback($=>{const[te,...ce]=L().map(ne=>ne.ref.current),[J]=ce.slice(-1),Q=document.activeElement;for(const ne of $)if(ne===Q||(ne?.scrollIntoView({block:"nearest"}),ne===te&&C&&(C.scrollTop=0),ne===J&&C&&(C.scrollTop=C.scrollHeight),ne?.focus(),document.activeElement!==Q))return},[L,C]),B=x.useCallback(()=>z([E,w]),[z,E,w]);x.useEffect(()=>{I&&B()},[I,B]);const{onOpenChange:A,triggerPointerDownPosRef:q}=_;x.useEffect(()=>{if(w){let $={x:0,y:0};const te=J=>{$={x:Math.abs(Math.round(J.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(J.pageY)-(q.current?.y??0))}},ce=J=>{$.x<=10&&$.y<=10?J.preventDefault():w.contains(J.target)||A(!1),document.removeEventListener("pointermove",te),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",ce,{capture:!0})}}},[w,A,q]),x.useEffect(()=>{const $=()=>A(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[A]);const[X,Z]=ld($=>{const te=L().filter(Q=>!Q.disabled),ce=te.find(Q=>Q.ref.current===document.activeElement),J=cd(te,$,ce);J&&setTimeout(()=>J.ref.current.focus())}),me=x.useCallback(($,te,ce)=>{const J=!D.current&&!ce;(_.value!==void 0&&_.value===te||J)&&(P($),J&&(D.current=!0))},[_.value]),Fe=x.useCallback(()=>w?.focus(),[w]),ge=x.useCallback(($,te,ce)=>{const J=!D.current&&!ce;(_.value!==void 0&&_.value===te||J)&&R($)},[_.value]),$e=n==="popper"?sa:Kc,pt=$e===sa?{side:l,sideOffset:d,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:me,selectedItem:E,onItemLeave:Fe,itemTextRefCallback:ge,focusSelectedItem:B,selectedItemText:T,position:n,isPositioned:I,searchRef:X,children:a.jsx(fn,{as:m_,allowPinchZoom:!0,children:a.jsx(qr,{asChild:!0,trapped:_.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{_.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Wr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:a.jsx($e,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:$=>$.preventDefault(),...v,...pt,onPlaced:()=>O(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:V(v.onKeyDown,$=>{const te=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!te&&$.key.length===1&&Z($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let J=L().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,ne=J.indexOf(Q);J=J.slice(ne+1)}setTimeout(()=>z(J)),$.preventDefault()}})})})})})})});Gc.displayName=p_;var f_="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=Je(ut,r),i=Ze(ut,r),[l,d]=x.useState(null),[c,u]=x.useState(null),p=Y(t,k=>u(k)),m=Pn(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:_}=i,w=x.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&c&&f&&h&&v){const k=s.trigger.getBoundingClientRect(),E=c.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(s.dir!=="rtl"){const Q=T.left-E.left,ne=P.left-Q,xe=k.left-ne,mt=k.width+xe,ga=Math.max(mt,E.width),xa=window.innerWidth-je,ba=zc(ne,[je,Math.max(je,xa-ga)]);l.style.minWidth=mt+"px",l.style.left=ba+"px"}else{const Q=E.right-T.right,ne=window.innerWidth-P.right-Q,xe=window.innerWidth-k.right-ne,mt=k.width+xe,ga=Math.max(mt,E.width),xa=window.innerWidth-je,ba=zc(ne,[je,Math.max(je,xa-ga)]);l.style.minWidth=mt+"px",l.style.right=ba+"px"}const R=m(),L=window.innerHeight-je*2,I=f.scrollHeight,O=window.getComputedStyle(c),D=parseInt(O.borderTopWidth,10),z=parseInt(O.paddingTop,10),B=parseInt(O.borderBottomWidth,10),A=parseInt(O.paddingBottom,10),q=D+z+I+A+B,X=Math.min(h.offsetHeight*5,q),Z=window.getComputedStyle(f),me=parseInt(Z.paddingTop,10),Fe=parseInt(Z.paddingBottom,10),ge=k.top+k.height/2-je,$e=L-ge,pt=h.offsetHeight/2,$=h.offsetTop+pt,te=D+z+$,ce=q-te;if(te<=ge){const Q=R.length>0&&h===R[R.length-1].ref.current;l.style.bottom="0px";const ne=c.clientHeight-f.offsetTop-f.offsetHeight,xe=Math.max($e,pt+(Q?Fe:0)+ne+B),mt=te+xe;l.style.height=mt+"px"}else{const Q=R.length>0&&h===R[0].ref.current;l.style.top="0px";const xe=Math.max(ge,D+f.offsetTop+(Q?me:0)+pt)+ce;l.style.height=xe+"px",f.scrollTop=te-ge+f.offsetTop}l.style.margin=`${je}px 0`,l.style.minHeight=X+"px",l.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,s.trigger,s.valueNode,l,c,f,h,v,s.dir,n]);se(()=>w(),[w]);const[j,C]=x.useState();se(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=x.useCallback(k=>{k&&b.current===!0&&(w(),_?.(),b.current=!1)},[w,_]);return a.jsx(g_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:d,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=f_;var h_="SelectPopperPosition",sa=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=je,...s}=e,i=Tn(r);return a.jsx(Ki,{...i,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.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=h_;var[g_,ia]=Ft(ut,{}),la="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=Ze(la,r),i=ia(la,r),l=Y(t,s.onViewportChange),d=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(En.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,c=>{const u=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=i;if(m?.current&&p){const g=Math.abs(d.current-u.scrollTop);if(g>0){const b=window.innerHeight-je*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")}}}d.current=u.scrollTop})})})]})});Yc.displayName=la;var Xc="SelectGroup",[x_,b_]=Ft(Xc),__=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ne();return a.jsx(x_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});__.displayName=Xc;var Jc="SelectLabel",v_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=b_(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});v_.displayName=Jc;var An="SelectItem",[y_,Zc]=Ft(An),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...i}=e,l=Je(An,r),d=Ze(An,r),c=l.value===n,[u,p]=x.useState(s??""),[m,g]=x.useState(!1),b=Y(t,_=>d.itemRefCallback?.(_,n,o)),f=Ne(),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(y_,{scope:r,value:n,disabled:o,textId:f,isSelected:c,onItemTextChange:x.useCallback(_=>{p(w=>w||(_?.textContent??"").trim())},[]),children:a.jsx(En.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":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:b,onFocus:V(i.onFocus,()=>g(!0)),onBlur:V(i.onBlur,()=>g(!1)),onClick:V(i.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:V(i.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:V(i.onPointerDown,_=>{h.current=_.pointerType}),onPointerMove:V(i.onPointerMove,_=>{h.current=_.pointerType,o?d.onItemLeave?.():h.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(i.onPointerLeave,_=>{_.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:V(i.onKeyDown,_=>{d.searchRef?.current!==""&&_.key===" "||(a_.includes(_.key)&&v(),_.key===" "&&_.preventDefault())})})})})});Qc.displayName=An;var xr="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,i=Je(xr,r),l=Ze(xr,r),d=Zc(xr,r),c=c_(xr,r),[u,p]=x.useState(null),m=Y(t,v=>p(v),d.onItemTextChange,v=>l.itemTextRefCallback?.(v,d.value,d.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=c;return se(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:d.textId,...s,ref:m}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?br.createPortal(s.children,i.valueNode):null]})});ed.displayName=xr;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 ca="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=Ze(ca,e.__scopeSelect),n=ia(ca,e.__scopeSelect),[o,s]=x.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let l=function(){const c=d.scrollTop>0;s(c)};const d=r.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=r;l&&d&&(l.scrollTop=l.scrollTop-d.offsetHeight)}}):null});nd.displayName=ca;var da="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=Ze(da,e.__scopeSelect),n=ia(da,e.__scopeSelect),[o,s]=x.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let l=function(){const c=d.scrollHeight-d.clientHeight,u=Math.ceil(d.scrollTop)<c;s(u)};const d=r.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=r;l&&d&&(l.scrollTop=l.scrollTop+d.offsetHeight)}}):null});od.displayName=da;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=Ze("SelectScrollButton",r),i=x.useRef(null),l=Pn(r),d=x.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return x.useEffect(()=>()=>d(),[d]),se(()=>{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,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{d()})})}),w_="SelectSeparator",j_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});j_.displayName=w_;var ua="SelectArrow",S_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Tn(r),s=Je(ua,r),i=Ze(ua,r);return s.open&&i.position==="popper"?a.jsx(Yi,{...o,...n,ref:t}):null});S_.displayName=ua;var C_="SelectBubbleInput",sd=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),s=Y(n,o),i=t_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const d=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[i,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:s,defaultValue:t})});sd.displayName=C_;function id(e){return e===""||e===void 0}function ld(e){const t=Ve(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(i=>{const l=r.current+i;t(l),(function d(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>d(""),1e3))})(l)},[t]),s=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=k_(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==r));const d=i.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return d!==r?d:void 0}function k_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var N_=Dc,E_=$c,P_=Uc,T_=Hc,A_=Vc,O_=Wc,R_=Yc,L_=Qc,I_=ed,z_=rd,M_=nd,D_=od;function $t({...e}){return a.jsx(N_,{"data-slot":"select",...e})}function Bt({...e}){return a.jsx(P_,{"data-slot":"select-value",...e})}function Ut({className:e,size:t="default",children:r,...n}){return a.jsxs(E_,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(T_,{asChild:!0,children:a.jsx(fo,{className:"ecr-select__icon"})})]})}function Ht({className:e,children:t,position:r="popper",align:n="center",...o}){const s=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(A_,{container:s,children:a.jsxs(O_,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(F_,{}),a.jsx(R_,{className:F("ecr-select__viewport"),children:t}),a.jsx($_,{})]})})}function Vt({className:e,children:t,...r}){return a.jsxs(L_,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(z_,{children:a.jsx(Mf,{className:"ecr-select__check-icon"})})}),a.jsx(I_,{children:t})]})}function F_({className:e,...t}){return a.jsx(M_,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Df,{className:"ecr-select__icon"})})}function $_({className:e,...t}){return a.jsx(D_,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(fo,{className:"ecr-select__icon"})})}const B_=({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($t,{value:e,onValueChange:t,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsx(Ht,{children:Ku.map(r=>a.jsx(Vt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),U_={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 H_(){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($t,{defaultValue:Za[0].value,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsxs(Ht,{children:[Za.map(e=>a.jsx(Vt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(Jt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(pr,{name:e.label,text:U_[e.value]})})]})},e.value))]})]})]})}const V_=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(H_,{}),a.jsx(B_,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]}),On=({label:e,text:t})=>a.jsxs(Rt,{children:[a.jsx(Lt,{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(Jt,{size:20})]}),a.jsx(K0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(It,{className:"ecr-admin-popover",children:a.jsx(pr,{name:e,text:t})})]});var Rn="Collapsible",[W_]=He(Rn),[q_,pa]=W_(Rn),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:s,onOpenChange:i,...l}=e,[d,c]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:Rn});return a.jsx(q_,{scope:r,disabled:s,contentId:Ne(),open:d,onOpenToggle:x.useCallback(()=>c(u=>!u),[c]),children:a.jsx(W.div,{"data-state":fa(d),"data-disabled":s?"":void 0,...l,ref:t})})});dd.displayName=Rn;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=pa(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":fa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ma="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pa(ma,e.__scopeCollapsible);return a.jsx(Ke,{present:r||o.open,children:({present:s})=>a.jsx(G_,{...n,ref:t,present:s})})});md.displayName=ma;var G_=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...s}=e,i=pa(ma,r),[l,d]=x.useState(n),c=x.useRef(null),u=Y(t,c),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=i.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const _=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(_)},[]),se(()=>{const _=c.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),d(n)}},[i.open,n]),a.jsx(W.div,{"data-state":fa(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!f,...s,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 fa(e){return e?"open":"closed"}var K_=dd,Y_=pd,X_=md;function fd({className:e,...t}){return a.jsx(K_,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(Y_,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(fo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(X_,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const J_=({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($t,{value:e,onValueChange:t,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsx(Ht,{children:Gu.map(r=>a.jsx(Vt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Z_=[{Icon:Vf,value:"desktop"},{Icon:qf,value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:s,id:i,wrapperStyles:l,hideSlider:d,device:c,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:i,className:"ecr-admin-range__label",children:[e,":",a.jsxs($t,{value:c,onValueChange:u,children:[a.jsx(Ut,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Bt,{})}),a.jsx(Ht,{style:{minWidth:"60px"},children:Z_.map(h=>a.jsx(Vt,{value:h.value,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!d&&a.jsx("input",{type:"range",id:i,name:s,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(Jo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},Q_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop");return a.jsx(xd,{label:"Gap",min:0,max:80,value:(r==="mobile"?e?.gapOnMobile:e?.gap)??16,onChange:r==="mobile"?o=>t(s=>({...s,gapOnMobile:o})):o=>t(s=>({...s,gap:o})),name:"column_gap",id:"column-gap",device:r,setDevice:n})},ev=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop");return a.jsx(xd,{label:"Size",min:150,max:400,value:(r==="mobile"?e?.sizeOnMobile:e?.size)??150,onChange:r==="mobile"?o=>t(s=>({...s,sizeOnMobile:o})):o=>t(s=>({...s,size:o})),name:"size",id:"size",device:r,setDevice:n})},tv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],rv=({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:tv.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(qp,{color:"#2563eb",size:16}):a.jsx(Gp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},nv=Object.values(Ja),ov={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!"})},av=({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($t,{value:e,onValueChange:t,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsxs(Ht,{children:[nv.map(r=>a.jsx(Vt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(Jt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(pr,{name:r,text:ov[r]})})]})},r))]})]})]}),sv=({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(Bf,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(rv,{selectedShape:r?.shape,handleShape:o=>n(s=>({...s,shape:o}))}),a.jsx(av,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(s=>({...s,template:o}))}),a.jsx(J_,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(s=>({...s,appearance:o}))}),a.jsx(ev,{styles:r,updateStyles:n}),a.jsx(Q_,{styles:r,updateStyles:n}),a.jsx(On,{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(On,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(On,{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(On,{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!"})})]})]}),iv=({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($t,{value:e,onValueChange:t,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsx(Ht,{children:Wu.map(r=>a.jsx(Vt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),lv=({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(Wf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Zo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(s=>({...s,border:{...s.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(s=>({...s,border:{...s.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Zo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(s=>({...s,border:{...s.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(iv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(s=>({...s,hoverEffect:o}))})]})]}),cv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",s=r==="style",i=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(sv,{handleSectionOpen:i,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(lv,{isStyleOpen:s,handleSectionOpen:i,styles:e,updateStyles:t})]})},dv=({styles:e,setStyles:t,isExpanded:r,setIsEdited:n,tabs:o,currentTab:s,setCurrentTab:i})=>{const l=c=>{t(u=>{const p=c(u);return n(!0),p})},d=c=>{(c===o.thumbnail||c===o.preview)&&i(c)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),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(Qb,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(e_,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:o.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:o.preview,children:"Preview"})]}),a.jsx(Ic,{value:o.thumbnail,children:a.jsx(cv,{styles:e,updateStyles:l})}),a.jsx(Ic,{value:o.preview,children:a.jsx(V_,{styles:e,updateStyles:l})})]})})]})},uv=e=>{const t=Se(),[r,n]=y.useState(""),[o,s]=y.useState([]),[i,l]=y.useState(et),[d,c]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){c(!1);return}c(!0);try{const _=(await pe.get(`stories/${e}`)).data;n(_.group_name),s(_.stories),l(_.styles??et)}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!")}finally{c(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),_={group_name:r,styles:i,story_ids:v};e&&(_.group_id=e);const w=await pe.post("stories/manage-group-stories",_);if(!e){const j=w.data.group_id;t(`?view=${K.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:s,styles:i,setStyles:l,isLoading:d,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),G.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?G.error(h.message):G.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},pv=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),s=y.useRef(!1),i=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){i.current=m;return}if(s.current){s.current=!1,i.current=m;return}m!==i.current&&(o.current=m,window.location.hash=i.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,s.current=!0,p();return}if(o.current){const p=o.current;o.current=null,s.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{s.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},mv=()=>{const e=Se(),{state:t}=Kt(),[r]=Yt(),n=r.get("gid"),{groupTitle:o,setGroupTitle:s,thisGroupReels:i,setThisGroupReels:l,styles:d,setStyles:c,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=uv(n),{allReels:f,setAllReels:h,searchTerm:v,setSearchTerm:_,isSearching:w,lastStoryElementRef:j}=Zs(n),[C,N]=y.useState(""),[k,E]=y.useState(!0),[P,T]=y.useState(bd.thumbnail),{showLeaveModal:R,requestLeave:L,confirmLeave:I,cancelLeave:O,allowNextNavigation:D}=pv(m),z=async(A,q)=>{try{N(A.story_uuid);const X=q==="add"?[A,...i]:i.filter(Z=>Z.story_uuid!==A.story_uuid);l(X),h(q==="add"?Z=>Z.filter(me=>me.story_uuid!==A.story_uuid):Z=>[...Z,A]),g(!0)}catch(X){X instanceof Error?G.error(X.message):G.error("Something went wrong. Please try again later!")}finally{N("")}};y.useEffect(()=>{if(!u&&t){const A=f.findIndex(q=>q.id==t.storyId);if(A!==-1){const q=f[A];h(X=>X.filter(Z=>Z.id!=q.id)),l(X=>[q,...X]),g(!0)}}},[t,f,u,h,l,g]);const B=async()=>{const A=await b();A?.isNewGroup&&D(()=>{e(`?view=${K.mg}&gid=${A.group_id}`,{replace:!0})})};return u?a.jsx(Rr,{}):a.jsxs(Sb,{value:{requestLeave:L},children:[a.jsx(_t,{left:[a.jsx(vt,{name:"Manage Widget",Icon:Tr},"page"),a.jsx(tr,{cb:()=>L(()=>e(`?view=${K.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Qs,{placeholder:"Enter group title",title:o,setTitle:s,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Vo,{children:[a.jsx(Wo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(X0,{})}),a.jsxs(qo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Customize title appearance"})}),a.jsx(yb,{styles:d,setStyles:c,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(w0,{asChild:!0,children:a.jsx(re,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(Y0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(uo,{onSave:B,isSaving:p,disabled:!m},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Manage Widget"}],onNavigate:A=>L(()=>e(A))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Rb,{allReels:f,gid:n,handleSelectReel:z,searchTerm:v,setSearchTerm:_,isSearching:w,togglingId:C,lastStoryElementRef:j}),a.jsx(Ob,{gid:n,reels:i,styles:d,handleRemoveReel:z,togglingId:C,currentTab:P}),a.jsx(dv,{isExpanded:k,setIsEdited:g,styles:d,setStyles:c,tabs:bd,setCurrentTab:T,currentTab:P})]}),R&&a.jsx(Ar,{onReject:O,onAccept:I,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function fv(){const[e]=Yt(),t=e.get("view")||K.ag;let r;switch(t){case K.settings:r=a.jsx(H0,{});break;case K.ar:r=a.jsx(Cf,{});break;case K.stat:r=a.jsx(q0,{});break;case K.cr:r=a.jsx(R0,{});break;case K.mg:r=a.jsx(mv,{});break;default:r=a.jsx(B0,{})}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 pe.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"),hv=()=>{const e=y.useContext(ha);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:s,setStoryViews:i}=e,[l,d]=y.useState(r.length-1),[c,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=c?.links&&c.links.length>0?c.links[0]:null,j=t?.playerAppearance??"overlay",C=y.useRef(""),N=y.useCallback((I,O=1)=>{if(r.length===0)return null;let D=I;for(let z=0;z<r.length;z+=1){const B=r[D];if(vd(B))return{story:B,index:D};D=(D+O+r.length)%r.length}return null},[r]),k=y.useCallback(()=>{d(r.length-1);const I=r.findIndex(z=>String(z.story_uuid)===o),O=I>=0?r[I]:null,D=vd(O)?{story:O,index:I}:N(Math.max(I,0),1);if(!D?.story){u(null),m(!1);return}u(D.story),I!==D.index&&D.story.story_uuid!==o&&s(D.story.story_uuid),_({index:0,story_uuid:D.story.story_uuid}),m(!1)},[N,o,s,r]);y.useEffect(()=>{k()},[k]),y.useEffect(()=>(C.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=C.current}),[]);const E=y.useCallback(()=>{s(null)},[s]),P=y.useCallback((I=1)=>{m(!0);const O=r.findIndex(q=>String(q.story_uuid)===String(o)),D=I>0?1:-1,z=I>0?l>O?O+1:0:O>0?O-1:l,B=N(z,D);if(!B?.story){m(!1);return}const A=B.story;if(A.story_uuid===o){m(!1),E();return}_({index:0,story_uuid:A.story_uuid}),n&&_d(n,A.id,i),s(A.story_uuid),m(!1)},[E,N,n,o,l,s,i,r]),T=y.useCallback(()=>{const I=c?.files??[];if(v.index>0){_(O=>({index:O.index-1,story_uuid:I[O.index-1].story_uuid??""}));return}P(-1)},[v.index,P,c?.files]),R=y.useCallback(()=>{const I=c?.files??[];if(v.index+1<I.length){_(O=>({index:O.index+1,story_uuid:I[O.index+1].story_uuid??""}));return}P(1)},[v.index,P,c?.files]),L=y.useCallback(I=>{I.target===I.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:v,duration:g,handleBackdropClick:L,handleNextFile:R,handlePrevFile:T,isLoadingNext:p,isPaused:f,playingStory:c,setDuration:b,setIsPaused:h,setIsPlaying:s,firstLink:w,playerAppearance:j}},gv=()=>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"})]})})}),xv=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:s,isLoadingNext:i,isPaused:l,playerAppearance:d,playingStory:c,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=hv();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:c&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(xt,{onClick:s,className:"ecr-player__nav--left",children:a.jsx(Zt,{size:24})}),a.jsx(xt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(Qt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[c&&a.jsx(ss,{playingStory:c,duration:r,currentFileIndex:t,isPaused:l},`${c.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(er,{className:"ecr-player__close-icon"})}),i?a.jsx(gv,{}):c?.files.length>0&&a.jsx(ds,{currentFileIndex:t,files:c?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:s,handleNextFile:o,storyId:c.id,storyTitle:c?.title}),d==="overlay"&&u?a.jsx(Cn,{link:u,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,d==="title"?a.jsx(kn,{title:c.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const s=e.links&&e.links.length>0?e.links[0]:null,i=t.appearance??"overlay";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(Jn,{story:e,styles:t,storyViews:n,setStoryViews:o}),i==="overlay"&&t.shape==="rectangle"?s?a.jsx(Cn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(kn,{title:e.title}):null]}),i==="title"?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},bv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:l,canScrollLeft:d,canScrollRight:c,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:s,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:i,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&&d&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Zt,{size:20,style:{width:"20px",height:"20px"}})}),l&&c&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Qt,{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(s=>s?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:s,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},s.story_uuid):null)})}),_v={carousel:bv,grid:wd},vv=()=>{const e=y.useContext(ha),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:s,storyViews:i,setStoryViews:l}=e,d=y.useRef(!0);y.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);const c=r.template??"carousel",u=_v[c]||wd,p=({sid:m,story_uuid:g})=>{s(g),o&&_d(o,m,l,{isActive:()=>d.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${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-mobile":`${r?.gapOnMobile??r?.gap}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:i,setStoryViews:l})]})},yv=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[s,i]=y.useState(et),[l,d]=y.useState(!1),[c,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),i(et),d(!1),u(null);return}const g=new AbortController;d(!0),u(null);try{const b=await pe.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),i(b.data.styles||et)}catch(b){if(g.signal.aborted)return;u(b)}finally{d(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:s,isLoading:l,error:c}},ha=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:s,stories:i,styles:l}=yv(e);return a.jsxs(ha.Provider,{value:{groupTitle:s,groupId:e,stories:i,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(xv,{}),a.jsx(vv,{})]})};_a(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(Zd,{children:a.jsx(fv,{})}))}),_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;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM); -
ecomm-reels/tags/4.0.11/ecomm-reels.php
r3452800 r3454572 3 3 * Plugin Name: ReelsWp - Shoppable Videos & Vertical Reels Carousels 4 4 * 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.0.1 05 * Version: 4.0.11 6 6 * Requires at least: 5.8 7 7 * Requires PHP: 7.4 … … 20 20 define('ECOMMREELS_ASSETS', plugins_url('/', __FILE__)); 21 21 define('ECOMMREELS_FILE_PREFIX', 'class-'); 22 define('WP_REELS_VER', '4.0.1 0');22 define('WP_REELS_VER', '4.0.11'); 23 23 24 24 // 1) Composer autoloader (optional, guarded) -
ecomm-reels/tags/4.0.11/readme.txt
r3452800 r3454572 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 4.0.1 07 Stable tag: 4.0.11 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 100 100 == Changelog == 101 101 102 = 4.0.11 - 2026-02-05 = 103 - New: Added multiple reel delete functionality for easier bulk management. 104 - New: Added responsive controls for adjusting size and spacing across desktop and mobile screen sizes. 105 102 106 = 4.0.10 - 2026-02-03 = 103 107 - New: Added a documentation link for easier access to setup and usage guides. -
ecomm-reels/trunk/CHANGELOG.md
r3452800 r3454572 1 1 # Changelog 2 3 ## [4.0.11](https://github.com/dstudio-asia/reels-wp/compare/v4.0.10...v4.0.11) (2026-02-05) 4 5 6 ### Features 7 8 * add bulk delete for selected reels ([9a7beb2](https://github.com/dstudio-asia/reels-wp/commit/9a7beb29f8072707188bb8c776aeed35c1d3c4c6)) 9 * add bulk delete for selected reels ([e2dfdca](https://github.com/dstudio-asia/reels-wp/commit/e2dfdcaa9eb3d280659f87b10762b9f4fbef7dc1)) 10 * add danger outline button style for bulk delete ([a64cd70](https://github.com/dstudio-asia/reels-wp/commit/a64cd702b7ac072fccaf624dd8d9d3020c40c815)) 11 * add danger outline button style for bulk delete ([114056c](https://github.com/dstudio-asia/reels-wp/commit/114056c9807186b9d01ba983a4886bbd69612184)) 12 * **ui:** add responsive size and gap controls ([6769ac0](https://github.com/dstudio-asia/reels-wp/commit/6769ac0967b6be5c0fbf10845a817a44c927f79e)) 13 * **ui:** add responsive thumbnail size and gap support ([12a4bfd](https://github.com/dstudio-asia/reels-wp/commit/12a4bfd9edc0ae3268dfdfd7180888772b9de8a6)) 14 15 16 ### Bug Fixes 17 18 * **player:** move modal backdrop styles to CSS ([e5ddd91](https://github.com/dstudio-asia/reels-wp/commit/e5ddd9170ce06840bc9cf177d84f91b401da5104)) 19 * remove unused bulk delete code ([8ae4d6d](https://github.com/dstudio-asia/reels-wp/commit/8ae4d6d18316dc5a707504c5779f827b8358bdb7)) 2 20 3 21 ## [4.0.10](https://github.com/dstudio-asia/reels-wp/compare/v4.0.9...v4.0.10) (2026-02-03) -
ecomm-reels/trunk/build/index.js
r3452800 r3454572 1 (function(y, xa,In,ba){"use strict";var _a=document.createElement("style");_a.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:color-mix(in srgb,#1f2937) 90%,#000}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:color-mix(in srgb,#e5e7eb 90%,#000)}#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--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{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}#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:20;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:50;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:50;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}#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;inset:0;display:grid;place-items:center;width:100%;height:100vh}#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:50;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(var(--thumbnail-size, 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:40;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:50;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:999;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__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{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:50;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-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#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:grid;cursor:pointer;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-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:70}#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-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:50}#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:60}#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:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:50;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:30;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}@media(min-width:1024px){#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-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}#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}#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}#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:10;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{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:12px;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}#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:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:48px;text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff}: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}#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}#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:20;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}#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:50;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:50;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:1024px){#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}#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;background:#fff;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:280px;border:2px solid #e5e7eb}#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-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:50}#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-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-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:50;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}#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{cursor:pointer;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{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}#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:10;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, 150px),1fr))}2 /*$vite$:1*/`,document.head.appendChild( _a);function va(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 g=va(y),_r=va(ba);function jd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},$t={};/**1 (function(y,_a,Ln,va){"use strict";var ya=document.createElement("style");ya.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{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}#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:20;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:50;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:50;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:50;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:40;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:50;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:999;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__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:50;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-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#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:grid;cursor:pointer;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-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:70}#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-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:50}#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:60}#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:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:50;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:30;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}@media(min-width:1024px){#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-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}#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)}}#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:10;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:12px;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}#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:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:48px;text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff}: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}#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)}}#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:20;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)}}#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:50;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:50;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:1024px){#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}#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;background:#fff;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:280px;border:2px solid #e5e7eb}#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-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:50}#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-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-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:50;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)}}#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{cursor:pointer;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)}}#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:10;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))}} 2 /*$vite$:1*/`,document.head.appendChild(ya);function wa(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=wa(y),br=wa(va);function Cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},Wt={};/** 3 3 * @license React 4 4 * react-jsx-runtime.production.min.js … … 8 8 * This source code is licensed under the MIT license found in the 9 9 * LICENSE file in the root directory of this source tree. 10 */var ya;function Sd(){if(ya)return $t;ya=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(c,l,d){var u,p={},m=null,h=null;d!==void 0&&(m=""+d),l.key!==void 0&&(m=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)n.call(l,u)&&!s.hasOwnProperty(u)&&(p[u]=l[u]);if(c&&c.defaultProps)for(u in l=c.defaultProps,l)p[u]===void 0&&(p[u]=l[u]);return{$$typeof:t,type:c,key:m,ref:h,props:p,_owner:o.current}}return $t.Fragment=r,$t.jsx=i,$t.jsxs=i,$t}var wa;function Cd(){return wa||(wa=1,zn.exports=Sd()),zn.exports}var a=Cd();/**10 */var ja;function kd(){if(ja)return Wt;ja=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(l,d,c){var u,p={},m=null,g=null;c!==void 0&&(m=""+c),d.key!==void 0&&(m=""+d.key),d.ref!==void 0&&(g=d.ref);for(u in d)n.call(d,u)&&!s.hasOwnProperty(u)&&(p[u]=d[u]);if(l&&l.defaultProps)for(u in d=l.defaultProps,d)p[u]===void 0&&(p[u]=d[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Wt.Fragment=r,Wt.jsx=i,Wt.jsxs=i,Wt}var Sa;function Nd(){return Sa||(Sa=1,In.exports=kd()),In.exports}var a=Nd();/** 11 11 * @remix-run/router v1.23.2 12 12 * … … 17 17 * 18 18 * @license MIT 19 */function Bt(){return Bt=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},Bt.apply(this,arguments)}var Qe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qe||(Qe={}));const ja="popstate";function kd(e){e===void 0&&(e={});function t(o,s){let{pathname:i="/",search:c="",hash:l=""}=Ut(o.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),Mn("",{pathname:i,search:c,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(o,s){let i=o.document.querySelector("base"),c="";if(i&&i.getAttribute("href")){let l=o.location.href,d=l.indexOf("#");c=d===-1?l:l.slice(0,d)}return c+"#"+(typeof s=="string"?s:vr(s))}function n(o,s){Sa(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(s)+")")}return Ed(t,r,n,e)}function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Sa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Nd(){return Math.random().toString(36).substr(2,8)}function Ca(e,t){return{usr:e.state,key:e.key,idx:t}}function Mn(e,t,r,n){return r===void 0&&(r=null),Bt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ut(t):t,{state:r,key:t&&t.key||n||Nd()})}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 Ut(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 Ed(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,c=Qe.Pop,l=null,d=u();d==null&&(d=0,i.replaceState(Bt({},i.state,{idx:d}),""));function u(){return(i.state||{idx:null}).idx}function p(){c=Qe.Pop;let x=u(),v=x==null?null:x-d;d=x,l&&l({action:c,location:f.location,delta:v})}function m(x,v){c=Qe.Push;let _=Mn(f.location,x,v);r&&r(_,x),d=u()+1;let w=Ca(_,d),j=f.createHref(_);try{i.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}s&&l&&l({action:c,location:f.location,delta:1})}function h(x,v){c=Qe.Replace;let _=Mn(f.location,x,v);r&&r(_,x),d=u();let w=Ca(_,d),j=f.createHref(_);i.replaceState(w,"",j),s&&l&&l({action:c,location:f.location,delta:0})}function b(x){let v=o.location.origin!=="null"?o.location.origin:o.location.href,_=typeof x=="string"?x:vr(x);return _=_.replace(/ $/,"%20"),be(v,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,v)}let f={get action(){return c},get location(){return e(o,i)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(ja,p),l=x,()=>{o.removeEventListener(ja,p),l=null}},createHref(x){return t(o,x)},createURL:b,encodeLocation(x){let v=b(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:h,go(x){return i.go(x)}};return f}var ka;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ka||(ka={}));function Na(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 Td=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ad=e=>Td.test(e);function Pd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Ut(e):e,s;if(r)if(Ad(r))s=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),Sa(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+r))}r.startsWith("/")?s=Ea(r.substring(1),"/"):s=Ea(r,t)}else s=t;return{pathname:s,search:Rd(n),hash:Ld(o)}}function Ea(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 Od(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ta(e,t){let r=Od(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Aa(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Ut(e):(o=Bt({},e),be(!o.pathname||!o.pathname.includes("?"),Dn("?","pathname","search",o)),be(!o.pathname||!o.pathname.includes("#"),Dn("#","pathname","hash",o)),be(!o.search||!o.search.includes("#"),Dn("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,c;if(i==null)c=r;else{let p=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}c=p>=0?t[p]:"/"}let l=Pd(o,c),d=i&&i!=="/"&&i.endsWith("/"),u=(s||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(d||u)&&(l.pathname+="/"),l}const Pa=e=>e.join("/").replace(/\/\/+/g,"/"),Rd=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ld=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Oa=["post","put","patch","delete"];new Set(Oa);const Id=["get",...Oa];new Set(Id);/**19 */function qt(){return qt=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},qt.apply(this,arguments)}var Qe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qe||(Qe={}));const Ca="popstate";function Ed(e){e===void 0&&(e={});function t(o,s){let{pathname:i="/",search:l="",hash:d=""}=Gt(o.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),zn("",{pathname:i,search:l,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(o,s){let i=o.document.querySelector("base"),l="";if(i&&i.getAttribute("href")){let d=o.location.href,c=d.indexOf("#");l=c===-1?d:d.slice(0,c)}return l+"#"+(typeof s=="string"?s:_r(s))}function n(o,s){ka(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(s)+")")}return Td(t,r,n,e)}function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Pd(){return Math.random().toString(36).substr(2,8)}function Na(e,t){return{usr:e.state,key:e.key,idx:t}}function zn(e,t,r,n){return r===void 0&&(r=null),qt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Gt(t):t,{state:r,key:t&&t.key||n||Pd()})}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 Gt(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 Td(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,l=Qe.Pop,d=null,c=u();c==null&&(c=0,i.replaceState(qt({},i.state,{idx:c}),""));function u(){return(i.state||{idx:null}).idx}function p(){l=Qe.Pop;let h=u(),v=h==null?null:h-c;c=h,d&&d({action:l,location:f.location,delta:v})}function m(h,v){l=Qe.Push;let _=zn(f.location,h,v);r&&r(_,h),c=u()+1;let w=Na(_,c),j=f.createHref(_);try{i.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}s&&d&&d({action:l,location:f.location,delta:1})}function g(h,v){l=Qe.Replace;let _=zn(f.location,h,v);r&&r(_,h),c=u();let w=Na(_,c),j=f.createHref(_);i.replaceState(w,"",j),s&&d&&d({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"),be(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,i)},listen(h){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(Ca,p),d=h,()=>{o.removeEventListener(Ca,p),d=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 i.go(h)}};return f}var Ea;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ea||(Ea={}));function Pa(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 Ad=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=e=>Ad.test(e);function Rd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Gt(e):e,s;if(r)if(Od(r))s=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),ka(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+r))}r.startsWith("/")?s=Ta(r.substring(1),"/"):s=Ta(r,t)}else s=t;return{pathname:s,search:Id(n),hash:zd(o)}}function Ta(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 Mn(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 Aa(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 Oa(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Gt(e):(o=qt({},e),be(!o.pathname||!o.pathname.includes("?"),Mn("?","pathname","search",o)),be(!o.pathname||!o.pathname.includes("#"),Mn("#","pathname","hash",o)),be(!o.search||!o.search.includes("#"),Mn("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,l;if(i==null)l=r;else{let p=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let d=Rd(o,l),c=i&&i!=="/"&&i.endsWith("/"),u=(s||i===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(c||u)&&(d.pathname+="/"),d}const Ra=e=>e.join("/").replace(/\/\/+/g,"/"),Id=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zd=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,La=["post","put","patch","delete"];new Set(La);const Md=["get",...La];new Set(Md);/** 20 20 * React Router v6.30.3 21 21 * … … 26 26 * 27 27 * @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 Ra=g.createContext(null),ft=g.createContext(null),Fn=g.createContext(null),wr=g.createContext({outlet:null,matches:[],isDataRoute:!1});function zd(e,t){let{relative:r}=t===void 0?{}:t;jr()||be(!1);let{basename:n,navigator:o}=g.useContext(ft),{hash:s,pathname:i,search:c}=Ia(e,{relative:r}),l=i;return n!=="/"&&(l=i==="/"?n:Pa([n,i])),o.createHref({pathname:l,search:c,hash:s})}function jr(){return g.useContext(Fn)!=null}function Ht(){return jr()||be(!1),g.useContext(Fn).location}function La(e){g.useContext(ft).static||g.useLayoutEffect(e)}function Se(){let{isDataRoute:e}=g.useContext(wr);return e?Bd():Md()}function Md(){jr()||be(!1);let e=g.useContext(Ra),{basename:t,future:r,navigator:n}=g.useContext(ft),{matches:o}=g.useContext(wr),{pathname:s}=Ht(),i=JSON.stringify(Ta(o,r.v7_relativeSplatPath)),c=g.useRef(!1);return La(()=>{c.current=!0}),g.useCallback(function(d,u){if(u===void 0&&(u={}),!c.current)return;if(typeof d=="number"){n.go(d);return}let p=Aa(d,JSON.parse(i),s,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Pa([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,i,s,e])}function Ia(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=g.useContext(ft),{matches:o}=g.useContext(wr),{pathname:s}=Ht(),i=JSON.stringify(Ta(o,n.v7_relativeSplatPath));return g.useMemo(()=>Aa(e,JSON.parse(i),s,r==="path"),[e,i,s,r])}var za=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(za||{}),Ma=(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})(Ma||{});function Dd(e){let t=g.useContext(Ra);return t||be(!1),t}function Fd(e){let t=g.useContext(wr);return t||be(!1),t}function $d(e){let t=Fd(),r=t.matches[t.matches.length-1];return r.route.id||be(!1),r.route.id}function Bd(){let{router:e}=Dd(za.UseNavigateStable),t=$d(Ma.UseNavigateStable),r=g.useRef(!1);return La(()=>{r.current=!0}),g.useCallback(function(o,s){s===void 0&&(s={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},s)))},[e,t])}function Ud(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Hd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Qe.Pop,navigator:s,static:i=!1,future:c}=e;jr()&&be(!1);let l=t.replace(/^\/*/,"/"),d=g.useMemo(()=>({basename:l,navigator:s,static:i,future:yr({v7_relativeSplatPath:!1},c)}),[l,c,s,i]);typeof n=="string"&&(n=Ut(n));let{pathname:u="/",search:p="",hash:m="",state:h=null,key:b="default"}=n,f=g.useMemo(()=>{let x=Na(u,l);return x==null?null:{location:{pathname:x,search:p,hash:m,state:h,key:b},navigationType:o}},[l,u,p,m,h,b,o]);return f==null?null:g.createElement(ft.Provider,{value:d},g.createElement(Fn.Provider,{children:r,value:f}))}new Promise(()=>{});/**28 */function vr(){return vr=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},vr.apply(this,arguments)}const Ia=x.createContext(null),ft=x.createContext(null),Dn=x.createContext(null),yr=x.createContext({outlet:null,matches:[],isDataRoute:!1});function Dd(e,t){let{relative:r}=t===void 0?{}:t;wr()||be(!1);let{basename:n,navigator:o}=x.useContext(ft),{hash:s,pathname:i,search:l}=Ma(e,{relative:r}),d=i;return n!=="/"&&(d=i==="/"?n:Ra([n,i])),o.createHref({pathname:d,search:l,hash:s})}function wr(){return x.useContext(Dn)!=null}function Kt(){return wr()||be(!1),x.useContext(Dn).location}function za(e){x.useContext(ft).static||x.useLayoutEffect(e)}function Se(){let{isDataRoute:e}=x.useContext(yr);return e?Hd():Fd()}function Fd(){wr()||be(!1);let e=x.useContext(Ia),{basename:t,future:r,navigator:n}=x.useContext(ft),{matches:o}=x.useContext(yr),{pathname:s}=Kt(),i=JSON.stringify(Aa(o,r.v7_relativeSplatPath)),l=x.useRef(!1);return za(()=>{l.current=!0}),x.useCallback(function(c,u){if(u===void 0&&(u={}),!l.current)return;if(typeof c=="number"){n.go(c);return}let p=Oa(c,JSON.parse(i),s,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ra([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,i,s,e])}function Ma(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=x.useContext(ft),{matches:o}=x.useContext(yr),{pathname:s}=Kt(),i=JSON.stringify(Aa(o,n.v7_relativeSplatPath));return x.useMemo(()=>Oa(e,JSON.parse(i),s,r==="path"),[e,i,s,r])}var Da=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Da||{}),Fa=(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})(Fa||{});function $d(e){let t=x.useContext(Ia);return t||be(!1),t}function Bd(e){let t=x.useContext(yr);return t||be(!1),t}function Ud(e){let t=Bd(),r=t.matches[t.matches.length-1];return r.route.id||be(!1),r.route.id}function Hd(){let{router:e}=$d(Da.UseNavigateStable),t=Ud(Fa.UseNavigateStable),r=x.useRef(!1);return za(()=>{r.current=!0}),x.useCallback(function(o,s){s===void 0&&(s={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,vr({fromRouteId:t},s)))},[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=Qe.Pop,navigator:s,static:i=!1,future:l}=e;wr()&&be(!1);let d=t.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:d,navigator:s,static:i,future:vr({v7_relativeSplatPath:!1},l)}),[d,l,s,i]);typeof n=="string"&&(n=Gt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:b="default"}=n,f=x.useMemo(()=>{let h=Pa(u,d);return h==null?null:{location:{pathname:h,search:p,hash:m,state:g,key:b},navigationType:o}},[d,u,p,m,g,b,o]);return f==null?null:x.createElement(ft.Provider,{value:c},x.createElement(Dn.Provider,{children:r,value:f}))}new Promise(()=>{});/** 29 29 * React Router DOM v6.30.3 30 30 * … … 35 35 * 36 36 * @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 Vd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Wd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qd(e,t){return e.button===0&&(!t||t==="_self")&&!Wd(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 Gd(e,t){let r=Bn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}const Kd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yd="6";try{window.__reactRouterVersion=Yd}catch{}const Da=g["startTransition"];function Xd(e){let{basename:t,children:r,future:n,window:o}=e,s=g.useRef();s.current==null&&(s.current=kd({window:o,v5Compat:!0}));let i=s.current,[c,l]=g.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},u=g.useCallback(p=>{d&&Da?Da(()=>l(p)):l(p)},[l,d]);return g.useLayoutEffect(()=>i.listen(u),[i,u]),g.useEffect(()=>Ud(n),[n]),g.createElement(Hd,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:i,future:n})}const Jd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ht=g.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:s,replace:i,state:c,target:l,to:d,preventScrollReset:u,viewTransition:p}=t,m=Vd(t,Kd),{basename:h}=g.useContext(ft),b,f=!1;if(typeof d=="string"&&Zd.test(d)&&(b=d,Jd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=Na(j.pathname,h);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let x=zd(d,{relative:o}),v=Qd(d,{replace:i,state:c,target:l,preventScrollReset:u,relative:o,viewTransition:p});function _(w){n&&n(w),w.defaultPrevented||v(w)}return g.createElement("a",$n({},m,{href:b||x,onClick:f||s?n:_,ref:r,target:l}))});var Fa;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Fa||(Fa={}));var $a;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})($a||($a={}));function Qd(e,t){let{target:r,replace:n,state:o,preventScrollReset:s,relative:i,viewTransition:c}=t===void 0?{}:t,l=Se(),d=Ht(),u=Ia(e,{relative:i});return g.useCallback(p=>{if(qd(p,r)){p.preventDefault();let m=n!==void 0?n:vr(d)===vr(u);l(e,{replace:m,state:o,preventScrollReset:s,relative:i,viewTransition:c})}},[d,l,u,n,o,r,e,s,i,c])}function Vt(e){let t=g.useRef(Bn(e)),r=g.useRef(!1),n=Ht(),o=g.useMemo(()=>Gd(n.search,r.current?null:t.current),[n.search]),s=Se(),i=g.useCallback((c,l)=>{const d=Bn(typeof c=="function"?c(o):c);r.current=!0,s("?"+d,l)},[s,o]);return[o,i]}let eu={data:""},tu=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||eu},ru=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,nu=/\/\*[^]*?\*\/| +/g,Ba=/\n+/g,Be=(e,t)=>{let r="",n="",o="";for(let s in e){let i=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+i+";":n+=s[1]=="f"?Be(i,s):s+"{"+Be(i,s[1]=="k"?"":t)+"}":typeof i=="object"?n+=Be(i,t?t.replace(/([^,])+/g,c=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,c):c?c+" "+l:l)):s):i!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Be.p?Be.p(s,i):s+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Le={},Ua=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ua(e[r]);return t}return e},ou=(e,t,r,n,o)=>{let s=Ua(e),i=Le[s]||(Le[s]=(l=>{let d=0,u=11;for(;d<l.length;)u=101*u+l.charCodeAt(d++)>>>0;return"go"+u})(s));if(!Le[i]){let l=s!==e?e:(d=>{let u,p,m=[{}];for(;u=ru.exec(d.replace(nu,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Ba," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Ba," ").trim();return m[0]})(e);Le[i]=Be(o?{["@keyframes "+i]:l}:l,r?"":"."+i)}let c=r&&Le.g?Le.g:null;return r&&(Le.g=Le[i]),((l,d,u,p)=>{p?d.data=d.data.replace(p,l):d.data.indexOf(l)===-1&&(d.data=u?l+d.data:d.data+l)})(Le[i],t,n,c),i},au=(e,t,r)=>e.reduce((n,o,s)=>{let i=t[s];if(i&&i.call){let c=i(r),l=c&&c.props&&c.props.className||/^go/.test(c)&&c;i=l?"."+l:c&&typeof c=="object"?c.props?"":Be(c,""):c===!1?"":c}return n+o+(i??"")},"");function Sr(e){let t=this||{},r=e.call?e(t.p):e;return ou(r.unshift?r.raw?au(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,tu(t.target),t.g,t.o,t.k)}let Ha,Un,Hn;Sr.bind({g:1});let Ie=Sr.bind({k:1});function su(e,t,r,n){Be.p=t,Ha=e,Un=r,Hn=n}function Ue(e,t){let r=this||{};return function(){let n=arguments;function o(s,i){let c=Object.assign({},s),l=c.className||o.className;r.p=Object.assign({theme:Un&&Un()},c),r.o=/ *go\d+/.test(l),c.className=Sr.apply(r,n)+(l?" "+l:"");let d=e;return e[0]&&(d=c.as||e,delete c.as),Hn&&d[0]&&Hn(c),Ha(d,c)}return o}}var iu=e=>typeof e=="function",Cr=(e,t)=>iu(e)?e(t):e,cu=(()=>{let e=0;return()=>(++e).toString()})(),Va=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),lu=20,Vn="default",Wa=(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(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return Wa(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+s}))}}},kr=[],qa={toasts:[],pausedAt:void 0,settings:{toastLimit:lu}},Ce={},Ga=(e,t=Vn)=>{Ce[t]=Wa(Ce[t]||qa,e),kr.forEach(([r,n])=>{r===t&&n(Ce[t])})},Ka=e=>Object.keys(Ce).forEach(t=>Ga(e,t)),du=e=>Object.keys(Ce).find(t=>Ce[t].toasts.some(r=>r.id===e)),Nr=(e=Vn)=>t=>{Ga(t,e)},uu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},pu=(e={},t=Vn)=>{let[r,n]=y.useState(Ce[t]||qa),o=y.useRef(Ce[t]);y.useEffect(()=>(o.current!==Ce[t]&&n(Ce[t]),kr.push([t,n]),()=>{let i=kr.findIndex(([c])=>c===t);i>-1&&kr.splice(i,1)}),[t]);let s=r.toasts.map(i=>{var c,l,d;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((c=e[i.type])==null?void 0:c.removeDelay)||e?.removeDelay,duration:i.duration||((l=e[i.type])==null?void 0:l.duration)||e?.duration||uu[i.type],style:{...e.style,...(d=e[i.type])==null?void 0:d.style,...i.style}}});return{...r,toasts:s}},mu=(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||cu()}),Wt=e=>(t,r)=>{let n=mu(t,e,r);return Nr(n.toasterId||du(n.id))({type:2,toast:n}),n.id},oe=(e,t)=>Wt("blank")(e,t);oe.error=Wt("error"),oe.success=Wt("success"),oe.loading=Wt("loading"),oe.custom=Wt("custom"),oe.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Nr(t)(r):Ka(r)},oe.dismissAll=e=>oe.dismiss(void 0,e),oe.remove=(e,t)=>{let r={type:4,toastId:e};t?Nr(t)(r):Ka(r)},oe.removeAll=e=>oe.remove(void 0,e),oe.promise=(e,t,r)=>{let n=oe.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?Cr(t.success,o):void 0;return s?oe.success(s,{id:n,...r,...r?.success}):oe.dismiss(n),o}).catch(o=>{let s=t.error?Cr(t.error,o):void 0;s?oe.error(s,{id:n,...r,...r?.error}):oe.dismiss(n)}),e};var fu=1e3,hu=(e,t="default")=>{let{toasts:r,pausedAt:n}=pu(e,t),o=y.useRef(new Map).current,s=y.useCallback((p,m=fu)=>{if(o.has(p))return;let h=setTimeout(()=>{o.delete(p),i({type:4,toastId:p})},m);o.set(p,h)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(h=>{if(h.duration===1/0)return;let b=(h.duration||0)+h.pauseDuration-(p-h.createdAt);if(b<0){h.visible&&oe.dismiss(h.id);return}return setTimeout(()=>oe.dismiss(h.id,t),b)});return()=>{m.forEach(h=>h&&clearTimeout(h))}},[r,n,t]);let i=y.useCallback(Nr(t),[t]),c=y.useCallback(()=>{i({type:5,time:Date.now()})},[i]),l=y.useCallback((p,m)=>{i({type:1,toast:{id:p,height:m}})},[i]),d=y.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),u=y.useCallback((p,m)=>{let{reverseOrder:h=!1,gutter:b=8,defaultPosition:f}=m||{},x=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),v=x.findIndex(w=>w.id===p.id),_=x.filter((w,j)=>j<v&&w.visible).length;return x.filter(w=>w.visible).slice(...h?[_+1]:[0,_]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)s(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:l,startPause:c,endPause:d,calculateOffset:u}}},gu=Ie`37 */function Fn(){return Fn=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},Fn.apply(this,arguments)}function qd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(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 $n(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=$n(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}const Xd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jd="6";try{window.__reactRouterVersion=Jd}catch{}const $a=x["startTransition"];function Zd(e){let{basename:t,children:r,future:n,window:o}=e,s=x.useRef();s.current==null&&(s.current=Ed({window:o,v5Compat:!0}));let i=s.current,[l,d]=x.useState({action:i.action,location:i.location}),{v7_startTransition:c}=n||{},u=x.useCallback(p=>{c&&$a?$a(()=>d(p)):d(p)},[d,c]);return x.useLayoutEffect(()=>i.listen(u),[i,u]),x.useEffect(()=>Vd(n),[n]),x.createElement(Wd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}const Qd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eu=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ht=x.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:s,replace:i,state:l,target:d,to:c,preventScrollReset:u,viewTransition:p}=t,m=qd(t,Xd),{basename:g}=x.useContext(ft),b,f=!1;if(typeof c=="string"&&eu.test(c)&&(b=c,Qd))try{let w=new URL(window.location.href),j=c.startsWith("//")?new URL(w.protocol+c):new URL(c),C=Pa(j.pathname,g);j.origin===w.origin&&C!=null?c=C+j.search+j.hash:f=!0}catch{}let h=Dd(c,{relative:o}),v=tu(c,{replace:i,state:l,target:d,preventScrollReset:u,relative:o,viewTransition:p});function _(w){n&&n(w),w.defaultPrevented||v(w)}return x.createElement("a",Fn({},m,{href:b||h,onClick:f||s?n:_,ref:r,target:d}))});var Ba;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ba||(Ba={}));var Ua;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ua||(Ua={}));function tu(e,t){let{target:r,replace:n,state:o,preventScrollReset:s,relative:i,viewTransition:l}=t===void 0?{}:t,d=Se(),c=Kt(),u=Ma(e,{relative:i});return x.useCallback(p=>{if(Kd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(c)===_r(u);d(e,{replace:m,state:o,preventScrollReset:s,relative:i,viewTransition:l})}},[c,d,u,n,o,r,e,s,i,l])}function Yt(e){let t=x.useRef($n(e)),r=x.useRef(!1),n=Kt(),o=x.useMemo(()=>Yd(n.search,r.current?null:t.current),[n.search]),s=Se(),i=x.useCallback((l,d)=>{const c=$n(typeof l=="function"?l(o):l);r.current=!0,s("?"+c,d)},[s,o]);return[o,i]}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,Ha=/\n+/g,Be=(e,t)=>{let r="",n="",o="";for(let s in e){let i=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+i+";":n+=s[1]=="f"?Be(i,s):s+"{"+Be(i,s[1]=="k"?"":t)+"}":typeof i=="object"?n+=Be(i,t?t.replace(/([^,])+/g,l=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,d=>/&/.test(d)?d.replace(/&/g,l):l?l+" "+d:d)):s):i!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Be.p?Be.p(s,i):s+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Le={},Va=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Va(e[r]);return t}return e},su=(e,t,r,n,o)=>{let s=Va(e),i=Le[s]||(Le[s]=(d=>{let c=0,u=11;for(;c<d.length;)u=101*u+d.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Le[i]){let d=s!==e?e:(c=>{let u,p,m=[{}];for(;u=ou.exec(c.replace(au,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Ha," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Ha," ").trim();return m[0]})(e);Le[i]=Be(o?{["@keyframes "+i]:d}:d,r?"":"."+i)}let l=r&&Le.g?Le.g:null;return r&&(Le.g=Le[i]),((d,c,u,p)=>{p?c.data=c.data.replace(p,d):c.data.indexOf(d)===-1&&(c.data=u?d+c.data:c.data+d)})(Le[i],t,n,l),i},iu=(e,t,r)=>e.reduce((n,o,s)=>{let i=t[s];if(i&&i.call){let l=i(r),d=l&&l.props&&l.props.className||/^go/.test(l)&&l;i=d?"."+d:l&&typeof l=="object"?l.props?"":Be(l,""):l===!1?"":l}return n+o+(i??"")},"");function jr(e){let t=this||{},r=e.call?e(t.p):e;return su(r.unshift?r.raw?iu(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 Wa,Bn,Un;jr.bind({g:1});let Ie=jr.bind({k:1});function lu(e,t,r,n){Be.p=t,Wa=e,Bn=r,Un=n}function Ue(e,t){let r=this||{};return function(){let n=arguments;function o(s,i){let l=Object.assign({},s),d=l.className||o.className;r.p=Object.assign({theme:Bn&&Bn()},l),r.o=/ *go\d+/.test(d),l.className=jr.apply(r,n)+(d?" "+d:"");let c=e;return e[0]&&(c=l.as||e,delete l.as),Un&&c[0]&&Un(l),Wa(c,l)}return o}}var cu=e=>typeof e=="function",Sr=(e,t)=>cu(e)?e(t):e,du=(()=>{let e=0;return()=>(++e).toString()})(),qa=(()=>{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,Hn="default",Ga=(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(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return Ga(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+s}))}}},Cr=[],Ka={toasts:[],pausedAt:void 0,settings:{toastLimit:uu}},Ce={},Ya=(e,t=Hn)=>{Ce[t]=Ga(Ce[t]||Ka,e),Cr.forEach(([r,n])=>{r===t&&n(Ce[t])})},Xa=e=>Object.keys(Ce).forEach(t=>Ya(e,t)),pu=e=>Object.keys(Ce).find(t=>Ce[t].toasts.some(r=>r.id===e)),kr=(e=Hn)=>t=>{Ya(t,e)},mu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fu=(e={},t=Hn)=>{let[r,n]=y.useState(Ce[t]||Ka),o=y.useRef(Ce[t]);y.useEffect(()=>(o.current!==Ce[t]&&n(Ce[t]),Cr.push([t,n]),()=>{let i=Cr.findIndex(([l])=>l===t);i>-1&&Cr.splice(i,1)}),[t]);let s=r.toasts.map(i=>{var l,d,c;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((l=e[i.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:i.duration||((d=e[i.type])==null?void 0:d.duration)||e?.duration||mu[i.type],style:{...e.style,...(c=e[i.type])==null?void 0:c.style,...i.style}}});return{...r,toasts:s}},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()}),Xt=e=>(t,r)=>{let n=hu(t,e,r);return kr(n.toasterId||pu(n.id))({type:2,toast:n}),n.id},oe=(e,t)=>Xt("blank")(e,t);oe.error=Xt("error"),oe.success=Xt("success"),oe.loading=Xt("loading"),oe.custom=Xt("custom"),oe.dismiss=(e,t)=>{let r={type:3,toastId:e};t?kr(t)(r):Xa(r)},oe.dismissAll=e=>oe.dismiss(void 0,e),oe.remove=(e,t)=>{let r={type:4,toastId:e};t?kr(t)(r):Xa(r)},oe.removeAll=e=>oe.remove(void 0,e),oe.promise=(e,t,r)=>{let n=oe.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?Sr(t.success,o):void 0;return s?oe.success(s,{id:n,...r,...r?.success}):oe.dismiss(n),o}).catch(o=>{let s=t.error?Sr(t.error,o):void 0;s?oe.error(s,{id:n,...r,...r?.error}):oe.dismiss(n)}),e};var gu=1e3,xu=(e,t="default")=>{let{toasts:r,pausedAt:n}=fu(e,t),o=y.useRef(new Map).current,s=y.useCallback((p,m=gu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),i({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&&oe.dismiss(g.id);return}return setTimeout(()=>oe.dismiss(g.id,t),b)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let i=y.useCallback(kr(t),[t]),l=y.useCallback(()=>{i({type:5,time:Date.now()})},[i]),d=y.useCallback((p,m)=>{i({type:1,toast:{id:p,height:m}})},[i]),c=y.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),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)s(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:d,startPause:l,endPause:c,calculateOffset:u}}},bu=Ie` 38 38 from { 39 39 transform: scale(0) rotate(45deg); … … 43 43 transform: scale(1) rotate(45deg); 44 44 opacity: 1; 45 }`, xu=Ie`45 }`,_u=Ie` 46 46 from { 47 47 transform: scale(0); … … 51 51 transform: scale(1); 52 52 opacity: 1; 53 }`, bu=Ie`53 }`,vu=Ie` 54 54 from { 55 55 transform: scale(0) rotate(90deg); … … 59 59 transform: scale(1) rotate(90deg); 60 60 opacity: 1; 61 }`, _u=Ue("div")`61 }`,yu=Ue("div")` 62 62 width: 20px; 63 63 opacity: 0; … … 68 68 transform: rotate(45deg); 69 69 70 animation: ${ gu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)70 animation: ${bu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 71 71 forwards; 72 72 animation-delay: 100ms; … … 75 75 &:before { 76 76 content: ''; 77 animation: ${ xu} 0.15s ease-out forwards;77 animation: ${_u} 0.15s ease-out forwards; 78 78 animation-delay: 150ms; 79 79 position: absolute; … … 88 88 89 89 &:before { 90 animation: ${ bu} 0.15s ease-out forwards;90 animation: ${vu} 0.15s ease-out forwards; 91 91 animation-delay: 180ms; 92 92 transform: rotate(90deg); 93 93 } 94 `, vu=Ie`94 `,wu=Ie` 95 95 from { 96 96 transform: rotate(0deg); … … 99 99 transform: rotate(360deg); 100 100 } 101 `, yu=Ue("div")`101 `,ju=Ue("div")` 102 102 width: 12px; 103 103 height: 12px; … … 107 107 border-color: ${e=>e.secondary||"#e0e0e0"}; 108 108 border-right-color: ${e=>e.primary||"#616161"}; 109 animation: ${ vu} 1s linear infinite;110 `, wu=Ie`109 animation: ${wu} 1s linear infinite; 110 `,Su=Ie` 111 111 from { 112 112 transform: scale(0) rotate(45deg); … … 116 116 transform: scale(1) rotate(45deg); 117 117 opacity: 1; 118 }`, ju=Ie`118 }`,Cu=Ie` 119 119 0% { 120 120 height: 0; … … 130 130 opacity: 1; 131 131 height: 10px; 132 }`, Su=Ue("div")`132 }`,ku=Ue("div")` 133 133 width: 20px; 134 134 opacity: 0; … … 139 139 transform: rotate(45deg); 140 140 141 animation: ${ wu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)141 animation: ${Su} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 142 142 forwards; 143 143 animation-delay: 100ms; … … 145 145 content: ''; 146 146 box-sizing: border-box; 147 animation: ${ ju} 0.2s ease-out forwards;147 animation: ${Cu} 0.2s ease-out forwards; 148 148 opacity: 0; 149 149 animation-delay: 200ms; … … 157 157 width: 6px; 158 158 } 159 `, Cu=Ue("div")`159 `,Nu=Ue("div")` 160 160 position: absolute; 161 `, ku=Ue("div")`161 `,Eu=Ue("div")` 162 162 position: relative; 163 163 display: flex; … … 166 166 min-width: 20px; 167 167 min-height: 20px; 168 `, Nu=Ie`168 `,Pu=Ie` 169 169 from { 170 170 transform: scale(0.6); … … 174 174 transform: scale(1); 175 175 opacity: 1; 176 }`, Eu=Ue("div")`176 }`,Tu=Ue("div")` 177 177 position: relative; 178 178 transform: scale(0.6); 179 179 opacity: 0.4; 180 180 min-width: 20px; 181 animation: ${ Nu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)181 animation: ${Pu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) 182 182 forwards; 183 `, Tu=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?g.createElement(Eu,null,t):t:r==="blank"?null:g.createElement(ku,null,g.createElement(yu,{...n}),r!=="loading"&&g.createElement(Cu,null,r==="error"?g.createElement(_u,{...n}):g.createElement(Su,{...n})))},Au=e=>`183 `,Au=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?x.createElement(Tu,null,t):t:r==="blank"?null:x.createElement(Eu,null,x.createElement(ju,{...n}),r!=="loading"&&x.createElement(Nu,null,r==="error"?x.createElement(yu,{...n}):x.createElement(ku,{...n})))},Ou=e=>` 184 184 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 185 185 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} 186 `, Pu=e=>`186 `,Ru=e=>` 187 187 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 188 188 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} 189 `, Ou="0%{opacity:0;} 100%{opacity:1;}",Ru="0%{opacity:1;} 100%{opacity:0;}",Lu=Ue("div")`189 `,Lu="0%{opacity:0;} 100%{opacity:1;}",Iu="0%{opacity:1;} 100%{opacity:0;}",zu=Ue("div")` 190 190 display: flex; 191 191 align-items: center; … … 199 199 padding: 8px 10px; 200 200 border-radius: 8px; 201 `, Iu=Ue("div")`201 `,Mu=Ue("div")` 202 202 display: flex; 203 203 justify-content: center; … … 206 206 flex: 1 1 auto; 207 207 white-space: pre-line; 208 `, zu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Va()?[Ou,Ru]:[Au(r),Pu(r)];return{animation:t?`${Ie(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ie(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Mu=g.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?zu(e.position||t||"top-center",e.visible):{opacity:0},s=g.createElement(Tu,{toast:e}),i=g.createElement(Iu,{...e.ariaProps},Cr(e.message,e));return g.createElement(Lu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:s,message:i}):g.createElement(g.Fragment,null,s,i))});su(g.createElement);var Du=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let s=g.useCallback(i=>{if(i){let c=()=>{let l=i.getBoundingClientRect().height;n(e,l)};c(),new MutationObserver(c).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return g.createElement("div",{ref:s,className:t,style:r},o)},Fu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Va()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},$u=Sr`208 `,Du=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=qa()?[Lu,Iu]:[Ou(r),Ru(r)];return{animation:t?`${Ie(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ie(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fu=x.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Du(e.position||t||"top-center",e.visible):{opacity:0},s=x.createElement(Au,{toast:e}),i=x.createElement(Mu,{...e.ariaProps},Sr(e.message,e));return x.createElement(zu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:s,message:i}):x.createElement(x.Fragment,null,s,i))});lu(x.createElement);var $u=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let s=x.useCallback(i=>{if(i){let l=()=>{let d=i.getBoundingClientRect().height;n(e,d)};l(),new MutationObserver(l).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return x.createElement("div",{ref:s,className:t,style:r},o)},Bu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:qa()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Uu=jr` 209 209 z-index: 9999; 210 210 > * { 211 211 pointer-events: auto; 212 212 } 213 `,Er=16,Bu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:i,containerClassName:c})=>{let{toasts:l,handlers:d}=hu(r,s);return g.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Er,left:Er,right:Er,bottom:Er,pointerEvents:"none",...i},className:c,onMouseEnter:d.startPause,onMouseLeave:d.endPause},l.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),h=Fu(p,m);return g.createElement(Du,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?$u:"",style:h},u.type==="custom"?Cr(u.message,u):o?o(u):g.createElement(Mu,{toast:u,position:p}))}))},G=oe;const Ya={carousel:"carousel",grid:"grid"},Uu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,shape:"rectangle",size:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ya.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Hu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Xa=[{label:"Horizontal",value:"horizontal"}],Vu=[{label:"Vertical",value:"vertical"}],Wu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],qu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Ja={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Za=y.createContext&&y.createContext(Ja),Gu=["attr","size","title"];function Ku(e,t){if(e==null)return{};var r=Yu(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yu(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 Tr(){return Tr=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},Tr.apply(this,arguments)}function Qa(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 Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qa(Object(r),!0).forEach(function(n){Xu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xu(e,t,r){return t=Ju(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ju(e){var t=Zu(e,"string");return typeof t=="symbol"?t:t+""}function Zu(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 es(e){return e&&e.map((t,r)=>y.createElement(t.tag,Ar({key:r},t.attr),es(t.child)))}function H(e){return t=>y.createElement(Qu,Tr({attr:Ar({},e.attr)},t),es(e.child))}function Qu(e){var t=r=>{var{attr:n,size:o,title:s}=e,i=Ku(e,Gu),c=o||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),y.createElement("svg",Tr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:l,style:Ar(Ar({color:e.color||r.color},r.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),s&&y.createElement("title",null,s),e.children)};return Za!==void 0?y.createElement(Za.Consumer,null,r=>t(r)):t(Ja)}function ep(e){return H({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 qt(e){return H({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 gt(e){return H({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 Gt(e){return H({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 Kt(e){return H({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 tp(e){return H({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 rp(e){return H({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 tt(e){return H({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 np(e){return H({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 ts(e){return H({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 op(e){return H({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 Yt(e){return H({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 rs(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wn(...e){return t=>{let r=!1;const n=e.map(o=>{const s=rs(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():rs(e[o],null)}}}}function Y(...e){return g.useCallback(Wn(...e),e)}function rt(e){const t=sp(e),r=g.forwardRef((n,o)=>{const{children:s,...i}=n,c=g.Children.toArray(s),l=c.find(cp);if(l){const d=l.props.children,u=c.map(p=>p===l?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var ap=rt("Slot");function sp(e){const t=g.forwardRef((r,n)=>{const{children:o,...s}=r;if(g.isValidElement(o)){const i=dp(o),c=lp(s,o.props);return o.type!==g.Fragment&&(c.ref=n?Wn(n,i):i),g.cloneElement(o,c)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ip=Symbol("radix.slottable");function cp(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ip}function lp(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...c)=>{const l=s(...c);return o(...c),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function dp(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 ns(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=ns(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function up(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=ns(e))&&(n&&(n+=" "),n+=t);return n}function D(...e){return up(e)}const pp="ecr-button",mp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},fp={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 re({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const s=n?ap:"button";return a.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:D(pp,mp[t],fp[r],e),...o})}function hp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:s,handleCreateGroup:i}){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(re,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(re,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"})]}):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(re,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(Yt,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ts,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(re,{disabled:s,onClick:i,className:"ecr-admin-reels-header__create",children:[s?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(gt,{})," ","Create Group"]}):null]})]})}function gp(e){return H({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 xp(e){return H({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 nt(e){return H({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 bp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function _p({isFullScreen:e}){return a.jsx("div",{className:D("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const os=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,s)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:D("ecr-player__progress-fill",s===r?.index?"ecr-player__progress-fill--active":s<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},s))}),xt=({className:e,children:t,...r})=>a.jsx("button",{className:D("ecr-player__nav",e),...r,children:t});function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Gn(e){return H({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 Kn(e){return H({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 Yn(e){return H({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 vp="Left",yp="Right",jp="Up",Sp="Down",bt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},as="mousemove",ss="mouseup",Cp="touchend",kp="touchmove",Np="touchstart";function Ep(e,t,r,n){return e>t?r>0?yp:vp:n>0?Sp:jp}function is(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 Tp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,h)=>{h.trackMouse&&!p&&(document.addEventListener(as,n),document.addEventListener(ss,i));const{clientX:b,clientY:f}=p?u.touches[0]:u,x=is([b,f],h.rotationAngle);return h.onTouchStartOrOnMouseDown&&h.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Xn),{initial:x.slice(),xy:x,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const h="touches"in u;if(h&&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}=h?u.touches[0]:u,[x,v]=is([b,f],m.rotationAngle),_=x-p.xy[0],w=v-p.xy[1],j=Math.abs(_),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[_/(N||1),w/(N||1)],T=Ep(j,C,_,w),O=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||bt.delta;if(j<O&&C<O&&!p.swiping)return p;const L={absX:j,absY:C,deltaX:_,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};L.first&&m.onSwipeStart&&m.onSwipeStart(L),m.onSwiping&&m.onSwiping(L);let A=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(A=!0),A&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:L,swiping:!0})})},o=u=>{e((p,m)=>{let h;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){h=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(h);const b=m[`onSwiped${h.dir}`];b&&b(h)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Xn),{eventData:h})})},s=()=>{document.removeEventListener(as,n),document.removeEventListener(ss,i)},i=u=>{s(),o(u)},c=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const h=Object.assign(Object.assign({},bt.touchEventOptions),p.touchEventOptions),b=[[Np,r,h],[kp,n,Object.assign(Object.assign({},h),p.preventScrollOnSwipe?{passive:!1}:{})],[Cp,o,h]];b.forEach(([f,x,v])=>u.addEventListener(f,x,v)),m=()=>b.forEach(([f,x])=>u.removeEventListener(f,x))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const h={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),h.cleanUpTouch=void 0),m.trackTouch&&u&&(h.cleanUpTouch=c(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),h)})}};return t.trackMouse&&(d.onMouseDown=r),[d,c]}function Ap(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 Pp(e){const{trackMouse:t}=e,r=g.useRef(Object.assign({},Xn)),n=g.useRef(Object.assign({},bt)),o=g.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},bt),e);let s;for(s in bt)n.current[s]===void 0&&(n.current[s]=bt[s]);const[i,c]=g.useMemo(()=>Tp(l=>r.current=l(r.current,n.current),{trackMouse:t}),[t]);return r.current=Ap(r.current,n.current,o.current,c),i}const Op=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:s,handleNextFile:i,setDuration:c})=>{const[l,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,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:l?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>s(o),onEnded:i,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,h=p.videoHeight;d(h>m),c(p.duration)}})})},cs=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:s,setIsPaused:i,handlePrevFile:c,handleNextFile:l})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=x=>{const v=p.current[x];v&&(s?v.play():v.pause(),i(_=>!_))},h=x=>{const v=p.current[x];v&&(v.muted=!d,u(_=>!_))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Pp({trackMouse:!0,onSwipedRight:c,onSwipedLeft:l,onSwipedUp:()=>{b&&l()},onSwipedDown:()=>{if(b){c();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((x,v)=>a.jsx("div",{className:"ecr-player__slide",children:x?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Op,{videoRefs:p,file:x,isMuted:d,i:v,togglePlayPause:m,handleNextFile:l,setDuration:r,isPaused:s},x.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[s?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}),d?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(v)}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(v)})]})]})},v))})},Rp=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,s]=y.useState(!1),[i,c]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const l=()=>{const m=e?.files??[];r?.index>0?n(h=>({index:h.index-1,story_uuid:m[h.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(h=>({index:h.index+1,story_uuid:m[h.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(xt,{onClick:l,className:"ecr-player__nav--left",children:a.jsx(Gt,{size:24})}):null,r.index<u-1?a.jsx(xt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Kt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(os,{playingStory:e,duration:i,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(cs,{currentFileIndex:r,files:e?.files,setDuration:c,setPreviewReel:t,isPaused:o,setIsPaused:s,handlePrevFile:l,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Lp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Ip(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function zp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return H({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 Mp(e){return H({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 ls(e){return H({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 Dp(e){return H({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 Fp(e){return H({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 $p(e){return H({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 Bp(e){return H({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)}function ds(e){return H({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 Up(e){return H({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 Hp(e){return H({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 Vp(e){return H({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 Wp(e){return H({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)}const qp=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`},Gp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(i=>({...i,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),s=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,poster:s}):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%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:qp(r?.[e.id]??e.view_count)}),a.jsx(rp,{size:14})]})]})},Jn=y.memo(Gp);function Kp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:i}){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:D("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Jn,{story:e,styles:t}),a.jsxs("div",{className:D("ecr-admin-reel-card__actions",i?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(re,{onClick:()=>s(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(re,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(ht,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(re,{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(ds,{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:D("ecr-admin-reel-card__corner",i?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(re,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Dp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Fp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel-card__title",children:e.title})]})}function Yp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:s,lastStoryElementRef:i}){return a.jsx("div",{style:{"--thumbnail-size":`${t?.size}px`},className:"ecr-admin-reels-grid",children:e?.map((c,l)=>a.jsx("div",{ref:e.length===l+1?i:null,children:a.jsx(Kp,{reel:c,styles:t,isSelected:r.includes(c.id),onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:r.length>0})},c.id))})}const Xt=({cb:e})=>{const t=Se(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(gp,{size:24})})};function Xp(e){return H({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 Jt=({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(ht,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:s=>{if(!t)return;const i=r.href;i&&(s.preventDefault(),t(i))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Xp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Or=({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:s=>{s.currentTarget.contains(s.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(op,{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(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:s})=>a.jsxs(ht,{style:{color:r},to:e,className:D("ecr-admin-link-button",o),onClick:i=>{s&&(i.preventDefault(),s(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:D("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),_t=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),vt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Jp(e){return H({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 Ir=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Jp,{}),"ReelsWP"]});function us(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zp}=Object.prototype,{getPrototypeOf:Zn}=Object,{iterator:zr,toStringTag:ps}=Symbol,Mr=(e=>t=>{const r=Zp.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),_e=e=>(e=e.toLowerCase(),t=>Mr(t)===e),Dr=e=>t=>typeof t===e,{isArray:yt}=Array,wt=Dr("undefined");function Zt(e){return e!==null&&!wt(e)&&e.constructor!==null&&!wt(e.constructor)&&le(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ms=_e("ArrayBuffer");function Qp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ms(e.buffer),t}const em=Dr("string"),le=Dr("function"),fs=Dr("number"),Qt=e=>e!==null&&typeof e=="object",tm=e=>e===!0||e===!1,Fr=e=>{if(Mr(e)!=="object")return!1;const t=Zn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ps in e)&&!(zr in e)},rm=e=>{if(!Qt(e)||Zt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},nm=_e("Date"),om=_e("File"),am=_e("Blob"),sm=_e("FileList"),im=e=>Qt(e)&&le(e.pipe),cm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||le(e.append)&&((t=Mr(e))==="formdata"||t==="object"&&le(e.toString)&&e.toString()==="[object FormData]"))},lm=_e("URLSearchParams"),[dm,um,pm,mm]=["ReadableStream","Request","Response","Headers"].map(_e),fm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function er(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Zt(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let c;for(n=0;n<i;n++)c=s[n],t.call(null,e[c],c,e)}}function hs(e,t){if(Zt(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 ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,gs=e=>!wt(e)&&e!==ot;function Qn(){const{caseless:e,skipUndefined:t}=gs(this)&&this||{},r={},n=(o,s)=>{const i=e&&hs(r,s)||s;Fr(r[i])&&Fr(o)?r[i]=Qn(r[i],o):Fr(o)?r[i]=Qn({},o):yt(o)?r[i]=o.slice():(!t||!wt(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&er(arguments[o],n);return r}const hm=(e,t,r,{allOwnKeys:n}={})=>(er(t,(o,s)=>{r&&le(o)?e[s]=us(o,r):e[s]=o},{allOwnKeys:n}),e),gm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xm=(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)},bm=(e,t,r,n)=>{let o,s,i;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&Zn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},_m=(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},vm=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!fs(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ym=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zn(Uint8Array)),wm=(e,t)=>{const n=(e&&e[zr]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},jm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Sm=_e("HTMLFormElement"),Cm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),xs=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),km=_e("RegExp"),bs=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};er(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},Nm=e=>{bs(e,(t,r)=>{if(le(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(le(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+"'")})}})},Em=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return yt(e)?n(e):n(String(e).split(t)),r},Tm=()=>{},Am=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Pm(e){return!!(e&&le(e.append)&&e[ps]==="FormData"&&e[zr])}const Om=e=>{const t=new Array(10),r=(n,o)=>{if(Qt(n)){if(t.indexOf(n)>=0)return;if(Zt(n))return n;if(!("toJSON"in n)){t[o]=n;const s=yt(n)?[]:{};return er(n,(i,c)=>{const l=r(i,o+1);!wt(l)&&(s[c]=l)}),t[o]=void 0,s}}return n};return r(e,0)},Rm=_e("AsyncFunction"),Lm=e=>e&&(Qt(e)||le(e))&&le(e.then)&&le(e.catch),_s=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:s})=>{o===ot&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",le(ot.postMessage)),Im=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||_s,S={isArray:yt,isArrayBuffer:ms,isBuffer:Zt,isFormData:cm,isArrayBufferView:Qp,isString:em,isNumber:fs,isBoolean:tm,isObject:Qt,isPlainObject:Fr,isEmptyObject:rm,isReadableStream:dm,isRequest:um,isResponse:pm,isHeaders:mm,isUndefined:wt,isDate:nm,isFile:om,isBlob:am,isRegExp:km,isFunction:le,isStream:im,isURLSearchParams:lm,isTypedArray:ym,isFileList:sm,forEach:er,merge:Qn,extend:hm,trim:fm,stripBOM:gm,inherits:xm,toFlatObject:bm,kindOf:Mr,kindOfTest:_e,endsWith:_m,toArray:vm,forEachEntry:wm,matchAll:jm,isHTMLForm:Sm,hasOwnProperty:xs,hasOwnProp:xs,reduceDescriptors:bs,freezeMethods:Nm,toObjectSet:Em,toCamelCase:Cm,noop:Tm,toFiniteNumber:Am,findKey:hs,global:ot,isContextDefined:gs,isSpecCompliantForm:Pm,toJSONObject:Om,isAsyncFn:Rm,isThenable:Lm,setImmediate:_s,asap:Im,isIterable:e=>e!=null&&le(e[zr])};function B(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(B,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 vs=B.prototype,ys={};["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=>{ys[e]={value:e}}),Object.defineProperties(B,ys),Object.defineProperty(vs,"isAxiosError",{value:!0}),B.from=(e,t,r,n,o,s)=>{const i=Object.create(vs);S.toFlatObject(e,i,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const c=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return B.call(i,c,l,r,n,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const zm=null;function eo(e){return S.isPlainObject(e)||S.isArray(e)}function ws(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function js(e,t,r){return e?e.concat(t).map(function(o,s){return o=ws(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function Mm(e){return S.isArray(e)&&!e.some(eo)}const Dm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(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,x){return!S.isUndefined(x[f])});const n=r.metaTokens,o=r.visitor||u,s=r.dots,i=r.indexes,l=(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(!l&&S.isBlob(b))throw new B("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?l&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,x){let v=b;if(b&&!x&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Mm(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(v=S.toArray(b)))return f=ws(f),v.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(i===!0?js([f],j,s):i===null?f:f+"[]",d(w))}),!1}return eo(b)?!0:(t.append(js(x,f,s),d(b)),!1)}const p=[],m=Object.assign(Dm,{defaultVisitor:u,convertValue:d,isVisitable:eo});function h(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&&h(v,f?f.concat(_):[_])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Ss(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function to(e,t){this._pairs=[],e&&$r(e,this,t)}const Cs=to.prototype;Cs.append=function(t,r){this._pairs.push([t,r])},Cs.toString=function(t){const r=t?function(n){return t.call(this,n,Ss)}:Ss;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Fm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ks(e,t,r){if(!t)return e;const n=r&&r.encode||Fm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(o?s=o(t,r):s=S.isURLSearchParams(t)?t.toString():new to(t,r).toString(n),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Ns{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 Es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$m={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:to,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ro=typeof window<"u"&&typeof document<"u",no=typeof navigator=="object"&&navigator||void 0,Bm=ro&&(!no||["ReactNative","NativeScript","NS"].indexOf(no.product)<0),Um=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hm=ro&&window.location.href||"http://localhost",ie={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ro,hasStandardBrowserEnv:Bm,hasStandardBrowserWebWorkerEnv:Um,navigator:no,origin:Hm},Symbol.toStringTag,{value:"Module"})),...$m};function Vm(e,t){return $r(e,new ie.classes.URLSearchParams,{visitor:function(r,n,o,s){return ie.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Wm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function qm(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function Ts(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),l=s>=r.length;return i=!i&&S.isArray(o)?o.length:i,l?(S.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!c):((!o[i]||!S.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&S.isArray(o[i])&&(o[i]=qm(o[i])),!c)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Wm(n),o,r,0)}),r}return null}function Gm(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 tr={transitional:Es,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=S.isObject(t);if(s&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Ts(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 c;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Vm(t,this.formSerializer).toString();if((c=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return $r(c?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),Gm(t)):t}],transformResponse:[function(t){const r=this.transitional||tr.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 i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?B.from(c,B.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.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=>{tr.headers[e]={}});const Km=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"]),Ym=e=>{const t={};let r,n,o;return e&&e.split(` 214 `).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&Km[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},As=Symbol("internals");function rr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:S.isArray(e)?e.map(Br):String(e)}function Xm(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 Jm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oo(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 Zm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Qm(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,s,i){return this[n].call(this,t,o,s,i)},configurable:!0})})}let de=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(c,l,d){const u=rr(l);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||l]=Br(c))}const i=(c,l)=>S.forEach(c,(d,u)=>s(d,u,l));if(S.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(S.isString(t)&&(t=t.trim())&&!Jm(t))i(Ym(t),r);else if(S.isObject(t)&&S.isIterable(t)){let c={},l,d;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[d=u[0]]=(l=c[d])?S.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}i(c,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=rr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Xm(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=rr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||oo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(i){if(i=rr(i),i){const c=S.findKey(n,i);c&&(!r||oo(n,n[c],c,r))&&(delete n[c],o=!0)}}return S.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||oo(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,s)=>{const i=S.findKey(n,s);if(i){r[i]=Br(o),delete r[s];return}const c=t?Zm(s):String(s).trim();c!==s&&delete r[s],r[c]=Br(o),n[c]=!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[As]=this[As]={accessors:{}}).accessors,o=this.prototype;function s(i){const c=rr(i);n[c]||(Qm(o,i),n[c]=!0)}return S.isArray(t)?t.forEach(s):s(t),this}};de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(de.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(de);function ao(e,t){const r=this||tr,n=t||r,o=de.from(n.headers);let s=n.data;return S.forEach(e,function(c){s=c.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Ps(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){B.call(this,e??"canceled",B.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(jt,B,{__CANCEL__:!0});function Os(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ef(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function tf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(l){const d=Date.now(),u=n[s];i||(i=d),r[o]=l,n[o]=d;let p=s,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-i<t)return;const h=u&&d-u;return h?Math.round(m*1e3/h):void 0}}function rf(e,t){let r=0,n=1e3/t,o,s;const i=(d,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?i(d,u):(o=d,s||(s=setTimeout(()=>{s=null,i(o)},n-p)))},()=>o&&i(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=tf(50,250);return rf(s=>{const i=s.loaded,c=s.lengthComputable?s.total:void 0,l=i-n,d=o(l),u=i<=c;n=i;const p={loaded:i,total:c,progress:c?i/c:void 0,bytes:l,rate:d||void 0,estimated:d&&c&&u?(c-i)/d:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},r)},Rs=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ls=e=>(...t)=>S.asap(()=>e(...t)),nf=ie.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ie.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ie.origin),ie.navigator&&/(msie|trident)/i.test(ie.navigator.userAgent)):()=>!0,of=ie.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&c.push(`path=${n}`),S.isString(o)&&c.push(`domain=${o}`),s===!0&&c.push("secure"),S.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.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 af(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Is(e,t,r){let n=!af(t);return e&&(n||r==!1)?sf(e,t):t}const zs=e=>e instanceof de?{...e}:e;function at(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 s(d,u){if(!S.isUndefined(u))return n(void 0,u)}function i(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function c(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const l={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(d,u,p)=>o(zs(d),zs(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=l[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==c||(r[u]=m)}),r}const Ms=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:c}=t;if(t.headers=i=de.from(i),t.url=ks(Is(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),S.isFormData(r)){if(ie.hasStandardBrowserEnv||ie.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const l=r.getHeaders(),d=["content-type","content-length"];Object.entries(l).forEach(([u,p])=>{d.includes(u.toLowerCase())&&i.set(u,p)})}}if(ie.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&nf(t.url))){const l=o&&s&&of.read(s);l&&i.set(o,l)}return t},cf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Ms(e);let s=o.data;const i=de.from(o.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:d}=o,u,p,m,h,b;function f(){h&&h(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function v(){if(!x)return;const w=de.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),C={data:!c||c==="text"||c==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};Os(function(k){r(k),f()},function(k){n(k),f()},C),x=null}"onloadend"in x?x.onloadend=v:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(v)},x.onabort=function(){x&&(n(new B("Request aborted",B.ECONNABORTED,e,x)),x=null)},x.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new B(C,B.ERR_NETWORK,e,x);N.event=j||null,n(N),x=null},x.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Es;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new B(j,C.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,x)),x=null},s===void 0&&i.setContentType(null),"setRequestHeader"in x&&S.forEach(i.toJSON(),function(j,C){x.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),c&&c!=="json"&&(x.responseType=o.responseType),d&&([m,b]=Ur(d,!0),x.addEventListener("progress",m)),l&&x.upload&&([p,h]=Ur(l),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(u=w=>{x&&(n(!w||w.type?new jt(null,e,x):w),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const _=ef(o.url);if(_&&ie.protocols.indexOf(_)===-1){n(new B("Unsupported protocol "+_+":",B.ERR_BAD_REQUEST,e));return}x.send(s||null)})},lf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const s=function(d){if(!o){o=!0,c();const u=d instanceof Error?d:this.reason;n.abort(u instanceof B?u:new jt(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new B(`timeout ${t} of ms exceeded`,B.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));const{signal:l}=n;return l.unsubscribe=()=>S.asap(c),l}},df=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},uf=async function*(e,t){for await(const r of pf(e))yield*df(r,t)},pf=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()}},Ds=(e,t,r,n)=>{const o=uf(e,t);let s=0,i,c=l=>{i||(i=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:d,value:u}=await o.next();if(d){c(),l.close();return}let p=u.byteLength;if(r){let m=s+=p;r(m)}l.enqueue(new Uint8Array(u))}catch(d){throw c(d),d}},cancel(l){return c(l),o.return()}},{highWaterMark:2})},Fs=64*1024,{isFunction:Hr}=S,mf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:$s,TextEncoder:Bs}=S.global,Us=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ff=e=>{e=S.merge.call({skipUndefined:!0},mf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",s=Hr(r),i=Hr(n);if(!o)return!1;const c=o&&Hr($s),l=o&&(typeof Bs=="function"?(b=>f=>b.encode(f))(new Bs):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=s&&c&&Us(()=>{let b=!1;const f=new r(ie.origin,{body:new $s,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=i&&c&&Us(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,x)=>{let v=f&&f[b];if(v)return v.call(f);throw new B(`Response type '${b}' is not supported`,B.ERR_NOT_SUPPORT,x)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ie.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 l(b)).byteLength},h=async(b,f)=>{const x=S.toFiniteNumber(b.getContentLength());return x??m(f)};return async b=>{let{url:f,method:x,data:v,signal:_,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:O}=Ms(b),L=t||fetch;k=k?(k+"").toLowerCase():"text";let A=lf([_,w&&w.toAbortSignal()],j),I=null;const z=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let $;try{if(N&&d&&x!=="get"&&x!=="head"&&($=await h(E,v))!==0){let Z=new r(f,{method:"POST",body:v,duplex:"half"}),me;if(S.isFormData(v)&&(me=Z.headers.get("content-type"))&&E.setContentType(me),Z.body){const[Fe,ge]=Rs($,Ur(Ls(N)));v=Ds(Z.body,Fs,Fe,ge)}}S.isString(T)||(T=T?"include":"omit");const R=s&&"credentials"in r.prototype,U={...O,signal:A,method:x.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:R?T:void 0};I=s&&new r(f,U);let P=await(s?L(I,O):L(f,U));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&z)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=P[$e]});const me=S.toFiniteNumber(P.headers.get("content-length")),[Fe,ge]=C&&Rs(me,Ur(Ls(C),!0))||[];P=new n(Ds(P.body,Fs,Fe,()=>{ge&&ge(),z&&z()}),Z)}k=k||"text";let X=await p[S.findKey(p,k)||"text"](P,b);return!q&&z&&z(),await new Promise((Z,me)=>{Os(Z,me,{data:X,headers:de.from(P.headers),status:P.status,statusText:P.statusText,config:b,request:I})})}catch(R){throw z&&z(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new B("Network Error",B.ERR_NETWORK,b,I),{cause:R.cause||R}):B.from(R,R&&R.code,b,I)}}},hf=new Map,Hs=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let i=s.length,c=i,l,d,u=hf;for(;c--;)l=s[c],d=u.get(l),d===void 0&&u.set(l,d=c?new Map:ff(t)),u=d;return d};Hs();const so={http:zm,xhr:cf,fetch:{get:Hs}};S.forEach(so,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Vs=e=>`- ${e}`,gf=e=>S.isFunction(e)||e===null||e===!1;function xf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let i=0;i<r;i++){n=e[i];let c;if(o=n,!gf(n)&&(o=so[(c=String(n)).toLowerCase()],o===void 0))throw new B(`Unknown adapter '${c}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;s[c||"#"+i]=o}if(!o){const i=Object.entries(s).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let c=r?i.length>1?`since : 216 `+i.map(Vs).join(` 217 `):" "+Vs(i[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return o}const Ws={getAdapter:xf,adapters:so};function io(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function qs(e){return io(e),e.headers=de.from(e.headers),e.data=ao.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ws.getAdapter(e.adapter||tr.adapter,e)(e).then(function(n){return io(e),n.data=ao.call(e,e.transformResponse,n),n.headers=de.from(n.headers),n},function(n){return Ps(n)||(io(e),n&&n.response&&(n.response.data=ao.call(e,e.transformResponse,n.response),n.response.headers=de.from(n.response.headers))),Promise.reject(n)})}const Gs="1.13.1",Vr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ks={};Vr.transitional=function(t,r,n){function o(s,i){return"[Axios v"+Gs+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,c)=>{if(t===!1)throw new B(o(i," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!Ks[i]&&(Ks[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,c):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function bf(e,t,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const c=e[s],l=c===void 0||i(c,s,e);if(l!==!0)throw new B("option "+s+" must be "+l,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+s,B.ERR_BAD_OPTION)}}const Wr={assertOptions:bf,validators:Vr},ke=Wr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ns,response:new Ns}}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 s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` 218 `+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&S.merge(s.common,s[r.method]);s&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),r.headers=de.concat(i,s);const c=[];let l=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(l=l&&f.synchronous,c.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(!l){const b=[qs.bind(this),void 0];for(b.unshift(...c),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=c.length;let h=r;for(;p<m;){const b=c[p++],f=c[p++];try{h=b(h)}catch(x){f.call(this,x);break}}try{u=qs.call(this,h)}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=at(this.defaults,t);const r=Is(t.baseURL,t.url,t.allowAbsoluteUrls);return ks(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,c){return this.request(at(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let _f=class wd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(c=>{n.subscribe(c),s=c}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,c){n.reason||(n.reason=new jt(s,i,c),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 wd(function(o){t=o}),cancel:t}}};function vf(e){return function(r){return e.apply(null,r)}}function yf(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 Ys(e){const t=new st(e),r=us(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Ys(at(e,o))},r}const ee=Ys(tr);ee.Axios=st,ee.CanceledError=jt,ee.CancelToken=_f,ee.isCancel=Ps,ee.VERSION=Gs,ee.toFormData=$r,ee.AxiosError=B,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=vf,ee.isAxiosError=yf,ee.mergeConfig=at,ee.AxiosHeaders=de,ee.formToJSON=e=>Ts(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=Ws.getAdapter,ee.HttpStatusCode=co,ee.default=ee;const{Axios:yv,AxiosError:wv,CanceledError:jv,isCancel:Sv,CancelToken:Cv,VERSION:kv,all:Nv,Cancel:Ev,isAxiosError:Tv,spread:Av,toFormData:Pv,AxiosHeaders:Ov,HttpStatusCode:Rv,formToJSON:Lv,getAdapter:Iv,mergeConfig:zv}=ee,Xs=ecommreelsInfo,ue=ee.create({baseURL:`${Xs.apiBase}`,headers:{"X-WP-Nonce":Xs.nonce,"Content-Type":"application/json"}}),wf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async i=>{try{t(!0);const c={styles:et,story_ids:i},l=await ue.post("stories/manage-group-stories",c);return G.success("Group created successfully!"),l.data.group_id}catch(c){return c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),s=y.useCallback(async(i,c)=>{try{n(!0),await ue.delete(`story/${i}`),c(l=>l.filter(d=>d.id!==i)),G.success("Reel deleted successfully!")}catch(l){l instanceof Error?G.error(l.message):G.error("Something went wrong. Try again later!")}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:s}};function lo(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Js=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[s,i]=y.useState(!0),[c,l]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),h=lo(p,500),b=y.useRef(!0),f=y.useCallback(async _=>{_===1&&b.current?u(!0):l(!0);try{const w={page:_,per_page:20};e&&(w.group_id=e),h&&(w.search=h);const j=await ue.get("stories",{params:w}),C=j.data,N=parseInt(j.headers["x-wp-totalpages"]);r(k=>_===1?C:[...k,...C]),o(_+1),i(_<N)}catch(w){w instanceof Error?G.error(w.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),l(!1),u(!1)}},[e,h]);y.useEffect(()=>{o(1),r([]),f(1)},[h,f]);const x=y.useRef(null),v=y.useCallback(_=>{c||(x.current&&x.current.disconnect(),x.current=new IntersectionObserver(w=>{w[0].isIntersecting&&s&&f(n)}),_&&x.current.observe(_))},[c,s,n,f]);return y.useEffect(()=>()=>{x.current&&x.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:c,isLoading:d,lastStoryElementRef:v}};function jf(){const e=Se(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:s,setSearchTerm:i,isLoading:c}=Js(null),{styles:l,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=wf(),[h,b]=y.useState(null),[f,x]=y.useState(null),[v,_]=y.useState([]),w=async()=>{const k=await p(v);k&&e(`?view=${K.mg}&gid=${k}`)},j=()=>{_(t.map(k=>k.id))},C=k=>{_(E=>E.includes(k)?E.filter(T=>T!==k):[...E,k])},N=y.useCallback(async()=>{h&&(await m(h,r),b(null))},[m,h,r]);return c&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[h&&a.jsx(Or,{onReject:()=>b(null),onAccept:N,isLoading:u,message:"Are you sure, You want to remove this reel?"}),a.jsx(_t,{left:[a.jsx(vt,{name:"All Reels",Icon:ep},"page"),a.jsx(Xt,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:gt},"add-reel-all-reel")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(hp,{selectedReelIds:v,handleSelectAll:j,clearSelection:()=>_([]),searchTerm:s,setSearchTerm:i,isCreating:d,handleCreateGroup:w}),t.length?a.jsx(Yp,{reels:t,styles:l,selectedReelIds:v,onSelectReel:C,onDeleteReel:b,onPreviewReel:x,lastStoryElementRef:o}):!n&&!c?a.jsx(bp,{}):null,n&&a.jsx(_p,{isFullScreen:!t.length})]}),!!f&&a.jsx(Rp,{previewReel:f,setPreviewReel:x})]})}const Sf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:s,links:i,thumbnail:c})=>{try{t(!0);const l={story_title:o,files:s,links:i};typeof c=="string"&&c.trim().length>0&&(l.thumbnail=c),n&&(l.story_id=n);const d=await ue.post("files",l);return G.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(l){return l instanceof Error?G.error(l.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},uo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(re,{onClick:t,className:D("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(np,{className:"ecr-admin-save-button__icon"})," ",r]}),Zs=({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:s=>{e&&e(!0),r(s.target.value)}})}),Cf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const s=Se(),[i]=Vt(),c=i.get("sid"),l=i.get("from")||K.ag,d=i.get("gid"),{isSaving:u,saveStory:p}=Sf(),m=async()=>{if(u)return;const h=await p({storyId:c,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});h&&s(`?view=${l}${d?`&gid=${d}`:""}`,{replace:!0,...c?{}:{state:{storyId:h}}})};return a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:c?"Update Reel":"Add Reel",Icon:gt},"page"),a.jsx(Xt,{},"back")],center:[a.jsx(Zs,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(uo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:c?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function kf(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let po;const Nf=new Uint8Array(16);function Ef(){if(!po){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");po=crypto.getRandomValues.bind(crypto)}return po(Nf)}const Qs={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Tf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Ef();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,kf(n)}function mo(e,t,r){return Qs.randomUUID&&!e?Qs.randomUUID():Tf(e)}const ei="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",ti=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:s})=>{const[i,c]=y.useState(!1),l=()=>{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:mo()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:D("ecr-admin-upload",i?"ecr-admin-upload--active":"ecr-admin-upload--idle",s),onDragOver:d=>{d.preventDefault(),c(!0)},onDragLeave:()=>c(!1),onDrop:d=>{d.preventDefault(),c(!1),l()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:l,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:ei,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:i?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]})})]})})};/** 219 * @license lucide-react v0.552.0 - ISC 220 * 221 * This source code is licensed under the ISC license. 222 * See the LICENSE file in the root directory of this source tree. 223 */const Af=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ri=e=>{const t=Pf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ni=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Of=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** 224 * @license lucide-react v0.552.0 - ISC 225 * 226 * This source code is licensed under the ISC license. 227 * See the LICENSE file in the root directory of this source tree. 228 */var Rf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 229 * @license lucide-react v0.552.0 - ISC 230 * 231 * This source code is licensed under the ISC license. 232 * See the LICENSE file in the root directory of this source tree. 233 */const Lf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...c},l)=>y.createElement("svg",{ref:l,...Rf,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ni("lucide",o),...!s&&!Of(c)&&{"aria-hidden":"true"},...c},[...i.map(([d,u])=>y.createElement(d,u)),...Array.isArray(s)?s:[s]]));/** 234 * @license lucide-react v0.552.0 - ISC 235 * 236 * This source code is licensed under the ISC license. 237 * See the LICENSE file in the root directory of this source tree. 238 */const pe=(e,t)=>{const r=y.forwardRef(({className:n,...o},s)=>y.createElement(Lf,{ref:s,iconNode:t,className:ni(`lucide-${Af(ri(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ri(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 If=pe("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 fo=pe("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 zf=pe("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 Mf=pe("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 Df=pe("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 Ff=pe("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 $f=pe("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 Bf=pe("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 Uf=pe("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"}]]);/** 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 Hf=pe("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"}]]);/** 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 Vf=pe("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 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 Wf=pe("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"}]]);/** 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 qf=pe("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"}]]);/** 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 Gf=pe("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 Kf(e,t){const r=g.createContext(t),n=s=>{const{children:i,...c}=s,l=g.useMemo(()=>c,Object.values(c));return a.jsx(r.Provider,{value:l,children:i})};n.displayName=e+"Provider";function o(s){const i=g.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(s,i){const c=g.createContext(i),l=r.length;r=[...r,i];const d=p=>{const{scope:m,children:h,...b}=p,f=m?.[e]?.[l]||c,x=g.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:x,children:h})};d.displayName=s+"Provider";function u(p,m){const h=m?.[e]?.[l]||c,b=g.useContext(h);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,u]}const o=()=>{const s=r.map(i=>g.createContext(i));return function(c){const l=c?.[e]||s;return g.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[n,Yf(o,...t)]}function Yf(...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(s){const i=n.reduce((c,{useScope:l,scopeName:d})=>{const p=l(s)[`__scope${d}`];return{...c,...p}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Xf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=Xf.reduce((e,t)=>{const r=rt(`Primitive.${t}`),n=g.forwardRef((o,s)=>{const{asChild:i,...c}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Jf(e,t){e&&_r.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>t.current?.(...r),[])}function Zf(e,t=globalThis?.document){const r=Ve(e);g.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 Qf="DismissableLayer",ho="dismissableLayer.update",eh="dismissableLayer.pointerDownOutside",th="dismissableLayer.focusOutside",oi,ai=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:c,...l}=e,d=g.useContext(ai),[u,p]=g.useState(null),m=u?.ownerDocument??globalThis?.document,[,h]=g.useState({}),b=Y(t,k=>p(k)),f=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(x),_=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=_>=v,C=oh(k=>{const E=k.target,T=[...d.branches].some(O=>O.contains(E));!j||T||(o?.(k),i?.(k),k.defaultPrevented||c?.())},m),N=ah(k=>{const E=k.target;[...d.branches].some(O=>O.contains(E))||(s?.(k),i?.(k),k.defaultPrevented||c?.())},m);return Zf(k=>{_===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&c&&(k.preventDefault(),c()))},m),g.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(oi=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),si(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=oi)}},[u,m,r,d]),g.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),si())},[u,d]),g.useEffect(()=>{const k=()=>h({});return document.addEventListener(ho,k),()=>document.removeEventListener(ho,k)},[]),a.jsx(W.div,{...l,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,C.onPointerDownCapture)})});qr.displayName=Qf;var rh="DismissableLayerBranch",nh=g.forwardRef((e,t)=>{const r=g.useContext(ai),n=g.useRef(null),o=Y(t,n);return g.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});nh.displayName=rh;function oh(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const s=c=>{if(c.target&&!n.current){let l=function(){ii(eh,r,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ah(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1);return g.useEffect(()=>{const o=s=>{s.target&&!n.current&&ii(th,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function si(){const e=new CustomEvent(ho);document.dispatchEvent(e)}function ii(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Jf(o,s):o.dispatchEvent(s)}var go=0;function xo(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ci()),document.body.insertAdjacentElement("beforeend",e[1]??ci()),go++,()=>{go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),go--}},[])}function ci(){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 bo="focusScope.autoFocusOnMount",_o="focusScope.autoFocusOnUnmount",li={bubbles:!1,cancelable:!0},sh="FocusScope",Gr=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[c,l]=g.useState(null),d=Ve(o),u=Ve(s),p=g.useRef(null),m=Y(t,f=>l(f)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let f=function(w){if(h.paused||!c)return;const j=w.target;c.contains(j)?p.current=j:We(p.current,{select:!0})},x=function(w){if(h.paused||!c)return;const j=w.relatedTarget;j!==null&&(c.contains(j)||We(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(c)};document.addEventListener("focusin",f),document.addEventListener("focusout",x);const _=new MutationObserver(v);return c&&_.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",x),_.disconnect()}}},[n,c,h.paused]),g.useEffect(()=>{if(c){pi.add(h);const f=document.activeElement;if(!c.contains(f)){const v=new CustomEvent(bo,li);c.addEventListener(bo,d),c.dispatchEvent(v),v.defaultPrevented||(ih(ph(di(c)),{select:!0}),document.activeElement===f&&We(c))}return()=>{c.removeEventListener(bo,d),setTimeout(()=>{const v=new CustomEvent(_o,li);c.addEventListener(_o,u),c.dispatchEvent(v),v.defaultPrevented||We(f??document.body,{select:!0}),c.removeEventListener(_o,u),pi.remove(h)},0)}}},[c,d,u,h]);const b=g.useCallback(f=>{if(!r&&!n||h.paused)return;const x=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(x&&v){const _=f.currentTarget,[w,j]=ch(_);w&&j?!f.shiftKey&&v===j?(f.preventDefault(),r&&We(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&We(j,{select:!0})):v===_&&f.preventDefault()}},[r,n,h.paused]);return a.jsx(W.div,{tabIndex:-1,...i,ref:m,onKeyDown:b})});Gr.displayName=sh;function ih(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function ch(e){const t=di(e),r=ui(t,e),n=ui(t.reverse(),e);return[r,n]}function di(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 ui(e,t){for(const r of e)if(!lh(r,{upTo:t}))return r}function lh(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 dh(e){return e instanceof HTMLInputElement&&"select"in e}function We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&dh(e)&&t&&e.select()}}var pi=uh();function uh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=mi(e,t),e.unshift(t)},remove(t){e=mi(e,t),e[0]?.resume()}}}function mi(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function ph(e){return e.filter(t=>t.tagName!=="A")}var se=globalThis?.document?g.useLayoutEffect:()=>{},mh=g[" useId ".trim().toString()]||(()=>{}),fh=0;function Ne(e){const[t,r]=g.useState(mh());return se(()=>{r(n=>n??String(fh++))},[e]),e||(t?`radix-${t}`:"")}const hh=["top","right","bottom","left"],qe=Math.min,fe=Math.max,Kr=Math.round,Yr=Math.floor,Ee=e=>({x:e,y:e}),gh={left:"right",right:"left",bottom:"top",top:"bottom"},xh={start:"end",end:"start"};function vo(e,t,r){return fe(e,qe(t,r))}function ze(e,t){return typeof e=="function"?e(t):e}function Me(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function yo(e){return e==="x"?"y":"x"}function wo(e){return e==="y"?"height":"width"}const bh=new Set(["top","bottom"]);function Te(e){return bh.has(Me(e))?"y":"x"}function jo(e){return yo(Te(e))}function _h(e,t,r){r===void 0&&(r=!1);const n=St(e),o=jo(e),s=wo(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xr(i)),[i,Xr(i)]}function vh(e){const t=Xr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>xh[t])}const fi=["left","right"],hi=["right","left"],yh=["top","bottom"],wh=["bottom","top"];function jh(e,t,r){switch(e){case"top":case"bottom":return r?t?hi:fi:t?fi:hi;case"left":case"right":return t?yh:wh;default:return[]}}function Sh(e,t,r,n){const o=St(e);let s=jh(Me(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(So)))),s}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>gh[t])}function Ch(e){return{top:0,right:0,bottom:0,left:0,...e}}function gi(e){return typeof e!="number"?Ch(e):{top:e,right:e,bottom:e,left:e}}function Jr(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 xi(e,t,r){let{reference:n,floating:o}=e;const s=Te(t),i=jo(t),c=wo(i),l=Me(t),d=s==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[c]/2-o[c]/2;let h;switch(l){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:p};break;case"left":h={x:n.x-o.width,y:p};break;default:h={x:n.x,y:n.y}}switch(St(t)){case"start":h[i]-=m*(r&&d?-1:1);break;case"end":h[i]+=m*(r&&d?-1:1);break}return h}const kh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,c=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=xi(d,n,l),m=n,h={},b=0;for(let f=0;f<c.length;f++){const{name:x,fn:v}=c[f],{x:_,y:w,data:j,reset:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:h,rects:d,platform:i,elements:{reference:e,floating:t}});u=_??u,p=w??p,h={...h,[x]:{...h[x],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=xi(d,m,l)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:h}};async function nr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:h=0}=ze(t,e),b=gi(h),x=c[m?p==="floating"?"reference":"floating":p],v=Jr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:u,strategy:l})),_=p==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),j=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:_,offsetParent:w,strategy:l}):_);return{top:(v.top-C.top+b.top)/j.y,bottom:(C.bottom-v.bottom+b.bottom)/j.y,left:(v.left-C.left+b.left)/j.x,right:(C.right-v.right+b.right)/j.x}}const Nh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:d,padding:u=0}=ze(e,t)||{};if(d==null)return{};const p=gi(u),m={x:r,y:n},h=jo(o),b=wo(h),f=await i.getDimensions(d),x=h==="y",v=x?"top":"left",_=x?"bottom":"right",w=x?"clientHeight":"clientWidth",j=s.reference[b]+s.reference[h]-m[h]-s.floating[b],C=m[h]-s.reference[h],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let k=N?N[w]:0;(!k||!await(i.isElement==null?void 0:i.isElement(N)))&&(k=c.floating[w]||s.floating[b]);const E=j/2-C/2,T=k/2-f[b]/2-1,O=qe(p[v],T),L=qe(p[_],T),A=O,I=k-f[b]-L,z=k/2-f[b]/2+E,$=vo(A,z,I),R=!l.arrow&&St(o)!=null&&z!==$&&s.reference[b]/2-(z<A?O:L)-f[b]/2<0,U=R?z<A?z-A:z-I:0;return{[h]:m[h]+U,data:{[h]:$,centerOffset:z-$-U,...R&&{alignmentOffset:U}},reset:R}}}),Eh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...x}=ze(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=Me(o),_=Te(c),w=Me(c)===c,j=await(l.isRTL==null?void 0:l.isRTL(d.floating)),C=m||(w||!f?[Xr(c)]:vh(c)),N=b!=="none";!m&&N&&C.push(...Sh(c,f,b,j));const k=[c,...C],E=await nr(t,x),T=[];let O=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[v]),p){const z=_h(o,i,j);T.push(E[z[0]],E[z[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(z=>z<=0)){var L,A;const z=(((L=s.flip)==null?void 0:L.index)||0)+1,$=k[z];if($&&(!(p==="alignment"?_!==Te($):!1)||O.every(P=>Te(P.placement)===_?P.overflows[0]>0:!0)))return{data:{index:z,overflows:O},reset:{placement:$}};let R=(A=O.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!R)switch(h){case"bestFit":{var I;const U=(I=O.filter(P=>{if(N){const q=Te(P.placement);return q===_||q==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((P,q)=>P[1]-q[1])[0])==null?void 0:I[0];U&&(R=U);break}case"initialPlacement":R=c;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function bi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _i(e){return hh.some(t=>e[t]>=0)}const Th=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=ze(e,t);switch(n){case"referenceHidden":{const s=await nr(t,{...o,elementContext:"reference"}),i=bi(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:_i(i)}}}case"escaped":{const s=await nr(t,{...o,altBoundary:!0}),i=bi(s,r.floating);return{data:{escapedOffsets:i,escaped:_i(i)}}}default:return{}}}}},vi=new Set(["left","top"]);async function Ah(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Me(r),c=St(r),l=Te(r)==="y",d=vi.has(i)?-1:1,u=s&&l?-1:1,p=ze(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof b=="number"&&(h=c==="end"?b*-1:b),l?{x:h*u,y:m*d}:{x:m*d,y:h*u}}const Ph=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:c}=t,l=await Ah(t,e);return i===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},Oh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:x=>{let{x:v,y:_}=x;return{x:v,y:_}}},...l}=ze(e,t),d={x:r,y:n},u=await nr(t,l),p=Te(Me(o)),m=yo(p);let h=d[m],b=d[p];if(s){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",_=h+u[x],w=h-u[v];h=vo(_,h,w)}if(i){const x=p==="y"?"top":"left",v=p==="y"?"bottom":"right",_=b+u[x],w=b-u[v];b=vo(_,b,w)}const f=c.fn({...t,[m]:h,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:s,[p]:i}}}}}},Rh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:l=!0,crossAxis:d=!0}=ze(e,t),u={x:r,y:n},p=Te(o),m=yo(p);let h=u[m],b=u[p];const f=ze(c,t),x=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const w=m==="y"?"height":"width",j=s.reference[m]-s.floating[w]+x.mainAxis,C=s.reference[m]+s.reference[w]-x.mainAxis;h<j?h=j:h>C&&(h=C)}if(d){var v,_;const w=m==="y"?"width":"height",j=vi.has(Me(o)),C=s.reference[p]-s.floating[w]+(j&&((v=i.offset)==null?void 0:v[p])||0)+(j?0:x.crossAxis),N=s.reference[p]+s.reference[w]+(j?0:((_=i.offset)==null?void 0:_[p])||0)-(j?x.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:h,[p]:b}}}},Lh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:l=()=>{},...d}=ze(e,t),u=await nr(t,d),p=Me(o),m=St(o),h=Te(o)==="y",{width:b,height:f}=s.floating;let x,v;p==="top"||p==="bottom"?(x=p,v=m===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(v=p,x=m==="end"?"top":"bottom");const _=f-u.top-u.bottom,w=b-u.left-u.right,j=qe(f-u[x],_),C=qe(b-u[v],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=_),N&&!m){const O=fe(u.left,0),L=fe(u.right,0),A=fe(u.top,0),I=fe(u.bottom,0);h?E=b-2*(O!==0||L!==0?O+L:fe(u.left,u.right)):k=f-2*(A!==0||I!==0?A+I:fe(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:k});const T=await i.getDimensions(c.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Zr(){return typeof window<"u"}function Ct(e){return yi(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(yi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yi(e){return Zr()?e instanceof Node||e instanceof he(e).Node:!1}function ve(e){return Zr()?e instanceof Element||e instanceof he(e).Element:!1}function Pe(e){return Zr()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function wi(e){return!Zr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}const Ih=new Set(["inline","contents"]);function or(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Ih.has(o)}const zh=new Set(["table","td","th"]);function Mh(e){return zh.has(Ct(e))}const Dh=[":popover-open",":modal"];function Qr(e){return Dh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Fh=["transform","translate","scale","rotate","perspective"],$h=["transform","translate","scale","rotate","perspective","filter"],Bh=["paint","layout","strict","content"];function Co(e){const t=ko(),r=ve(e)?ye(e):e;return Fh.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)||$h.some(n=>(r.willChange||"").includes(n))||Bh.some(n=>(r.contain||"").includes(n))}function Uh(e){let t=Ge(e);for(;Pe(t)&&!kt(t);){if(Co(t))return t;if(Qr(t))return null;t=Ge(t)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Hh=new Set(["html","body","#document"]);function kt(e){return Hh.has(Ct(e))}function ye(e){return he(e).getComputedStyle(e)}function en(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wi(e)&&e.host||Ae(e);return wi(t)?t.host:t}function ji(e){const t=Ge(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&or(t)?t:ji(t)}function ar(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ji(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=he(o);if(s){const c=No(i);return t.concat(i,i.visualViewport||[],or(o)?o:[],c&&r?ar(c):[])}return t.concat(o,ar(o,[],r))}function No(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Si(e){const t=ye(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Pe(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,c=Kr(r)!==s||Kr(n)!==i;return c&&(r=s,n=i),{width:r,height:n,$:c}}function Eo(e){return ve(e)?e:e.contextElement}function Nt(e){const t=Eo(e);if(!Pe(t))return Ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=Si(t);let i=(s?Kr(r.width):r.width)/n,c=(s?Kr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Vh=Ee(0);function Ci(e){const t=he(e);return!ko()||!t.visualViewport?Vh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==he(e)?!1:t}function it(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Eo(e);let i=Ee(1);t&&(n?ve(n)&&(i=Nt(n)):i=Nt(e));const c=Wh(s,r,n)?Ci(s):Ee(0);let l=(o.left+c.x)/i.x,d=(o.top+c.y)/i.y,u=o.width/i.x,p=o.height/i.y;if(s){const m=he(s),h=n&&ve(n)?he(n):n;let b=m,f=No(b);for(;f&&n&&h!==b;){const x=Nt(f),v=f.getBoundingClientRect(),_=ye(f),w=v.left+(f.clientLeft+parseFloat(_.paddingLeft))*x.x,j=v.top+(f.clientTop+parseFloat(_.paddingTop))*x.y;l*=x.x,d*=x.y,u*=x.x,p*=x.y,l+=w,d+=j,b=he(f),f=No(b)}}return Jr({width:u,height:p,x:l,y:d})}function tn(e,t){const r=en(e).scrollLeft;return t?t.left+r:it(Ae(e)).left+r}function ki(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-tn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function qh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=Ae(n),c=t?Qr(t.floating):!1;if(n===i||c&&s)return r;let l={scrollLeft:0,scrollTop:0},d=Ee(1);const u=Ee(0),p=Pe(n);if((p||!p&&!s)&&((Ct(n)!=="body"||or(i))&&(l=en(n)),Pe(n))){const h=it(n);d=Nt(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const m=i&&!p&&!s?ki(i,l):Ee(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-l.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-l.scrollTop*d.y+u.y+m.y}}function Gh(e){return Array.from(e.getClientRects())}function Kh(e){const t=Ae(e),r=en(e),n=e.ownerDocument.body,o=fe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=fe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+tn(e);const c=-r.scrollTop;return ye(n).direction==="rtl"&&(i+=fe(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:c}}const Ni=25;function Yh(e,t){const r=he(e),n=Ae(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,c=0,l=0;if(o){s=o.width,i=o.height;const u=ko();(!u||u&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const d=tn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-h);b<=Ni&&(s-=b)}else d<=Ni&&(s+=d);return{width:s,height:i,x:c,y:l}}const Xh=new Set(["absolute","fixed"]);function Jh(e,t){const r=it(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=Pe(e)?Nt(e):Ee(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=o*s.x,d=n*s.y;return{width:i,height:c,x:l,y:d}}function Ei(e,t,r){let n;if(t==="viewport")n=Yh(e,r);else if(t==="document")n=Kh(Ae(e));else if(ve(t))n=Jh(t,r);else{const o=Ci(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(n)}function Ti(e,t){const r=Ge(e);return r===t||!ve(r)||kt(r)?!1:ye(r).position==="fixed"||Ti(r,t)}function Zh(e,t){const r=t.get(e);if(r)return r;let n=ar(e,[],!1).filter(c=>ve(c)&&Ct(c)!=="body"),o=null;const s=ye(e).position==="fixed";let i=s?Ge(e):e;for(;ve(i)&&!kt(i);){const c=ye(i),l=Co(i);!l&&c.position==="fixed"&&(o=null),(s?!l&&!o:!l&&c.position==="static"&&!!o&&Xh.has(o.position)||or(i)&&!l&&Ti(e,i))?n=n.filter(u=>u!==i):o=c,i=Ge(i)}return t.set(e,n),n}function Qh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Qr(t)?[]:Zh(t,this._c):[].concat(r),n],c=i[0],l=i.reduce((d,u)=>{const p=Ei(t,u,o);return d.top=fe(p.top,d.top),d.right=qe(p.right,d.right),d.bottom=qe(p.bottom,d.bottom),d.left=fe(p.left,d.left),d},Ei(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function eg(e){const{width:t,height:r}=Si(e);return{width:t,height:r}}function tg(e,t,r){const n=Pe(t),o=Ae(t),s=r==="fixed",i=it(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=Ee(0);function d(){l.x=tn(o)}if(n||!n&&!s)if((Ct(t)!=="body"||or(o))&&(c=en(t)),n){const h=it(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&d();s&&!n&&o&&d();const u=o&&!n&&!s?ki(o,c):Ee(0),p=i.left+c.scrollLeft-l.x-u.x,m=i.top+c.scrollTop-l.y-u.y;return{x:p,y:m,width:i.width,height:i.height}}function To(e){return ye(e).position==="static"}function Ai(e,t){if(!Pe(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Pi(e,t){const r=he(e);if(Qr(e))return r;if(!Pe(e)){let o=Ge(e);for(;o&&!kt(o);){if(ve(o)&&!To(o))return o;o=Ge(o)}return r}let n=Ai(e,t);for(;n&&Mh(n)&&To(n);)n=Ai(n,t);return n&&kt(n)&&To(n)&&!Co(n)?r:n||Uh(e)||r}const rg=async function(e){const t=this.getOffsetParent||Pi,r=this.getDimensions,n=await r(e.floating);return{reference:tg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ng(e){return ye(e).direction==="rtl"}const og={convertOffsetParentRelativeRectToViewportRelativeRect:qh,getDocumentElement:Ae,getClippingRect:Qh,getOffsetParent:Pi,getElementRects:rg,getClientRects:Gh,getDimensions:eg,getScale:Nt,isElement:ve,isRTL:ng};function Oi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ag(e,t){let r=null,n;const o=Ae(e);function s(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:h}=d;if(c||t(),!m||!h)return;const b=Yr(p),f=Yr(o.clientWidth-(u+m)),x=Yr(o.clientHeight-(p+h)),v=Yr(u),w={rootMargin:-b+"px "+-f+"px "+-x+"px "+-v+"px",threshold:fe(0,qe(1,l))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==l){if(!j)return i();k?i(!1,k):n=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Oi(d,e.getBoundingClientRect())&&i(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return i(!0),s}function sg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,d=Eo(e),u=o||s?[...d?ar(d):[],...ar(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const p=d&&c?ag(d,r):null;let m=-1,h=null;i&&(h=new ResizeObserver(v=>{let[_]=v;_&&_.target===d&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),r()}),d&&!l&&h.observe(d),h.observe(t));let b,f=l?it(e):null;l&&x();function x(){const v=it(e);f&&!Oi(f,v)&&r(),f=v,b=requestAnimationFrame(x)}return r(),()=>{var v;u.forEach(_=>{o&&_.removeEventListener("scroll",r),s&&_.removeEventListener("resize",r)}),p?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(b)}}const ig=Ph,cg=Oh,lg=Eh,dg=Lh,ug=Th,Ri=Nh,pg=Rh,mg=(e,t,r)=>{const n=new Map,o={platform:og,...r},s={...o.platform,_c:n};return kh(e,t,{...o,platform:s})};var fg=typeof document<"u",hg=function(){},rn=fg?y.useLayoutEffect:hg;function nn(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(!nn(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 s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!nn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Li(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ii(e,t){const r=Li(e);return Math.round(t*r)/r}function Ao(e){const t=g.useRef(e);return rn(()=>{t.current=e}),t}function gg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:d}=e,[u,p]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=g.useState(n);nn(m,n)||h(n);const[b,f]=g.useState(null),[x,v]=g.useState(null),_=g.useCallback(P=>{P!==N.current&&(N.current=P,f(P))},[]),w=g.useCallback(P=>{P!==k.current&&(k.current=P,v(P))},[]),j=s||b,C=i||x,N=g.useRef(null),k=g.useRef(null),E=g.useRef(u),T=l!=null,O=Ao(l),L=Ao(o),A=Ao(d),I=g.useCallback(()=>{if(!N.current||!k.current)return;const P={placement:t,strategy:r,middleware:m};L.current&&(P.platform=L.current),mg(N.current,k.current,P).then(q=>{const X={...q,isPositioned:A.current!==!1};z.current&&!nn(E.current,X)&&(E.current=X,_r.flushSync(()=>{p(X)}))})},[m,t,r,L,A]);rn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[d]);const z=g.useRef(!1);rn(()=>(z.current=!0,()=>{z.current=!1}),[]),rn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(O.current)return O.current(j,C,I);I()}},[j,C,I,O,T]);const $=g.useMemo(()=>({reference:N,floating:k,setReference:_,setFloating:w}),[_,w]),R=g.useMemo(()=>({reference:j,floating:C}),[j,C]),U=g.useMemo(()=>{const P={position:r,left:0,top:0};if(!R.floating)return P;const q=Ii(R.floating,u.x),X=Ii(R.floating,u.y);return c?{...P,transform:"translate("+q+"px, "+X+"px)",...Li(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:X}},[r,c,R.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:I,refs:$,elements:R,floatingStyles:U}),[u,I,$,R,U])}const xg=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?Ri({element:n.current,padding:o}).fn(r):{}:n?Ri({element:n,padding:o}).fn(r):{}}}},bg=(e,t)=>({...ig(e),options:[e,t]}),_g=(e,t)=>({...cg(e),options:[e,t]}),vg=(e,t)=>({...pg(e),options:[e,t]}),yg=(e,t)=>({...lg(e),options:[e,t]}),wg=(e,t)=>({...dg(e),options:[e,t]}),jg=(e,t)=>({...ug(e),options:[e,t]}),Sg=(e,t)=>({...xg(e),options:[e,t]});var Cg="Arrow",zi=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return a.jsx(W.svg,{...s,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"})})});zi.displayName=Cg;var kg=zi;function Ng(e){const[t,r]=g.useState(void 0);return se(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,d=Array.isArray(l)?l[0]:l;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;r({width:i,height:c})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Po="Popper",[Mi,on]=He(Po),[Eg,Di]=Mi(Po),Fi=e=>{const{__scopePopper:t,children:r}=e,[n,o]=g.useState(null);return a.jsx(Eg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Fi.displayName=Po;var $i="PopperAnchor",Bi=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Di($i,r),i=g.useRef(null),c=Y(t,i),l=g.useRef(null);return g.useEffect(()=>{const d=l.current;l.current=n?.current||i.current,d!==l.current&&s.onAnchorChange(l.current)}),n?null:a.jsx(W.div,{...o,ref:c})});Bi.displayName=$i;var Oo="PopperContent",[Tg,Ag]=Mi(Oo),Ui=g.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:b,...f}=e,x=Di(Oo,r),[v,_]=g.useState(null),w=Y(t,F=>_(F)),[j,C]=g.useState(null),N=Ng(j),k=N?.width??0,E=N?.height??0,T=n+(s!=="center"?"-"+s:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(d)?d:[d],A=L.length>0,I={padding:O,boundary:L.filter(Og),altBoundary:A},{refs:z,floatingStyles:$,placement:R,isPositioned:U,middlewareData:P}=gg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>sg(...F,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[bg({mainAxis:o+E,alignmentAxis:i}),l&&_g({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?vg():void 0,...I}),l&&yg({...I}),wg({...I,apply:({elements:F,rects:te,availableWidth:ce,availableHeight:J})=>{const{width:Q,height:ne}=te.reference,xe=F.floating.style;xe.setProperty("--radix-popper-available-width",`${ce}px`),xe.setProperty("--radix-popper-available-height",`${J}px`),xe.setProperty("--radix-popper-anchor-width",`${Q}px`),xe.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),j&&Sg({element:j,padding:c}),Rg({arrowWidth:k,arrowHeight:E}),m&&jg({strategy:"referenceHidden",...I})]}),[q,X]=Wi(R),Z=Ve(b);se(()=>{U&&Z?.()},[U,Z]);const me=P.arrow?.x,Fe=P.arrow?.y,ge=P.arrow?.centerOffset!==0,[$e,pt]=g.useState();return se(()=>{v&&pt(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Tg,{scope:r,placedSide:q,onArrowChange:C,arrowX:me,arrowY:Fe,shouldHideArrow:ge,children:a.jsx(W.div,{"data-side":q,"data-align":X,...f,ref:w,style:{...f.style,animation:U?void 0:"none"}})})})});Ui.displayName=Oo;var Hi="PopperArrow",Pg={top:"bottom",right:"left",bottom:"top",left:"right"},Vi=g.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Ag(Hi,n),i=Pg[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(kg,{...o,ref:r,style:{...o.style,display:"block"}})})});Vi.displayName=Hi;function Og(e){return e!==null}var Rg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[d,u]=Wi(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+c/2,h=(o.arrow?.y??0)+l/2;let b="",f="";return d==="bottom"?(b=i?p:`${m}px`,f=`${-l}px`):d==="top"?(b=i?p:`${m}px`,f=`${n.floating.height+l}px`):d==="right"?(b=`${-l}px`,f=i?p:`${h}px`):d==="left"&&(b=`${n.floating.width+l}px`,f=i?p:`${h}px`),{data:{x:b,y:f}}}});function Wi(e){const[t,r="center"]=e.split("-");return[t,r]}var qi=Fi,Ro=Bi,Gi=Ui,Ki=Vi,Lg="Portal",an=g.forwardRef((e,t)=>{const{container:r,...n}=e,[o,s]=g.useState(!1);se(()=>s(!0),[]);const i=r||o&&globalThis?.document?.body;return i?ba.createPortal(a.jsx(W.div,{...n,ref:t}),i):null});an.displayName=Lg;function Ig(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Ke=e=>{const{present:t,children:r}=e,n=zg(t),o=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),s=Y(n.ref,Mg(o));return typeof r=="function"||n.isPresent?g.cloneElement(o,{ref:s}):null};Ke.displayName="Presence";function zg(e){const[t,r]=g.useState(),n=g.useRef(null),o=g.useRef(e),s=g.useRef("none"),i=e?"mounted":"unmounted",[c,l]=Ig(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const d=sn(n.current);s.current=c==="mounted"?d:"none"},[c]),se(()=>{const d=n.current,u=o.current;if(u!==e){const m=s.current,h=sn(d);e?l("MOUNT"):h==="none"||d?.display==="none"?l("UNMOUNT"):l(u&&m!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),se(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=h=>{const f=sn(n.current).includes(CSS.escape(h.animationName));if(h.target===t&&f&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=h=>{h.target===t&&(s.current=sn(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 l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function sn(e){return e?.animationName||"none"}function Mg(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 Dg=g[" useInsertionEffect ".trim().toString()]||se;function ct({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=Fg({defaultProp:t,onChange:r}),c=e!==void 0,l=c?e:o;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const p=u.current;p!==c&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${c?"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=c},[c,n])}const d=g.useCallback(u=>{if(c){const p=$g(u)?u(e):u;p!==e&&i.current?.(p)}else s(u)},[c,e,s,i]);return[l,d]}function Fg({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),o=g.useRef(r),s=g.useRef(t);return Dg(()=>{s.current=t},[t]),g.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,n,s]}function $g(e){return typeof e=="function"}var Bg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Et=new WeakMap,cn=new WeakMap,ln={},Lo=0,Yi=function(e){return e&&(e.host||Yi(e.parentNode))},Ug=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Yi(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})},Hg=function(e,t,r,n){var o=Ug(t,Array.isArray(e)?e:[e]);ln[r]||(ln[r]=new WeakMap);var s=ln[r],i=[],c=new Set,l=new Set(o),d=function(p){!p||c.has(p)||(c.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(m){if(c.has(m))u(m);else try{var h=m.getAttribute(n),b=h!==null&&h!=="false",f=(Et.get(m)||0)+1,x=(s.get(m)||0)+1;Et.set(m,f),s.set(m,x),i.push(m),f===1&&b&&cn.set(m,!0),x===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return u(t),c.clear(),Lo++,function(){i.forEach(function(p){var m=Et.get(p)-1,h=s.get(p)-1;Et.set(p,m),s.set(p,h),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),h||p.removeAttribute(r)}),Lo--,Lo||(Et=new WeakMap,Et=new WeakMap,cn=new WeakMap,ln={})}},Io=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Bg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Hg(n,o,r,"aria-hidden")):function(){return null}},Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Oe.apply(this,arguments)};function Xi(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 Vg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var dn="right-scroll-bar-position",un="width-before-scroll-bar",Wg="with-scroll-bars-hidden",qg="--removed-body-scroll-bar-size";function zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Gg(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 Kg=typeof window<"u"?g.useLayoutEffect:g.useEffect,Ji=new WeakMap;function Yg(e,t){var r=Gg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return Kg(function(){var n=Ji.get(r);if(n){var o=new Set(n),s=new Set(e),i=r.current;o.forEach(function(c){s.has(c)||zo(c,null)}),s.forEach(function(c){o.has(c)||zo(c,i)})}Ji.set(r,e)},[e]),r}function Xg(e){return e}function Jg(e,t){t===void 0&&(t=Xg);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(s){var i=t(s,n);return r.push(i),function(){r=r.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(n=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(c){return s(c)},filter:function(){return r}}},assignMedium:function(s){n=!0;var i=[];if(r.length){var c=r;r=[],c.forEach(s),i=r}var l=function(){var u=i;i=[],u.forEach(s)},d=function(){return Promise.resolve().then(l)};d(),r={push:function(u){i.push(u),d()},filter:function(u){return i=i.filter(u),r}}}};return o}function Zg(e){e===void 0&&(e={});var t=Jg(null);return t.options=Oe({async:!0,ssr:!1},e),t}var Zi=function(e){var t=e.sideCar,r=Xi(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 g.createElement(n,Oe({},r))};Zi.isSideCarExport=!0;function Qg(e,t){return e.useMedium(t),Zi}var Qi=Zg(),Mo=function(){},pn=g.forwardRef(function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:Mo,onWheelCapture:Mo,onTouchMoveCapture:Mo}),o=n[0],s=n[1],i=e.forwardProps,c=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,b=e.noIsolation,f=e.inert,x=e.allowPinchZoom,v=e.as,_=v===void 0?"div":v,w=e.gapMode,j=Xi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=Yg([r,t]),k=Oe(Oe({},j),o);return g.createElement(g.Fragment,null,u&&g.createElement(C,{sideCar:Qi,removeScrollBar:d,shards:p,noRelative:h,noIsolation:b,inert:f,setCallbacks:s,allowPinchZoom:!!x,lockRef:r,gapMode:w}),i?g.cloneElement(g.Children.only(c),Oe(Oe({},k),{ref:N})):g.createElement(_,Oe({},k,{className:l,ref:N}),c))});pn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pn.classNames={fullWidth:un,zeroRight:dn};var ex=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ex();return t&&e.setAttribute("nonce",t),e}function rx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ox=function(){var e=0,t=null;return{add:function(r){e==0&&(t=tx())&&(rx(t,r),nx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ax=function(){var e=ox();return function(t,r){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ec=function(){var e=ax(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},sx={left:0,top:0,right:0,gap:0},Do=function(e){return parseInt(e||"",10)||0},ix=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[Do(r),Do(n),Do(o)]},cx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sx;var t=ix(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])}},lx=ec(),Tt="data-scroll-locked",dx=function(e,t,r,n){var o=e.left,s=e.top,i=e.right,c=e.gap;return r===void 0&&(r="margin"),` 309 .`.concat(Wg,` { 213 `,Nr=16,Hu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:i,containerClassName:l})=>{let{toasts:d,handlers:c}=xu(r,s);return x.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Nr,left:Nr,right:Nr,bottom:Nr,pointerEvents:"none",...i},className:l,onMouseEnter:c.startPause,onMouseLeave:c.endPause},d.map(u=>{let p=u.position||t,m=c.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Bu(p,m);return x.createElement($u,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?Uu:"",style:g},u.type==="custom"?Sr(u.message,u):o?o(u):x.createElement(Fu,{toast:u,position:p}))}))},G=oe;const Ja={carousel:"carousel",grid:"grid"},Vu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,gapOnMobile:16,shape:"rectangle",size:150,sizeOnMobile:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ja.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={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"}],Za=[{label:"Horizontal",value:"horizontal"}],qu=[{label:"Vertical",value:"vertical"}],Gu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],Ku=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Qa={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},es=y.createContext&&y.createContext(Qa),Yu=["attr","size","title"];function Xu(e,t){if(e==null)return{};var r=Ju(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ju(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 Er(){return Er=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},Er.apply(this,arguments)}function ts(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?ts(Object(r),!0).forEach(function(n){Zu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ts(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zu(e,t,r){return t=Qu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qu(e){var t=ep(e,"string");return typeof t=="symbol"?t:t+""}function ep(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 rs(e){return e&&e.map((t,r)=>y.createElement(t.tag,Pr({key:r},t.attr),rs(t.child)))}function H(e){return t=>y.createElement(tp,Er({attr:Pr({},e.attr)},t),rs(e.child))}function tp(e){var t=r=>{var{attr:n,size:o,title:s}=e,i=Xu(e,Yu),l=o||r.size||"1em",d;return r.className&&(d=r.className),e.className&&(d=(d?d+" ":"")+e.className),y.createElement("svg",Er({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:d,style:Pr(Pr({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&y.createElement("title",null,s),e.children)};return es!==void 0?y.createElement(es.Consumer,null,r=>t(r)):t(Qa)}function rp(e){return H({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 Jt(e){return H({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 gt(e){return H({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 Zt(e){return H({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 Qt(e){return H({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 np(e){return H({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 op(e){return H({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 tt(e){return H({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 ap(e){return H({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 ns(e){return H({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 sp(e){return H({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 er(e){return H({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 Vn(e){return H({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 ip(e){return H({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 lp(e){return H({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 cp(e){return H({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 dp(e){return H({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 os(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wn(...e){return t=>{let r=!1;const n=e.map(o=>{const s=os(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():os(e[o],null)}}}}function Y(...e){return x.useCallback(Wn(...e),e)}function rt(e){const t=pp(e),r=x.forwardRef((n,o)=>{const{children:s,...i}=n,l=x.Children.toArray(s),d=l.find(fp);if(d){const c=d.props.children,u=l.map(p=>p===d?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:p);return a.jsx(t,{...i,ref:o,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var up=rt("Slot");function pp(e){const t=x.forwardRef((r,n)=>{const{children:o,...s}=r;if(x.isValidElement(o)){const i=gp(o),l=hp(s,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,i):i),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mp=Symbol("radix.slottable");function fp(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mp}function hp(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...l)=>{const d=s(...l);return o(...l),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function gp(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 as(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=as(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function xp(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=as(e))&&(n&&(n+=" "),n+=t);return n}function F(...e){return xp(e)}const bp="ecr-button",_p={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"},vp={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 re({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const s=n?up:"button";return a.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:F(bp,_p[t],vp[r],e),...o})}function yp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:s,handleCreateGroup:i,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(re,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(re,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"}),a.jsxs(re,{variant:"outline-danger",size:"sm",onClick:l,children:[a.jsx(Vn,{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:d=>o(d.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(re,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(er,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(ns,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(re,{disabled:s,onClick:i,className:"ecr-admin-reels-header__create",children:[s?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(gt,{})," ","Create Widget"]}):null]})]})}function jp(e){return H({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 Sp(e){return H({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 nt(e){return H({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 Cp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function kp({isFullScreen:e}){return a.jsx("div",{className:F("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const ss=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,s)=>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",s===r?.index?"ecr-player__progress-fill--active":s<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},s))}),xt=({className:e,children:t,...r})=>a.jsx("button",{className:F("ecr-player__nav",e),...r,children:t});function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Gn(e){return H({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 Kn(e){return H({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 Yn(e){return H({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 Np="Left",Ep="Right",Pp="Up",Tp="Down",bt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},is="mousemove",ls="mouseup",Ap="touchend",Op="touchmove",Rp="touchstart";function Lp(e,t,r,n){return e>t?r>0?Ep:Np:n>0?Tp:Pp}function cs(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 Ip(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(is,n),document.addEventListener(ls,i));const{clientX:b,clientY:f}=p?u.touches[0]:u,h=cs([b,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Xn),{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]=cs([b,f],m.rotationAngle),_=h-p.xy[0],w=v-p.xy[1],j=Math.abs(_),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[_/(N||1),w/(N||1)],P=Lp(j,C,_,w),T=typeof m.delta=="number"?m.delta:m.delta[P.toLowerCase()]||bt.delta;if(j<T&&C<T&&!p.swiping)return p;const R={absX:j,absY:C,deltaX:_,deltaY:w,dir:P,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};R.first&&m.onSwipeStart&&m.onSwipeStart(R),m.onSwiping&&m.onSwiping(R);let L=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${P}`])&&(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),Xn),{eventData:g})})},s=()=>{document.removeEventListener(is,n),document.removeEventListener(ls,i)},i=u=>{s(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},bt.touchEventOptions),p.touchEventOptions),b=[[Rp,r,g],[Op,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[Ap,o,g]];b.forEach(([f,h,v])=>u.addEventListener(f,h,v)),m=()=>b.forEach(([f,h])=>u.removeEventListener(f,h))}return m},c={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&&(c.onMouseDown=r),[c,l]}function zp(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 Mp(e){const{trackMouse:t}=e,r=x.useRef(Object.assign({},Xn)),n=x.useRef(Object.assign({},bt)),o=x.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},bt),e);let s;for(s in bt)n.current[s]===void 0&&(n.current[s]=bt[s]);const[i,l]=x.useMemo(()=>Ip(d=>r.current=d(r.current,n.current),{trackMouse:t}),[t]);return r.current=zp(r.current,n.current,o.current,l),i}const Dp=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:s,handleNextFile:i,setDuration:l})=>{const[d,c]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,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:d?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>s(o),onEnded:i,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;c(g>m),l(p.duration)}})})},ds=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:s,setIsPaused:i,handlePrevFile:l,handleNextFile:d})=>{const[c,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=h=>{const v=p.current[h];v&&(s?v.play():v.pause(),i(_=>!_))},g=h=>{const v=p.current[h];v&&(v.muted=!c,u(_=>!_))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Mp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:d,onSwipedUp:()=>{b&&d()},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(Dp,{videoRefs:p,file:h,isMuted:c,i:v,togglePlayPause:m,handleNextFile:d,setDuration:r,isPaused:s},h.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[s?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(v)}),c?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(v)})]})]})},v))})},Fp=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,s]=y.useState(!1),[i,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const d=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},c=()=>{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(xt,{onClick:d,className:"ecr-player__nav--left",children:a.jsx(Zt,{size:24})}):null,r.index<u-1?a.jsx(xt,{onClick:c,className:"ecr-player__nav--right",children:a.jsx(Qt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ss,{playingStory:e,duration:i,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(er,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(ds,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:s,handlePrevFile:d,handleNextFile:c,storyId:e.id,storyTitle:e?.title})]})]})})};function $p(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Bp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Tr(e){return H({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 Hp(e){return H({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 us(e){return H({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 Vp(e){return H({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 Wp(e){return H({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 qp(e){return H({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 Gp(e){return H({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 Kp=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`},Yp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(i=>({...i,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),s=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,poster:s}):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%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Kp(r?.[e.id]??e.view_count)}),a.jsx(op,{size:14})]})]})},Jn=y.memo(Yp);function Xp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:i}){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(Jn,{story:e,styles:t}),a.jsxs("div",{className:F("ecr-admin-reel-card__actions",i?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(re,{onClick:()=>s(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(dp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(re,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(ht,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Tr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(re,{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(Vn,{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",i?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(re,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Vp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{className:"ecr-admin-reel-card__title",children:e.title})]})}function Jp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:s,lastStoryElementRef:i}){return a.jsx("div",{className:"ecr-admin-reels-grid",children:e?.map((l,d)=>a.jsx("div",{ref:e.length===d+1?i:null,children:a.jsx(Xp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:r.length>0})},l.id))})}const tr=({cb:e})=>{const t=Se(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(jp,{size:24})})};function Zp(e){return H({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 rr=({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(ht,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:s=>{if(!t)return;const i=r.href;i&&(s.preventDefault(),t(i))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Zp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Ar=({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:s=>{s.currentTarget.contains(s.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(sp,{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(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Or=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:s})=>a.jsxs(ht,{style:{color:r},to:e,className:F("ecr-admin-link-button",o),onClick:i=>{s&&(i.preventDefault(),s(e))},children:[t&&a.jsx(t,{}),n]}),Rr=({className:e})=>a.jsx("div",{className:F("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),_t=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),vt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Qp(e){return H({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 Lr=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Qp,{}),"ReelsWP"]});function ps(e,t){return function(){return e.apply(t,arguments)}}const{toString:em}=Object.prototype,{getPrototypeOf:Zn}=Object,{iterator:Ir,toStringTag:ms}=Symbol,zr=(e=>t=>{const r=em.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),_e=e=>(e=e.toLowerCase(),t=>zr(t)===e),Mr=e=>t=>typeof t===e,{isArray:yt}=Array,wt=Mr("undefined");function nr(e){return e!==null&&!wt(e)&&e.constructor!==null&&!wt(e.constructor)&&de(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fs=_e("ArrayBuffer");function tm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fs(e.buffer),t}const rm=Mr("string"),de=Mr("function"),hs=Mr("number"),or=e=>e!==null&&typeof e=="object",nm=e=>e===!0||e===!1,Dr=e=>{if(zr(e)!=="object")return!1;const t=Zn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ms in e)&&!(Ir in e)},om=e=>{if(!or(e)||nr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},am=_e("Date"),sm=_e("File"),im=_e("Blob"),lm=_e("FileList"),cm=e=>or(e)&&de(e.pipe),dm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||de(e.append)&&((t=zr(e))==="formdata"||t==="object"&&de(e.toString)&&e.toString()==="[object FormData]"))},um=_e("URLSearchParams"),[pm,mm,fm,hm]=["ReadableStream","Request","Response","Headers"].map(_e),gm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ar(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(nr(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let l;for(n=0;n<i;n++)l=s[n],t.call(null,e[l],l,e)}}function gs(e,t){if(nr(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 ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xs=e=>!wt(e)&&e!==ot;function Qn(){const{caseless:e,skipUndefined:t}=xs(this)&&this||{},r={},n=(o,s)=>{const i=e&&gs(r,s)||s;Dr(r[i])&&Dr(o)?r[i]=Qn(r[i],o):Dr(o)?r[i]=Qn({},o):yt(o)?r[i]=o.slice():(!t||!wt(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&ar(arguments[o],n);return r}const xm=(e,t,r,{allOwnKeys:n}={})=>(ar(t,(o,s)=>{r&&de(o)?e[s]=ps(o,r):e[s]=o},{allOwnKeys:n}),e),bm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),_m=(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)},vm=(e,t,r,n)=>{let o,s,i;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=r!==!1&&Zn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ym=(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},wm=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!hs(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},jm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Zn(Uint8Array)),Sm=(e,t)=>{const n=(e&&e[Ir]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Cm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},km=_e("HTMLFormElement"),Nm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),bs=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Em=_e("RegExp"),_s=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ar(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},Pm=e=>{_s(e,(t,r)=>{if(de(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(de(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+"'")})}})},Tm=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return yt(e)?n(e):n(String(e).split(t)),r},Am=()=>{},Om=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Rm(e){return!!(e&&de(e.append)&&e[ms]==="FormData"&&e[Ir])}const Lm=e=>{const t=new Array(10),r=(n,o)=>{if(or(n)){if(t.indexOf(n)>=0)return;if(nr(n))return n;if(!("toJSON"in n)){t[o]=n;const s=yt(n)?[]:{};return ar(n,(i,l)=>{const d=r(i,o+1);!wt(d)&&(s[l]=d)}),t[o]=void 0,s}}return n};return r(e,0)},Im=_e("AsyncFunction"),zm=e=>e&&(or(e)||de(e))&&de(e.then)&&de(e.catch),vs=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:s})=>{o===ot&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",de(ot.postMessage)),Mm=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||vs,S={isArray:yt,isArrayBuffer:fs,isBuffer:nr,isFormData:dm,isArrayBufferView:tm,isString:rm,isNumber:hs,isBoolean:nm,isObject:or,isPlainObject:Dr,isEmptyObject:om,isReadableStream:pm,isRequest:mm,isResponse:fm,isHeaders:hm,isUndefined:wt,isDate:am,isFile:sm,isBlob:im,isRegExp:Em,isFunction:de,isStream:cm,isURLSearchParams:um,isTypedArray:jm,isFileList:lm,forEach:ar,merge:Qn,extend:xm,trim:gm,stripBOM:bm,inherits:_m,toFlatObject:vm,kindOf:zr,kindOfTest:_e,endsWith:ym,toArray:wm,forEachEntry:Sm,matchAll:Cm,isHTMLForm:km,hasOwnProperty:bs,hasOwnProp:bs,reduceDescriptors:_s,freezeMethods:Pm,toObjectSet:Tm,toCamelCase:Nm,noop:Am,toFiniteNumber:Om,findKey:gs,global:ot,isContextDefined:xs,isSpecCompliantForm:Rm,toJSONObject:Lm,isAsyncFn:Im,isThenable:zm,setImmediate:vs,asap:Mm,isIterable:e=>e!=null&&de(e[Ir])};function U(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(U,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 ys=U.prototype,ws={};["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=>{ws[e]={value:e}}),Object.defineProperties(U,ws),Object.defineProperty(ys,"isAxiosError",{value:!0}),U.from=(e,t,r,n,o,s)=>{const i=Object.create(ys);S.toFlatObject(e,i,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const l=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return U.call(i,l,d,r,n,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const Dm=null;function eo(e){return S.isPlainObject(e)||S.isArray(e)}function js(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function Ss(e,t,r){return e?e.concat(t).map(function(o,s){return o=js(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function Fm(e){return S.isArray(e)&&!e.some(eo)}const $m=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function Fr(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,s=r.dots,i=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!d&&S.isBlob(b))throw new U("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?d&&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)&&Fm(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(v=S.toArray(b)))return f=js(f),v.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(i===!0?Ss([f],j,s):i===null?f:f+"[]",c(w))}),!1}return eo(b)?!0:(t.append(Ss(h,f,s),c(b)),!1)}const p=[],m=Object.assign($m,{defaultVisitor:u,convertValue:c,isVisitable:eo});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 Cs(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function to(e,t){this._pairs=[],e&&Fr(e,this,t)}const ks=to.prototype;ks.append=function(t,r){this._pairs.push([t,r])},ks.toString=function(t){const r=t?function(n){return t.call(this,n,Cs)}:Cs;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Bm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ns(e,t,r){if(!t)return e;const n=r&&r.encode||Bm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(o?s=o(t,r):s=S.isURLSearchParams(t)?t.toString():new to(t,r).toString(n),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Es{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 Ps={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Um={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:to,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ro=typeof window<"u"&&typeof document<"u",no=typeof navigator=="object"&&navigator||void 0,Hm=ro&&(!no||["ReactNative","NativeScript","NS"].indexOf(no.product)<0),Vm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wm=ro&&window.location.href||"http://localhost",ie={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ro,hasStandardBrowserEnv:Hm,hasStandardBrowserWebWorkerEnv:Vm,navigator:no,origin:Wm},Symbol.toStringTag,{value:"Module"})),...Um};function qm(e,t){return Fr(e,new ie.classes.URLSearchParams,{visitor:function(r,n,o,s){return ie.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Gm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Km(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function Ts(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),d=s>=r.length;return i=!i&&S.isArray(o)?o.length:i,d?(S.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!l):((!o[i]||!S.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&S.isArray(o[i])&&(o[i]=Km(o[i])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Gm(n),o,r,0)}),r}return null}function Ym(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:Ps,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=S.isObject(t);if(s&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Ts(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(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return qm(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Fr(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),Ym(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 i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?U.from(l,U.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:ie.classes.FormData,Blob:ie.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 Xm=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"]),Jm=e=>{const t={};let r,n,o;return e&&e.split(` 214 `).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&Xm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},As=Symbol("internals");function ir(e){return e&&String(e).trim().toLowerCase()}function $r(e){return e===!1||e==null?e:S.isArray(e)?e.map($r):String(e)}function Zm(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 Qm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oo(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 ef(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function tf(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,s,i){return this[n].call(this,t,o,s,i)},configurable:!0})})}let ue=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(l,d,c){const u=ir(d);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||c===!0||c===void 0&&o[p]!==!1)&&(o[p||d]=$r(l))}const i=(l,d)=>S.forEach(l,(c,u)=>s(c,u,d));if(S.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(S.isString(t)&&(t=t.trim())&&!Qm(t))i(Jm(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},d,c;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[c=u[0]]=(d=l[c])?S.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}i(l,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=ir(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Zm(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=ir(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||oo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(i){if(i=ir(i),i){const l=S.findKey(n,i);l&&(!r||oo(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||oo(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,s)=>{const i=S.findKey(n,s);if(i){r[i]=$r(o),delete r[s];return}const l=t?ef(s):String(s).trim();l!==s&&delete r[s],r[l]=$r(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[As]=this[As]={accessors:{}}).accessors,o=this.prototype;function s(i){const l=ir(i);n[l]||(tf(o,i),n[l]=!0)}return S.isArray(t)?t.forEach(s):s(t),this}};ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(ue.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(ue);function ao(e,t){const r=this||sr,n=t||r,o=ue.from(n.headers);let s=n.data;return S.forEach(e,function(l){s=l.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Os(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(jt,U,{__CANCEL__:!0});function Rs(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function rf(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function nf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),u=n[s];i||(i=c),r[o]=d,n[o]=c;let p=s,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const g=u&&c-u;return g?Math.round(m*1e3/g):void 0}}function of(e,t){let r=0,n=1e3/t,o,s;const i=(c,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...c)};return[(...c)=>{const u=Date.now(),p=u-r;p>=n?i(c,u):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},n-p)))},()=>o&&i(o)]}const Br=(e,t,r=3)=>{let n=0;const o=nf(50,250);return of(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,d=i-n,c=o(d),u=i<=l;n=i;const p={loaded:i,total:l,progress:l?i/l:void 0,bytes:d,rate:c||void 0,estimated:c&&l&&u?(l-i)/c:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Ls=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Is=e=>(...t)=>S.asap(()=>e(...t)),af=ie.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ie.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ie.origin),ie.navigator&&/(msie|trident)/i.test(ie.navigator.userAgent)):()=>!0,sf=ie.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){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}`),s===!0&&l.push("secure"),S.isString(i)&&l.push(`SameSite=${i}`),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 lf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function cf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function zs(e,t,r){let n=!lf(t);return e&&(n||r==!1)?cf(e,t):t}const Ms=e=>e instanceof ue?{...e}:e;function at(e,t){t=t||{};const r={};function n(c,u,p,m){return S.isPlainObject(c)&&S.isPlainObject(u)?S.merge.call({caseless:m},c,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(c,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(c))return n(void 0,c,p,m)}else return n(c,u,p,m)}function s(c,u){if(!S.isUndefined(u))return n(void 0,u)}function i(c,u){if(S.isUndefined(u)){if(!S.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function l(c,u,p){if(p in t)return n(c,u);if(p in e)return n(void 0,c)}const d={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(c,u,p)=>o(Ms(c),Ms(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=d[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Ds=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:l}=t;if(t.headers=i=ue.from(i),t.url=Ns(zs(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ie.hasStandardBrowserEnv||ie.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const d=r.getHeaders(),c=["content-type","content-length"];Object.entries(d).forEach(([u,p])=>{c.includes(u.toLowerCase())&&i.set(u,p)})}}if(ie.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&af(t.url))){const d=o&&s&&sf.read(s);d&&i.set(o,d)}return t},df=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Ds(e);let s=o.data;const i=ue.from(o.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:c}=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=ue.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};Rs(function(k){r(k),f()},function(k){n(k),f()},C),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 U("Request aborted",U.ECONNABORTED,e,h)),h=null)},h.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new U(C,U.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 C=o.transitional||Ps;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new U(j,C.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},s===void 0&&i.setContentType(null),"setRequestHeader"in h&&S.forEach(i.toJSON(),function(j,C){h.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),l&&l!=="json"&&(h.responseType=o.responseType),c&&([m,b]=Br(c,!0),h.addEventListener("progress",m)),d&&h.upload&&([p,g]=Br(d),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{h&&(n(!w||w.type?new jt(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 _=rf(o.url);if(_&&ie.protocols.indexOf(_)===-1){n(new U("Unsupported protocol "+_+":",U.ERR_BAD_REQUEST,e));return}h.send(s||null)})},uf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const s=function(c){if(!o){o=!0,l();const u=c instanceof Error?c:this.reason;n.abort(u instanceof U?u:new jt(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:d}=n;return d.unsubscribe=()=>S.asap(l),d}},pf=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},mf=async function*(e,t){for await(const r of ff(e))yield*pf(r,t)},ff=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()}},Fs=(e,t,r,n)=>{const o=mf(e,t);let s=0,i,l=d=>{i||(i=!0,n&&n(d))};return new ReadableStream({async pull(d){try{const{done:c,value:u}=await o.next();if(c){l(),d.close();return}let p=u.byteLength;if(r){let m=s+=p;r(m)}d.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(d){return l(d),o.return()}},{highWaterMark:2})},$s=64*1024,{isFunction:Ur}=S,hf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Bs,TextEncoder:Us}=S.global,Hs=(e,...t)=>{try{return!!e(...t)}catch{return!1}},gf=e=>{e=S.merge.call({skipUndefined:!0},hf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Ur(t):typeof fetch=="function",s=Ur(r),i=Ur(n);if(!o)return!1;const l=o&&Ur(Bs),d=o&&(typeof Us=="function"?(b=>f=>b.encode(f))(new Us):async b=>new Uint8Array(await new r(b).arrayBuffer())),c=s&&l&&Hs(()=>{let b=!1;const f=new r(ie.origin,{body:new Bs,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=i&&l&&Hs(()=>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 U(`Response type '${b}' is not supported`,U.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(ie.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 d(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:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:P="same-origin",fetchOptions:T}=Ds(b),R=t||fetch;k=k?(k+"").toLowerCase():"text";let L=uf([_,w&&w.toAbortSignal()],j),I=null;const O=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let D;try{if(N&&c&&h!=="get"&&h!=="head"&&(D=await g(E,v))!==0){let Z=new r(f,{method:"POST",body:v,duplex:"half"}),me;if(S.isFormData(v)&&(me=Z.headers.get("content-type"))&&E.setContentType(me),Z.body){const[Fe,ge]=Ls(D,Br(Is(N)));v=Fs(Z.body,$s,Fe,ge)}}S.isString(P)||(P=P?"include":"omit");const z=s&&"credentials"in r.prototype,B={...T,signal:L,method:h.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:z?P:void 0};I=s&&new r(f,B);let A=await(s?R(I,T):R(f,B));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&O)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=A[$e]});const me=S.toFiniteNumber(A.headers.get("content-length")),[Fe,ge]=C&&Ls(me,Br(Is(C),!0))||[];A=new n(Fs(A.body,$s,Fe,()=>{ge&&ge(),O&&O()}),Z)}k=k||"text";let X=await p[S.findKey(p,k)||"text"](A,b);return!q&&O&&O(),await new Promise((Z,me)=>{Rs(Z,me,{data:X,headers:ue.from(A.headers),status:A.status,statusText:A.statusText,config:b,request:I})})}catch(z){throw O&&O(),z&&z.name==="TypeError"&&/Load failed|fetch/i.test(z.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,b,I),{cause:z.cause||z}):U.from(z,z&&z.code,b,I)}}},xf=new Map,Vs=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let i=s.length,l=i,d,c,u=xf;for(;l--;)d=s[l],c=u.get(d),c===void 0&&u.set(d,c=l?new Map:gf(t)),u=c;return c};Vs();const so={http:Dm,xhr:df,fetch:{get:Vs}};S.forEach(so,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ws=e=>`- ${e}`,bf=e=>S.isFunction(e)||e===null||e===!1;function _f(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let i=0;i<r;i++){n=e[i];let l;if(o=n,!bf(n)&&(o=so[(l=String(n)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;s[l||"#"+i]=o}if(!o){const i=Object.entries(s).map(([d,c])=>`adapter ${d} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=r?i.length>1?`since : 216 `+i.map(Ws).join(` 217 `):" "+Ws(i[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const qs={getAdapter:_f,adapters:so};function io(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function Gs(e){return io(e),e.headers=ue.from(e.headers),e.data=ao.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),qs.getAdapter(e.adapter||sr.adapter,e)(e).then(function(n){return io(e),n.data=ao.call(e,e.transformResponse,n),n.headers=ue.from(n.headers),n},function(n){return Os(n)||(io(e),n&&n.response&&(n.response.data=ao.call(e,e.transformResponse,n.response),n.response.headers=ue.from(n.response.headers))),Promise.reject(n)})}const Ks="1.13.1",Hr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Hr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ys={};Hr.transitional=function(t,r,n){function o(s,i){return"[Axios v"+Ks+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,l)=>{if(t===!1)throw new U(o(i," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!Ys[i]&&(Ys[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,l):!0}},Hr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function vf(e,t,r){if(typeof e!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const l=e[s],d=l===void 0||i(l,s,e);if(d!==!0)throw new U("option "+s+" must be "+d,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+s,U.ERR_BAD_OPTION)}}const Vr={assertOptions:vf,validators:Hr},ke=Vr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Es,response:new Es}}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 s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` 218 `+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Vr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:Vr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Vr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&S.merge(s.common,s[r.method]);s&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),r.headers=ue.concat(i,s);const l=[];let d=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(d=d&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!d){const b=[Gs.bind(this),void 0];for(b.unshift(...l),b.push(...c),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=Gs.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,m=c.length;p<m;)u=u.then(c[p++],c[p++]);return u}getUri(t){t=at(this.defaults,t);const r=zs(t.baseURL,t.url,t.allowAbsoluteUrls);return Ns(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,l){return this.request(at(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let yf=class Sd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(l=>{n.subscribe(l),s=l}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,l){n.reason||(n.reason=new jt(s,i,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 wf(e){return function(r){return e.apply(null,r)}}function jf(e){return S.isObject(e)&&e.isAxiosError===!0}const lo={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(lo).forEach(([e,t])=>{lo[t]=e});function Xs(e){const t=new st(e),r=ps(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Xs(at(e,o))},r}const ee=Xs(sr);ee.Axios=st,ee.CanceledError=jt,ee.CancelToken=yf,ee.isCancel=Os,ee.VERSION=Ks,ee.toFormData=Fr,ee.AxiosError=U,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=wf,ee.isAxiosError=jf,ee.mergeConfig=at,ee.AxiosHeaders=ue,ee.formToJSON=e=>Ts(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=qs.getAdapter,ee.HttpStatusCode=lo,ee.default=ee;const{Axios:Pv,AxiosError:Tv,CanceledError:Av,isCancel:Ov,CancelToken:Rv,VERSION:Lv,all:Iv,Cancel:zv,isAxiosError:Mv,spread:Dv,toFormData:Fv,AxiosHeaders:$v,HttpStatusCode:Bv,formToJSON:Uv,getAdapter:Hv,mergeConfig:Vv}=ee,Js=ecommreelsInfo,pe=ee.create({baseURL:`${Js.apiBase}`,headers:{"X-WP-Nonce":Js.nonce,"Content-Type":"application/json"}}),Sf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async i=>{try{t(!0);const l={styles:et,story_ids:i},d=await pe.post("stories/manage-group-stories",l);return G.success("Group created successfully!"),d.data.group_id}catch(l){return l instanceof Error?G.error(l.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),s=y.useCallback(async(i,l,d)=>{try{return n(!0),await pe.delete(`story/${i}`),l(c=>c.filter(u=>u.id!==i)),d?.silent||G.success("Reel deleted successfully!"),{ok:!0}}catch(c){const u=c instanceof Error?c.message:"Something went wrong. Try again later!";return d?.silent||G.error(u),{ok:!1,message:u}}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:s}};function co(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Zs=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[s,i]=y.useState(!0),[l,d]=y.useState(!1),[c,u]=y.useState(!1),[p,m]=y.useState(""),g=co(p,500),b=y.useRef(!0),f=y.useCallback(async _=>{_===1&&b.current?u(!0):d(!0);try{const w={page:_,per_page:20};e&&(w.group_id=e),g&&(w.search=g);const j=await pe.get("stories",{params:w}),C=j.data,N=parseInt(j.headers["x-wp-totalpages"]);r(k=>_===1?C:[...k,...C]),o(_+1),i(_<N)}catch(w){w instanceof Error?G.error(w.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),d(!1),u(!1)}},[e,g]);y.useEffect(()=>{o(1),r([]),f(1)},[g,f]);const h=y.useRef(null),v=y.useCallback(_=>{l||(h.current&&h.current.disconnect(),h.current=new IntersectionObserver(w=>{w[0].isIntersecting&&s&&f(n)}),_&&h.current.observe(_))},[l,s,n,f]);return y.useEffect(()=>()=>{h.current&&h.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:c,lastStoryElementRef:v}};function Cf(){const e=Se(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:s,setSearchTerm:i,isLoading:l}=Zs(null),{styles:d,isCreating:c,isDeleting:u,createGroup:p,deleteReel:m}=Sf(),[g,b]=y.useState(null),[f,h]=y.useState(null),[v,_]=y.useState(null),[w,j]=y.useState([]),C=async()=>{const T=await p(w);T&&e(`?view=${K.mg}&gid=${T}`)},N=()=>{j(t.map(T=>T.id))},k=T=>{j(R=>R.includes(T)?R.filter(L=>L!==T):[...R,T])},E=()=>{w.length&&h(w)},P=y.useCallback(async()=>{if(g){await m(g,r),b(null);return}if(f?.length){const T=await Promise.all(f.map(O=>m(O,r,{silent:!0}))),R=f.filter((O,D)=>T[D]?.ok),L=R.length,I=f.length-L;L&&(r(O=>O.filter(D=>!R.includes(D.id))),j(O=>O.filter(D=>!R.includes(D)))),L&&G.success(`${L} reels deleted successfully!`),I&&G.error(`${I} reels failed to delete.`),h(null)}},[m,g,f,r]);return l&&!t.length?a.jsx(Rr,{}):a.jsxs(a.Fragment,{children:[(g||f)&&a.jsx(Ar,{onReject:()=>{b(null),h(null)},onAccept:P,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(_t,{left:[a.jsx(vt,{name:"All Reels",Icon:rp},"page"),a.jsx(tr,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Lr,{},"reel-wp")],right:[a.jsx(Or,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:gt},"add-reel-all-reel")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(yp,{selectedReelIds:w,handleSelectAll:N,clearSelection:()=>j([]),searchTerm:s,setSearchTerm:i,isCreating:c,handleCreateGroup:C,handleBulkDelete:E}),t.length?a.jsx(Jp,{reels:t,styles:d,selectedReelIds:w,onSelectReel:k,onDeleteReel:b,onPreviewReel:_,lastStoryElementRef:o}):!n&&!l?a.jsx(Cp,{}):null,n&&a.jsx(kp,{isFullScreen:!t.length})]}),!!v&&a.jsx(Fp,{previewReel:v,setPreviewReel:_})]})}const kf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:s,links:i,thumbnail:l})=>{try{t(!0);const d={story_title:o,files:s,links:i};typeof l=="string"&&l.trim().length>0&&(d.thumbnail=l),n&&(d.story_id=n);const c=await pe.post("files",d);return G.success(`Story ${n?"updated":"created"} successfully!`),c.data.story_id}catch(d){return d instanceof Error?G.error(d.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},uo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(re,{onClick:t,className:F("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(ap,{className:"ecr-admin-save-button__icon"})," ",r]}),Qs=({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:s=>{e&&e(!0),r(s.target.value)}})}),Nf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const s=Se(),[i]=Yt(),l=i.get("sid"),d=i.get("from")||K.ag,c=i.get("gid"),{isSaving:u,saveStory:p}=kf(),m=async()=>{if(u)return;const g=await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});g&&s(`?view=${d}${c?`&gid=${c}`:""}`,{replace:!0,...l?{}:{state:{storyId:g}}})};return a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:l?"Update Reel":"Add Reel",Icon:gt},"page"),a.jsx(tr,{},"back")],center:[a.jsx(Qs,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(uo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function Ef(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let po;const Pf=new Uint8Array(16);function Tf(){if(!po){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");po=crypto.getRandomValues.bind(crypto)}return po(Pf)}const ei={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Af(e,t,r){e=e||{};const n=e.random??e.rng?.()??Tf();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,Ef(n)}function mo(e,t,r){return ei.randomUUID&&!e?ei.randomUUID():Af(e)}const ti="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",ri=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:s})=>{const[i,l]=y.useState(!1),d=()=>{const c=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});c.on("select",()=>{const u=c.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:mo()}));e(m=>[...m,...p])}),c.open()};return a.jsx("div",{className:F("ecr-admin-upload",i?"ecr-admin-upload--active":"ecr-admin-upload--idle",s),onDragOver:c=>{c.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:c=>{c.preventDefault(),l(!1),d()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:d,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:ti,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:i?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]})})]})})};/** 219 * @license lucide-react v0.552.0 - ISC 220 * 221 * This source code is licensed under the ISC license. 222 * See the LICENSE file in the root directory of this source tree. 223 */const Of=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ni=e=>{const t=Rf(e);return t.charAt(0).toUpperCase()+t.slice(1)},oi=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Lf=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** 224 * @license lucide-react v0.552.0 - ISC 225 * 226 * This source code is licensed under the ISC license. 227 * See the LICENSE file in the root directory of this source tree. 228 */var If={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 229 * @license lucide-react v0.552.0 - ISC 230 * 231 * This source code is licensed under the ISC license. 232 * See the LICENSE file in the root directory of this source tree. 233 */const zf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...l},d)=>y.createElement("svg",{ref:d,...If,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:oi("lucide",o),...!s&&!Lf(l)&&{"aria-hidden":"true"},...l},[...i.map(([c,u])=>y.createElement(c,u)),...Array.isArray(s)?s:[s]]));/** 234 * @license lucide-react v0.552.0 - ISC 235 * 236 * This source code is licensed under the ISC license. 237 * See the LICENSE file in the root directory of this source tree. 238 */const le=(e,t)=>{const r=y.forwardRef(({className:n,...o},s)=>y.createElement(zf,{ref:s,iconNode:t,className:oi(`lucide-${Of(ni(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ni(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 Mf=le("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 fo=le("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 Df=le("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 Ff=le("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 $f=le("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 Bf=le("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 Uf=le("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 Hf=le("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 Vf=le("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 Wf=le("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 qf=le("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 Gf=le("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 Kf=le("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 Yf=le("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"}]]);/** 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 Xf=le("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"}]]);/** 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 Jf=le("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=s=>{const{children:i,...l}=s,d=x.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:d,children:i})};n.displayName=e+"Provider";function o(s){const i=x.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(s,i){const l=x.createContext(i),d=r.length;r=[...r,i];const c=p=>{const{scope:m,children:g,...b}=p,f=m?.[e]?.[d]||l,h=x.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:h,children:g})};c.displayName=s+"Provider";function u(p,m){const g=m?.[e]?.[d]||l,b=x.useContext(g);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[c,u]}const o=()=>{const s=r.map(i=>x.createContext(i));return function(l){const d=l?.[e]||s;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};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(s){const i=n.reduce((l,{useScope:d,scopeName:c})=>{const p=d(s)[`__scope${c}`];return{...l,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};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=rt(`Primitive.${t}`),n=x.forwardRef((o,s)=>{const{asChild:i,...l}=o,d=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function th(e,t){e&&br.flushSync(()=>e.dispatchEvent(t))}function Ve(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=Ve(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",ho="dismissableLayer.update",oh="dismissableLayer.pointerDownOutside",ah="dismissableLayer.focusOutside",ai,si=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wr=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...d}=e,c=x.useContext(si),[u,p]=x.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=x.useState({}),b=Y(t,k=>p(k)),f=Array.from(c.layers),[h]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(h),_=u?f.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,j=_>=v,C=lh(k=>{const E=k.target,P=[...c.branches].some(T=>T.contains(E));!j||P||(o?.(k),i?.(k),k.defaultPrevented||l?.())},m),N=ch(k=>{const E=k.target;[...c.branches].some(T=>T.contains(E))||(s?.(k),i?.(k),k.defaultPrevented||l?.())},m);return rh(k=>{_===c.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),x.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ai=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ii(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ai)}},[u,m,r,c]),x.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ii())},[u,c]),x.useEffect(()=>{const k=()=>g({});return document.addEventListener(ho,k),()=>document.removeEventListener(ho,k)},[]),a.jsx(W.div,{...d,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,C.onPointerDownCapture)})});Wr.displayName=nh;var sh="DismissableLayerBranch",ih=x.forwardRef((e,t)=>{const r=x.useContext(si),n=x.useRef(null),o=Y(t,n);return x.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ih.displayName=sh;function lh(e,t=globalThis?.document){const r=Ve(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const s=l=>{if(l.target&&!n.current){let d=function(){li(oh,r,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ch(e,t=globalThis?.document){const r=Ve(e),n=x.useRef(!1);return x.useEffect(()=>{const o=s=>{s.target&&!n.current&&li(ah,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ii(){const e=new CustomEvent(ho);document.dispatchEvent(e)}function li(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?th(o,s):o.dispatchEvent(s)}var go=0;function xo(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ci()),document.body.insertAdjacentElement("beforeend",e[1]??ci()),go++,()=>{go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),go--}},[])}function ci(){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 bo="focusScope.autoFocusOnMount",_o="focusScope.autoFocusOnUnmount",di={bubbles:!1,cancelable:!0},dh="FocusScope",qr=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[l,d]=x.useState(null),c=Ve(o),u=Ve(s),p=x.useRef(null),m=Y(t,f=>d(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:We(p.current,{select:!0})},h=function(w){if(g.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||We(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(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){mi.add(g);const f=document.activeElement;if(!l.contains(f)){const v=new CustomEvent(bo,di);l.addEventListener(bo,c),l.dispatchEvent(v),v.defaultPrevented||(uh(gh(ui(l)),{select:!0}),document.activeElement===f&&We(l))}return()=>{l.removeEventListener(bo,c),setTimeout(()=>{const v=new CustomEvent(_o,di);l.addEventListener(_o,u),l.dispatchEvent(v),v.defaultPrevented||We(f??document.body,{select:!0}),l.removeEventListener(_o,u),mi.remove(g)},0)}}},[l,c,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&&We(w,{select:!0})):f.shiftKey&&v===w&&(f.preventDefault(),r&&We(j,{select:!0})):v===_&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...i,ref:m,onKeyDown:b})});qr.displayName=dh;function uh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function ph(e){const t=ui(e),r=pi(t,e),n=pi(t.reverse(),e);return[r,n]}function ui(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 pi(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 We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&fh(e)&&t&&e.select()}}var mi=hh();function hh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=fi(e,t),e.unshift(t)},remove(t){e=fi(e,t),e[0]?.resume()}}}function fi(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 se=globalThis?.document?x.useLayoutEffect:()=>{},xh=x[" useId ".trim().toString()]||(()=>{}),bh=0;function Ne(e){const[t,r]=x.useState(xh());return se(()=>{r(n=>n??String(bh++))},[e]),e||(t?`radix-${t}`:"")}const _h=["top","right","bottom","left"],qe=Math.min,fe=Math.max,Gr=Math.round,Kr=Math.floor,Ee=e=>({x:e,y:e}),vh={left:"right",right:"left",bottom:"top",top:"bottom"},yh={start:"end",end:"start"};function vo(e,t,r){return fe(e,qe(t,r))}function ze(e,t){return typeof e=="function"?e(t):e}function Me(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function yo(e){return e==="x"?"y":"x"}function wo(e){return e==="y"?"height":"width"}const wh=new Set(["top","bottom"]);function Pe(e){return wh.has(Me(e))?"y":"x"}function jo(e){return yo(Pe(e))}function jh(e,t,r){r===void 0&&(r=!1);const n=St(e),o=jo(e),s=wo(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Yr(i)),[i,Yr(i)]}function Sh(e){const t=Yr(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>yh[t])}const hi=["left","right"],gi=["right","left"],Ch=["top","bottom"],kh=["bottom","top"];function Nh(e,t,r){switch(e){case"top":case"bottom":return r?t?gi:hi:t?hi:gi;case"left":case"right":return t?Ch:kh;default:return[]}}function Eh(e,t,r,n){const o=St(e);let s=Nh(Me(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(So)))),s}function Yr(e){return e.replace(/left|right|bottom|top/g,t=>vh[t])}function Ph(e){return{top:0,right:0,bottom:0,left:0,...e}}function xi(e){return typeof e!="number"?Ph(e):{top:e,right:e,bottom:e,left:e}}function Xr(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 bi(e,t,r){let{reference:n,floating:o}=e;const s=Pe(t),i=jo(t),l=wo(i),d=Me(t),c=s==="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(d){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(St(t)){case"start":g[i]-=m*(r&&c?-1:1);break;case"end":g[i]+=m*(r&&c?-1:1);break}return g}const Th=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,l=s.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=bi(c,n,d),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:C}=await v({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:c,platform:i,elements:{reference:e,floating:t}});u=_??u,p=w??p,g={...g,[h]:{...g[h],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=bi(c,m,d)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function lr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:l,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=ze(t,e),b=xi(g),h=l[m?p==="floating"?"reference":"floating":p],v=Xr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(h)))==null||r?h:h.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:d})),_=p==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),j=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Xr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:w,strategy:d}):_);return{top:(v.top-C.top+b.top)/j.y,bottom:(C.bottom-v.bottom+b.bottom)/j.y,left:(v.left-C.left+b.left)/j.x,right:(C.right-v.right+b.right)/j.x}}const Ah=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:l,middlewareData:d}=t,{element:c,padding:u=0}=ze(e,t)||{};if(c==null)return{};const p=xi(u),m={x:r,y:n},g=jo(o),b=wo(g),f=await i.getDimensions(c),h=g==="y",v=h?"top":"left",_=h?"bottom":"right",w=h?"clientHeight":"clientWidth",j=s.reference[b]+s.reference[g]-m[g]-s.floating[b],C=m[g]-s.reference[g],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let k=N?N[w]:0;(!k||!await(i.isElement==null?void 0:i.isElement(N)))&&(k=l.floating[w]||s.floating[b]);const E=j/2-C/2,P=k/2-f[b]/2-1,T=qe(p[v],P),R=qe(p[_],P),L=T,I=k-f[b]-R,O=k/2-f[b]/2+E,D=vo(L,O,I),z=!d.arrow&&St(o)!=null&&O!==D&&s.reference[b]/2-(O<L?T:R)-f[b]/2<0,B=z?O<L?O-L:O-I:0;return{[g]:m[g]+B,data:{[g]:D,centerOffset:O-D-B,...z&&{alignmentOffset:B}},reset:z}}}),Oh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:d,elements:c}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...h}=ze(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=Me(o),_=Pe(l),w=Me(l)===l,j=await(d.isRTL==null?void 0:d.isRTL(c.floating)),C=m||(w||!f?[Yr(l)]:Sh(l)),N=b!=="none";!m&&N&&C.push(...Eh(l,f,b,j));const k=[l,...C],E=await lr(t,h),P=[];let T=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&P.push(E[v]),p){const O=jh(o,i,j);P.push(E[O[0]],E[O[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(O=>O<=0)){var R,L;const O=(((R=s.flip)==null?void 0:R.index)||0)+1,D=k[O];if(D&&(!(p==="alignment"?_!==Pe(D):!1)||T.every(A=>Pe(A.placement)===_?A.overflows[0]>0:!0)))return{data:{index:O,overflows:T},reset:{placement:D}};let z=(L=T.filter(B=>B.overflows[0]<=0).sort((B,A)=>B.overflows[1]-A.overflows[1])[0])==null?void 0:L.placement;if(!z)switch(g){case"bestFit":{var I;const B=(I=T.filter(A=>{if(N){const q=Pe(A.placement);return q===_||q==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((A,q)=>A[1]-q[1])[0])==null?void 0:I[0];B&&(z=B);break}case"initialPlacement":z=l;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function _i(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vi(e){return _h.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}=ze(e,t);switch(n){case"referenceHidden":{const s=await lr(t,{...o,elementContext:"reference"}),i=_i(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:vi(i)}}}case"escaped":{const s=await lr(t,{...o,altBoundary:!0}),i=_i(s,r.floating);return{data:{escapedOffsets:i,escaped:vi(i)}}}default:return{}}}}},yi=new Set(["left","top"]);async function Lh(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Me(r),l=St(r),d=Pe(r)==="y",c=yi.has(i)?-1:1,u=s&&d?-1:1,p=ze(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),d?{x:g*u,y:m*c}:{x:m*c,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:s,placement:i,middlewareData:l}=t,d=await Lh(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+d.x,y:s+d.y,data:{...d,placement:i}}}}},zh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:h=>{let{x:v,y:_}=h;return{x:v,y:_}}},...d}=ze(e,t),c={x:r,y:n},u=await lr(t,d),p=Pe(Me(o)),m=yo(p);let g=c[m],b=c[p];if(s){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",_=g+u[h],w=g-u[v];g=vo(_,g,w)}if(i){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]:s,[p]:i}}}}}},Mh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:d=!0,crossAxis:c=!0}=ze(e,t),u={x:r,y:n},p=Pe(o),m=yo(p);let g=u[m],b=u[p];const f=ze(l,t),h=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(d){const w=m==="y"?"height":"width",j=s.reference[m]-s.floating[w]+h.mainAxis,C=s.reference[m]+s.reference[w]-h.mainAxis;g<j?g=j:g>C&&(g=C)}if(c){var v,_;const w=m==="y"?"width":"height",j=yi.has(Me(o)),C=s.reference[p]-s.floating[w]+(j&&((v=i.offset)==null?void 0:v[p])||0)+(j?0:h.crossAxis),N=s.reference[p]+s.reference[w]+(j?0:((_=i.offset)==null?void 0:_[p])||0)-(j?h.crossAxis:0);b<C?b=C: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:s,platform:i,elements:l}=t,{apply:d=()=>{},...c}=ze(e,t),u=await lr(t,c),p=Me(o),m=St(o),g=Pe(o)==="y",{width:b,height:f}=s.floating;let h,v;p==="top"||p==="bottom"?(h=p,v=m===(await(i.isRTL==null?void 0:i.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=qe(f-u[h],_),C=qe(b-u[v],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=_),N&&!m){const T=fe(u.left,0),R=fe(u.right,0),L=fe(u.top,0),I=fe(u.bottom,0);g?E=b-2*(T!==0||R!==0?T+R:fe(u.left,u.right)):k=f-2*(L!==0||I!==0?L+I:fe(u.top,u.bottom))}await d({...t,availableWidth:E,availableHeight:k});const P=await i.getDimensions(l.floating);return b!==P.width||f!==P.height?{reset:{rects:!0}}:{}}}};function Jr(){return typeof window<"u"}function Ct(e){return wi(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Te(e){var t;return(t=(wi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wi(e){return Jr()?e instanceof Node||e instanceof he(e).Node:!1}function ve(e){return Jr()?e instanceof Element||e instanceof he(e).Element:!1}function Ae(e){return Jr()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function ji(e){return!Jr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}const Fh=new Set(["inline","contents"]);function cr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ye(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(Ct(e))}const Uh=[":popover-open",":modal"];function Zr(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 Co(e){const t=ko(),r=ve(e)?ye(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=Ge(e);for(;Ae(t)&&!kt(t);){if(Co(t))return t;if(Zr(t))return null;t=Ge(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 kt(e){return Gh.has(Ct(e))}function ye(e){return he(e).getComputedStyle(e)}function Qr(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ji(e)&&e.host||Te(e);return ji(t)?t.host:t}function Si(e){const t=Ge(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ae(t)&&cr(t)?t:Si(t)}function dr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Si(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=he(o);if(s){const l=No(i);return t.concat(i,i.visualViewport||[],cr(o)?o:[],l&&r?dr(l):[])}return t.concat(o,dr(o,[],r))}function No(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ci(e){const t=ye(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Ae(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,l=Gr(r)!==s||Gr(n)!==i;return l&&(r=s,n=i),{width:r,height:n,$:l}}function Eo(e){return ve(e)?e:e.contextElement}function Nt(e){const t=Eo(e);if(!Ae(t))return Ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=Ci(t);let i=(s?Gr(r.width):r.width)/n,l=(s?Gr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Kh=Ee(0);function ki(e){const t=he(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!==he(e)?!1:t}function it(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Eo(e);let i=Ee(1);t&&(n?ve(n)&&(i=Nt(n)):i=Nt(e));const l=Yh(s,r,n)?ki(s):Ee(0);let d=(o.left+l.x)/i.x,c=(o.top+l.y)/i.y,u=o.width/i.x,p=o.height/i.y;if(s){const m=he(s),g=n&&ve(n)?he(n):n;let b=m,f=No(b);for(;f&&n&&g!==b;){const h=Nt(f),v=f.getBoundingClientRect(),_=ye(f),w=v.left+(f.clientLeft+parseFloat(_.paddingLeft))*h.x,j=v.top+(f.clientTop+parseFloat(_.paddingTop))*h.y;d*=h.x,c*=h.y,u*=h.x,p*=h.y,d+=w,c+=j,b=he(f),f=No(b)}}return Xr({width:u,height:p,x:d,y:c})}function en(e,t){const r=Qr(e).scrollLeft;return t?t.left+r:it(Te(e)).left+r}function Ni(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-en(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 s=o==="fixed",i=Te(n),l=t?Zr(t.floating):!1;if(n===i||l&&s)return r;let d={scrollLeft:0,scrollTop:0},c=Ee(1);const u=Ee(0),p=Ae(n);if((p||!p&&!s)&&((Ct(n)!=="body"||cr(i))&&(d=Qr(n)),Ae(n))){const g=it(n);c=Nt(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=i&&!p&&!s?Ni(i,d):Ee(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-d.scrollLeft*c.x+u.x+m.x,y:r.y*c.y-d.scrollTop*c.y+u.y+m.y}}function Jh(e){return Array.from(e.getClientRects())}function Zh(e){const t=Te(e),r=Qr(e),n=e.ownerDocument.body,o=fe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=fe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+en(e);const l=-r.scrollTop;return ye(n).direction==="rtl"&&(i+=fe(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:l}}const Ei=25;function Qh(e,t){const r=he(e),n=Te(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,l=0,d=0;if(o){s=o.width,i=o.height;const u=ko();(!u||u&&t==="fixed")&&(l=o.offsetLeft,d=o.offsetTop)}const c=en(n);if(c<=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<=Ei&&(s-=b)}else c<=Ei&&(s+=c);return{width:s,height:i,x:l,y:d}}const eg=new Set(["absolute","fixed"]);function tg(e,t){const r=it(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=Ae(e)?Nt(e):Ee(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,d=o*s.x,c=n*s.y;return{width:i,height:l,x:d,y:c}}function Pi(e,t,r){let n;if(t==="viewport")n=Qh(e,r);else if(t==="document")n=Zh(Te(e));else if(ve(t))n=tg(t,r);else{const o=ki(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Xr(n)}function Ti(e,t){const r=Ge(e);return r===t||!ve(r)||kt(r)?!1:ye(r).position==="fixed"||Ti(r,t)}function rg(e,t){const r=t.get(e);if(r)return r;let n=dr(e,[],!1).filter(l=>ve(l)&&Ct(l)!=="body"),o=null;const s=ye(e).position==="fixed";let i=s?Ge(e):e;for(;ve(i)&&!kt(i);){const l=ye(i),d=Co(i);!d&&l.position==="fixed"&&(o=null),(s?!d&&!o:!d&&l.position==="static"&&!!o&&eg.has(o.position)||cr(i)&&!d&&Ti(e,i))?n=n.filter(u=>u!==i):o=l,i=Ge(i)}return t.set(e,n),n}function ng(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Zr(t)?[]:rg(t,this._c):[].concat(r),n],l=i[0],d=i.reduce((c,u)=>{const p=Pi(t,u,o);return c.top=fe(p.top,c.top),c.right=qe(p.right,c.right),c.bottom=qe(p.bottom,c.bottom),c.left=fe(p.left,c.left),c},Pi(t,l,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function og(e){const{width:t,height:r}=Ci(e);return{width:t,height:r}}function ag(e,t,r){const n=Ae(t),o=Te(t),s=r==="fixed",i=it(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const d=Ee(0);function c(){d.x=en(o)}if(n||!n&&!s)if((Ct(t)!=="body"||cr(o))&&(l=Qr(t)),n){const g=it(t,!0,s,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else o&&c();s&&!n&&o&&c();const u=o&&!n&&!s?Ni(o,l):Ee(0),p=i.left+l.scrollLeft-d.x-u.x,m=i.top+l.scrollTop-d.y-u.y;return{x:p,y:m,width:i.width,height:i.height}}function Po(e){return ye(e).position==="static"}function Ai(e,t){if(!Ae(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Te(e)===r&&(r=r.ownerDocument.body),r}function Oi(e,t){const r=he(e);if(Zr(e))return r;if(!Ae(e)){let o=Ge(e);for(;o&&!kt(o);){if(ve(o)&&!Po(o))return o;o=Ge(o)}return r}let n=Ai(e,t);for(;n&&Bh(n)&&Po(n);)n=Ai(n,t);return n&&kt(n)&&Po(n)&&!Co(n)?r:n||qh(e)||r}const sg=async function(e){const t=this.getOffsetParent||Oi,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 ig(e){return ye(e).direction==="rtl"}const lg={convertOffsetParentRelativeRectToViewportRelativeRect:Xh,getDocumentElement:Te,getClippingRect:ng,getOffsetParent:Oi,getElementRects:sg,getClientRects:Jh,getDimensions:og,getScale:Nt,isElement:ve,isRTL:ig};function Ri(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=Te(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),s();const c=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=c;if(l||t(),!m||!g)return;const b=Kr(p),f=Kr(o.clientWidth-(u+m)),h=Kr(o.clientHeight-(p+g)),v=Kr(u),w={rootMargin:-b+"px "+-f+"px "+-h+"px "+-v+"px",threshold:fe(0,qe(1,d))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==d){if(!j)return i();k?i(!1,k):n=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Ri(c,e.getBoundingClientRect())&&i(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return i(!0),s}function dg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,c=Eo(e),u=o||s?[...c?dr(c):[],...dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const p=c&&l?cg(c,r):null;let m=-1,g=null;i&&(g=new ResizeObserver(v=>{let[_]=v;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),c&&!d&&g.observe(c),g.observe(t));let b,f=d?it(e):null;d&&h();function h(){const v=it(e);f&&!Ri(f,v)&&r(),f=v,b=requestAnimationFrame(h)}return r(),()=>{var v;u.forEach(_=>{o&&_.removeEventListener("scroll",r),s&&_.removeEventListener("resize",r)}),p?.(),(v=g)==null||v.disconnect(),g=null,d&&cancelAnimationFrame(b)}}const ug=Ih,pg=zh,mg=Oh,fg=Dh,hg=Rh,Li=Ah,gg=Mh,xg=(e,t,r)=>{const n=new Map,o={platform:lg,...r},s={...o.platform,_c:n};return Th(e,t,{...o,platform:s})};var bg=typeof document<"u",_g=function(){},tn=bg?y.useLayoutEffect:_g;function rn(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(!rn(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 s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!rn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ii(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zi(e,t){const r=Ii(e);return Math.round(t*r)/r}function To(e){const t=x.useRef(e);return tn(()=>{t.current=e}),t}function vg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:d,open:c}=e,[u,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=x.useState(n);rn(m,n)||g(n);const[b,f]=x.useState(null),[h,v]=x.useState(null),_=x.useCallback(A=>{A!==N.current&&(N.current=A,f(A))},[]),w=x.useCallback(A=>{A!==k.current&&(k.current=A,v(A))},[]),j=s||b,C=i||h,N=x.useRef(null),k=x.useRef(null),E=x.useRef(u),P=d!=null,T=To(d),R=To(o),L=To(c),I=x.useCallback(()=>{if(!N.current||!k.current)return;const A={placement:t,strategy:r,middleware:m};R.current&&(A.platform=R.current),xg(N.current,k.current,A).then(q=>{const X={...q,isPositioned:L.current!==!1};O.current&&!rn(E.current,X)&&(E.current=X,br.flushSync(()=>{p(X)}))})},[m,t,r,R,L]);tn(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(A=>({...A,isPositioned:!1})))},[c]);const O=x.useRef(!1);tn(()=>(O.current=!0,()=>{O.current=!1}),[]),tn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(T.current)return T.current(j,C,I);I()}},[j,C,I,T,P]);const D=x.useMemo(()=>({reference:N,floating:k,setReference:_,setFloating:w}),[_,w]),z=x.useMemo(()=>({reference:j,floating:C}),[j,C]),B=x.useMemo(()=>{const A={position:r,left:0,top:0};if(!z.floating)return A;const q=zi(z.floating,u.x),X=zi(z.floating,u.y);return l?{...A,transform:"translate("+q+"px, "+X+"px)",...Ii(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:X}},[r,l,z.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:I,refs:D,elements:z,floatingStyles:B}),[u,I,D,z,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?Li({element:n.current,padding:o}).fn(r):{}:n?Li({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]}),Cg=(e,t)=>({...mg(e),options:[e,t]}),kg=(e,t)=>({...fg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...yg(e),options:[e,t]});var Pg="Arrow",Mi=x.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return a.jsx(W.svg,{...s,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"})})});Mi.displayName=Pg;var Tg=Mi;function Ag(e){const[t,r]=x.useState(void 0);return se(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const d=s.borderBoxSize,c=Array.isArray(d)?d[0]:d;i=c.inlineSize,l=c.blockSize}else i=e.offsetWidth,l=e.offsetHeight;r({width:i,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ao="Popper",[Di,nn]=He(Ao),[Og,Fi]=Di(Ao),$i=e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null);return a.jsx(Og,{scope:t,anchor:n,onAnchorChange:o,children:r})};$i.displayName=Ao;var Bi="PopperAnchor",Ui=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Fi(Bi,r),i=x.useRef(null),l=Y(t,i),d=x.useRef(null);return x.useEffect(()=>{const c=d.current;d.current=n?.current||i.current,c!==d.current&&s.onAnchorChange(d.current)}),n?null:a.jsx(W.div,{...o,ref:l})});Ui.displayName=Bi;var Oo="PopperContent",[Rg,Lg]=Di(Oo),Hi=x.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...f}=e,h=Fi(Oo,r),[v,_]=x.useState(null),w=Y(t,$=>_($)),[j,C]=x.useState(null),N=Ag(j),k=N?.width??0,E=N?.height??0,P=n+(s!=="center"?"-"+s:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(c)?c:[c],L=R.length>0,I={padding:T,boundary:R.filter(zg),altBoundary:L},{refs:O,floatingStyles:D,placement:z,isPositioned:B,middlewareData:A}=vg({strategy:"fixed",placement:P,whileElementsMounted:(...$)=>dg(...$,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[wg({mainAxis:o+E,alignmentAxis:i}),d&&jg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Sg():void 0,...I}),d&&Cg({...I}),kg({...I,apply:({elements:$,rects:te,availableWidth:ce,availableHeight:J})=>{const{width:Q,height:ne}=te.reference,xe=$.floating.style;xe.setProperty("--radix-popper-available-width",`${ce}px`),xe.setProperty("--radix-popper-available-height",`${J}px`),xe.setProperty("--radix-popper-anchor-width",`${Q}px`),xe.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),j&&Eg({element:j,padding:l}),Mg({arrowWidth:k,arrowHeight:E}),m&&Ng({strategy:"referenceHidden",...I})]}),[q,X]=qi(z),Z=Ve(b);se(()=>{B&&Z?.()},[B,Z]);const me=A.arrow?.x,Fe=A.arrow?.y,ge=A.arrow?.centerOffset!==0,[$e,pt]=x.useState();return se(()=>{v&&pt(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:B?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Rg,{scope:r,placedSide:q,onArrowChange:C,arrowX:me,arrowY:Fe,shouldHideArrow:ge,children:a.jsx(W.div,{"data-side":q,"data-align":X,...f,ref:w,style:{...f.style,animation:B?void 0:"none"}})})})});Hi.displayName=Oo;var Vi="PopperArrow",Ig={top:"bottom",right:"left",bottom:"top",left:"right"},Wi=x.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Lg(Vi,n),i=Ig[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(Tg,{...o,ref:r,style:{...o.style,display:"block"}})})});Wi.displayName=Vi;function zg(e){return e!==null}var Mg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,d=i?0:e.arrowHeight,[c,u]=qi(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+d/2;let b="",f="";return c==="bottom"?(b=i?p:`${m}px`,f=`${-d}px`):c==="top"?(b=i?p:`${m}px`,f=`${n.floating.height+d}px`):c==="right"?(b=`${-d}px`,f=i?p:`${g}px`):c==="left"&&(b=`${n.floating.width+d}px`,f=i?p:`${g}px`),{data:{x:b,y:f}}}});function qi(e){const[t,r="center"]=e.split("-");return[t,r]}var Gi=$i,Ro=Ui,Ki=Hi,Yi=Wi,Dg="Portal",on=x.forwardRef((e,t)=>{const{container:r,...n}=e,[o,s]=x.useState(!1);se(()=>s(!0),[]);const i=r||o&&globalThis?.document?.body;return i?va.createPortal(a.jsx(W.div,{...n,ref:t}),i):null});on.displayName=Dg;function Fg(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var Ke=e=>{const{present:t,children:r}=e,n=$g(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),s=Y(n.ref,Bg(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:s}):null};Ke.displayName="Presence";function $g(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),s=x.useRef("none"),i=e?"mounted":"unmounted",[l,d]=Fg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=an(n.current);s.current=l==="mounted"?c:"none"},[l]),se(()=>{const c=n.current,u=o.current;if(u!==e){const m=s.current,g=an(c);e?d("MOUNT"):g==="none"||c?.display==="none"?d("UNMOUNT"):d(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),se(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,p=g=>{const f=an(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(d("ANIMATION_END"),!o.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},m=g=>{g.target===t&&(s.current=an(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function an(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()]||se;function lt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=Hg({defaultProp:t,onChange:r}),l=e!==void 0,d=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 c=x.useCallback(u=>{if(l){const p=Vg(u)?u(e):u;p!==e&&i.current?.(p)}else s(u)},[l,e,s,i]);return[d,c]}function Hg({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),s=x.useRef(t);return Ug(()=>{s.current=t},[t]),x.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,n,s]}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},Et=new WeakMap,sn=new WeakMap,ln={},Lo=0,Xi=function(e){return e&&(e.host||Xi(e.parentNode))},qg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Xi(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]);ln[r]||(ln[r]=new WeakMap);var s=ln[r],i=[],l=new Set,d=new Set(o),c=function(p){!p||l.has(p)||(l.add(p),c(p.parentNode))};o.forEach(c);var u=function(p){!p||d.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=(Et.get(m)||0)+1,h=(s.get(m)||0)+1;Et.set(m,f),s.set(m,h),i.push(m),f===1&&b&&sn.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(),Lo++,function(){i.forEach(function(p){var m=Et.get(p)-1,g=s.get(p)-1;Et.set(p,m),s.set(p,g),m||(sn.has(p)||p.removeAttribute(n),sn.delete(p)),g||p.removeAttribute(r)}),Lo--,Lo||(Et=new WeakMap,Et=new WeakMap,sn=new WeakMap,ln={})}},Io=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}},Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Oe.apply(this,arguments)};function Ji(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,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var cn="right-scroll-bar-position",dn="width-before-scroll-bar",Yg="with-scroll-bars-hidden",Xg="--removed-body-scroll-bar-size";function zo(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,Zi=new WeakMap;function Qg(e,t){var r=Jg(null,function(n){return e.forEach(function(o){return zo(o,n)})});return Zg(function(){var n=Zi.get(r);if(n){var o=new Set(n),s=new Set(e),i=r.current;o.forEach(function(l){s.has(l)||zo(l,null)}),s.forEach(function(l){o.has(l)||zo(l,i)})}Zi.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(s){var i=t(s,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(n=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(l){return s(l)},filter:function(){return r}}},assignMedium:function(s){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(s),i=r}var d=function(){var u=i;i=[],u.forEach(s)},c=function(){return Promise.resolve().then(d)};c(),r={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),r}}}};return o}function rx(e){e===void 0&&(e={});var t=tx(null);return t.options=Oe({async:!0,ssr:!1},e),t}var Qi=function(e){var t=e.sideCar,r=Ji(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,Oe({},r))};Qi.isSideCarExport=!0;function nx(e,t){return e.useMedium(t),Qi}var el=rx(),Mo=function(){},un=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Mo,onWheelCapture:Mo,onTouchMoveCapture:Mo}),o=n[0],s=n[1],i=e.forwardProps,l=e.children,d=e.className,c=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=Ji(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=Qg([r,t]),k=Oe(Oe({},j),o);return x.createElement(x.Fragment,null,u&&x.createElement(C,{sideCar:el,removeScrollBar:c,shards:p,noRelative:g,noIsolation:b,inert:f,setCallbacks:s,allowPinchZoom:!!h,lockRef:r,gapMode:w}),i?x.cloneElement(x.Children.only(l),Oe(Oe({},k),{ref:N})):x.createElement(_,Oe({},k,{className:d,ref:N}),l))});un.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},un.classNames={fullWidth:dn,zeroRight:cn};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 sx(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 lx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ax())&&(sx(t,r),ix(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])}},tl=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},Do=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[Do(r),Do(n),Do(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=tl(),Pt="data-scroll-locked",fx=function(e,t,r,n){var o=e.left,s=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),` 319 .`.concat(Yg,` { 310 320 overflow: hidden `).concat(n,`; 311 padding-right: `).concat( c,"px ").concat(n,`;312 } 313 body[`).concat( Tt,`] {321 padding-right: `).concat(l,"px ").concat(n,`; 322 } 323 body[`).concat(Pt,`] { 314 324 overflow: hidden `).concat(n,`; 315 325 overscroll-behavior: contain; … … 320 330 margin-left:0; 321 331 margin-top:0; 322 margin-right: `).concat(c,"px ").concat(n,`; 323 `),r==="padding"&&"padding-right: ".concat(c,"px ").concat(n,";")].filter(Boolean).join(""),` 332 margin-right: `).concat(l,"px ").concat(n,`; 333 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),` 334 } 335 336 .`).concat(cn,` { 337 right: `).concat(l,"px ").concat(n,`; 324 338 } 325 339 326 340 .`).concat(dn,` { 327 right: `).concat(c,"px ").concat(n,`;328 } 329 330 .`).concat( un,` {331 margin-right: `).concat(c,"px ").concat(n,`;341 margin-right: `).concat(l,"px ").concat(n,`; 342 } 343 344 .`).concat(cn," .").concat(cn,` { 345 right: 0 `).concat(n,`; 332 346 } 333 347 334 348 .`).concat(dn," .").concat(dn,` { 335 right: 0 `).concat(n,`;336 }337 338 .`).concat(un," .").concat(un,` {339 349 margin-right: 0 `).concat(n,`; 340 350 } 341 351 342 body[`).concat( Tt,`] {343 `).concat( qg,": ").concat(c,`px;344 } 345 `)}, tc=function(){var e=parseInt(document.body.getAttribute(Tt)||"0",10);return isFinite(e)?e:0},ux=function(){g.useEffect(function(){return document.body.setAttribute(Tt,(tc()+1).toString()),function(){var e=tc()-1;e<=0?document.body.removeAttribute(Tt):document.body.setAttribute(Tt,e.toString())}},[])},px=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;ux();var s=g.useMemo(function(){return cx(o)},[o]);return g.createElement(lx,{styles:dx(s,!t,o,r?"":"!important")})},Fo=!1;if(typeof window<"u")try{var mn=Object.defineProperty({},"passive",{get:function(){return Fo=!0,!0}});window.addEventListener("test",mn,mn),window.removeEventListener("test",mn,mn)}catch{Fo=!1}var At=Fo?{passive:!1}:!1,mx=function(e){return e.tagName==="TEXTAREA"},rc=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!mx(e)&&r[t]==="visible")},fx=function(e){return rc(e,"overflowY")},hx=function(e){return rc(e,"overflowX")},nc=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=oc(e,n);if(o){var s=ac(e,n),i=s[1],c=s[2];if(i>c)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},gx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},xx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},oc=function(e,t){return e==="v"?fx(t):hx(t)},ac=function(e,t){return e==="v"?gx(t):xx(t)},bx=function(e,t){return e==="h"&&t==="rtl"?-1:1},_x=function(e,t,r,n,o){var s=bx(e,window.getComputedStyle(t).direction),i=s*n,c=r.target,l=t.contains(c),d=!1,u=i>0,p=0,m=0;do{if(!c)break;var h=ac(e,c),b=h[0],f=h[1],x=h[2],v=f-x-s*b;(b||v)&&oc(e,c)&&(p+=v,m+=b);var _=c.parentNode;c=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},fn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sc=function(e){return[e.deltaX,e.deltaY]},ic=function(e){return e&&"current"in e?e.current:e},vx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yx=function(e){return`352 body[`).concat(Pt,`] { 353 `).concat(Xg,": ").concat(l,`px; 354 } 355 `)},rl=function(){var e=parseInt(document.body.getAttribute(Pt)||"0",10);return isFinite(e)?e:0},hx=function(){x.useEffect(function(){return document.body.setAttribute(Pt,(rl()+1).toString()),function(){var e=rl()-1;e<=0?document.body.removeAttribute(Pt):document.body.setAttribute(Pt,e.toString())}},[])},gx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;hx();var s=x.useMemo(function(){return px(o)},[o]);return x.createElement(mx,{styles:fx(s,!t,o,r?"":"!important")})},Fo=!1;if(typeof window<"u")try{var pn=Object.defineProperty({},"passive",{get:function(){return Fo=!0,!0}});window.addEventListener("test",pn,pn),window.removeEventListener("test",pn,pn)}catch{Fo=!1}var Tt=Fo?{passive:!1}:!1,xx=function(e){return e.tagName==="TEXTAREA"},nl=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 nl(e,"overflowY")},_x=function(e){return nl(e,"overflowX")},ol=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=al(e,n);if(o){var s=sl(e,n),i=s[1],l=s[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},vx=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]},al=function(e,t){return e==="v"?bx(t):_x(t)},sl=function(e,t){return e==="v"?vx(t):yx(t)},wx=function(e,t){return e==="h"&&t==="rtl"?-1:1},jx=function(e,t,r,n,o){var s=wx(e,window.getComputedStyle(t).direction),i=s*n,l=r.target,d=t.contains(l),c=!1,u=i>0,p=0,m=0;do{if(!l)break;var g=sl(e,l),b=g[0],f=g[1],h=g[2],v=f-h-s*b;(b||v)&&al(e,l)&&(p+=v,m+=b);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!d&&l!==document.body||d&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(c=!0),c},mn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},il=function(e){return[e.deltaX,e.deltaY]},ll=function(e){return e&&"current"in e?e.current:e},Sx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Cx=function(e){return` 346 356 .block-interactivity-`.concat(e,` {pointer-events: none;} 347 357 .allow-interactivity-`).concat(e,` {pointer-events: all;} 348 `)}, wx=0,Pt=[];function jx(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),o=g.useState(wx++)[0],s=g.useState(ec)[0],i=g.useRef(e);g.useEffect(function(){i.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Vg([e.lockRef.current],(e.shards||[]).map(ic),!0).filter(Boolean);return f.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=g.useCallback(function(f,x){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!i.current.allowPinchZoom;var v=fn(f),_=r.current,w="deltaX"in f?f.deltaX:_[0]-v[0],j="deltaY"in f?f.deltaY:_[1]-v[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=nc(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=nc(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return _x(T,x,f,T==="h"?w:j)},[]),l=g.useCallback(function(f){var x=f;if(!(!Pt.length||Pt[Pt.length-1]!==s)){var v="deltaY"in x?sc(x):fn(x),_=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&vx(C.delta,v)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var w=(i.current.shards||[]).map(ic).filter(Boolean).filter(function(C){return C.contains(x.target)}),j=w.length>0?c(x,w[0]):!i.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),d=g.useCallback(function(f,x,v,_){var w={name:f,delta:x,target:v,should:_,shadowParent:Sx(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=g.useCallback(function(f){r.current=fn(f),n.current=void 0},[]),p=g.useCallback(function(f){d(f.type,sc(f),f.target,c(f,e.lockRef.current))},[]),m=g.useCallback(function(f){d(f.type,fn(f),f.target,c(f,e.lockRef.current))},[]);g.useEffect(function(){return Pt.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,At),document.addEventListener("touchmove",l,At),document.addEventListener("touchstart",u,At),function(){Pt=Pt.filter(function(f){return f!==s}),document.removeEventListener("wheel",l,At),document.removeEventListener("touchmove",l,At),document.removeEventListener("touchstart",u,At)}},[]);var h=e.removeScrollBar,b=e.inert;return g.createElement(g.Fragment,null,b?g.createElement(s,{styles:yx(o)}):null,h?g.createElement(px,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Cx=Qg(Qi,jx);var hn=g.forwardRef(function(e,t){return g.createElement(pn,Oe({},e,{ref:t,sideCar:Cx}))});hn.classNames=pn.classNames;var gn="Popover",[cc]=He(gn,[on]),sr=on(),[kx,Ye]=cc(gn),lc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,c=sr(t),l=g.useRef(null),[d,u]=g.useState(!1),[p,m]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:gn});return a.jsx(qi,{...c,children:a.jsx(kx,{scope:t,contentId:Ne(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(h=>!h),[m]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>u(!0),[]),onCustomAnchorRemove:g.useCallback(()=>u(!1),[]),modal:i,children:r})})};lc.displayName=gn;var dc="PopoverAnchor",Nx=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(dc,r),s=sr(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=o;return g.useEffect(()=>(i(),()=>c()),[i,c]),a.jsx(Ro,{...s,...n,ref:t})});Nx.displayName=dc;var uc="PopoverTrigger",pc=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(uc,r),s=sr(r),i=Y(t,o.triggerRef),c=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":xc(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:a.jsx(Ro,{asChild:!0,...s,children:c})});pc.displayName=uc;var $o="PopoverPortal",[Ex,Tx]=cc($o,{forceMount:void 0}),mc=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=Ye($o,t);return a.jsx(Ex,{scope:t,forceMount:r,children:a.jsx(Ke,{present:r||s.open,children:a.jsx(an,{asChild:!0,container:o,children:n})})})};mc.displayName=$o;var Ot="PopoverContent",fc=g.forwardRef((e,t)=>{const r=Tx(Ot,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=Ye(Ot,e.__scopePopover);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(Px,{...o,ref:t}):a.jsx(Ox,{...o,ref:t})})});fc.displayName=Ot;var Ax=rt("PopoverContent.RemoveScroll"),Px=g.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=g.useRef(null),o=Y(t,n),s=g.useRef(!1);return g.useEffect(()=>{const i=n.current;if(i)return Io(i)},[]),a.jsx(hn,{as:Ax,allowPinchZoom:!0,children:a.jsx(hc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,d=c.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ox=g.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=g.useRef(!1),o=g.useRef(!1);return a.jsx(hc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),hc=g.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Ye(Ot,r),h=sr(r);return xo(),a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Gi,{"data-state":xc(m.open),role:"dialog",id:m.contentId,...h,...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)"}})})})}),gc="PopoverClose",Rx=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(gc,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Rx.displayName=gc;var Lx="PopoverArrow",Ix=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=sr(r);return a.jsx(Ki,{...o,...n,ref:t})});Ix.displayName=Lx;function xc(e){return e?"open":"closed"}var zx=lc,Mx=pc,Dx=mc,Fx=fc;function Rt({...e}){return a.jsx(zx,{"data-slot":"popover",...e})}function Lt({...e}){return a.jsx(Mx,{"data-slot":"popover-trigger",...e})}function It({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(Dx,{container:o,children:a.jsx(Fx,{"data-slot":"popover-content",align:t,sideOffset:r,className:D("ecr-popover",e),...n})})}var $x=Symbol.for("react.lazy"),xn=g[" use ".trim().toString()];function Bx(e){return typeof e=="object"&&e!==null&&"then"in e}function bc(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$x&&"_payload"in e&&Bx(e._payload)}function Ux(e){const t=Hx(e),r=g.forwardRef((n,o)=>{let{children:s,...i}=n;bc(s)&&typeof xn=="function"&&(s=xn(s._payload));const c=g.Children.toArray(s),l=c.find(Wx);if(l){const d=l.props.children,u=c.map(p=>p===l?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Hx(e){const t=g.forwardRef((r,n)=>{let{children:o,...s}=r;if(bc(o)&&typeof xn=="function"&&(o=xn(o._payload)),g.isValidElement(o)){const i=Gx(o),c=qx(s,o.props);return o.type!==g.Fragment&&(c.ref=n?Wn(n,i):i),g.cloneElement(o,c)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vx=Symbol("radix.slottable");function Wx(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vx}function qx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...c)=>{const l=s(...c);return o(...c),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Gx(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 Kx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yx=Kx.reduce((e,t)=>{const r=Ux(`Primitive.${t}`),n=g.forwardRef((o,s)=>{const{asChild:i,...c}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xx="Separator",_c="horizontal",Jx=["horizontal","vertical"],vc=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=_c,...o}=e,s=Zx(n)?n:_c,c=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(Yx.div,{"data-orientation":s,...c,...o,ref:t})});vc.displayName=Xx;function Zx(e){return Jx.includes(e)}var Qx=vc;function bn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(Qx,{"data-slot":"separator",decorative:r,orientation:t,className:D("ecr-separator",e),...n})}const ir=({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(bn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(bn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(re,{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"})})})]})};var _n="Dialog",[yc]=He(_n),[e0,we]=yc(_n),wc=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,c=g.useRef(null),l=g.useRef(null),[d,u]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:_n});return a.jsx(e0,{scope:t,triggerRef:c,contentRef:l,contentId:Ne(),titleId:Ne(),descriptionId:Ne(),open:d,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(p=>!p),[u]),modal:i,children:r})};wc.displayName=_n;var jc="DialogTrigger",Sc=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(jc,r),s=Y(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ho(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)})});Sc.displayName=jc;var Bo="DialogPortal",[t0,Cc]=yc(Bo,{forceMount:void 0}),kc=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=we(Bo,t);return a.jsx(t0,{scope:t,forceMount:r,children:g.Children.map(n,i=>a.jsx(Ke,{present:r||s.open,children:a.jsx(an,{asChild:!0,container:o,children:i})}))})};kc.displayName=Bo;var vn="DialogOverlay",Nc=g.forwardRef((e,t)=>{const r=Cc(vn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(vn,e.__scopeDialog);return s.modal?a.jsx(Ke,{present:n||s.open,children:a.jsx(n0,{...o,ref:t})}):null});Nc.displayName=vn;var r0=rt("DialogOverlay.RemoveScroll"),n0=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(vn,r);return a.jsx(hn,{as:r0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Ho(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),lt="DialogContent",Ec=g.forwardRef((e,t)=>{const r=Cc(lt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(lt,e.__scopeDialog);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(o0,{...o,ref:t}):a.jsx(a0,{...o,ref:t})})});Ec.displayName=lt;var o0=g.forwardRef((e,t)=>{const r=we(lt,e.__scopeDialog),n=g.useRef(null),o=Y(t,r.contentRef,n);return g.useEffect(()=>{const s=n.current;if(s)return Io(s)},[]),a.jsx(Tc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&s.preventDefault()}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault())})}),a0=g.forwardRef((e,t)=>{const r=we(lt,e.__scopeDialog),n=g.useRef(!1),o=g.useRef(!1);return a.jsx(Tc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Tc=g.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,c=we(lt,r),l=g.useRef(null),d=Y(t,l);return xo(),a.jsxs(a.Fragment,{children:[a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(qr,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ho(c.open),...i,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(i0,{titleId:c.titleId}),a.jsx(l0,{contentRef:l,descriptionId:c.descriptionId})]})]})}),Uo="DialogTitle",Ac=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Uo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Ac.displayName=Uo;var Pc="DialogDescription",s0=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Pc,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});s0.displayName=Pc;var Oc="DialogClose",Rc=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Oc,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Rc.displayName=Oc;function Ho(e){return e?"open":"closed"}var Lc="DialogTitleWarning",[Zv,Ic]=Kf(Lc,{contentName:lt,titleName:Uo,docsSlug:"dialog"}),i0=({titleId:e})=>{const t=Ic(Lc),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.358 `)},kx=0,At=[];function Nx(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(kx++)[0],s=x.useState(tl)[0],i=x.useRef(e);x.useEffect(function(){i.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(ll),!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!i.current.allowPinchZoom;var v=mn(f),_=r.current,w="deltaX"in f?f.deltaX:_[0]-v[0],j="deltaY"in f?f.deltaY:_[1]-v[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=ol(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=ol(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var P=n.current||C;return jx(P,h,f,P==="h"?w:j)},[]),d=x.useCallback(function(f){var h=f;if(!(!At.length||At[At.length-1]!==s)){var v="deltaY"in h?il(h):mn(h),_=t.current.filter(function(C){return C.name===h.type&&(C.target===h.target||h.target===C.shadowParent)&&Sx(C.delta,v)})[0];if(_&&_.should){h.cancelable&&h.preventDefault();return}if(!_){var w=(i.current.shards||[]).map(ll).filter(Boolean).filter(function(C){return C.contains(h.target)}),j=w.length>0?l(h,w[0]):!i.current.noIsolation;j&&h.cancelable&&h.preventDefault()}}},[]),c=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=mn(f),n.current=void 0},[]),p=x.useCallback(function(f){c(f.type,il(f),f.target,l(f,e.lockRef.current))},[]),m=x.useCallback(function(f){c(f.type,mn(f),f.target,l(f,e.lockRef.current))},[]);x.useEffect(function(){return At.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",d,Tt),document.addEventListener("touchmove",d,Tt),document.addEventListener("touchstart",u,Tt),function(){At=At.filter(function(f){return f!==s}),document.removeEventListener("wheel",d,Tt),document.removeEventListener("touchmove",d,Tt),document.removeEventListener("touchstart",u,Tt)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(s,{styles:Cx(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 Px=nx(el,Nx);var fn=x.forwardRef(function(e,t){return x.createElement(un,Oe({},e,{ref:t,sideCar:Px}))});fn.classNames=un.classNames;var hn="Popover",[cl]=He(hn,[nn]),ur=nn(),[Tx,Ye]=cl(hn),dl=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,l=ur(t),d=x.useRef(null),[c,u]=x.useState(!1),[p,m]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:hn});return a.jsx(Gi,{...l,children:a.jsx(Tx,{scope:t,contentId:Ne(),triggerRef:d,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:c,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:i,children:r})})};dl.displayName=hn;var ul="PopoverAnchor",Ax=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(ul,r),s=ur(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return x.useEffect(()=>(i(),()=>l()),[i,l]),a.jsx(Ro,{...s,...n,ref:t})});Ax.displayName=ul;var pl="PopoverTrigger",ml=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(pl,r),s=ur(r),i=Y(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":bl(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Ro,{asChild:!0,...s,children:l})});ml.displayName=pl;var $o="PopoverPortal",[Ox,Rx]=cl($o,{forceMount:void 0}),fl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=Ye($o,t);return a.jsx(Ox,{scope:t,forceMount:r,children:a.jsx(Ke,{present:r||s.open,children:a.jsx(on,{asChild:!0,container:o,children:n})})})};fl.displayName=$o;var Ot="PopoverContent",hl=x.forwardRef((e,t)=>{const r=Rx(Ot,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=Ye(Ot,e.__scopePopover);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(Ix,{...o,ref:t}):a.jsx(zx,{...o,ref:t})})});hl.displayName=Ot;var Lx=rt("PopoverContent.RemoveScroll"),Ix=x.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=x.useRef(null),o=Y(t,n),s=x.useRef(!1);return x.useEffect(()=>{const i=n.current;if(i)return Io(i)},[]),a.jsx(fn,{as:Lx,allowPinchZoom:!0,children:a.jsx(gl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,d=l.button===0&&l.ctrlKey===!0,c=l.button===2||d;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),zx=x.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(gl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),gl=x.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:u,...p}=e,m=Ye(Ot,r),g=ur(r);return xo(),a.jsx(qr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(Wr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Ki,{"data-state":bl(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)"}})})})}),xl="PopoverClose",Mx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(xl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Mx.displayName=xl;var Dx="PopoverArrow",Fx=x.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=ur(r);return a.jsx(Yi,{...o,...n,ref:t})});Fx.displayName=Dx;function bl(e){return e?"open":"closed"}var $x=dl,Bx=ml,Ux=fl,Hx=hl;function Rt({...e}){return a.jsx($x,{"data-slot":"popover",...e})}function Lt({...e}){return a.jsx(Bx,{"data-slot":"popover-trigger",...e})}function It({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})})}var Vx=Symbol.for("react.lazy"),gn=x[" use ".trim().toString()];function Wx(e){return typeof e=="object"&&e!==null&&"then"in e}function _l(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:s,...i}=n;_l(s)&&typeof gn=="function"&&(s=gn(s._payload));const l=x.Children.toArray(s),d=l.find(Yx);if(d){const c=d.props.children,u=l.map(p=>p===d?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:p);return a.jsx(t,{...i,ref:o,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Gx(e){const t=x.forwardRef((r,n)=>{let{children:o,...s}=r;if(_l(o)&&typeof gn=="function"&&(o=gn(o._payload)),x.isValidElement(o)){const i=Jx(o),l=Xx(s,o.props);return o.type!==x.Fragment&&(l.ref=n?Wn(n,i):i),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],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...l)=>{const d=s(...l);return o(...l),d}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].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,s)=>{const{asChild:i,...l}=o,d=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),e0="Separator",vl="horizontal",t0=["horizontal","vertical"],yl=x.forwardRef((e,t)=>{const{decorative:r,orientation:n=vl,...o}=e,s=r0(n)?n:vl,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(Qx.div,{"data-orientation":s,...l,...o,ref:t})});yl.displayName=e0;function r0(e){return t0.includes(e)}var n0=yl;function xn({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 pr=({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(xn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(xn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(re,{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"})})})]})};var bn="Dialog",[wl]=He(bn),[o0,we]=wl(bn),jl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,l=x.useRef(null),d=x.useRef(null),[c,u]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:bn});return a.jsx(o0,{scope:t,triggerRef:l,contentRef:d,contentId:Ne(),titleId:Ne(),descriptionId:Ne(),open:c,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(p=>!p),[u]),modal:i,children:r})};jl.displayName=bn;var Sl="DialogTrigger",Cl=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Sl,r),s=Y(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ho(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)})});Cl.displayName=Sl;var Bo="DialogPortal",[a0,kl]=wl(Bo,{forceMount:void 0}),Nl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=we(Bo,t);return a.jsx(a0,{scope:t,forceMount:r,children:x.Children.map(n,i=>a.jsx(Ke,{present:r||s.open,children:a.jsx(on,{asChild:!0,container:o,children:i})}))})};Nl.displayName=Bo;var _n="DialogOverlay",El=x.forwardRef((e,t)=>{const r=kl(_n,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(_n,e.__scopeDialog);return s.modal?a.jsx(Ke,{present:n||s.open,children:a.jsx(i0,{...o,ref:t})}):null});El.displayName=_n;var s0=rt("DialogOverlay.RemoveScroll"),i0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(_n,r);return a.jsx(fn,{as:s0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Ho(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ct="DialogContent",Pl=x.forwardRef((e,t)=>{const r=kl(ct,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(ct,e.__scopeDialog);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(l0,{...o,ref:t}):a.jsx(c0,{...o,ref:t})})});Pl.displayName=ct;var l0=x.forwardRef((e,t)=>{const r=we(ct,e.__scopeDialog),n=x.useRef(null),o=Y(t,r.contentRef,n);return x.useEffect(()=>{const s=n.current;if(s)return Io(s)},[]),a.jsx(Tl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault())})}),c0=x.forwardRef((e,t)=>{const r=we(ct,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return a.jsx(Tl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Tl=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,l=we(ct,r),d=x.useRef(null),c=Y(t,d);return xo(),a.jsxs(a.Fragment,{children:[a.jsx(qr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(Wr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ho(l.open),...i,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(u0,{titleId:l.titleId}),a.jsx(m0,{contentRef:d,descriptionId:l.descriptionId})]})]})}),Uo="DialogTitle",Al=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Uo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Al.displayName=Uo;var Ol="DialogDescription",d0=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Ol,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});d0.displayName=Ol;var Rl="DialogClose",Ll=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Rl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ll.displayName=Rl;function Ho(e){return e?"open":"closed"}var Il="DialogTitleWarning",[l1,zl]=Zf(Il,{contentName:ct,titleName:Uo,docsSlug:"dialog"}),u0=({titleId:e})=>{const t=zl(Il),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 349 359 350 360 If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 351 361 352 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},c0="DialogDescriptionWarning",l0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ic(c0).contentName}}.`;return g.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},d0=wc,u0=Sc,p0=kc,m0=Nc,f0=Ec,h0=Ac,zc=Rc;function Vo({...e}){return a.jsx(d0,{"data-slot":"dialog",...e})}function Wo({...e}){return a.jsx(u0,{"data-slot":"dialog-trigger",...e})}function g0({...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 x0({className:e,...t}){return a.jsx(m0,{"data-slot":"dialog-overlay",className:D("ecr-dialog__overlay",e),...t})}function qo({className:e,children:t,...r}){return a.jsxs(g0,{children:[a.jsx(x0,{}),a.jsxs(f0,{"data-slot":"dialog-content",className:D("ecr-dialog__content",e),...r,children:[t,a.jsx(zc,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(Gf,{className:"ecr-dialog__close-icon"})})]})]})}function Go({className:e,...t}){return a.jsx("div",{className:D("ecr-dialog__header",e),...t})}function Ko({className:e,...t}){return a.jsx(h0,{"data-slot":"dialog-title",className:D("ecr-dialog__title",e),...t})}function b0({...e}){return a.jsx(zc,{"data-slot":"dialog-close",...e})}const _0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,s]=y.useState([]),[i,c]=y.useState(1),[l,d]=y.useState(!0),[u,p]=y.useState(!1),[m,h]=y.useState(!1),[b,f]=y.useState(""),x=lo(b,500),v=y.useRef(!0),_=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),h(!1),p(!1);return}const O=++_.current;w.current&&w.current.abort();const L=new AbortController;w.current=L,T===1&&v.current?h(!0):p(!0);try{const A={page:T,per_page:50};x&&(A.search=x);const I=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:A,signal:L.signal}),z=I.data,$=parseInt(I.headers["x-wp-totalpages"]||"1",10);O===_.current&&(s(R=>T===1?z:[...R,...z]),c(T+1),d(T<$))}catch(A){if(L.signal.aborted)return;A instanceof Error?C(A.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),O===_.current&&!L.signal.aborted&&(p(!1),h(!1))}},[x,n,r]);y.useEffect(()=>{t&&(c(1),s([]),C(null),v.current=!0,N(1))},[x,N,t]);const k=y.useRef(null),E=y.useCallback(T=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(O=>{O[0].isIntersecting&&l&&N(i)}),T&&k.current.observe(T))},[u,l,i,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:s,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},yn="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",Mc=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:D("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),v0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:s,searchTerm:i,setSearchTerm:c,error:l})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),h=f=>{m(!1),u(x=>x.includes(f.id)?x.filter(v=>v!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const x=new Set(d),v=[];for(const _ of r)x.has(_.id)&&v.push({btn_type:"product",btn_uuid:mo(),buttonText:_.name,buttonUrl:_.permalink,rating:_.average_rating,price:_.price_html,thumbnail:_.images?.[0]?.thumbnail||_.images?.[0]?.src||yn,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:i,onChange:f=>c(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(Dc,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:l||"No products are available to add."}):r.map((f,x)=>{const v=d.includes(f.id);return a.jsx("div",{ref:r.length===x+1?s:null,className:"ecr-admin-product-link__item",style:d.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(re,{type:"button",onClick:()=>h(f),className:D("ecr-admin-product-link__button",v?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[v?a.jsx(Hf,{size:20,color:"#2563eb"}):a.jsx(Vf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||yn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Dc,{})]})}),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(Mc,{name:"add",handleClick:b})})]})]})},Dc=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),y0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,w0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[s,i]=y.useState(""),[c,l]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),h=()=>{const b=[];t||b.push("text"),n&&y0.test(n)||b.push("url"),s||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:mo(),buttonText:t,buttonUrl:n,openInNewTab:c,campaignName:s,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(wn,{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(wn,{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(wn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:s,setValue:i}),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:c,onChange:b=>l(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(wn,{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(Mc,{name:"add",handleClick:h})})]})};function wn({error:e,type:t,name:r,label:n,placeholder:o,value:s,setValue:i}){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:s,onChange:c=>i(c.target.value),className:D("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const j0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,s]=y.useState(null),[i,c]=y.useState(!1),l=_0({enabled:i}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(h=>h.btn_type==="product"),m=()=>c(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(bn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Vo,{open:o==="custom",onOpenChange:h=>s(h?"custom":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx($f,{size:20})," Add Custom Link"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(w0,{handleLinks:h=>{e(b=>[...b,h]),s(null)}})})]})]}),u&&a.jsxs(Vo,{open:o==="product",onOpenChange:h=>s(h?"product":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Wf,{size:20})," Tag Products"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(v0,{handleLinks:h=>{e(h),s(null)},taggedProducts:p,products:l.products,isSearching:l.isSearching,isLoading:l.isLoading,lastProductElementRef:l.lastProductElementRef,searchTerm:l.searchTerm,setSearchTerm:l.setSearchTerm,error:l.error})})]})]})]})})]})},S0=({links:e,onLinksChange:t})=>{const r=o=>{t(s=>s.filter(i=>i.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(re,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(qf,{size:16})})]},o.btn_uuid)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(qt,{size:20})]}),a.jsx(It,{className:"ecr-admin-links__popover",children:a.jsx(ir,{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(j0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function Fc(e){return H({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 C0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[s,i]=y.useState(!1);return a.jsx("video",{ref:n,className:D("ecr-admin-reelvideo",s?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:c=>{const l=c.currentTarget,d=l.videoWidth,u=l.videoHeight;i(()=>u>d)}})},k0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:s,dragEnd:i})=>{const[c,l]=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))},h=()=>{p.current&&(p.current.muted=!c,l(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>s(e),onDragEnd:i,className:D("ecr-admin-customization__panel"),children:[a.jsx(Fc,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(C0,{togglePlayPause:m,isMuted:c,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}),c?a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:h}):a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:h})]})]})},N0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),s=l=>{n.current=l},i=l=>{o.current=l},c=()=>{if(n.current===null||o.current===null)return;const l=[...e],d=l[n.current];l.splice(n.current,1),l.splice(o.current,0,d),n.current=null,o.current=null,r(l)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((l,d)=>a.jsx(k0,{setIsAttemptingDelete:t,file:l,file_uuid:l.file_uuid,index:d,dragStart:s,dragEnter:i,dragEnd:c},d)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:ei,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(qt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(It,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ir,{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!"]})})})]})]})},E0=({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(Fc,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(ti,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),T0=()=>{const e=Se(),[t]=Vt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,s]=y.useState({files:[],title:"",links:[],thumbnail:null}),[i,c]=y.useState(!1),[l,d]=y.useState(null),u=y.useCallback(x=>{s(v=>({...v,title:typeof x=="function"?x(v.title):x}))},[]),p=y.useCallback(x=>{s(v=>({...v,files:typeof x=="function"?x(v.files):x}))},[]),m=y.useCallback(x=>{s(v=>({...v,links:typeof x=="function"?x(v.links):x}))},[]),h=y.useCallback(x=>{s(v=>({...v,thumbnail:typeof x=="function"?x(v.thumbnail):x}))},[]),b=()=>{l&&(p(x=>x.filter(v=>v.file_uuid!==l)),d(null))},f=y.useCallback(async x=>{try{c(!0);const v=await ue.get(`story/${x}`);s({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{c(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),i?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(Cf,{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"}),l&&a.jsx(Or,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(N0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(ti,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(E0,{thumbnail:o.thumbnail,onThumbnailChange:h}),a.jsx(bn,{className:"ecr-admin-create__separator"}),a.jsx(S0,{links:o.links,onLinksChange:m})]})]})]})},$c=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(Hp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Yo,Bc;function A0(){return Bc||(Bc=1,Yo=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()}}),Yo}var Xo,Uc;function P0(){if(Uc)return Xo;Uc=1;var e=A0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(s){var i=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,i)}function o(s,i){var c,l,d,u,p,m,h=!1;i||(i={}),c=i.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=s,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(),i.format)if(f.preventDefault(),typeof f.clipboardData>"u"){c&&console.warn("unable to use e.clipboardData"),c&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=t[i.format]||t.default;window.clipboardData.setData(x,s)}else f.clipboardData.clearData(),f.clipboardData.setData(i.format,s);i.onCopy&&(f.preventDefault(),i.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");h=!0}catch(f){c&&console.error("unable to copy using execCommand: ",f),c&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(i.format||"text",s),i.onCopy&&i.onCopy(window.clipboardData),h=!0}catch(x){c&&console.error("unable to copy using clipboardData: ",x),c&&console.error("falling back to prompt"),l=n("message"in i?i.message:r),window.prompt(l,s)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return h}return Xo=o,Xo}var O0=P0();const Hc=jd(O0);function Vc({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:D("ecr-table",e),...t})})}function Wc({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:D("ecr-table__header",e),...t})}function qc({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:D("ecr-table__body",e),...t})}function jn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:D("ecr-table__row",e),...t})}function Gc({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:D("ecr-table__head",e),...t})}function Re({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:D("ecr-table__cell",e),...t})}function Kc({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:D("ecr-table__caption",e),...t})}const R0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],L0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),s=(i,c)=>{Hc(i),n(c),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Vc,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Kc,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(nt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(Wc,{children:a.jsx(jn,{children:R0.map((i,c)=>a.jsx(Gc,{className:"ecr-admin-groups__head",style:{width:i?.width||"auto",textAlign:i?.align},children:i.label},c))})}),a.jsx(qc,{children:e.map((i,c)=>a.jsxs(jn,{className:D("ecr-admin-groups__row",c%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:c+1}),a.jsx(Re,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:i.group_name})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${i.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>s(`[reelswp-group id='${i.id}']`,c),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(tp,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:D("ecr-admin-groups__copy-tooltip",r===c&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(re,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.stat}&group=${i.id}&name=${i.group_name}`,children:a.jsx(ls,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.mg}&gid=${i.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Delete Group",onClick:()=>t(i.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(Up,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},i.id??c))})]}):null]})},Yc=()=>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))})]}),I0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,s]=y.useState(!1),[i,c]=y.useState(!1),[l,d]=y.useState(!1),[u,p]=y.useState(""),[m,h]=y.useState(1),[b]=y.useState(20),[f,x]=y.useState(0),[v,_]=y.useState(1),w=lo(u,500),j=y.useCallback(async E=>{const T=new AbortController,O=E===1;try{O?s(!0):c(!0),n("");const L=await ue.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),A=Number(L.headers?.["x-wp-total"]??0),I=Number(L.headers?.["x-wp-totalpages"]??1),z=Math.max(1,I||1);t($=>{if(O)return L.data;const R=new Set($.map(P=>P.id)),U=L.data.filter(P=>!R.has(P.id));return[...$,...U]}),x(A),_(z),E>z&&h(z)}catch(L){if(T.signal.aborted)return;L instanceof Error?n(L.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(O?s(!1):c(!1))}},[b,w]),C=y.useCallback(()=>{h(E=>o||i||E>=v?E:E+1)},[o,i,v]),N=y.useCallback(async()=>{if(m!==1){h(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{d(!0),await ue.delete(`group/${E}`),await N(),G.success("Group deleted successfully!")}catch(T){T instanceof Error?G.error(T.message):G.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:i,isDeleting:l,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:k}},z0={docs:"https://reelswp.com/docs/"},M0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:s,isDeleting:i,deleteGroup:c,hasMore:l,loadMore:d,searchTerm:u,setSearchTerm:p}=I0(),m=y.useRef(null),h=async()=>{e&&(await c(e),t(null))};return y.useEffect(()=>{if(!m.current||!l)return;const b=new IntersectionObserver(f=>{const[x]=f;x.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[l,d]),a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:"All Widgets",Icon:Vp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsxs("a",{href:z0.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx(Df,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Rr,{to:`?view=${K.cr}`,text:"Add Reel",Icon:gt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:h,onReject:()=>t(null),isLoading:i}),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(re,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(Yt,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ts,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${K.mg}`,text:"Create Widget",Icon:gt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Yc,{}):n?a.jsx($c,{}):a.jsxs(a.Fragment,{children:[a.jsx(L0,{tableData:r,setIsAttemptingDelete:t}),l&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:s?a.jsx(Bf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},D0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,s]=y.useState(!1),[i,c]=y.useState(!1),[l,d]=y.useState(!1),u=y.useCallback((m,h)=>{t(!0),n(b=>({...b,[m]:h}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),h=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(h)){G.error("Please enter valid numbers.");return}try{c(!0),d(!1),await ue.post("settings",{rate_limit:m,time_limit:h}),G.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{c(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{s(!0),d(!1);const b=await ue.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?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||s(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:i,isError:l,handleOnChange:u,handleSave:p}},F0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:s,handleSave:i}=D0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(_t,{left:[a.jsx(vt,{name:"Settings",Icon:xp},"Settings"),a.jsx(Xt,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(uo,{onSave:i,isSaving:n,disabled:!t},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.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:c=>s("rateLimit",c.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:c=>s("timeLimit",c.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},$0=[{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"}],B0=({tableData:e})=>a.jsxs(Vc,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Kc,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(Wc,{children:a.jsx(jn,{children:$0.map((t,r)=>a.jsx(Gc,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(qc,{children:e.map((t,r)=>a.jsxs(jn,{className:D("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Re,{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(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),U0=()=>{const[e]=Vt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[s,i]=y.useState([]),[c,l]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{l(!0);const h=await ue.get(`/group/${t}/stats`);o(h.data.stories),i(h.data.buttons)}catch(h){h instanceof Error?G.error(h.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{l(!1)}})()},[t]);const p=n.length>0?n.reduce((m,h)=>m+=h.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:"Statistics",Icon:ls},"Statistics"),a.jsx(Xt,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.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]}),c?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:c?a.jsx(Yc,{}):d?a.jsx($c,{}):s.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(B0,{tableData:s})})]})]})};function H0(e){return H({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 V0(e){return H({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 W0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:D("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(H0,{size:24})}),q0=({...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"})]})}),Xc=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:D("ecr-input",e),...r}));Xc.displayName="Input";const cr=({label:e,min:t,max:r,value:n,onChange:o,name:s,id:i,wrapperStyles:c,hideSlider:l})=>{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)},h=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:c,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:i,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!l&&a.jsx("input",{type:"range",id:i,name:s,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(Xc,{type:"number",min:t,max:r,value:d,onChange:b=>h(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function M(){return M=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},M.apply(null,arguments)}function De(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 zt=255,Xe=100,lr=e=>{var{r:t,g:r,b:n,a:o}=e,s=Math.max(t,r,n),i=s-Math.min(t,r,n),c=i?s===t?(r-n)/i:s===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(c<0?c+6:c),s:s?i/s*Xe:0,v:s/zt*Xe,a:o}},Jc=e=>{var{h:t,s:r,l:n,a:o}=Zc(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Zc=e=>{var{h:t,s:r,v:n,a:o}=e,s=(200-r)*n/Xe;return{h:t,s:s>0&&s<200?r*n/Xe/(s<=Xe?s:200-s)*Xe:0,l:s/2,a:o}},Qc=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(s=>new Array(7-s.length).join("0")+s)(o.toString(16))},G0=e=>{var{r:t,g:r,b:n,a:o}=e,s=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Qc({r:t,g:r,b:n})+(s||"")},dr=e=>lr(K0(e)),K0=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,s=0,i]=e.match(r).map(c=>parseInt(c,16));return{r:n,g:o,b:s,a:(i??255)/zt}},Sn=e=>{var{h:t,s:r,v:n,a:o}=e,s=t/60,i=r/Xe,c=n/Xe,l=Math.floor(s)%6,d=s-Math.floor(s),u=zt*c*(1-i),p=zt*c*(1-i*d),m=zt*c*(1-i*(1-d));c*=zt;var h={};switch(l){case 0:h.r=c,h.g=m,h.b=u;break;case 1:h.r=p,h.g=c,h.b=u;break;case 2:h.r=u,h.g=c,h.b=m;break;case 3:h.r=u,h.g=p,h.b=c;break;case 4:h.r=m,h.g=u,h.b=c;break;case 5:h.r=c,h.g=u,h.b=p;break}return h.r=Math.round(h.r),h.g=Math.round(h.g),h.b=Math.round(h.b),M({},h,{a:o})},Y0=e=>{var{r:t,g:r,b:n,a:o}=Sn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},X0=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},J0=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Jo=e=>Qc(Sn(e)),Z0=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},Q0=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)},s=o(t/255),i=o(r/255),c=o(n/255),l={};return l.x=s*.4124+i*.3576+c*.1805,l.y=s*.2126+i*.7152+c*.0722,l.bri=s*.0193+i*.1192+c*.9505,l},Mt=e=>{var t,r,n,o,s,i,c,l,d;return typeof e=="string"&&Zo(e)?(i=dr(e),l=e):typeof e!="string"&&(i=e),i&&(n=Z0(i),s=Zc(i),o=Sn(i),d=G0(o),l=Jo(i),r=J0(s),t=X0(o),c=Q0(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:s,hsva:i,hex:l,hexa:d,xy:c}},Zo=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function el(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var ur=e=>"touches"in e,tl=e=>{!ur(e)&&e.preventDefault&&e.preventDefault()},rl=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},nl=(e,t)=>{var r=e.getBoundingClientRect(),n=ur(t)?t.touches[0]:t;return{left:rl((n.pageX-(r.left+window.pageXOffset))/r.width),top:rl((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)}},eb=["prefixCls","className","onMove","onDown"],Qo=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:s}=e,i=De(e,eb),c=y.useRef(null),l=y.useRef(!1),[d,u]=y.useState(!1),p=el(o),m=el(s),h=_=>l.current&&!ur(_)?!1:(l.current=ur(_),!0),b=y.useCallback(_=>{if(tl(_),!!c.current){var w=ur(_)?_.touches.length>0:_.buttons>0;if(!w){u(!1);return}p?.(nl(c.current,_),_)}},[p]),f=y.useCallback(()=>u(!1),[]),x=y.useCallback(_=>{_?(window.addEventListener(l.current?"touchmove":"mousemove",b),window.addEventListener(l.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(x(d),()=>{x(!1)}),[d,b,f,x]);var v=y.useCallback(_=>{var w=document.activeElement;w?.blur(),tl(_.nativeEvent),h(_.nativeEvent)&&c.current&&(m?.(nl(c.current,_.nativeEvent),_.nativeEvent),u(!0))},[m]);return a.jsx("div",M({},i,{className:[r,n||""].filter(Boolean).join(" "),style:M({},i.style,{touchAction:"none"}),ref:c,tabIndex:0,onMouseDown:v,onTouchStart:v}))});Qo.displayName="Interactive";var tb=e=>{var{className:t,color:r,left:n,top:o,prefixCls:s}=e,i={position:"absolute",top:o,left:n},c={"--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:s+"-pointer "+(t||""),style:i,children:a.jsx("div",{className:s+"-fill",style:c})}),[o,n,r,t,s])},rb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],ol=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:s,className:i,hue:c=0,style:l,hsva:d,onChange:u}=e,p=De(e,rb),m=M({width:200,height:200,borderRadius:o},l,{position:"relative"}),h=(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,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,d.s-_),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+_),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+_),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-_),C=!0,v.preventDefault();break;default:return}C&&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:Jc(d)};return s&&typeof s=="function"?s(M({prefixCls:n},v)):a.jsx(tb,M({prefixCls:n},v))},[d,s,n]),x=y.useCallback(v=>{v.target.focus()},[]);return a.jsx(Qo,M({className:[n,i||""].filter(Boolean).join(" ")},p,{style:M({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:c)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:h,onDown:h,onKeyDown:b,onClick:x,children:f}))});ol.displayName="Saturation";var nb=["className","prefixCls","left","top","style","fillProps"],ob=e=>{var{className:t,prefixCls:r,left:n,top:o,style:s,fillProps:i}=e,c=De(e,nb),l=M({},s,{position:"absolute",left:n,top:o}),d=M({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},i?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",M({className:r+"-pointer "+(t||""),style:l},c,{children:a.jsx("div",M({className:r+"-fill"},i,{style:d}))}))},ab=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],sb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Cn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:s,bgProps:i={},innerProps:c={},pointerProps:l={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:h,onChange:b,pointer:f}=e,x=De(e,ab),v=T=>{b&&b(M({},o,{a:m==="horizontal"?T.left:T.top}),T)},_=Jc(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 C=M({"--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("+sb+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},h,{position:"relative"}),N=y.useCallback(T=>{var O=.01,L=o.a,A=L;switch(T.key){case"ArrowLeft":m==="horizontal"&&(A=Math.max(0,L-O),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(A=Math.min(1,L+O),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(A=Math.max(0,L-O),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(A=Math.min(1,L+O),T.preventDefault());break;default:return}if(A!==L){var I={left:m==="horizontal"?A:o.a,top:m==="vertical"?A:o.a,width:0,height:0,x:0,y:0};b&&b(M({},o,{a:A}),I)}},[o,m,b]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(M({prefixCls:r},l,j)):a.jsx(ob,M({},l,{prefixCls:r},j));return a.jsxs("div",M({},x,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",M({},i,{style:M({inset:0,position:"absolute",background:s||w,borderRadius:d},i.style)})),a.jsx(Qo,M({},c,{style:M({},c.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:k,onKeyDown:N,children:E}))]}))});Cn.displayName="Alpha";var ib=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],cb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),lb=e=>Number(String(e).replace(/%/g,"")),Dt=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:s,className:i,style:c,labelStyle:l,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,h=De(e,ib),[b,f]=y.useState(s),x=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(x.current||f(e.value))},[e.value]);function v(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");cb(T)&&u&&u(k,T);var O=lb(T);isNaN(O)||u&&u(k,O),f(T)}function _(k){x.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=M({"--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,c),C=M({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=M({value:b,onChange:v,onBlur:_,autoComplete:"off",onFocus:()=>x.current=!0},h,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,i||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",M({ref:t},N)),o&&a.jsx("span",{style:M({color:"var(--editable-input-label-color)",textTransform:"capitalize"},l),children:o})]})});Dt.displayName="EditableInput";var db=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],al=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:s={},gProps:i={},bProps:c={},aProps:l={},className:d,style:u,onChange:p}=e,m=De(e,db),h=n?Sn(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")},x=(_,w,j)=>{typeof _=="number"&&(w==="a"&&(_<0&&(_=0),_>100&&(_=100),p&&p(Mt(lr(M({},h,{a:_/100}))))),_>255&&(_=255,j.target.value="255"),_<0&&(_=0,j.target.value="0"),w==="r"&&p&&p(Mt(lr(M({},h,{r:_})))),w==="g"&&p&&p(Mt(lr(M({},h,{g:_})))),w==="b"&&p&&p(Mt(lr(M({},h,{b:_})))))},v=h.a?Math.round(h.a*100)/100:0;return a.jsxs("div",M({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:M({fontSize:11,display:"flex"},u),children:[a.jsx(Dt,M({label:"R",value:h.r||0,onBlur:b,placement:o,onChange:(_,w)=>x(w,"r",_)},s,{style:M({},s.style)})),a.jsx(Dt,M({label:"G",value:h.g||0,onBlur:b,placement:o,onChange:(_,w)=>x(w,"g",_)},i,{style:M({marginLeft:5},s.style)})),a.jsx(Dt,M({label:"B",value:h.b||0,onBlur:b,placement:o,onChange:(_,w)=>x(w,"b",_)},c,{style:M({marginLeft:5},c.style)})),l&&a.jsx(Dt,M({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(_,w)=>x(w,"a",_)},l,{style:M({marginLeft:5},l.style)}))]}))});al.displayName="EditableInputRGBA";var ub=["prefixCls","className","hue","onChange","direction"],sl=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:s,direction:i="horizontal"}=e,c=De(e,ub);return a.jsx(Cn,M({ref:t,className:r+" "+(n||"")},c,{direction:i,background:"linear-gradient(to "+(i==="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:(l,d)=>{s&&s({h:i==="horizontal"?360*d.left:360*d.top})}}))});sl.displayName="Hue";var pb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],il=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:s=[],style:i,rectProps:c={},onChange:l,addonAfter:d,addonBefore:u,rectRender:p}=e,m=De(e,pb),h=M({"--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},c.style),b=(f,x)=>{l&&l(dr(f),Mt(dr(f)),x)};return a.jsxs("div",M({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:M({display:"flex",flexWrap:"wrap",position:"relative"},i),children:[u&&y.isValidElement(u)&&u,s&&Array.isArray(s)&&s.map((f,x)=>{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:M({},h,{background:_}),onClick:N=>b(_,N)});if(j)return a.jsx(y.Fragment,{children:j},x);var C=c.children&&y.isValidElement(c.children)?y.cloneElement(c.children,{color:_,checked:w}):null;return a.jsx("div",M({tabIndex:0,title:v,onClick:N=>b(_,N)},c,{children:C,style:M({},h,{background:_})}),x)}),d&&y.isValidElement(d)&&d]}))});il.displayName="Swatch";var mb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],fb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],cl=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"}}),ll=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:s=218,presetColors:i=fb,color:c,editableDisable:l=!0,disableAlpha:d=!1,style:u}=e,p=De(e,mb),[m,h]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof c=="string"&&Zo(c)&&h(dr(c)),typeof c=="object"&&h(c)},[c]);var b=N=>{h(N),o&&o(Mt(N))},f=(N,k)=>{typeof N=="string"&&Zo(N)&&/(3|6)/.test(String(N.length))&&b(dr(N))},x=N=>b(M({},m,{a:N.a})),v=N=>b(M({},m,N,{a:m.a})),_=M({"--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:s},u),w={borderRadius:2,background:Y0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",M({},p,{className:r+" "+(n||""),ref:t,style:_,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(ol,{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(sl,{width:"auto",height:10,hue:m.h,pointer:cl,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(M({},m,N))}),!d&&a.jsx(Cn,{width:"auto",height:10,hsva:m,pointer:cl,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:x})]}),!d&&a.jsx(Cn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),l&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Dt,{label:"Hex",value:Jo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(al,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),i&&i.length>0&&a.jsx(il,{style:j,colors:i,color:Jo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});ll.displayName="Sketch";const dl=({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(Rt,{children:[a.jsx(Lt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(It,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(ll,{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)})]})]}),hb=[{value:"left",title:"Align Left",Icon:Lp},{value:"center",title:"Align Center",Icon:Ip},{value:"right",title:"Align Right",Icon:zp},{value:"hidden",title:"Hidden",Icon:Mp}],gb=({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:hb.map(({value:r,title:n,Icon:o})=>a.jsx(re,{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))})]}),xb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(s=>{const i=o(s);return r(!0),i})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(gb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,alignment:o}}))}),a.jsx(dl,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(cr,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},bb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(s=>{Hc(s),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},_b=({gid:e})=>{const[t,r]=bb(),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(Mf,{color:"#ffffff",size:12})}),a.jsx("span",{className:D("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},ul=y.createContext({requestLeave:e=>e()}),vb=({value:e,children:t})=>a.jsx(ul.Provider,{value:e,children:t}),pl=()=>y.useContext(ul);function yb(e){return H({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 wb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(jb,{link:e,usedFor:t})}),jb=({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||yn,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||yn,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(yb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Sb=({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})})},kn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(wb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Sb,{link:e,usedFor:t},e.btn_uuid)}),Nn=({title:e})=>a.jsx("p",{className:"ecr-reel_title",children:e}),ml=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const s=Se(),{requestLeave:i}=pl(),c=n===e.story_uuid,l=`?view=${K.cr}&from=${K.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={width:`${t?.size}px`,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=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:D("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Jn,{story:e,styles:t}),d==="overlay"&&t.shape==="rectangle"?p?a.jsx(kn,{link:p,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Nn,{title:e.title}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(re,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:c,children:a.jsx(ht,{to:l,className:D("ecr-admin-reelitem__link",c?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:m=>{m.preventDefault(),i(()=>s(l))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(re,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:c,children:c?a.jsx(tt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(ds,{size:18})})]})]}),d==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel__title",children:e.title}):null]})},fl=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[s,i]=y.useState(!1),[c,l]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),h=()=>{const f=r.current;if(!f)return;const x=f.scrollLeft,v=f.scrollWidth,_=f.clientWidth;l(x>0),u(x+_<v-1)};y.useEffect(()=>{const f=r.current,x=n.current;f&&x&&(i(x.scrollWidth>f.clientWidth),m(f.clientWidth-100),h())},[e,t]);const b=f=>{const x=r.current;x&&(x.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(h,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let x=!1,v,_;const w=O=>{x=!0,v=O.pageX-f.offsetLeft,_=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{x=!1,f.style.cursor="default"},C=()=>{x=!1,f.style.cursor="default"},N=O=>{if(!x)return;O.preventDefault();const A=(O.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-A,h()},k=O=>{x=!0,v=O.touches[0].pageX-f.offsetLeft,_=f.scrollLeft},E=()=>{x=!1},T=O=>{if(!x)return;const A=(O.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-A,h()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:s,canScrollLeft:c,canScrollRight:d,scrollBy:b,scrollStep:p}},hl=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:c,canScrollLeft:l,canScrollRight:d,scrollBy:u,scrollStep:p}=fl([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:s,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:i,style:{...!e.length&&{margin:"auto"},gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:D("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(ml,{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(nt,{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."})]})})})}),c&&l&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Gt,{size:20})}),c&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Kt,{size:20})})]})},Cb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const s={columnGap:`${t?.gap}px`};return a.jsx("div",{style:s,className:D("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(ml,{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(nt,{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."})]})})})},kb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,s]=y.useState(!1),[i,c]=y.useState(!0),[l,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=i)},[i]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&s(f=>!f)},m=()=>{u.current&&c(f=>!f)},h=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(xt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Gt,{size:24})}),a.jsx(xt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Kt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:l?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(Yt,{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:l?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:i,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const x=f.currentTarget,v=x.videoWidth,_=x.videoHeight;d(()=>_>v)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}),i?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Yn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),h==="overlay"&&b?a.jsx(kn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,h==="title"?a.jsx(Nn,{title:e.title}):null]})})},Nb={carousel:hl,grid:Cb},Eb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:s})=>{const i=r.template??"carousel",c=Nb[i]||hl;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(_b,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:s==="thumbnail"?a.jsx(c,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(kb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(nt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gl=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Tb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:s,togglingId:i,lastStoryElementRef:c})=>{const l=Se(),{requestLeave:d}=pl(),u=`?view=${K.cr}&from=${K.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(Rr,{to:u,text:"Add Reel",Icon:gt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>l(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:s&&t.length===0?a.jsx(gl,{}):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,h)=>a.jsx("div",{ref:p.length===h+1?c:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:i==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}`}),i==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(tt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),s&&t.length>0&&a.jsx(gl,{})]})})]})]})};function xl(e){const t=e+"CollectionProvider",[r,n]=He(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=f=>{const{scope:x,children:v}=f,_=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:w,collectionRef:_,children:v})};i.displayName=t;const c=e+"CollectionSlot",l=rt(c),d=y.forwardRef((f,x)=>{const{scope:v,children:_}=f,w=s(c,v),j=Y(x,w.collectionRef);return a.jsx(l,{ref:j,children:_})});d.displayName=c;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=rt(u),h=y.forwardRef((f,x)=>{const{scope:v,children:_,...w}=f,j=y.useRef(null),C=Y(x,j),N=s(u,v);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:_})});h.displayName=u;function b(f){const x=s(e+"CollectionConsumer",f);return y.useCallback(()=>{const _=x.collectionRef.current;if(!_)return[];const w=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:d,ItemSlot:h},b,n]}var Ab=g.createContext(void 0);function ea(e){const t=g.useContext(Ab);return e||t||"ltr"}var ta="rovingFocusGroup.onEntryFocus",Pb={bubbles:!1,cancelable:!0},pr="RovingFocusGroup",[ra,bl,Ob]=xl(pr),[Rb,_l]=He(pr,[Ob]),[Lb,Ib]=Rb(pr),vl=g.forwardRef((e,t)=>a.jsx(ra.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(ra.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(zb,{...e,ref:t})})}));vl.displayName=pr;var zb=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=g.useRef(null),h=Y(t,m),b=ea(s),[f,x]=ct({prop:i,defaultProp:c??null,onChange:l,caller:pr}),[v,_]=g.useState(!1),w=Ve(d),j=bl(r),C=g.useRef(!1),[N,k]=g.useState(0);return g.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(ta,w),()=>E.removeEventListener(ta,w)},[w]),a.jsx(Lb,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:g.useCallback(E=>x(E),[x]),onItemShiftTab:g.useCallback(()=>_(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:g.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:v||N===0?-1:0,"data-orientation":n,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!v){const O=new CustomEvent(ta,Pb);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const L=j().filter(R=>R.focusable),A=L.find(R=>R.active),I=L.find(R=>R.id===f),$=[A,I,...L].filter(Boolean).map(R=>R.ref.current);jl($,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>_(!1))})})}),yl="RovingFocusGroupItem",wl=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...c}=e,l=Ne(),d=s||l,u=Ib(yl,r),p=u.currentTabStopId===d,m=bl(r),{onFocusableItemAdd:h,onFocusableItemRemove:b,currentTabStopId:f}=u;return g.useEffect(()=>{if(n)return h(),()=>b()},[n,h,b]),a.jsx(ra.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...c,ref:t,onMouseDown:V(e.onMouseDown,x=>{n?u.onItemFocus(d):x.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=Fb(x,u.orientation,u.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.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(x.currentTarget);w=u.loop?$b(w,j+1):w.slice(j+1)}setTimeout(()=>jl(w))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:f!=null}):i})})});wl.displayName=yl;var Mb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Db(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Fb(e,t,r){const n=Db(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Mb[n]}function jl(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function $b(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Bb=vl,Ub=wl,En="Tabs",[Hb]=He(En,[_l]),Sl=_l(),[Vb,na]=Hb(En),Cl=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:c,activationMode:l="automatic",...d}=e,u=ea(c),[p,m]=ct({prop:n,onChange:o,defaultProp:s??"",caller:En});return a.jsx(Vb,{scope:r,baseId:Ne(),value:p,onValueChange:m,orientation:i,dir:u,activationMode:l,children:a.jsx(W.div,{dir:u,"data-orientation":i,...d,ref:t})})});Cl.displayName=En;var kl="TabsList",Nl=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,s=na(kl,r),i=Sl(r);return a.jsx(Bb,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Nl.displayName=kl;var El="TabsTrigger",Tl=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...s}=e,i=na(El,r),c=Sl(r),l=Ol(i.baseId,n),d=Rl(i.baseId,n),u=n===i.value;return a.jsx(Ub,{asChild:!0,...c,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:l,...s,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=i.activationMode!=="manual";!u&&!o&&p&&i.onValueChange(n)})})})});Tl.displayName=El;var Al="TabsContent",Pl=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:s,...i}=e,c=na(Al,r),l=Ol(c.baseId,n),d=Rl(c.baseId,n),u=n===c.value,p=g.useRef(u);return g.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ke,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&s})})});Pl.displayName=Al;function Ol(e,t){return`${e}-trigger-${t}`}function Rl(e,t){return`${e}-content-${t}`}var Wb=Cl,qb=Nl,Gb=Tl,Kb=Pl;function Yb({className:e,...t}){return a.jsx(Wb,{"data-slot":"tabs",className:D("ecr-tabs",e),...t})}function Xb({className:e,...t}){return a.jsx(qb,{"data-slot":"tabs-list",className:D("ecr-tabs__list",e),...t})}function Ll({className:e,...t}){return a.jsx(Gb,{"data-slot":"tabs-trigger",className:D("ecr-tabs__trigger",e),...t})}function Il({className:e,...t}){return a.jsx(Kb,{"data-slot":"tabs-content",className:D("ecr-tabs__content",e),...t})}function zl(e,[t,r]){return Math.min(r,Math.max(t,e))}function Jb(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ml=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"}),Zb="VisuallyHidden",Qb=g.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Ml,...e.style}}));Qb.displayName=Zb;var e_=[" ","Enter","ArrowUp","ArrowDown"],t_=[" ","Enter"],dt="Select",[Tn,An,r_]=xl(dt),[Ft]=He(dt,[r_,on]),Pn=on(),[n_,Je]=Ft(dt),[o_,a_]=Ft(dt),Dl=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:i,defaultValue:c,onValueChange:l,dir:d,name:u,autoComplete:p,disabled:m,required:h,form:b}=e,f=Pn(t),[x,v]=g.useState(null),[_,w]=g.useState(null),[j,C]=g.useState(!1),N=ea(d),[k,E]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:dt}),[T,O]=ct({prop:i,defaultProp:c,onChange:l,caller:dt}),L=g.useRef(null),A=x?b||!!x.closest("form"):!0,[I,z]=g.useState(new Set),$=Array.from(I).map(R=>R.props.value).join(";");return a.jsx(qi,{...f,children:a.jsxs(n_,{required:h,scope:t,trigger:x,onTriggerChange:v,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ne(),value:T,onValueChange:O,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:L,disabled:m,children:[a.jsx(Tn.Provider,{scope:t,children:a.jsx(o_,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(R=>{z(U=>new Set(U).add(R))},[]),onNativeOptionRemove:g.useCallback(R=>{z(U=>{const P=new Set(U);return P.delete(R),P})},[]),children:r})}),A?a.jsxs(sd,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:R=>O(R.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(I)]},$):null]})})};Dl.displayName=dt;var Fl="SelectTrigger",$l=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=Pn(r),i=Je(Fl,r),c=i.disabled||n,l=Y(t,i.onTriggerChange),d=An(r),u=g.useRef("touch"),[p,m,h]=cd(f=>{const x=d().filter(w=>!w.disabled),v=x.find(w=>w.value===i.value),_=ld(x,f,v);_!==void 0&&i.onValueChange(_.value)}),b=f=>{c||(i.onOpenChange(!0),h()),f&&(i.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Ro,{asChild:!0,...s,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":id(i.value)?"":void 0,...o,ref:l,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const x=f.target;x.hasPointerCapture(f.pointerId)&&x.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const x=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(x&&f.key===" ")&&e_.includes(f.key)&&(b(),f.preventDefault())})})})});$l.displayName=Fl;var Bl="SelectValue",Ul=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:s,placeholder:i="",...c}=e,l=Je(Bl,r),{onValueNodeHasChildrenChange:d}=l,u=s!==void 0,p=Y(t,l.onValueNodeChange);return se(()=>{d(u)},[d,u]),a.jsx(W.span,{...c,ref:p,style:{pointerEvents:"none"},children:id(l.value)?a.jsx(a.Fragment,{children:i}):s})});Ul.displayName=Bl;var s_="SelectIcon",Hl=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hl.displayName=s_;var i_="SelectPortal",Vl=e=>a.jsx(an,{asChild:!0,...e});Vl.displayName=i_;var ut="SelectContent",Wl=g.forwardRef((e,t)=>{const r=Je(ut,e.__scopeSelect),[n,o]=g.useState();if(se(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?_r.createPortal(a.jsx(ql,{scope:e.__scopeSelect,children:a.jsx(Tn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(Gl,{...e,ref:t})});Wl.displayName=ut;var je=10,[ql,Ze]=Ft(ut),c_="SelectContentImpl",l_=rt("SelectContent.RemoveScroll"),Gl=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:c,sideOffset:l,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:b,hideWhenDetached:f,avoidCollisions:x,...v}=e,_=Je(ut,r),[w,j]=g.useState(null),[C,N]=g.useState(null),k=Y(t,F=>j(F)),[E,T]=g.useState(null),[O,L]=g.useState(null),A=An(r),[I,z]=g.useState(!1),$=g.useRef(!1);g.useEffect(()=>{if(w)return Io(w)},[w]),xo();const R=g.useCallback(F=>{const[te,...ce]=A().map(ne=>ne.ref.current),[J]=ce.slice(-1),Q=document.activeElement;for(const ne of F)if(ne===Q||(ne?.scrollIntoView({block:"nearest"}),ne===te&&C&&(C.scrollTop=0),ne===J&&C&&(C.scrollTop=C.scrollHeight),ne?.focus(),document.activeElement!==Q))return},[A,C]),U=g.useCallback(()=>R([E,w]),[R,E,w]);g.useEffect(()=>{I&&U()},[I,U]);const{onOpenChange:P,triggerPointerDownPosRef:q}=_;g.useEffect(()=>{if(w){let F={x:0,y:0};const te=J=>{F={x:Math.abs(Math.round(J.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(J.pageY)-(q.current?.y??0))}},ce=J=>{F.x<=10&&F.y<=10?J.preventDefault():w.contains(J.target)||P(!1),document.removeEventListener("pointermove",te),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",ce,{capture:!0})}}},[w,P,q]),g.useEffect(()=>{const F=()=>P(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[P]);const[X,Z]=cd(F=>{const te=A().filter(Q=>!Q.disabled),ce=te.find(Q=>Q.ref.current===document.activeElement),J=ld(te,F,ce);J&&setTimeout(()=>J.ref.current.focus())}),me=g.useCallback((F,te,ce)=>{const J=!$.current&&!ce;(_.value!==void 0&&_.value===te||J)&&(T(F),J&&($.current=!0))},[_.value]),Fe=g.useCallback(()=>w?.focus(),[w]),ge=g.useCallback((F,te,ce)=>{const J=!$.current&&!ce;(_.value!==void 0&&_.value===te||J)&&L(F)},[_.value]),$e=n==="popper"?oa:Kl,pt=$e===oa?{side:c,sideOffset:l,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:b,hideWhenDetached:f,avoidCollisions:x}:{};return a.jsx(ql,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:me,selectedItem:E,onItemLeave:Fe,itemTextRefCallback:ge,focusSelectedItem:U,selectedItemText:O,position:n,isPositioned:I,searchRef:X,children:a.jsx(hn,{as:l_,allowPinchZoom:!0,children:a.jsx(Gr,{asChild:!0,trapped:_.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:V(o,F=>{_.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:a.jsx($e,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:F=>F.preventDefault(),...v,...pt,onPlaced:()=>z(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:V(v.onKeyDown,F=>{const te=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!te&&F.key.length===1&&Z(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let J=A().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(F.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const Q=F.target,ne=J.indexOf(Q);J=J.slice(ne+1)}setTimeout(()=>R(J)),F.preventDefault()}})})})})})})});Gl.displayName=c_;var d_="SelectItemAlignedPosition",Kl=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=Je(ut,r),i=Ze(ut,r),[c,l]=g.useState(null),[d,u]=g.useState(null),p=Y(t,k=>u(k)),m=An(r),h=g.useRef(!1),b=g.useRef(!0),{viewport:f,selectedItem:x,selectedItemText:v,focusSelectedItem:_}=i,w=g.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&f&&x&&v){const k=s.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),O=v.getBoundingClientRect();if(s.dir!=="rtl"){const Q=O.left-E.left,ne=T.left-Q,xe=k.left-ne,mt=k.width+xe,fa=Math.max(mt,E.width),ha=window.innerWidth-je,ga=zl(ne,[je,Math.max(je,ha-fa)]);c.style.minWidth=mt+"px",c.style.left=ga+"px"}else{const Q=E.right-O.right,ne=window.innerWidth-T.right-Q,xe=window.innerWidth-k.right-ne,mt=k.width+xe,fa=Math.max(mt,E.width),ha=window.innerWidth-je,ga=zl(ne,[je,Math.max(je,ha-fa)]);c.style.minWidth=mt+"px",c.style.right=ga+"px"}const L=m(),A=window.innerHeight-je*2,I=f.scrollHeight,z=window.getComputedStyle(d),$=parseInt(z.borderTopWidth,10),R=parseInt(z.paddingTop,10),U=parseInt(z.borderBottomWidth,10),P=parseInt(z.paddingBottom,10),q=$+R+I+P+U,X=Math.min(x.offsetHeight*5,q),Z=window.getComputedStyle(f),me=parseInt(Z.paddingTop,10),Fe=parseInt(Z.paddingBottom,10),ge=k.top+k.height/2-je,$e=A-ge,pt=x.offsetHeight/2,F=x.offsetTop+pt,te=$+R+F,ce=q-te;if(te<=ge){const Q=L.length>0&&x===L[L.length-1].ref.current;c.style.bottom="0px";const ne=d.clientHeight-f.offsetTop-f.offsetHeight,xe=Math.max($e,pt+(Q?Fe:0)+ne+U),mt=te+xe;c.style.height=mt+"px"}else{const Q=L.length>0&&x===L[0].ref.current;c.style.top="0px";const xe=Math.max(ge,$+f.offsetTop+(Q?me:0)+pt)+ce;c.style.height=xe+"px",f.scrollTop=te-ge+f.offsetTop}c.style.margin=`${je}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=A+"px",n?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,c,d,f,x,v,s.dir,n]);se(()=>w(),[w]);const[j,C]=g.useState();se(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=g.useCallback(k=>{k&&b.current===!0&&(w(),_?.(),b.current=!1)},[w,_]);return a.jsx(p_,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:a.jsx("div",{ref:l,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}})})})});Kl.displayName=d_;var u_="SelectPopperPosition",oa=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=je,...s}=e,i=Pn(r);return a.jsx(Gi,{...i,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});oa.displayName=u_;var[p_,aa]=Ft(ut,{}),sa="SelectViewport",Yl=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=Ze(sa,r),i=aa(sa,r),c=Y(t,s.onViewportChange),l=g.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(Tn.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=i;if(m?.current&&p){const h=Math.abs(l.current-u.scrollTop);if(h>0){const b=window.innerHeight-je*2,f=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),v=Math.max(f,x);if(v<b){const _=v+h,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")}}}l.current=u.scrollTop})})})]})});Yl.displayName=sa;var Xl="SelectGroup",[m_,f_]=Ft(Xl),h_=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ne();return a.jsx(m_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});h_.displayName=Xl;var Jl="SelectLabel",g_=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=f_(Jl,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});g_.displayName=Jl;var On="SelectItem",[x_,Zl]=Ft(On),Ql=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...i}=e,c=Je(On,r),l=Ze(On,r),d=c.value===n,[u,p]=g.useState(s??""),[m,h]=g.useState(!1),b=Y(t,_=>l.itemRefCallback?.(_,n,o)),f=Ne(),x=g.useRef("touch"),v=()=>{o||(c.onValueChange(n),c.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(x_,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:g.useCallback(_=>{p(w=>w||(_?.textContent??"").trim())},[]),children:a.jsx(Tn.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,...i,ref:b,onFocus:V(i.onFocus,()=>h(!0)),onBlur:V(i.onBlur,()=>h(!1)),onClick:V(i.onClick,()=>{x.current!=="mouse"&&v()}),onPointerUp:V(i.onPointerUp,()=>{x.current==="mouse"&&v()}),onPointerDown:V(i.onPointerDown,_=>{x.current=_.pointerType}),onPointerMove:V(i.onPointerMove,_=>{x.current=_.pointerType,o?l.onItemLeave?.():x.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(i.onPointerLeave,_=>{_.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:V(i.onKeyDown,_=>{l.searchRef?.current!==""&&_.key===" "||(t_.includes(_.key)&&v(),_.key===" "&&_.preventDefault())})})})})});Ql.displayName=On;var mr="SelectItemText",ed=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,i=Je(mr,r),c=Ze(mr,r),l=Zl(mr,r),d=a_(mr,r),[u,p]=g.useState(null),m=Y(t,v=>p(v),l.onItemTextChange,v=>c.itemTextRefCallback?.(v,l.value,l.disabled)),h=u?.textContent,b=g.useMemo(()=>a.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:f,onNativeOptionRemove:x}=d;return se(()=>(f(b),()=>x(b)),[f,x,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:l.textId,...s,ref:m}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?_r.createPortal(s.children,i.valueNode):null]})});ed.displayName=mr;var td="SelectItemIndicator",rd=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zl(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var ia="SelectScrollUpButton",nd=g.forwardRef((e,t)=>{const r=Ze(ia,e.__scopeSelect),n=aa(ia,e.__scopeSelect),[o,s]=g.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let c=function(){const d=l.scrollTop>0;s(d)};const l=r.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=r;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});nd.displayName=ia;var ca="SelectScrollDownButton",od=g.forwardRef((e,t)=>{const r=Ze(ca,e.__scopeSelect),n=aa(ca,e.__scopeSelect),[o,s]=g.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let c=function(){const d=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<d;s(u)};const l=r.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=r;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});od.displayName=ca;var ad=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=Ze("SelectScrollButton",r),i=g.useRef(null),c=An(r),l=g.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),se(()=>{c().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{l()})})}),b_="SelectSeparator",__=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});__.displayName=b_;var la="SelectArrow",v_=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pn(r),s=Je(la,r),i=Ze(la,r);return s.open&&i.position==="popper"?a.jsx(Ki,{...o,...n,ref:t}):null});v_.displayName=la;var y_="SelectBubbleInput",sd=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=g.useRef(null),s=Y(n,o),i=Jb(t);return g.useEffect(()=>{const c=o.current;if(!c)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&u){const p=new Event("change",{bubbles:!0});u.call(c,t),c.dispatchEvent(p)}},[i,t]),a.jsx(W.select,{...r,style:{...Ml,...r.style},ref:s,defaultValue:t})});sd.displayName=y_;function id(e){return e===""||e===void 0}function cd(e){const t=Ve(e),r=g.useRef(""),n=g.useRef(0),o=g.useCallback(i=>{const c=r.current+i;t(c),(function l(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function ld(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=w_(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==r));const l=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function w_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var j_=Dl,S_=$l,C_=Ul,k_=Hl,N_=Vl,E_=Wl,T_=Yl,A_=Ql,P_=ed,O_=rd,R_=nd,L_=od;function fr({...e}){return a.jsx(j_,{"data-slot":"select",...e})}function hr({...e}){return a.jsx(C_,{"data-slot":"select-value",...e})}function gr({className:e,size:t="default",children:r,...n}){return a.jsxs(S_,{"data-slot":"select-trigger","data-size":t,className:D("ecr-select__trigger",e),...n,children:[r,a.jsx(k_,{asChild:!0,children:a.jsx(fo,{className:"ecr-select__icon"})})]})}function xr({className:e,children:t,position:r="popper",align:n="center",...o}){const s=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(N_,{container:s,children:a.jsxs(E_,{"data-slot":"select-content",className:D("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(I_,{}),a.jsx(T_,{className:D("ecr-select__viewport"),children:t}),a.jsx(z_,{})]})})}function br({className:e,children:t,...r}){return a.jsxs(A_,{"data-slot":"select-item",className:D("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(O_,{children:a.jsx(If,{className:"ecr-select__check-icon"})})}),a.jsx(P_,{children:t})]})}function I_({className:e,...t}){return a.jsx(R_,{"data-slot":"select-scroll-up-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(zf,{className:"ecr-select__icon"})})}function z_({className:e,...t}){return a.jsx(L_,{"data-slot":"select-scroll-down-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(fo,{className:"ecr-select__icon"})})}const M_=({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(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:qu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),D_={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 F_(){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(fr,{defaultValue:Xa[0].value,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Xa.map(e=>a.jsx(br,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Vu.map(e=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(qt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(ir,{name:e.label,text:D_[e.value]})})]})},e.value))]})]})]})}const $_=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(F_,{}),a.jsx(M_,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]}),Rn=({label:e,text:t})=>a.jsxs(Rt,{children:[a.jsx(Lt,{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(qt,{size:20})]}),a.jsx(V0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(It,{className:"ecr-admin-popover",children:a.jsx(ir,{name:e,text:t})})]});var Ln="Collapsible",[B_]=He(Ln),[U_,da]=B_(Ln),dd=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:s,onOpenChange:i,...c}=e,[l,d]=ct({prop:n,defaultProp:o??!1,onChange:i,caller:Ln});return a.jsx(U_,{scope:r,disabled:s,contentId:Ne(),open:l,onOpenToggle:g.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":pa(l),"data-disabled":s?"":void 0,...c,ref:t})})});dd.displayName=Ln;var ud="CollapsibleTrigger",pd=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=da(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":pa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ua="CollapsibleContent",md=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=da(ua,e.__scopeCollapsible);return a.jsx(Ke,{present:r||o.open,children:({present:s})=>a.jsx(H_,{...n,ref:t,present:s})})});md.displayName=ua;var H_=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...s}=e,i=da(ua,r),[c,l]=g.useState(n),d=g.useRef(null),u=Y(t,d),p=g.useRef(0),m=p.current,h=g.useRef(0),b=h.current,f=i.open||c,x=g.useRef(f),v=g.useRef(void 0);return g.useEffect(()=>{const _=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(_)},[]),se(()=>{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,h.current=w.width,x.current||(_.style.transitionDuration=v.current.transitionDuration,_.style.animationName=v.current.animationName),l(n)}},[i.open,n]),a.jsx(W.div,{"data-state":pa(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!f,...s,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 pa(e){return e?"open":"closed"}var V_=dd,W_=pd,q_=md;function fd({className:e,...t}){return a.jsx(V_,{"data-slot":"collapsible",className:D("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(W_,{"data-slot":"collapsible-trigger",className:D("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(fo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(q_,{"data-slot":"collapsible-content",className:D("ecr-collapsible__content",e),...t})}const G_=({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(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Wu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),K_=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],Y_=({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:K_.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($p,{color:"#2563eb",size:16}):a.jsx(Bp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},X_=Object.values(Ya),J_={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!"})},Z_=({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(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[X_.map(r=>a.jsx(br,{value:r,className:"ecr-admin-control__option",children:r},r)),Uu.map(r=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(qt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(ir,{name:r,text:J_[r]})})]})},r))]})]})]}),Q_=({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(Ff,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Y_,{selectedShape:r?.shape,handleShape:o=>n(s=>({...s,shape:o}))}),a.jsx(Z_,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(s=>({...s,template:o}))}),a.jsx(G_,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(s=>({...s,appearance:o}))}),a.jsx(cr,{label:"Size",min:150,max:400,value:r?.size??150,onChange:o=>n(s=>({...s,size:o})),name:"size",id:"size"}),a.jsx(cr,{label:"Gap",min:0,max:80,value:r?.gap??0,onChange:o=>n(s=>({...s,gap:o})),name:"column_gap",id:"column-gap"}),a.jsx(Rn,{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(Rn,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(Rn,{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(Rn,{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!"})})]})]}),ev=({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(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Hu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),tv=({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(Uf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(cr,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(s=>({...s,border:{...s.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dl,{selectedColor:r?.border?.border_color,handleColor:o=>n(s=>({...s,border:{...s.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(cr,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(s=>({...s,border:{...s.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(ev,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(s=>({...s,hoverEffect:o}))})]})]}),rv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",s=r==="style",i=c=>{n(r!==c?c:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Q_,{handleSectionOpen:i,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(tv,{isStyleOpen:s,handleSectionOpen:i,styles:e,updateStyles:t})]})},nv=({styles:e,setStyles:t,isExpanded:r,setIsEdited:n,tabs:o,currentTab:s,setCurrentTab:i})=>{const c=d=>{t(u=>{const p=d(u);return n(!0),p})},l=d=>{(d===o.thumbnail||d===o.preview)&&i(d)};return a.jsxs("div",{className:D("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),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(Yb,{value:s,onValueChange:l,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(Xb,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Ll,{value:o.thumbnail,children:"Thumbnail"}),a.jsx(Ll,{value:o.preview,children:"Preview"})]}),a.jsx(Il,{value:o.thumbnail,children:a.jsx(rv,{styles:e,updateStyles:c})}),a.jsx(Il,{value:o.preview,children:a.jsx($_,{styles:e,updateStyles:c})})]})})]})},ov=e=>{const t=Se(),[r,n]=y.useState(""),[o,s]=y.useState([]),[i,c]=y.useState(et),[l,d]=y.useState(!0),[u,p]=y.useState(!1),[m,h]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const _=(await ue.get(`stories/${e}`)).data;n(_.group_name),s(_.stories),c(_.styles??et)}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async x=>{const v=o.map(j=>j.id),_={group_name:r,styles:i,story_ids:v};e&&(_.group_id=e);const w=await ue.post("stories/manage-group-stories",_);if(!e){const j=w.data.group_id;t(`?view=${K.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:s,styles:i,setStyles:c,isLoading:l,isSaving:u,isEdited:m,setIsEdited:h,handleSave:async()=>{try{p(!0);const x=await b();return h(!1),G.success("Changes saved successfully!"),x}catch(x){return x instanceof Error?G.error(x.message):G.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},av=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),s=y.useRef(!1),i=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){i.current=m;return}if(s.current){s.current=!1,i.current=m;return}m!==i.current&&(o.current=m,window.location.hash=i.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,s.current=!0,p();return}if(o.current){const p=o.current;o.current=null,s.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{s.current=!0,p()}}},xd={thumbnail:"thumbnail",preview:"preview"},sv=()=>{const e=Se(),{state:t}=Ht(),[r]=Vt(),n=r.get("gid"),{groupTitle:o,setGroupTitle:s,thisGroupReels:i,setThisGroupReels:c,styles:l,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:h,handleSave:b}=ov(n),{allReels:f,setAllReels:x,searchTerm:v,setSearchTerm:_,isSearching:w,lastStoryElementRef:j}=Js(n),[C,N]=y.useState(""),[k,E]=y.useState(!0),[T,O]=y.useState(xd.thumbnail),{showLeaveModal:L,requestLeave:A,confirmLeave:I,cancelLeave:z,allowNextNavigation:$}=av(m),R=async(P,q)=>{try{N(P.story_uuid);const X=q==="add"?[P,...i]:i.filter(Z=>Z.story_uuid!==P.story_uuid);c(X),x(q==="add"?Z=>Z.filter(me=>me.story_uuid!==P.story_uuid):Z=>[...Z,P]),h(!0)}catch(X){X instanceof Error?G.error(X.message):G.error("Something went wrong. Please try again later!")}finally{N("")}};y.useEffect(()=>{if(!u&&t){const P=f.findIndex(q=>q.id==t.storyId);if(P!==-1){const q=f[P];x(X=>X.filter(Z=>Z.id!=q.id)),c(X=>[q,...X]),h(!0)}}},[t,f,u,x,c,h]);const U=async()=>{const P=await b();P?.isNewGroup&&$(()=>{e(`?view=${K.mg}&gid=${P.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(vb,{value:{requestLeave:A},children:[a.jsx(_t,{left:[a.jsx(vt,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(Xt,{cb:()=>A(()=>e(`?view=${K.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Zs,{placeholder:"Enter group title",title:o,setTitle:s,setIsEdited:h,style:{paddingInline:"32px"}}),o&&a.jsxs(Vo,{children:[a.jsx(Wo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(q0,{})}),a.jsxs(qo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Customize title appearance"})}),a.jsx(xb,{styles:l,setStyles:d,setIsEdited:h}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(b0,{asChild:!0,children:a.jsx(re,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(W0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(uo,{onSave:U,isSaving:p,disabled:!m},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Manage Widget"}],onNavigate:P=>A(()=>e(P))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Tb,{allReels:f,gid:n,handleSelectReel:R,searchTerm:v,setSearchTerm:_,isSearching:w,togglingId:C,lastStoryElementRef:j}),a.jsx(Eb,{gid:n,reels:i,styles:l,handleRemoveReel:R,togglingId:C,currentTab:T}),a.jsx(nv,{isExpanded:k,setIsEdited:h,styles:l,setStyles:d,tabs:xd,setCurrentTab:O,currentTab:T})]}),L&&a.jsx(Or,{onReject:z,onAccept:I,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function iv(){const[e]=Vt(),t=e.get("view")||K.ag;let r;switch(t){case K.settings:r=a.jsx(F0,{});break;case K.ar:r=a.jsx(jf,{});break;case K.stat:r=a.jsx(U0,{});break;case K.cr:r=a.jsx(T0,{});break;case K.mg:r=a.jsx(sv,{});break;default:r=a.jsx(M0,{})}return a.jsxs("div",{children:[r,a.jsx(Bu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const bd=async(e,t,r,n={})=>{try{if(await ue.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},cv=()=>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 e=y.useContext(ma),{stories:t,styles:r,groupId:n,isPlaying:o,setIsPlaying:s,setStoryViews:i}=e,[c,l]=y.useState(null),[d,u]=y.useState(!0),[p,m]=y.useState(0),[h,b]=y.useState(!1),f=y.useRef(!0),x=t.length-1,[v,_]=y.useState({index:0,story_uuid:t[0]?.story_uuid}),w=A=>!!A?.files?.[0]?.mime_type?.startsWith("video"),j=y.useCallback((A,I=1)=>{if(t.length===0)return null;let z=A;for(let $=0;$<t.length;$+=1){const R=t[z];if(w(R))return{story:R,index:z};z=(z+I+t.length)%t.length}return null},[t]),C=y.useCallback(()=>{const A=o,I=t.findIndex(R=>String(R.story_uuid)===A),z=I>=0?t[I]:null,$=w(z)?{story:z,index:I}:j(Math.max(I,0),1);$?.story?(l($.story),I!==$.index&&$.story.story_uuid!==o&&s($.story.story_uuid)):l(null),u(!1)},[o,t,s,j]);y.useEffect(()=>{C()},[o,t,C]),y.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const N=(A=1)=>{u(!0);const I=t.findIndex(P=>String(P.story_uuid)===String(o)),z=A>0?1:-1,$=A>0?x>I?I+1:0:I>0?I-1:x,R=j($,z);if(!R?.story){u(!1);return}const U=R.story;if(U.story_uuid===o){u(!1),s(null);return}_({index:0,story_uuid:U.story_uuid}),n&&bd(n,U.id,i,{isActive:()=>f.current}),s(U.story_uuid),u(!1)},k=()=>{const A=c?.files??[];v?.index>0?_(I=>({index:I.index-1,story_uuid:A[I.index-1].story_uuid})):N(-1)},E=()=>{const A=c?.files??[];v?.index+1<A.length?_(I=>({index:I.index+1,story_uuid:A[I.index+1].story_uuid})):(N(),A[0]?.story_uuid&&_({index:0,story_uuid:A[0].story_uuid}))},T=A=>{A.target===A.currentTarget&&s(null)},O=r?.playerAppearance??"overlay",L=c?.links&&c.links.length>0?c.links[0]:null;return a.jsx("div",{onClick:T,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:c&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(xt,{onClick:k,className:"ecr-player__nav--left",children:a.jsx(Gt,{size:24})}),a.jsx(xt,{onClick:E,className:"ecr-player__nav--right",children:a.jsx(Kt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[c&&a.jsx(os,{playingStory:c,duration:p,currentFileIndex:v,isPaused:h},`${c.story_uuid}-${v.index}`),a.jsx("div",{onClick:()=>s(null),className:"ecr-player__close",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),d?a.jsx(cv,{}):c?.files.length>0&&a.jsx(cs,{currentFileIndex:v,files:c?.files,setDuration:m,setIsPlaying:s,isPaused:h,setIsPaused:b,handlePrevFile:k,handleNextFile:E,storyId:c.id,storyTitle:c?.title}),O==="overlay"&&L?a.jsx(kn,{link:L,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,O==="title"?a.jsx(Nn,{title:c.title}):null]})]})})},_d=({story:e,styles:t,handlePlaying:r,template:n,storyViews:o,setStoryViews:s})=>{const i=e.links&&e.links.length>0?e.links[0]:null,c=t.appearance??"overlay";return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,style:{width:n==="carousel"?`${t?.size}px`:"auto"},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(Jn,{story:e,styles:t,storyViews:o,setStoryViews:s}),c==="overlay"&&t.shape==="rectangle"?i?a.jsx(kn,{link:i,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(Nn,{title:e.title}):null]}),c==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-reel__title",children:e.title}):null]})},dv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:c,canScrollLeft:l,canScrollRight:d,scrollBy:u,scrollStep:p}=fl([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:s,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:i,style:{gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},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(_d,{story:m,styles:t,handlePlaying:r,template:"carousel",storyViews:n,setStoryViews:o},m.story_uuid):null)})}),c&&l&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Gt,{size:20,style:{width:"20px",height:"20px"}})}),c&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Kt,{size:20,style:{width:"20px",height:"20px"}})})]})},vd=({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`,gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:"ecr-front-grid__list",children:e?.map(s=>s?.files[0]?.mime_type.startsWith("video")?a.jsx(_d,{story:s,styles:t,handlePlaying:r,template:"grid",storyViews:n,setStoryViews:o},s.story_uuid):null)})}),uv={carousel:dv,grid:vd},pv=()=>{const e=y.useContext(ma),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:s,storyViews:i,setStoryViews:c}=e,l=y.useRef(!0);y.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const d=r.template??"carousel",u=uv[d]||vd,p=({sid:m,story_uuid:h})=>{s(h),o&&bd(o,m,c,{isActive:()=>l.current})};return a.jsxs("div",{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:i,setStoryViews:c})]})},mv=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[s,i]=y.useState(et),[c,l]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),i(et),l(!1),u(null);return}const h=new AbortController;l(!0),u(null);try{const b=await ue.get(`stories/${m}`,{signal:h.signal});if(h.signal.aborted)return;r(b.data.group_name),o(b.data.stories),i(b.data.styles||et)}catch(b){if(h.signal.aborted)return;u(b)}finally{l(!1)}return()=>{h.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:s,isLoading:c,error:d}},ma=y.createContext(void 0),yd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:s,stories:i,styles:c}=mv(e);return a.jsxs(ma.Provider,{value:{groupTitle:s,groupId:e,stories:i,styles:c,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(lv,{}),a.jsx(pv,{})]})};xa(()=>{const e=document.getElementById("ecommreels-admin-app");e&&In.createRoot(e).render(a.jsx(Xd,{children:a.jsx(iv,{})}))}),xa(()=>{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(yd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;In.createRoot(n).render(a.jsx(yd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);362 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},p0="DialogDescriptionWarning",m0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zl(p0).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},f0=jl,h0=Cl,g0=Nl,x0=El,b0=Pl,_0=Al,Ml=Ll;function Vo({...e}){return a.jsx(f0,{"data-slot":"dialog",...e})}function Wo({...e}){return a.jsx(h0,{"data-slot":"dialog-trigger",...e})}function v0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(g0,{"data-slot":"dialog-portal",container:t,...e})}function y0({className:e,...t}){return a.jsx(x0,{"data-slot":"dialog-overlay",className:F("ecr-dialog__overlay",e),...t})}function qo({className:e,children:t,...r}){return a.jsxs(v0,{children:[a.jsx(y0,{}),a.jsxs(b0,{"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(Jf,{className:"ecr-dialog__close-icon"})})]})]})}function Go({className:e,...t}){return a.jsx("div",{className:F("ecr-dialog__header",e),...t})}function Ko({className:e,...t}){return a.jsx(_0,{"data-slot":"dialog-title",className:F("ecr-dialog__title",e),...t})}function w0({...e}){return a.jsx(Ml,{"data-slot":"dialog-close",...e})}const j0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,s]=y.useState([]),[i,l]=y.useState(1),[d,c]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1),[b,f]=y.useState(""),h=co(b,500),v=y.useRef(!0),_=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async P=>{if(!r||!n){C("Missing API configuration."),g(!1),p(!1);return}const T=++_.current;w.current&&w.current.abort();const R=new AbortController;w.current=R,P===1&&v.current?g(!0):p(!0);try{const L={page:P,per_page:50};h&&(L.search=h);const I=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:L,signal:R.signal}),O=I.data,D=parseInt(I.headers["x-wp-totalpages"]||"1",10);T===_.current&&(s(z=>P===1?O:[...z,...O]),l(P+1),c(P<D))}catch(L){if(R.signal.aborted)return;L instanceof Error?C(L.message):C("An unknown error occurred")}finally{v.current&&(v.current=!1),T===_.current&&!R.signal.aborted&&(p(!1),g(!1))}},[h,n,r]);y.useEffect(()=>{t&&(l(1),s([]),C(null),v.current=!0,N(1))},[h,N,t]);const k=y.useRef(null),E=y.useCallback(P=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(T=>{T[0].isIntersecting&&d&&N(i)}),P&&k.current.observe(P))},[u,d,i,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:s,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},vn="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}),S0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:s,searchTerm:i,setSearchTerm:l,error:d})=>{const[c,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(),c.length===0){m(!0);return}const h=new Set(c),v=[];for(const _ of r)h.has(_.id)&&v.push({btn_type:"product",btn_uuid:mo(),buttonText:_.name,buttonUrl:_.permalink,rating:_.average_rating,price:_.price_html,thumbnail:_.images?.[0]?.thumbnail||_.images?.[0]?.src||vn,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:i,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:d||"No products are available to add."}):r.map((f,h)=>{const v=c.includes(f.id);return a.jsx("div",{ref:r.length===h+1?s:null,className:"ecr-admin-product-link__item",style:c.length>0&&!v?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(re,{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(Gf,{size:20,color:"#2563eb"}):a.jsx(Kf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||vn,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"})}),C0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,k0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[s,i]=y.useState(""),[l,d]=y.useState(!0),[c,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const b=[];t||b.push("text"),n&&C0.test(n)||b.push("url"),s||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:mo(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:s,customClass:c,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(yn,{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(yn,{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(yn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:s,setValue:i}),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=>d(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(yn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:c,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(Dl,{name:"add",handleClick:g})})]})};function yn({error:e,type:t,name:r,label:n,placeholder:o,value:s,setValue:i}){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:s,onChange:l=>i(l.target.value),className:F("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const N0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,s]=y.useState(null),[i,l]=y.useState(!1),d=j0({enabled:i}),c=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(xn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[c&&a.jsxs(Vo,{open:o==="custom",onOpenChange:g=>s(g?"custom":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Uf,{size:20})," Add Custom Link"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(k0,{handleLinks:g=>{e(b=>[...b,g]),s(null)}})})]})]}),u&&a.jsxs(Vo,{open:o==="product",onOpenChange:g=>s(g?"product":null),children:[a.jsxs(Wo,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Yf,{size:20})," Tag Products"]}),a.jsxs(qo,{className:"ecr-admin-link-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(S0,{handleLinks:g=>{e(g),s(null)},taggedProducts:p,products:d.products,isSearching:d.isSearching,isLoading:d.isLoading,lastProductElementRef:d.lastProductElementRef,searchTerm:d.searchTerm,setSearchTerm:d.setSearchTerm,error:d.error})})]})]})]})})]})},E0=({links:e,onLinksChange:t})=>{const r=o=>{t(s=>s.filter(i=>i.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(re,{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(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(Jt,{size:20})]}),a.jsx(It,{className:"ecr-admin-links__popover",children:a.jsx(pr,{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(N0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function $l(e){return H({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 P0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[s,i]=y.useState(!1);return a.jsx("video",{ref:n,className:F("ecr-admin-reelvideo",s?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const d=l.currentTarget,c=d.videoWidth,u=d.videoHeight;i(()=>u>c)}})},T0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:s,dragEnd:i})=>{const[l,d]=y.useState(!0),[c,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(c?p.current.play():p.current.pause(),u(b=>!b))},g=()=>{p.current&&(p.current.muted=!l,d(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>s(e),onDragEnd:i,className:F("ecr-admin-customization__panel"),children:[a.jsx($l,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(P0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[c?a.jsx(Kn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Yn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},A0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),s=d=>{n.current=d},i=d=>{o.current=d},l=()=>{if(n.current===null||o.current===null)return;const d=[...e],c=d[n.current];d.splice(n.current,1),d.splice(o.current,0,c),n.current=null,o.current=null,r(d)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((d,c)=>a.jsx(T0,{setIsAttemptingDelete:t,file:d,file_uuid:d.file_uuid,index:c,dragStart:s,dragEnter:i,dragEnd:l},c)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:ti,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(Jt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(It,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(pr,{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!"]})})})]})]})},O0=({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(ri,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),R0=()=>{const e=Se(),[t]=Yt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,s]=y.useState({files:[],title:"",links:[],thumbnail:null}),[i,l]=y.useState(!1),[d,c]=y.useState(null),u=y.useCallback(h=>{s(v=>({...v,title:typeof h=="function"?h(v.title):h}))},[]),p=y.useCallback(h=>{s(v=>({...v,files:typeof h=="function"?h(v.files):h}))},[]),m=y.useCallback(h=>{s(v=>({...v,links:typeof h=="function"?h(v.links):h}))},[]),g=y.useCallback(h=>{s(v=>({...v,thumbnail:typeof h=="function"?h(v.thumbnail):h}))},[]),b=()=>{d&&(p(h=>h.filter(v=>v.file_uuid!==d)),c(null))},f=y.useCallback(async h=>{try{l(!0);const v=await pe.get(`story/${h}`);s({title:v.data.title,files:v.data.files,links:v.data.links,thumbnail:v.data.thumbnail})}catch(v){v instanceof Error?G.error(v.message):G.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)},[]),i?a.jsx(Rr,{}):a.jsxs(a.Fragment,{children:[a.jsx(Nf,{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"}),d&&a.jsx(Ar,{onReject:()=>c(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(A0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:c}):a.jsx(ri,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(O0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(xn,{className:"ecr-admin-create__separator"}),a.jsx(E0,{links:o.links,onLinksChange:m})]})]})]})},Bl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(lp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Yo,Ul;function L0(){return Ul||(Ul=1,Yo=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()}}),Yo}var Xo,Hl;function I0(){if(Hl)return Xo;Hl=1;var e=L0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(s){var i=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,i)}function o(s,i){var l,d,c,u,p,m,g=!1;i||(i={}),l=i.debug||!1;try{c=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=s,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(),i.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[i.format]||t.default;window.clipboardData.setData(h,s)}else f.clipboardData.clearData(),f.clipboardData.setData(i.format,s);i.onCopy&&(f.preventDefault(),i.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(i.format||"text",s),i.onCopy&&i.onCopy(window.clipboardData),g=!0}catch(h){l&&console.error("unable to copy using clipboardData: ",h),l&&console.error("falling back to prompt"),d=n("message"in i?i.message:r),window.prompt(d,s)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),c()}return g}return Xo=o,Xo}var z0=I0();const Vl=Cd(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 wn({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 Re({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 M0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],D0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),s=(i,l)=>{Vl(i),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(nt,{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(wn,{children:M0.map((i,l)=>a.jsx(Kl,{className:"ecr-admin-groups__head",style:{width:i?.width||"auto",textAlign:i?.align},children:i.label},l))})}),a.jsx(Gl,{children:e.map((i,l)=>a.jsxs(wn,{className:F("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Re,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:i.group_name})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${i.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>s(`[reelswp-group id='${i.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(np,{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(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(re,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.stat}&group=${i.id}&name=${i.group_name}`,children:a.jsx(us,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.mg}&gid=${i.id}`,children:a.jsx(Tr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Delete Group",onClick:()=>t(i.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(ip,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},i.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))})]}),F0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,s]=y.useState(!1),[i,l]=y.useState(!1),[d,c]=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=co(u,500),j=y.useCallback(async E=>{const P=new AbortController,T=E===1;try{T?s(!0):l(!0),n("");const R=await pe.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:P.signal}),L=Number(R.headers?.["x-wp-total"]??0),I=Number(R.headers?.["x-wp-totalpages"]??1),O=Math.max(1,I||1);t(D=>{if(T)return R.data;const z=new Set(D.map(A=>A.id)),B=R.data.filter(A=>!z.has(A.id));return[...D,...B]}),h(L),_(O),E>O&&g(O)}catch(R){if(P.signal.aborted)return;R instanceof Error?n(R.message):n("Something went wrong. Try again later!")}finally{P.signal.aborted||(T?s(!1):l(!1))}},[b,w]),C=y.useCallback(()=>{g(E=>o||i||E>=v?E:E+1)},[o,i,v]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{c(!0),await pe.delete(`group/${E}`),await N(),G.success("Group deleted successfully!")}catch(P){P instanceof Error?G.error(P.message):G.error("Failed to delete group.")}finally{c(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:i,isDeleting:d,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:v,hasMore:m<=v,loadMore:C,refreshGroups:N,deleteGroup:k}},$0={docs:"https://reelswp.com/docs/"},B0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:s,isDeleting:i,deleteGroup:l,hasMore:d,loadMore:c,searchTerm:u,setSearchTerm:p}=F0(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!d)return;const b=new IntersectionObserver(f=>{const[h]=f;h.isIntersecting&&c()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[d,c]),a.jsxs(a.Fragment,{children:[a.jsx(_t,{left:[a.jsx(vt,{name:"All Widgets",Icon:cp},"page")],center:[a.jsx(Lr,{},"reel-wp")],right:[a.jsxs("a",{href:$0.docs,className:"ecr-admin-docs-link",target:"_blank",children:[a.jsx($f,{size:14}),a.jsx("span",{children:"Documentation"})]},"view-documentation"),a.jsx(Or,{to:`?view=${K.cr}`,text:"Add Reel",Icon:gt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Ar,{onAccept:g,onReject:()=>t(null),isLoading:i}),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(re,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(er,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(ns,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Or,{to:`?view=${K.mg}`,text:"Create Widget",Icon:gt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Xl,{}):n?a.jsx(Bl,{}):a.jsxs(a.Fragment,{children:[a.jsx(D0,{tableData:r,setIsAttemptingDelete:t}),d&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:s?a.jsx(Hf,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},U0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,s]=y.useState(!1),[i,l]=y.useState(!1),[d,c]=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)){G.error("Please enter valid numbers.");return}try{l(!0),c(!1),await pe.post("settings",{rate_limit:m,time_limit:g}),G.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),c(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{s(!0),c(!1);const b=await pe.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?G.error(b.message):G.error("Something went wrong. Try again later!"),c(!0)}finally{m.signal.aborted||s(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:i,isError:d,handleOnChange:u,handleSave:p}},H0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:s,handleSave:i}=U0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Rr,{}),a.jsx(_t,{left:[a.jsx(vt,{name:"Settings",Icon:Sp},"Settings"),a.jsx(tr,{},"back-settings")],center:[a.jsx(Lr,{},"Settings-widget-name")],right:[a.jsx(uo,{onSave:i,isSaving:n,disabled:!t},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${K.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=>s("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=>s("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},V0=[{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"}],W0=({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(nt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(ql,{children:a.jsx(wn,{children:V0.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(wn,{className:F("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Re,{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(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),q0=()=>{const[e]=Yt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[s,i]=y.useState([]),[l,d]=y.useState(!1),[c,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{d(!0);const g=await pe.get(`/group/${t}/stats`);o(g.data.stories),i(g.data.buttons)}catch(g){g instanceof Error?G.error(g.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{d(!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(_t,{left:[a.jsx(vt,{name:"Statistics",Icon:us},"Statistics"),a.jsx(tr,{},"Statistics-back")],center:[a.jsx(Lr,{},"Statistics-widget-name")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${K.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,{}):c?a.jsx(Bl,{}):s.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(W0,{tableData:s})})]})]})};function G0(e){return H({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 K0(e){return H({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 Y0=({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(G0,{size:24})}),X0=({...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"})]})}),Jo=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}));Jo.displayName="Input";const Zo=({label:e,min:t,max:r,value:n,onChange:o,name:s,id:i,wrapperStyles:l,hideSlider:d})=>{const[c,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:i,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!d&&a.jsx("input",{type:"range",id:i,name:s,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(Jo,{type:"number",min:t,max:r,value:c,onChange:b=>g(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function M(){return M=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},M.apply(null,arguments)}function De(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 zt=255,Xe=100,mr=e=>{var{r:t,g:r,b:n,a:o}=e,s=Math.max(t,r,n),i=s-Math.min(t,r,n),l=i?s===t?(r-n)/i:s===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(l<0?l+6:l),s:s?i/s*Xe:0,v:s/zt*Xe,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,s=(200-r)*n/Xe;return{h:t,s:s>0&&s<200?r*n/Xe/(s<=Xe?s:200-s)*Xe:0,l:s/2,a:o}},Ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(s=>new Array(7-s.length).join("0")+s)(o.toString(16))},J0=e=>{var{r:t,g:r,b:n,a:o}=e,s=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Ql({r:t,g:r,b:n})+(s||"")},fr=e=>mr(Z0(e)),Z0=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,s=0,i]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:s,a:(i??255)/zt}},jn=e=>{var{h:t,s:r,v:n,a:o}=e,s=t/60,i=r/Xe,l=n/Xe,d=Math.floor(s)%6,c=s-Math.floor(s),u=zt*l*(1-i),p=zt*l*(1-i*c),m=zt*l*(1-i*(1-c));l*=zt;var g={};switch(d){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),M({},g,{a:o})},Q0=e=>{var{r:t,g:r,b:n,a:o}=jn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},eb=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},tb=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Qo=e=>Ql(jn(e)),rb=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},nb=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)},s=o(t/255),i=o(r/255),l=o(n/255),d={};return d.x=s*.4124+i*.3576+l*.1805,d.y=s*.2126+i*.7152+l*.0722,d.bri=s*.0193+i*.1192+l*.9505,d},Mt=e=>{var t,r,n,o,s,i,l,d,c;return typeof e=="string"&&ea(e)?(i=fr(e),d=e):typeof e!="string"&&(i=e),i&&(n=rb(i),s=Zl(i),o=jn(i),c=J0(o),d=Qo(i),r=tb(s),t=eb(o),l=nb(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:s,hsva:i,hex:d,hexa:c,xy:l}},ea=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)}},ob=["prefixCls","className","onMove","onDown"],ta=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:s}=e,i=De(e,ob),l=y.useRef(null),d=y.useRef(!1),[c,u]=y.useState(!1),p=ec(o),m=ec(s),g=_=>d.current&&!hr(_)?!1:(d.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(d.current?"touchmove":"mousemove",b),window.addEventListener(d.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(c),()=>{h(!1)}),[c,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",M({},i,{className:[r,n||""].filter(Boolean).join(" "),style:M({},i.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:v,onTouchStart:v}))});ta.displayName="Interactive";var ab=e=>{var{className:t,color:r,left:n,top:o,prefixCls:s}=e,i={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:s+"-pointer "+(t||""),style:i,children:a.jsx("div",{className:s+"-fill",style:l})}),[o,n,r,t,s])},sb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],oc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:s,className:i,hue:l=0,style:d,hsva:c,onChange:u}=e,p=De(e,sb),m=M({width:200,height:200,borderRadius:o},d,{position:"relative"}),g=(v,_)=>{u&&c&&u({h:c.h,s:v.left*100,v:(1-v.top)*100,a:c.a})},b=y.useCallback(v=>{if(!(!c||!u)){var _=1,w=c.s,j=c.v,C=!1;switch(v.key){case"ArrowLeft":w=Math.max(0,c.s-_),C=!0,v.preventDefault();break;case"ArrowRight":w=Math.min(100,c.s+_),C=!0,v.preventDefault();break;case"ArrowUp":j=Math.min(100,c.v+_),C=!0,v.preventDefault();break;case"ArrowDown":j=Math.max(0,c.v-_),C=!0,v.preventDefault();break;default:return}C&&u({h:c.h,s:w,v:j,a:c.a})}},[c,u]),f=y.useMemo(()=>{if(!c)return null;var v={top:100-c.v+"%",left:c.s+"%",color:Jl(c)};return s&&typeof s=="function"?s(M({prefixCls:n},v)):a.jsx(ab,M({prefixCls:n},v))},[c,s,n]),h=y.useCallback(v=>{v.target.focus()},[]);return a.jsx(ta,M({className:[n,i||""].filter(Boolean).join(" ")},p,{style:M({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=c?.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 ib=["className","prefixCls","left","top","style","fillProps"],lb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:s,fillProps:i}=e,l=De(e,ib),d=M({},s,{position:"absolute",left:n,top:o}),c=M({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},i?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",M({className:r+"-pointer "+(t||""),style:d},l,{children:a.jsx("div",M({className:r+"-fill"},i,{style:c}))}))},cb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],db="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Sn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:s,bgProps:i={},innerProps:l={},pointerProps:d={},radius:c=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:b,pointer:f}=e,h=De(e,cb),v=P=>{b&&b(M({},o,{a:m==="horizontal"?P.left:P.top}),P)},_=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 C=M({"--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:c,background:"url("+db+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(P=>{var T=.01,R=o.a,L=R;switch(P.key){case"ArrowLeft":m==="horizontal"&&(L=Math.max(0,R-T),P.preventDefault());break;case"ArrowRight":m==="horizontal"&&(L=Math.min(1,R+T),P.preventDefault());break;case"ArrowUp":m==="vertical"&&(L=Math.max(0,R-T),P.preventDefault());break;case"ArrowDown":m==="vertical"&&(L=Math.min(1,R+T),P.preventDefault());break;default:return}if(L!==R){var I={left:m==="horizontal"?L:o.a,top:m==="vertical"?L:o.a,width:0,height:0,x:0,y:0};b&&b(M({},o,{a:L}),I)}},[o,m,b]),k=y.useCallback(P=>{P.target.focus()},[]),E=f&&typeof f=="function"?f(M({prefixCls:r},d,j)):a.jsx(lb,M({},d,{prefixCls:r},j));return a.jsxs("div",M({},h,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",M({},i,{style:M({inset:0,position:"absolute",background:s||w,borderRadius:c},i.style)})),a.jsx(ta,M({},l,{style:M({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:v,onDown:v,onClick:k,onKeyDown:N,children:E}))]}))});Sn.displayName="Alpha";var ub=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],pb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),mb=e=>Number(String(e).replace(/%/g,"")),Dt=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:s,className:i,style:l,labelStyle:d,inputStyle:c,onChange:u,onBlur:p,renderInput:m}=e,g=De(e,ub),[b,f]=y.useState(s),h=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(h.current||f(e.value))},[e.value]);function v(k,E){var P=(E||k.target.value).trim().replace(/^#/,"");pb(P)&&u&&u(k,P);var T=mb(P);isNaN(T)||u&&u(k,T),f(P)}function _(k){h.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=M({"--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),C=M({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)"},c),N=M({value:b,onChange:v,onBlur:_,autoComplete:"off",onFocus:()=>h.current=!0},g,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,i||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",M({ref:t},N)),o&&a.jsx("span",{style:M({color:"var(--editable-input-label-color)",textTransform:"capitalize"},d),children:o})]})});Dt.displayName="EditableInput";var fb=["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:s={},gProps:i={},bProps:l={},aProps:d={},className:c,style:u,onChange:p}=e,m=De(e,fb),g=n?jn(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(Mt(mr(M({},g,{a:_/100}))))),_>255&&(_=255,j.target.value="255"),_<0&&(_=0,j.target.value="0"),w==="r"&&p&&p(Mt(mr(M({},g,{r:_})))),w==="g"&&p&&p(Mt(mr(M({},g,{g:_})))),w==="b"&&p&&p(Mt(mr(M({},g,{b:_})))))},v=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",M({ref:t,className:[r,c||""].filter(Boolean).join(" ")},m,{style:M({fontSize:11,display:"flex"},u),children:[a.jsx(Dt,M({label:"R",value:g.r||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"r",_)},s,{style:M({},s.style)})),a.jsx(Dt,M({label:"G",value:g.g||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"g",_)},i,{style:M({marginLeft:5},s.style)})),a.jsx(Dt,M({label:"B",value:g.b||0,onBlur:b,placement:o,onChange:(_,w)=>h(w,"b",_)},l,{style:M({marginLeft:5},l.style)})),d&&a.jsx(Dt,M({label:"A",value:parseInt(String(v*100),10),onBlur:f,placement:o,onChange:(_,w)=>h(w,"a",_)},d,{style:M({marginLeft:5},d.style)}))]}))});ac.displayName="EditableInputRGBA";var hb=["prefixCls","className","hue","onChange","direction"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:s,direction:i="horizontal"}=e,l=De(e,hb);return a.jsx(Sn,M({ref:t,className:r+" "+(n||"")},l,{direction:i,background:"linear-gradient(to "+(i==="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:(d,c)=>{s&&s({h:i==="horizontal"?360*c.left:360*c.top})}}))});sc.displayName="Hue";var gb=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],ic=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:s=[],style:i,rectProps:l={},onChange:d,addonAfter:c,addonBefore:u,rectRender:p}=e,m=De(e,gb),g=M({"--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)=>{d&&d(fr(f),Mt(fr(f)),h)};return a.jsxs("div",M({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:M({display:"flex",flexWrap:"wrap",position:"relative"},i),children:[u&&y.isValidElement(u)&&u,s&&Array.isArray(s)&&s.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:M({},g,{background:_}),onClick:N=>b(_,N)});if(j)return a.jsx(y.Fragment,{children:j},h);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:_,checked:w}):null;return a.jsx("div",M({tabIndex:0,title:v,onClick:N=>b(_,N)},l,{children:C,style:M({},g,{background:_})}),h)}),c&&y.isValidElement(c)&&c]}))});ic.displayName="Swatch";var xb=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],bb=["#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:s=218,presetColors:i=bb,color:l,editableDisable:d=!0,disableAlpha:c=!1,style:u}=e,p=De(e,xb),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&ea(l)&&g(fr(l)),typeof l=="object"&&g(l)},[l]);var b=N=>{g(N),o&&o(Mt(N))},f=(N,k)=>{typeof N=="string"&&ea(N)&&/(3|6)/.test(String(N.length))&&b(fr(N))},h=N=>b(M({},m,{a:N.a})),v=N=>b(M({},m,N,{a:m.a})),_=M({"--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:s},u),w={borderRadius:2,background:Q0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",M({},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(sc,{width:"auto",height:10,hue:m.h,pointer:lc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(M({},m,N))}),!c&&a.jsx(Sn,{width:"auto",height:10,hsva:m,pointer:lc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:h})]}),!c&&a.jsx(Sn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),d&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Dt,{label:"Hex",value:Qo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(ac,{hsva:m,style:{marginLeft:6},aProps:c?!1:{},onChange:N=>b(N.hsva)})]}),i&&i.length>0&&a.jsx(ic,{style:j,colors:i,color:Qo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});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(Rt,{children:[a.jsx(Lt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(It,{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)})]})]}),_b=[{value:"left",title:"Align Left",Icon:$p},{value:"center",title:"Align Center",Icon:Bp},{value:"right",title:"Align Right",Icon:Up},{value:"hidden",title:"Hidden",Icon:Hp}],vb=({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:_b.map(({value:r,title:n,Icon:o})=>a.jsx(re,{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))})]}),yb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(s=>{const i=o(s);return r(!0),i})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(vb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,alignment:o}}))}),a.jsx(dc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(Zo,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},wb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(s=>{Vl(s),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},jb=({gid:e})=>{const[t,r]=wb(),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(Ff,{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()}),Sb=({value:e,children:t})=>a.jsx(uc.Provider,{value:e,children:t}),pc=()=>y.useContext(uc);function Cb(e){return H({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 kb=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(Nb,{link:e,usedFor:t})}),Nb=({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||vn,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||vn,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(Cb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),Eb=({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})})},Cn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(kb,{link:e,usedFor:t},e.btn_uuid):a.jsx(Eb,{link:e,usedFor:t},e.btn_uuid)}),kn=({title:e})=>a.jsx("p",{className:"ecr-reel_title",children:e}),mc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const s=Se(),{requestLeave:i}=pc(),l=n===e.story_uuid,d=`?view=${K.cr}&from=${K.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,c=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=e.links&&e.links.length>0?e.links[0]:null;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(Jn,{story:e,styles:t}),c==="overlay"&&t.shape==="rectangle"?p?a.jsx(Cn,{link:p,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(kn,{title:e.title}):null,a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(re,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(ht,{to:d,className:F("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:m=>{m.preventDefault(),i(()=>s(d))},children:a.jsx(Tr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(re,{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(tt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(Vn,{size:18})})]})]}),c==="title"?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),[s,i]=y.useState(!1),[l,d]=y.useState(!1),[c,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;d(h>0),u(h+_<v-1)};y.useEffect(()=>{const f=r.current,h=n.current;f&&h&&(i(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=T=>{h=!0,v=T.pageX-f.offsetLeft,_=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{h=!1,f.style.cursor="default"},C=()=>{h=!1,f.style.cursor="default"},N=T=>{if(!h)return;T.preventDefault();const L=(T.pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-L,g()},k=T=>{h=!0,v=T.touches[0].pageX-f.offsetLeft,_=f.scrollLeft},E=()=>{h=!1},P=T=>{if(!h)return;const L=(T.touches[0].pageX-f.offsetLeft-v)*1.5;f.scrollLeft=_-L,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",P,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",P)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:s,canScrollLeft:l,canScrollRight:c,scrollBy:b,scrollStep:p}},hc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:l,canScrollLeft:d,canScrollRight:c,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:s,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:i,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(nt,{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&&d&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Zt,{size:20})}),l&&c&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Qt,{size:20})})]})},Pb=({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(s=>a.jsx(mc,{reel:s,styles:t,gid:r,togglingId:n,onRemove:o},s.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(nt,{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."})]})})}),Tb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,s]=y.useState(!1),[i,l]=y.useState(!0),[d,c]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=i)},[i]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&s(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(xt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Zt,{size:24})}),a.jsx(xt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Qt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:d?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(er,{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:d?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:i,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const h=f.currentTarget,v=h.videoWidth,_=h.videoHeight;c(()=>_>v)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Kn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}),i?a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Yn,{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(Cn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,g==="title"?a.jsx(kn,{title:e.title}):null]})})},Ab={carousel:hc,grid:Pb},Ob=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:s})=>{const i=r.template??"carousel",l=Ab[i]||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(jb,{gid:e})]}),a.jsx("div",{style:{"--thumbnail-size":`${r?.size}px`,"--thumbnail-size-mobile":`${r?.sizeOnMobile??r?.size}px`,"--thumbnail-gap":`${r?.gap}px`,"--thumbnail-gap-mobile":`${r?.gapOnMobile??r?.gap}px`},className:"scrollbarThin ecr-admin-existing__body",children:s==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Tb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(nt,{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"})}),Rb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:s,togglingId:i,lastStoryElementRef:l})=>{const d=Se(),{requestLeave:c}=pc(),u=`?view=${K.cr}&from=${K.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(Or,{to:u,text:"Add Reel",Icon:gt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>c(()=>d(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:s&&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:i==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}`}),i==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(tt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),s&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=He(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=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})};i.displayName=t;const l=e+"CollectionSlot",d=rt(l),c=y.forwardRef((f,h)=>{const{scope:v,children:_}=f,w=s(l,v),j=Y(h,w.collectionRef);return a.jsx(d,{ref:j,children:_})});c.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=rt(u),g=y.forwardRef((f,h)=>{const{scope:v,children:_,...w}=f,j=y.useRef(null),C=Y(h,j),N=s(u,v);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:_})});g.displayName=u;function b(f){const h=s(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,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:i,Slot:c,ItemSlot:g},b,n]}var Lb=x.createContext(void 0);function ra(e){const t=x.useContext(Lb);return e||t||"ltr"}var na="rovingFocusGroup.onEntryFocus",Ib={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[oa,bc,zb]=xc(gr),[Mb,_c]=He(gr,[zb]),[Db,Fb]=Mb(gr),vc=x.forwardRef((e,t)=>a.jsx(oa.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(oa.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx($b,{...e,ref:t})})}));vc.displayName=gr;var $b=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...p}=e,m=x.useRef(null),g=Y(t,m),b=ra(s),[f,h]=lt({prop:i,defaultProp:l??null,onChange:d,caller:gr}),[v,_]=x.useState(!1),w=Ve(c),j=bc(r),C=x.useRef(!1),[N,k]=x.useState(0);return x.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(na,w),()=>E.removeEventListener(na,w)},[w]),a.jsx(Db,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:x.useCallback(E=>h(E),[h]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:x.useCallback(()=>k(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,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const P=!C.current;if(E.target===E.currentTarget&&P&&!v){const T=new CustomEvent(na,Ib);if(E.currentTarget.dispatchEvent(T),!T.defaultPrevented){const R=j().filter(z=>z.focusable),L=R.find(z=>z.active),I=R.find(z=>z.id===f),D=[L,I,...R].filter(Boolean).map(z=>z.ref.current);jc(D,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>_(!1))})})}),yc="RovingFocusGroupItem",wc=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...l}=e,d=Ne(),c=s||d,u=Fb(yc,r),p=u.currentTabStopId===c,m=bc(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:f}=u;return x.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),a.jsx(oa.ItemSlot,{scope:r,id:c,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(c):h.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:V(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){u.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const v=Hb(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?Vb(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:f!=null}):i})})});wc.displayName=yc;var Bb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ub(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hb(e,t,r){const n=Ub(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Bb[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 Vb(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Wb=vc,qb=wc,Nn="Tabs",[Gb]=He(Nn,[_c]),Sc=_c(),[Kb,aa]=Gb(Nn),Cc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:l,activationMode:d="automatic",...c}=e,u=ra(l),[p,m]=lt({prop:n,onChange:o,defaultProp:s??"",caller:Nn});return a.jsx(Kb,{scope:r,baseId:Ne(),value:p,onValueChange:m,orientation:i,dir:u,activationMode:d,children:a.jsx(W.div,{dir:u,"data-orientation":i,...c,ref:t})})});Cc.displayName=Nn;var kc="TabsList",Nc=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,s=aa(kc,r),i=Sc(r);return a.jsx(Wb,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Nc.displayName=kc;var Ec="TabsTrigger",Pc=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...s}=e,i=aa(Ec,r),l=Sc(r),d=Oc(i.baseId,n),c=Rc(i.baseId,n),u=n===i.value;return a.jsx(qb,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:d,...s,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=i.activationMode!=="manual";!u&&!o&&p&&i.onValueChange(n)})})})});Pc.displayName=Ec;var Tc="TabsContent",Ac=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:s,...i}=e,l=aa(Tc,r),d=Oc(l.baseId,n),c=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(Ke,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":d,hidden:!m,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&s})})});Ac.displayName=Tc;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var Yb=Cc,Xb=Nc,Jb=Pc,Zb=Ac;function Qb({className:e,...t}){return a.jsx(Yb,{"data-slot":"tabs",className:F("ecr-tabs",e),...t})}function e_({className:e,...t}){return a.jsx(Xb,{"data-slot":"tabs-list",className:F("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(Jb,{"data-slot":"tabs-trigger",className:F("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(Zb,{"data-slot":"tabs-content",className:F("ecr-tabs__content",e),...t})}function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function t_(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"}),r_="VisuallyHidden",n_=x.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));n_.displayName=r_;var o_=[" ","Enter","ArrowUp","ArrowDown"],a_=[" ","Enter"],dt="Select",[En,Pn,s_]=xc(dt),[Ft]=He(dt,[s_,nn]),Tn=nn(),[i_,Je]=Ft(dt),[l_,c_]=Ft(dt),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:i,defaultValue:l,onValueChange:d,dir:c,name:u,autoComplete:p,disabled:m,required:g,form:b}=e,f=Tn(t),[h,v]=x.useState(null),[_,w]=x.useState(null),[j,C]=x.useState(!1),N=ra(c),[k,E]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:dt}),[P,T]=lt({prop:i,defaultProp:l,onChange:d,caller:dt}),R=x.useRef(null),L=h?b||!!h.closest("form"):!0,[I,O]=x.useState(new Set),D=Array.from(I).map(z=>z.props.value).join(";");return a.jsx(Gi,{...f,children:a.jsxs(i_,{required:g,scope:t,trigger:h,onTriggerChange:v,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ne(),value:P,onValueChange:T,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:R,disabled:m,children:[a.jsx(En.Provider,{scope:t,children:a.jsx(l_,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(z=>{O(B=>new Set(B).add(z))},[]),onNativeOptionRemove:x.useCallback(z=>{O(B=>{const A=new Set(B);return A.delete(z),A})},[]),children:r})}),L?a.jsxs(sd,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:P,onChange:z=>T(z.target.value),disabled:m,form:b,children:[P===void 0?a.jsx("option",{value:""}):null,Array.from(I)]},D):null]})})};Dc.displayName=dt;var Fc="SelectTrigger",$c=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=Tn(r),i=Je(Fc,r),l=i.disabled||n,d=Y(t,i.onTriggerChange),c=Pn(r),u=x.useRef("touch"),[p,m,g]=ld(f=>{const h=c().filter(w=>!w.disabled),v=h.find(w=>w.value===i.value),_=cd(h,f,v);_!==void 0&&i.onValueChange(_.value)}),b=f=>{l||(i.onOpenChange(!0),g()),f&&(i.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Ro,{asChild:!0,...s,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":id(i.value)?"":void 0,...o,ref:d,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===" ")&&o_.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:s,placeholder:i="",...l}=e,d=Je(Bc,r),{onValueNodeHasChildrenChange:c}=d,u=s!==void 0,p=Y(t,d.onValueNodeChange);return se(()=>{c(u)},[c,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:id(d.value)?a.jsx(a.Fragment,{children:i}):s})});Uc.displayName=Bc;var d_="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=d_;var u_="SelectPortal",Vc=e=>a.jsx(on,{asChild:!0,...e});Vc.displayName=u_;var ut="SelectContent",Wc=x.forwardRef((e,t)=>{const r=Je(ut,e.__scopeSelect),[n,o]=x.useState();if(se(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?br.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(En.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=ut;var je=10,[qc,Ze]=Ft(ut),p_="SelectContentImpl",m_=rt("SelectContent.RemoveScroll"),Gc=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:d,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h,...v}=e,_=Je(ut,r),[w,j]=x.useState(null),[C,N]=x.useState(null),k=Y(t,$=>j($)),[E,P]=x.useState(null),[T,R]=x.useState(null),L=Pn(r),[I,O]=x.useState(!1),D=x.useRef(!1);x.useEffect(()=>{if(w)return Io(w)},[w]),xo();const z=x.useCallback($=>{const[te,...ce]=L().map(ne=>ne.ref.current),[J]=ce.slice(-1),Q=document.activeElement;for(const ne of $)if(ne===Q||(ne?.scrollIntoView({block:"nearest"}),ne===te&&C&&(C.scrollTop=0),ne===J&&C&&(C.scrollTop=C.scrollHeight),ne?.focus(),document.activeElement!==Q))return},[L,C]),B=x.useCallback(()=>z([E,w]),[z,E,w]);x.useEffect(()=>{I&&B()},[I,B]);const{onOpenChange:A,triggerPointerDownPosRef:q}=_;x.useEffect(()=>{if(w){let $={x:0,y:0};const te=J=>{$={x:Math.abs(Math.round(J.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(J.pageY)-(q.current?.y??0))}},ce=J=>{$.x<=10&&$.y<=10?J.preventDefault():w.contains(J.target)||A(!1),document.removeEventListener("pointermove",te),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",ce,{capture:!0})}}},[w,A,q]),x.useEffect(()=>{const $=()=>A(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[A]);const[X,Z]=ld($=>{const te=L().filter(Q=>!Q.disabled),ce=te.find(Q=>Q.ref.current===document.activeElement),J=cd(te,$,ce);J&&setTimeout(()=>J.ref.current.focus())}),me=x.useCallback(($,te,ce)=>{const J=!D.current&&!ce;(_.value!==void 0&&_.value===te||J)&&(P($),J&&(D.current=!0))},[_.value]),Fe=x.useCallback(()=>w?.focus(),[w]),ge=x.useCallback(($,te,ce)=>{const J=!D.current&&!ce;(_.value!==void 0&&_.value===te||J)&&R($)},[_.value]),$e=n==="popper"?sa:Kc,pt=$e===sa?{side:l,sideOffset:d,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:f,avoidCollisions:h}:{};return a.jsx(qc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:me,selectedItem:E,onItemLeave:Fe,itemTextRefCallback:ge,focusSelectedItem:B,selectedItemText:T,position:n,isPositioned:I,searchRef:X,children:a.jsx(fn,{as:m_,allowPinchZoom:!0,children:a.jsx(qr,{asChild:!0,trapped:_.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:V(o,$=>{_.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:a.jsx(Wr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:a.jsx($e,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:$=>$.preventDefault(),...v,...pt,onPlaced:()=>O(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:V(v.onKeyDown,$=>{const te=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!te&&$.key.length===1&&Z($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let J=L().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes($.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Q=$.target,ne=J.indexOf(Q);J=J.slice(ne+1)}setTimeout(()=>z(J)),$.preventDefault()}})})})})})})});Gc.displayName=p_;var f_="SelectItemAlignedPosition",Kc=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=Je(ut,r),i=Ze(ut,r),[l,d]=x.useState(null),[c,u]=x.useState(null),p=Y(t,k=>u(k)),m=Pn(r),g=x.useRef(!1),b=x.useRef(!0),{viewport:f,selectedItem:h,selectedItemText:v,focusSelectedItem:_}=i,w=x.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&c&&f&&h&&v){const k=s.trigger.getBoundingClientRect(),E=c.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(s.dir!=="rtl"){const Q=T.left-E.left,ne=P.left-Q,xe=k.left-ne,mt=k.width+xe,ga=Math.max(mt,E.width),xa=window.innerWidth-je,ba=zc(ne,[je,Math.max(je,xa-ga)]);l.style.minWidth=mt+"px",l.style.left=ba+"px"}else{const Q=E.right-T.right,ne=window.innerWidth-P.right-Q,xe=window.innerWidth-k.right-ne,mt=k.width+xe,ga=Math.max(mt,E.width),xa=window.innerWidth-je,ba=zc(ne,[je,Math.max(je,xa-ga)]);l.style.minWidth=mt+"px",l.style.right=ba+"px"}const R=m(),L=window.innerHeight-je*2,I=f.scrollHeight,O=window.getComputedStyle(c),D=parseInt(O.borderTopWidth,10),z=parseInt(O.paddingTop,10),B=parseInt(O.borderBottomWidth,10),A=parseInt(O.paddingBottom,10),q=D+z+I+A+B,X=Math.min(h.offsetHeight*5,q),Z=window.getComputedStyle(f),me=parseInt(Z.paddingTop,10),Fe=parseInt(Z.paddingBottom,10),ge=k.top+k.height/2-je,$e=L-ge,pt=h.offsetHeight/2,$=h.offsetTop+pt,te=D+z+$,ce=q-te;if(te<=ge){const Q=R.length>0&&h===R[R.length-1].ref.current;l.style.bottom="0px";const ne=c.clientHeight-f.offsetTop-f.offsetHeight,xe=Math.max($e,pt+(Q?Fe:0)+ne+B),mt=te+xe;l.style.height=mt+"px"}else{const Q=R.length>0&&h===R[0].ref.current;l.style.top="0px";const xe=Math.max(ge,D+f.offsetTop+(Q?me:0)+pt)+ce;l.style.height=xe+"px",f.scrollTop=te-ge+f.offsetTop}l.style.margin=`${je}px 0`,l.style.minHeight=X+"px",l.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,s.trigger,s.valueNode,l,c,f,h,v,s.dir,n]);se(()=>w(),[w]);const[j,C]=x.useState();se(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=x.useCallback(k=>{k&&b.current===!0&&(w(),_?.(),b.current=!1)},[w,_]);return a.jsx(g_,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:d,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=f_;var h_="SelectPopperPosition",sa=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=je,...s}=e,i=Tn(r);return a.jsx(Ki,{...i,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.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=h_;var[g_,ia]=Ft(ut,{}),la="SelectViewport",Yc=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=Ze(la,r),i=ia(la,r),l=Y(t,s.onViewportChange),d=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(En.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,c=>{const u=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=i;if(m?.current&&p){const g=Math.abs(d.current-u.scrollTop);if(g>0){const b=window.innerHeight-je*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")}}}d.current=u.scrollTop})})})]})});Yc.displayName=la;var Xc="SelectGroup",[x_,b_]=Ft(Xc),__=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ne();return a.jsx(x_,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});__.displayName=Xc;var Jc="SelectLabel",v_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=b_(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});v_.displayName=Jc;var An="SelectItem",[y_,Zc]=Ft(An),Qc=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...i}=e,l=Je(An,r),d=Ze(An,r),c=l.value===n,[u,p]=x.useState(s??""),[m,g]=x.useState(!1),b=Y(t,_=>d.itemRefCallback?.(_,n,o)),f=Ne(),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(y_,{scope:r,value:n,disabled:o,textId:f,isSelected:c,onItemTextChange:x.useCallback(_=>{p(w=>w||(_?.textContent??"").trim())},[]),children:a.jsx(En.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":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:b,onFocus:V(i.onFocus,()=>g(!0)),onBlur:V(i.onBlur,()=>g(!1)),onClick:V(i.onClick,()=>{h.current!=="mouse"&&v()}),onPointerUp:V(i.onPointerUp,()=>{h.current==="mouse"&&v()}),onPointerDown:V(i.onPointerDown,_=>{h.current=_.pointerType}),onPointerMove:V(i.onPointerMove,_=>{h.current=_.pointerType,o?d.onItemLeave?.():h.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(i.onPointerLeave,_=>{_.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:V(i.onKeyDown,_=>{d.searchRef?.current!==""&&_.key===" "||(a_.includes(_.key)&&v(),_.key===" "&&_.preventDefault())})})})})});Qc.displayName=An;var xr="SelectItemText",ed=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,i=Je(xr,r),l=Ze(xr,r),d=Zc(xr,r),c=c_(xr,r),[u,p]=x.useState(null),m=Y(t,v=>p(v),d.onItemTextChange,v=>l.itemTextRefCallback?.(v,d.value,d.disabled)),g=u?.textContent,b=x.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:h}=c;return se(()=>(f(b),()=>h(b)),[f,h,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:d.textId,...s,ref:m}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?br.createPortal(s.children,i.valueNode):null]})});ed.displayName=xr;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 ca="SelectScrollUpButton",nd=x.forwardRef((e,t)=>{const r=Ze(ca,e.__scopeSelect),n=ia(ca,e.__scopeSelect),[o,s]=x.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let l=function(){const c=d.scrollTop>0;s(c)};const d=r.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=r;l&&d&&(l.scrollTop=l.scrollTop-d.offsetHeight)}}):null});nd.displayName=ca;var da="SelectScrollDownButton",od=x.forwardRef((e,t)=>{const r=Ze(da,e.__scopeSelect),n=ia(da,e.__scopeSelect),[o,s]=x.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let l=function(){const c=d.scrollHeight-d.clientHeight,u=Math.ceil(d.scrollTop)<c;s(u)};const d=r.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=r;l&&d&&(l.scrollTop=l.scrollTop+d.offsetHeight)}}):null});od.displayName=da;var ad=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=Ze("SelectScrollButton",r),i=x.useRef(null),l=Pn(r),d=x.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return x.useEffect(()=>()=>d(),[d]),se(()=>{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,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{d()})})}),w_="SelectSeparator",j_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});j_.displayName=w_;var ua="SelectArrow",S_=x.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Tn(r),s=Je(ua,r),i=Ze(ua,r);return s.open&&i.position==="popper"?a.jsx(Yi,{...o,...n,ref:t}):null});S_.displayName=ua;var C_="SelectBubbleInput",sd=x.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=x.useRef(null),s=Y(n,o),i=t_(t);return x.useEffect(()=>{const l=o.current;if(!l)return;const d=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[i,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:s,defaultValue:t})});sd.displayName=C_;function id(e){return e===""||e===void 0}function ld(e){const t=Ve(e),r=x.useRef(""),n=x.useRef(0),o=x.useCallback(i=>{const l=r.current+i;t(l),(function d(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>d(""),1e3))})(l)},[t]),s=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=k_(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==r));const d=i.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return d!==r?d:void 0}function k_(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var N_=Dc,E_=$c,P_=Uc,T_=Hc,A_=Vc,O_=Wc,R_=Yc,L_=Qc,I_=ed,z_=rd,M_=nd,D_=od;function $t({...e}){return a.jsx(N_,{"data-slot":"select",...e})}function Bt({...e}){return a.jsx(P_,{"data-slot":"select-value",...e})}function Ut({className:e,size:t="default",children:r,...n}){return a.jsxs(E_,{"data-slot":"select-trigger","data-size":t,className:F("ecr-select__trigger",e),...n,children:[r,a.jsx(T_,{asChild:!0,children:a.jsx(fo,{className:"ecr-select__icon"})})]})}function Ht({className:e,children:t,position:r="popper",align:n="center",...o}){const s=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(A_,{container:s,children:a.jsxs(O_,{"data-slot":"select-content",className:F("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(F_,{}),a.jsx(R_,{className:F("ecr-select__viewport"),children:t}),a.jsx($_,{})]})})}function Vt({className:e,children:t,...r}){return a.jsxs(L_,{"data-slot":"select-item",className:F("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(z_,{children:a.jsx(Mf,{className:"ecr-select__check-icon"})})}),a.jsx(I_,{children:t})]})}function F_({className:e,...t}){return a.jsx(M_,{"data-slot":"select-scroll-up-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(Df,{className:"ecr-select__icon"})})}function $_({className:e,...t}){return a.jsx(D_,{"data-slot":"select-scroll-down-button",className:F("ecr-select__scroll-button",e),...t,children:a.jsx(fo,{className:"ecr-select__icon"})})}const B_=({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($t,{value:e,onValueChange:t,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsx(Ht,{children:Ku.map(r=>a.jsx(Vt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),U_={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 H_(){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($t,{defaultValue:Za[0].value,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsxs(Ht,{children:[Za.map(e=>a.jsx(Vt,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),qu.map(e=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(Jt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(pr,{name:e.label,text:U_[e.value]})})]})},e.value))]})]})]})}const V_=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(H_,{}),a.jsx(B_,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]}),On=({label:e,text:t})=>a.jsxs(Rt,{children:[a.jsx(Lt,{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(Jt,{size:20})]}),a.jsx(K0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(It,{className:"ecr-admin-popover",children:a.jsx(pr,{name:e,text:t})})]});var Rn="Collapsible",[W_]=He(Rn),[q_,pa]=W_(Rn),dd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:s,onOpenChange:i,...l}=e,[d,c]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:Rn});return a.jsx(q_,{scope:r,disabled:s,contentId:Ne(),open:d,onOpenToggle:x.useCallback(()=>c(u=>!u),[c]),children:a.jsx(W.div,{"data-state":fa(d),"data-disabled":s?"":void 0,...l,ref:t})})});dd.displayName=Rn;var ud="CollapsibleTrigger",pd=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=pa(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":fa(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ma="CollapsibleContent",md=x.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pa(ma,e.__scopeCollapsible);return a.jsx(Ke,{present:r||o.open,children:({present:s})=>a.jsx(G_,{...n,ref:t,present:s})})});md.displayName=ma;var G_=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...s}=e,i=pa(ma,r),[l,d]=x.useState(n),c=x.useRef(null),u=Y(t,c),p=x.useRef(0),m=p.current,g=x.useRef(0),b=g.current,f=i.open||l,h=x.useRef(f),v=x.useRef(void 0);return x.useEffect(()=>{const _=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(_)},[]),se(()=>{const _=c.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),d(n)}},[i.open,n]),a.jsx(W.div,{"data-state":fa(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!f,...s,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 fa(e){return e?"open":"closed"}var K_=dd,Y_=pd,X_=md;function fd({className:e,...t}){return a.jsx(K_,{"data-slot":"collapsible",className:F("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(Y_,{"data-slot":"collapsible-trigger",className:F("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(fo,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(X_,{"data-slot":"collapsible-content",className:F("ecr-collapsible__content",e),...t})}const J_=({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($t,{value:e,onValueChange:t,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsx(Ht,{children:Gu.map(r=>a.jsx(Vt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Z_=[{Icon:Vf,value:"desktop"},{Icon:qf,value:"mobile"}],xd=({label:e,min:t,max:r,value:n,onChange:o,name:s,id:i,wrapperStyles:l,hideSlider:d,device:c,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:i,className:"ecr-admin-range__label",children:[e,":",a.jsxs($t,{value:c,onValueChange:u,children:[a.jsx(Ut,{style:{padding:"4px 4px 0px",height:"24px",gap:"4px"},children:a.jsx(Bt,{})}),a.jsx(Ht,{style:{minWidth:"60px"},children:Z_.map(h=>a.jsx(Vt,{value:h.value,children:a.jsx(h.Icon,{size:16})},h.value))})]})]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!d&&a.jsx("input",{type:"range",id:i,name:s,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(Jo,{type:"number",min:t,max:r,value:p,onChange:h=>f(h.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})},Q_=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop");return a.jsx(xd,{label:"Gap",min:0,max:80,value:(r==="mobile"?e?.gapOnMobile:e?.gap)??16,onChange:r==="mobile"?o=>t(s=>({...s,gapOnMobile:o})):o=>t(s=>({...s,gap:o})),name:"column_gap",id:"column-gap",device:r,setDevice:n})},ev=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("desktop");return a.jsx(xd,{label:"Size",min:150,max:400,value:(r==="mobile"?e?.sizeOnMobile:e?.size)??150,onChange:r==="mobile"?o=>t(s=>({...s,sizeOnMobile:o})):o=>t(s=>({...s,size:o})),name:"size",id:"size",device:r,setDevice:n})},tv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],rv=({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:tv.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(qp,{color:"#2563eb",size:16}):a.jsx(Gp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},nv=Object.values(Ja),ov={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!"})},av=({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($t,{value:e,onValueChange:t,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsxs(Ht,{children:[nv.map(r=>a.jsx(Vt,{value:r,className:"ecr-admin-control__option",children:r},r)),Vu.map(r=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(Jt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(pr,{name:r,text:ov[r]})})]})},r))]})]})]}),sv=({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(Bf,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(rv,{selectedShape:r?.shape,handleShape:o=>n(s=>({...s,shape:o}))}),a.jsx(av,{selectedLayout:r?.template??"carousel",handleLayout:o=>n(s=>({...s,template:o}))}),a.jsx(J_,{linkLayout:r?.appearance??"overlay",handleLinkLayout:o=>n(s=>({...s,appearance:o}))}),a.jsx(ev,{styles:r,updateStyles:n}),a.jsx(Q_,{styles:r,updateStyles:n}),a.jsx(On,{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(On,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(On,{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(On,{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!"})})]})]}),iv=({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($t,{value:e,onValueChange:t,children:[a.jsx(Ut,{className:"ecr-admin-control__trigger",children:a.jsx(Bt,{placeholder:"Layout"})}),a.jsx(Ht,{children:Wu.map(r=>a.jsx(Vt,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),lv=({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(Wf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Zo,{label:"Border Width",min:0,max:12,value:r?.border?.border_width??0,onChange:o=>n(s=>({...s,border:{...s.border,border_width:o}})),name:"border_width",id:"border-width"}),a.jsx(dc,{selectedColor:r?.border?.border_color,handleColor:o=>n(s=>({...s,border:{...s.border,border_color:o}})),text:"Border Color"}),r?.shape==="rectangle"&&a.jsx(Zo,{label:"Border Radius",min:0,max:99,value:r?.border?.border_radius??0,onChange:o=>n(s=>({...s,border:{...s.border,border_radius:o}})),name:"border_radius",id:"border-radius"}),a.jsx(iv,{hoverEffect:r?.hoverEffect||"none",handleHoverEffect:o=>n(s=>({...s,hoverEffect:o}))})]})]}),cv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",s=r==="style",i=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(sv,{handleSectionOpen:i,isLayoutOpen:o,styles:e,updateStyles:t}),a.jsx(lv,{isStyleOpen:s,handleSectionOpen:i,styles:e,updateStyles:t})]})},dv=({styles:e,setStyles:t,isExpanded:r,setIsEdited:n,tabs:o,currentTab:s,setCurrentTab:i})=>{const l=c=>{t(u=>{const p=c(u);return n(!0),p})},d=c=>{(c===o.thumbnail||c===o.preview)&&i(c)};return a.jsxs("div",{className:F("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),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(Qb,{value:s,onValueChange:d,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(e_,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:o.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:o.preview,children:"Preview"})]}),a.jsx(Ic,{value:o.thumbnail,children:a.jsx(cv,{styles:e,updateStyles:l})}),a.jsx(Ic,{value:o.preview,children:a.jsx(V_,{styles:e,updateStyles:l})})]})})]})},uv=e=>{const t=Se(),[r,n]=y.useState(""),[o,s]=y.useState([]),[i,l]=y.useState(et),[d,c]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){c(!1);return}c(!0);try{const _=(await pe.get(`stories/${e}`)).data;n(_.group_name),s(_.stories),l(_.styles??et)}catch(v){v instanceof Error?G.error(v.message):G.error("Something went wrong. Try again later!")}finally{c(!1)}})()},[e]);const b=async h=>{const v=o.map(j=>j.id),_={group_name:r,styles:i,story_ids:v};e&&(_.group_id=e);const w=await pe.post("stories/manage-group-stories",_);if(!e){const j=w.data.group_id;t(`?view=${K.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:s,styles:i,setStyles:l,isLoading:d,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const h=await b();return g(!1),G.success("Changes saved successfully!"),h}catch(h){return h instanceof Error?G.error(h.message):G.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},pv=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),s=y.useRef(!1),i=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){i.current=m;return}if(s.current){s.current=!1,i.current=m;return}m!==i.current&&(o.current=m,window.location.hash=i.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,s.current=!0,p();return}if(o.current){const p=o.current;o.current=null,s.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{s.current=!0,p()}}},bd={thumbnail:"thumbnail",preview:"preview"},mv=()=>{const e=Se(),{state:t}=Kt(),[r]=Yt(),n=r.get("gid"),{groupTitle:o,setGroupTitle:s,thisGroupReels:i,setThisGroupReels:l,styles:d,setStyles:c,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:b}=uv(n),{allReels:f,setAllReels:h,searchTerm:v,setSearchTerm:_,isSearching:w,lastStoryElementRef:j}=Zs(n),[C,N]=y.useState(""),[k,E]=y.useState(!0),[P,T]=y.useState(bd.thumbnail),{showLeaveModal:R,requestLeave:L,confirmLeave:I,cancelLeave:O,allowNextNavigation:D}=pv(m),z=async(A,q)=>{try{N(A.story_uuid);const X=q==="add"?[A,...i]:i.filter(Z=>Z.story_uuid!==A.story_uuid);l(X),h(q==="add"?Z=>Z.filter(me=>me.story_uuid!==A.story_uuid):Z=>[...Z,A]),g(!0)}catch(X){X instanceof Error?G.error(X.message):G.error("Something went wrong. Please try again later!")}finally{N("")}};y.useEffect(()=>{if(!u&&t){const A=f.findIndex(q=>q.id==t.storyId);if(A!==-1){const q=f[A];h(X=>X.filter(Z=>Z.id!=q.id)),l(X=>[q,...X]),g(!0)}}},[t,f,u,h,l,g]);const B=async()=>{const A=await b();A?.isNewGroup&&D(()=>{e(`?view=${K.mg}&gid=${A.group_id}`,{replace:!0})})};return u?a.jsx(Rr,{}):a.jsxs(Sb,{value:{requestLeave:L},children:[a.jsx(_t,{left:[a.jsx(vt,{name:"Manage Widget",Icon:Tr},"page"),a.jsx(tr,{cb:()=>L(()=>e(`?view=${K.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Qs,{placeholder:"Enter group title",title:o,setTitle:s,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Vo,{children:[a.jsx(Wo,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(X0,{})}),a.jsxs(qo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Go,{children:a.jsx(Ko,{children:"Customize title appearance"})}),a.jsx(yb,{styles:d,setStyles:c,setIsEdited:g}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(w0,{asChild:!0,children:a.jsx(re,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(Y0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(uo,{onSave:B,isSaving:p,disabled:!m},"save")]}),a.jsx(rr,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Manage Widget"}],onNavigate:A=>L(()=>e(A))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Rb,{allReels:f,gid:n,handleSelectReel:z,searchTerm:v,setSearchTerm:_,isSearching:w,togglingId:C,lastStoryElementRef:j}),a.jsx(Ob,{gid:n,reels:i,styles:d,handleRemoveReel:z,togglingId:C,currentTab:P}),a.jsx(dv,{isExpanded:k,setIsEdited:g,styles:d,setStyles:c,tabs:bd,setCurrentTab:T,currentTab:P})]}),R&&a.jsx(Ar,{onReject:O,onAccept:I,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function fv(){const[e]=Yt(),t=e.get("view")||K.ag;let r;switch(t){case K.settings:r=a.jsx(H0,{});break;case K.ar:r=a.jsx(Cf,{});break;case K.stat:r=a.jsx(q0,{});break;case K.cr:r=a.jsx(R0,{});break;case K.mg:r=a.jsx(mv,{});break;default:r=a.jsx(B0,{})}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 pe.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"),hv=()=>{const e=y.useContext(ha);if(!e)throw new Error("useVideoPlayer must be used inside PublicStoryContext");const{styles:t,stories:r,groupId:n,isPlaying:o,setIsPlaying:s,setStoryViews:i}=e,[l,d]=y.useState(r.length-1),[c,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=c?.links&&c.links.length>0?c.links[0]:null,j=t?.playerAppearance??"overlay",C=y.useRef(""),N=y.useCallback((I,O=1)=>{if(r.length===0)return null;let D=I;for(let z=0;z<r.length;z+=1){const B=r[D];if(vd(B))return{story:B,index:D};D=(D+O+r.length)%r.length}return null},[r]),k=y.useCallback(()=>{d(r.length-1);const I=r.findIndex(z=>String(z.story_uuid)===o),O=I>=0?r[I]:null,D=vd(O)?{story:O,index:I}:N(Math.max(I,0),1);if(!D?.story){u(null),m(!1);return}u(D.story),I!==D.index&&D.story.story_uuid!==o&&s(D.story.story_uuid),_({index:0,story_uuid:D.story.story_uuid}),m(!1)},[N,o,s,r]);y.useEffect(()=>{k()},[k]),y.useEffect(()=>(C.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=C.current}),[]);const E=y.useCallback(()=>{s(null)},[s]),P=y.useCallback((I=1)=>{m(!0);const O=r.findIndex(q=>String(q.story_uuid)===String(o)),D=I>0?1:-1,z=I>0?l>O?O+1:0:O>0?O-1:l,B=N(z,D);if(!B?.story){m(!1);return}const A=B.story;if(A.story_uuid===o){m(!1),E();return}_({index:0,story_uuid:A.story_uuid}),n&&_d(n,A.id,i),s(A.story_uuid),m(!1)},[E,N,n,o,l,s,i,r]),T=y.useCallback(()=>{const I=c?.files??[];if(v.index>0){_(O=>({index:O.index-1,story_uuid:I[O.index-1].story_uuid??""}));return}P(-1)},[v.index,P,c?.files]),R=y.useCallback(()=>{const I=c?.files??[];if(v.index+1<I.length){_(O=>({index:O.index+1,story_uuid:I[O.index+1].story_uuid??""}));return}P(1)},[v.index,P,c?.files]),L=y.useCallback(I=>{I.target===I.currentTarget&&E()},[E]);return{closePlayer:E,currentFileIndex:v,duration:g,handleBackdropClick:L,handleNextFile:R,handlePrevFile:T,isLoadingNext:p,isPaused:f,playingStory:c,setDuration:b,setIsPaused:h,setIsPlaying:s,firstLink:w,playerAppearance:j}},gv=()=>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"})]})})}),xv=()=>{const{closePlayer:e,currentFileIndex:t,duration:r,handleBackdropClick:n,handleNextFile:o,handlePrevFile:s,isLoadingNext:i,isPaused:l,playerAppearance:d,playingStory:c,firstLink:u,setDuration:p,setIsPaused:m,setIsPlaying:g}=hv();return a.jsx("div",{onClick:n,className:"ecommreels-story-modal ecr-player",children:c&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(xt,{onClick:s,className:"ecr-player__nav--left",children:a.jsx(Zt,{size:24})}),a.jsx(xt,{onClick:o,className:"ecr-player__nav--right",children:a.jsx(Qt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[c&&a.jsx(ss,{playingStory:c,duration:r,currentFileIndex:t,isPaused:l},`${c.story_uuid}-${t.index}`),a.jsx("div",{onClick:e,className:"ecr-player__close",children:a.jsx(er,{className:"ecr-player__close-icon"})}),i?a.jsx(gv,{}):c?.files.length>0&&a.jsx(ds,{currentFileIndex:t,files:c?.files,setDuration:p,setIsPlaying:g,isPaused:l,setIsPaused:m,handlePrevFile:s,handleNextFile:o,storyId:c.id,storyTitle:c?.title}),d==="overlay"&&u?a.jsx(Cn,{link:u,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,d==="title"?a.jsx(kn,{title:c.title}):null]})]})})},yd=({story:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const s=e.links&&e.links.length>0?e.links[0]:null,i=t.appearance??"overlay";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(Jn,{story:e,styles:t,storyViews:n,setStoryViews:o}),i==="overlay"&&t.shape==="rectangle"?s?a.jsx(Cn,{link:s,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}):a.jsx(kn,{title:e.title}):null]}),i==="title"?a.jsx("p",{className:"ecr-reel__title",children:e.title}):null]})},bv=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:l,canScrollLeft:d,canScrollRight:c,scrollBy:u,scrollStep:p}=fc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:s,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:i,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&&d&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Zt,{size:20,style:{width:"20px",height:"20px"}})}),l&&c&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Qt,{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(s=>s?.files[0]?.mime_type.startsWith("video")?a.jsx(yd,{story:s,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o},s.story_uuid):null)})}),_v={carousel:bv,grid:wd},vv=()=>{const e=y.useContext(ha),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:s,storyViews:i,setStoryViews:l}=e,d=y.useRef(!0);y.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);const c=r.template??"carousel",u=_v[c]||wd,p=({sid:m,story_uuid:g})=>{s(g),o&&_d(o,m,l,{isActive:()=>d.current})};return a.jsxs("div",{style:{"--thumbnail-size":r.template==="grid"?"auto":`${r?.size}px`,"--thumbnail-size-grid":`${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-mobile":`${r?.gapOnMobile??r?.gap}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:i,setStoryViews:l})]})},yv=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[s,i]=y.useState(et),[l,d]=y.useState(!1),[c,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),i(et),d(!1),u(null);return}const g=new AbortController;d(!0),u(null);try{const b=await pe.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(b.data.group_name),o(b.data.stories),i(b.data.styles||et)}catch(b){if(g.signal.aborted)return;u(b)}finally{d(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:s,isLoading:l,error:c}},ha=y.createContext(void 0),jd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:s,stories:i,styles:l}=yv(e);return a.jsxs(ha.Provider,{value:{groupTitle:s,groupId:e,stories:i,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(xv,{}),a.jsx(vv,{})]})};_a(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Ln.createRoot(e).render(a.jsx(Zd,{children:a.jsx(fv,{})}))}),_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;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Ln.createRoot(n).render(a.jsx(jd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM); -
ecomm-reels/trunk/ecomm-reels.php
r3452800 r3454572 3 3 * Plugin Name: ReelsWp - Shoppable Videos & Vertical Reels Carousels 4 4 * 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.0.1 05 * Version: 4.0.11 6 6 * Requires at least: 5.8 7 7 * Requires PHP: 7.4 … … 20 20 define('ECOMMREELS_ASSETS', plugins_url('/', __FILE__)); 21 21 define('ECOMMREELS_FILE_PREFIX', 'class-'); 22 define('WP_REELS_VER', '4.0.1 0');22 define('WP_REELS_VER', '4.0.11'); 23 23 24 24 // 1) Composer autoloader (optional, guarded) -
ecomm-reels/trunk/readme.txt
r3452800 r3454572 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 4.0.1 07 Stable tag: 4.0.11 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 100 100 == Changelog == 101 101 102 = 4.0.11 - 2026-02-05 = 103 - New: Added multiple reel delete functionality for easier bulk management. 104 - New: Added responsive controls for adjusting size and spacing across desktop and mobile screen sizes. 105 102 106 = 4.0.10 - 2026-02-03 = 103 107 - New: Added a documentation link for easier access to setup and usage guides.
Note: See TracChangeset
for help on using the changeset viewer.